kernel32: Handle the case where the 16-bit module is already loaded also for separated dlls.
diff --git a/dlls/kernel32/ne_module.c b/dlls/kernel32/ne_module.c
index 8f22ccb..273eb9e 100644
--- a/dlls/kernel32/ne_module.c
+++ b/dlls/kernel32/ne_module.c
@@ -1119,16 +1119,6 @@
FreeLibrary( mod32 );
owner_exists = 0;
}
- /* loading the 32-bit library can have the side effect of loading the module */
- /* if so, simply incr the ref count and return the module */
- if ((hModule = GetModuleHandle16( libname )))
- {
- TRACE( "module %s already loaded by owner\n", libname );
- pModule = NE_GetPtr( hModule );
- if (pModule) pModule->count++;
- FreeLibrary( mod32 );
- return hModule;
- }
}
else
{
@@ -1137,6 +1127,16 @@
return ERROR_FILE_NOT_FOUND;
}
}
+ /* loading the 32-bit library can have the side effect of loading the module */
+ /* if so, simply incr the ref count and return the module */
+ if (descr && (hModule = GetModuleHandle16( libname )))
+ {
+ TRACE( "module %s already loaded by owner\n", libname );
+ pModule = NE_GetPtr( hModule );
+ if (pModule) pModule->count++;
+ FreeLibrary( mod32 );
+ return hModule;
+ }
}
if (descr)