Lines Matching defs:hModule

68 BOOL APIENTRY DllMain(HANDLE hModule,
109 UINT __stdcall IsSerialCheckNeeded(MSIHANDLE hModule)
112 /*BOOL bRet =*/ serialCheckNeeded(hModule);
117 UINT __stdcall CheckSerial(MSIHANDLE hModule)
120 /*BOOL bRet =*/ serialIsValid(hModule);
125 DWORD Exec(MSIHANDLE hModule,
142 logStringW(hModule, L"Executing command line: %s %s (Working Dir: %s)",
158 logStringW(hModule, L"Executing command line: CreateProcess() failed! Error: %ld", rc);
166 logStringW(hModule, L"Executing command line: WaitForSingleObject() failed! Error: %u", rc);
173 logStringW(hModule, L"Executing command line: GetExitCodeProcess() failed! Error: %u", rc);
181 logStringW(hModule, L"Executing command returned: %u (exit code %u)", rc, *pdwExitCode);
185 UINT __stdcall InstallPythonAPI(MSIHANDLE hModule)
187 logStringW(hModule, L"InstallPythonAPI: Checking for installed Python environment ...");
194 logStringW(hModule, L"InstallPythonAPI: Python seems not to be installed.");
221 logStringW(hModule, L"InstallPythonAPI: Path \"%s\" detected.", wszVal);
234 logStringW(hModule, L"InstallPythonAPI: Python installed. Checking for Win32 extensions ...");
238 DWORD dwRetExec = Exec(hModule, wszExec, wszCmdLine, NULL, &dwExitCode);
243 logStringW(hModule, L"InstallPythonAPI: Win32 extensions installed.");
247 logStringW(hModule, L"InstallPythonAPI: Win32 extensions not found.");
255 VBoxGetProperty(hModule, L"CustomActionData", wszPathTargetDir, sizeof(wszPathTargetDir));
266 logStringW(hModule, L"InstallPythonAPI: Could set environment variable VBOX_INSTALL_PATH!");
269 DWORD dwRetExec = Exec(hModule, wszExec, wszCmdLine, wszPath, &dwExitCode);
274 logStringW(hModule, L"InstallPythonAPI: VBoxAPI for Python successfully installed.");
280 logStringW(hModule, L"InstallPythonAPI: Error while executing installation of VBox API: %ld", dwRetExec);
282 logStringW(hModule, L"InstallPythonAPI: Python reported an error while installing VBox API: %ld", dwExitCode);
287 logStringW(hModule, L"InstallPythonAPI: Unable to retrieve VBox installation path!");
290 VBoxSetProperty(hModule, L"VBOX_PYTHON_IS_INSTALLED", bInstalled ? L"1" : L"0");
293 logStringW(hModule, L"InstallPythonAPI: VBox API not installed.");
297 static LONG installBrandingValue(MSIHANDLE hModule,
325 logStringW(hModule, L"InstallBranding: Could not write value %s! Error %ld", pwszValue, rc);
334 UINT CopyDir(MSIHANDLE hModule, const WCHAR *pwszDestDir, const WCHAR *pwszSourceDir)
353 logStringW(hModule, L"CopyDir: DestDir=%s, SourceDir=%s", wszDest, wszSource);
357 logStringW(hModule, L"CopyDir: Copy operation returned status 0x%x", r);
365 UINT RemoveDir(MSIHANDLE hModule, const WCHAR *pwszDestDir)
381 logStringW(hModule, L"RemoveDir: DestDir=%s", wszDest);
385 logStringW(hModule, L"RemoveDir: Remove operation returned status 0x%x", r);
393 UINT RenameDir(MSIHANDLE hModule, const WCHAR *pwszDestDir, const WCHAR *pwszSourceDir)
412 logStringW(hModule, L"RenameDir: DestDir=%s, SourceDir=%s", wszDest, wszSource);
416 logStringW(hModule, L"RenameDir: Rename operation returned status 0x%x", r);
424 UINT __stdcall UninstallBranding(MSIHANDLE hModule)
427 logStringW(hModule, L"UninstallBranding: Handling branding file ...");
432 rc = VBoxGetProperty(hModule, L"CustomActionData", wszPathTargetDir, sizeof(wszPathTargetDir));
443 rc = RemoveDir(hModule, wszPathDest);
448 rc = RemoveDir(hModule, wszPathDest);
452 logStringW(hModule, L"UninstallBranding: Handling done. (rc=%u (ignored))", rc);
456 UINT __stdcall InstallBranding(MSIHANDLE hModule)
459 logStringW(hModule, L"InstallBranding: Handling branding file ...");
462 rc = VBoxGetProperty(hModule, L"SOURCEDIR", wszPathMSI, sizeof(wszPathMSI));
466 rc = VBoxGetProperty(hModule, L"CustomActionData", wszPathTargetDir, sizeof(wszPathTargetDir));
475 rc = CopyDir(hModule, wszPathDest, wszPathSource);
480 rc = RenameDir(hModule, wszPathDest, wszPathSource);
485 logStringW(hModule, L"InstallBranding: Handling done. (rc=%u (ignored))", rc);
534 static VOID netCfgLoggerEnable(MSIHANDLE hModule)
536 NonStandardAssert(hModule);
541 g_hCurrentModule = hModule;
548 static UINT errorConvertFromHResult(MSIHANDLE hModule, HRESULT hr)
559 logStringW(hModule, L"Reboot required, setting REBOOT property to \"force\"");
560 HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
562 logStringW(hModule, L"Failed to set REBOOT property, error = 0x%x", hr2);
568 logStringW(hModule, L"Converting unhandled HRESULT (0x%x) to ERROR_GEN_FAILURE", hr);
574 static MSIHANDLE createNetCfgLockedMsgRecord(MSIHANDLE hModule)
582 logStringW(hModule, L"createNetCfgLockedMsgRecord: MsiRecordSetInteger failed, error = 0x%x", uErr);
588 logStringW(hModule, L"createNetCfgLockedMsgRecord: Failed to create a record");
593 static UINT doNetCfgInit(MSIHANDLE hModule, INetCfg **ppnc, BOOL bWrite)
607 logStringW(hModule, L"doNetCfgInit: VBoxNetCfgWinQueryINetCfg failed, error = 0x%x", hr);
608 uErr = errorConvertFromHResult(hModule, hr);
616 logStringW(hModule, L"doNetCfgInit: lpszLockedBy == NULL, breaking");
630 logStringW(hModule, L"doNetCfgInit: lpszLockedBy is 6to4svc.dll, retrying %d out of %d", cRetries, VBOX_NETCFG_MAX_RETRIES);
637 hMsg = createNetCfgLockedMsgRecord(hModule);
640 logStringW(hModule, L"doNetCfgInit: Failed to create a message record, breaking");
650 logStringW(hModule, L"doNetCfgInit: MsiRecordSetStringW failed, error = 0x%x", rTmp);
655 MsgResult = MsiProcessMessage(hModule, (INSTALLMESSAGE)(INSTALLMESSAGE_USER | MB_RETRYCANCEL), hMsg);
657 logStringW(hModule, L"doNetCfgInit: MsiProcessMessage returned (0x%x)", MsgResult);
668 static UINT vboxNetFltQueryInfArray(MSIHANDLE hModule, OUT LPWSTR pwszPtInf, OUT LPWSTR pwszMpInf, DWORD dwSize)
671 UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", pwszPtInf, &dwBuf);
678 logStringW(hModule, L"vboxNetFltQueryInfArray: INF 1: %s", pwszPtInf);
681 logStringW(hModule, L"vboxNetFltQueryInfArray: INF 2: %s", pwszMpInf);
684 logStringW(hModule, L"vboxNetFltQueryInfArray: MsiGetPropertyW failed, error = 0x%x", uErr);
687 logStringW(hModule, L"vboxNetFltQueryInfArray: Empty installation directory");
696 UINT __stdcall UninstallNetFlt(MSIHANDLE hModule)
702 netCfgLoggerEnable(hModule);
708 logStringW(hModule, L"Uninstalling NetFlt");
710 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);
715 logStringW(hModule, L"UninstallNetFlt: VBoxNetCfgWinUninstallComponent failed, error = 0x%x", hr);
717 uErr = errorConvertFromHResult(hModule, hr);
721 logStringW(hModule, L"Uninstalling NetFlt done, error = 0x%x", uErr);
724 logStringW(hModule, L"UninstallNetFlt: doNetCfgInit failed, error = 0x%x", uErr);
741 UINT __stdcall InstallNetFlt(MSIHANDLE hModule)
747 netCfgLoggerEnable(hModule);
754 logStringW(hModule, L"InstallNetFlt: Installing NetFlt");
756 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);
761 uErr = vboxNetFltQueryInfArray(hModule, wszPtInf, wszMpInf, sizeof(wszMpInf));
767 logStringW(hModule, L"InstallNetFlt: VBoxNetCfgWinNetFltInstall failed, error = 0x%x", hr);
769 uErr = errorConvertFromHResult(hModule, hr);
772 logStringW(hModule, L"InstallNetFlt: vboxNetFltQueryInfArray failed, error = 0x%x", uErr);
776 logStringW(hModule, L"InstallNetFlt: Done");
779 logStringW(hModule, L"InstallNetFlt: doNetCfgInit failed, error = 0x%x", uErr);
797 UINT __stdcall UninstallNetLwf(MSIHANDLE hModule)
803 netCfgLoggerEnable(hModule);
809 logStringW(hModule, L"Uninstalling NetLwf");
811 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);
816 logStringW(hModule, L"UninstallNetLwf: VBoxNetCfgWinUninstallComponent failed, error = 0x%x", hr);
818 uErr = errorConvertFromHResult(hModule, hr);
822 logStringW(hModule, L"Uninstalling NetLwf done, error = 0x%x", uErr);
825 logStringW(hModule, L"UninstallNetLwf: doNetCfgInit failed, error = 0x%x", uErr);
842 UINT __stdcall InstallNetLwf(MSIHANDLE hModule)
848 netCfgLoggerEnable(hModule);
855 logStringW(hModule, L"InstallNetLwf: Installing NetLwf");
857 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);
863 UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszInf, &cchInf);
878 logStringW(hModule, L"InstallNetLwf: VBoxNetCfgWinNetLwfInstall failed, error = 0x%x", hr);
880 uErr = errorConvertFromHResult(hModule, hr);
884 logStringW(hModule, L"vboxNetFltQueryInfArray: Empty installation directory");
889 logStringW(hModule, L"vboxNetFltQueryInfArray: MsiGetPropertyW failed, error = 0x%x", uErr);
893 logStringW(hModule, L"InstallNetLwf: Done");
896 logStringW(hModule, L"InstallNetLwf: doNetCfgInit failed, error = 0x%x", uErr);
972 static UINT _createHostOnlyInterface(MSIHANDLE hModule, LPCWSTR pwszId, LPCWSTR pwszInfName)
975 netCfgLoggerEnable(hModule);
980 logStringW(hModule, L"CreateHostOnlyInterface: Creating host-only interface");
989 UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszMpInf, &cchMpInf);
994 logStringW(hModule, L"CreateHostOnlyInterface: NetAdpDir property = %s", wszMpInf);
1005 logStringW(hModule, L"CreateHostOnlyInterface: Resulting INF path = %s", pwszInfPath);
1008 logStringW(hModule, L"CreateHostOnlyInterface: VBox installation path is empty");
1011 logStringW(hModule, L"CreateHostOnlyInterface: Unable to retrieve VBox installation path, error = 0x%x", uErr);
1016 logStringW(hModule, L"CreateHostOnlyInterface: Calling VBoxDrvCfgInfInstall(%s)", pwszInfPath);
1018 logStringW(hModule, L"CreateHostOnlyInterface: VBoxDrvCfgInfInstall returns 0x%x", hr);
1020 logStringW(hModule, L"CreateHostOnlyInterface: Failed to install INF file, error = 0x%x", hr);
1032 logStringW(hModule, L"UpdateHostOnlyInterfaces: Reboot required, setting REBOOT property to force");
1033 HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
1035 logStringW(hModule, L"UpdateHostOnlyInterfaces: Failed to set REBOOT property, error = 0x%x", hr2);
1039 logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
1043 logStringW(hModule, L"CreateHostOnlyInterface: calling VBoxNetCfgWinCreateHostOnlyNetworkInterface");
1045 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface returns 0x%x", hr);
1050 logStringW(hModule, L"CreateHostOnlyInterface: calling VBoxNetCfgWinEnableStaticIpConfig");
1052 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig returns 0x%x", hr);
1054 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinEnableStaticIpConfig failed, error = 0x%x", hr);
1057 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface failed, error = 0x%x", hr);
1062 logStringW(hModule, L"CreateHostOnlyInterface: Creating host-only interface done");
1065 logStringW(hModule, L"CreateHostOnlyInterface: Almost done...");
1073 logStringW(hModule, L"CreateHostOnlyInterface: Returns success (ignoring all failures)");
1078 UINT __stdcall CreateHostOnlyInterface(MSIHANDLE hModule)
1080 return _createHostOnlyInterface(hModule, NETADP_ID, L"VBoxNetAdp.inf");
1083 UINT __stdcall Ndis6CreateHostOnlyInterface(MSIHANDLE hModule)
1085 return _createHostOnlyInterface(hModule, NETADP_ID, L"VBoxNetAdp6.inf");
1088 static UINT _removeHostOnlyInterfaces(MSIHANDLE hModule, LPCWSTR pwszId)
1091 netCfgLoggerEnable(hModule);
1093 logStringW(hModule, L"RemoveHostOnlyInterfaces: Removing all host-only interfaces");
1103 logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully, but failed to remove INF files");
1106 logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully");
1110 logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x", hr);
1123 UINT __stdcall RemoveHostOnlyInterfaces(MSIHANDLE hModule)
1125 return _removeHostOnlyInterfaces(hModule, NETADP_ID);
1128 static UINT _stopHostOnlyInterfaces(MSIHANDLE hModule, LPCWSTR pwszId)
1131 netCfgLoggerEnable(hModule);
1133 logStringW(hModule, L"StopHostOnlyInterfaces: Stopping all host-only interfaces");
1140 logStringW(hModule, L"StopHostOnlyInterfaces: Disabling host interfaces was successful, hr = 0x%x", hr);
1143 logStringW(hModule, L"StopHostOnlyInterfaces: Disabling host interfaces failed, hr = 0x%x", hr);
1156 UINT __stdcall StopHostOnlyInterfaces(MSIHANDLE hModule)
1158 return _stopHostOnlyInterfaces(hModule, NETADP_ID);
1161 static UINT _updateHostOnlyInterfaces(MSIHANDLE hModule, LPCWSTR pwszInfName, LPCWSTR pwszId)
1164 netCfgLoggerEnable(hModule);
1166 logStringW(hModule, L"UpdateHostOnlyInterfaces: Updating all host-only interfaces");
1174 UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszMpInf, &cchMpInf);
1179 logStringW(hModule, L"UpdateHostOnlyInterfaces: NetAdpDir property = %s", wszMpInf);
1190 logStringW(hModule, L"UpdateHostOnlyInterfaces: Resulting INF path = %s", pwszInfPath);
1196 logStringW(hModule, L"UpdateHostOnlyInterfaces: File \"%s\" not found, dwErr=%ld",
1201 logStringW(hModule, L"UpdateHostOnlyInterfaces: File \"%s\" exists",
1210 logStringW(hModule, L"UpdateHostOnlyInterfaces: Reboot required, setting REBOOT property to force");
1211 HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
1213 logStringW(hModule, L"UpdateHostOnlyInterfaces: Failed to set REBOOT property, error = 0x%x", hr2);
1217 logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
1221 logStringW(hModule, L"UpdateHostOnlyInterfaces: VBox installation path is empty");
1224 logStringW(hModule, L"UpdateHostOnlyInterfaces: Unable to retrieve VBox installation path, error = 0x%x", uErr);
1237 UINT __stdcall UpdateHostOnlyInterfaces(MSIHANDLE hModule)
1239 return _updateHostOnlyInterfaces(hModule, L"VBoxNetAdp.inf", NETADP_ID);
1242 UINT __stdcall Ndis6UpdateHostOnlyInterfaces(MSIHANDLE hModule)
1244 return _updateHostOnlyInterfaces(hModule, L"VBoxNetAdp6.inf", NETADP_ID);
1247 static UINT _uninstallNetAdp(MSIHANDLE hModule, LPCWSTR pwszId)
1253 netCfgLoggerEnable(hModule);
1259 logStringW(hModule, L"Uninstalling NetAdp");
1261 uErr = doNetCfgInit(hModule, &pNetCfg, TRUE);
1266 logStringW(hModule, L"UninstallNetAdp: VBoxNetCfgWinUninstallComponent failed, error = 0x%x", hr);
1268 uErr = errorConvertFromHResult(hModule, hr);
1272 logStringW(hModule, L"Uninstalling NetAdp done, error = 0x%x", uErr);
1275 logStringW(hModule, L"UninstallNetAdp: doNetCfgInit failed, error = 0x%x", uErr);
1292 UINT __stdcall UninstallNetAdp(MSIHANDLE hModule)
1294 return _uninstallNetAdp(hModule, NETADP_ID);
1364 logStringW(hModule, strAndArgs); \
1368 int removeNetworkInterface(MSIHANDLE hModule, const WCHAR *pwszGUID)
1434 logStringW(hModule, L"VBox HostInterfaces: SetupDiGetClassDevs failed (0x%08X)!", GetLastError());
1537 logStringW(hModule, L"VBox HostInterfaces: SetupDiSetSelectedDevice failed (0x%08X)!", GetLastError());
1544 logStringW(hModule, L"VBox HostInterfaces: SetupDiCallClassInstaller (DIF_REMOVE) failed (0x%08X)!", GetLastError());
1561 UINT __stdcall UninstallTAPInstances(MSIHANDLE hModule)
1569 logStringW(hModule, L"VBox HostInterfaces: Enumerating interfaces ...");
1580 logStringW(hModule, L"VBox HostInterfaces: No interfaces found.");
1583 logStringW(hModule, L"VBox HostInterfaces: Enumeration failed: %ld", lStatus);
1591 logStringW(hModule, L"VBox HostInterfaces: Removing interface \"%s\" ...", wszNetworkGUID);
1592 removeNetworkInterface(hModule, wszNetworkGUID);
1597 logStringW(hModule, L"VBox HostInterfaces: Removing interfaces done.");