[Libreoffice-commits] core.git: setup_native/source

Stephan Bergmann sbergman at redhat.com
Thu Oct 13 09:52:38 UTC 2016


 setup_native/source/win32/customactions/regactivex/regactivex.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c236c8e88a6d3e30cc4acc9108cbce018ca872cc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Oct 13 10:53:53 2016 +0200

    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 at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx
index bf33f71..b437318 100644
--- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx
+++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx
@@ -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 )


More information about the Libreoffice-commits mailing list