LoadLibraryEx returns null on error

Returning <= HINSTANCE_ERROR (aka 32) on error was apparently a feature of
LoadLibrary in 16-bit Windows 3 times.

Change-Id: Idf9fbd84ac1fadb67449968b65cd5e8e391a39f2
Reviewed-on: https://gerrit.libreoffice.org/29752
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2016-10-13 10:53:53 +02:00
parent a8fa87913f
commit c236c8e88a

View File

@ -72,7 +72,7 @@ char* UnicodeToAnsiString( wchar_t* pUniString )
void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit )
{
HINSTANCE hModule = LoadLibraryExA( pActiveXPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH );
if( !( hModule <= ( HINSTANCE )HINSTANCE_ERROR ) )
if( hModule )
{
DllNativeRegProc pNativeProc = ( DllNativeRegProc )GetProcAddress( hModule, "DllRegisterServerNative" );
if( pNativeProc!=NULL )
@ -99,7 +99,7 @@ void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallFor
void UnregisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit )
{
HINSTANCE hModule = LoadLibraryExA( pActiveXPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH );
if( !( hModule <= ( HINSTANCE )HINSTANCE_ERROR ) )
if( hModule )
{
DllNativeUnregProc pNativeProc = ( DllNativeUnregProc )GetProcAddress( hModule, "DllUnregisterServerNative" );
if( pNativeProc!=NULL )