urlmon: Delay-load cabinet.dll as native urlmon doesn't import it.
This commit is contained in:
parent
c340ddd310
commit
4582a2bb8e
|
@ -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 = \
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
@ 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
|
||||
|
|
|
@ -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, DWORD fdwReason, LPVOID fImpLoad)
|
|||
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, LPCWSTR pwzUrl, LPVOID pBuffer,
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue