VirtualBox

Changeset 59561 in vbox


Ignore:
Timestamp:
Feb 2, 2016 6:11:18 PM (9 years ago)
Author:
vboxsync
Message:

VBoxProxyStub.c: Adjusted assertions to ignore ERROR_ACCESS_DENIED in some places and use LogRel as it may help with identifying trouble (if logging is enabled early enough).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c

    r59422 r59561  
    8686                  ((PKUSER_SHARED_DATA)MM_SHARED_USER_DATA_VA)->NtMajorVersion) >= RT_MAKE_U64(1/*Lo*/,6/*Hi*/) \
    8787      ? "VBoxProxyStub.dll" : "VBoxProxyStubLegacy.dll" )
     88
     89/** For use with AssertLogRel except a_Expr1 from assertions but not LogRel. */
     90#ifdef RT_STRICT
     91# define VBPS_LOGREL_NO_ASSERT(a_Expr1) (a_Expr)
     92#else
     93# define VBPS_LOGREL_NO_ASSERT false
     94#endif
    8895
    8996
     
    225232     * /target being set to NT51.
    226233     */
    227     AssertMsg(hrc == S_OK, ("%Rhrc\n",  hrc));
     234    AssertLogRelMsg(hrc == S_OK, ("%Rhrc\n",  hrc));
    228235    return hrc;
    229236}
     
    413420        /* Ignore access denied errors as these may easily happen for
    414421           non-admin users. Just give up when this happens */
    415         AssertMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
     422        AssertLogRelMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
    416423    }
    417424    else
    418         AssertMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
     425       AssertLogRelMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
    419426    return pState->rc = rc;
    420427}
     
    513520            return ERROR_SUCCESS;
    514521        }
    515         AssertMsgFailed(("%u\n", rc));
     522        AssertLogRelMsgFailed(("%u\n", rc));
    516523        RegCloseKey(pState->aAltDeletes[i].hkeyClasses);
    517524    }
     
    521528    else
    522529    {
    523         AssertMsgFailed(("%u\n", rc));
     530        AssertLogRelMsgFailed(("%u (%#x %s)\n", rc));
    524531        pState->rc = rc;
    525532    }
     
    556563            rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,
    557564                               &pState->hkeyClsidRootDst);
    558         AssertMsgReturnStmt(rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL,  pState->rc = rc);
     565        AssertLogRelMsgReturnStmt(rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL,  pState->rc = rc);
    559566    }
    560567
     
    570577            if (rc != ERROR_SUCCESS)
    571578            {
    572                 AssertMsgStmt(rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
     579                AssertMsgStmt(rc == ERROR_FILE_NOT_FOUND || ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
    573580                pState->aAltDeletes[i].hkeyInterface = NULL;
    574581            }
     
    702709    }
    703710
    704     AssertMsgFailed(("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, rc));
     711    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     712                    ("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, rc));
    705713    pState->rc = rc;
    706714    return rc;
     
    768776    }
    769777
    770     AssertMsgFailed(("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, rc));
     778    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     779                    ("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, rc));
    771780    pState->rc = rc;
    772781    return rc;
     
    788797        return ERROR_SUCCESS;
    789798
    790     AssertMsgFailed(("%d: close key -> %u\n", uLine, rc));
     799    AssertLogRelMsgFailed(("%d: close key -> %u\n", uLine, rc));
    791800    pState->rc = rc;
    792801    return rc;
     
    822831    else
    823832    {
    824         AssertMsgFailed(("%d: create key '%s' -> %u\n", uLine, pszKey,  rc));
     833        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     834                        ("%d: create key '%s' -> %u\n", uLine, pszKey,  rc));
    825835        pState->rc = rc;
    826836        *phkey = NULL;
     
    853863    else
    854864    {
    855         AssertMsgFailed(("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
     865        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     866                        ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
    856867        pState->rc = rc;
    857868    }
     
    883894    else
    884895    {
    885         AssertMsgFailed(("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, rc));
     896        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     897                        ("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, rc));
    886898        pState->rc = rc;
    887899    }
     
    914926    else
    915927    {
    916         AssertMsgFailed(("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
     928        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     929                        ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
    917930        pState->rc = rc;
    918931        *phkey = NULL;
     
    955968        return ERROR_SUCCESS;
    956969
    957     AssertMsgFailed(("%d: delete key '%s' -> %u\n", uLine, pszKey, rc));
     970    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     971                    ("%d: delete key '%s' -> %u\n", uLine, pszKey, rc));
    958972    pState->rc = rc;
    959973    return rc;
     
    9941008        return ERROR_SUCCESS;
    9951009
    996     AssertMsgFailed(("%d: delete key '%ls' -> %u\n", uLine, pwszKey, rc));
     1010    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
     1011                    ("%d: delete key '%ls' -> %u\n", uLine, pwszKey, rc));
    9971012    pState->rc = rc;
    9981013    return rc;
     
    10231038        {
    10241039            rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"AppID", 0 /*fOptions*/, pState->fSamDelete, &hkeyAppIds);
    1025             AssertMsgStmt(rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
     1040            AssertLogRelMsgStmt(rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
    10261041            if (rc == ERROR_SUCCESS)
    10271042            {
     
    10421057            return ERROR_SUCCESS;
    10431058    }
    1044     AssertMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
     1059    AssertLogRelMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
    10451060
    10461061    if (pState->fDelete)
     
    13151330    /* Open Classes/TypeLib/. */
    13161331    rc = vbpsCreateRegKeyA(pState, pState->hkeyClassesRootDst, "TypeLib", &hkeyTypeLibs, __LINE__);
    1317     AssertReturnVoid(rc == ERROR_SUCCESS);
     1332    if (rc != ERROR_SUCCESS)
     1333        return;
    13181334
    13191335    /* Create TypeLib/{UUID}. */
     
    14211437    Assert(pState->fUpdate && !pState->fDelete);
    14221438    rc = vbpsRegOpenInterfaceKeys(pState);
    1423     AssertReturnVoid(rc == ERROR_SUCCESS);
     1439    if (rc != ERROR_SUCCESS)
     1440        return rc;
    14241441
    14251442    /*
     
    14501467            AssertReturnVoidStmt(cMethods >= 3 && cMethods < 1024, pState->rc = ERROR_INVALID_DATA);
    14511468            sprintf(szMethods, "%u", cMethods);
    1452 
    1453             AssertReturnVoid(rc == ERROR_SUCCESS);
    14541469
    14551470            rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyInterfaceRootDst,
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