diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-08 23:23:59 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-08 23:23:59 +0900 |
commit | e2e3518bb6dca73d6c1b9bd80c03bbfd50d1811f (patch) | |
tree | 45b0d3e286b1540f38f249fc9549b617922e49cd /common/fmplayer_drumrom_win.c | |
parent | bee86e7dacdc2fffd80618be74c00acb457664c7 (diff) |
common: win32: use explicit UTF-16 (FooW) functions
Diffstat (limited to 'common/fmplayer_drumrom_win.c')
-rw-r--r-- | common/fmplayer_drumrom_win.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/common/fmplayer_drumrom_win.c b/common/fmplayer_drumrom_win.c index aab4546..c3c4e36 100644 --- a/common/fmplayer_drumrom_win.c +++ b/common/fmplayer_drumrom_win.c @@ -3,6 +3,7 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <shlwapi.h> +#include <wchar.h> static struct { char drum_rom[OPNA_ROM_SIZE]; bool loaded; @@ -11,15 +12,15 @@ static struct { static void loadrom(void) { const wchar_t *path = L"ym2608_adpcm_rom.bin"; wchar_t exepath[MAX_PATH]; - if (GetModuleFileName(0, exepath, MAX_PATH)) { - PathRemoveFileSpec(exepath); - if ((lstrlen(exepath) + lstrlen(path) + 1) < MAX_PATH) { - lstrcat(exepath, L"\\"); - lstrcat(exepath, path); + if (GetModuleFileNameW(0, exepath, MAX_PATH)) { + PathRemoveFileSpecW(exepath); + if ((wcslen(exepath) + wcslen(path) + 1) < MAX_PATH) { + wcscat(exepath, L"\\"); + wcscat(exepath, path); path = exepath; } } - HANDLE file = CreateFile(path, GENERIC_READ, + HANDLE file = CreateFileW(path, GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (file == INVALID_HANDLE_VALUE) goto err; DWORD filesize = GetFileSize(file, 0); |