diff --git a/dlls/setupapi/setupapi_private.h b/dlls/setupapi/setupapi_private.h index d01edba227e..428cba48fb2 100644 --- a/dlls/setupapi/setupapi_private.h +++ b/dlls/setupapi/setupapi_private.h @@ -29,6 +29,8 @@ #define REGPART_RENAME "\\Rename" #define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager" +extern HINSTANCE SETUPAPI_hInstance; + static inline WCHAR *strdupW( const WCHAR *str ) { WCHAR *ret = NULL; diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c index 96050e2c966..d879f9da9a0 100644 --- a/dlls/setupapi/setupcab.c +++ b/dlls/setupapi/setupcab.c @@ -65,6 +65,7 @@ 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); @@ -695,6 +696,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); if (!GetVersionExW(&OsVersionInfo)) return FALSE; + SETUPAPI_hInstance = hinstDLL; break; case DLL_PROCESS_DETACH: UnloadCABINETDll(); diff --git a/dlls/setupapi/virtcopy.c b/dlls/setupapi/virtcopy.c index 9dddc889da4..c2fded22ccc 100644 --- a/dlls/setupapi/virtcopy.c +++ b/dlls/setupapi/virtcopy.c @@ -43,8 +43,6 @@ static BOOL VCP_opened = FALSE; static VCPSTATUS vcp_status; -static HINSTANCE SETUPAPI_hInstance; - static WORD VCP_Callback( LPVOID obj, UINT16 msg, WPARAM16 wParam, LPARAM lParam, LPARAM lParamRef ) { WORD args[8]; @@ -308,13 +306,6 @@ RETERR16 WINAPI VcpOpen16(VIFPROC vifproc, LPARAM lparamMsgRef) VCP_Proc = (FARPROC16)vifproc; VCP_MsgRef = lparamMsgRef; - /* load SETUPAPI needed for dialog resources etc. */ - SETUPAPI_hInstance = GetModuleHandleA("setupapi.dll"); - if (!SETUPAPI_hInstance) - { - ERR("Could not load sibling setupapi.dll\n"); - return ERR_VCP_NOMEM; - } VCP_opened = TRUE; return OK; }