kernel32: Fix Garant 7.4.1 installation (eterbug #5345)
authorVitaly Perov <vitperov@etersoft.ru>
Thu, 15 Apr 2010 13:27:55 +0000 (17:27 +0400)
committerDenis Baranov <baraka@etersoft.ru>
Fri, 16 Apr 2010 10:12:01 +0000 (14:12 +0400)
dlls/kernel32/module.c

index 3df42cc5865336884c096e8b65824e76201e9ff5..b7e6305baedd88012c9c21a74167bef5ba316fa9 100644 (file)
@@ -486,6 +486,13 @@ BOOL WINAPI GetModuleHandleExA( DWORD flags, LPCSTR name, HMODULE *module )
 {
     WCHAR *nameW;
 
+    /* Eterhack for bug #5345 Installation of Garant 7.4.1 */
+    if (name && name < 0x10000)
+    {
+        ERR("Invalid address 0x%x. Eterhack: return 0\n", name);
+        return 0;
+    }
+
     if (!name || (flags & GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS))
         return GetModuleHandleExW( flags, (LPCWSTR)name, module );