Robert Shearman : urlmon: Delay-load cabinet.dll as native urlmon doesn' t import it.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 4 14:57:26 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 4582a2bb8e43937bb5a5f555b40c0b744a2d45fd
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=4582a2bb8e43937bb5a5f555b40c0b744a2d45fd

Author: Robert Shearman <rob at codeweavers.com>
Date:   Fri Aug  4 12:55:37 2006 +0100

urlmon: Delay-load cabinet.dll as native urlmon doesn't import it.

---

 dlls/urlmon/Makefile.in   |    2 +-
 dlls/urlmon/urlmon.spec   |    2 +-
 dlls/urlmon/urlmon_main.c |   21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/dlls/urlmon/Makefile.in b/dlls/urlmon/Makefile.in
index b54592d..0546bdb 100644
--- a/dlls/urlmon/Makefile.in
+++ b/dlls/urlmon/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = urlmon.dll
 IMPORTLIB = liburlmon.$(IMPLIBEXT)
-IMPORTS   = cabinet ole32 shlwapi wininet user32 advapi32 kernel32 ntdll
+IMPORTS   = ole32 shlwapi wininet user32 advapi32 kernel32 ntdll
 EXTRALIBS = -luuid
 
 C_SRCS = \
diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec
index 46e5f28..7821486 100644
--- a/dlls/urlmon/urlmon.spec
+++ b/dlls/urlmon/urlmon.spec
@@ -32,7 +32,7 @@ #3 stub IsJITInProgress
 @ stdcall -private DllRegisterServer()
 @ stdcall -private DllRegisterServerEx()
 @ stdcall -private DllUnregisterServer()
-@ stdcall Extract(long ptr) cabinet.Extract
+@ stdcall Extract(long ptr)
 @ stdcall FaultInIEFeature(long ptr ptr long)
 @ stub FindMediaType
 @ stub FindMediaTypeClass
diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c
index f4c51d8..953553d 100644
--- a/dlls/urlmon/urlmon_main.c
+++ b/dlls/urlmon/urlmon_main.c
@@ -41,6 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
 LONG URLMON_refCount = 0;
 
 HINSTANCE URLMON_hInstance = 0;
+static HMODULE hCabinet = NULL;
 
 DWORD urlmon_tls = 0;
 
@@ -63,6 +64,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, 
     case DLL_PROCESS_DETACH:
         if(urlmon_tls)
             TlsFree(urlmon_tls);
+        if (hCabinet)
+            FreeLibrary(hCabinet);
+        hCabinet = NULL;
         init_session(FALSE);
         URLMON_hInstance = 0;
 	break;
@@ -597,3 +601,20 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC
 
     return E_FAIL;
 }
+
+/***********************************************************************
+ * Extract (URLMON.@)
+ */
+HRESULT WINAPI Extract(void *dest, LPCSTR szCabName)
+{
+    HRESULT (WINAPI *pExtract)(void *, LPCSTR);
+
+    if (!hCabinet)
+        hCabinet = LoadLibraryA("cabinet.dll");
+
+    if (!hCabinet) return HRESULT_FROM_WIN32(GetLastError());
+    pExtract = (void *)GetProcAddress(hCabinet, "Extract");
+    if (!pExtract) return HRESULT_FROM_WIN32(GetLastError());
+
+    return pExtract(dest, szCabName);
+}




More information about the wine-cvs mailing list