static VOID netCfgLoggerEnable(MSIHANDLE hModule) { NonStandardAssert(hModule); if (g_hCurrentModule) netCfgLoggerDisable(); g_hCurrentModule = hModule; VBoxNetCfgWinSetLogging((LOG_ROUTINE)netCfgLoggerCallback); /* uncomment next line if you want to add logging information from VBoxDrvCfg.cpp */ VBoxDrvCfgLoggerSet(vboxDrvLoggerCallback, NULL); }
int __cdecl main(int argc, char **argv) { if (RTR3InitExe(argc, &argv, 0) != VINF_SUCCESS) { printf("Could not init IPRT!\n"); return 1; } VBoxDrvCfgLoggerSet(vboxUsbLog, NULL); VBoxDrvCfgPanicSet(vboxUsbPanic, NULL); RTPrintf("USB installation\n"); int rc = usblibOsCreateService(); if (RT_SUCCESS(rc)) { LPWSTR lpszFilePart; WCHAR szFullPath[MAX_PATH]; DWORD len; len = GetFullPathNameW(L".\\VBoxUSB.inf", RT_ELEMENTS(szFullPath), szFullPath, &lpszFilePart); Assert(len); HRESULT hr = VBoxDrvCfgInfInstall(szFullPath); if (hr == S_OK) { RTPrintf("Installation successful.\n"); } else { rc = -1; } } if (RT_SUCCESS(rc)) rc = 0; /** @todo RTR3Term(); */ return rc; }
int __cdecl main(int argc, char **argv) { printf("USB uninstallation\n"); VBoxDrvCfgLoggerSet(vboxUsbLog, NULL); VBoxDrvCfgPanicSet(vboxUsbPanic, NULL); usblibOsStopService(); usblibOsDeleteService(); HRESULT hr = VBoxDrvCfgInfUninstallAllF(L"USB", L"USB\\VID_80EE&PID_CAFE", SUOI_FORCEDELETE); if (hr != S_OK) { printf("SetupUninstallOEMInf failed with hr=0x%x\n", hr); return 1; } printf("USB uninstallation succeeded!\n"); return 0; }