diff options
Diffstat (limited to 'loader')
-rw-r--r-- | loader/win32.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/loader/win32.c b/loader/win32.c index 8e314d5935..100c1f3c89 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -596,6 +596,19 @@ static HMODULE WINAPI expGetModuleHandleA(const char* name) return result; } +static HMODULE WINAPI expGetModuleHandleW(const uint16_t* name) +{ + char aname[256]; + int pos = 0; + while (*name) { + if (*name > 256 || pos >= sizeof(aname) - 1) + return NULL; + aname[pos++] = *name++; + } + aname[pos] = 0; + return expGetModuleHandleA(aname); +} + static void* WINAPI expCreateThread(void* pSecAttr, long dwStackSize, void* lpStartAddress, void* lpParameter, long dwFlags, long* dwThreadId) @@ -5030,6 +5043,7 @@ struct exports exp_kernel32[]= FF(UnmapViewOfFile, -1) FF(Sleep, -1) FF(GetModuleHandleA, -1) + FF(GetModuleHandleW, -1) FF(GetProfileIntA, -1) FF(GetPrivateProfileIntA, -1) FF(GetPrivateProfileStringA, -1) |