From e2e3518bb6dca73d6c1b9bd80c03bbfd50d1811f Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Fri, 8 Sep 2017 23:23:59 +0900 Subject: common: win32: use explicit UTF-16 (FooW) functions --- common/fmplayer_drumrom_win.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'common/fmplayer_drumrom_win.c') 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 #include +#include 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); -- cgit v1.2.3