# HG changeset patch # User reimar # Date 1266524585 0 # Node ID 0dbb798e67b09fb050f97c2d72457e7a1226665d # Parent 8806ec11a25087980fad9e2e840a442ad7a32bb7 Add a GetModuleHandleW implementation. diff -r 8806ec11a250 -r 0dbb798e67b0 loader/win32.c --- a/loader/win32.c Thu Feb 18 20:20:23 2010 +0000 +++ b/loader/win32.c Thu Feb 18 20:23:05 2010 +0000 @@ -596,6 +596,19 @@ 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 @@ FF(UnmapViewOfFile, -1) FF(Sleep, -1) FF(GetModuleHandleA, -1) + FF(GetModuleHandleW, -1) FF(GetProfileIntA, -1) FF(GetPrivateProfileIntA, -1) FF(GetPrivateProfileStringA, -1)