Changeset 41012 in vbox for trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
- Timestamp:
- Apr 20, 2012 1:31:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
r40993 r41012 203 203 if (!SetupFindFirstLineW(hInf, lpszSection, lpszKey, pCtx)) 204 204 { 205 DWORD winEr = GetLastError();206 NonStandardLogRelCrap((__FUNCTION__ ": SetupFindFirstLine failed WinEr (%d) for Section(%S), Key(%S)\n", winEr, lpszSection, lpszKey));207 return HRESULT_FROM_WIN32( winEr);205 DWORD dwErr = GetLastError(); 206 NonStandardLogRelCrap((__FUNCTION__ ": SetupFindFirstLine failed WinEr (%d) for Section(%S), Key(%S)\n", dwErr, lpszSection, lpszKey)); 207 return HRESULT_FROM_WIN32(dwErr); 208 208 } 209 209 return S_OK; … … 212 212 static HRESULT vboxDrvCfgInfQueryKeyValue(PINFCONTEXT pCtx, DWORD iValue, LPWSTR *lppszValue, PDWORD pcValue) 213 213 { 214 DWORD winEr;214 DWORD dwErr; 215 215 DWORD cValue; 216 216 217 217 if (!SetupGetStringFieldW(pCtx, iValue, NULL, 0, &cValue)) 218 218 { 219 winEr = GetLastError();220 // NonStandardAssert( winEr == ERROR_INSUFFICIENT_BUFFER);221 if ( winEr != ERROR_INSUFFICIENT_BUFFER)222 { 223 NonStandardLogFlowCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue));224 return HRESULT_FROM_WIN32( winEr);219 dwErr = GetLastError(); 220 // NonStandardAssert(dwErr == ERROR_INSUFFICIENT_BUFFER); 221 if (dwErr != ERROR_INSUFFICIENT_BUFFER) 222 { 223 NonStandardLogFlowCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", dwErr, iValue)); 224 return HRESULT_FROM_WIN32(dwErr); 225 225 } 226 226 } … … 230 230 if (!lpszValue) 231 231 { 232 NonStandardLogRelCrap((__FUNCTION__ ": SetCoTaskMemAlloc failed to alloc mem of size (%d), for iValue(%d)\n", cValue * sizeof (lpszValue[0]), winEr, iValue));232 NonStandardLogRelCrap((__FUNCTION__ ": SetCoTaskMemAlloc failed to alloc mem of size (%d), for iValue(%d)\n", cValue * sizeof (lpszValue[0]), dwErr, iValue)); 233 233 return E_FAIL; 234 234 } … … 236 236 if (!SetupGetStringFieldW(pCtx, iValue, lpszValue, cValue, &cValue)) 237 237 { 238 winEr = GetLastError();239 NonStandardLogRelCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue));238 dwErr = GetLastError(); 239 NonStandardLogRelCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", dwErr, iValue)); 240 240 NonStandardAssert(0); 241 241 free(lpszValue); 242 return HRESULT_FROM_WIN32( winEr);242 return HRESULT_FROM_WIN32(dwErr); 243 243 } 244 244 … … 265 265 if (hr != S_OK) 266 266 { 267 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for Manufacturer failed, hr = (0x%x)\n", hr));267 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for Manufacturer failed, hr=0x%x\n", hr)); 268 268 return hr; 269 269 } … … 272 272 if (hr != S_OK) 273 273 { 274 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue 1 for Manufacturer failed, hr = (0x%x)\n", hr));274 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue 1 for Manufacturer failed, hr=0x%x\n", hr)); 275 275 return hr; 276 276 } … … 354 354 if (hr != S_OK) 355 355 { 356 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for Manufacturer failed, hr = (0x%x)\n", hr));356 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for Manufacturer failed, hr=0x%x\n", hr)); 357 357 return hr; 358 358 } … … 362 362 if (hr != S_OK) 363 363 { 364 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for models (%S) failed, hr = (0x%x)\n", lpszModels, hr));364 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for models (%S) failed, hr=0x%x\n", lpszModels, hr)); 365 365 } 366 366 else … … 369 369 if (hr != S_OK) 370 370 { 371 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) failed, hr = (0x%x)\n", lpszModels, hr));371 NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) failed, hr=0x%x\n", lpszModels, hr)); 372 372 } 373 373 } … … 399 399 lpszDstNameComponent)) 400 400 { 401 DWORD winEr = GetLastError();402 HRESULT hr = HRESULT_FROM_WIN32( winEr);401 DWORD dwErr = GetLastError(); 402 HRESULT hr = HRESULT_FROM_WIN32(dwErr); 403 403 if (fCopyStyle != SP_COPY_REPLACEONLY || hr != VBOXDRVCFG_S_INFEXISTS) 404 404 { 405 NonStandardLogRelCrap((__FUNCTION__ ": SetupCopyOEMInf fail winEr (%d)\n", winEr));405 NonStandardLogRelCrap((__FUNCTION__ ": SetupCopyOEMInf fail dwErr=%ld\n", dwErr)); 406 406 } 407 407 return hr; … … 430 430 if (!SetupUninstallOEMInfW(DstInfName, fFlags, NULL /*__in PVOID Reserved == NULL */)) 431 431 { 432 DWORD winEr = GetLastError();433 NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), oem(%S), winEr (%d)\n", lpszInfPath, DstInfName, winEr));432 DWORD dwErr = GetLastError(); 433 NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), oem(%S), dwErr=%ld\n", lpszInfPath, DstInfName, dwErr)); 434 434 NonStandardAssert(0); 435 return HRESULT_FROM_WIN32( winEr);435 return HRESULT_FROM_WIN32(dwErr); 436 436 } 437 437 } … … 442 442 static HRESULT vboxDrvCfgCollectInfsSetupDi(const GUID * pGuid, LPCWSTR pPnPId, VBoxDrvCfgStringList & list) 443 443 { 444 DWORD winEr = ERROR_SUCCESS;444 DWORD dwErr = ERROR_SUCCESS; 445 445 int counter = 0; 446 446 HDEVINFO hDevInfo = SetupDiCreateDeviceInfoList( … … 494 494 else 495 495 { 496 DWORD winEr = GetLastError();497 NonStandardLogRelCrap((__FUNCTION__": SetupDiGetDriverInfoDetail fail winEr (%d), size(%d)", winEr, dwReq));496 DWORD dwErr = GetLastError(); 497 NonStandardLogRelCrap((__FUNCTION__": SetupDiGetDriverInfoDetail fail dwErr=%ld, size(%d)", dwErr, dwReq)); 498 498 // NonStandardAssert(0); 499 499 } … … 502 502 else 503 503 { 504 DWORD winEr = GetLastError();505 if ( winEr == ERROR_NO_MORE_ITEMS)504 DWORD dwErr = GetLastError(); 505 if (dwErr == ERROR_NO_MORE_ITEMS) 506 506 { 507 507 break; … … 519 519 else 520 520 { 521 winEr = GetLastError();521 dwErr = GetLastError(); 522 522 NonStandardAssert(0); 523 523 } … … 527 527 else 528 528 { 529 winEr = GetLastError();529 dwErr = GetLastError(); 530 530 NonStandardAssert(0); 531 531 } 532 532 533 return HRESULT_FROM_WIN32( winEr);533 return HRESULT_FROM_WIN32(dwErr); 534 534 } 535 535 … … 603 603 if (!bNext) 604 604 { 605 int winEr = GetLastError();606 if ( winEr != ERROR_NO_MORE_FILES)605 DWORD dwErr = GetLastError(); 606 if (dwErr != ERROR_NO_MORE_FILES) 607 607 { 608 NonStandardLogRelCrap((__FUNCTION__": FindNextFile fail winEr (%d)\n", winEr));608 NonStandardLogRelCrap((__FUNCTION__": FindNextFile fail dwErr=%ld\n", dwErr)); 609 609 NonStandardAssert(0); 610 hr = HRESULT_FROM_WIN32( winEr);610 hr = HRESULT_FROM_WIN32(dwErr); 611 611 } 612 612 break; … … 617 617 else 618 618 { 619 int winEr = GetLastError();620 if ( winEr != ERROR_NO_MORE_FILES)621 { 622 NonStandardLogRelCrap((__FUNCTION__": FindFirstFile fail winEr (%d)\n", winEr));619 DWORD dwErr = GetLastError(); 620 if (dwErr != ERROR_NO_MORE_FILES) 621 { 622 NonStandardLogRelCrap((__FUNCTION__": FindFirstFile fail dwErr=%ld\n", dwErr)); 623 623 NonStandardAssert(0); 624 hr = HRESULT_FROM_WIN32( winEr);624 hr = HRESULT_FROM_WIN32(dwErr); 625 625 } 626 626 } … … 632 632 { 633 633 PINFENUM_CONTEXT pContext = (PINFENUM_CONTEXT)pCtxt; 634 DWORD winEr;634 DWORD dwErr; 635 635 // NonStandardLogRelCrap(("vboxDrvCfgInfEnumerationCallback: pFileName (%S)\n", pFileName)); 636 636 … … 638 638 if (hInf == INVALID_HANDLE_VALUE) 639 639 { 640 winEr = GetLastError();641 // NonStandardAssert( winEr == ERROR_CLASS_MISMATCH);642 if ( winEr != ERROR_CLASS_MISMATCH)643 { 644 NonStandardLogCrap((__FUNCTION__ ": SetupOpenInfFileW err winEr (%d)\n", winEr));640 dwErr = GetLastError(); 641 // NonStandardAssert(dwErr == ERROR_CLASS_MISMATCH); 642 if (dwErr != ERROR_CLASS_MISMATCH) 643 { 644 NonStandardLogCrap((__FUNCTION__ ": SetupOpenInfFileW err dwErr=%ld\n", dwErr)); 645 645 } 646 646 … … 659 659 )) 660 660 { 661 winEr = GetLastError();662 NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), winEr (%d)\n", lpszFileName, winEr));661 dwErr = GetLastError(); 662 NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), dwErr=%ld\n", lpszFileName, dwErr)); 663 663 NonStandardAssert(0); 664 hr = HRESULT_FROM_WIN32( winEr );664 hr = HRESULT_FROM_WIN32( dwErr ); 665 665 } 666 666 } … … 670 670 else 671 671 { 672 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId failed, hr = (0x%x)\n", hr));672 NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId failed, hr=0x%x\n", hr)); 673 673 } 674 674 … … 704 704 else 705 705 { 706 NonStandardLogRelCrap((__FUNCTION__": vboxDrvCfgEnumFiles failed, hr = (0x%x)\n", hr));706 NonStandardLogRelCrap((__FUNCTION__": vboxDrvCfgEnumFiles failed, hr=0x%x\n", hr)); 707 707 } 708 708 } 709 709 else 710 710 { 711 NonStandardLogRelCrap((__FUNCTION__": SHGetFolderPathW failed, hr = (0x%x)\n", hr));711 NonStandardLogRelCrap((__FUNCTION__": SHGetFolderPathW failed, hr=0x%x\n", hr)); 712 712 } 713 713 … … 729 729 if (hMgr == NULL) 730 730 { 731 DWORD winEr = GetLastError();732 NonStandardLogRelCrap((__FUNCTION__": OpenSCManager failed, winEr (%d)\n", winEr));733 return HRESULT_FROM_WIN32( winEr);731 DWORD dwErr = GetLastError(); 732 NonStandardLogRelCrap((__FUNCTION__": OpenSCManager failed, dwErr=%ld\n", dwErr)); 733 return HRESULT_FROM_WIN32(dwErr); 734 734 } 735 735 … … 744 744 if (!fRc) 745 745 { 746 DWORD winEr = GetLastError();747 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));748 hr = HRESULT_FROM_WIN32( winEr);746 DWORD dwErr = GetLastError(); 747 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed dwErr=%ld\n", dwErr)); 748 hr = HRESULT_FROM_WIN32(dwErr); 749 749 break; 750 750 } … … 757 757 if (!fRc) 758 758 { 759 DWORD winEr = GetLastError();760 NonStandardLogRelCrap((__FUNCTION__": StartService failed winEr (%d)\n", winEr));761 hr = HRESULT_FROM_WIN32( winEr);759 DWORD dwErr = GetLastError(); 760 NonStandardLogRelCrap((__FUNCTION__": StartService failed dwErr=%ld\n", dwErr)); 761 hr = HRESULT_FROM_WIN32(dwErr); 762 762 break; 763 763 } … … 767 767 if (!fRc) 768 768 { 769 DWORD winEr = GetLastError();770 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));771 hr = HRESULT_FROM_WIN32( winEr);769 DWORD dwErr = GetLastError(); 770 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed dwErr=%ld\n", dwErr)); 771 hr = HRESULT_FROM_WIN32(dwErr); 772 772 break; 773 773 } … … 781 781 if (!fRc) 782 782 { 783 DWORD winEr = GetLastError();784 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));785 hr = HRESULT_FROM_WIN32( winEr);783 DWORD dwErr = GetLastError(); 784 NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed dwErr=%ld\n", dwErr)); 785 hr = HRESULT_FROM_WIN32(dwErr); 786 786 break; 787 787 } … … 804 804 else 805 805 { 806 DWORD winEr = GetLastError();807 NonStandardLogRelCrap((__FUNCTION__": OpenServiceW failed, winEr (%d)\n", winEr));808 hr = HRESULT_FROM_WIN32( winEr);806 DWORD dwErr = GetLastError(); 807 NonStandardLogRelCrap((__FUNCTION__": OpenServiceW failed, dwErr=%ld\n", dwErr)); 808 hr = HRESULT_FROM_WIN32(dwErr); 809 809 } 810 810 … … 828 828 if (!dwChars || dwChars >= MAX_PATH) 829 829 { 830 NonStandardLogCrap(("GetFullPathNameW failed, WinEr(%d), dwChars(%d)\n", GetLastError(), dwChars)); 830 NonStandardLogCrap(("GetFullPathNameW failed, dwErr=%ld, dwChars=%ld\n", 831 GetLastError(), dwChars)); 831 832 return E_INVALIDARG; 832 833 } … … 839 840 &bRebootRequired)) 840 841 { 841 NonStandardLogCrap(("UpdateDriverForPlugAndPlayDevicesW failed, WinEr(%d)\n", GetLastError(), dwChars)); 842 return E_FAIL; 842 DWORD dwErr = GetLastError(); 843 NonStandardLogCrap(("UpdateDriverForPlugAndPlayDevicesW failed, dwErr=%ld\n", 844 dwErr)); 845 return HRESULT_FROM_WIN32(dwErr); 843 846 } 844 847
Note:
See TracChangeset
for help on using the changeset viewer.