setupapi: Make hinstance global for all dialogs.
This commit is contained in:
parent
1056771b91
commit
7ab7a74171
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue