VirtualBox

Ignore:
Timestamp:
Jul 29, 2016 12:39:44 PM (8 years ago)
Author:
vboxsync
Message:

SUPHardNt: -Wall warnings.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r62490 r62677  
    393393 * Display a fatal error and try call TrustedError or quit.
    394394 */
    395 DECLHIDDEN(void)   supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va);
     395DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc,
     396                                                        const char *pszMsgFmt, va_list va);
    396397
    397398/**
    398399 * Display a fatal error and try call TrustedError or quit.
    399400 */
    400 DECLHIDDEN(void)   supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, ...);
     401DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc,
     402                                                       const char *pszMsgFmt, ...);
    401403
    402404/**
    403405 * Display a fatal error and quit.
    404406 */
    405 DECLHIDDEN(void)  supR3HardenedFatalV(const char *pszFormat, va_list va);
     407DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va);
    406408
    407409/**
    408410 * Display a fatal error and quit.
    409411 */
    410 DECLHIDDEN(void)  supR3HardenedFatal(const char *pszFormat, ...);
     412DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...);
    411413
    412414/**
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp

    r62675 r62677  
    9696
    9797
    98 DECLHIDDEN(void)   supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va)
     98DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc,
     99                                                        const char *pszMsgFmt, va_list va)
    99100{
    100101    va_list vaCopy;
     
    106107
    107108
    108 DECLHIDDEN(void)   supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, ...)
     109DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc,
     110                                                       const char *pszMsgFmt, ...)
    109111{
    110112    va_list va;
     
    115117
    116118
    117 DECLHIDDEN(void) supR3HardenedFatalV(const char *pszFormat, va_list va)
     119DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va)
    118120{
    119121    va_list vaCopy;
     
    124126
    125127
    126 DECLHIDDEN(void) supR3HardenedFatal(const char *pszFormat, ...)
     128DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...)
    127129{
    128130    va_list va;
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp

    r62490 r62677  
    669669}
    670670
     671#ifndef IPRT_NO_CRT
    671672
    672673/**
     
    755756}
    756757
    757 #ifdef IPRT_NO_CRT
     758#else /* IPRT_NO_CRT */
    758759
    759760/** Buffer structure used by suplibHardenedOutput. */
     
    11261127
    11271128    /* will never get here */
    1128     return NULL;
    11291129}
    11301130
     
    13341334
    13351335    supR3HardenedFatal("supR3HardenedPathAppBin: Buffer too small (%u < %u)\n", cchPath, cch);
    1336     return VERR_BUFFER_OVERFLOW;
     1336    /* not reached */
    13371337}
    13381338
     
    15241524
    15251525
    1526 DECLHIDDEN(void)   supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va)
     1526DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc,
     1527                                                        const char *pszMsgFmt, va_list va)
    15271528{
    15281529    /*
     
    16351636
    16361637
    1637 DECLHIDDEN(void)   supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, ...)
     1638DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc,
     1639                                                       const char *pszMsgFmt, ...)
    16381640{
    16391641    va_list va;
    16401642    va_start(va, pszMsgFmt);
    16411643    supR3HardenedFatalMsgV(pszWhere, enmWhat, rc, pszMsgFmt, va);
    1642     va_end(va);
    1643 }
    1644 
    1645 
    1646 DECLHIDDEN(void) supR3HardenedFatalV(const char *pszFormat, va_list va)
     1644    /* not reached */
     1645}
     1646
     1647
     1648DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va)
    16471649{
    16481650    supR3HardenedLog("Fatal error:\n");
     
    16791681
    16801682
    1681 DECLHIDDEN(void) supR3HardenedFatal(const char *pszFormat, ...)
     1683DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...)
    16821684{
    16831685    va_list va;
    16841686    va_start(va, pszFormat);
    16851687    supR3HardenedFatalV(pszFormat, va);
    1686     va_end(va);
     1688    /* not reached */
    16871689}
    16881690
     
    21092111    if (fMainFlags & SUPSECMAIN_FLAGS_OSX_VM_APP)
    21102112        pszProgName = "VirtualBox";
     2113#else
     2114    RT_NOREF1(fMainFlags);
    21112115#endif
    21122116    size_t cch = suplibHardenedStrLen(pszPath);
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp

    r62490 r62677  
    3030*********************************************************************************************************************************/
    3131#if RT_OS_WINDOWS
    32 # include <Windows.h>
     32# include <iprt/win/windows.h>
    3333#endif
    3434
  • trunk/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp

    r62490 r62677  
    8989
    9090    int ch;
    91     int i = 1;
    9291    RTGETOPTUNION Val;
    9392    RTGETOPTSTATE GetState;
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupVerify.cpp

    r62490 r62677  
    6060    };
    6161
    62     bool fKeepLoaded = false;
     62    //bool fKeepLoaded = false;
    6363
    6464    int ch;
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r62667 r62677  
    28402840static bool supdrvNtProtectIsFrigginThemesService(PSUPDRVNTPROTECT pNtProtect, PEPROCESS pAnnoyingProcess)
    28412841{
     2842    RT_NOREF1(pNtProtect);
     2843
    28422844    /*
    28432845     * Check the process name.
     
    31853187supdrvNtProtectCallback_ProcessCreateNotifyEx(PEPROCESS pNewProcess, HANDLE hNewPid, PPS_CREATE_NOTIFY_INFO pInfo)
    31863188{
     3189    RT_NOREF1(pNewProcess);
     3190
    31873191    /*
    31883192     * Is it a new process that needs protection?
     
    32663270supdrvNtProtectCallback_ProcessHandlePre(PVOID pvUser, POB_PRE_OPERATION_INFORMATION pOpInfo)
    32673271{
    3268     Assert(pvUser == NULL);
     3272    Assert(pvUser == NULL); RT_NOREF1(pvUser);
    32693273    Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE);
    32703274    Assert(pOpInfo->ObjectType == *PsProcessType);
     
    35183522supdrvNtProtectCallback_ProcessHandlePost(PVOID pvUser, POB_POST_OPERATION_INFORMATION pOpInfo)
    35193523{
    3520     Assert(pvUser == NULL);
     3524    Assert(pvUser == NULL); RT_NOREF1(pvUser);
    35213525    Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE);
    35223526    Assert(pOpInfo->ObjectType == *PsProcessType);
     
    35803584supdrvNtProtectCallback_ThreadHandlePre(PVOID pvUser, POB_PRE_OPERATION_INFORMATION pOpInfo)
    35813585{
    3582     Assert(pvUser == NULL);
     3586    Assert(pvUser == NULL); RT_NOREF1(pvUser);
    35833587    Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE);
    35843588    Assert(pOpInfo->ObjectType == *PsThreadType);
     
    37283732supdrvNtProtectCallback_ThreadHandlePost(PVOID pvUser, POB_POST_OPERATION_INFORMATION pOpInfo)
    37293733{
    3730     Assert(pvUser == NULL);
     3734    Assert(pvUser == NULL); RT_NOREF1(pvUser);
    37313735    Assert(pOpInfo->Operation == OB_OPERATION_HANDLE_CREATE || pOpInfo->Operation == OB_OPERATION_HANDLE_DUPLICATE);
    37323736    Assert(pOpInfo->ObjectType == *PsThreadType);
     
    38263830        {
    38273831            PSUPDRVNTPROTECT pRemoved = (PSUPDRVNTPROTECT)RTAvlPVRemove(&g_NtProtectTree, pNtProtect->AvlCore.Key);
    3828             Assert(pRemoved == pNtProtect);
     3832            Assert(pRemoved == pNtProtect); RT_NOREF_PV(pRemoved);
    38293833            pNtProtect->fInTree = false;
    38303834        }
     
    38463850                    {
    38473851                        PSUPDRVNTPROTECT pRemovedChild = (PSUPDRVNTPROTECT)RTAvlPVRemove(&g_NtProtectTree, pChild->AvlCore.Key);
    3848                         Assert(pRemovedChild == pChild);
     3852                        Assert(pRemovedChild == pChild); RT_NOREF_PV(pRemovedChild);
    38493853                        pChild->fInTree = false;
    38503854                    }
     
    39193923            {
    39203924                uint32_t cRefs = ASMAtomicIncU32(&pNtStub->cRefs);
    3921                 Assert(cRefs > 0 && cRefs < 1024);
     3925                Assert(cRefs > 0 && cRefs < 1024); RT_NOREF_PV(cRefs);
    39223926            }
    39233927            else
     
    43954399# endif
    43964400
     4401
    43974402/**
    43984403 * Initalizes the hardening bits.
     
    45634568                    {
    45644569                        {
    4565                             PsProcessType,
     4570                            0, /* PsProcessType - imported, need runtime init, better do it explicitly. */
    45664571                            OB_OPERATION_HANDLE_CREATE | OB_OPERATION_HANDLE_DUPLICATE,
    45674572                            supdrvNtProtectCallback_ProcessHandlePre,
     
    45694574                        },
    45704575                        {
    4571                             PsThreadType,
     4576                            0, /* PsThreadType - imported, need runtime init, better do it explicitly. */
    45724577                            OB_OPERATION_HANDLE_CREATE | OB_OPERATION_HANDLE_DUPLICATE,
    45734578                            supdrvNtProtectCallback_ThreadHandlePre,
     
    45754580                        },
    45764581                    };
     4582                    s_aObOperations[0].ObjectType = PsProcessType;
     4583                    s_aObOperations[1].ObjectType = PsThreadType;
     4584
    45774585                    static OB_CALLBACK_REGISTRATION s_ObCallbackReg =
    45784586                    {
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerify-win.h

    r62490 r62677  
    215215/** Creates a combined NT version number for simple comparisons. */
    216216#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)) )
    222222/** Simple version of SUP_MAKE_NT_VER_COMBINED. */
    223223#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  
    308308static DECLCALLBACK(int) supHardNtViRdrMap(PRTLDRREADER pReader, const void **ppvBits)
    309309{
     310    RT_NOREF2(pReader, ppvBits);
    310311    return VERR_NOT_SUPPORTED;
    311312}
     
    315316static DECLCALLBACK(int) supHardNtViRdrUnmap(PRTLDRREADER pReader, const void *pvBits)
    316317{
     318    RT_NOREF2(pReader, pvBits);
    317319    return VERR_NOT_SUPPORTED;
    318320}
     
    496498    SUP_DPRINTF(("%ls: Owner is not trusted installer (%.*Rhxs)\n",
    497499                 pwszName, ((uint8_t *)pOwner)[1] /*SubAuthorityCount*/ * sizeof(ULONG) + 8, pOwner));
     500    RT_NOREF1(pwszName);
    498501    return false;
    499502}
     
    558561
    559562
     563#if 0 /* unused */
    560564/**
    561565 * Simple case insensitive UTF-16 / ASCII ends-with path predicate.
     
    573577    return false;
    574578}
     579#endif
    575580
    576581
     
    675680
    676681
    677 
     682#ifndef IN_RING0
    678683/**
    679684 * Counts slashes in the given UTF-8 path string.
     
    691696    return cSlashes;
    692697}
     698#endif
    693699
    694700
     
    733739static int supHardNtViCheckIfNotSignedOk(RTLDRMOD hLdrMod, PCRTUTF16 pwszName, uint32_t fFlags, HANDLE hFile, int rc)
    734740{
     741    RT_NOREF1(hLdrMod);
     742
    735743    if (fFlags & (SUPHNTVI_F_REQUIRE_BUILD_CERT | SUPHNTVI_F_REQUIRE_KERNEL_CODE_SIGNING))
    736744        return rc;
     
    10371045                                             PRTERRINFO pErrInfo, void *pvUser)
    10381046{
     1047    RT_NOREF2(hLdrMod, enmSignature);
     1048
    10391049    /*
    10401050     * Check out the input.
     
    12141224    if (!fAvoidWinVerifyTrust)
    12151225        rc = supHardenedWinVerifyImageTrust(pNtViRdr->hFile, pwszName, pNtViRdr->fFlags, rc, pfWinVerifyTrust, pErrInfo);
     1226#else
     1227    RT_NOREF1(fAvoidWinVerifyTrust);
    12161228#endif
    12171229
     
    14641476{
    14651477    AssertReturn(*phStore == NIL_RTCRSTORE, VERR_WRONG_ORDER);
     1478    RT_NOREF1(pszErrorTag);
    14661479
    14671480    int rc = RTCrStoreCreateInMem(phStore, cCerts1 + cCerts2);
     
    21482161        supR3HardenedFatalMsg(pszProgName, kSupInitOp_Integrity, rc,
    21492162                              "WinVerifyTrust failed on stub executable: %s", ErrInfoStatic.szMsg);
     2163# else
     2164    RT_NOREF1(pszProgName);
    21502165# endif
    21512166
     
    22092224                                           PFNWINVERIFYTRUST pfnWinVerifyTrust, HRESULT *phrcWinVerifyTrust)
    22102225{
     2226    RT_NOREF1(fFlags);
    22112227    if (phrcWinVerifyTrust)
    22122228        *phrcWinVerifyTrust = S_OK;
     
    23332349                                                  PFNWINVERIFYTRUST pfnWinVerifyTrust)
    23342350{
     2351    RT_NOREF1(fFlags);
    23352352    SUP_DPRINTF(("supR3HardNtViCallWinVerifyTrustCatFile: hFile=%p pwszName=%ls\n", hFile, pwszName));
    23362353
     
    27282745                        AssertMsg(RT_FAILURE_NP(rc2),
    27292746                                  ("rc=%Rrc, rc2=%Rrc %s", rc, rc2, pErrInfo ? pErrInfo->pszMsg : "<no-err-info>"));
     2747                        RT_NOREF_PV(rc2);
    27302748                    }
    27312749                }
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp

    r62490 r62677  
    359359#ifdef IN_RING0
    360360    /* ASSUMES hProcess is the current process. */
     361    RT_NOREF1(hProcess);
    361362    /** @todo use MmCopyVirtualMemory where available! */
    362363    int rc = RTR0MemUserCopyFrom(pvBuf, uPtr, cbRead);
     
    411412                                            uint32_t fCorrectProtection)
    412413{
     414#ifndef IN_RING3
     415    RT_NOREF1(fCorrectProtection);
     416#endif
    413417    AssertCompileAdjacentMembers(SUPHNTVPSTATE, abMemory, abFile); /* Use both the memory and file buffers here. Parfait might hate me for this... */
    414418    uint32_t  const cbMemory = sizeof(pThis->abMemory) + sizeof(pThis->abFile);
     
    636640                                              PRTLDRADDR pValue, void *pvUser)
    637641{
     642    RT_NOREF1(hLdrMod);
    638643    /*SUP_DPRINTF(("supHardNtVpGetImport: %s / %#x / %s.\n", pszModule, uSymbol, pszSymbol));*/
    639644    PSUPHNTVPSTATE pThis = (PSUPHNTVPSTATE)pvUser;
     
    720725 *                              space scan.
    721726 * @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 */
     728static int supHardNtVpVerifyImageMemoryCompare(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage)
     729{
     730
    726731    /*
    727732     * Read and find the file headers.
     
    10381043 * @param   pImage              The image data collected during the address
    10391044 *                              space scan.
    1040  * @param   hProcess            Handle to the process.
    1041  */
    1042 static int supHardNtVpVerifyImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage, HANDLE hProcess)
     1045 */
     1046static int supHardNtVpVerifyImage(PSUPHNTVPSTATE pThis, PSUPHNTVPIMAGE pImage)
    10431047{
    10441048    /*
     
    10511055        rc = supHardNtLdrCacheEntryVerify(pImage->pCacheEntry, pImage->Name.UniStr.Buffer, pThis->pErrInfo);
    10521056        if (RT_SUCCESS(rc))
    1053             rc = supHardNtVpVerifyImageMemoryCompare(pThis, pImage, hProcess, pThis->pErrInfo);
     1057            rc = supHardNtVpVerifyImageMemoryCompare(pThis, pImage);
    10541058    }
    10551059    else
     
    10691073DECLHIDDEN(int) supHardNtVpThread(HANDLE hProcess, HANDLE hThread, PRTERRINFO pErrInfo)
    10701074{
     1075    RT_NOREF1(hProcess);
     1076
    10711077    /*
    10721078     * Use the ThreadAmILastThread request to check that there is only one
     
    11151121        return supHardNtVpSetInfo1(pErrInfo, VERR_SUP_VP_DEBUGGED,
    11161122                                   "Debugger attached (%#zx)", uPtr);
     1123#else
     1124    RT_NOREF2(hProcess, pErrInfo);
    11171125#endif /* !VBOX_WITHOUT_DEBUGGER_CHECKS */
    11181126    return VINF_SUCCESS;
     
    12011209    RTUTF16   wc;
    12021210    unsigned  cwcDirName   = pLongName->Length / sizeof(WCHAR);
    1203     PCRTUTF16 pwcDirName   = &pLongName->Buffer[cwcDirName];
    12041211    PCRTUTF16 pwszFilename = &pLongName->Buffer[cwcDirName];
    12051212    while (   cwcDirName > 0
     
    22082215 * @returns VBox status code.
    22092216 * @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 */
     2221static int supHardNtVpCheckExe(PSUPHNTVPSTATE pThis)
    22142222{
    22152223    /*
     
    22452253                                  "Error allocating %zu bytes for process name.", cbUniStr);
    22462254    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);
    22482256    if (NT_SUCCESS(rcNt))
    22492257    {
     
    22692277     * This will load the fDllCharecteristics and fImageCharecteristics members we use below.
    22702278     */
    2271     rc = supHardNtVpVerifyImage(pThis, pImage, hProcess);
     2279    rc = supHardNtVpVerifyImage(pThis, pImage);
    22722280    if (RT_FAILURE(rc))
    22732281        return rc;
     
    22792287     */
    22802288    SECTION_IMAGE_INFORMATION ImageInfo;
    2281     rcNt = NtQueryInformationProcess(hProcess, ProcessImageInformation, &ImageInfo, sizeof(ImageInfo), NULL);
     2289    rcNt = NtQueryInformationProcess(pThis->hProcess, ProcessImageInformation, &ImageInfo, sizeof(ImageInfo), NULL);
    22822290    if (!NT_SUCCESS(rcNt))
    22832291    {
    22842292        if (   rcNt == STATUS_INVALID_PARAMETER
    22852293            && g_uNtVerCombined < SUP_NT_VER_VISTA
    2286             && hProcess != NtCurrentProcess() )
     2294            && pThis->hProcess != NtCurrentProcess() )
    22872295            return VINF_SUCCESS;
    22882296        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);
    22902299    }
    22912300    if ( !(ImageInfo.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY))
     
    23212330 * @returns VBox status code.
    23222331 * @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 */
     2336static int supHardNtVpCheckDlls(PSUPHNTVPSTATE pThis)
    23272337{
    23282338    /*
     
    23692379    while (i-- > 0)
    23702380    {
    2371         int rc = supHardNtVpVerifyImage(pThis, &pThis->aImages[i], hProcess);
     2381        int rc = supHardNtVpVerifyImage(pThis, &pThis->aImages[i]);
    23722382        if (RT_FAILURE(rc))
    23732383            return rc;
     
    24372447                rc = supHardNtVpOpenImages(pThis);
    24382448            if (RT_SUCCESS(rc))
    2439                 rc = supHardNtVpCheckExe(pThis, hProcess);
     2449                rc = supHardNtVpCheckExe(pThis);
    24402450            if (RT_SUCCESS(rc))
    2441                 rc = supHardNtVpCheckDlls(pThis, hProcess);
     2451                rc = supHardNtVpCheckDlls(pThis);
    24422452
    24432453            if (pcFixes)
  • trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp

    r62490 r62677  
    390390
    391391
     392#if 0 /* unused */
    392393
    393394/**
     
    427428    return pwszCur - pwsz;
    428429}
     430
     431#endif /* unused */
    429432
    430433
     
    508511    }
    509512    supR3HardenedFatal("RTStrToUtf16Ex failed on '%s': %Rrc", pszName, rc);
    510     return NULL;
     513    /* not reached */
    511514}
    512515
     
    21082111                               pData->Loaded.FullDllName->Length / sizeof(WCHAR), pData->Loaded.FullDllName->Buffer,
    21092112                               NtPathUniStr.Length / sizeof(WCHAR), NtPathUniStr.Buffer, rcNt);
    2110             RTNtPathFree(&NtPathUniStr, &hRootDir);
    2111             return;
     2113            /* not reached */
    21122114        }
    21132115
     
    21252127                               pData->Loaded.FullDllName->Length / sizeof(WCHAR), pData->Loaded.FullDllName->Buffer,
    21262128                               NtPathUniStr.Length / sizeof(WCHAR), NtPathUniStr.Buffer, rcNt);
    2127             RTNtPathFree(&NtPathUniStr, &hRootDir);
    2128             return;
     2129            /* not reached */
    21292130        }
    21302131        RTNtPathFree(&NtPathUniStr, &hRootDir);
     
    22432244    SUP_DPRINTF(("supR3HardenedWinParentWatcherThread: Quitting: ExitCode=%#x rcNt=%#x\n", BasicInfo.ExitStatus, rcNt));
    22442245    suplibHardenedExit((RTEXITCODE)BasicInfo.ExitStatus);
    2245 
    2246     return VINF_SUCCESS; /* won't be reached. */
     2246    /* not reached */
    22472247}
    22482248
     
    30993099
    31003100    *pwszDst = '\0';
    3101     SUPR3HARDENED_ASSERT(pwszDst - pwszCmdLine == cwcCmdLine);
     3101    SUPR3HARDENED_ASSERT((uintptr_t)(pwszDst - pwszCmdLine) == cwcCmdLine);
    31023102
    31033103    if (pString)
     
    31683168    va_start(va, pszFormat);
    31693169    supR3HardenedFatalMsgV(pszWhere, kSupInitOp_Misc, rc, pszFormat, va);
    3170     va_end(va);
     3170    /* not reached */
    31713171}
    31723172
     
    34973497    uint32_t cMsFudge        = g_fSupAdversaries ? 512 : 256;
    34983498    uint32_t cTotalFixes     = 0;
    3499     uint32_t cFixes;
     3499    uint32_t cFixes          = 0; /* (MSC wrongly thinks this maybe used uninitialized) */
    35003500    for (uint32_t iLoop = 0; iLoop < 16; iLoop++)
    35013501    {
     
    38953895 *                              first one, and 2 the second and final.
    38963896 */
    3897 static void supR3HardenedWinDoReSpawn(int iWhich)
     3897static DECL_NO_RETURN(void) supR3HardenedWinDoReSpawn(int iWhich)
    38983898{
    38993899    NTSTATUS                        rcNt;
     
    41274127     */
    41284128    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*/
    41304131}
    41314132
     
    41884189        while (pObjDir->Name.Length != 0)
    41894190        {
    4190             WCHAR wcSaved = pObjDir->Name.Buffer[pObjDir->Name.Length / sizeof(WCHAR)];
    41914191            SUP_DPRINTF(("  %.*ls  %.*ls\n",
    41924192                         pObjDir->TypeName.Length / sizeof(WCHAR), pObjDir->TypeName.Buffer,
     
    45634563     */
    45644564    supR3HardenedWinDoReSpawn(iWhich);
    4565     SUPR3HARDENED_ASSERT(false); /* We're not supposed to get here! */
    4566     return RTEXITCODE_FAILURE;
     4565    /* not reached! */
    45674566}
    45684567
     
    49674966static void supR3HardenedLogFileInfo(PCRTUTF16 pwszFile, bool fAdversarial)
    49684967{
     4968    RT_NOREF1(fAdversarial);
     4969
    49694970    /*
    49704971     * Open the file.
     
    56585659        LARGE_INTEGER Timeout;
    56595660        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);
    56615662    }
    56625663}
  • trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp

    r62490 r62677  
    854854
    855855    supR3HardenedFatal("supR3HardenedWinGetRealDllSymbol: Unknown DLL %s (proc: %s)\n", pszDll, pszProcedure);
    856     return NULL;
     856    /* not reached */
    857857}
    858858
  • trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp

    r62490 r62677  
    141141
    142142            NTSTATUS rcNt = NtFreeVirtualMemory(NtCurrentProcess(), &pvMem, &cbMem, MEM_RELEASE);
    143             Assert(NT_SUCCESS(rcNt));
     143            Assert(NT_SUCCESS(rcNt)); RT_NOREF_PV(rcNt);
    144144            SUP_DPRINTF(("supR3HardenedEarlyCompact: Removed heap %#u (%#p LB %#zx)\n", iHeap, pvMem, cbMem));
    145145        }
     
    230230
    231231    supR3HardenedFatal("RtlCreateHeap failed.\n");
    232     return NULL;
     232    /* not reached */
    233233}
    234234
     
    267267RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
    268268{
     269    RT_NOREF1(pszTag);
    269270    HANDLE hHeap = g_hSupR3HardenedHeap;
    270271    if (!hHeap)
     
    285286RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
    286287{
     288    RT_NOREF1(pszTag);
    287289    HANDLE hHeap = g_hSupR3HardenedHeap;
    288290    if (!hHeap)
  • trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp

    r62490 r62677  
    3030*********************************************************************************************************************************/
    3131#define LOG_GROUP   LOG_GROUP_SUP
    32 #include <Windows.h>
     32#include <iprt/win/windows.h>
    3333
    3434#include <VBox/log.h>
  • trunk/src/VBox/HostDrivers/Support/win/VBoxSupLib-win.cpp

    r62490 r62677  
    4242BOOL __stdcall DllMainEntrypoint(HANDLE hModule, DWORD dwReason, PVOID pvReserved)
    4343{
     44    RT_NOREF1(pvReserved);
     45
    4446    switch (dwReason)
    4547    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette