summaryrefslogtreecommitdiff
path: root/src/share/win_utf8_io/win_utf8_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/win_utf8_io/win_utf8_io.c')
-rw-r--r--src/share/win_utf8_io/win_utf8_io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
index b32db3c7..d8736e16 100644
--- a/src/share/win_utf8_io/win_utf8_io.c
+++ b/src/share/win_utf8_io/win_utf8_io.c
@@ -307,3 +307,16 @@ int rename_utf8(const char *oldname, const char *newname)
return ret;
}
+
+HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
+{
+ wchar_t *wname;
+ HANDLE handle = INVALID_HANDLE_VALUE;
+
+ if ((wname = wchar_from_utf8(lpFileName)) != NULL) {
+ handle = CreateFileW(wname, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
+ free(wname);
+ }
+
+ return handle;
+}