Changeset 34251 in vbox
- Timestamp:
- Nov 22, 2010 3:23:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/process-win.cpp
r33540 r34251 264 264 NULL /*pszAsUser*/, NULL /* pszPassword*/, 265 265 pProcess); 266 } 267 268 269 /** 270 * Map some important or much used Windows error codes 271 * to our error codes. 272 * 273 * @return Mapped IPRT status code. 274 * @param dwError Windows error code to map to IPRT code. 275 */ 276 static int rtProcMapErrorCodes(DWORD dwError) 277 { 278 int rc; 279 switch (dwError) 280 { 281 case ERROR_NOACCESS: 282 case ERROR_PRIVILEGE_NOT_HELD: 283 rc = VERR_PERMISSION_DENIED; 284 break; 285 286 case ERROR_PASSWORD_EXPIRED: 287 case ERROR_ACCOUNT_RESTRICTION: /* See: http://support.microsoft.com/kb/303846/ */ 288 case ERROR_PASSWORD_RESTRICTION: 289 rc = VERR_AUTHENTICATION_FAILURE; 290 break; 291 292 default: 293 /* Could trigger a debug assertion! */ 294 rc = RTErrConvertFromWin32(dwError); 295 break; 296 } 297 return rc; 266 298 } 267 299 … … 505 537 static int rtProcUserLogon(PRTUTF16 pwszUser, PRTUTF16 pwszPassword, PRTUTF16 pwszDomain, HANDLE *phToken) 506 538 { 507 int rc = VINF_SUCCESS;508 539 /** @todo Add domain support! */ 509 540 BOOL fRc = LogonUserW(pwszUser, … … 521 552 phToken); 522 553 if (!fRc) 523 r c = RTErrConvertFromWin32(GetLastError());524 return rc;554 return rtProcMapErrorCodes(GetLastError()); 555 return VINF_SUCCESS; 525 556 } 526 557 … … 904 935 && dwErr != NO_ERROR) 905 936 { 906 /* 907 * Map some important or much used Windows error codes 908 * to our error codes. 909 */ 910 switch (dwErr) 911 { 912 case ERROR_NOACCESS: 913 case ERROR_PRIVILEGE_NOT_HELD: 914 rc = VERR_PERMISSION_DENIED; 915 break; 916 917 case ERROR_PASSWORD_EXPIRED: 918 case ERROR_ACCOUNT_RESTRICTION: /* See: http://support.microsoft.com/kb/303846/ */ 919 rc = VERR_AUTHENTICATION_FAILURE; 920 break; 921 922 default: 923 /* Could trigger a debug assertion! */ 924 rc = RTErrConvertFromWin32(dwErr); 925 break; 926 } 937 rc = rtProcMapErrorCodes(dwErr); 927 938 } 928 939 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.