Commit ad59a006 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

setupapi: Link directly to cabinet.

parent 85afec5f
......@@ -2,7 +2,7 @@ EXTRADEFS = -D_SETUPAPI_
MODULE = setupapi.dll
IMPORTLIB = setupapi
IMPORTS = uuid version advapi32 rpcrt4 kernelbase
DELAYIMPORTS = shell32 wintrust ole32 winspool.drv comdlg32 user32
DELAYIMPORTS = cabinet shell32 wintrust ole32 winspool.drv comdlg32 user32
EXTRADLLFLAGS = -mno-cygwin
......
......@@ -63,17 +63,8 @@
OSVERSIONINFOW OsVersionInfo;
static HINSTANCE CABINET_hInstance = 0;
HINSTANCE SETUPAPI_hInstance = 0;
static HFDI (__cdecl *sc_FDICreate)(PFNALLOC, PFNFREE, PFNOPEN,
PFNREAD, PFNWRITE, PFNCLOSE, PFNSEEK, int, PERF);
static BOOL (__cdecl *sc_FDICopy)(HFDI, char *, char *, int,
PFNFDINOTIFY, PFNFDIDECRYPT, void *);
static BOOL (__cdecl *sc_FDIDestroy)(HFDI);
#define SC_HSC_A_MAGIC 0xACABFEED
typedef struct {
UINT magic;
......@@ -86,23 +77,6 @@ typedef struct {
WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
static BOOL LoadCABINETDll(void)
{
if (!CABINET_hInstance) {
CABINET_hInstance = LoadLibraryA("cabinet.dll");
if (CABINET_hInstance) {
sc_FDICreate = (void *)GetProcAddress(CABINET_hInstance, "FDICreate");
sc_FDICopy = (void *)GetProcAddress(CABINET_hInstance, "FDICopy");
sc_FDIDestroy = (void *)GetProcAddress(CABINET_hInstance, "FDIDestroy");
return TRUE;
} else {
ERR("load cabinet dll failed.\n");
return FALSE;
}
} else
return TRUE;
}
/* FDICreate callbacks */
static void * CDECL sc_cb_alloc(ULONG cb)
......@@ -392,9 +366,6 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
TRACE("(CabinetFile == %s, Reserved == %u, MsgHandler == ^%p, Context == ^%p)\n",
debugstr_a(CabinetFile), Reserved, MsgHandler, Context);
if (!LoadCABINETDll())
return FALSE;
if (!CabinetFile)
{
SetLastError(ERROR_INVALID_PARAMETER);
......@@ -429,14 +400,14 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
my_hsc.magic = SC_HSC_A_MAGIC;
my_hsc.msghandler = MsgHandler;
my_hsc.context = Context;
my_hsc.hfdi = sc_FDICreate( sc_cb_alloc, sc_cb_free, sc_cb_open, sc_cb_read,
my_hsc.hfdi = FDICreate( sc_cb_alloc, sc_cb_free, sc_cb_open, sc_cb_read,
sc_cb_write, sc_cb_close, sc_cb_lseek, cpuUNKNOWN, &erf );
if (!my_hsc.hfdi) return FALSE;
ret = sc_FDICopy(my_hsc.hfdi, pszCabinet, pszCabPath, 0, sc_FNNOTIFY_A, NULL, &my_hsc);
ret = FDICopy(my_hsc.hfdi, pszCabinet, pszCabPath, 0, sc_FNNOTIFY_A, NULL, &my_hsc);
sc_FDIDestroy(my_hsc.hfdi);
FDIDestroy(my_hsc.hfdi);
return ret;
}
......@@ -572,7 +543,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case DLL_PROCESS_DETACH:
if (lpvReserved) break;
SetupCloseLog();
if (CABINET_hInstance) FreeLibrary(CABINET_hInstance);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment