Author: mturk
Date: Mon Dec 14 06:03:49 2009
New Revision: 890189

URL: http://svn.apache.org/viewvc?rev=890189&view=rev
Log:
Use private dll loader

Modified:
    
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c

Modified: 
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=890189&r1=890188&r2=890189&view=diff
==============================================================================
--- 
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h 
(original)
+++ 
commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h 
Mon Dec 14 06:03:49 2009
@@ -611,6 +611,7 @@
 /* Define ACR_WANT_LATE_DLL before including this file */
 #if defined(ACR_WANT_LATE_DLL)
 
+HMODULE acr_load_dll(acr_dlltoken_e);
 FARPROC acr_load_dll_func(acr_dlltoken_e, const char *, int);
 
 /* The acr_load_dll_func call WILL return def if the function cannot be loaded 
*/

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c?rev=890189&r1=890188&r2=890189&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/dhtml.c Mon Dec 14 
06:03:49 2009
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#define ACR_WANT_LATE_DLL
 #include "acr.h"
 #include "acr_private.h"
 #include "acr_arch.h"
@@ -64,7 +65,7 @@
     if (!pfnShowHTMLDialog) {
         HMODULE gui_hMSHTML;
 
-        gui_hMSHTML = LoadLibraryA("mshtml.dll");
+        gui_hMSHTML = acr_load_dll(SYSDLL_MSHTML);
         if (IS_INVALID_HANDLE(gui_hMSHTML))
             goto cleanup;
 

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
URL: 
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=890189&r1=890188&r2=890189&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Mon Dec 14 
06:03:49 2009
@@ -194,6 +194,21 @@
     NULL
 };
 
+HMODULE acr_load_dll(acr_dlltoken_e fnLib)
+{
+    if (!late_dll_handles[fnLib]) {
+        /* First see if the .dll is already loaded in the process */
+        late_dll_handles[fnLib] = GetModuleHandleA(late_dll_names[fnLib]);
+        if (!late_dll_handles[fnLib]) {
+            /* Do not display error messages when loading library */
+            UINT em = SetErrorMode(SEM_FAILCRITICALERRORS);
+            late_dll_handles[fnLib] = LoadLibraryA(late_dll_names[fnLib]);
+            SetErrorMode(em);
+        }
+    }    
+    return late_dll_handles[fnLib];
+}
+
 FARPROC acr_load_dll_func(acr_dlltoken_e fnLib, const char* fnName, int undec)
 {
     FARPROC fp = NULL;


Reply via email to