VirtualBox

Changeset 98297 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Jan 25, 2023 1:59:25 AM (23 months ago)
Author:
vboxsync
Message:

Main: rc -> hrc/vrc for all but testcases. Enabled scm rc checks accordingly. bugref:10223

File:
1 edited

Legend:

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

    r98103 r98297  
    360360
    361361    /** The current total result. */
    362     LSTATUS rc;
     362    LSTATUS lrc;
    363363
    364364    /** KEY_WOW64_32KEY, KEY_WOW64_64KEY or 0 (for default).  Allows doing all
     
    395395static LSTATUS vbpsRegInit(VBPSREGSTATE *pState, HKEY hkeyRoot, const char *pszSubRoot, bool fDelete, bool fUpdate, DWORD fSamWow)
    396396{
    397     LSTATUS rc;
     397    LSTATUS lrc;
    398398    unsigned i = 0;
    399399
     
    411411    }
    412412    pState->cAltDeletes                 = 0;
    413     pState->rc                          = ERROR_SUCCESS;
     413    pState->lrc                         = ERROR_SUCCESS;
    414414    pState->fDelete                     = fDelete;
    415415    pState->fUpdate                     = fUpdate;
     
    428428     * Open the root keys.
    429429     */
    430     rc = RegOpenKeyExA(hkeyRoot, pszSubRoot, 0 /*fOptions*/, pState->fSamBoth, &pState->hkeyClassesRootDst);
    431     if (rc == ERROR_SUCCESS)
    432     {
    433         rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"CLSID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
    434                              pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyClsidRootDst, NULL /*pdwDisposition*/);
    435         if (rc == ERROR_SUCCESS)
     430    lrc = RegOpenKeyExA(hkeyRoot, pszSubRoot, 0 /*fOptions*/, pState->fSamBoth, &pState->hkeyClassesRootDst);
     431    if (lrc == ERROR_SUCCESS)
     432    {
     433        lrc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"CLSID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
     434                              pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyClsidRootDst, NULL /*pdwDisposition*/);
     435        if (lrc == ERROR_SUCCESS)
    436436            return ERROR_SUCCESS;
    437437
    438438        /* Ignore access denied errors as these may easily happen for
    439439           non-admin users. Just give up when this happens */
    440         AssertLogRelMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
     440        AssertLogRelMsgReturn(lrc == ERROR_ACCESS_DENIED, ("%u\n", lrc), pState->lrc = lrc);
    441441    }
    442442    else
    443        AssertLogRelMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
    444     return pState->rc = rc;
     443       AssertLogRelMsgReturn(lrc == ERROR_ACCESS_DENIED, ("%u\n", lrc), pState->lrc = lrc);
     444    return pState->lrc = lrc;
    445445}
    446446
     
    453453static void vbpsRegTerm(VBPSREGSTATE *pState)
    454454{
    455     LSTATUS rc;
     455    LSTATUS lrc;
    456456    if (pState->hkeyClassesRootDst)
    457457    {
    458         rc = RegCloseKey(pState->hkeyClassesRootDst);
    459         Assert(rc == ERROR_SUCCESS);
     458        lrc = RegCloseKey(pState->hkeyClassesRootDst);
     459        Assert(lrc == ERROR_SUCCESS);
    460460        pState->hkeyClassesRootDst = NULL;
    461461    }
    462462    if (pState->hkeyClsidRootDst)
    463463    {
    464         rc = RegCloseKey(pState->hkeyClsidRootDst);
    465         Assert(rc == ERROR_SUCCESS);
     464        lrc = RegCloseKey(pState->hkeyClsidRootDst);
     465        Assert(lrc == ERROR_SUCCESS);
    466466        pState->hkeyClsidRootDst = NULL;
    467467    }
    468468    if (pState->hkeyInterfaceRootDst)
    469469    {
    470         rc = RegCloseKey(pState->hkeyInterfaceRootDst);
    471         Assert(rc == ERROR_SUCCESS);
     470        lrc = RegCloseKey(pState->hkeyInterfaceRootDst);
     471        Assert(lrc == ERROR_SUCCESS);
    472472        pState->hkeyInterfaceRootDst = NULL;
    473473    }
     
    478478        if (pState->aAltDeletes[i].hkeyClasses)
    479479        {
    480             rc = RegCloseKey(pState->aAltDeletes[i].hkeyClasses);
    481             Assert(rc == ERROR_SUCCESS);
     480            lrc = RegCloseKey(pState->aAltDeletes[i].hkeyClasses);
     481            Assert(lrc == ERROR_SUCCESS);
    482482            pState->aAltDeletes[i].hkeyClasses = NULL;
    483483        }
    484484        if (pState->aAltDeletes[i].hkeyClsid)
    485485        {
    486             rc = RegCloseKey(pState->aAltDeletes[i].hkeyClsid);
    487             Assert(rc == ERROR_SUCCESS);
     486            lrc = RegCloseKey(pState->aAltDeletes[i].hkeyClsid);
     487            Assert(lrc == ERROR_SUCCESS);
    488488            pState->aAltDeletes[i].hkeyClsid = NULL;
    489489        }
    490490        if (pState->aAltDeletes[i].hkeyInterface)
    491491        {
    492             rc = RegCloseKey(pState->aAltDeletes[i].hkeyInterface);
    493             Assert(rc == ERROR_SUCCESS);
     492            lrc = RegCloseKey(pState->aAltDeletes[i].hkeyInterface);
     493            Assert(lrc == ERROR_SUCCESS);
    494494            pState->aAltDeletes[i].hkeyInterface = NULL;
    495495        }
     
    512512{
    513513    unsigned i;
    514     LSTATUS rc;
     514    LSTATUS lrc;
    515515
    516516    /* Ignore call if not in delete mode. */
     
    520520    /* Check that there is space in the state. */
    521521    i = pState->cAltDeletes;
    522     AssertReturn(i < RT_ELEMENTS(pState->aAltDeletes), pState->rc = ERROR_TOO_MANY_NAMES);
     522    AssertReturn(i < RT_ELEMENTS(pState->aAltDeletes), pState->lrc = ERROR_TOO_MANY_NAMES);
    523523
    524524
    525525    /* Open the root. */
    526     rc = RegOpenKeyExA(hkeyAltRoot, pszAltSubRoot, 0 /*fOptions*/, pState->fSamDelete,
     526    lrc = RegOpenKeyExA(hkeyAltRoot, pszAltSubRoot, 0 /*fOptions*/, pState->fSamDelete,
    527527                       &pState->aAltDeletes[i].hkeyClasses);
    528     if (rc == ERROR_SUCCESS)
     528    if (lrc == ERROR_SUCCESS)
    529529    {
    530530        /* Try open the CLSID subkey, it's fine if it doesn't exists. */
    531         rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete,
    532                            &pState->aAltDeletes[i].hkeyClsid);
    533         if (rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND)
     531        lrc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete,
     532                            &pState->aAltDeletes[i].hkeyClsid);
     533        if (lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND)
    534534        {
    535             if (rc == ERROR_FILE_NOT_FOUND)
     535            if (lrc == ERROR_FILE_NOT_FOUND)
    536536                pState->aAltDeletes[i].hkeyClsid = NULL;
    537537            pState->cAltDeletes = i + 1;
    538538            return ERROR_SUCCESS;
    539539        }
    540         AssertLogRelMsgFailed(("%u\n", rc));
     540        AssertLogRelMsgFailed(("%u\n", lrc));
    541541        RegCloseKey(pState->aAltDeletes[i].hkeyClasses);
    542542    }
    543543    /* No need to add non-existing alternative roots, nothing to delete in the void. */
    544     else if (rc == ERROR_FILE_NOT_FOUND)
    545         rc = ERROR_SUCCESS;
     544    else if (lrc == ERROR_FILE_NOT_FOUND)
     545        lrc = ERROR_SUCCESS;
    546546    else
    547547    {
    548         AssertLogRelMsgFailed(("%u (%#x %s)\n", rc));
    549         pState->rc = rc;
     548        AssertLogRelMsgFailed(("%u (%#x %s)\n", lrc));
     549        pState->lrc = lrc;
    550550    }
    551551
    552552    pState->aAltDeletes[i].hkeyClasses = NULL;
    553553    pState->aAltDeletes[i].hkeyClsid   = NULL;
    554     return rc;
     554    return lrc;
    555555}
    556556
     
    568568{
    569569    unsigned i;
    570     LSTATUS rc;
     570    LSTATUS lrc;
    571571
    572572    /*
     
    576576    {
    577577        if (pState->fSamUpdate)
    578             rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
    579                                  pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyInterfaceRootDst, NULL /*pdwDisposition*/);
     578            lrc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
     579                                  pState->fSamBoth, NULL /*pSecAttr*/, &pState->hkeyInterfaceRootDst, NULL /*pdwDisposition*/);
    580580        else
    581             rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,
    582                                &pState->hkeyClsidRootDst);
    583         if (rc == ERROR_ACCESS_DENIED)
     581            lrc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,
     582                                &pState->hkeyClsidRootDst);
     583        if (lrc == ERROR_ACCESS_DENIED)
    584584        {
    585585            pState->hkeyInterfaceRootDst = NULL;
    586             return pState->rc = rc;
     586            return pState->lrc = lrc;
    587587        }
    588         AssertLogRelMsgReturnStmt(rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL,  pState->rc = rc);
     588        AssertLogRelMsgReturnStmt(lrc == ERROR_SUCCESS, ("%u\n", lrc), pState->hkeyInterfaceRootDst = NULL,  pState->lrc = lrc);
    589589    }
    590590
     
    596596        if (pState->aAltDeletes[i].hkeyInterface == NULL)
    597597        {
    598             rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"Interface", 0 /*fOptions*/, pState->fSamDelete,
    599                                &pState->aAltDeletes[i].hkeyInterface);
    600             if (rc != ERROR_SUCCESS)
     598            lrc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"Interface", 0 /*fOptions*/, pState->fSamDelete,
     599                                &pState->aAltDeletes[i].hkeyInterface);
     600            if (lrc != ERROR_SUCCESS)
    601601            {
    602                 AssertMsgStmt(rc == ERROR_FILE_NOT_FOUND || rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
     602                AssertMsgStmt(lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_ACCESS_DENIED, ("%u\n", lrc), pState->lrc = lrc);
    603603                pState->aAltDeletes[i].hkeyInterface = NULL;
    604604            }
     
    687687{
    688688    DWORD const cbValue = (DWORD)((RTUtf16Len(pwszValue) + 1) * sizeof(RTUTF16));
    689     LSTATUS rc;
     689    LSTATUS lrc;
    690690    Assert(pState->fUpdate);
    691691
     
    699699        PRTUTF16    pwszExistingData = (PRTUTF16)alloca(cbExistingData);
    700700        DWORD       dwExistingType;
    701         rc = RegQueryValueExW(hkey, pwszValueNm, 0 /*Reserved*/, &dwExistingType, (BYTE *)pwszExistingData, &cbExistingData);
    702         if (rc == ERROR_SUCCESS)
     701        lrc = RegQueryValueExW(hkey, pwszValueNm, 0 /*Reserved*/, &dwExistingType, (BYTE *)pwszExistingData, &cbExistingData);
     702        if (lrc == ERROR_SUCCESS)
    703703        {
    704704            if (   dwExistingType == REG_SZ
     
    718718        }
    719719        else
    720             Assert(rc == ERROR_FILE_NOT_FOUND || rc == ERROR_MORE_DATA);
     720            Assert(lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_MORE_DATA);
    721721    }
    722722
     
    724724     * Set the value.
    725725     */
    726     rc = RegSetValueExW(hkey, pwszValueNm, 0 /*Reserved*/, REG_SZ, (const BYTE *)pwszValue, cbValue);
    727     if (rc == ERROR_SUCCESS)
     726    lrc = RegSetValueExW(hkey, pwszValueNm, 0 /*Reserved*/, REG_SZ, (const BYTE *)pwszValue, cbValue);
     727    if (lrc == ERROR_SUCCESS)
    728728    {
    729729        VBSP_LOG_SET_VALUE(("vbpsSetRegValueWW: %ls/%ls=%ls (at %d)\n",
     
    732732    }
    733733
    734     AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    735                     ("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, rc));
    736     pState->rc = rc;
    737     return rc;
     734    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     735                    ("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, lrc));
     736    pState->lrc = lrc;
     737    return lrc;
    738738}
    739739
     
    752752{
    753753    DWORD const cbValue = (DWORD)strlen(pszValue) + 1;
    754     LSTATUS rc;
     754    LSTATUS lrc;
    755755    Assert(pState->fUpdate);
    756756
     
    764764        char *pszExistingData = alloca(cbExistingData);
    765765        DWORD dwExistingType;
    766         rc = RegQueryValueExA(hkey, pszValueNm, 0 /*Reserved*/, &dwExistingType, (PBYTE)pszExistingData, &cbExistingData);
    767         if (rc == ERROR_SUCCESS)
     766        lrc = RegQueryValueExA(hkey, pszValueNm, 0 /*Reserved*/, &dwExistingType, (PBYTE)pszExistingData, &cbExistingData);
     767        if (lrc == ERROR_SUCCESS)
    768768        {
    769769            if (   dwExistingType == REG_SZ
     
    785785        }
    786786        else
    787             Assert(rc == ERROR_FILE_NOT_FOUND || rc == ERROR_MORE_DATA);
     787            Assert(lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_MORE_DATA);
    788788    }
    789789
     
    791791     * Set the value.
    792792     */
    793     rc = RegSetValueExA(hkey, pszValueNm, 0 /*Reserved*/, REG_SZ, (PBYTE)pszValue, cbValue);
    794     if (rc == ERROR_SUCCESS)
     793    lrc = RegSetValueExA(hkey, pszValueNm, 0 /*Reserved*/, REG_SZ, (PBYTE)pszValue, cbValue);
     794    if (lrc == ERROR_SUCCESS)
    795795    {
    796796        VBSP_LOG_SET_VALUE(("vbpsSetRegValueAA: %ls/%s=%s (at %d)\n",
     
    799799    }
    800800
    801     AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    802                     ("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, rc));
    803     pState->rc = rc;
    804     return rc;
     801    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     802                    ("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, lrc));
     803    pState->lrc = lrc;
     804    return lrc;
    805805}
    806806
     
    816816static LSTATUS vbpsCloseKey(VBPSREGSTATE *pState, HKEY hkey, unsigned uLine)
    817817{
    818     LSTATUS rc = RegCloseKey(hkey);
    819     if (rc == ERROR_SUCCESS)
     818    LSTATUS lrc = RegCloseKey(hkey);
     819    if (lrc == ERROR_SUCCESS)
    820820        return ERROR_SUCCESS;
    821821
    822     AssertLogRelMsgFailed(("%d: close key -> %u\n", uLine, rc));
    823     pState->rc = rc;
    824     return rc;
     822    AssertLogRelMsgFailed(("%d: close key -> %u\n", uLine, lrc));
     823    pState->lrc = lrc;
     824    return lrc;
    825825}
    826826
     
    844844    HKEY hNewKey;
    845845    DWORD dwDisposition = 0;
    846     LSTATUS rc = RegCreateKeyExA(hkeyParent, pszKey, 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
    847                                  pState->fSamBoth, NULL /*pSecAttr*/, &hNewKey, &dwDisposition);
    848     if (rc == ERROR_SUCCESS)
     846    LSTATUS lrc = RegCreateKeyExA(hkeyParent, pszKey, 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
     847                                  pState->fSamBoth, NULL /*pSecAttr*/, &hNewKey, &dwDisposition);
     848    if (lrc == ERROR_SUCCESS)
    849849    {
    850850        *phkey = hNewKey;
     
    854854    else
    855855    {
    856         AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    857                         ("%d: create key '%s' -> %u\n", uLine, pszKey,  rc));
    858         pState->rc = rc;
     856        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     857                        ("%d: create key '%s' -> %u\n", uLine, pszKey,  lrc));
     858        pState->lrc = lrc;
    859859        *phkey = NULL;
    860860    }
    861     return rc;
     861    return lrc;
    862862}
    863863
     
    878878{
    879879    HKEY hNewKey;
    880     LSTATUS rc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);
    881     if (rc == ERROR_SUCCESS)
    882     {
    883         rc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine);
     880    LSTATUS lrc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);
     881    if (lrc == ERROR_SUCCESS)
     882    {
     883        lrc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine);
    884884        vbpsCloseKey(pState, hNewKey, uLine);
    885885    }
    886886    else
    887887    {
    888         AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    889                         ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
    890         pState->rc = rc;
    891     }
    892     return rc;
     888        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     889                        ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, lrc));
     890        pState->lrc = lrc;
     891    }
     892    return lrc;
    893893}
    894894
     
    909909{
    910910    HKEY hNewKey;
    911     LSTATUS rc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);
    912     if (rc == ERROR_SUCCESS)
    913     {
    914         rc = vbpsSetRegValueWW(pState, hNewKey, NULL /*pwszValueNm*/, pwszValue, uLine);
     911    LSTATUS lrc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);
     912    if (lrc == ERROR_SUCCESS)
     913    {
     914        lrc = vbpsSetRegValueWW(pState, hNewKey, NULL /*pwszValueNm*/, pwszValue, uLine);
    915915        vbpsCloseKey(pState, hNewKey, uLine);
    916916    }
    917917    else
    918918    {
    919         AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    920                         ("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, rc));
    921         pState->rc = rc;
    922     }
    923     return rc;
     919        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     920                        ("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, lrc));
     921        pState->lrc = lrc;
     922    }
     923    return lrc;
    924924}
    925925
     
    941941{
    942942    HKEY hNewKey;
    943     LSTATUS rc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);
    944     if (rc == ERROR_SUCCESS)
    945     {
    946         rc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine);
     943    LSTATUS lrc = vbpsCreateRegKeyA(pState, hkeyParent, pszKey, &hNewKey, uLine);
     944    if (lrc == ERROR_SUCCESS)
     945    {
     946        lrc = vbpsSetRegValueAA(pState, hNewKey, NULL /*pszValueNm*/, pszValue, uLine);
    947947        *phkey = hNewKey;
    948948    }
    949949    else
    950950    {
    951         AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    952                         ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
    953         pState->rc = rc;
     951        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     952                        ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, lrc));
     953        pState->lrc = lrc;
    954954        *phkey = NULL;
    955955    }
    956     return rc;
     956    return lrc;
    957957}
    958958
     
    970970static LSTATUS vbpsDeleteKeyRecursiveA(VBPSREGSTATE *pState, HKEY hkeyParent, const char *pszKey, unsigned uLine)
    971971{
    972     LSTATUS rc;
     972    LSTATUS lrc;
    973973
    974974    Assert(pState->fDelete);
    975975    Assert(pszKey);
    976     AssertReturn(*pszKey != '\0', pState->rc = ERROR_INVALID_PARAMETER);
     976    AssertReturn(*pszKey != '\0', pState->lrc = ERROR_INVALID_PARAMETER);
    977977
    978978#ifdef VBSP_LOG_ENABLED
    979979    {
    980980        HKEY hkeyLog;
    981         rc = RegOpenKeyExA(hkeyParent, pszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog);
    982         if (rc != ERROR_FILE_NOT_FOUND)
     981        lrc = RegOpenKeyExA(hkeyParent, pszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog);
     982        if (lrc != ERROR_FILE_NOT_FOUND)
    983983            VBSP_LOG_DEL_KEY(("vbpsDeleteKeyRecursiveA: %ls/%s (at %d)\n", vbpsDebugKeyToWSZ(hkeyParent), pszKey, uLine));
    984         if (rc == ERROR_SUCCESS)
     984        if (lrc == ERROR_SUCCESS)
    985985            RegCloseKey(hkeyLog);
    986986    }
    987987#endif
    988988
    989     rc = SHDeleteKeyA(hkeyParent, pszKey);
    990     if (rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND)
     989    lrc = SHDeleteKeyA(hkeyParent, pszKey);
     990    if (lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND)
    991991        return ERROR_SUCCESS;
    992992
    993     AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    994                     ("%d: delete key '%s' -> %u\n", uLine, pszKey, rc));
    995     pState->rc = rc;
    996     return rc;
     993    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     994                    ("%d: delete key '%s' -> %u\n", uLine, pszKey, lrc));
     995    pState->lrc = lrc;
     996    return lrc;
    997997}
    998998
     
    10101010static LSTATUS vbpsDeleteKeyRecursiveW(VBPSREGSTATE *pState, HKEY hkeyParent, PCRTUTF16 pwszKey, unsigned uLine)
    10111011{
    1012     LSTATUS rc;
     1012    LSTATUS lrc;
    10131013
    10141014    Assert(pState->fDelete);
    10151015    Assert(pwszKey);
    1016     AssertReturn(*pwszKey != '\0', pState->rc = ERROR_INVALID_PARAMETER);
     1016    AssertReturn(*pwszKey != '\0', pState->lrc = ERROR_INVALID_PARAMETER);
    10171017
    10181018#ifdef VBSP_LOG_ENABLED
    10191019    {
    10201020        HKEY hkeyLog;
    1021         rc = RegOpenKeyExW(hkeyParent, pwszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog);
    1022         if (rc != ERROR_FILE_NOT_FOUND)
     1021        lrc = RegOpenKeyExW(hkeyParent, pwszKey, 0 /*fOptions*/, pState->fSamDelete, &hkeyLog);
     1022        if (lrc != ERROR_FILE_NOT_FOUND)
    10231023            VBSP_LOG_DEL_KEY(("vbpsDeleteKeyRecursiveW: %ls/%ls (at %d)\n", vbpsDebugKeyToWSZ(hkeyParent), pwszKey, uLine));
    1024         if (rc == ERROR_SUCCESS)
     1024        if (lrc == ERROR_SUCCESS)
    10251025            RegCloseKey(hkeyLog);
    10261026    }
    10271027#endif
    10281028
    1029     rc = SHDeleteKeyW(hkeyParent, pwszKey);
    1030     if (rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND)
     1029    lrc = SHDeleteKeyW(hkeyParent, pwszKey);
     1030    if (lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND)
    10311031        return ERROR_SUCCESS;
    10321032
    1033     AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
    1034                     ("%d: delete key '%ls' -> %u\n", uLine, pwszKey, rc));
    1035     pState->rc = rc;
    1036     return rc;
     1033    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(lrc == ERROR_ACCESS_DENIED),
     1034                    ("%d: delete key '%ls' -> %u\n", uLine, pwszKey, lrc));
     1035    pState->lrc = lrc;
     1036    return lrc;
    10371037}
    10381038
     
    10521052                          const char *pszDescription, const char *pszServiceName)
    10531053{
    1054     LSTATUS rc;
     1054    LSTATUS lrc;
    10551055    HKEY hkeyAppIds;
    10561056    Assert(*pszAppId == '{');
     
    10641064        while (i-- > 0)
    10651065        {
    1066             rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"AppID", 0 /*fOptions*/, pState->fSamDelete, &hkeyAppIds);
    1067             AssertLogRelMsgStmt(rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
    1068             if (rc == ERROR_SUCCESS)
     1066            lrc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"AppID", 0 /*fOptions*/, pState->fSamDelete, &hkeyAppIds);
     1067            AssertLogRelMsgStmt(lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND, ("%u\n", lrc), pState->lrc = lrc);
     1068            if (lrc == ERROR_SUCCESS)
    10691069            {
    10701070                vbpsDeleteKeyRecursiveA(pState, hkeyAppIds, pszAppId, __LINE__);
     
    10761076    if (pState->fUpdate)
    10771077    {
    1078         rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
    1079                              pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/);
    1080         if (rc == ERROR_ACCESS_DENIED)
     1078        lrc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
     1079                              pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/);
     1080        if (lrc == ERROR_ACCESS_DENIED)
    10811081            return ERROR_SUCCESS;
    10821082    }
    10831083    else
    10841084    {
    1085         rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*fOptions*/, pState->fSamBoth, &hkeyAppIds);
    1086         if (rc == ERROR_FILE_NOT_FOUND || rc == ERROR_ACCESS_DENIED)
     1085        lrc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*fOptions*/, pState->fSamBoth, &hkeyAppIds);
     1086        if (lrc == ERROR_FILE_NOT_FOUND || lrc == ERROR_ACCESS_DENIED)
    10871087            return ERROR_SUCCESS;
    10881088    }
    1089     if (rc == ERROR_ACCESS_DENIED)
    1090         return pState->rc = rc;
    1091     AssertLogRelMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
     1089    if (lrc == ERROR_ACCESS_DENIED)
     1090        return pState->lrc = lrc;
     1091    AssertLogRelMsgReturn(lrc == ERROR_SUCCESS, ("%u\n", lrc), pState->lrc = lrc);
    10921092
    10931093    if (pState->fDelete)
     
    11031103    {
    11041104        HKEY hkey;
    1105         rc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszAppId, &hkey, __LINE__);
    1106         if (rc == ERROR_SUCCESS)
     1105        lrc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszAppId, &hkey, __LINE__);
     1106        if (lrc == ERROR_SUCCESS)
    11071107        {
    11081108            vbpsSetRegValueAA(pState, hkey, NULL /*pszValueNm*/, pszDescription, __LINE__);
     
    11121112        }
    11131113
    1114         rc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszModuleName, &hkey, __LINE__);
    1115         if (rc == ERROR_SUCCESS)
     1114        lrc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszModuleName, &hkey, __LINE__);
     1115        if (lrc == ERROR_SUCCESS)
    11161116        {
    11171117            vbpsSetRegValueAA(pState, hkey, NULL /*pszValueNm*/, "", __LINE__);
     
    11231123    vbpsCloseKey(pState, hkeyAppIds, __LINE__);
    11241124
    1125     return pState->rc;
     1125    return pState->lrc;
    11261126}
    11271127
     
    11421142                              const CLSID *pClsId, const char *pszCurVerSuffIfRootName)
    11431143{
    1144     LSTATUS rc;
     1144    LSTATUS lrc;
    11451145
    11461146    /*
     
    11621162        /* pszClassName/Default = description. */
    11631163        HKEY hkeyClass;
    1164         rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClassesRootDst, pszClassName, pszDescription,
    1165                                                   &hkeyClass, __LINE__);
    1166         if (rc == ERROR_SUCCESS)
     1164        lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClassesRootDst, pszClassName, pszDescription,
     1165                                                   &hkeyClass, __LINE__);
     1166        if (lrc == ERROR_SUCCESS)
    11671167        {
    11681168            char szClsId[CURLY_UUID_STR_BUF_SIZE];
     
    11751175            {
    11761176                char szCurClassNameVer[128];
    1177                 rc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName);
    1178                 if (RT_SUCCESS(rc))
    1179                     rc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurVerSuffIfRootName);
    1180                 AssertStmt(RT_SUCCESS(rc), pState->rc = rc = ERROR_INVALID_DATA);
    1181                 if (rc == ERROR_SUCCESS)
     1177                lrc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName);
     1178                if (RT_SUCCESS(lrc))
     1179                    lrc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurVerSuffIfRootName);
     1180                AssertStmt(RT_SUCCESS(lrc), pState->lrc = lrc = ERROR_INVALID_DATA);
     1181                if (lrc == ERROR_SUCCESS)
    11821182                    vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyClass, "CurVer", szCurClassNameVer, __LINE__);
    11831183            }
     
    11871187    }
    11881188
    1189     return pState->rc;
     1189    return pState->lrc;
    11901190}
    11911191
     
    12181218                            const char *pszThreadingModel)
    12191219{
    1220     LSTATUS rc;
     1220    LSTATUS lrc;
    12211221    char szClsId[CURLY_UUID_STR_BUF_SIZE];
    12221222    RT_NOREF(pszAppId);
     
    12481248    {
    12491249        HKEY hkeyClass;
    1250         rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClsidRootDst, szClsId, pszDescription,
    1251                                                   &hkeyClass, __LINE__);
    1252         if (rc == ERROR_SUCCESS)
     1250        lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyClsidRootDst, szClsId, pszDescription,
     1251                                                   &hkeyClass, __LINE__);
     1252        if (lrc == ERROR_SUCCESS)
    12531253        {
    12541254            bool const fIsLocalServer32 = strcmp(pszServerType, "LocalServer32") == 0;
     
    12571257
    12581258            /* pszServerType/Default = module. */
    1259             rc = vbpsCreateRegKeyA(pState, hkeyClass, pszServerType, &hkeyServerType, __LINE__);
    1260             if (rc == ERROR_SUCCESS)
     1259            lrc = vbpsCreateRegKeyA(pState, hkeyClass, pszServerType, &hkeyServerType, __LINE__);
     1260            if (lrc == ERROR_SUCCESS)
    12611261            {
    12621262                RTUTF16 wszModule[MAX_PATH * 2];
     
    12651265                    *pwszCur++ = '"';
    12661266
    1267                 rc = RTUtf16Copy(pwszCur, MAX_PATH, pwszVBoxDir); AssertRC(rc);
     1267                int vrc = RTUtf16Copy(pwszCur, MAX_PATH, pwszVBoxDir); AssertRC(vrc);
    12681268                pwszCur += RTUtf16Len(pwszCur);
    1269                 rc = RTUtf16CopyAscii(pwszCur, MAX_PATH - 3, pszServerSubPath); AssertRC(rc);
     1269                vrc = RTUtf16CopyAscii(pwszCur, MAX_PATH - 3, pszServerSubPath); AssertRC(vrc);
    12701270                pwszCur += RTUtf16Len(pwszCur);
    12711271
     
    12861286            if (pszClassName)
    12871287            {
    1288                 rc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName);
    1289                 if (RT_SUCCESS(rc))
    1290                     rc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurClassNameVerSuffix);
    1291                 AssertStmt(RT_SUCCESS(rc), pState->rc = rc = ERROR_INVALID_DATA);
    1292                 if (rc == ERROR_SUCCESS)
     1288                int vrc = RTStrCopy(szCurClassNameVer, sizeof(szCurClassNameVer), pszClassName);
     1289                if (RT_SUCCESS(vrc))
     1290                    vrc = RTStrCat(szCurClassNameVer, sizeof(szCurClassNameVer), pszCurClassNameVerSuffix);
     1291                AssertStmt(RT_SUCCESS(vrc), pState->lrc = lrc = ERROR_INVALID_DATA);
     1292                if (lrc == ERROR_SUCCESS)
    12931293                    vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyClass, "ProgId", szCurClassNameVer, __LINE__);
    12941294
     
    13131313    }
    13141314
    1315     return pState->rc;
     1315    return pState->lrc;
    13161316}
    13171317
     
    13931393    HKEY hkeyTypeLibs;
    13941394    HKEY hkeyTypeLibId;
    1395     LSTATUS rc;
     1395    LSTATUS lrc;
    13961396    RT_NOREF(fIs32On64);
    13971397
     
    14031403
    14041404    /* Open Classes/TypeLib/. */
    1405     rc = vbpsCreateRegKeyA(pState, pState->hkeyClassesRootDst, "TypeLib", &hkeyTypeLibs, __LINE__);
    1406     if (rc != ERROR_SUCCESS)
     1405    lrc = vbpsCreateRegKeyA(pState, pState->hkeyClassesRootDst, "TypeLib", &hkeyTypeLibs, __LINE__);
     1406    if (lrc != ERROR_SUCCESS)
    14071407        return;
    14081408
    14091409    /* Create TypeLib/{UUID}. */
    1410     rc = vbpsCreateRegKeyA(pState, hkeyTypeLibs, vbpsFormatUuidInCurly(szTypeLibId, &LIBID_VirtualBox), &hkeyTypeLibId, __LINE__);
    1411     if (rc == ERROR_SUCCESS)
     1410    lrc = vbpsCreateRegKeyA(pState, hkeyTypeLibs, vbpsFormatUuidInCurly(szTypeLibId, &LIBID_VirtualBox), &hkeyTypeLibId, __LINE__);
     1411    if (lrc == ERROR_SUCCESS)
    14121412    {
    14131413        /* {UUID}/Major.Minor/Default = pszDescription. */
     
    14151415        char szMajMin[64];
    14161416        sprintf(szMajMin, "%u.%u", kTypeLibraryMajorVersion, kTypeLibraryMinorVersion);
    1417         rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyTypeLibId, szMajMin, pszDescription, &hkeyMajMin, __LINE__);
    1418         if (rc == ERROR_SUCCESS)
     1417        lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyTypeLibId, szMajMin, pszDescription, &hkeyMajMin, __LINE__);
     1418        if (lrc == ERROR_SUCCESS)
    14191419        {
    14201420            RTUTF16 wszBuf[MAX_PATH * 2];
     
    14221422            /* {UUID}/Major.Minor/0. */
    14231423            HKEY hkey0;
    1424             rc = vbpsCreateRegKeyA(pState, hkeyMajMin, "0", &hkey0, __LINE__);
    1425             if (rc == ERROR_SUCCESS)
     1424            lrc = vbpsCreateRegKeyA(pState, hkeyMajMin, "0", &hkey0, __LINE__);
     1425            if (lrc == ERROR_SUCCESS)
    14261426            {
    14271427                /* {UUID}/Major.Minor/0/winXX/Default = VBoxProxyStub. */
    1428                 rc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(rc);
    1429                 rc = RTUtf16CatAscii(wszBuf, MAX_PATH * 2, pszTypeLibDll); AssertRC(rc);
     1428                int vrc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(vrc);
     1429                vrc = RTUtf16CatAscii(wszBuf, MAX_PATH * 2, pszTypeLibDll); AssertRC(vrc);
    14301430
    14311431                vbpsCreateRegKeyWithDefaultValueAW(pState, hkey0, pszWinXx, wszBuf, __LINE__);
     
    14371437
    14381438            /* {UUID}/Major.Minor/HELPDIR */
    1439             rc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(rc);
     1439            int vrc = RTUtf16Copy(wszBuf, MAX_PATH, pwszVBoxDir); AssertRC(vrc);
    14401440#if 0 /* MSI: trailing slash;  regsvr32/comregister: strip unnecessary trailing slash.  Go with MSI to avoid user issues. */
    14411441            {
     
    14971497    const ProxyFileInfo **ppProxyFile = &g_apProxyFiles[0];
    14981498    const ProxyFileInfo  *pProxyFile;
    1499     LSTATUS               rc;
     1499    LSTATUS               lrc;
    15001500    char                  szProxyClsId[CURLY_UUID_STR_BUF_SIZE];
    15011501    char                  szTypeLibId[CURLY_UUID_STR_BUF_SIZE];
     
    15071507
    15081508    Assert(pState->fUpdate && !pState->fDelete);
    1509     rc = vbpsRegOpenInterfaceKeys(pState);
    1510     if (rc != ERROR_SUCCESS)
     1509    lrc = vbpsRegOpenInterfaceKeys(pState);
     1510    if (lrc != ERROR_SUCCESS)
    15111511        return;
    15121512
     
    15341534            HKEY                hkeyIfId;
    15351535
    1536             AssertReturnVoidStmt(cchIfNm >= 3 && cchIfNm <= 72, pState->rc = ERROR_INVALID_DATA);
    1537 
    1538             AssertReturnVoidStmt(cMethods >= 3 && cMethods < 1024, pState->rc = ERROR_INVALID_DATA);
     1536            AssertReturnVoidStmt(cchIfNm >= 3 && cchIfNm <= 72, pState->lrc = ERROR_INVALID_DATA);
     1537
     1538            AssertReturnVoidStmt(cMethods >= 3 && cMethods < 1024, pState->lrc = ERROR_INVALID_DATA);
    15391539            sprintf(szMethods, "%u", cMethods);
    15401540
    1541             rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyInterfaceRootDst,
    1542                                                       vbpsFormatUuidInCurly(szIfId, papStubVtbls[iIf]->header.piid),
    1543                                                       pszIfNm, &hkeyIfId, __LINE__);
    1544             if (rc == ERROR_SUCCESS)
     1541            lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyInterfaceRootDst,
     1542                                                       vbpsFormatUuidInCurly(szIfId, papStubVtbls[iIf]->header.piid),
     1543                                                       pszIfNm, &hkeyIfId, __LINE__);
     1544            if (lrc == ERROR_SUCCESS)
    15451545            {
    15461546                HKEY hkeyTypeLib;
     
    15491549
    15501550                /* The MSI seems to still be putting TypeLib keys here. So, let's do that too. */
    1551                 rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyIfId, "TypeLib", szTypeLibId, &hkeyTypeLib, __LINE__);
    1552                 if (rc == ERROR_SUCCESS)
     1551                lrc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, hkeyIfId, "TypeLib", szTypeLibId, &hkeyTypeLib, __LINE__);
     1552                if (lrc == ERROR_SUCCESS)
    15531553                {
    15541554                    vbpsSetRegValueAA(pState, hkeyTypeLib, "Version", szTypeLibVersion, __LINE__);
     
    16291629#endif
    16301630    VBPSREGSTATE    State;
    1631     LSTATUS         rc;
     1631    LSTATUS         lrc;
    16321632
    16331633    /*
    16341634     * Do registration for the current execution mode of the DLL.
    16351635     */
    1636     rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL /* Alt: HKEY_LOCAL_MACHINE, "Software\\Classes", */, fDelete, fUpdate, 0);
    1637     if (rc == ERROR_SUCCESS)
     1636    lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL /* Alt: HKEY_LOCAL_MACHINE, "Software\\Classes", */, fDelete, fUpdate, 0);
     1637    if (lrc == ERROR_SUCCESS)
    16381638    {
    16391639        if (!fUpdate)
     
    16461646
    16471647        RegisterXidlModulesAndClassesGenerated(&State, pwszVBoxDir, fIs32On64);
    1648         rc = State.rc;
     1648        lrc = State.lrc;
    16491649    }
    16501650    vbpsRegTerm(&State);
     
    16531653     * Translate error code? Return.
    16541654     */
    1655     if (rc == ERROR_SUCCESS)
     1655    if (lrc == ERROR_SUCCESS)
    16561656        return S_OK;
    16571657    return E_FAIL;
     
    18801880         */
    18811881        HKEY hkeyInterfaces;
    1882         LRESULT rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"Interface",
    1883                                    0 /*fOptions*/, pState->fSamDelete, &hkeyInterfaces);
    1884         if (rc == ERROR_SUCCESS)
     1882        LRESULT lrc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"Interface",
     1883                                    0 /*fOptions*/, pState->fSamDelete, &hkeyInterfaces);
     1884        if (lrc == ERROR_SUCCESS)
    18851885        {
    18861886            /*
     
    18931893                RTUTF16 wszCurNm[128 + 48];
    18941894                DWORD   cwcCurNm = 128;
    1895                 rc = RegEnumKeyExW(hkeyInterfaces, idxKey, wszCurNm, &cwcCurNm,
    1896                                    NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/);
    1897                 if (rc == ERROR_SUCCESS)
     1895                lrc = RegEnumKeyExW(hkeyInterfaces, idxKey, wszCurNm, &cwcCurNm,
     1896                                    NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/);
     1897                if (lrc == ERROR_SUCCESS)
    18981898                {
    18991899                    /*
     
    19181918                    /* Try the TypeLib sub-key. */
    19191919                    memcpy(&wszCurNm[cwcCurNm], s_wszTypeLib, sizeof(s_wszTypeLib));
    1920                     rc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
    1921                     if (rc == ERROR_SUCCESS)
     1920                    lrc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
     1921                    if (lrc == ERROR_SUCCESS)
    19221922                    {
    19231923                        cbValue = sizeof(wszValue) - sizeof(RTUTF16);
    1924                         rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
    1925                                               &dwType, (PBYTE)&wszValue[0], &cbValue);
    1926                         if (rc != ERROR_SUCCESS || dwType != REG_SZ)
     1924                        lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
     1925                                               &dwType, (PBYTE)&wszValue[0], &cbValue);
     1926                        if (lrc != ERROR_SUCCESS || dwType != REG_SZ)
    19271927                            cbValue = 0;
    19281928                        wszValue[cbValue / sizeof(RTUTF16)] = '\0';
    19291929
    1930                         if (   rc == ERROR_SUCCESS
     1930                        if (   lrc == ERROR_SUCCESS
    19311931                            && vbpsIsTypeLibIdToRemove(wszValue))
    19321932                        {
    19331933                            /* Check the TypeLib/Version value to make sure. */
    19341934                            cbValue = sizeof(wszValue) - sizeof(RTUTF16);
    1935                             rc = RegQueryValueExW(hkeySub, L"Version", 0 /*pdwReserved*/, &dwType, (PBYTE)&wszValue[0], &cbValue);
    1936                             if (rc != ERROR_SUCCESS)
     1935                            lrc = RegQueryValueExW(hkeySub, L"Version", 0 /*pdwReserved*/, &dwType, (PBYTE)&wszValue[0], &cbValue);
     1936                            if (lrc != ERROR_SUCCESS)
    19371937                                cbValue = 0;
    19381938                            wszValue[cbValue] = '\0';
    19391939
    1940                             if (   rc == ERROR_SUCCESS
     1940                            if (   lrc == ERROR_SUCCESS
    19411941                                && vbpsIsTypeLibVersionToRemove(wszValue))
    19421942                                fDeleteMe = true;
     
    19441944                        vbpsCloseKey(pState, hkeySub, __LINE__);
    19451945                    }
    1946                     else if (rc == ERROR_FILE_NOT_FOUND)
     1946                    else if (lrc == ERROR_FILE_NOT_FOUND)
    19471947                    {
    19481948                        /* No TypeLib, try the ProxyStubClsid32 sub-key next. */
    19491949                        static RTUTF16 const    s_wszProxyStubClsid32[] = L"\\ProxyStubClsid32";
    19501950                        memcpy(&wszCurNm[cwcCurNm], s_wszProxyStubClsid32, sizeof(s_wszProxyStubClsid32));
    1951                         rc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
    1952                         if (rc == ERROR_SUCCESS)
     1951                        lrc = RegOpenKeyExW(hkeyInterfaces, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
     1952                        if (lrc == ERROR_SUCCESS)
    19531953                        {
    19541954                            cbValue = sizeof(wszValue) - sizeof(RTUTF16);
    1955                             rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
    1956                                                   &dwType, (PBYTE)&wszValue[0], &cbValue);
    1957                             if (rc != ERROR_SUCCESS || dwType != REG_SZ)
     1955                            lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
     1956                                                   &dwType, (PBYTE)&wszValue[0], &cbValue);
     1957                            if (lrc != ERROR_SUCCESS || dwType != REG_SZ)
    19581958                                cbValue = 0;
    19591959                            wszValue[cbValue / sizeof(RTUTF16)] = '\0';
    19601960
    1961                             if (   rc == ERROR_SUCCESS
     1961                            if (   lrc == ERROR_SUCCESS
    19621962                                && vbpsIsProxyStubClsIdToRemove(wszValue))
    19631963                                fDeleteMe = true;
     
    19781978                else
    19791979                {
    1980                     Assert(rc == ERROR_NO_MORE_ITEMS);
     1980                    Assert(lrc == ERROR_NO_MORE_ITEMS);
    19811981                    break;
    19821982                }
     
    20042004         */
    20052005        HKEY hkeyClsIds;
    2006         LRESULT rc;
    2007         rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete, &hkeyClsIds);
    2008         if (rc == ERROR_SUCCESS)
     2006        LRESULT lrc;
     2007        lrc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"CLSID", 0 /*fOptions*/, pState->fSamDelete, &hkeyClsIds);
     2008        if (lrc == ERROR_SUCCESS)
    20092009        {
    20102010            /*
     
    20172017                RTUTF16 wszCurNm[128 + 48];
    20182018                DWORD   cwcCurNm = 128;
    2019                 rc = RegEnumKeyExW(hkeyClsIds, idxKey, wszCurNm, &cwcCurNm,
    2020                                    NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/);
    2021                 if (rc == ERROR_SUCCESS)
     2019                lrc = RegEnumKeyExW(hkeyClsIds, idxKey, wszCurNm, &cwcCurNm,
     2020                                    NULL /*pdwReserved*/, NULL /*pwszClass*/, NULL /*pcwcClass*/, NULL /*pLastWriteTime*/);
     2021                if (lrc == ERROR_SUCCESS)
    20222022                {
    20232023                    /*
     
    20392039                    /* The TypeLib sub-key. */
    20402040                    memcpy(&wszCurNm[cwcCurNm], s_wszTypeLib, sizeof(s_wszTypeLib));
    2041                     rc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
    2042                     if (rc == ERROR_SUCCESS)
     2041                    lrc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
     2042                    if (lrc == ERROR_SUCCESS)
    20432043                    {
    20442044                        bool fDeleteMe = false;
    20452045
    20462046                        cbValue = sizeof(wszValue) - sizeof(RTUTF16);
    2047                         rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
    2048                                               &dwType, (PBYTE)&wszValue[0], &cbValue);
    2049                         if (rc != ERROR_SUCCESS || dwType != REG_SZ)
     2047                        lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
     2048                                               &dwType, (PBYTE)&wszValue[0], &cbValue);
     2049                        if (lrc != ERROR_SUCCESS || dwType != REG_SZ)
    20502050                            cbValue = 0;
    20512051                        wszValue[cbValue / sizeof(RTUTF16)] = '\0';
    20522052
    2053                         if (   rc == ERROR_SUCCESS
     2053                        if (   lrc == ERROR_SUCCESS
    20542054                            && vbpsIsTypeLibIdToRemove(wszValue))
    20552055                            fDeleteMe = true;
     
    20622062                            static RTUTF16 const    s_wszProgId[] = L"\\ProgId";
    20632063                            memcpy(&wszCurNm[cwcCurNm], s_wszProgId, sizeof(s_wszProgId));
    2064                             rc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
    2065                             if (rc == ERROR_SUCCESS)
     2064                            lrc = RegOpenKeyExW(hkeyClsIds, wszCurNm, 0 /*fOptions*/, KEY_QUERY_VALUE, &hkeySub);
     2065                            if (lrc == ERROR_SUCCESS)
    20662066                            {
    20672067                                static RTUTF16 const s_wszProgIdPrefix[] = L"VirtualBox.";
    20682068
    20692069                                cbValue = sizeof(wszValue) - sizeof(RTUTF16);
    2070                                 rc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
    2071                                                       &dwType, (PBYTE)&wszValue[0], &cbValue);
    2072                                 if (rc != ERROR_SUCCESS || dwType != REG_SZ)
     2070                                lrc = RegQueryValueExW(hkeySub, NULL /*pszValueNm*/, NULL /*pdwReserved*/,
     2071                                                       &dwType, (PBYTE)&wszValue[0], &cbValue);
     2072                                if (lrc != ERROR_SUCCESS || dwType != REG_SZ)
    20732073                                    cbValue = 0;
    20742074                                wszValue[cbValue / sizeof(RTUTF16)] = '\0';
     
    20812081                            }
    20822082                            else
    2083                                 AssertStmt(rc == ERROR_FILE_NOT_FOUND, fDeleteMe = false);
     2083                                AssertStmt(lrc == ERROR_FILE_NOT_FOUND, fDeleteMe = false);
    20842084
    20852085                            if (fDeleteMe)
     
    20942094                    }
    20952095                    else
    2096                         Assert(rc == ERROR_FILE_NOT_FOUND);
     2096                        Assert(lrc == ERROR_FILE_NOT_FOUND);
    20972097                }
    20982098                else
    20992099                {
    2100                     Assert(rc == ERROR_NO_MORE_ITEMS);
     2100                    Assert(lrc == ERROR_NO_MORE_ITEMS);
    21012101                    break;
    21022102                }
     
    21062106        }
    21072107        else
    2108             Assert(rc == ERROR_FILE_NOT_FOUND);
     2108            Assert(lrc == ERROR_FILE_NOT_FOUND);
    21092109    }
    21102110}
     
    21232123         */
    21242124        HKEY hkeyTypeLibs;
    2125         LSTATUS rc;
    2126         rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"TypeLib", 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibs);
    2127         if (rc == ERROR_SUCCESS)
     2125        LSTATUS lrc;
     2126        lrc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"TypeLib", 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibs);
     2127        if (lrc == ERROR_SUCCESS)
    21282128        {
    21292129            /*
     
    21342134            {
    21352135                HKEY hkeyTypeLibId;
    2136                 rc = RegOpenKeyExW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb], 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibId);
    2137                 if (rc == ERROR_SUCCESS)
     2136                lrc = RegOpenKeyExW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb], 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibId);
     2137                if (lrc == ERROR_SUCCESS)
    21382138                {
    21392139                    unsigned iVer = RT_ELEMENTS(g_apwszTypelibVersions);
     
    21412141                    {
    21422142                        HKEY hkeyVer;
    2143                         rc = RegOpenKeyExW(hkeyTypeLibId, g_apwszTypelibVersions[iVer], 0, KEY_READ, &hkeyVer);
    2144                         if (rc == ERROR_SUCCESS)
     2143                        lrc = RegOpenKeyExW(hkeyTypeLibId, g_apwszTypelibVersions[iVer], 0, KEY_READ, &hkeyVer);
     2144                        if (lrc == ERROR_SUCCESS)
    21452145                        {
    21462146                            char szValue[128];
    21472147                            DWORD cbValue = sizeof(szValue) - 1;
    2148                             rc = RegQueryValueExA(hkeyVer, NULL, NULL, NULL, (PBYTE)&szValue[0], &cbValue);
     2148                            lrc = RegQueryValueExA(hkeyVer, NULL, NULL, NULL, (PBYTE)&szValue[0], &cbValue);
    21492149                            vbpsCloseKey(pState, hkeyVer, __LINE__);
    2150                             if (rc == ERROR_SUCCESS)
     2150                            if (lrc == ERROR_SUCCESS)
    21512151                            {
    21522152                                szValue[cbValue] = '\0';
     
    21672167                     * The type library ID key should be empty now, so we can try remove it (non-recursively).
    21682168                     */
    2169                     rc = RegDeleteKeyW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb]);
    2170                     Assert(rc == ERROR_SUCCESS);
     2169                    lrc = RegDeleteKeyW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb]);
     2170                    Assert(lrc == ERROR_SUCCESS);
    21712171                }
    21722172            }
    21732173        }
    21742174        else
    2175             Assert(rc == ERROR_FILE_NOT_FOUND);
     2175            Assert(lrc == ERROR_FILE_NOT_FOUND);
    21762176    }
    21772177}
     
    21882188     */
    21892189    VBPSREGSTATE State;
    2190     LRESULT rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, true /*fDelete*/, false /*fUpdate*/, fSamWow);
    2191     if (rc == ERROR_SUCCESS)
     2190    LRESULT lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, true /*fDelete*/, false /*fUpdate*/, fSamWow);
     2191    if (lrc == ERROR_SUCCESS)
    21922192    {
    21932193        vbpsRegAddAltDelete(&State, HKEY_CURRENT_USER,  "Software\\Classes");
     
    23422342     */
    23432343    WCHAR wszFilePath[MAX_PATH + 2];
    2344     int rc = RTUtf16CopyAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\"");
    2345     if (RT_SUCCESS(rc))
    2346         rc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszVBoxDir);
    2347     if (RT_SUCCESS(rc))
    2348         rc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszModule);
    2349     if (RT_SUCCESS(rc))
    2350         rc = RTUtf16CatAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\"");
    2351     AssertLogRelRCReturnVoid(rc);
     2344    int vrc = RTUtf16CopyAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\"");
     2345    if (RT_SUCCESS(vrc))
     2346        vrc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszVBoxDir);
     2347    if (RT_SUCCESS(vrc))
     2348        vrc = RTUtf16Cat(wszFilePath, RT_ELEMENTS(wszFilePath), pwszModule);
     2349    if (RT_SUCCESS(vrc))
     2350        vrc = RTUtf16CatAscii(wszFilePath, RT_ELEMENTS(wszFilePath), "\"");
     2351    AssertLogRelRCReturnVoid(vrc);
    23522352
    23532353    /*
     
    24632463            else
    24642464            {
    2465                 pState->rc = GetLastError();
    2466                 LogRel(("Failed to not open service %ls for stop+delete: %u\n", pwszServiceName, pState->rc));
     2465                pState->lrc = GetLastError();
     2466                LogRel(("Failed to not open service %ls for stop+delete: %u\n", pwszServiceName, pState->lrc));
    24672467                hService = OpenServiceW(hSCM, pwszServiceName, SERVICE_CHANGE_CONFIG);
    24682468            }
     
    25062506                else
    25072507                {
    2508                     pState->rc = GetLastError();
    2509                     AssertMsgFailed(("Failed to create service '%ls': %u\n", pwszServiceName, pState->rc));
     2508                    pState->lrc = GetLastError();
     2509                    AssertMsgFailed(("Failed to create service '%ls': %u\n", pwszServiceName, pState->lrc));
    25102510                }
    25112511                CloseServiceHandle(hSCM);
     
    25132513            else
    25142514            {
    2515                 pState->rc = GetLastError();
    2516                 LogRel(("Failed to open service manager with create service access: %u\n", pState->rc));
     2515                pState->lrc = GetLastError();
     2516                LogRel(("Failed to open service manager with create service access: %u\n", pState->lrc));
    25172517            }
    25182518        }
     
    25352535DECLEXPORT(uint32_t) VbpsUpdateRegistrations(void)
    25362536{
    2537     LSTATUS         rc;
     2537    LSTATUS         lrc;
    25382538    VBPSREGSTATE    State;
    25392539#ifdef VBOX_IN_32_ON_64_MAIN_API
     
    25572557     * Update registry entries for the current CPU bitness.
    25582558     */
    2559     rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/, 0);
    2560     if (rc == ERROR_SUCCESS && !vbpsIsUpToDate(&State))
     2559    lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/, 0);
     2560    if (lrc == ERROR_SUCCESS && !vbpsIsUpToDate(&State))
    25612561    {
    25622562
     
    25702570        RegisterXidlModulesAndClassesGenerated(&State, wszVBoxDir, fIs32On64);
    25712571        vbpsMarkUpToDate(&State);
    2572         rc = State.rc;
     2572        lrc = State.lrc;
    25732573    }
    25742574    vbpsRegTerm(&State);
     
    25792579     * Update registry entries for the other CPU bitness.
    25802580     */
    2581     if (rc == ERROR_SUCCESS)
    2582     {
    2583         rc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/,
    2584                          !fIs32On64 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY);
    2585         if (rc == ERROR_SUCCESS && !vbpsIsUpToDate(&State))
     2581    if (lrc == ERROR_SUCCESS)
     2582    {
     2583        lrc = vbpsRegInit(&State, HKEY_CLASSES_ROOT, NULL, false /*fDelete*/, true /*fUpdate*/,
     2584                          !fIs32On64 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY);
     2585        if (lrc == ERROR_SUCCESS && !vbpsIsUpToDate(&State))
    25862586        {
    25872587            vbpsUpdateTypeLibRegistration(&State, wszVBoxDir, !fIs32On64);
     
    25902590            RegisterXidlModulesAndClassesGenerated(&State, wszVBoxDir, !fIs32On64);
    25912591            vbpsMarkUpToDate(&State);
    2592             rc = State.rc;
     2592            lrc = State.lrc;
    25932593        }
    25942594        vbpsRegTerm(&State);
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