儲存庫 vbox 的更動 38731
- 時間撮記:
- 2011-9-13 下午01:05:12 (13 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
r38636 r38731 101 101 /* we do not use IPRT Logging because the lib is used in host installer and needs to 102 102 * post its msgs to MSI logger */ 103 #define Log(_m) do { vboxDrvCfgLogRegular _m ; } while (0)104 #define LogFlow(_m) do { vboxDrvCfgLogFlow _m ; } while (0)105 #define LogRel(_m) do { vboxDrvCfgLogRel _m ; } while (0)106 #define AssertFailed() vboxDrvCfgPanic()107 #define Assert(_m) do { \103 #define NonStandardLogCrap(_m) do { vboxDrvCfgLogRegular _m ; } while (0) 104 #define NonStandardLogFlowCrap(_m) do { vboxDrvCfgLogFlow _m ; } while (0) 105 #define NonStandardLogRelCrap(_m) do { vboxDrvCfgLogRel _m ; } while (0) 106 #define NonStandardAssertFailed() vboxDrvCfgPanic() 107 #define NonStandardAssert(_m) do { \ 108 108 if (RT_UNLIKELY(!(_m))) { vboxDrvCfgPanic(); } \ 109 109 } while (0) … … 168 168 HRESULT VBoxDrvCfgStringList::resize(int newSize) 169 169 { 170 Assert(newSize >= mSize);170 NonStandardAssert(newSize >= mSize); 171 171 if (newSize < mSize) 172 172 return E_FAIL; … … 202 202 { 203 203 DWORD winEr = GetLastError(); 204 LogRel((__FUNCTION__ ": SetupFindFirstLine failed WinEr (%d) for Section(%S), Key(%S)\n", winEr, lpszSection, lpszKey));204 NonStandardLogRelCrap((__FUNCTION__ ": SetupFindFirstLine failed WinEr (%d) for Section(%S), Key(%S)\n", winEr, lpszSection, lpszKey)); 205 205 return HRESULT_FROM_WIN32(winEr); 206 206 } … … 216 216 { 217 217 winEr = GetLastError(); 218 // Assert(winEr == ERROR_INSUFFICIENT_BUFFER);218 // NonStandardAssert(winEr == ERROR_INSUFFICIENT_BUFFER); 219 219 if (winEr != ERROR_INSUFFICIENT_BUFFER) 220 220 { 221 LogFlow((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue));221 NonStandardLogFlowCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue)); 222 222 return HRESULT_FROM_WIN32(winEr); 223 223 } … … 225 225 226 226 LPWSTR lpszValue = (LPWSTR)malloc(cValue * sizeof (lpszValue[0])); 227 Assert(lpszValue);227 NonStandardAssert(lpszValue); 228 228 if (!lpszValue) 229 229 { 230 LogRel((__FUNCTION__ ": SetCoTaskMemAlloc failed to alloc mem of size (%d), for iValue(%d)\n", cValue * sizeof (lpszValue[0]), winEr, iValue));230 NonStandardLogRelCrap((__FUNCTION__ ": SetCoTaskMemAlloc failed to alloc mem of size (%d), for iValue(%d)\n", cValue * sizeof (lpszValue[0]), winEr, iValue)); 231 231 return E_FAIL; 232 232 } … … 235 235 { 236 236 winEr = GetLastError(); 237 LogRel((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue));238 Assert(0);237 NonStandardLogRelCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue)); 238 NonStandardAssert(0); 239 239 free(lpszValue); 240 240 return HRESULT_FROM_WIN32(winEr); … … 263 263 if (hr != S_OK) 264 264 { 265 Log((__FUNCTION__ ": vboxDrvCfgInfQueryContext for Manufacturer failed, hr = (0x%x)\n", hr));265 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for Manufacturer failed, hr = (0x%x)\n", hr)); 266 266 return hr; 267 267 } … … 270 270 if (hr != S_OK) 271 271 { 272 LogRel((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue 1 for Manufacturer failed, hr = (0x%x)\n", hr));272 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue 1 for Manufacturer failed, hr = (0x%x)\n", hr)); 273 273 return hr; 274 274 } … … 352 352 if (hr != S_OK) 353 353 { 354 Log((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for Manufacturer failed, hr = (0x%x)\n", hr));354 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for Manufacturer failed, hr = (0x%x)\n", hr)); 355 355 return hr; 356 356 } … … 360 360 if (hr != S_OK) 361 361 { 362 LogRel((__FUNCTION__ ": vboxDrvCfgInfQueryContext for models (%S) failed, hr = (0x%x)\n", lpszModels, hr));362 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for models (%S) failed, hr = (0x%x)\n", lpszModels, hr)); 363 363 } 364 364 else … … 367 367 if (hr != S_OK) 368 368 { 369 LogRel((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) failed, hr = (0x%x)\n", lpszModels, hr));369 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) failed, hr = (0x%x)\n", lpszModels, hr)); 370 370 } 371 371 } … … 401 401 if (fCopyStyle != SP_COPY_REPLACEONLY || hr != VBOXDRVCFG_S_INFEXISTS) 402 402 { 403 LogRel((__FUNCTION__ ": SetupCopyOEMInf fail winEr (%d)\n", winEr));403 NonStandardLogRelCrap((__FUNCTION__ ": SetupCopyOEMInf fail winEr (%d)\n", winEr)); 404 404 } 405 405 return hr; … … 429 429 { 430 430 DWORD winEr = GetLastError(); 431 LogRel((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), oem(%S), winEr (%d)\n", lpszInfPath, DstInfName, winEr));432 Assert(0);431 NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), oem(%S), winEr (%d)\n", lpszInfPath, DstInfName, winEr)); 432 NonStandardAssert(0); 433 433 return HRESULT_FROM_WIN32(winEr); 434 434 } … … 482 482 if (!wcsicmp(pHwId, pPnPId)) 483 483 { 484 Assert(pDrvDetail->InfFileName[0]);484 NonStandardAssert(pDrvDetail->InfFileName[0]); 485 485 if (pDrvDetail->InfFileName) 486 486 { … … 493 493 { 494 494 DWORD winEr = GetLastError(); 495 LogRel((__FUNCTION__": SetupDiGetDriverInfoDetail fail winEr (%d), size(%d)", winEr, dwReq));496 // Assert(0);495 NonStandardLogRelCrap((__FUNCTION__": SetupDiGetDriverInfoDetail fail winEr (%d), size(%d)", winEr, dwReq)); 496 // NonStandardAssert(0); 497 497 } 498 498 … … 506 506 } 507 507 508 Assert(0);508 NonStandardAssert(0); 509 509 } 510 510 } … … 518 518 { 519 519 winEr = GetLastError(); 520 Assert(0);520 NonStandardAssert(0); 521 521 } 522 522 … … 526 526 { 527 527 winEr = GetLastError(); 528 Assert(0);528 NonStandardAssert(0); 529 529 } 530 530 … … 538 538 if (rc != VINF_SUCCESS) 539 539 { 540 LogRel(("Could not init IPRT!, rc (%d)\n", rc));540 NonStandardLogRelCrap(("Could not init IPRT!, rc (%d)\n", rc)); 541 541 return E_FAIL; 542 542 } … … 573 573 574 574 vboxDrvCfgInfEnumerationCallback(pRel, &Context); 575 // LogRel(("inf : %S\n", list.get(i)));575 // NonStandardLogRelCrap(("inf : %S\n", list.get(i))); 576 576 } 577 577 } … … 604 604 if (winEr != ERROR_NO_MORE_FILES) 605 605 { 606 LogRel((__FUNCTION__": FindNextFile fail winEr (%d)\n", winEr));607 Assert(0);606 NonStandardLogRelCrap((__FUNCTION__": FindNextFile fail winEr (%d)\n", winEr)); 607 NonStandardAssert(0); 608 608 hr = HRESULT_FROM_WIN32(winEr); 609 609 } … … 618 618 if (winEr != ERROR_NO_MORE_FILES) 619 619 { 620 LogRel((__FUNCTION__": FindFirstFile fail winEr (%d)\n", winEr));621 Assert(0);620 NonStandardLogRelCrap((__FUNCTION__": FindFirstFile fail winEr (%d)\n", winEr)); 621 NonStandardAssert(0); 622 622 hr = HRESULT_FROM_WIN32(winEr); 623 623 } … … 631 631 PINFENUM_CONTEXT pContext = (PINFENUM_CONTEXT)pCtxt; 632 632 DWORD winEr; 633 // LogRel(("vboxDrvCfgInfEnumerationCallback: pFileName (%S)\n", pFileName));633 // NonStandardLogRelCrap(("vboxDrvCfgInfEnumerationCallback: pFileName (%S)\n", pFileName)); 634 634 635 635 HINF hInf = SetupOpenInfFileW(lpszFileName, pContext->InfInfo.lpszClassName, INF_STYLE_WIN4, NULL /*__in PUINT ErrorLine */); … … 637 637 { 638 638 winEr = GetLastError(); 639 // Assert(winEr == ERROR_CLASS_MISMATCH);639 // NonStandardAssert(winEr == ERROR_CLASS_MISMATCH); 640 640 if (winEr != ERROR_CLASS_MISMATCH) 641 641 { 642 Log((__FUNCTION__ ": SetupOpenInfFileW err winEr (%d)\n", winEr));642 NonStandardLogCrap((__FUNCTION__ ": SetupOpenInfFileW err winEr (%d)\n", winEr)); 643 643 } 644 644 … … 658 658 { 659 659 winEr = GetLastError(); 660 LogRel((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), winEr (%d)\n", lpszFileName, winEr));661 Assert(0);660 NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), winEr (%d)\n", lpszFileName, winEr)); 661 NonStandardAssert(0); 662 662 hr = HRESULT_FROM_WIN32( winEr ); 663 663 } … … 668 668 else 669 669 { 670 Log((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId failed, hr = (0x%x)\n", hr));670 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId failed, hr = (0x%x)\n", hr)); 671 671 } 672 672 … … 684 684 SHGFP_TYPE_CURRENT, /*DWORD dwFlags*/ 685 685 InfDirPath); 686 Assert(hr == S_OK);686 NonStandardAssert(hr == S_OK); 687 687 if (hr == S_OK) 688 688 { … … 695 695 Context.hr = S_OK; 696 696 hr = vboxDrvCfgEnumFiles(InfDirPath, vboxDrvCfgInfEnumerationCallback, &Context); 697 Assert(hr == S_OK);697 NonStandardAssert(hr == S_OK); 698 698 if (hr == S_OK) 699 699 { … … 702 702 else 703 703 { 704 LogRel((__FUNCTION__": vboxDrvCfgEnumFiles failed, hr = (0x%x)\n", hr));704 NonStandardLogRelCrap((__FUNCTION__": vboxDrvCfgEnumFiles failed, hr = (0x%x)\n", hr)); 705 705 } 706 706 } 707 707 else 708 708 { 709 LogRel((__FUNCTION__": SHGetFolderPathW failed, hr = (0x%x)\n", hr));709 NonStandardLogRelCrap((__FUNCTION__": SHGetFolderPathW failed, hr = (0x%x)\n", hr)); 710 710 } 711 711 … … 728 728 { 729 729 DWORD winEr = GetLastError(); 730 LogRel((__FUNCTION__": OpenSCManager failed, winEr (%d)\n", winEr));730 NonStandardLogRelCrap((__FUNCTION__": OpenSCManager failed, winEr (%d)\n", winEr)); 731 731 return HRESULT_FROM_WIN32(winEr); 732 732 } … … 743 743 { 744 744 DWORD winEr = GetLastError(); 745 LogRel((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));745 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr)); 746 746 hr = HRESULT_FROM_WIN32(winEr); 747 747 break; … … 750 750 if (Status.dwCurrentState != SERVICE_RUNNING && Status.dwCurrentState != SERVICE_START_PENDING) 751 751 { 752 LogRel(("Starting service (%S)\n", lpszSvcName));752 NonStandardLogRelCrap(("Starting service (%S)\n", lpszSvcName)); 753 753 754 754 fRc = StartService(hSvc, 0, NULL); … … 756 756 { 757 757 DWORD winEr = GetLastError(); 758 LogRel((__FUNCTION__": StartService failed winEr (%d)\n", winEr));758 NonStandardLogRelCrap((__FUNCTION__": StartService failed winEr (%d)\n", winEr)); 759 759 hr = HRESULT_FROM_WIN32(winEr); 760 760 break; … … 766 766 { 767 767 DWORD winEr = GetLastError(); 768 LogRel((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));768 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr)); 769 769 hr = HRESULT_FROM_WIN32(winEr); 770 770 break; … … 780 780 { 781 781 DWORD winEr = GetLastError(); 782 LogRel((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));782 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr)); 783 783 hr = HRESULT_FROM_WIN32(winEr); 784 784 break; … … 791 791 if (hr != S_OK || Status.dwCurrentState != SERVICE_RUNNING) 792 792 { 793 LogRel((__FUNCTION__": Failed to start the service\n"));793 NonStandardLogRelCrap((__FUNCTION__": Failed to start the service\n")); 794 794 hr = E_FAIL; 795 795 break; … … 803 803 { 804 804 DWORD winEr = GetLastError(); 805 LogRel((__FUNCTION__": OpenServiceW failed, winEr (%d)\n", winEr));805 NonStandardLogRelCrap((__FUNCTION__": OpenServiceW failed, winEr (%d)\n", winEr)); 806 806 hr = HRESULT_FROM_WIN32(winEr); 807 807 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器