Changeset 52241 in vbox for trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
- Timestamp:
- Jul 31, 2014 6:27:37 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
r44529 r52241 680 680 VBOXDRVCFG_DECL(HRESULT) VBoxDrvCfgInfUninstallAllF(LPCWSTR lpszClassName, LPCWSTR lpszPnPId, DWORD Flags) 681 681 { 682 WCHAR InfDirPath[MAX_PATH]; 683 HRESULT hr = SHGetFolderPathW(NULL, /* HWND hwndOwner*/ 684 CSIDL_WINDOWS, /* int nFolder*/ 685 NULL, /*HANDLE hToken*/ 686 SHGFP_TYPE_CURRENT, /*DWORD dwFlags*/ 687 InfDirPath); 688 NonStandardAssert(hr == S_OK); 689 if (hr == S_OK) 690 { 691 wcscat(InfDirPath, L"\\inf\\oem*.inf"); 682 static WCHAR const s_wszFilter[] = L"\\inf\\oem*.inf"; 683 HRESULT hr; 684 WCHAR wszInfDirPath[MAX_PATH]; 685 UINT cwcInput = RT_ELEMENTS(wszInfDirPath) - RT_ELEMENTS(s_wszFilter); 686 UINT cwcWindows = GetSystemWindowsDirectory(wszInfDirPath, cwcInput); 687 if (cwcWindows > 0 && cwcWindows < cwcInput) 688 { 689 wcscpy(&wszInfDirPath[cwcWindows], s_wszFilter); 692 690 693 691 INFENUM_CONTEXT Context; … … 696 694 Context.Flags = Flags; 697 695 Context.hr = S_OK; 698 hr = vboxDrvCfgEnumFiles( InfDirPath, vboxDrvCfgInfEnumerationCallback, &Context);696 hr = vboxDrvCfgEnumFiles(wszInfDirPath, vboxDrvCfgInfEnumerationCallback, &Context); 699 697 NonStandardAssert(hr == S_OK); 700 698 if (hr == S_OK) … … 709 707 else 710 708 { 711 NonStandardLogRelCrap((__FUNCTION__": SHGetFolderPathW failed, hr=0x%x\n", hr)); 709 NonStandardLogRelCrap((__FUNCTION__": GetSystemWindowsDirectory failed, cwcWindows=%u lasterr=%u\n", cwcWindows, GetLastError())); 710 NonStandardAssertFailed(); 711 hr = E_FAIL; 712 712 } 713 713
Note:
See TracChangeset
for help on using the changeset viewer.