Commit 0f6efae8 authored by Jess Haas's avatar Jess Haas Committed by Alexandre Julliard

Fixed GetModuleHandle16.

parent dbfdca8b
...@@ -1225,19 +1225,12 @@ DWORD WINAPI WIN16_GetModuleHandle( SEGPTR name ) ...@@ -1225,19 +1225,12 @@ DWORD WINAPI WIN16_GetModuleHandle( SEGPTR name )
HMODULE16 WINAPI GetModuleHandle16( LPCSTR name ) HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )
{ {
HMODULE16 hModule = hFirstModule; HMODULE16 hModule = hFirstModule;
LPCSTR filename, dotptr; LPCSTR dotptr;
BYTE len, *name_table; BYTE len, *name_table;
if (!(filename = strrchr( name, '\\' ))) if ((dotptr = strrchr( name, '.' )) != NULL)
filename = name; len = (BYTE)(dotptr - name);
else else len = strlen( name );
{
FIXME(module,"illegal usage of GetModuleHandle16\n");
filename++;
}
if ((dotptr = strrchr( filename, '.' )) != NULL)
len = (BYTE)(dotptr - filename);
else len = strlen( filename );
while (hModule) while (hModule)
{ {
...@@ -1250,11 +1243,11 @@ HMODULE16 WINAPI GetModuleHandle16( LPCSTR name ) ...@@ -1250,11 +1243,11 @@ HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )
if (!(modulename = strrchr( modulepath, '\\' ))) if (!(modulename = strrchr( modulepath, '\\' )))
modulename = modulepath; modulename = modulepath;
else modulename++; else modulename++;
if (!lstrcmpiA( modulename, filename )) return hModule; if (!lstrcmpiA( modulename, name )) return hModule;
*/ */
name_table = (BYTE *)pModule + pModule->name_table; name_table = (BYTE *)pModule + pModule->name_table;
if ((*name_table == len) && !lstrncmpiA(filename, name_table+1, len)) if ((*name_table == len) && !lstrncmpiA(name, name_table+1, len))
return hModule; return hModule;
hModule = pModule->next; hModule = pModule->next;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment