VirtualBox

Changeset 12460 in vbox


Ignore:
Timestamp:
Sep 15, 2008 12:15:17 PM (16 years ago)
Author:
vboxsync
Message:

Proper exit paths in case of failure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/win/PerformanceWin.cpp

    r12459 r12460  
    332332        {
    333333            Log (("Failed to read 'IDProcess' property. HR = %x\n", hr));
    334             return VERR_INTERNAL_ERROR;
     334            rc = VERR_INTERNAL_ERROR;
     335            break;
    335336        }
    336337        LogFlowThisFunc (("Matching process %x against the list of machines...\n", dwIDProcess));
     
    345346            {
    346347                Log (("Failed to read 'PercentUserTime' property. HR = %x\n", hr));
    347                     return VERR_INTERNAL_ERROR;
     348                rc = VERR_INTERNAL_ERROR;
     349                break;
    348350            }
    349351            if (FAILED (hr = apEnumAccess[i]->ReadQWORD(
     
    352354            {
    353355                Log (("Failed to read 'PercentPrivilegedTime' property. HR = %x\n", hr));
    354                     return VERR_INTERNAL_ERROR;
     356                rc = VERR_INTERNAL_ERROR;
     357                break;
    355358            }
    356359            if (FAILED (hr = apEnumAccess[i]->ReadQWORD(
     
    359362            {
    360363                Log (("Failed to read 'Timestamp_Sys100NS' property. HR = %x\n", hr));
    361                     return VERR_INTERNAL_ERROR;
     364                rc = VERR_INTERNAL_ERROR;
     365                break;
    362366            }
    363367            if (FAILED (hr = apEnumAccess[i]->ReadQWORD(
     
    366370            {
    367371                Log (("Failed to read 'WorkingSet' property. HR = %x\n", hr));
    368                     return VERR_INTERNAL_ERROR;
     372                rc = VERR_INTERNAL_ERROR;
     373                break;
    369374            }
    370375
     
    373378            rc = VINF_SUCCESS;
    374379        }
     380    }
     381
     382    for (unsigned i = 0; i < dwNumReturned; i++)
     383    {
    375384        apEnumAccess[i]->Release();
    376385        apEnumAccess[i] = NULL;
     
    412421        {
    413422            Log (("Failed to read 'Name' property. HR = %x\n", hr));
    414             return VERR_INTERNAL_ERROR;
     423            rc = VERR_INTERNAL_ERROR;
     424            break;
    415425        }
    416426        if (wcscmp(tmpBuf, L"_Total") == 0)
     
    420430                user)))
    421431            {
    422             Log (("Failed to read 'PercentUserTime' property. HR = %x\n", hr));
    423                 return VERR_INTERNAL_ERROR;
     432                Log (("Failed to read 'PercentUserTime' property. HR = %x\n", hr));
     433                rc = VERR_INTERNAL_ERROR;
     434                break;
    424435            }
    425436            if (FAILED (hr = apEnumAccess[i]->ReadQWORD(
     
    427438                kernel)))
    428439            {
    429             Log (("Failed to read 'PercentPrivilegedTime' property. HR = %x\n", hr));
    430                 return VERR_INTERNAL_ERROR;
     440                Log (("Failed to read 'PercentPrivilegedTime' property. HR = %x\n", hr));
     441                rc = VERR_INTERNAL_ERROR;
     442                break;
    431443            }
    432444            if (FAILED (hr = apEnumAccess[i]->ReadQWORD(
     
    434446                idle)))
    435447            {
    436             Log (("Failed to read 'PercentProcessorTime' property. HR = %x\n", hr));
    437                 return VERR_INTERNAL_ERROR;
     448                Log (("Failed to read 'PercentProcessorTime' property. HR = %x\n", hr));
     449                rc = VERR_INTERNAL_ERROR;
     450                break;
    438451            }
    439452            rc = VINF_SUCCESS;
    440453        }
     454    }
     455    for (unsigned i = 0; i < dwNumReturned; i++)
     456    {
    441457        apEnumAccess[i]->Release();
    442458        apEnumAccess[i] = NULL;
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