[MPlayer-cvslog] r30639 - trunk/loader/win32.c

reimar subversion at mplayerhq.hu
Thu Feb 18 21:23:05 CET 2010


Author: reimar
Date: Thu Feb 18 21:23:05 2010
New Revision: 30639

Log:
Add a GetModuleHandleW implementation.

Modified:
   trunk/loader/win32.c

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	Thu Feb 18 21:20:23 2010	(r30638)
+++ trunk/loader/win32.c	Thu Feb 18 21:23:05 2010	(r30639)
@@ -596,6 +596,19 @@ static HMODULE WINAPI expGetModuleHandle
     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)


More information about the MPlayer-cvslog mailing list