summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormunkyu.im <munkyu.im@samsung.com>2012-03-07 15:59:04 +0900
committermunkyu.im <munkyu.im@samsung.com>2012-03-07 15:59:04 +0900
commite7d7ae166f491e8716d931177f9b527479e85541 (patch)
tree6735b455ec2889e10f4b3a37e41be7bcdbadc390
parent146ee5c274d301613e1dfea88528d8127cba0909 (diff)
downloadqemu-e7d7ae166f491e8716d931177f9b527479e85541.tar.gz
qemu-e7d7ae166f491e8716d931177f9b527479e85541.tar.bz2
qemu-e7d7ae166f491e8716d931177f9b527479e85541.zip
[Title]convert utf8 to cp949 (CreateFile)
[Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase]
-rw-r--r--block/raw-win32.c6
-rw-r--r--net/tap-win32.c2
-rw-r--r--os-win32.c2
-rw-r--r--qemu-char.c5
4 files changed, 9 insertions, 6 deletions
diff --git a/block/raw-win32.c b/block/raw-win32.c
index e4b0b75b70..0bbc41bd51 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -96,7 +96,8 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
overlapped |= FILE_FLAG_NO_BUFFERING;
if (!(flags & BDRV_O_CACHE_WB))
overlapped |= FILE_FLAG_WRITE_THROUGH;
- s->hfile = CreateFile(filename, access_flags,
+ s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename),
+ access_flags,
FILE_SHARE_READ, NULL,
OPEN_EXISTING, overlapped, NULL);
if (s->hfile == INVALID_HANDLE_VALUE) {
@@ -386,7 +387,8 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
overlapped |= FILE_FLAG_NO_BUFFERING;
if (!(flags & BDRV_O_CACHE_WB))
overlapped |= FILE_FLAG_WRITE_THROUGH;
- s->hfile = CreateFile(filename, access_flags,
+ s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename),
+ access_flags,
FILE_SHARE_READ, NULL,
create_flags, overlapped, NULL);
if (s->hfile == INVALID_HANDLE_VALUE) {
diff --git a/net/tap-win32.c b/net/tap-win32.c
index 596132e272..b859b4c3e0 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -593,7 +593,7 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
TAPSUFFIX);
handle = CreateFile (
- device_path,
+ g_win32_locale_filename_from_utf8(device_path),
GENERIC_READ | GENERIC_WRITE,
0,
0,
diff --git a/os-win32.c b/os-win32.c
index 8ad5fa1fc3..444cf70cba 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -129,7 +129,7 @@ int qemu_create_pidfile(const char *filename)
BOOL ret;
memset(&overlap, 0, sizeof(overlap));
- file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+ file = CreateFile(g_win32_locale_filename_from_utf8(filename), GENERIC_WRITE, FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (file == INVALID_HANDLE_VALUE) {
diff --git a/qemu-char.c b/qemu-char.c
index 27abcb9186..6c9eee53c3 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1523,7 +1523,8 @@ static int win_chr_init(CharDriverState *chr, const char *filename)
goto fail;
}
- s->hcom = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL,
+ s->hcom = CreateFile(g_win32_locale_filename_from_utf8(filename),
+ GENERIC_READ|GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
if (s->hcom == INVALID_HANDLE_VALUE) {
fprintf(stderr, "Failed CreateFile (%lu)\n", GetLastError());
@@ -1813,7 +1814,7 @@ static int qemu_chr_open_win_file_out(QemuOpts *opts, CharDriverState **_chr)
const char *file_out = qemu_opt_get(opts, "path");
HANDLE fd_out;
- fd_out = CreateFile(file_out, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+ fd_out = CreateFile(g_win32_locale_filename_from_utf8(file_out), GENERIC_WRITE, FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (fd_out == INVALID_HANDLE_VALUE) {
return -EIO;