Changeset 62677 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jul 29, 2016 12:39:44 PM (8 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r62490 r62677 393 393 * Display a fatal error and try call TrustedError or quit. 394 394 */ 395 DECLHIDDEN(void) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va); 395 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, 396 const char *pszMsgFmt, va_list va); 396 397 397 398 /** 398 399 * Display a fatal error and try call TrustedError or quit. 399 400 */ 400 DECLHIDDEN(void) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, ...); 401 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, 402 const char *pszMsgFmt, ...); 401 403 402 404 /** 403 405 * Display a fatal error and quit. 404 406 */ 405 DECL HIDDEN(void)supR3HardenedFatalV(const char *pszFormat, va_list va);407 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va); 406 408 407 409 /** 408 410 * Display a fatal error and quit. 409 411 */ 410 DECL HIDDEN(void)supR3HardenedFatal(const char *pszFormat, ...);412 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...); 411 413 412 414 /** -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
r62675 r62677 96 96 97 97 98 DECLHIDDEN(void) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va) 98 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, 99 const char *pszMsgFmt, va_list va) 99 100 { 100 101 va_list vaCopy; … … 106 107 107 108 108 DECLHIDDEN(void) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, ...) 109 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, 110 const char *pszMsgFmt, ...) 109 111 { 110 112 va_list va; … … 115 117 116 118 117 DECL HIDDEN(void) supR3HardenedFatalV(const char *pszFormat, va_list va)119 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va) 118 120 { 119 121 va_list vaCopy; … … 124 126 125 127 126 DECL HIDDEN(void) supR3HardenedFatal(const char *pszFormat, ...)128 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...) 127 129 { 128 130 va_list va; -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r62490 r62677 669 669 } 670 670 671 #ifndef IPRT_NO_CRT 671 672 672 673 /** … … 755 756 } 756 757 757 # ifdef IPRT_NO_CRT758 #else /* IPRT_NO_CRT */ 758 759 759 760 /** Buffer structure used by suplibHardenedOutput. */ … … 1126 1127 1127 1128 /* will never get here */ 1128 return NULL;1129 1129 } 1130 1130 … … 1334 1334 1335 1335 supR3HardenedFatal("supR3HardenedPathAppBin: Buffer too small (%u < %u)\n", cchPath, cch); 1336 return VERR_BUFFER_OVERFLOW;1336 /* not reached */ 1337 1337 } 1338 1338 … … 1524 1524 1525 1525 1526 DECLHIDDEN(void) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va) 1526 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, 1527 const char *pszMsgFmt, va_list va) 1527 1528 { 1528 1529 /* … … 1635 1636 1636 1637 1637 DECLHIDDEN(void) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, ...) 1638 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, 1639 const char *pszMsgFmt, ...) 1638 1640 { 1639 1641 va_list va; 1640 1642 va_start(va, pszMsgFmt); 1641 1643 supR3HardenedFatalMsgV(pszWhere, enmWhat, rc, pszMsgFmt, va); 1642 va_end(va);1643 } 1644 1645 1646 DECL HIDDEN(void) supR3HardenedFatalV(const char *pszFormat, va_list va)1644 /* not reached */ 1645 } 1646 1647 1648 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va) 1647 1649 { 1648 1650 supR3HardenedLog("Fatal error:\n"); … … 1679 1681 1680 1682 1681 DECL HIDDEN(void) supR3HardenedFatal(const char *pszFormat, ...)1683 DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...) 1682 1684 { 1683 1685 va_list va; 1684 1686 va_start(va, pszFormat); 1685 1687 supR3HardenedFatalV(pszFormat, va); 1686 va_end(va);1688 /* not reached */ 1687 1689 } 1688 1690 … … 2109 2111 if (fMainFlags & SUPSECMAIN_FLAGS_OSX_VM_APP) 2110 2112 pszProgName = "VirtualBox"; 2113 #else 2114 RT_NOREF1(fMainFlags); 2111 2115 #endif 2112 2116 size_t cch = suplibHardenedStrLen(pszPath); -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp
r62490 r62677 30 30 *********************************************************************************************************************************/ 31 31 #if RT_OS_WINDOWS 32 # include < Windows.h>32 # include <iprt/win/windows.h> 33 33 #endif 34 34 -
trunk/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
r62490 r62677 89 89 90 90 int ch; 91 int i = 1;92 91 RTGETOPTUNION Val; 93 92 RTGETOPTSTATE GetState; -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupVerify.cpp
r62490 r62677 60 60 }; 61 61 62 bool fKeepLoaded = false;62 //bool fKeepLoaded = false; 63 63 64 64 int ch; -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r62667 r62677 2840 2840 static bool supdrvNtProtectIsFrigginThemesService(PSUPDRVNTPROTECT pNtProtect, PEPROCESS pAnnoyingProcess) 2841 2841 { 2842 RT_NOREF1(pNtProtect); 2843 2842 2844 /* 2843 2845 * Check the process name. … … 3185 3187 supdrvNtProtectCallback_ProcessCreateNotifyEx(PEPROCESS pNewProcess, HANDLE hNewPid, PPS_CREATE_NOTIFY_INFO pInfo) 3186 3188 { 3189 RT_NOREF1(pNewProcess); 3190 3187 3191 /* 3188 3192 * Is it a new process that needs protection? … … 3266 3270 supdrvNtProtectCallback_ProcessHandlePre(PVOID pvUser, POB_PRE_OPERATION_INFORMATION pOpInfo) 3267 3271 { 3268 Assert(pvUser == NULL); 3272 Assert(pvUser == NULL); RT_NOREF1(pvUser); 3269 3273 Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE); 3270 3274 Assert(pOpInfo->ObjectType == *PsProcessType); … … 3518 3522 supdrvNtProtectCallback_ProcessHandlePost(PVOID pvUser, POB_POST_OPERATION_INFORMATION pOpInfo) 3519 3523 { 3520 Assert(pvUser == NULL); 3524 Assert(pvUser == NULL); RT_NOREF1(pvUser); 3521 3525 Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE); 3522 3526 Assert(pOpInfo->ObjectType == *PsProcessType); … … 3580 3584 supdrvNtProtectCallback_ThreadHandlePre(PVOID pvUser, POB_PRE_OPERATION_INFORMATION pOpInfo) 3581 3585 { 3582 Assert(pvUser == NULL); 3586 Assert(pvUser == NULL); RT_NOREF1(pvUser); 3583 3587 Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE); 3584 3588 Assert(pOpInfo->ObjectType == *PsThreadType); … … 3728 3732 supdrvNtProtectCallback_ThreadHandlePost(PVOID pvUser, POB_POST_OPERATION_INFORMATION pOpInfo) 3729 3733 { 3730 Assert(pvUser == NULL); 3734 Assert(pvUser == NULL); RT_NOREF1(pvUser); 3731 3735 Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE); 3732 3736 Assert(pOpInfo->ObjectType == *PsThreadType); … … 3826 3830 { 3827 3831 PSUPDRVNTPROTECT pRemoved = (PSUPDRVNTPROTECT)RTAvlPVRemove(&g_NtProtectTree, pNtProtect->AvlCore.Key); 3828 Assert(pRemoved == pNtProtect); 3832 Assert(pRemoved == pNtProtect); RT_NOREF_PV(pRemoved); 3829 3833 pNtProtect->fInTree = false; 3830 3834 } … … 3846 3850 { 3847 3851 PSUPDRVNTPROTECT pRemovedChild = (PSUPDRVNTPROTECT)RTAvlPVRemove(&g_NtProtectTree, pChild->AvlCore.Key); 3848 Assert(pRemovedChild == pChild); 3852 Assert(pRemovedChild == pChild); RT_NOREF_PV(pRemovedChild); 3849 3853 pChild->fInTree = false; 3850 3854 } … … 3919 3923 { 3920 3924 uint32_t cRefs = ASMAtomicIncU32(&pNtStub->cRefs); 3921 Assert(cRefs > 0 && cRefs < 1024); 3925 Assert(cRefs > 0 && cRefs < 1024); RT_NOREF_PV(cRefs); 3922 3926 } 3923 3927 else … … 4395 4399 # endif 4396 4400 4401 4397 4402 /** 4398 4403 * Initalizes the hardening bits. … … 4563 4568 { 4564 4569 { 4565 PsProcessType,4570 0, /* PsProcessType - imported, need runtime init, better do it explicitly. */ 4566 4571 OB_OPERATION_HANDLE_CREATE | OB_OPERATION_HANDLE_DUPLICATE, 4567 4572 supdrvNtProtectCallback_ProcessHandlePre, … … 4569 4574 }, 4570 4575 { 4571 PsThreadType,4576 0, /* PsThreadType - imported, need runtime init, better do it explicitly. */ 4572 4577 OB_OPERATION_HANDLE_CREATE | OB_OPERATION_HANDLE_DUPLICATE, 4573 4578 supdrvNtProtectCallback_ThreadHandlePre, … … 4575 4580 }, 4576 4581 }; 4582 s_aObOperations[0].ObjectType = PsProcessType; 4583 s_aObOperations[1].ObjectType = PsThreadType; 4584 4577 4585 static OB_CALLBACK_REGISTRATION s_ObCallbackReg = 4578 4586 { -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h
r62490 r62677 215 215 /** Creates a combined NT version number for simple comparisons. */ 216 216 #define SUP_MAKE_NT_VER_COMBINED(a_uMajor, a_uMinor, a_uBuild, a_uSpMajor, a_uSpMinor) \ 217 ( ((uint32_t)((a_uMajor) & UINT32_C(0xf)) << 28) \218 | ((uint32_t)((a_uMinor) & UINT32_C(0xf)) << 24) \219 | ((uint32_t)((a_uBuild) & UINT32_C(0xffff)) << 8) \220 | ((uint32_t)((a_uSpMajor) & UINT32_C(0xf)) << 4) \221 | RT_MIN((uint32_t)(a_uSpMinor),UINT32_C(0xf)) )217 ( ((uint32_t)((a_uMajor) & UINT32_C(0xf)) << 28) \ 218 | ((uint32_t)((a_uMinor) & UINT32_C(0xf)) << 24) \ 219 | ((uint32_t)((a_uBuild) & UINT32_C(0xffff)) << 8) \ 220 | ((uint32_t)((a_uSpMajor) & UINT32_C(0xf)) << 4) \ 221 | (uint32_t)((a_uSpMinor) & UINT32_C(0xf)) ) 222 222 /** Simple version of SUP_MAKE_NT_VER_COMBINED. */ 223 223 #define SUP_MAKE_NT_VER_SIMPLE(a_uMajor, a_uMinor) SUP_MAKE_NT_VER_COMBINED(a_uMajor, a_uMinor, 0, 0, 0) -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
r62490 r62677 308 308 static DECLCALLBACK(int) supHardNtViRdrMap(PRTLDRREADER pReader, const void **ppvBits) 309 309 { 310 RT_NOREF2(pReader, ppvBits); 310 311 return VERR_NOT_SUPPORTED; 311 312 } … … 315 316 static DECLCALLBACK(int) supHardNtViRdrUnmap(PRTLDRREADER pReader, const void *pvBits) 316 317 { 318 RT_NOREF2(pReader, pvBits); 317 319 return VERR_NOT_SUPPORTED; 318 320 } … … 496 498 SUP_DPRINTF(("%ls: Owner is not trusted installer (%.*Rhxs)\n", 497 499 pwszName, ((uint8_t *)pOwner)[1] /*SubAuthorityCount*/ * sizeof(ULONG) + 8, pOwner)); 500 RT_NOREF1(pwszName); 498 501 return false; 499 502 } … … 558 561 559 562 563 #if 0 /* unused */ 560 564 /** 561 565 * Simple case insensitive UTF-16 / ASCII ends-with path predicate. … … 573 577 return false; 574 578 } 579 #endif 575 580 576 581 … … 675 680 676 681 677 682 #ifndef IN_RING0 678 683 /** 679 684 * Counts slashes in the given UTF-8 path string. … … 691 696 return cSlashes; 692 697 } 698 #endif 693 699 694 700 … … 733 739 static int supHardNtViCheckIfNotSignedOk(RTLDRMOD hLdrMod, PCRTUTF16 pwszName, uint32_t fFlags, HANDLE hFile, int rc) 734 740 { 741 RT_NOREF1(hLdrMod); 742 735 743 if (fFlags & (SUPHNTVI_F_REQUIRE_BUILD_CERT | SUPHNTVI_F_REQUIRE_KERNEL_CODE_SIGNING)) 736 744 return rc; … … 1037 1045 PRTERRINFO pErrInfo, void *pvUser) 1038 1046 { 1047 RT_NOREF2(hLdrMod, enmSignature); 1048 1039 1049 /* 1040 1050 * Check out the input. … … 1214 1224 if (!fAvoidWinVerifyTrust) 1215 1225 rc = supHardenedWinVerifyImageTrust(pNtViRdr->hFile, pwszName, pNtViRdr->fFlags, rc, pfWinVerifyTrust, pErrInfo); 1226 #else 1227 RT_NOREF1(fAvoidWinVerifyTrust); 1216 1228 #endif 1217 1229 … … 1464 1476 { 1465 1477 AssertReturn(*phStore == NIL_RTCRSTORE, VERR_WRONG_ORDER); 1478 RT_NOREF1(pszErrorTag); 1466 1479 1467 1480 int rc = RTCrStoreCreateInMem(phStore, cCerts1 + cCerts2); … … 2148 2161 supR3HardenedFatalMsg(pszProgName, kSupInitOp_Integrity, rc, 2149 2162 "WinVerifyTrust failed on stub executable: %s", ErrInfoStatic.szMsg); 2163 # else 2164 RT_NOREF1(pszProgName); 2150 2165 # endif 2151 2166 … … 2209 2224 PFNWINVERIFYTRUST pfnWinVerifyTrust, HRESULT *phrcWinVerifyTrust) 2210 2225 { 2226 RT_NOREF1(fFlags); 2211 2227 if (phrcWinVerifyTrust) 2212 2228 *phrcWinVerifyTrust = S_OK; … … 2333 2349 PFNWINVERIFYTRUST pfnWinVerifyTrust) 2334 2350 { 2351 RT_NOREF1(fFlags); 2335 2352 SUP_DPRINTF(("supR3HardNtViCallWinVerifyTrustCatFile: hFile=%p pwszName=%ls\n", hFile, pwszName)); 2336 2353 … … 2728 2745 AssertMsg(RT_FAILURE_NP(rc2), 2729 2746 ("rc=%Rrc, rc2=%Rrc %s", rc, rc2, pErrInfo ? pErrInfo->pszMsg : "<no-err-info>")); 2747 RT_NOREF_PV(rc2); 2730 2748 } 2731 2749 } -
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
r62490 r62677 359 359 #ifdef IN_RING0 360 360 /* ASSUMES hProcess is the current process. */ 361 RT_NOREF1(hProcess); 361 362 /** @todo use MmCopyVirtualMemory where available! */ 362 363 int rc = RTR0MemUserCopyFrom(pvBuf, uPtr, cbRead); … … 411 412 uint32_t fCorrectProtection) 412 413 { 414 #ifndef IN_RING3 415 RT_NOREF1(fCorrectProtection); 416 #endif 413 417 AssertCompileAdjacentMembers(SUPHNTVPSTATE, abMemory, abFile); /* Use both the memory and file buffers here. Parfait might hate me for this... */ 414 418 uint32_t const cbMemory = sizeof(pThis->abMemory) + sizeof(pThis->abFile); … … 636 640 PRTLDRADDR pValue, void *pvUser) 637 641 { 642 RT_NOREF1(hLdrMod); 638 643 /*SUP_DPRINTF(("supHardNtVpGetImport: %s / %#x / %s.\n", pszModule, uSymbol, pszSymbol));*/ 639 644 PSUPHNTVPSTATE pThis = (PSUPHNTVPSTATE)pvUser; … … 720 725 * space scan. 721 726 * @param hProcess Handle to the process. 722 * @param pErrInfo Pointer to error info structure. Optional.723 */ 724 static int supHardNtVpVerifyImageMemoryCompare(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, HANDLE hProcess, PRTERRINFO pErrInfo) 725 { 727 */ 728 static int supHardNtVpVerifyImageMemoryCompare(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage) 729 { 730 726 731 /* 727 732 * Read and find the file headers. … … 1038 1043 * @param pImage The image data collected during the address 1039 1044 * space scan. 1040 * @param hProcess Handle to the process. 1041 */ 1042 static int supHardNtVpVerifyImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, HANDLE hProcess) 1045 */ 1046 static int supHardNtVpVerifyImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage) 1043 1047 { 1044 1048 /* … … 1051 1055 rc = supHardNtLdrCacheEntryVerify(pImage->pCacheEntry, pImage->Name.UniStr.Buffer, pThis->pErrInfo); 1052 1056 if (RT_SUCCESS(rc)) 1053 rc = supHardNtVpVerifyImageMemoryCompare(pThis, pImage , hProcess, pThis->pErrInfo);1057 rc = supHardNtVpVerifyImageMemoryCompare(pThis, pImage); 1054 1058 } 1055 1059 else … … 1069 1073 DECLHIDDEN(int) supHardNtVpThread(HANDLE hProcess, HANDLE hThread, PRTERRINFO pErrInfo) 1070 1074 { 1075 RT_NOREF1(hProcess); 1076 1071 1077 /* 1072 1078 * Use the ThreadAmILastThread request to check that there is only one … … 1115 1121 return supHardNtVpSetInfo1(pErrInfo, VERR_SUP_VP_DEBUGGED, 1116 1122 "Debugger attached (%#zx)", uPtr); 1123 #else 1124 RT_NOREF2(hProcess, pErrInfo); 1117 1125 #endif /* !VBOX_WITHOUT_DEBUGGER_CHECKS */ 1118 1126 return VINF_SUCCESS; … … 1201 1209 RTUTF16 wc; 1202 1210 unsigned cwcDirName = pLongName->Length / sizeof(WCHAR); 1203 PCRTUTF16 pwcDirName = &pLongName->Buffer[cwcDirName];1204 1211 PCRTUTF16 pwszFilename = &pLongName->Buffer[cwcDirName]; 1205 1212 while ( cwcDirName > 0 … … 2208 2215 * @returns VBox status code. 2209 2216 * @param pThis The process scanning state structure. Details 2210 * about images are added to this. 2211 * @param hProcess The process to verify. 2212 */ 2213 static int supHardNtVpCheckExe(PSUPHNTVPSTATE pThis, HANDLE hProcess) 2217 * about images are added to this. The hProcess 2218 * member holds the handle to the process that is 2219 * to be verified. 2220 */ 2221 static int supHardNtVpCheckExe(PSUPHNTVPSTATE pThis) 2214 2222 { 2215 2223 /* … … 2245 2253 "Error allocating %zu bytes for process name.", cbUniStr); 2246 2254 ULONG cbIgn = 0; 2247 NTSTATUS rcNt = NtQueryInformationProcess( hProcess, ProcessImageFileName, pUniStr, cbUniStr - sizeof(WCHAR), &cbIgn);2255 NTSTATUS rcNt = NtQueryInformationProcess(pThis->hProcess, ProcessImageFileName, pUniStr, cbUniStr - sizeof(WCHAR), &cbIgn); 2248 2256 if (NT_SUCCESS(rcNt)) 2249 2257 { … … 2269 2277 * This will load the fDllCharecteristics and fImageCharecteristics members we use below. 2270 2278 */ 2271 rc = supHardNtVpVerifyImage(pThis, pImage , hProcess);2279 rc = supHardNtVpVerifyImage(pThis, pImage); 2272 2280 if (RT_FAILURE(rc)) 2273 2281 return rc; … … 2279 2287 */ 2280 2288 SECTION_IMAGE_INFORMATION ImageInfo; 2281 rcNt = NtQueryInformationProcess( hProcess, ProcessImageInformation, &ImageInfo, sizeof(ImageInfo), NULL);2289 rcNt = NtQueryInformationProcess(pThis->hProcess, ProcessImageInformation, &ImageInfo, sizeof(ImageInfo), NULL); 2282 2290 if (!NT_SUCCESS(rcNt)) 2283 2291 { 2284 2292 if ( rcNt == STATUS_INVALID_PARAMETER 2285 2293 && g_uNtVerCombined < SUP_NT_VER_VISTA 2286 && hProcess != NtCurrentProcess() )2294 && pThis->hProcess != NtCurrentProcess() ) 2287 2295 return VINF_SUCCESS; 2288 2296 return supHardNtVpSetInfo2(pThis, VERR_SUP_VP_NT_QI_PROCESS_IMG_INFO_ERROR, 2289 "NtQueryInformationProcess/ProcessImageInformation failed: %#x hProcess=%#x", rcNt, hProcess); 2297 "NtQueryInformationProcess/ProcessImageInformation failed: %#x hProcess=%#x", 2298 rcNt, pThis->hProcess); 2290 2299 } 2291 2300 if ( !(ImageInfo.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY)) … … 2321 2330 * @returns VBox status code. 2322 2331 * @param pThis The process scanning state structure. Details 2323 * about images are added to this. 2324 * @param hProcess The process to verify. 2325 */ 2326 static int supHardNtVpCheckDlls(PSUPHNTVPSTATE pThis, HANDLE hProcess) 2332 * about images are added to this. The hProcess 2333 * member holds the handle to the process that is 2334 * to be verified. 2335 */ 2336 static int supHardNtVpCheckDlls(PSUPHNTVPSTATE pThis) 2327 2337 { 2328 2338 /* … … 2369 2379 while (i-- > 0) 2370 2380 { 2371 int rc = supHardNtVpVerifyImage(pThis, &pThis->aImages[i] , hProcess);2381 int rc = supHardNtVpVerifyImage(pThis, &pThis->aImages[i]); 2372 2382 if (RT_FAILURE(rc)) 2373 2383 return rc; … … 2437 2447 rc = supHardNtVpOpenImages(pThis); 2438 2448 if (RT_SUCCESS(rc)) 2439 rc = supHardNtVpCheckExe(pThis , hProcess);2449 rc = supHardNtVpCheckExe(pThis); 2440 2450 if (RT_SUCCESS(rc)) 2441 rc = supHardNtVpCheckDlls(pThis , hProcess);2451 rc = supHardNtVpCheckDlls(pThis); 2442 2452 2443 2453 if (pcFixes) -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
r62490 r62677 390 390 391 391 392 #if 0 /* unused */ 392 393 393 394 /** … … 427 428 return pwszCur - pwsz; 428 429 } 430 431 #endif /* unused */ 429 432 430 433 … … 508 511 } 509 512 supR3HardenedFatal("RTStrToUtf16Ex failed on '%s': %Rrc", pszName, rc); 510 return NULL;513 /* not reached */ 511 514 } 512 515 … … 2108 2111 pData->Loaded.FullDllName->Length / sizeof(WCHAR), pData->Loaded.FullDllName->Buffer, 2109 2112 NtPathUniStr.Length / sizeof(WCHAR), NtPathUniStr.Buffer, rcNt); 2110 RTNtPathFree(&NtPathUniStr, &hRootDir); 2111 return; 2113 /* not reached */ 2112 2114 } 2113 2115 … … 2125 2127 pData->Loaded.FullDllName->Length / sizeof(WCHAR), pData->Loaded.FullDllName->Buffer, 2126 2128 NtPathUniStr.Length / sizeof(WCHAR), NtPathUniStr.Buffer, rcNt); 2127 RTNtPathFree(&NtPathUniStr, &hRootDir); 2128 return; 2129 /* not reached */ 2129 2130 } 2130 2131 RTNtPathFree(&NtPathUniStr, &hRootDir); … … 2243 2244 SUP_DPRINTF(("supR3HardenedWinParentWatcherThread: Quitting: ExitCode=%#x rcNt=%#x\n", BasicInfo.ExitStatus, rcNt)); 2244 2245 suplibHardenedExit((RTEXITCODE)BasicInfo.ExitStatus); 2245 2246 return VINF_SUCCESS; /* won't be reached. */ 2246 /* not reached */ 2247 2247 } 2248 2248 … … 3099 3099 3100 3100 *pwszDst = '\0'; 3101 SUPR3HARDENED_ASSERT( pwszDst - pwszCmdLine== cwcCmdLine);3101 SUPR3HARDENED_ASSERT((uintptr_t)(pwszDst - pwszCmdLine) == cwcCmdLine); 3102 3102 3103 3103 if (pString) … … 3168 3168 va_start(va, pszFormat); 3169 3169 supR3HardenedFatalMsgV(pszWhere, kSupInitOp_Misc, rc, pszFormat, va); 3170 va_end(va);3170 /* not reached */ 3171 3171 } 3172 3172 … … 3497 3497 uint32_t cMsFudge = g_fSupAdversaries ? 512 : 256; 3498 3498 uint32_t cTotalFixes = 0; 3499 uint32_t cFixes ;3499 uint32_t cFixes = 0; /* (MSC wrongly thinks this maybe used uninitialized) */ 3500 3500 for (uint32_t iLoop = 0; iLoop < 16; iLoop++) 3501 3501 { … … 3895 3895 * first one, and 2 the second and final. 3896 3896 */ 3897 static voidsupR3HardenedWinDoReSpawn(int iWhich)3897 static DECL_NO_RETURN(void) supR3HardenedWinDoReSpawn(int iWhich) 3898 3898 { 3899 3899 NTSTATUS rcNt; … … 4127 4127 */ 4128 4128 supR3HardNtChildWaitFor(&This, kSupR3WinChildReq_End, RT_INDEFINITE_WAIT, "the end"); 4129 SUPR3HARDENED_ASSERT(false); /* We're not supposed to get here! */ 4129 supR3HardenedFatal("supR3HardenedWinDoReSpawn: supR3HardNtChildWaitFor unexpectedly returned!\n"); 4130 /* not reached*/ 4130 4131 } 4131 4132 … … 4188 4189 while (pObjDir->Name.Length != 0) 4189 4190 { 4190 WCHAR wcSaved = pObjDir->Name.Buffer[pObjDir->Name.Length / sizeof(WCHAR)];4191 4191 SUP_DPRINTF((" %.*ls %.*ls\n", 4192 4192 pObjDir->TypeName.Length / sizeof(WCHAR), pObjDir->TypeName.Buffer, … … 4563 4563 */ 4564 4564 supR3HardenedWinDoReSpawn(iWhich); 4565 SUPR3HARDENED_ASSERT(false); /* We're not supposed to get here! */ 4566 return RTEXITCODE_FAILURE; 4565 /* not reached! */ 4567 4566 } 4568 4567 … … 4967 4966 static void supR3HardenedLogFileInfo(PCRTUTF16 pwszFile, bool fAdversarial) 4968 4967 { 4968 RT_NOREF1(fAdversarial); 4969 4969 4970 /* 4970 4971 * Open the file. … … 5658 5659 LARGE_INTEGER Timeout; 5659 5660 Timeout.QuadPart = -300000000; /* 30 second */ 5660 NTSTATUS rcNt =NtWaitForSingleObject(g_ProcParams.hEvtChild, FALSE /*Alertable*/, &Timeout);5661 /*NTSTATUS rcNt =*/ NtWaitForSingleObject(g_ProcParams.hEvtChild, FALSE /*Alertable*/, &Timeout); 5661 5662 } 5662 5663 } -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
r62490 r62677 854 854 855 855 supR3HardenedFatal("supR3HardenedWinGetRealDllSymbol: Unknown DLL %s (proc: %s)\n", pszDll, pszProcedure); 856 return NULL;856 /* not reached */ 857 857 } 858 858 -
trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp
r62490 r62677 141 141 142 142 NTSTATUS rcNt = NtFreeVirtualMemory(NtCurrentProcess(), &pvMem, &cbMem, MEM_RELEASE); 143 Assert(NT_SUCCESS(rcNt)); 143 Assert(NT_SUCCESS(rcNt)); RT_NOREF_PV(rcNt); 144 144 SUP_DPRINTF(("supR3HardenedEarlyCompact: Removed heap %#u (%#p LB %#zx)\n", iHeap, pvMem, cbMem)); 145 145 } … … 230 230 231 231 supR3HardenedFatal("RtlCreateHeap failed.\n"); 232 return NULL;232 /* not reached */ 233 233 } 234 234 … … 267 267 RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF 268 268 { 269 RT_NOREF1(pszTag); 269 270 HANDLE hHeap = g_hSupR3HardenedHeap; 270 271 if (!hHeap) … … 285 286 RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF 286 287 { 288 RT_NOREF1(pszTag); 287 289 HANDLE hHeap = g_hSupR3HardenedHeap; 288 290 if (!hHeap) -
trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
r62490 r62677 30 30 *********************************************************************************************************************************/ 31 31 #define LOG_GROUP LOG_GROUP_SUP 32 #include < Windows.h>32 #include <iprt/win/windows.h> 33 33 34 34 #include <VBox/log.h> -
trunk/src/VBox/HostDrivers/Support/win/VBoxSupLib-win.cpp
r62490 r62677 42 42 BOOL __stdcall DllMainEntrypoint(HANDLE hModule, DWORD dwReason, PVOID pvReserved) 43 43 { 44 RT_NOREF1(pvReserved); 45 44 46 switch (dwReason) 45 47 {
Note:
See TracChangeset
for help on using the changeset viewer.