Changeset 35834 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Feb 3, 2011 2:43:20 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69827
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp
r35709 r35834 143 143 const _TCHAR *pszLogFile) 144 144 { 145 HRESULT hr = ERROR_SUCCESS;145 HRESULT hr = S_OK; 146 146 HMODULE hDIFxAPI = LoadLibrary(_T("DIFxAPI.dll")); 147 147 if (NULL == hDIFxAPI) 148 148 { 149 149 _tprintf(_T("ERROR: Unable to locate DIFxAPI.dll!\n")); 150 hr = ERROR_FILE_NOT_FOUND;150 hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); 151 151 } 152 152 else … … 158 158 { 159 159 _tprintf(_T("ERROR: Unable to retrieve entry point for DriverPackageInstallW!\n")); 160 hr = ERROR_PROC_NOT_FOUND;160 hr = HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND); 161 161 } 162 162 } … … 167 167 { 168 168 _tprintf(_T("ERROR: Unable to retrieve entry point for DriverPackageUninstallW!\n")); 169 hr = ERROR_PROC_NOT_FOUND;169 hr = HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND); 170 170 } 171 171 } … … 177 177 { 178 178 _tprintf(_T("ERROR: Unable to retrieve entry point for DIFXAPISetLogCallbackW!\n")); 179 hr = ERROR_PROC_NOT_FOUND;179 hr = HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND); 180 180 } 181 181 } … … 184 184 if (SUCCEEDED(hr)) 185 185 { 186 FILE * fh= NULL;186 FILE *phFile = NULL; 187 187 if (pszLogFile) 188 188 { 189 fh= _wfopen(pszLogFile, _T("a"));190 if (! fh)189 phFile = _wfopen(pszLogFile, _T("a")); 190 if (!phFile) 191 191 _tprintf(_T("ERROR: Unable to create log file!\n")); 192 g_pfnDIFXAPISetLogCallback(LogCallback, fh);192 g_pfnDIFXAPISetLogCallback(LogCallback, phFile); 193 193 } 194 194 … … 205 205 { 206 206 _tprintf(_T("ERROR: INF-Path too long / could not be retrieved!\n")); 207 hr = ERROR_INVALID_PARAMETER;207 hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER); 208 208 } 209 209 else … … 301 301 break; 302 302 303 case ERROR_SHARING_VIOLATION:304 _tprintf(_T("ERROR: A component of the driver package in the DIFx driver store is locked by a thread or process\n"));305 break;303 case ERROR_SHARING_VIOLATION: 304 _tprintf(_T("ERROR: A component of the driver package in the DIFx driver store is locked by a thread or process\n")); 305 break; 306 306 307 307 /* … … 315 315 break; 316 316 317 case ERROR_UNSUPPORTED_TYPE:318 _tprintf(_T("ERROR: The driver package type is not supported of INF %ws!\n"), szDriverInf);319 break;317 case ERROR_UNSUPPORTED_TYPE: 318 _tprintf(_T("ERROR: The driver package type is not supported of INF %ws!\n"), szDriverInf); 319 break; 320 320 321 321 default: … … 328 328 } 329 329 } 330 hr = ERROR_INSTALL_FAILURE;330 hr = HRESULT_FROM_WIN32(dwRet); 331 331 } 332 332 g_pfnDIFXAPISetLogCallback(NULL, NULL); 333 if ( fh)334 fclose( fh);333 if (phFile) 334 fclose(phFile); 335 335 if (SUCCEEDED(hr)) 336 336 { 337 _tprintf(_T("Driver was installed successfully!\n")); 337 338 if (fReboot) 338 339 _tprintf(_T("A reboot is needed to complete the driver (un)installation!\n"));
Note:
See TracChangeset
for help on using the changeset viewer.