VirtualBox

Changeset 11266 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 8, 2008 4:14:51 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34348
Message:

Devices: VBOX_SUCCESS/FAILURE -> RT_SUCCESS/FAILURE.

Location:
trunk/src/VBox/Devices
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchAc97.cpp

    r11167 r11266  
    14031403                                      ichac97IOPortNABMWrite, ichac97IOPortNABMRead,
    14041404                                      NULL, NULL, "ICHAC97 NABM");
    1405     if (VBOX_FAILURE(rc))
     1405    if (RT_FAILURE(rc))
    14061406        return rc;
    14071407
     
    16221622     */
    16231623    rc = PDMDevHlpPCIRegister (pDevIns, &pData->dev);
    1624     if (VBOX_FAILURE (rc))
     1624    if (RT_FAILURE (rc))
    16251625        return rc;
    16261626
    16271627    rc = PDMDevHlpPCIIORegionRegister (pDevIns, 0, 256, PCI_ADDRESS_SPACE_IO,
    16281628                                       ichac97IOPortMap);
    1629     if (VBOX_FAILURE (rc))
     1629    if (RT_FAILURE (rc))
    16301630        return rc;
    16311631
    16321632    rc = PDMDevHlpPCIIORegionRegister (pDevIns, 1, 64, PCI_ADDRESS_SPACE_IO,
    16331633                                       ichac97IOPortMap);
    1634     if (VBOX_FAILURE (rc))
     1634    if (RT_FAILURE (rc))
    16351635        return rc;
    16361636
     
    16391639                               NULL, ichac97SaveExec, NULL,
    16401640                               NULL, ichac97LoadExec, NULL);
    1641     if (VBOX_FAILURE (rc))
     1641    if (RT_FAILURE (rc))
    16421642        return rc;
    16431643
     
    16491649    if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    16501650        Log (("ac97: No attached driver!\n"));
    1651     else if (VBOX_FAILURE (rc))
     1651    else if (RT_FAILURE (rc))
    16521652    {
    16531653        AssertMsgFailed (("Failed to attach AC97 LUN #0! rc=%Vrc\n", rc));
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r11168 r11266  
    17471747     */
    17481748    rc = CFGMR3QuerySIntDef(pCfgHandle, "IRQ", &s->irq, 5);
    1749     if (VBOX_FAILURE(rc))
     1749    if (RT_FAILURE(rc))
    17501750        return PDMDEV_SET_ERROR(pDevIns, rc,
    17511751                                N_("Configuration error: Failed to get the \"IRQ\" value"));
    17521752
    17531753    rc = CFGMR3QuerySIntDef(pCfgHandle, "DMA", &s->dma, 1);
    1754     if (VBOX_FAILURE(rc))
     1754    if (RT_FAILURE(rc))
    17551755        return PDMDEV_SET_ERROR(pDevIns, rc,
    17561756                                N_("Configuration error: Failed to get the \"DMA\" value"));
    17571757
    17581758    rc = CFGMR3QuerySIntDef(pCfgHandle, "DMA16", &s->hdma, 5);
    1759     if (VBOX_FAILURE(rc))
     1759    if (RT_FAILURE(rc))
    17601760        return PDMDEV_SET_ERROR(pDevIns, rc,
    17611761                                N_("Configuration error: Failed to get the \"DMA16\" value"));
     
    17631763    RTIOPORT Port;
    17641764    rc = CFGMR3QueryPortDef(pCfgHandle, "Port", &Port, 0x220);
    1765     if (VBOX_FAILURE(rc))
     1765    if (RT_FAILURE(rc))
    17661766        return PDMDEV_SET_ERROR(pDevIns, rc,
    17671767                                N_("Configuration error: Failed to get the \"Port\" value"));
     
    17701770    uint16_t u16Version;
    17711771    rc = CFGMR3QueryU16Def(pCfgHandle, "Version", &u16Version, 0x0405);
    1772     if (VBOX_FAILURE(rc))
     1772    if (RT_FAILURE(rc))
    17731773        return PDMDEV_SET_ERROR(pDevIns, rc,
    17741774                                N_("Configuration error: Failed to get the \"Version\" value"));
     
    17951795     */
    17961796    rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, sb16Timer, "SB16 timer", &s->pTimer);
    1797     if (VBOX_FAILURE(rc))
     1797    if (RT_FAILURE(rc))
    17981798        AssertMsgFailedReturn(("pfnTMTimerCreate -> %Vrc\n", rc), rc);
    17991799
    18001800    rc = PDMDevHlpIOPortRegister(pDevIns, s->port + 0x04,  2, s,
    18011801                                 mixer_write, mixer_read, NULL, NULL, "SB16");
    1802     if (VBOX_FAILURE(rc))
     1802    if (RT_FAILURE(rc))
    18031803        return rc;
    18041804    rc = PDMDevHlpIOPortRegister(pDevIns, s->port + 0x06, 10, s,
    18051805                                 dsp_write, dsp_read, NULL, NULL, "SB16");
    1806     if (VBOX_FAILURE(rc))
     1806    if (RT_FAILURE(rc))
    18071807        return rc;
    18081808
    18091809    rc = PDMDevHlpDMARegister(pDevIns, s->hdma, SB_read_DMA, s);
    1810     if (VBOX_FAILURE(rc))
     1810    if (RT_FAILURE(rc))
    18111811        return rc;
    18121812    rc = PDMDevHlpDMARegister(pDevIns, s->dma, SB_read_DMA, s);
    1813     if (VBOX_FAILURE(rc))
     1813    if (RT_FAILURE(rc))
    18141814        return rc;
    18151815
     
    18181818    rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, SB16_SSM_VERSION,
    18191819                              sizeof(*s), NULL, SaveExec, NULL, NULL, LoadExec, NULL);
    1820     if (VBOX_FAILURE(rc))
     1820    if (RT_FAILURE(rc))
    18211821        return rc;
    18221822
     
    18241824    if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    18251825        Log(("sb16: No attached driver!\n"));
    1826     else if (VBOX_FAILURE(rc))
     1826    else if (RT_FAILURE(rc))
    18271827        AssertMsgFailedReturn(("Failed to attach SB16 LUN #0! rc=%Vrc\n", rc), rc);
    18281828
  • trunk/src/VBox/Devices/Audio/audio.c

    r8132 r11266  
    16281628    rc = pDrvIns->pDrvHlp->pfnTMTimerCreate (pDrvIns, TMCLOCK_VIRTUAL,
    16291629                                             audio_timer_helper, "Audio timer", &s->ts);
    1630     if (VBOX_FAILURE (rc))
     1630    if (RT_FAILURE (rc))
    16311631        return rc;
    16321632
     
    20022002
    20032003    rc = CFGMR3QueryStringAlloc (pCfgHandle, "AudioDriver", &drvname);
    2004     if (VBOX_FAILURE (rc))
     2004    if (RT_FAILURE (rc))
    20052005        return rc;
    20062006
    20072007    rc = CFGMR3QueryStringAlloc (pCfgHandle, "StreamName", &audio_streamname);
    2008     if (VBOX_FAILURE (rc))
     2008    if (RT_FAILURE (rc))
    20092009        audio_streamname = NULL;
    20102010
    20112011    rc = AUD_init (pDrvIns, drvname);
    2012     if (VBOX_FAILURE (rc))
     2012    if (RT_FAILURE (rc))
    20132013        return rc;
    20142014
  • trunk/src/VBox/Devices/Audio/audiosniffer.c

    r8155 r11266  
    196196    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pData->Base, &pData->pDrvBase, "Audio Sniffer Port");
    197197
    198     if (VBOX_SUCCESS(rc))
     198    if (RT_SUCCESS(rc))
    199199    {
    200200        pData->pDrv = (PPDMIAUDIOSNIFFERCONNECTOR)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_AUDIO_SNIFFER_CONNECTOR);
     
    216216    }
    217217
    218     if (VBOX_SUCCESS (rc))
     218    if (RT_SUCCESS (rc))
    219219    {
    220220        /* Save PDM device instance data for future reference. */
  • trunk/src/VBox/Devices/Builtins.cpp

    r9124 r11266  
    5959
    6060    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCI);
    61     if (VBOX_FAILURE(rc))
     61    if (RT_FAILURE(rc))
    6262        return rc;
    6363    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcArch);
    64     if (VBOX_FAILURE(rc))
     64    if (RT_FAILURE(rc))
    6565        return rc;
    6666    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePcBios);
    67     if (VBOX_FAILURE(rc))
     67    if (RT_FAILURE(rc))
    6868        return rc;
    6969    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePS2KeyboardMouse);
    70     if (VBOX_FAILURE(rc))
     70    if (RT_FAILURE(rc))
    7171        return rc;
    7272    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePIIX3IDE);
    73     if (VBOX_FAILURE(rc))
     73    if (RT_FAILURE(rc))
    7474        return rc;
    7575    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8254);
    76     if (VBOX_FAILURE(rc))
     76    if (RT_FAILURE(rc))
    7777        return rc;
    7878    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceI8259);
    79     if (VBOX_FAILURE(rc))
     79    if (RT_FAILURE(rc))
    8080        return rc;
    8181    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceMC146818);
    82     if (VBOX_FAILURE(rc))
     82    if (RT_FAILURE(rc))
    8383        return rc;
    8484    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVga);
    85     if (VBOX_FAILURE(rc))
     85    if (RT_FAILURE(rc))
    8686        return rc;
    8787    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceVMMDev);
    88     if (VBOX_FAILURE(rc))
     88    if (RT_FAILURE(rc))
    8989        return rc;
    9090    rc = pCallbacks->pfnRegister(pCallbacks, &g_DevicePCNet);
    91     if (VBOX_FAILURE(rc))
     91    if (RT_FAILURE(rc))
    9292        return rc;
    9393#ifdef VBOX_WITH_E1000
    9494    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceE1000);
    95     if (VBOX_FAILURE(rc))
     95    if (RT_FAILURE(rc))
    9696        return rc;
    9797#endif
    9898#ifdef VBOX_WITH_INIP
    9999    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceINIP);
    100     if (VBOX_FAILURE(rc))
     100    if (RT_FAILURE(rc))
    101101        return rc;
    102102#endif
    103103    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceICHAC97);
    104     if (VBOX_FAILURE(rc))
     104    if (RT_FAILURE(rc))
    105105        return rc;
    106106    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSB16);
    107     if (VBOX_FAILURE(rc))
     107    if (RT_FAILURE(rc))
    108108        return rc;
    109109    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAudioSniffer);
    110     if (VBOX_FAILURE(rc))
     110    if (RT_FAILURE(rc))
    111111        return rc;
    112112#ifdef VBOX_WITH_USB
    113113    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceOHCI);
    114     if (VBOX_FAILURE(rc))
     114    if (RT_FAILURE(rc))
    115115        return rc;
    116116#endif
    117117#ifdef VBOX_WITH_EHCI
    118118    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceEHCI);
    119     if (VBOX_FAILURE(rc))
     119    if (RT_FAILURE(rc))
    120120        return rc;
    121121#endif
    122122#ifdef VBOX_ACPI
    123123    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceACPI);
    124     if (VBOX_FAILURE(rc))
     124    if (RT_FAILURE(rc))
    125125        return rc;
    126126#endif
    127127    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceDMA);
    128     if (VBOX_FAILURE(rc))
     128    if (RT_FAILURE(rc))
    129129        return rc;
    130130    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceFloppyController);
    131     if (VBOX_FAILURE(rc))
     131    if (RT_FAILURE(rc))
    132132        return rc;
    133133    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceSerialPort);
    134     if (VBOX_FAILURE(rc))
     134    if (RT_FAILURE(rc))
    135135        return rc;
    136136    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceParallelPort);
    137     if (VBOX_FAILURE(rc))
     137    if (RT_FAILURE(rc))
    138138        return rc;
    139139#ifdef VBOX_WITH_AHCI
    140140    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAHCI);
    141     if (VBOX_FAILURE(rc))
     141    if (RT_FAILURE(rc))
    142142        return rc;
    143143#endif
     
    160160
    161161    int rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMouseQueue);
    162     if (VBOX_FAILURE(rc))
     162    if (RT_FAILURE(rc))
    163163        return rc;
    164164    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvKeyboardQueue);
    165     if (VBOX_FAILURE(rc))
     165    if (RT_FAILURE(rc))
    166166        return rc;
    167167    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvBlock);
    168     if (VBOX_FAILURE(rc))
     168    if (RT_FAILURE(rc))
    169169        return rc;
    170170    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVBoxHDD);
    171     if (VBOX_FAILURE(rc))
     171    if (RT_FAILURE(rc))
    172172        return rc;
    173173    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVD);
    174     if (VBOX_FAILURE(rc))
     174    if (RT_FAILURE(rc))
    175175        return rc;
    176176#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
    177177    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostDVD);
    178     if (VBOX_FAILURE(rc))
     178    if (RT_FAILURE(rc))
    179179        return rc;
    180180#endif
    181181#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
    182182    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostFloppy);
    183     if (VBOX_FAILURE(rc))
     183    if (RT_FAILURE(rc))
    184184        return rc;
    185185#endif
    186186    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvMediaISO);
    187     if (VBOX_FAILURE(rc))
     187    if (RT_FAILURE(rc))
    188188        return rc;
    189189    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImage);
    190     if (VBOX_FAILURE(rc))
     190    if (RT_FAILURE(rc))
    191191        return rc;
    192192#ifdef VBOX_WITH_ISCSI
    193193    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvISCSI);
    194     if (VBOX_FAILURE(rc))
     194    if (RT_FAILURE(rc))
    195195        return rc;
    196196    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvISCSITransportTcp);
    197     if (VBOX_FAILURE(rc))
     197    if (RT_FAILURE(rc))
    198198        return rc;
    199199#endif
    200200#ifndef RT_OS_L4
    201201    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNAT);
    202     if (VBOX_FAILURE(rc))
     202    if (RT_FAILURE(rc))
    203203        return rc;
    204204#endif
    205205#if defined(RT_OS_L4) || defined(RT_OS_LINUX) || defined(RT_OS_OS2) || (defined(RT_OS_SOLARIS) && !defined(RT_OS_SOLARIS_10)) || defined(RT_OS_WINDOWS)
    206206    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostInterface);
    207     if (VBOX_FAILURE(rc))
     207    if (RT_FAILURE(rc))
    208208        return rc;
    209209#endif
    210210    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvIntNet);
    211     if (VBOX_FAILURE(rc))
     211    if (RT_FAILURE(rc))
    212212        return rc;
    213213    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNetSniffer);
    214     if (VBOX_FAILURE(rc))
     214    if (RT_FAILURE(rc))
    215215        return rc;
    216216    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvAUDIO);
    217     if (VBOX_FAILURE(rc))
     217    if (RT_FAILURE(rc))
    218218        return rc;
    219219    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvACPI);
    220     if (VBOX_FAILURE(rc))
     220    if (RT_FAILURE(rc))
    221221        return rc;
    222222
    223223#ifdef VBOX_WITH_USB
    224224    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvVUSBRootHub);
    225     if (VBOX_FAILURE(rc))
     225    if (RT_FAILURE(rc))
    226226        return rc;
    227227#endif
     
    229229#if !defined(RT_OS_L4)
    230230    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvNamedPipe);
    231     if (VBOX_FAILURE(rc))
     231    if (RT_FAILURE(rc))
    232232        return rc;
    233233    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvChar);
    234     if (VBOX_FAILURE(rc))
     234    if (RT_FAILURE(rc))
    235235        return rc;
    236236#endif
     
    238238#if defined(RT_OS_LINUX)
    239239    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostParallel);
    240     if (VBOX_FAILURE(rc))
     240    if (RT_FAILURE(rc))
    241241        return rc;
    242242#endif
     
    244244#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
    245245    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
    246     if (VBOX_FAILURE(rc))
     246    if (RT_FAILURE(rc))
    247247        return rc;
    248248#endif
     
    250250#if defined(VBOX_WITH_PDM_ASYNC_COMPLETION)
    251251    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvRawImageAsync);
    252     if (VBOX_FAILURE(rc))
     252    if (RT_FAILURE(rc))
    253253        return rc;
    254254
    255255    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvTransportAsync);
    256     if (VBOX_FAILURE(rc))
     256    if (RT_FAILURE(rc))
    257257        return rc;
    258258#endif
     
    273273{
    274274    int rc = pCallbacks->pfnRegister(pCallbacks, &g_UsbDevProxy);
    275     if (VBOX_FAILURE(rc))
     275    if (RT_FAILURE(rc))
    276276        return rc;
    277277
  • trunk/src/VBox/Devices/Builtins2.cpp

    r9693 r11266  
    6363
    6464    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceAPIC);
    65     if (VBOX_FAILURE(rc))
     65    if (RT_FAILURE(rc))
    6666        return rc;
    6767    rc = pCallbacks->pfnRegister(pCallbacks, &g_DeviceIOAPIC);
    68     if (VBOX_FAILURE(rc))
     68    if (RT_FAILURE(rc))
    6969        return rc;
    7070
  • trunk/src/VBox/Devices/Bus/DevPCI.cpp

    r11233 r11266  
    10181018            SSMR3PutMem(pSSMHandle, pDev->config, sizeof(pDev->config));
    10191019            rc = SSMR3PutS32(pSSMHandle, pDev->Int.s.iIrq);
    1020             if (VBOX_FAILURE(rc))
     1020            if (RT_FAILURE(rc))
    10211021                return rc;
    10221022        }
     
    10591059    /* separator */
    10601060    rc = SSMR3GetU32(pSSMHandle, &u32);
    1061     if (VBOX_FAILURE(rc))
     1061    if (RT_FAILURE(rc))
    10621062        return rc;
    10631063    if (u32 != (uint32_t)~0)
     
    10741074        /* index / terminator */
    10751075        rc = SSMR3GetU32(pSSMHandle, &u32);
    1076         if (VBOX_FAILURE(rc))
     1076        if (RT_FAILURE(rc))
    10771077            return rc;
    10781078        if (u32 == (uint32_t)~0)
     
    11001100        SSMR3GetMem(pSSMHandle, DevTmp.config, sizeof(DevTmp.config));
    11011101        rc = SSMR3GetS32(pSSMHandle, &DevTmp.Int.s.iIrq);
    1102         if (VBOX_FAILURE(rc))
     1102        if (RT_FAILURE(rc))
    11031103            return rc;
    11041104
     
    13891389    {
    13901390        AssertMsgFailed(("Writing to PIC failed!\n"));
    1391         return VBOX_SUCCESS(rc) ? VERR_INTERNAL_ERROR : rc;
     1391        return RT_SUCCESS(rc) ? VERR_INTERNAL_ERROR : rc;
    13921392    }
    13931393
     
    14451445    bool fUseIoApic;
    14461446    rc = CFGMR3QueryBoolDef(pCfgHandle, "IOAPIC", &fUseIoApic, false);
    1447     if (VBOX_FAILURE(rc))
     1447    if (RT_FAILURE(rc))
    14481448        return PDMDEV_SET_ERROR(pDevIns, rc,
    14491449                                N_("Configuration error: Failed to query boolean value \"IOAPIC\""));
     
    14521452    bool fGCEnabled;
    14531453    rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true);
    1454     if (VBOX_FAILURE(rc))
     1454    if (RT_FAILURE(rc))
    14551455        return PDMDEV_SET_ERROR(pDevIns, rc,
    14561456                                N_("Configuration error: Failed to query boolean value \"GCEnabled\""));
     
    14591459    bool fR0Enabled;
    14601460    rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true);
    1461     if (VBOX_FAILURE(rc))
     1461    if (RT_FAILURE(rc))
    14621462        return PDMDEV_SET_ERROR(pDevIns, rc,
    14631463                                N_("Configuration error: Failed to query boolean value \"R0Enabled\""));
     
    14921492    PciBusReg.pszSetIrqR0             = fR0Enabled ? "pciSetIrq" : NULL;
    14931493    rc = pDevIns->pDevHlp->pfnPCIBusRegister(pDevIns, &PciBusReg, &pBus->pPciHlpR3);
    1494     if (VBOX_FAILURE(rc))
     1494    if (RT_FAILURE(rc))
    14951495        return PDMDEV_SET_ERROR(pDevIns, rc,
    14961496                                N_("Failed to register ourselves as a PCI Bus"));
     
    15361536     */
    15371537    rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cf8, 1, NULL, pciIOPortAddressWrite, pciIOPortAddressRead, NULL, NULL, "i440FX (PCI)");
    1538     if (VBOX_FAILURE(rc))
     1538    if (RT_FAILURE(rc))
    15391539        return rc;
    15401540    rc = PDMDevHlpIOPortRegister(pDevIns, 0x0cfc, 4, NULL, pciIOPortDataWrite, pciIOPortDataRead, NULL, NULL, "i440FX (PCI)");
    1541     if (VBOX_FAILURE(rc))
     1541    if (RT_FAILURE(rc))
    15421542        return rc;
    15431543    rc = PDMDevHlpSSMRegister(pDevIns, "pci", iInstance, 2, sizeof(*pBus),
    15441544                              NULL, pciSaveExec, NULL, NULL, pciLoadExec, NULL);
    1545     if (VBOX_FAILURE(rc))
     1545    if (RT_FAILURE(rc))
    15461546        return rc;
    15471547
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r11196 r11266  
    11861186     */
    11871187    rc = SSMR3GetU32(f, &u32);
    1188     if (VBOX_FAILURE(rc))
     1188    if (RT_FAILURE(rc))
    11891189        return rc;
    11901190    if (u32 > ELEMENTS(s->queue.data))
     
    11961196    {
    11971197        rc = SSMR3GetU8(f, &s->queue.data[i]);
    1198         if (VBOX_FAILURE(rc))
     1198        if (RT_FAILURE(rc))
    11991199            return rc;
    12001200    }
     
    12041204
    12051205    rc = SSMR3GetU32(f, &u32);
    1206     if (VBOX_FAILURE(rc))
     1206    if (RT_FAILURE(rc))
    12071207        return rc;
    12081208    if (u32 > ELEMENTS(s->mouse_command_queue.data))
     
    12141214    {
    12151215        rc = SSMR3GetU8(f, &s->mouse_command_queue.data[i]);
    1216         if (VBOX_FAILURE(rc))
     1216        if (RT_FAILURE(rc))
    12171217            return rc;
    12181218    }
     
    12221222
    12231223    rc = SSMR3GetU32(f, &u32);
    1224     if (VBOX_FAILURE(rc))
     1224    if (RT_FAILURE(rc))
    12251225        return rc;
    12261226    if (u32 > ELEMENTS(s->mouse_event_queue.data))
     
    12321232    {
    12331233        rc = SSMR3GetU8(f, &s->mouse_event_queue.data[i]);
    1234         if (VBOX_FAILURE(rc))
     1234        if (RT_FAILURE(rc))
    12351235            return rc;
    12361236    }
     
    12411241    /* terminator */
    12421242    rc = SSMR3GetU32(f, &u32);
    1243     if (VBOX_FAILURE(rc))
     1243    if (RT_FAILURE(rc))
    12441244        return rc;
    12451245    if (u32 != ~0U)
  • trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp

    r8155 r11266  
    167167    PDRVKBDQUEUEITEM    pItem = (PDRVKBDQUEUEITEM)pItemCore;
    168168    int rc = pData->pUpPort->pfnPutEvent(pData->pUpPort, pItem->u8KeyCode);
    169     return VBOX_SUCCESS(rc);
     169    return RT_SUCCESS(rc);
    170170}
    171171
     
    284284    PPDMIBASE pDownBase;
    285285    int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pDownBase);
    286     if (VBOX_FAILURE(rc))
     286    if (RT_FAILURE(rc))
    287287    {
    288288        AssertMsgFailed(("Failed to attach driver below us! rc=%Vra\n", rc));
     
    303303    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    304304        cMilliesInterval = 0;
    305     else if (VBOX_FAILURE(rc))
     305    else if (RT_FAILURE(rc))
    306306    {
    307307        AssertMsgFailed(("Configuration error: 32-bit \"Interval\" -> rc=%Vrc\n", rc));
     
    313313    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    314314        cItems = 128;
    315     else if (VBOX_FAILURE(rc))
     315    else if (RT_FAILURE(rc))
    316316    {
    317317        AssertMsgFailed(("Configuration error: 32-bit \"QueueSize\" -> rc=%Vrc\n", rc));
     
    320320
    321321    rc = pDrvIns->pDrvHlp->pfnPDMQueueCreate(pDrvIns, sizeof(DRVKBDQUEUEITEM), cItems, cMilliesInterval, drvKbdQueueConsumer, &pDrv->pQueue);
    322     if (VBOX_FAILURE(rc))
     322    if (RT_FAILURE(rc))
    323323    {
    324324        AssertMsgFailed(("Failed to create driver: cItems=%d cMilliesInterval=%d rc=%Vrc\n", cItems, cMilliesInterval, rc));
  • trunk/src/VBox/Devices/Input/DrvMouseQueue.cpp

    r9022 r11266  
    155155    PDRVMOUSEQUEUEITEM    pItem = (PDRVMOUSEQUEUEITEM)pItemCore;
    156156    int rc = pData->pUpPort->pfnPutEvent(pData->pUpPort, pItem->i32DeltaX, pItem->i32DeltaY, pItem->i32DeltaZ, pItem->fButtonStates);
    157     return VBOX_SUCCESS(rc);
     157    return RT_SUCCESS(rc);
    158158}
    159159
     
    270270    PPDMIBASE pDownBase;
    271271    int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pDownBase);
    272     if (VBOX_FAILURE(rc))
     272    if (RT_FAILURE(rc))
    273273    {
    274274        AssertMsgFailed(("Failed to attach driver below us! rc=%Vra\n", rc));
     
    289289    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    290290        cMilliesInterval = 0;
    291     else if (VBOX_FAILURE(rc))
     291    else if (RT_FAILURE(rc))
    292292    {
    293293        AssertMsgFailed(("Configuration error: 32-bit \"Interval\" -> rc=%Vrc\n", rc));
     
    299299    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    300300        cItems = 128;
    301     else if (VBOX_FAILURE(rc))
     301    else if (RT_FAILURE(rc))
    302302    {
    303303        AssertMsgFailed(("Configuration error: 32-bit \"QueueSize\" -> rc=%Vrc\n", rc));
     
    306306
    307307    rc = pDrvIns->pDrvHlp->pfnPDMQueueCreate(pDrvIns, sizeof(DRVMOUSEQUEUEITEM), cItems, cMilliesInterval, drvMouseQueueConsumer, &pDrv->pQueue);
    308     if (VBOX_FAILURE(rc))
     308    if (RT_FAILURE(rc))
    309309    {
    310310        AssertMsgFailed(("Failed to create driver: cItems=%d cMilliesInterval=%d rc=%Vrc\n", cItems, cMilliesInterval, rc));
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r11259 r11266  
    461461                     */
    462462                    rc = drvIntNetAsyncIoWaitForSpace(pThis);
    463                     if (VBOX_FAILURE(rc))
     463                    if (RT_FAILURE(rc))
    464464                    {
    465465                        STAM_PROFILE_ADV_STOP(&pThis->StatReceive, a);
     
    497497        STAM_PROFILE_ADV_STOP(&pThis->StatReceive, a);
    498498        int rc = pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pDrvIns, VMMR0_DO_INTNET_IF_WAIT, &WaitReq, sizeof(WaitReq));
    499         if (    VBOX_FAILURE(rc)
     499        if (    RT_FAILURE(rc)
    500500            &&  rc != VERR_TIMEOUT
    501501            &&  rc != VERR_INTERRUPTED)
     
    533533            {
    534534                int rc = RTSemEventWait(pThis->EventSuspended, 30000);
    535                 if (    VBOX_FAILURE(rc)
     535                if (    RT_FAILURE(rc)
    536536                    &&  rc != VERR_TIMEOUT)
    537537                {
     
    546546                int rc = drvIntNetAsyncIoRun(pThis);
    547547                if (    rc != VERR_STATE_CHANGED
    548                     &&  VBOX_FAILURE(rc))
     548                    &&  RT_FAILURE(rc))
    549549                {
    550550                    LogFlow(("drvIntNetAsyncIoThread: returns %Vrc\n", rc));
     
    795795     */
    796796    rc = CFGMR3QueryString(pCfgHandle, "Network", OpenReq.szNetwork, sizeof(OpenReq.szNetwork));
    797     if (VBOX_FAILURE(rc))
     797    if (RT_FAILURE(rc))
    798798        return PDMDRV_SET_ERROR(pDrvIns, rc,
    799799                                N_("Configuration error: Failed to get the \"Network\" value"));
     
    807807    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    808808        u32TrunkType = kIntNetTrunkType_None;
    809     else if (VBOX_FAILURE(rc))
     809    else if (RT_FAILURE(rc))
    810810        return PDMDRV_SET_ERROR(pDrvIns, rc,
    811811                                N_("Configuration error: Failed to get the \"TrunkType\" value"));
     
    818818    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    819819        OpenReq.szTrunk[0] = '\0';
    820     else if (VBOX_FAILURE(rc))
     820    else if (RT_FAILURE(rc))
    821821        return PDMDRV_SET_ERROR(pDrvIns, rc,
    822822                                N_("Configuration error: Failed to get the \"Trunk\" value"));
     
    830830    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    831831        fRestrictAccess = true;
    832     else if (VBOX_FAILURE(rc))
     832    else if (RT_FAILURE(rc))
    833833        return PDMDRV_SET_ERROR(pDrvIns, rc,
    834834                                N_("Configuration error: Failed to get the \"RestrictAccess\" value"));
     
    841841    bool fSharedMacOnWire;
    842842    rc = CFGMR3QueryBoolDef(pCfgHandle, "SharedMacOnWire", &fSharedMacOnWire, false);
    843     if (VBOX_FAILURE(rc))
     843    if (RT_FAILURE(rc))
    844844        return PDMDRV_SET_ERROR(pDrvIns, rc,
    845845                                N_("Configuration error: Failed to get the \"SharedMacOnWire\" value"));
     
    853853    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    854854        OpenReq.cbRecv = 218 * _1K ;
    855     else if (VBOX_FAILURE(rc))
     855    else if (RT_FAILURE(rc))
    856856        return PDMDRV_SET_ERROR(pDrvIns, rc,
    857857                                N_("Configuration error: Failed to get the \"ReceiveBufferSize\" value"));
     
    868868    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    869869        OpenReq.cbSend = 36*_1K;
    870     else if (VBOX_FAILURE(rc))
     870    else if (RT_FAILURE(rc))
    871871        return PDMDRV_SET_ERROR(pDrvIns, rc,
    872872                                N_("Configuration error: Failed to get the \"SendBufferSize\" value"));
     
    884884    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    885885        pThis->fActivateEarlyDeactivateLate = false;
    886     else if (VBOX_FAILURE(rc))
     886    else if (RT_FAILURE(rc))
    887887        return PDMDRV_SET_ERROR(pDrvIns, rc,
    888888                                N_("Configuration error: Failed to get the \"IsService\" value"));
     
    920920     */
    921921    rc = RTSemEventCreate(&pThis->EventSuspended);
    922     if (VBOX_FAILURE(rc))
     922    if (RT_FAILURE(rc))
    923923        return rc;
    924924
     
    928928    OpenReq.hIf = INTNET_HANDLE_INVALID;
    929929    rc = pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pDrvIns, VMMR0_DO_INTNET_OPEN, &OpenReq, sizeof(OpenReq));
    930     if (VBOX_FAILURE(rc))
     930    if (RT_FAILURE(rc))
    931931        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    932932                                   N_("Failed to open/create the internal network '%s'"), pThis->szNetwork);
     
    945945    GetRing3BufferReq.pRing3Buf = NULL;
    946946    rc = pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pDrvIns, VMMR0_DO_INTNET_IF_GET_RING3_BUFFER, &GetRing3BufferReq, sizeof(GetRing3BufferReq));
    947     if (VBOX_FAILURE(rc))
     947    if (RT_FAILURE(rc))
    948948        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    949949                                   N_("Failed to get ring-3 buffer for the newly created interface to '%s'"), pThis->szNetwork);
     
    956956     */
    957957    rc = RTThreadCreate(&pThis->Thread, drvIntNetAsyncIoThread, pThis, _128K, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "INTNET");
    958     if (VBOX_FAILURE(rc))
     958    if (RT_FAILURE(rc))
    959959    {
    960960        AssertRC(rc);
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r11170 r11266  
    378378            if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    379379                fUDP = false;
    380             else if (VBOX_FAILURE(rc))
     380            else if (RT_FAILURE(rc))
    381381                return PDMDrvHlpVMSetError(pData->pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"UDP\" boolean failed"), iInstance);
    382382        }
    383         else if (VBOX_SUCCESS(rc))
     383        else if (RT_SUCCESS(rc))
    384384        {
    385385            if (!RTStrICmp(szProtocol, "TCP"))
     
    396396        int32_t iHostPort;
    397397        rc = CFGMR3QueryS32(pNode, "HostPort", &iHostPort);
    398         if (VBOX_FAILURE(rc))
     398        if (RT_FAILURE(rc))
    399399            return PDMDrvHlpVMSetError(pData->pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"HostPort\" integer failed"), iInstance);
    400400
     
    402402        int32_t iGuestPort;
    403403        rc = CFGMR3QueryS32(pNode, "GuestPort", &iGuestPort);
    404         if (VBOX_FAILURE(rc))
     404        if (RT_FAILURE(rc))
    405405            return PDMDrvHlpVMSetError(pData->pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"GuestPort\" integer failed"), iInstance);
    406406
     
    411411            RTStrPrintf(szGuestIP, sizeof(szGuestIP), "%d.%d.%d.%d",
    412412                        (Network & 0xFF000000) >> 24, (Network & 0xFF0000) >> 16, (Network & 0xFF00) >> 8, (Network & 0xE0) | 15);
    413         else if (VBOX_FAILURE(rc))
     413        else if (RT_FAILURE(rc))
    414414            return PDMDrvHlpVMSetError(pData->pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"GuestIP\" string failed"), iInstance);
    415415        struct in_addr GuestIP;
     
    514514    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    515515        fPassDomain = true;
    516     else if (VBOX_FAILURE(rc))
     516    else if (RT_FAILURE(rc))
    517517        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"PassDomain\" boolean failed"), pDrvIns->iInstance);
    518518
    519519    rc = CFGMR3QueryStringAlloc(pCfgHandle, "TFTPPrefix", &pData->pszTFTPPrefix);
    520     if (VBOX_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
     520    if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
    521521        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"TFTPPrefix\" string failed"), pDrvIns->iInstance);
    522522    rc = CFGMR3QueryStringAlloc(pCfgHandle, "BootFile", &pData->pszBootFile);
    523     if (VBOX_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
     523    if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
    524524        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"BootFile\" string failed"), pDrvIns->iInstance);
    525525
     
    540540    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    541541        RTStrPrintf(szNetwork, sizeof(szNetwork), "10.0.%d.0/24", pDrvIns->iInstance + 2);
    542     else if (VBOX_FAILURE(rc))
     542    else if (RT_FAILURE(rc))
    543543        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"Network\" string failed"), pDrvIns->iInstance);
    544544
     
    556556     */
    557557    rc = RTCritSectInit(&pData->CritSect);
    558     if (VBOX_FAILURE(rc))
     558    if (RT_FAILURE(rc))
    559559        return rc;
    560560#if 0
    561561    rc = RTSemEventCreate(&g_EventSem);
    562     if (VBOX_SUCCESS(rc))
     562    if (RT_SUCCESS(rc))
    563563    {
    564564        /*
     
    567567        g_fThreadTerm = false;
    568568        rc = RTThreadCreate(&g_ThreadSelect, drvNATSelectThread, 0, NULL, "NATSEL");
    569         if (VBOX_SUCCESS(rc))
     569        if (RT_SUCCESS(rc))
    570570        {
    571571#endif
     
    575575             */
    576576            rc = slirp_init(&pData->pNATState, &szNetAddr[0], Netmask, fPassDomain, pData->pszTFTPPrefix, pData->pszBootFile, pData);
    577             if (VBOX_SUCCESS(rc))
     577            if (RT_SUCCESS(rc))
    578578            {
    579579                int rc2 = drvNATConstructRedir(pDrvIns->iInstance, pData, pCfgHandle, Network);
    580                 if (VBOX_SUCCESS(rc2))
     580                if (RT_SUCCESS(rc2))
    581581                {
    582582                    /*
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r11157 r11266  
    346346    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    347347        RTStrPrintf(pThis->szFilename, sizeof(pThis->szFilename), "./VBox-%x.pcap", RTProcSelf());
    348     else if (VBOX_FAILURE(rc))
     348    else if (RT_FAILURE(rc))
    349349    {
    350350        AssertMsgFailed(("Failed to query \"File\", rc=%Vrc.\n", rc));
     
    379379    if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    380380        pThis->pConnector = NULL;
    381     else if (VBOX_SUCCESS(rc))
     381    else if (RT_SUCCESS(rc))
    382382    {
    383383        pThis->pConnector = (PPDMINETWORKCONNECTOR)pBaseDown->pfnQueryInterface(pBaseDown, PDMINTERFACE_NETWORK_CONNECTOR);
     
    398398     */
    399399    rc = RTCritSectInit(&pThis->Lock);
    400     if (VBOX_FAILURE(rc))
     400    if (RT_FAILURE(rc))
    401401        return rc;
    402402
     
    406406    rc = RTFileOpen(&pThis->File, pThis->szFilename,
    407407                    RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE);
    408     if (VBOX_FAILURE(rc))
     408    if (RT_FAILURE(rc))
    409409    {
    410410        AssertMsgFailed(("Failed to create file '%s' for writing. rc=%Vrc\n", pThis->szFilename, rc));
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r11246 r11266  
    284284            rc = RTFileRead(pData->FileDevice, achBuf, sizeof(achBuf), &cbRead);
    285285#endif
    286             if (VBOX_SUCCESS(rc))
     286            if (RT_SUCCESS(rc))
    287287            {
    288288                /*
     
    932932#if defined(RT_OS_SOLARIS)   /** @todo Other platforms' TAP code should be moved here from ConsoleImpl & VBoxBFE. */
    933933    rc = CFGMR3QueryStringAlloc(pCfgHandle, "TAPSetupApplication", &pData->pszSetupApplication);
    934     if (VBOX_SUCCESS(rc))
     934    if (RT_SUCCESS(rc))
    935935    {
    936936        if (!RTPathExists(pData->pszSetupApplication))
     
    942942
    943943    rc = CFGMR3QueryStringAlloc(pCfgHandle, "TAPTerminateApplication", &pData->pszTerminateApplication);
    944     if (VBOX_SUCCESS(rc))
     944    if (RT_SUCCESS(rc))
    945945    {
    946946        if (!RTPathExists(pData->pszTerminateApplication))
     
    953953# ifdef VBOX_WITH_CROSSBOW
    954954    rc = CFGMR3QueryBytes(pCfgHandle, "MAC", &pData->MacAddress, sizeof(pData->MacAddress));
    955     if (VBOX_FAILURE(rc))
     955    if (RT_FAILURE(rc))
    956956        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Configuration error: Failed to query \"MAC\""));
    957957# endif
    958958
    959959    rc = CFGMR3QueryStringAlloc(pCfgHandle, "Device", &pData->pszDeviceName);
    960     if (VBOX_FAILURE(rc))
     960    if (RT_FAILURE(rc))
    961961        pData->fStatic = false;
    962962
     
    965965    {
    966966        rc = drvTAPSetupApplication(pData);
    967         if (VBOX_FAILURE(rc))
     967        if (RT_FAILURE(rc))
    968968            return PDMDrvHlpVMSetError(pDrvIns, VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,
    969969                                       N_("Error running TAP setup application. rc=%d"), rc);
     
    983983    rc = SolarisTAPAttach(pData);
    984984# endif
    985     if (VBOX_FAILURE(rc))
     985    if (RT_FAILURE(rc))
    986986        return rc;
    987987
     
    990990    int32_t iFile;
    991991    rc = CFGMR3QueryS32(pCfgHandle, "FileHandle", &iFile);
    992     if (VBOX_FAILURE(rc))
     992    if (RT_FAILURE(rc))
    993993        return PDMDRV_SET_ERROR(pDrvIns, rc,
    994994                                N_("Configuration error: Query for \"FileHandle\" 32-bit signed integer failed"));
  • trunk/src/VBox/Devices/Network/DrvTAPOs2.cpp

    r11157 r11266  
    450450    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    451451        strcpy(pThis->szDevice, "\\DEV\\TAP$");
    452     else if (VBOX_FAILURE(rc))
     452    else if (RT_FAILURE(rc))
    453453        return PDMDRV_SET_ERROR(pDrvIns, rc,
    454454                                N_("Configuration error: Query for \"Device\" failed"));
     
    458458    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    459459        iConnectTo = -1;
    460     else if (VBOX_FAILURE(rc))
     460    else if (RT_FAILURE(rc))
    461461        return PDMDRV_SET_ERROR(pDrvIns, rc,
    462462                                N_("Configuration error: Query for \"ConnectTo\" failed"));
     
    467467     */
    468468    rc = RTFileOpen(&pThis->hDevice, pThis->szDevice, RTFILE_O_DENY_NONE | RTFILE_O_READ);
    469     if (VBOX_FAILURE(rc))
     469    if (RT_FAILURE(rc))
    470470        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    471471                                   N_("Failed to open tap device '%s'"), pThis->szDevice);
     
    482482    else if (Parm[0])
    483483        rc = VERR_GENERAL_FAILURE;
    484     if (VBOX_FAILURE(rc))
     484    if (RT_FAILURE(rc))
    485485        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    486486                                   N_("Failed to query LanNumber! orc=%d Parm={%ld,%ld}"),
     
    509509        else if (Parm[0])
    510510            rc = VERR_GENERAL_FAILURE;
    511         if (VBOX_FAILURE(rc))
     511        if (RT_FAILURE(rc))
    512512            return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    513513                                       N_("Failed to connect %d to %d! orc=%d Parm={%ld,%ld}"),
  • trunk/src/VBox/Devices/Network/DrvTAPWin.cpp

    r8773 r11266  
    381381    char *pszHostDriver = NULL;
    382382    rc = CFGMR3QueryStringAlloc(pCfgHandle, "HostInterfaceName", &pszHostDriver);
    383     if (VBOX_FAILURE(rc))
     383    if (RT_FAILURE(rc))
    384384        return PDMDRV_SET_ERROR(pDrvIns, rc,
    385385                                N_("Configuration error: query for \"HostInterfaceName\" failed"));
     
    391391
    392392    rc = CFGMR3QueryBytes(pCfgHandle, "GUID", szDriverGUID, sizeof(szDriverGUID));
    393     if (VBOX_FAILURE(rc))
     393    if (RT_FAILURE(rc))
    394394        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    395395                                N_("Configuration error: could not query GUID"));
  • trunk/src/VBox/Devices/PC/DevDMA.cpp

    r11249 r11266  
    908908#if 0
    909909    rc = CFGMR3QueryBool (pCfgHandle, "HighPageEnable", &high_page_enable);
    910     if (VBOX_FAILURE (rc)) {
     910    if (RT_FAILURE (rc)) {
    911911        return rc;
    912912    }
     
    928928    Assert(pDevIns->pDevHlp->pfnDMARegister);
    929929    rc = pDevIns->pDevHlp->pfnDMACRegister (pDevIns, &reg, &s->pHlp);
    930     if (VBOX_FAILURE (rc)) {
     930    if (RT_FAILURE (rc)) {
    931931        return rc;
    932932    }
     
    934934    rc = PDMDevHlpSSMRegister (pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1, sizeof (*s),
    935935                               NULL, SaveExec, NULL, NULL, LoadExec, NULL);
    936     if (VBOX_FAILURE(rc))
     936    if (RT_FAILURE(rc))
    937937        return rc;
    938938
  • trunk/src/VBox/Devices/Parallel/DevParallel.cpp

    r9212 r11266  
    597597
    598598    rc = SSMR3GetU32(pSSMHandle, &u32);
    599     if (VBOX_FAILURE(rc))
     599    if (RT_FAILURE(rc))
    600600        return rc;
    601601
     
    693693    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    694694        pData->fGCEnabled = true;
    695     else if (VBOX_FAILURE(rc))
     695    else if (RT_FAILURE(rc))
    696696        return PDMDEV_SET_ERROR(pDevIns, rc,
    697697                                N_("Configuration error: Failed to get the \"GCEnabled\" value"));
     
    700700    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    701701        pData->fR0Enabled = true;
    702     else if (VBOX_FAILURE(rc))
     702    else if (RT_FAILURE(rc))
    703703        return PDMDEV_SET_ERROR(pDevIns, rc,
    704704                                N_("Configuration error: Failed to get the \"R0Enabled\" value"));
     
    720720    RTStrPrintf(szName, sizeof(szName), "Parallel#%d", iInstance);
    721721    rc = PDMDevHlpCritSectInit(pDevIns, &pData->CritSect, szName);
    722     if (VBOX_FAILURE(rc))
     722    if (RT_FAILURE(rc))
    723723        return rc;
    724724
     
    726726    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    727727        irq_lvl = 7;
    728     else if (VBOX_FAILURE(rc))
     728    else if (RT_FAILURE(rc))
    729729        return PDMDEV_SET_ERROR(pDevIns, rc,
    730730                                N_("Configuration error: Failed to get the \"IRQ\" value"));
     
    733733    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    734734        io_base = 0x378;
    735     else if (VBOX_FAILURE(rc))
     735    else if (RT_FAILURE(rc))
    736736        return PDMDEV_SET_ERROR(pDevIns, rc,
    737737                                N_("Configuration error: Failed to get the \"IOBase\" value"));
     
    741741    pData->irq = irq_lvl;
    742742    pData->base = io_base;
    743    
     743
    744744    /* Init parallel state */
    745745    pData->reg_data = 0;
     
    751751                                 parallelIOPortWrite, parallelIOPortRead,
    752752                                 NULL, NULL, "PARALLEL");
    753     if (VBOX_FAILURE(rc))
     753    if (RT_FAILURE(rc))
    754754        return rc;
    755755
     
    759759                                 parallelIOPortWriteECP, parallelIOPortReadECP,
    760760                                 NULL, NULL, "PARALLEL ECP");
    761     if (VBOX_FAILURE(rc))
     761    if (RT_FAILURE(rc))
    762762        return rc;
    763763#endif
     
    767767        rc = PDMDevHlpIOPortRegisterGC(pDevIns, io_base, 8, 0, "parallelIOPortWrite",
    768768                                      "parallelIOPortRead", NULL, NULL, "Parallel");
    769         if (VBOX_FAILURE(rc))
     769        if (RT_FAILURE(rc))
    770770            return rc;
    771771
     
    773773        rc = PDMDevHlpIOPortRegisterGC(pDevIns, io_base+0x400, 8, 0, "parallelIOPortWriteECP",
    774774                                      "parallelIOPortReadECP", NULL, NULL, "Parallel Ecp");
    775         if (VBOX_FAILURE(rc))
     775        if (RT_FAILURE(rc))
    776776            return rc;
    777777#endif
     
    782782        rc = PDMDevHlpIOPortRegisterR0(pDevIns, io_base, 8, 0, "parallelIOPortWrite",
    783783                                      "parallelIOPortRead", NULL, NULL, "Parallel");
    784         if (VBOX_FAILURE(rc))
     784        if (RT_FAILURE(rc))
    785785            return rc;
    786786
     
    788788        rc = PDMDevHlpIOPortRegisterR0(pDevIns, io_base+0x400, 8, 0, "parallelIOPortWriteECP",
    789789                                      "parallelIOPortReadECP", NULL, NULL, "Parallel Ecp");
    790         if (VBOX_FAILURE(rc))
     790        if (RT_FAILURE(rc))
    791791            return rc;
    792792#endif
     
    796796     * changes are supported. */
    797797    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pData->IBase, &pData->pDrvBase, "Parallel Host");
    798     if (VBOX_SUCCESS(rc))
    799     {
    800         pData->pDrvHostParallelConnector = (PDMIHOSTPARALLELCONNECTOR *)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, 
     798    if (RT_SUCCESS(rc))
     799    {
     800        pData->pDrvHostParallelConnector = (PDMIHOSTPARALLELCONNECTOR *)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase,
    801801                                                                                                           PDMINTERFACE_HOST_PARALLEL_CONNECTOR);
    802802        if (!pData->pDrvHostParallelConnector)
     
    838838        NULL                            /* pfnLoadDone */
    839839        );
    840     if (VBOX_FAILURE(rc))
     840    if (RT_FAILURE(rc))
    841841        return rc;
    842842
  • trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp

    r8155 r11266  
    153153            break;
    154154    }
    155  
     155
    156156    ioctl(pData->FileDevice, PPSETMODE, &ppdev_mode);
    157157
     
    301301    /* Device */
    302302    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "DevicePath", &pData->pszDevicePath);
    303     if (VBOX_FAILURE(rc))
     303    if (RT_FAILURE(rc))
    304304    {
    305305        AssertMsgFailed(("Configuration error: query for \"DevicePath\" string returned %Vra.\n", rc));
     
    311311     */
    312312    rc = RTFileOpen(&pData->FileDevice, pData->pszDevicePath, RTFILE_O_OPEN | RTFILE_O_READWRITE);
    313     if (VBOX_FAILURE(rc))
    314         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Parallel#%d could not open '%s'"), 
     313    if (RT_FAILURE(rc))
     314        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Parallel#%d could not open '%s'"),
    315315                                   pDrvIns->iInstance, pData->pszDevicePath);
    316316
     
    318318     * Try to get exclusive access to parallel port
    319319     */
    320     rc = ioctl(pData->FileDevice, PPEXCL);     
     320    rc = ioctl(pData->FileDevice, PPEXCL);
    321321    if (rc < 0)
    322         return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS, 
     322        return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS,
    323323                                   N_("Parallel#%d could not get exclusive access for parallel port '%s'"
    324                                       "Be sure that no other process or driver accesses this port"), 
     324                                      "Be sure that no other process or driver accesses this port"),
    325325                                   pDrvIns->iInstance, pData->pszDevicePath);
    326326
     
    330330    rc = ioctl(pData->FileDevice, PPCLAIM);
    331331    if (rc < 0)
    332         return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS, 
     332        return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS,
    333333                                   N_("Parallel#%d could not claim parallel port '%s'"
    334                                       "Be sure that no other process or driver accesses this port"), 
     334                                      "Be sure that no other process or driver accesses this port"),
    335335                                   pDrvIns->iInstance, pData->pszDevicePath);
    336336
     
    340340    pData->pDrvHostParallelPort = (PPDMIHOSTPARALLELPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_HOST_PARALLEL_PORT);
    341341    if (!pData->pDrvHostParallelPort)
    342         return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE, RT_SRC_POS, N_("Parallel#%d has no parallel port interface above"), 
     342        return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE, RT_SRC_POS, N_("Parallel#%d has no parallel port interface above"),
    343343                                   pDrvIns->iInstance);
    344344
     
    359359     * Start waiting for interrupts.
    360360     */
    361     rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pData->pMonitorThread, pData, drvHostParallelMonitorThread, drvHostParallelWakeupMonitorThread, 0, 
     361    rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pData->pMonitorThread, pData, drvHostParallelMonitorThread, drvHostParallelWakeupMonitorThread, 0,
    362362                                  RTTHREADTYPE_IO, "ParMon");
    363     if (VBOX_FAILURE(rc))
     363    if (RT_FAILURE(rc))
    364364        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostParallel#%d cannot create monitor thread"), pDrvIns->iInstance);
    365365
  • trunk/src/VBox/Devices/Serial/DevSerial.cpp

    r9387 r11266  
    411411        PDMCritSectLeave(&pData->CritSect);
    412412        rc = RTSemEventWait(pData->ReceiveSem, 250);
    413         if (VBOX_FAILURE(rc))
     413        if (RT_FAILURE(rc))
    414414            return rc;
    415415
     
    605605
    606606    rc = SSMR3GetU32(pSSMHandle, &u32);
    607     if (VBOX_FAILURE(rc))
     607    if (RT_FAILURE(rc))
    608608        return rc;
    609609
     
    738738    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    739739        pData->fGCEnabled = true;
    740     else if (VBOX_FAILURE(rc))
     740    else if (RT_FAILURE(rc))
    741741        return PDMDEV_SET_ERROR(pDevIns, rc,
    742742                                N_("Configuration error: Failed to get the \"GCEnabled\" value"));
     
    745745    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    746746        pData->fR0Enabled = true;
    747     else if (VBOX_FAILURE(rc))
     747    else if (RT_FAILURE(rc))
    748748        return PDMDEV_SET_ERROR(pDevIns, rc,
    749749                                N_("Configuration error: Failed to get the \"R0Enabled\" value"));
     
    766766    RTStrPrintf(szName, sizeof(szName), "Serial#%d", iInstance);
    767767    rc = PDMDevHlpCritSectInit(pDevIns, &pData->CritSect, szName);
    768     if (VBOX_FAILURE(rc))
     768    if (RT_FAILURE(rc))
    769769        return rc;
    770770
     
    778778            irq_lvl = 3;
    779779    }
    780     else if (VBOX_FAILURE(rc))
     780    else if (RT_FAILURE(rc))
    781781        return PDMDEV_SET_ERROR(pDevIns, rc,
    782782                                N_("Configuration error: Failed to get the \"IRQ\" value"));
     
    790790            io_base = 0x2f8;
    791791    }
    792     else if (VBOX_FAILURE(rc))
     792    else if (RT_FAILURE(rc))
    793793        return PDMDEV_SET_ERROR(pDevIns, rc,
    794794                                N_("Configuration error: Failed to get the \"IOBase\" value"));
     
    814814    pData->dev.config[0x3d] = 1;    /* interrupt pin 0 */
    815815    rc = PDMDevHlpPCIRegister(pDevIns, &pData->dev);
    816     if (VBOX_FAILURE(rc))
     816    if (RT_FAILURE(rc))
    817817        return rc;
    818818    /*
     
    820820     */
    821821    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 8, PCI_ADDRESS_SPACE_IO, serialIOPortRegionMap);
    822     if (VBOX_FAILURE(rc))
     822    if (RT_FAILURE(rc))
    823823        return rc;
    824824#else /* !VBOX_SERIAL_PCI */
     
    827827                                 serialIOPortWrite, serialIOPortRead,
    828828                                 NULL, NULL, "SERIAL");
    829     if (VBOX_FAILURE (rc))
     829    if (RT_FAILURE (rc))
    830830        return rc;
    831831
     
    843843     * changes are supported. */
    844844    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pData->IBase, &pData->pDrvBase, "Serial Char");
    845     if (VBOX_SUCCESS(rc))
     845    if (RT_SUCCESS(rc))
    846846    {
    847847        pData->pDrvChar = (PDMICHAR *)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_CHAR);
     
    879879        NULL                    /* pfnLoadDone */
    880880        );
    881     if (VBOX_FAILURE(rc))
     881    if (RT_FAILURE(rc))
    882882        return rc;
    883883
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r8155 r11266  
    157157    {
    158158        int rc = RTSemEventWait(pData->SendSem, RT_INDEFINITE_WAIT);
    159         if (VBOX_FAILURE(rc))
     159        if (RT_FAILURE(rc))
    160160            break;
    161161
     
    171171
    172172                rc = pData->pDrvStream->pfnWrite(pData->pDrvStream, &pData->aSendQueue[pData->iSendQueueTail], &cbProcessed);
    173                 if (VBOX_SUCCESS(rc))
     173                if (RT_SUCCESS(rc))
    174174                {
    175175                    Assert(cbProcessed);
     
    226226                cbRemaining = sizeof(aBuffer);
    227227                rc = pData->pDrvStream->pfnRead(pData->pDrvStream, aBuffer, &cbRemaining);
    228                 if (VBOX_FAILURE(rc))
     228                if (RT_FAILURE(rc))
    229229                {
    230230                    LogFlow(("Read failed with %Vrc\n", rc));
     
    244244            cbProcessed = cbRemaining;
    245245            rc = pData->pDrvCharPort->pfnNotifyRead(pData->pDrvCharPort, pBuffer, &cbProcessed);
    246             if (VBOX_SUCCESS(rc))
     246            if (RT_SUCCESS(rc))
    247247            {
    248248                Assert(cbProcessed);
     
    327327    PPDMIBASE pBase;
    328328    int rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBase);
    329     if (VBOX_FAILURE(rc))
     329    if (RT_FAILURE(rc))
    330330        return rc; /* Don't call PDMDrvHlpVMSetError here as we assume that the driver already set an appropriate error */
    331331    pData->pDrvStream = (PPDMISTREAM)pBase->pfnQueryInterface(pBase, PDMINTERFACE_STREAM);
     
    334334
    335335    rc = RTThreadCreate(&pData->ReceiveThread, drvCharReceiveLoop, (void *)pData, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "CharRecv");
    336     if (VBOX_FAILURE(rc))
     336    if (RT_FAILURE(rc))
    337337        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Char#%d cannot create receive thread"), pDrvIns->iInstance);
    338338
     
    341341
    342342    rc = RTThreadCreate(&pData->SendThread, drvCharSendLoop, (void *)pData, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "CharSend");
    343     if (VBOX_FAILURE(rc))
     343    if (RT_FAILURE(rc))
    344344        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Char#%d cannot create send thread"), pDrvIns->iInstance);
    345345
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r10902 r11266  
    428428    {
    429429        int rc = RTSemEventWait(pData->SendSem, RT_INDEFINITE_WAIT);
    430         if (VBOX_FAILURE(rc))
     430        if (RT_FAILURE(rc))
    431431            break;
    432432
     
    467467#endif
    468468
    469             if (VBOX_SUCCESS(rc))
     469            if (RT_SUCCESS(rc))
    470470            {
    471471                Assert(cbProcessed);
     
    473473                pData->iSendQueueTail &= CHAR_MAX_SEND_QUEUE_MASK;
    474474            }
    475             else if (VBOX_FAILURE(rc))
     475            else if (RT_FAILURE(rc))
    476476            {
    477477                LogRel(("HostSerial#%d: Serial Write failed with %Vrc; terminating send thread\n", pDrvIns->iInstance, rc));
     
    573573            }
    574574            rc = RTFileRead(pData->DeviceFile, abBuffer, sizeof(abBuffer), &cbRead);
    575             if (VBOX_FAILURE(rc))
     575            if (RT_FAILURE(rc))
    576576            {
    577577                LogRel(("HostSerial#%d: Read failed with %Vrc, terminating the worker thread.\n", pDrvIns->iInstance, rc));
     
    638638                        uNewStatusLinesState |= PDM_ICHAR_STATUS_LINES_CTS;
    639639                    rc = pData->pDrvCharPort->pfnNotifyStatusLinesChanged(pData->pDrvCharPort, uNewStatusLinesState);
    640                     if (VBOX_FAILURE(rc))
     640                    if (RT_FAILURE(rc))
    641641                    {
    642642                        /* Notifying device failed, continue but log it */
     
    660660            size_t cbProcessed = cbRemaining;
    661661            rc = pData->pDrvCharPort->pfnNotifyRead(pData->pDrvCharPort, pbBuffer, &cbProcessed);
    662             if (VBOX_SUCCESS(rc))
     662            if (RT_SUCCESS(rc))
    663663            {
    664664                Assert(cbProcessed); Assert(cbProcessed <= cbRemaining);
     
    802802        goto ioctl_error;
    803803
    804     /* 
     804    /*
    805805     * Change current level on the RTS pin to make the ioctl call return in the
    806806     * monitor thread.
     
    921921    /* Device */
    922922    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "DevicePath", &pData->pszDevicePath);
    923     if (VBOX_FAILURE(rc))
     923    if (RT_FAILURE(rc))
    924924    {
    925925        AssertMsgFailed(("Configuration error: query for \"DevicePath\" string returned %Vra.\n", rc));
     
    968968#endif
    969969
    970     if (VBOX_FAILURE(rc))
     970    if (RT_FAILURE(rc))
    971971    {
    972972        AssertMsgFailed(("Could not open host device %s, rc=%Vrc\n", pData->pszDevicePath, rc));
     
    10291029
    10301030    rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pData->pRecvThread, pData, drvHostSerialRecvThread, drvHostSerialWakeupRecvThread, 0, RTTHREADTYPE_IO, "SerRecv");
    1031     if (VBOX_FAILURE(rc))
     1031    if (RT_FAILURE(rc))
    10321032        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create receive thread"), pDrvIns->iInstance);
    10331033
     
    10361036
    10371037    rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pData->pSendThread, pData, drvHostSerialSendThread, drvHostSerialWakeupSendThread, 0, RTTHREADTYPE_IO, "SerSend");
    1038     if (VBOX_FAILURE(rc))
     1038    if (RT_FAILURE(rc))
    10391039        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create send thread"), pDrvIns->iInstance);
    10401040
     
    10421042    /* Linux needs a separate thread which monitors the status lines. */
    10431043    rc = PDMDrvHlpPDMThreadCreate(pDrvIns, &pData->pMonitorThread, pData, drvHostSerialMonitorThread, drvHostSerialWakeupMonitorThread, 0, RTTHREADTYPE_IO, "SerMon");
    1044     if (VBOX_FAILURE(rc))
     1044    if (RT_FAILURE(rc))
    10451045        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create monitor thread"), pDrvIns->iInstance);
    10461046#endif
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r8155 r11266  
    142142        }
    143143
    144         if (VBOX_FAILURE(rc))
     144        if (RT_FAILURE(rc))
    145145        {
    146146            Log(("drvNamedPipeRead: FileRead returned %Vrc fShutdown=%d\n", rc, pData->fShutdown));
     
    236236            cbWritten = *cbWrite;
    237237
    238         if (VBOX_FAILURE(rc))
     238        if (RT_FAILURE(rc))
    239239        {
    240240            if (    rc == VERR_EOF
     
    442442
    443443    rc = CFGMR3QueryStringAlloc(pCfgHandle, "Location", &pszLocation);
    444     if (VBOX_FAILURE(rc))
     444    if (RT_FAILURE(rc))
    445445    {
    446446        AssertMsgFailed(("Configuration error: query \"Location\" resulted in %Vrc.\n", rc));
     
    451451    bool fIsServer;
    452452    rc = CFGMR3QueryBool(pCfgHandle, "IsServer", &fIsServer);
    453     if (VBOX_FAILURE(rc))
     453    if (RT_FAILURE(rc))
    454454    {
    455455        AssertMsgFailed(("Configuration error: query \"IsServer\" resulted in %Vrc.\n", rc));
     
    474474
    475475        rc = RTThreadCreate(&pData->ListenThread, drvNamedPipeListenLoop, (void *)pData, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "SerPipe");
    476         if VBOX_FAILURE(rc)
     476        if RT_FAILURE(rc)
    477477            return PDMDrvHlpVMSetError(pDrvIns, rc,  RT_SRC_POS, N_("NamedPipe#%d failed to create listening thread"), pDrvIns->iInstance);
    478478
     
    514514        pData->LocalSocketServer = s;
    515515        rc = RTThreadCreate(&pData->ListenThread, drvNamedPipeListenLoop, (void *)pData, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "SerPipe");
    516         if VBOX_FAILURE(rc)
     516        if RT_FAILURE(rc)
    517517            return PDMDrvHlpVMSetError(pDrvIns, rc,  RT_SRC_POS, N_("NamedPipe#%d failed to create listening thread"), pDrvIns->iInstance);
    518518    }
     
    527527
    528528out:
    529     if (VBOX_FAILURE(rc))
     529    if (RT_FAILURE(rc))
    530530    {
    531531        if (pszLocation)
     
    582582    if (pData->NamedPipe != INVALID_HANDLE_VALUE)
    583583    {
    584         if (pData->fIsServer) 
     584        if (pData->fIsServer)
    585585        {
    586586            FlushFileBuffers(pData->NamedPipe);
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r11184 r11266  
    299299    LogBird(("ata: %x: signalling\n", pCtl->IOPortBase1));
    300300    rc = PDMR3CritSectScheduleExitEvent(&pCtl->lock, pCtl->AsyncIOSem);
    301     if (VBOX_FAILURE(rc))
     301    if (RT_FAILURE(rc))
    302302    {
    303303        LogBird(("ata: %x: schedule failed, rc=%Vrc\n", pCtl->IOPortBase1, rc));
     
    743743    Assert(s->cbElementaryTransfer == 512);
    744744    rc = s->pDrvBlock ? s->pDrvBlock->pfnGetUuid(s->pDrvBlock, &Uuid) : RTUuidClear(&Uuid);
    745     if (VBOX_FAILURE(rc) || RTUuidIsNull(&Uuid))
     745    if (RT_FAILURE(rc) || RTUuidIsNull(&Uuid))
    746746    {
    747747        PATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s);
     
    867867    Assert(s->cbElementaryTransfer == 512);
    868868    rc = s->pDrvBlock ? s->pDrvBlock->pfnGetUuid(s->pDrvBlock, &Uuid) : RTUuidClear(&Uuid);
    869     if (VBOX_FAILURE(rc) || RTUuidIsNull(&Uuid))
     869    if (RT_FAILURE(rc) || RTUuidIsNull(&Uuid))
    870870    {
    871871        PATACONTROLLER pCtl = ATADEVSTATE_2_CONTROLLER(s);
     
    11221122    Log(("%s: %d sectors at LBA %d\n", __FUNCTION__, cSectors, iLBA));
    11231123    rc = ataReadSectors(s, iLBA, s->CTX_SUFF(pbIOBuffer), cSectors);
    1124     if (VBOX_SUCCESS(rc))
     1124    if (RT_SUCCESS(rc))
    11251125    {
    11261126        ataSetSector(s, iLBA + cSectors);
     
    11691169    Log(("%s: %d sectors at LBA %d\n", __FUNCTION__, cSectors, iLBA));
    11701170    rc = ataWriteSectors(s, iLBA, s->CTX_SUFF(pbIOBuffer), cSectors);
    1171     if (VBOX_SUCCESS(rc))
     1171    if (RT_SUCCESS(rc))
    11721172    {
    11731173        ataSetSector(s, iLBA + cSectors);
     
    12761276            aModeSenseCmd[9] = 0; /* control */
    12771277            rc = s->pDrvBlock->pfnSendCmd(s->pDrvBlock, aModeSenseCmd, PDMBLOCKTXDIR_FROM_DEVICE, aModeSenseResult, &cbTransfer, &uDummySense, 500);
    1278             if (VBOX_FAILURE(rc))
     1278            if (RT_FAILURE(rc))
    12791279            {
    12801280                atapiCmdError(s, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_NONE);
     
    13611361                    /* data */
    13621362                    rc = s->pDrvBlock->pfnRead(s->pDrvBlock, (uint64_t)i * 2048, pbBuf, 2048);
    1363                     if (VBOX_FAILURE(rc))
     1363                    if (RT_FAILURE(rc))
    13641364                        break;
    13651365                    pbBuf += 2048;
     
    13791379    STAM_PROFILE_STOP(&pCtl->StatLockWait, a);
    13801380
    1381     if (VBOX_SUCCESS(rc))
     1381    if (RT_SUCCESS(rc))
    13821382    {
    13831383        s->Led.Actual.s.fReading = 0;
     
    15391539    }
    15401540
    1541     if (VBOX_SUCCESS(rc))
     1541    if (RT_SUCCESS(rc))
    15421542    {
    15431543        if (s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE)
     
    22682268                        break;
    22692269                }
    2270                 if (VBOX_SUCCESS(rc))
     2270                if (RT_SUCCESS(rc))
    22712271                    atapiCmdOK(s);
    22722272                else
     
    38083808        {
    38093809            rc = RTSemEventWait(pCtl->SuspendIOSem, RT_INDEFINITE_WAIT);
    3810             if (VBOX_FAILURE(rc) || pCtl->fShutdown)
     3810            if (RT_FAILURE(rc) || pCtl->fShutdown)
    38113811                break;
    38123812
     
    38203820            rc = RTSemEventWait(pCtl->AsyncIOSem, RT_INDEFINITE_WAIT);
    38213821            LogBird(("ata: %x: waking up\n", pCtl->IOPortBase1));
    3822             if (VBOX_FAILURE(rc) || pCtl->fShutdown)
     3822            if (RT_FAILURE(rc) || pCtl->fShutdown)
    38233823                break;
    38243824
     
    49704970        {
    49714971            rc = RTThreadWait(pData->aCts[i].AsyncIOThread, 30000 /* 30 s*/, NULL);
    4972             AssertMsg(VBOX_SUCCESS(rc) || rc == VERR_INVALID_HANDLE, ("rc=%Rrc i=%d\n", rc, i));
     4972            AssertMsg(RT_SUCCESS(rc) || rc == VERR_INVALID_HANDLE, ("rc=%Rrc i=%d\n", rc, i));
    49734973        }
    49744974    }
     
    51035103        Assert(!pIf->pbIOBufferR3);
    51045104        rc = MMHyperAlloc(pVM, pIf->cbIOBuffer, 1, MM_TAG_PDM_DEVICE_USER, (void **)&pIf->pbIOBufferR3);
    5105         if (VBOX_FAILURE(rc))
     5105        if (RT_FAILURE(rc))
    51065106            return VERR_NO_MEMORY;
    51075107        pIf->pbIOBufferR0 = MMHyperR3ToR0(pVM, pIf->pbIOBufferR3);
     
    51965196     */
    51975197    rc = PDMDevHlpDriverAttach(pDevIns, pIf->iLUN, &pIf->IBase, &pIf->pDrvBase, NULL);
    5198     if (VBOX_SUCCESS(rc))
     5198    if (RT_SUCCESS(rc))
    51995199        rc = ataConfigLun(pDevIns, pIf);
    52005200    else
    52015201        AssertMsgFailed(("Failed to attach LUN#%d. rc=%Vrc\n", pIf->iLUN, rc));
    52025202
    5203     if (VBOX_FAILURE(rc))
     5203    if (RT_FAILURE(rc))
    52045204    {
    52055205        pIf->pDrvBase = NULL;
     
    54885488
    54895489    rc = SSMR3GetU32(pSSMHandle, &u32);
    5490     if (VBOX_FAILURE(rc))
     5490    if (RT_FAILURE(rc))
    54915491        return rc;
    54925492    if (u32 != ~0U)
     
    55435543
    55445544    rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true);
    5545     if (VBOX_FAILURE(rc))
     5545    if (RT_FAILURE(rc))
    55465546        return PDMDEV_SET_ERROR(pDevIns, rc,
    55475547                                N_("PIIX3 configuration error: failed to read GCEnabled as boolean"));
     
    55495549
    55505550    rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true);
    5551     if (VBOX_FAILURE(rc))
     5551    if (RT_FAILURE(rc))
    55525552        return PDMDEV_SET_ERROR(pDevIns, rc,
    55535553                                N_("PIIX3 configuration error: failed to read R0Enabled as boolean"));
     
    55555555
    55565556    rc = CFGMR3QueryU32Def(pCfgHandle, "IRQDelay", &DelayIRQMillies, 0);
    5557     if (VBOX_FAILURE(rc))
     5557    if (RT_FAILURE(rc))
    55585558        return PDMDEV_SET_ERROR(pDevIns, rc,
    55595559                                N_("PIIX3 configuration error: failed to read IRQDelay as integer"));
     
    55625562
    55635563    rc = CFGMR3QueryBoolDef(pCfgHandle, "PIIX4", &pData->fPIIX4, false);
    5564     if (VBOX_FAILURE(rc))
     5564    if (RT_FAILURE(rc))
    55655565        return PDMDEV_SET_ERROR(pDevIns, rc,
    55665566                                N_("PIIX3 configuration error: failed to read PIIX4 as boolean"));
     
    56315631     */
    56325632    rc = PDMDevHlpPCIRegister(pDevIns, &pData->dev);
    5633     if (VBOX_FAILURE(rc))
     5633    if (RT_FAILURE(rc))
    56345634        return PDMDEV_SET_ERROR(pDevIns, rc,
    56355635                                N_("PIIX3 cannot register PCI device"));
    56365636    AssertMsg(pData->dev.devfn == 9 || iInstance != 0, ("pData->dev.devfn=%d\n", pData->dev.devfn));
    56375637    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 4, 0x10, PCI_ADDRESS_SPACE_IO, ataBMDMAIORangeMap);
    5638     if (VBOX_FAILURE(rc))
     5638    if (RT_FAILURE(rc))
    56395639        return PDMDEV_SET_ERROR(pDevIns, rc,
    56405640                                N_("PIIX3 cannot register PCI I/O region for BMDMA"));
     
    56485648        rc = PDMDevHlpIOPortRegister(pDevIns, pData->aCts[i].IOPortBase1, 8, (RTHCPTR)i,
    56495649                                     ataIOPortWrite1, ataIOPortRead1, ataIOPortWriteStr1, ataIOPortReadStr1, "ATA I/O Base 1");
    5650         if (VBOX_FAILURE(rc))
     5650        if (RT_FAILURE(rc))
    56515651            return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot register I/O handlers"));
    56525652
     
    56555655            rc = PDMDevHlpIOPortRegisterGC(pDevIns, pData->aCts[i].IOPortBase1, 8, (RTGCPTR)i,
    56565656                                           "ataIOPortWrite1", "ataIOPortRead1", "ataIOPortWriteStr1", "ataIOPortReadStr1", "ATA I/O Base 1");
    5657             if (VBOX_FAILURE(rc))
     5657            if (RT_FAILURE(rc))
    56585658                return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot register I/O handlers (GC)"));
    56595659        }
     
    56685668                                           "ataIOPortWrite1", "ataIOPortRead1", "ataIOPortWriteStr1", "ataIOPortReadStr1", "ATA I/O Base 1");
    56695669#endif
    5670             if (VBOX_FAILURE(rc))
     5670            if (RT_FAILURE(rc))
    56715671                return PDMDEV_SET_ERROR(pDevIns, rc, "PIIX3 cannot register I/O handlers (R0).");
    56725672        }
     
    56745674        rc = PDMDevHlpIOPortRegister(pDevIns, pData->aCts[i].IOPortBase2, 1, (RTHCPTR)i,
    56755675                                     ataIOPortWrite2, ataIOPortRead2, NULL, NULL, "ATA I/O Base 2");
    5676         if (VBOX_FAILURE(rc))
     5676        if (RT_FAILURE(rc))
    56775677            return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot register base2 I/O handlers"));
    56785678
     
    56815681            rc = PDMDevHlpIOPortRegisterGC(pDevIns, pData->aCts[i].IOPortBase2, 1, (RTGCPTR)i,
    56825682                                           "ataIOPortWrite2", "ataIOPortRead2", NULL, NULL, "ATA I/O Base 2");
    5683             if (VBOX_FAILURE(rc))
     5683            if (RT_FAILURE(rc))
    56845684                return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot register base2 I/O handlers (GC)"));
    56855685        }
     
    56885688            rc = PDMDevHlpIOPortRegisterR0(pDevIns, pData->aCts[i].IOPortBase2, 1, (RTR0PTR)i,
    56895689                                           "ataIOPortWrite2", "ataIOPortRead2", NULL, NULL, "ATA I/O Base 2");
    5690             if (VBOX_FAILURE(rc))
     5690            if (RT_FAILURE(rc))
    56915691                return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot register base2 I/O handlers (R0)"));
    56925692        }
     
    57285728        RTStrPrintf(szName, sizeof(szName), "ATA%d", i);
    57295729        rc = PDMDevHlpCritSectInit(pDevIns, &pData->aCts[i].lock, szName);
    5730         if (VBOX_FAILURE(rc))
     5730        if (RT_FAILURE(rc))
    57315731            return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot initialize critical section"));
    57325732    }
     
    57365736     */
    57375737    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pData->IBase, &pBase, "Status Port");
    5738     if (VBOX_SUCCESS(rc))
     5738    if (RT_SUCCESS(rc))
    57395739        pData->pLedsConnector = (PDMILEDCONNECTORS *)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
    57405740    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
     
    57835783
    57845784            rc = PDMDevHlpDriverAttach(pDevIns, pIf->iLUN, &pIf->IBase, &pIf->pDrvBase, s_apszDescs[i][j]);
    5785             if (VBOX_SUCCESS(rc))
     5785            if (RT_SUCCESS(rc))
    57865786                rc = ataConfigLun(pDevIns, pIf);
    57875787            else if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
     
    58175817                              ataSaveLoadPrep, ataSaveExec, NULL,
    58185818                              ataSaveLoadPrep, ataLoadExec, NULL);
    5819     if (VBOX_FAILURE(rc))
     5819    if (RT_FAILURE(rc))
    58205820        return PDMDEV_SET_ERROR(pDevIns, rc, N_("PIIX3 cannot register save state handlers"));
    58215821
  • trunk/src/VBox/Devices/Storage/DrvBlock.cpp

    r11187 r11266  
    343343    int rc = pData->pDrvMedia->pfnBiosGetPCHSGeometry(pData->pDrvMedia, &pData->PCHSGeometry);
    344344
    345     if (VBOX_SUCCESS(rc))
     345    if (RT_SUCCESS(rc))
    346346    {
    347347        *pPCHSGeometry = pData->PCHSGeometry;
     
    377377    int rc = pData->pDrvMedia->pfnBiosSetPCHSGeometry(pData->pDrvMedia, pPCHSGeometry);
    378378
    379     if (    VBOX_SUCCESS(rc)
     379    if (    RT_SUCCESS(rc)
    380380        ||  rc == VERR_NOT_IMPLEMENTED)
    381381    {
     
    415415    int rc = pData->pDrvMedia->pfnBiosGetLCHSGeometry(pData->pDrvMedia, &pData->LCHSGeometry);
    416416
    417     if (VBOX_SUCCESS(rc))
     417    if (RT_SUCCESS(rc))
    418418    {
    419419        *pLCHSGeometry = pData->LCHSGeometry;
     
    449449    int rc = pData->pDrvMedia->pfnBiosSetLCHSGeometry(pData->pDrvMedia, pLCHSGeometry);
    450450
    451     if (    VBOX_SUCCESS(rc)
     451    if (    RT_SUCCESS(rc)
    452452        ||  rc == VERR_NOT_IMPLEMENTED)
    453453    {
     
    505505    {
    506506        int rc = pData->pDrvIns->pDrvHlp->pfnMountPrepare(pData->pDrvIns, pszFilename, pszCoreDriver);
    507         if (VBOX_FAILURE(rc))
     507        if (RT_FAILURE(rc))
    508508        {
    509509            Log(("drvblockMount: Prepare failed for \"%s\" rc=%Vrc\n", pszFilename, rc));
     
    517517    PPDMIBASE pBase;
    518518    int rc = pData->pDrvIns->pDrvHlp->pfnAttach(pData->pDrvIns, &pBase);
    519     if (VBOX_FAILURE(rc))
     519    if (RT_FAILURE(rc))
    520520    {
    521521        Log(("drvblockMount: Attach failed rc=%Vrc\n", rc));
     
    588588     */
    589589    int rc = pData->pDrvIns->pDrvHlp->pfnDetach(pData->pDrvIns);
    590     if (VBOX_FAILURE(rc))
     590    if (RT_FAILURE(rc))
    591591    {
    592592        Log(("drvblockUnmount: Detach failed rc=%Vrc\n", rc));
     
    772772    char *psz;
    773773    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "Type", &psz);
    774     if (VBOX_FAILURE(rc))
     774    if (RT_FAILURE(rc))
    775775        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_BLOCK_NO_TYPE, N_("Failed to obtain the type"));
    776776    if (!strcmp(psz, "HardDisk"))
     
    802802    /* Mountable */
    803803    rc = CFGMR3QueryBoolDef(pCfgHandle, "Mountable", &pData->fMountable, false);
    804     if (VBOX_FAILURE(rc))
     804    if (RT_FAILURE(rc))
    805805        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Mountable\" from the config"));
    806806
    807807    /* Locked */
    808808    rc = CFGMR3QueryBoolDef(pCfgHandle, "Locked", &pData->fLocked, false);
    809     if (VBOX_FAILURE(rc))
     809    if (RT_FAILURE(rc))
    810810        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Locked\" from the config"));
    811811
    812812    /* BIOS visible */
    813813    rc = CFGMR3QueryBoolDef(pCfgHandle, "BIOSVisible", &pData->fBiosVisible, true);
    814     if (VBOX_FAILURE(rc))
     814    if (RT_FAILURE(rc))
    815815        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"BIOSVisible\" from the config"));
    816816
     
    819819    /* Cylinders */
    820820    rc = CFGMR3QueryU32Def(pCfgHandle, "Cylinders", &pData->LCHSGeometry.cCylinders, 0);
    821     if (VBOX_FAILURE(rc))
     821    if (RT_FAILURE(rc))
    822822        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Cylinders\" from the config"));
    823823
    824824    /* Heads */
    825825    rc = CFGMR3QueryU32Def(pCfgHandle, "Heads", &pData->LCHSGeometry.cHeads, 0);
    826     if (VBOX_FAILURE(rc))
     826    if (RT_FAILURE(rc))
    827827        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Heads\" from the config"));
    828828
    829829    /* Sectors */
    830830    rc = CFGMR3QueryU32Def(pCfgHandle, "Sectors", &pData->LCHSGeometry.cSectors, 0);
    831     if (VBOX_FAILURE(rc))
     831    if (RT_FAILURE(rc))
    832832        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Sectors\" from the config"));
    833833
     
    836836    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    837837        RTUuidClear(&pData->Uuid);
    838     else if (VBOX_SUCCESS(rc))
     838    else if (RT_SUCCESS(rc))
    839839    {
    840840        rc = RTUuidFromStr(&pData->Uuid, psz);
    841         if (VBOX_FAILURE(rc))
     841        if (RT_FAILURE(rc))
    842842        {
    843843            PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, "%s",
     
    853853#ifdef VBOX_PERIODIC_FLUSH
    854854    rc = CFGMR3QueryU32Def(pCfgHandle, "FlushInterval", &pData->cbFlushInterval, 0);
    855     if (VBOX_FAILURE(rc))
     855    if (RT_FAILURE(rc))
    856856        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"FlushInterval\" from the config"));
    857857#endif /* VBOX_PERIODIC_FLUSH */
     
    859859#ifdef VBOX_IGNORE_FLUSH
    860860    rc = CFGMR3QueryBoolDef(pCfgHandle, "IgnoreFlush", &pData->fIgnoreFlush, true);
    861     if (VBOX_FAILURE(rc))
     861    if (RT_FAILURE(rc))
    862862        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"IgnoreFlush\" from the config"));
    863863#endif /* VBOX_IGNORE_FLUSH */
     
    871871        &&  pData->enmType != PDMBLOCKTYPE_HARD_DISK)
    872872        return VINF_SUCCESS;
    873     if (VBOX_FAILURE(rc))
     873    if (RT_FAILURE(rc))
    874874    {
    875875        AssertLogRelMsgFailed(("Failed to attach driver below us! rc=%Vra\n", rc));
  • trunk/src/VBox/Devices/Storage/DrvHostBase.cpp

    r8579 r11266  
    166166         */
    167167        rc = RTFileSeek(pThis->FileDevice, off, RTFILE_SEEK_BEGIN, NULL);
    168         if (VBOX_SUCCESS(rc))
     168        if (RT_SUCCESS(rc))
    169169        {
    170170            rc = RTFileRead(pThis->FileDevice, pvBuf, cbRead, NULL);
    171             if (VBOX_SUCCESS(rc))
     171            if (RT_SUCCESS(rc))
    172172            {
    173173                Log2(("%s-%d: drvHostBaseRead: off=%#llx cbRead=%#x\n"
     
    222222             */
    223223            rc = RTFileSeek(pThis->FileDevice, off, RTFILE_SEEK_BEGIN, NULL);
    224             if (VBOX_SUCCESS(rc))
     224            if (RT_SUCCESS(rc))
    225225            {
    226226                rc = RTFileWrite(pThis->FileDevice, pvBuf, cbWrite, NULL);
    227                 if (VBOX_FAILURE(rc))
     227                if (RT_FAILURE(rc))
    228228                    Log(("%s-%d: drvHostBaseWrite: RTFileWrite(%d, %p, %#x) -> %Vrc (off=%#llx '%s')\n",
    229229                         pThis->pDrvIns->pDrvReg->szDriverName, pThis->pDrvIns->iInstance, pThis->FileDevice,
     
    489489        if (pThis->pfnDoLock)
    490490            rc = pThis->pfnDoLock(pThis, true);
    491         if (VBOX_SUCCESS(rc))
     491        if (RT_SUCCESS(rc))
    492492            pThis->fLocked = true;
    493493    }
     
    512512        if (pThis->pfnDoLock)
    513513            rc = pThis->pfnDoLock(pThis, false);
    514         if (VBOX_SUCCESS(rc))
     514        if (RT_SUCCESS(rc))
    515515            pThis->fLocked = false;
    516516    }
     
    675675        char szName[128];
    676676        int rc = drvHostBaseGetBSDName(DVDService, &szName[0], 0);
    677         if (VBOX_SUCCESS(rc))
     677        if (RT_SUCCESS(rc))
    678678        {
    679679            pThis->pDASession = DASessionCreate(kCFAllocatorDefault);
     
    891891
    892892                    /* Obtain exclusive access to the device so we can send SCSI commands. */
    893                     if (VBOX_SUCCESS(rc))
     893                    if (RT_SUCCESS(rc))
    894894                        rc = drvHostBaseObtainExclusiveAccess(pThis, DVDService);
    895895
    896896                    /* Cleanup on failure. */
    897                     if (VBOX_FAILURE(rc))
     897                    if (RT_FAILURE(rc))
    898898                    {
    899899                        if (pThis->ppScsiTaskDI)
     
    991991    int rc = drvHostBaseOpen(pThis, &FileDevice, pThis->fReadOnlyConfig);
    992992#endif
    993     if (VBOX_FAILURE(rc))
     993    if (RT_FAILURE(rc))
    994994    {
    995995        if (!pThis->fReadOnlyConfig)
     
    10021002#endif
    10031003        }
    1004         if (VBOX_FAILURE(rc))
     1004        if (RT_FAILURE(rc))
    10051005        {
    10061006            LogFlow(("%s-%d: failed to open device '%s', rc=%Vrc\n",
     
    10521052    };
    10531053    int rc = DRVHostBaseScsiCmd(pThis, abCmd, 6, PDMBLOCKTXDIR_FROM_DEVICE, &Buf, &cbBuf, NULL, 0, 0);
    1054     if (VBOX_SUCCESS(rc))
     1054    if (RT_SUCCESS(rc))
    10551055    {
    10561056        Assert(cbBuf == sizeof(Buf));
     
    12441244     */
    12451245    int rc = drvHostBaseReopen(pThis);
    1246     if (VBOX_FAILURE(rc))
     1246    if (RT_FAILURE(rc))
    12471247        return rc;
    12481248
     
    12521252    uint64_t cb;
    12531253    rc = pThis->pfnGetMediaSize(pThis, &cb);
    1254     if (VBOX_FAILURE(rc))
     1254    if (RT_FAILURE(rc))
    12551255    {
    12561256        LogFlow(("%s-%d: failed to figure media size of %s, rc=%Vrc\n",
     
    13321332                        int cRetries = 10;
    13331333                        int rc = DRVHostBaseMediaPresent(pThis);
    1334                         while (VBOX_FAILURE(rc) && cRetries-- > 0)
     1334                        while (RT_FAILURE(rc) && cRetries-- > 0)
    13351335                        {
    13361336                            RTThreadSleep(50);
     
    14291429
    14301430            int rc = pThis->pfnPoll(pThis);
    1431             if (VBOX_FAILURE(rc))
     1431            if (RT_FAILURE(rc))
    14321432            {
    14331433                RTSemEventWait(pThis->EventPoller, 50);
     
    14491449         */
    14501450        int rc = RTSemEventWait(pThis->EventPoller, pThis->cMilliesPoller);
    1451         if (    VBOX_FAILURE(rc)
     1451        if (    RT_FAILURE(rc)
    14521452            &&  rc != VERR_TIMEOUT)
    14531453        {
     
    15421542    {
    15431543        int rc = pThis->pfnDoLock(pThis, false);
    1544         if (VBOX_SUCCESS(rc))
     1544        if (RT_SUCCESS(rc))
    15451545            pThis->fLocked = false;
    15461546    }
     
    17391739    /* Device */
    17401740    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "Path", &pThis->pszDevice);
    1741     if (VBOX_FAILURE(rc))
     1741    if (RT_FAILURE(rc))
    17421742    {
    17431743        AssertMsgFailed(("Configuration error: query for \"Path\" string returned %Vra.\n", rc));
     
    17481748    uint32_t u32;
    17491749    rc = CFGMR3QueryU32(pCfgHandle, "Interval", &u32);
    1750     if (VBOX_SUCCESS(rc))
     1750    if (RT_SUCCESS(rc))
    17511751        pThis->cMilliesPoller = u32;
    17521752    else if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    17531753        pThis->cMilliesPoller = 1000;
    1754     else if (VBOX_FAILURE(rc))
     1754    else if (RT_FAILURE(rc))
    17551755    {
    17561756        AssertMsgFailed(("Configuration error: Query \"Mountable\" resulted in %Vrc.\n", rc));
     
    17621762    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    17631763        pThis->fReadOnlyConfig = enmType == PDMBLOCKTYPE_DVD || enmType == PDMBLOCKTYPE_CDROM ? true : false;
    1764     else if (VBOX_FAILURE(rc))
     1764    else if (RT_FAILURE(rc))
    17651765    {
    17661766        AssertMsgFailed(("Configuration error: Query \"ReadOnly\" resulted in %Vrc.\n", rc));
     
    17721772    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    17731773        pThis->fLocked = false;
    1774     else if (VBOX_FAILURE(rc))
     1774    else if (RT_FAILURE(rc))
    17751775    {
    17761776        AssertMsgFailed(("Configuration error: Query \"Locked\" resulted in %Vrc.\n", rc));
     
    17821782    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    17831783        pThis->fBiosVisible = true;
    1784     else if (VBOX_FAILURE(rc))
     1784    else if (RT_FAILURE(rc))
    17851785    {
    17861786        AssertMsgFailed(("Configuration error: Query \"BIOSVisible\" resulted in %Vrc.\n", rc));
     
    17931793    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    17941794        RTUuidClear(&pThis->Uuid);
    1795     else if (VBOX_SUCCESS(rc))
     1795    else if (RT_SUCCESS(rc))
    17961796    {
    17971797        rc = RTUuidFromStr(&pThis->Uuid, psz);
    1798         if (VBOX_FAILURE(rc))
     1798        if (RT_FAILURE(rc))
    17991799        {
    18001800            AssertMsgFailed(("Configuration error: Uuid from string failed on \"%s\", rc=%Vrc.\n", psz, rc));
     
    18131813    bool fAttachFailError;
    18141814    rc = CFGMR3QueryBool(pCfgHandle, "AttachFailError", &fAttachFailError);
    1815     if (VBOX_FAILURE(rc))
     1815    if (RT_FAILURE(rc))
    18161816        fAttachFailError = true;
    18171817    pThis->fAttachFailError = fAttachFailError;
     
    18841884                                          NULL, NULL, NULL,
    18851885                                          NULL, NULL, drvHostBaseLoadDone);
    1886     if (VBOX_FAILURE(rc))
     1886    if (RT_FAILURE(rc))
    18871887        return rc;
    18881888
     
    19301930    rc = drvHostBaseReopen(pThis);
    19311931#endif
    1932     if (VBOX_FAILURE(rc))
     1932    if (RT_FAILURE(rc))
    19331933    {
    19341934        char *pszDevice = pThis->pszDevice;
     
    19811981    }
    19821982#ifdef RT_OS_WINDOWS
    1983     if (VBOX_SUCCESS(src))
     1983    if (RT_SUCCESS(src))
    19841984        DRVHostBaseMediaPresent(pThis);
    19851985#endif
     
    19921992        if (pThis->pfnDoLock)
    19931993            rc = pThis->pfnDoLock(pThis, true);
    1994         if (VBOX_FAILURE(rc))
     1994        if (RT_FAILURE(rc))
    19951995        {
    19961996            AssertMsgFailed(("Failed to lock the dvd drive. rc=%Vrc\n", rc));
     
    20002000
    20012001#ifndef RT_OS_WINDOWS
    2002     if (VBOX_SUCCESS(src))
     2002    if (RT_SUCCESS(src))
    20032003    {
    20042004        /*
     
    20062006         */
    20072007        rc = RTSemEventCreate(&pThis->EventPoller);
    2008         if (VBOX_FAILURE(rc))
     2008        if (RT_FAILURE(rc))
    20092009            return rc;
    20102010    }
     
    20152015     */
    20162016    rc = RTCritSectInit(&pThis->CritSect);
    2017     if (VBOX_FAILURE(rc))
     2017    if (RT_FAILURE(rc))
    20182018        return rc;
    20192019
    2020     if (VBOX_SUCCESS(src))
     2020    if (RT_SUCCESS(src))
    20212021    {
    20222022        /*
     
    20252025        rc = RTThreadCreate(&pThis->ThreadPoller, drvHostBaseMediaThread, pThis, 0,
    20262026                            RTTHREADTYPE_INFREQUENT_POLLER, RTTHREADFLAGS_WAITABLE, "DVDMEDIA");
    2027         if (VBOX_FAILURE(rc))
     2027        if (RT_FAILURE(rc))
    20282028        {
    20292029            AssertMsgFailed(("Failed to create poller thread. rc=%Vrc\n", rc));
     
    20422042    }
    20432043
    2044     if (VBOX_FAILURE(src))
     2044    if (RT_FAILURE(src))
    20452045        return src;
    20462046    return rc;
  • trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp

    r9330 r11266  
    162162         if (FileDevice == NIL_RTFILE) /* obsolete crap */
    163163             rc = RTFileOpen(&FileDevice, pThis->pszDeviceOpen, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    164          if (VBOX_SUCCESS(rc))
     164         if (RT_SUCCESS(rc))
    165165         {
    166166             /* do ioctl */
     
    312312    uint8_t abSense[32];
    313313    int rc2 = DRVHostBaseScsiCmd(pThis, abCmd, 6, PDMBLOCKTXDIR_NONE, NULL, NULL, abSense, sizeof(abSense), 0);
    314     if (VBOX_SUCCESS(rc2))
     314    if (RT_SUCCESS(rc2))
    315315        fMediaPresent = true;
    316316    else if (   rc2 == VERR_UNRESOLVED_ERROR
     
    710710     */
    711711    int rc = DRVHostBaseInitData(pDrvIns, pCfgHandle, PDMBLOCKTYPE_DVD);
    712     if (VBOX_SUCCESS(rc))
     712    if (RT_SUCCESS(rc))
    713713    {
    714714        /*
     
    719719        bool fPassthrough;
    720720        rc = CFGMR3QueryBool(pCfgHandle, "Passthrough", &fPassthrough);
    721         if (VBOX_SUCCESS(rc) && fPassthrough)
     721        if (RT_SUCCESS(rc) && fPassthrough)
    722722        {
    723723            pThis->IBlock.pfnSendCmd = drvHostDvdSendCmd;
     
    726726# ifdef VBOX_WITH_SUID_WRAPPER  /* Solaris setuid for Passthrough mode. */
    727727            rc = solarisCheckUserAuth();
    728             if (VBOX_FAILURE(rc))
     728            if (RT_FAILURE(rc))
    729729            {
    730730                Log(("DVD: solarisCheckUserAuth failed. Permission denied!\n"));
     
    752752        rc = DRVHostBaseInitFinish(pThis);
    753753    }
    754     if (VBOX_FAILURE(rc))
     754    if (RT_FAILURE(rc))
    755755    {
    756756        if (!pThis->fAttachFailError)
  • trunk/src/VBox/Devices/Storage/DrvHostFloppy.cpp

    r8155 r11266  
    124124            DRVHostBaseMediaNotPresent(pThis);
    125125        rc = DRVHostBaseMediaPresent(pThis);
    126         if (VBOX_FAILURE(rc))
     126        if (RT_FAILURE(rc))
    127127        {
    128128            pThisFloppy->fPrevDiskIn = fDiskIn;
     
    162162     */
    163163    int rc = DRVHostBaseInitData(pDrvIns, pCfgHandle, PDMBLOCKTYPE_FLOPPY_1_44);
    164     if (VBOX_SUCCESS(rc))
     164    if (RT_SUCCESS(rc))
    165165    {
    166166        /*
     
    177177        rc = DRVHostBaseInitFinish(&pThis->Base);
    178178    }
    179     if (VBOX_FAILURE(rc))
     179    if (RT_FAILURE(rc))
    180180    {
    181181        if (!pThis->Base.fAttachFailError)
  • trunk/src/VBox/Devices/Storage/DrvMediaISO.cpp

    r11191 r11266  
    128128    char *pszName;
    129129    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "Path", &pszName);
    130     if (VBOX_FAILURE(rc))
     130    if (RT_FAILURE(rc))
    131131        return PDMDRV_SET_ERROR(pDrvIns, rc, N_("Failed to query \"Path\" from the config"));
    132132
     
    136136    rc = RTFileOpen(&pData->File, pszName,
    137137                    RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
    138     if (VBOX_SUCCESS(rc))
     138    if (RT_SUCCESS(rc))
    139139    {
    140140        LogFlow(("drvMediaISOConstruct: ISO image '%s' opened successfully.\n", pszName));
     
    182182    uint64_t cbFile;
    183183    int rc = RTFileGetSize(pData->File, &cbFile);
    184     if (VBOX_SUCCESS(rc))
     184    if (RT_SUCCESS(rc))
    185185    {
    186186        LogFlow(("drvMediaISOGetSize: returns %lld (%s)\n", cbFile, pData->pszFilename));
     
    238238     */
    239239    int rc = RTFileSeek(pData->File, off, RTFILE_SEEK_BEGIN, NULL);
    240     if (VBOX_SUCCESS(rc))
     240    if (RT_SUCCESS(rc))
    241241    {
    242242        rc = RTFileRead(pData->File, pvBuf, cbRead, NULL);
    243         if (VBOX_SUCCESS(rc))
     243        if (RT_SUCCESS(rc))
    244244        {
    245245            Log2(("drvMediaISORead: off=%#llx pvBuf=%p cbRead=%#x (%s)\n"
  • trunk/src/VBox/Devices/Storage/DrvRawImage.cpp

    r8155 r11266  
    131131    char *pszName;
    132132    int rc = CFGMR3QueryStringAlloc(pCfgHandle, "Path", &pszName);
    133     if (VBOX_FAILURE(rc))
     133    if (RT_FAILURE(rc))
    134134    {
    135135        AssertMsgFailed(("Configuration error: query for \"Path\" string return %Vrc.\n", rc));
     
    142142    rc = RTFileOpen(&pData->File, pszName,
    143143                    RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    144     if (VBOX_SUCCESS(rc))
     144    if (RT_SUCCESS(rc))
    145145    {
    146146        LogFlow(("drvRawImageConstruct: Raw image '%s' opened successfully.\n", pszName));
     
    152152        rc = RTFileOpen(&pData->File, pszName,
    153153                        RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    154         if (VBOX_SUCCESS(rc))
     154        if (RT_SUCCESS(rc))
    155155        {
    156156            LogFlow(("drvRawImageConstruct: Raw image '%s' opened successfully.\n", pszName));
     
    200200    uint64_t cbFile;
    201201    int rc = RTFileGetSize(pData->File, &cbFile);
    202     if (VBOX_SUCCESS(rc))
     202    if (RT_SUCCESS(rc))
    203203    {
    204204        LogFlow(("drvRawImageGetSize: returns %lld (%s)\n", cbFile, pData->pszFilename));
     
    256256     */
    257257    int rc = RTFileSeek(pData->File, off, RTFILE_SEEK_BEGIN, NULL);
    258     if (VBOX_SUCCESS(rc))
     258    if (RT_SUCCESS(rc))
    259259    {
    260260        rc = RTFileRead(pData->File, pvBuf, cbRead, NULL);
    261         if (VBOX_SUCCESS(rc))
     261        if (RT_SUCCESS(rc))
    262262        {
    263263            Log2(("drvRawImageRead: off=%#llx pvBuf=%p cbRead=%#x (%s)\n"
     
    290290     */
    291291    int rc = RTFileSeek(pData->File, off, RTFILE_SEEK_BEGIN, NULL);
    292     if (VBOX_SUCCESS(rc))
     292    if (RT_SUCCESS(rc))
    293293    {
    294294        rc = RTFileWrite(pData->File, pvBuf, cbWrite, NULL);
    295         if (VBOX_SUCCESS(rc))
     295        if (RT_SUCCESS(rc))
    296296        {
    297297            Log2(("drvRawImageWrite: off=%#llx pvBuf=%p cbWrite=%#x (%s)\n"
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r11047 r11266  
    146146}
    147147
    148 static DECLCALLBACK(int) drvvdAsyncIORead(void *pvUser, void *pStorage, uint64_t uOffset, 
     148static DECLCALLBACK(int) drvvdAsyncIORead(void *pvUser, void *pStorage, uint64_t uOffset,
    149149                                          size_t cbRead, void *pvBuf, size_t *pcbRead)
    150150{
     
    158158}
    159159
    160 static DECLCALLBACK(int) drvvdAsyncIOWrite(void *pvUser, void *pStorage, uint64_t uOffset, 
     160static DECLCALLBACK(int) drvvdAsyncIOWrite(void *pvUser, void *pStorage, uint64_t uOffset,
    161161                                           size_t cbWrite, const void *pvBuf, size_t *pcbWritten)
    162162{
     
    278278    PVBOXDISK pData = PDMIMEDIA_2_VBOXDISK(pInterface);
    279279    int rc = VDRead(pData->pDisk, off, pvBuf, cbRead);
    280     if (VBOX_SUCCESS(rc))
     280    if (RT_SUCCESS(rc))
    281281        Log2(("%s: off=%#llx pvBuf=%p cbRead=%d %.*Vhxd\n", __FUNCTION__,
    282282              off, pvBuf, cbRead, cbRead, pvBuf));
     
    337337    PVBOXDISK pData = PDMIMEDIA_2_VBOXDISK(pInterface);
    338338    int rc = VDGetPCHSGeometry(pData->pDisk, VD_LAST_IMAGE, pPCHSGeometry);
    339     if (VBOX_FAILURE(rc))
     339    if (RT_FAILURE(rc))
    340340    {
    341341        Log(("%s: geometry not available.\n", __FUNCTION__));
     
    366366    PVBOXDISK pData = PDMIMEDIA_2_VBOXDISK(pInterface);
    367367    int rc = VDGetLCHSGeometry(pData->pDisk, VD_LAST_IMAGE, pLCHSGeometry);
    368     if (VBOX_FAILURE(rc))
     368    if (RT_FAILURE(rc))
    369369    {
    370370        Log(("%s: geometry not available.\n", __FUNCTION__));
     
    402402*******************************************************************************/
    403403
    404 static DECLCALLBACK(int) drvvdStartRead(PPDMIMEDIAASYNC pInterface, uint64_t uOffset, 
     404static DECLCALLBACK(int) drvvdStartRead(PPDMIMEDIAASYNC pInterface, uint64_t uOffset,
    405405                                        PPDMDATASEG paSeg, unsigned cSeg,
    406406                                        size_t cbRead, void *pvUser)
     
    435435    PDRVVDASYNCTASK pDrvVDAsyncTask = (PDRVVDASYNCTASK)pvUser;
    436436    int rc = VINF_VDI_ASYNC_IO_FINISHED;
    437    
     437
    438438    /* Having a completion callback for a task is not mandatory. */
    439439    if (pDrvVDAsyncTask->pfnCompleted)
     
    580580    pData->pDrvMediaAsyncPort = (PPDMIMEDIAASYNCPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_MEDIA_ASYNC_PORT);
    581581
    582     /* 
     582    /*
    583583     * Attach the async transport driver below of the device above us implements the
    584584     * async interface.
     
    592592        if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    593593        {
    594             /* 
     594            /*
    595595             * Though the device supports async I/O the backend seems to not support it.
    596596             * Revert to non async I/O.
     
    598598            pData->pDrvMediaAsyncPort = NULL;
    599599        }
    600         else if (VBOX_FAILURE(rc))
     600        else if (RT_FAILURE(rc))
    601601        {
    602602            AssertMsgFailed(("Failed to attach async transport driver below rc=%Vrc\n", rc));
     
    656656     * Open the images.
    657657     */
    658     if (VBOX_SUCCESS(rc))
     658    if (RT_SUCCESS(rc))
    659659    {
    660660        /** @todo TEMP! later the iSCSI config callbacks won't be included here */
     
    664664
    665665    unsigned cImages = iLevel;
    666     while (pCurNode && VBOX_SUCCESS(rc))
     666    while (pCurNode && RT_SUCCESS(rc))
    667667    {
    668668        /*
     
    670670         */
    671671        rc = CFGMR3QueryStringAlloc(pCurNode, "Path", &pszName);
    672         if (VBOX_FAILURE(rc))
     672        if (RT_FAILURE(rc))
    673673        {
    674674            rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     
    678678
    679679        rc = CFGMR3QueryStringAlloc(pCfgHandle, "Format", &pszFormat);
    680         if (VBOX_FAILURE(rc))
     680        if (RT_FAILURE(rc))
    681681        {
    682682            rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     
    690690            if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    691691                fReadOnly = false;
    692             else if (VBOX_FAILURE(rc))
     692            else if (RT_FAILURE(rc))
    693693            {
    694694                rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     
    700700            if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    701701                fHonorZeroWrites = false;
    702             else if (VBOX_FAILURE(rc))
     702            else if (RT_FAILURE(rc))
    703703            {
    704704                rc = PDMDRV_SET_ERROR(pDrvIns, rc,
     
    742742        }
    743743
    744         if (VBOX_SUCCESS(rc))
     744        if (RT_SUCCESS(rc))
    745745            Log(("%s: %d - Opened '%s' in %s mode\n", __FUNCTION__,
    746746                 iLevel, pszName,
     
    763763    }
    764764
    765     if (VBOX_FAILURE(rc))
     765    if (RT_FAILURE(rc))
    766766    {
    767767        if (VALID_PTR(pData->pDisk))
     
    776776    }
    777777
    778     /* 
     778    /*
    779779     * Check for async I/O support. Every opened image has to support
    780780     * it.
     
    790790        if (vdBackendInfo.uBackendCaps & VD_CAP_ASYNC)
    791791        {
    792             /* 
     792            /*
    793793             * Backend indicates support for at least some files.
    794794             * Check if current file is supported with async I/O)
     
    797797            AssertRC(rc);
    798798
    799             /* 
     799            /*
    800800             * Check if current image is supported.
    801801             * If not we can stop checking because
     
    895895    PVBOXDISK pData = PDMINS2DATA(pDrvIns, PVBOXDISK);
    896896
    897     /* 
     897    /*
    898898     * We must close the disk here to ensure that
    899899     * the backend closes all files before the
  • trunk/src/VBox/Devices/Storage/RawHDDCore.cpp

    r11176 r11266  
    111111                     ? RTFILE_O_READ      | RTFILE_O_OPEN | RTFILE_O_DENY_NONE
    112112                     : RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
    113     if (VBOX_FAILURE(rc))
     113    if (RT_FAILURE(rc))
    114114    {
    115115        /* Do NOT signal an appropriate error here, as the VD layer has the
     
    120120
    121121    rc = RTFileGetSize(pImage->File, &pImage->cbSize);
    122     if (VBOX_FAILURE(rc))
     122    if (RT_FAILURE(rc))
    123123        goto out;
    124124    if (pImage->cbSize % 512)
     
    130130
    131131out:
    132     if (VBOX_FAILURE(rc))
     132    if (RT_FAILURE(rc))
    133133        rawFreeImage(pImage, false);
    134134    return rc;
     
    167167    rc = RTFileOpen(&File, pImage->pszFilename,
    168168                    RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_ALL);
    169     if (VBOX_FAILURE(rc))
     169    if (RT_FAILURE(rc))
    170170    {
    171171        rc = rawError(pImage, rc, RT_SRC_POS, N_("Raw: cannot create image '%s'"), pImage->pszFilename);
     
    177177     * sufficient space available. */
    178178    rc = RTFsQuerySizes(pImage->pszFilename, NULL, &cbFree, NULL, NULL);
    179     if (VBOX_SUCCESS(rc) /* ignore errors */ && ((uint64_t)cbFree < cbSize))
     179    if (RT_SUCCESS(rc) /* ignore errors */ && ((uint64_t)cbFree < cbSize))
    180180    {
    181181        rc = rawError(pImage, VERR_DISK_FULL, RT_SRC_POS, N_("Raw: disk would overflow creating image '%s'"), pImage->pszFilename);
     
    186186     * effective than expanding file by write operations. */
    187187    rc = RTFileSetSize(File, cbSize);
    188     if (VBOX_FAILURE(rc))
     188    if (RT_FAILURE(rc))
    189189    {
    190190        rc = rawError(pImage, rc, RT_SRC_POS, N_("Raw: setting image size failed for '%s'"), pImage->pszFilename);
     
    210210
    211211        rc = RTFileWriteAt(File, uOff, pvBuf, cbChunk, NULL);
    212         if (VBOX_FAILURE(rc))
     212        if (RT_FAILURE(rc))
    213213        {
    214214            rc = rawError(pImage, rc, RT_SRC_POS, N_("Raw: writing block failed for '%s'"), pImage->pszFilename);
     
    223223                             uPercentStart + uOff * uPercentSpan * 98 / (cbSize * 100),
    224224                             pvUser);
    225             if (VBOX_FAILURE(rc))
     225            if (RT_FAILURE(rc))
    226226                goto out;
    227227        }
     
    229229    RTMemTmpFree(pvBuf);
    230230
    231     if (VBOX_SUCCESS(rc) && pfnProgress)
     231    if (RT_SUCCESS(rc) && pfnProgress)
    232232        pfnProgress(NULL /* WARNING! pVM=NULL  */,
    233233                    uPercentStart + uPercentSpan * 98 / 100, pvUser);
     
    239239
    240240out:
    241     if (VBOX_SUCCESS(rc) && pfnProgress)
     241    if (RT_SUCCESS(rc) && pfnProgress)
    242242        pfnProgress(NULL /* WARNING! pVM=NULL  */,
    243243                    uPercentStart + uPercentSpan, pvUser);
    244244
    245     if (VBOX_FAILURE(rc))
     245    if (RT_FAILURE(rc))
    246246        rawFreeImage(pImage, rc != VERR_ALREADY_EXISTS);
    247247    return rc;
     
    346346
    347347    rc = rawOpenImage(pImage, uOpenFlags);
    348     if (VBOX_SUCCESS(rc))
     348    if (RT_SUCCESS(rc))
    349349        *ppBackendData = pImage;
    350350
     
    404404                        pPCHSGeometry, pLCHSGeometry,
    405405                        pfnProgress, pvUser, uPercentStart, uPercentSpan);
    406     if (VBOX_SUCCESS(rc))
     406    if (RT_SUCCESS(rc))
    407407    {
    408408        /* So far the image is opened in read/write mode. Make sure the
     
    412412            rawFreeImage(pImage, false);
    413413            rc = rawOpenImage(pImage, uOpenFlags);
    414             if (VBOX_FAILURE(rc))
     414            if (RT_FAILURE(rc))
    415415                goto out;
    416416        }
     
    585585        {
    586586            int rc = RTFileGetSize(pImage->File, &cbFile);
    587             if (VBOX_SUCCESS(rc))
     587            if (RT_SUCCESS(rc))
    588588                cb += cbFile;
    589589        }
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    r11176 r11266  
    192192        /* Try to load the plugin (RTldrLoad takes care of the suffix). */
    193193        rc = RTLdrLoad(pszPluginName, &hPlugin);
    194         if (VBOX_SUCCESS(rc))
     194        if (RT_SUCCESS(rc))
    195195        {
    196196            PFNVBOXHDDFORMATLOAD pfnHDDFormatLoad;
     
    198198            rc = RTLdrGetSymbol(hPlugin, VBOX_HDDFORMAT_LOAD_NAME,
    199199                                (void**)&pfnHDDFormatLoad);
    200             if (VBOX_FAILURE(rc) || !pfnHDDFormatLoad)
     200            if (RT_FAILURE(rc) || !pfnHDDFormatLoad)
    201201            {
    202202                LogFunc(("error resolving the entry point %s in plugin %s, rc=%Vrc, pfnHDDFormat=%#p\n", VBOX_HDDFORMAT_LOAD_NAME, pszPluginName, rc, pfnHDDFormatLoad));
    203                 if (VBOX_SUCCESS(rc))
     203                if (RT_SUCCESS(rc))
    204204                    rc = VERR_SYMBOL_NOT_FOUND;
    205205                goto out;
     
    209209            PVBOXHDDBACKEND pBE;
    210210            rc = pfnHDDFormatLoad(&pBE);
    211             if (VBOX_FAILURE(rc))
     211            if (RT_FAILURE(rc))
    212212                goto out;
    213213            /* Check if the sizes match. If not this plugin is too old. */
     
    230230
    231231out:
    232     if (VBOX_FAILURE(rc))
     232    if (RT_FAILURE(rc))
    233233    {
    234234        if (hPlugin != NIL_RTLDRMOD)
     
    344344        uOffset += cbThisRead;
    345345        pvBuf = (char *)pvBuf + cbThisRead;
    346     } while (cbRead != 0 && VBOX_SUCCESS(rc));
     346    } while (cbRead != 0 && RT_SUCCESS(rc));
    347347
    348348    return rc;
     
    407407        rc = vdReadHelper(pDisk, pImage->pPrev, uOffset - cbPreRead, pvTmp,
    408408                          cbPreRead);
    409         if (VBOX_FAILURE(rc))
     409        if (RT_FAILURE(rc))
    410410            return rc;
    411411    }
     
    444444                              (char *)pvTmp + cbPreRead + cbThisWrite + cbWriteCopy,
    445445                              cbReadImage);
    446         if (VBOX_FAILURE(rc))
     446        if (RT_FAILURE(rc))
    447447            return rc;
    448448        /* Zero out the remainder of this block. Will never be visible, as this
     
    503503    rc = vdReadHelper(pDisk, pImage->pPrev, uOffset - cbPreRead, pvTmp,
    504504                      cbPreRead + cbThisWrite + cbPostRead - cbFill);
    505     if (VBOX_FAILURE(rc))
     505    if (RT_FAILURE(rc))
    506506        return rc;
    507507
     
    595595            }
    596596            RTMemTmpFree(pvTmp);
    597             if (VBOX_FAILURE(rc))
     597            if (RT_FAILURE(rc))
    598598                break;
    599599        }
     
    602602        uOffset += cbThisWrite;
    603603        pvBuf = (char *)pvBuf + cbThisWrite;
    604     } while (cbWrite != 0 && VBOX_SUCCESS(rc));
     604    } while (cbWrite != 0 && RT_SUCCESS(rc));
    605605
    606606    return rc;
     
    656656            }
    657657        }
    658         if (VBOX_FAILURE(rc))
     658        if (RT_FAILURE(rc))
    659659            break;
    660660
     
    662662        char szPath[RTPATH_MAX];
    663663        rc = RTPathSharedLibs(szPath, sizeof(szPath));
    664         if (VBOX_FAILURE(rc))
     664        if (RT_FAILURE(rc))
    665665            break;
    666666
     
    669669        rc = RTStrAPrintf(&pszPluginFilter, "%s/%s*", szPath,
    670670                          VBOX_HDDFORMAT_PLUGIN_PREFIX);
    671         if (VBOX_FAILURE(rc))
     671        if (RT_FAILURE(rc))
    672672        {
    673673            rc = VERR_NO_MEMORY;
     
    677677        /* The plugins are in the same directory as the other shared libs. */
    678678        rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT);
    679         if (VBOX_FAILURE(rc))
     679        if (RT_FAILURE(rc))
    680680            break;
    681681
     
    702702                /* Retry. */
    703703                rc = RTDirRead(pPluginDir, pPluginDirEntry, &cbPluginDirEntry);
    704                 if (VBOX_FAILURE(rc))
     704                if (RT_FAILURE(rc))
    705705                    break;
    706706            }
    707             else if (VBOX_FAILURE(rc))
     707            else if (RT_FAILURE(rc))
    708708                break;
    709709
     
    713713
    714714            rc = RTLdrLoad(pPluginDirEntry->szName, &hPlugin);
    715             if (VBOX_SUCCESS(rc))
     715            if (RT_SUCCESS(rc))
    716716            {
    717717                rc = RTLdrGetSymbol(hPlugin, VBOX_HDDFORMAT_LOAD_NAME, (void**)&pfnHDDFormatLoad);
    718                 if (VBOX_FAILURE(rc) || !pfnHDDFormatLoad)
     718                if (RT_FAILURE(rc) || !pfnHDDFormatLoad)
    719719                {
    720720                    LogFunc(("error resolving the entry point %s in plugin %s, rc=%Vrc, pfnHDDFormat=%#p\n", VBOX_HDDFORMAT_LOAD_NAME, pPluginDirEntry->szName, rc, pfnHDDFormatLoad));
    721                     if (VBOX_SUCCESS(rc))
     721                    if (RT_SUCCESS(rc))
    722722                        rc = VERR_SYMBOL_NOT_FOUND;
    723723                }
    724724
    725                 if (VBOX_SUCCESS(rc))
     725                if (RT_SUCCESS(rc))
    726726                {
    727727                    /* Get the function table. */
    728728                    rc = pfnHDDFormatLoad(&pBackend);
    729                     if (VBOX_SUCCESS(rc) && pBackend->cbSize == sizeof(VBOXHDDBACKEND))
     729                    if (RT_SUCCESS(rc) && pBackend->cbSize == sizeof(VBOXHDDBACKEND))
    730730                    {
    731731                        char *pszName = RTStrDup(pBackend->pszBackendName);
     
    885885            {
    886886                rc = aBackends[i]->pfnCheckIfValid(pszFilename);
    887                 if (VBOX_SUCCESS(rc))
     887                if (RT_SUCCESS(rc))
    888888                {
    889889                    fPluginFound = true;
     
    906906        char szPath[RTPATH_MAX];
    907907        rc = RTPathSharedLibs(szPath, sizeof(szPath));
    908         if (VBOX_FAILURE(rc))
     908        if (RT_FAILURE(rc))
    909909            break;
    910910
     
    913913        rc = RTStrAPrintf(&pszPluginFilter, "%s/%s*", szPath,
    914914                          VBOX_HDDFORMAT_PLUGIN_PREFIX);
    915         if (VBOX_FAILURE(rc))
     915        if (RT_FAILURE(rc))
    916916        {
    917917            rc = VERR_NO_MEMORY;
     
    921921        /* The plugins are in the same directory as the other shared libs. */
    922922        rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT);
    923         if (VBOX_FAILURE(rc))
     923        if (RT_FAILURE(rc))
    924924            break;
    925925
     
    946946                /* Retry. */
    947947                rc = RTDirRead(pPluginDir, pPluginDirEntry, &cbPluginDirEntry);
    948                 if (VBOX_FAILURE(rc))
     948                if (RT_FAILURE(rc))
    949949                    break;
    950950            }
    951             else if (VBOX_FAILURE(rc))
     951            else if (RT_FAILURE(rc))
    952952                break;
    953953
     
    957957
    958958            rc = RTLdrLoad(pPluginDirEntry->szName, &hPlugin);
    959             if (VBOX_SUCCESS(rc))
     959            if (RT_SUCCESS(rc))
    960960            {
    961961                rc = RTLdrGetSymbol(hPlugin, VBOX_HDDFORMAT_LOAD_NAME, (void**)&pfnHDDFormatLoad);
    962                 if (VBOX_FAILURE(rc) || !pfnHDDFormatLoad)
     962                if (RT_FAILURE(rc) || !pfnHDDFormatLoad)
    963963                {
    964964                    LogFunc(("error resolving the entry point %s in plugin %s, rc=%Vrc, pfnHDDFormat=%#p\n", VBOX_HDDFORMAT_LOAD_NAME, pPluginDirEntry->szName, rc, pfnHDDFormatLoad));
    965                     if (VBOX_SUCCESS(rc))
     965                    if (RT_SUCCESS(rc))
    966966                        rc = VERR_SYMBOL_NOT_FOUND;
    967967                }
    968968
    969                 if (VBOX_SUCCESS(rc))
     969                if (RT_SUCCESS(rc))
    970970                {
    971971                    /* Get the function table. */
    972972                    rc = pfnHDDFormatLoad(&pBackend);
    973                     if (VBOX_SUCCESS(rc) && pBackend->cbSize == sizeof(VBOXHDDBACKEND))
     973                    if (RT_SUCCESS(rc) && pBackend->cbSize == sizeof(VBOXHDDBACKEND))
    974974                    {
    975975
    976976                        /* Check if the plugin can handle this file. */
    977977                        rc = pBackend->pfnCheckIfValid(pszFilename);
    978                         if (VBOX_SUCCESS(rc))
     978                        if (RT_SUCCESS(rc))
    979979                        {
    980980                            fPluginFound = true;
     
    10801080
    10811081        rc = vdFindBackend(pszBackend, &pImage->Backend, &pImage->hPlugin);
    1082         if (VBOX_FAILURE(rc))
     1082        if (RT_FAILURE(rc))
    10831083            break;
    10841084        if (!pImage->Backend)
     
    10951095                                      &pImage->pvBackendData);
    10961096        /* If the open in read-write mode failed, retry in read-only mode. */
    1097         if (VBOX_FAILURE(rc))
     1097        if (RT_FAILURE(rc))
    10981098        {
    10991099            if (!(uOpenFlags & VD_OPEN_FLAGS_READONLY)
     
    11081108                                               pDisk->pInterfaces,
    11091109                                               &pImage->pvBackendData);
    1110             if (VBOX_FAILURE(rc))
     1110            if (RT_FAILURE(rc))
    11111111            {
    11121112                rc = vdError(pDisk, rc, RT_SRC_POS,
     
    11241124         * diff images. Some image formats don't distinguish between normal
    11251125         * and diff images, so this must be corrected here. */
    1126         if (VBOX_FAILURE(rc))
     1126        if (RT_FAILURE(rc))
    11271127            enmImageType = VD_IMAGE_TYPE_INVALID;
    1128         if (    VBOX_SUCCESS(rc)
     1128        if (    RT_SUCCESS(rc)
    11291129            &&  !(uOpenFlags & VD_OPEN_FLAGS_INFO))
    11301130        {
     
    11651165        rc2 = pImage->Backend->pfnGetPCHSGeometry(pImage->pvBackendData,
    11661166                                                  &pDisk->PCHSGeometry);
    1167         if (VBOX_FAILURE(rc2))
     1167        if (RT_FAILURE(rc2))
    11681168        {
    11691169            pDisk->PCHSGeometry.cCylinders = 0;
     
    11821182        rc2 = pImage->Backend->pfnGetLCHSGeometry(pImage->pvBackendData,
    11831183                                                  &pDisk->LCHSGeometry);
    1184         if (VBOX_FAILURE(rc2))
     1184        if (RT_FAILURE(rc2))
    11851185        {
    11861186            pDisk->LCHSGeometry.cCylinders = 0;
     
    12081208        }
    12091209
    1210         if (VBOX_SUCCESS(rc))
     1210        if (RT_SUCCESS(rc))
    12111211        {
    12121212            /* Image successfully opened, make it the last image. */
     
    12251225    } while (0);
    12261226
    1227     if (VBOX_FAILURE(rc))
     1227    if (RT_FAILURE(rc))
    12281228    {
    12291229        if (pImage)
     
    13411341
    13421342        rc = vdFindBackend(pszBackend, &pImage->Backend, &pImage->hPlugin);
    1343         if (VBOX_FAILURE(rc))
     1343        if (RT_FAILURE(rc))
    13441344            break;
    13451345        if (!pImage->Backend)
     
    13591359                                        &pImage->pvBackendData);
    13601360
    1361         if (VBOX_SUCCESS(rc))
     1361        if (RT_SUCCESS(rc))
    13621362        {
    13631363            pImage->enmImageType = enmType;
     
    13781378            rc2 = pImage->Backend->pfnGetPCHSGeometry(pImage->pvBackendData,
    13791379                                                      &pDisk->PCHSGeometry);
    1380             if (VBOX_FAILURE(rc2))
     1380            if (RT_FAILURE(rc2))
    13811381            {
    13821382                pDisk->PCHSGeometry.cCylinders = 0;
     
    13951395            rc2 = pImage->Backend->pfnGetLCHSGeometry(pImage->pvBackendData,
    13961396                                                      &pDisk->LCHSGeometry);
    1397             if (VBOX_FAILURE(rc2))
     1397            if (RT_FAILURE(rc2))
    13981398            {
    13991399                pDisk->LCHSGeometry.cCylinders = 0;
     
    14101410        }
    14111411
    1412         if (VBOX_SUCCESS(rc))
     1412        if (RT_SUCCESS(rc))
    14131413        {
    14141414            /* Image successfully opened, make it the last image. */
     
    14271427    } while (0);
    14281428
    1429     if (VBOX_FAILURE(rc))
     1429    if (RT_FAILURE(rc))
    14301430    {
    14311431        if (pImage)
     
    14401440    }
    14411441
    1442     if (VBOX_SUCCESS(rc) && pfnProgress)
     1442    if (RT_SUCCESS(rc) && pfnProgress)
    14431443        pfnProgress(NULL /* WARNING! pVM=NULL  */, 100, pvUser);
    14441444
     
    15121512
    15131513        rc = vdFindBackend(pszBackend, &pImage->Backend, &pImage->hPlugin);
    1514         if (VBOX_FAILURE(rc))
     1514        if (RT_FAILURE(rc))
    15151515            break;
    15161516        if (!pImage->Backend)
     
    15321532                                        &pImage->pvBackendData);
    15331533
    1534         if (VBOX_SUCCESS(rc) && pDisk->cImages != 0)
     1534        if (RT_SUCCESS(rc) && pDisk->cImages != 0)
    15351535        {
    15361536            pImage->enmImageType = VD_IMAGE_TYPE_DIFF;
     
    15461546        }
    15471547
    1548         if (VBOX_SUCCESS(rc))
     1548        if (RT_SUCCESS(rc))
    15491549        {
    15501550            RTUUID Uuid;
     
    15541554            rc2 = pDisk->pLast->Backend->pfnGetUuid(pDisk->pLast->pvBackendData,
    15551555                                                    &Uuid);
    1556             if (VBOX_SUCCESS(rc2))
     1556            if (RT_SUCCESS(rc2))
    15571557                pImage->Backend->pfnSetParentUuid(pImage->pvBackendData, &Uuid);
    15581558            rc2 = pDisk->pLast->Backend->pfnGetModificationUuid(pDisk->pLast->pvBackendData,
    15591559                                                                &Uuid);
    1560             if (VBOX_SUCCESS(rc2))
     1560            if (RT_SUCCESS(rc2))
    15611561                pImage->Backend->pfnSetParentModificationUuid(pImage->pvBackendData,
    15621562                                                              &Uuid);
    15631563            rc2 = pDisk->pLast->Backend->pfnGetTimeStamp(pDisk->pLast->pvBackendData,
    15641564                                                             &ts);
    1565             if (VBOX_SUCCESS(rc2))
     1565            if (RT_SUCCESS(rc2))
    15661566                pImage->Backend->pfnSetParentTimeStamp(pImage->pvBackendData, &ts);
    15671567
     
    15691569        }
    15701570
    1571         if (VBOX_SUCCESS(rc))
     1571        if (RT_SUCCESS(rc))
    15721572        {
    15731573            /** @todo optionally check UUIDs */
    15741574        }
    15751575
    1576         if (VBOX_SUCCESS(rc))
     1576        if (RT_SUCCESS(rc))
    15771577        {
    15781578            /* Image successfully opened, make it the last image. */
     
    15911591    } while (0);
    15921592
    1593     if (VBOX_FAILURE(rc))
     1593    if (RT_FAILURE(rc))
    15941594    {
    15951595        if (pImage->hPlugin != NIL_RTLDRMOD)
     
    16041604    }
    16051605
    1606     if (VBOX_SUCCESS(rc) && pfnProgress)
     1606    if (RT_SUCCESS(rc) && pfnProgress)
    16071607        pfnProgress(NULL /* WARNING! pVM=NULL  */, 100, pvUser);
    16081608
     
    16561656            rc = pImageTo->Backend->pfnSetOpenFlags(pImageTo->pvBackendData,
    16571657                                                    uOpenFlags);
    1658             if (VBOX_FAILURE(rc))
     1658            if (RT_FAILURE(rc))
    16591659                break;
    16601660        }
     
    17081708                    if (rc != VERR_VDI_BLOCK_FREE)
    17091709                    {
    1710                         if (VBOX_FAILURE(rc))
     1710                        if (RT_FAILURE(rc))
    17111711                            break;
    17121712                        rc = vdWriteHelper(pDisk, pImageTo, uOffset, pvBuf,
    17131713                                           cbThisRead);
    1714                         if (VBOX_FAILURE(rc))
     1714                        if (RT_FAILURE(rc))
    17151715                            break;
    17161716                    }
     
    17181718                        rc = VINF_SUCCESS;
    17191719                }
    1720                 else if (VBOX_FAILURE(rc))
     1720                else if (RT_FAILURE(rc))
    17211721                    break;
    17221722
     
    17511751                if (rc != VERR_VDI_BLOCK_FREE)
    17521752                {
    1753                     if (VBOX_FAILURE(rc))
     1753                    if (RT_FAILURE(rc))
    17541754                        break;
    17551755                    rc = vdWriteHelper(pDisk, pImageTo, uOffset, pvBuf,
    17561756                                       cbThisRead);
    1757                     if (VBOX_FAILURE(rc))
     1757                    if (RT_FAILURE(rc))
    17581758                        break;
    17591759                }
     
    18021802            rc = pImageTo->Backend->pfnSetOpenFlags(pImageTo->pvBackendData,
    18031803                                                    uOpenFlags);
    1804             if (VBOX_FAILURE(rc))
     1804            if (RT_FAILURE(rc))
    18051805                break;
    18061806        }
     
    18231823        RTMemTmpFree(pvBuf);
    18241824
    1825     if (VBOX_SUCCESS(rc) && pfnProgress)
     1825    if (RT_SUCCESS(rc) && pfnProgress)
    18261826        pfnProgress(NULL /* WARNING! pVM=NULL */, 100, pvUser);
    18271827
     
    18931893            /* Close the source image. */
    18941894            rc = pImageFrom->Backend->pfnClose(pImageFrom->pvBackendData, false);
    1895             if (VBOX_FAILURE(rc))
     1895            if (RT_FAILURE(rc))
    18961896                break;
    18971897
    18981898            /* Open the source image in the destination container. */
    18991899            rc = VDOpen(pDiskTo, pImageFrom->Backend->pszBackendName, pImageFrom->pszFilename, pImageFrom->uOpenFlags);
    1900             if (VBOX_FAILURE(rc))
     1900            if (RT_FAILURE(rc))
    19011901                goto movefail;
    19021902
     
    19051905            /* Rename the image. */
    19061906            rc = pImageTo->Backend->pfnRename(pImageTo->pvBackendData, pszFilename ? pszFilename : pImageTo->pszFilename);
    1907             if (VBOX_FAILURE(rc))
     1907            if (RT_FAILURE(rc))
    19081908                goto movefail;
    19091909
     
    19241924            /* In case of failure, re-open the source image in the source container. */
    19251925            rc2 = VDOpen(pDiskFrom, pImageFrom->Backend->pszBackendName, pImageFrom->pszFilename, pImageFrom->uOpenFlags);
    1926             if (VBOX_FAILURE(rc2))
     1926            if (RT_FAILURE(rc2))
    19271927                /** @todo Uncertain what to do on error. If this happens pImageFrom and pImageTo are both closed. */
    19281928                rc = rc2;
     
    19741974                              uOpenFlagsFrom, NULL, NULL);
    19751975        }
    1976         if (VBOX_FAILURE(rc))
     1976        if (RT_FAILURE(rc))
    19771977            break;
    19781978
     
    19981998            rc = vdReadHelper(pDiskFrom, pImageFrom, uOffset, pvBuf,
    19991999                              cbThisRead);
    2000             if (VBOX_FAILURE(rc))
     2000            if (RT_FAILURE(rc))
    20012001                break;
    20022002
    20032003            rc = vdWriteHelper(pDiskTo, pImageTo, uOffset, pvBuf,
    20042004                               cbThisRead);
    2005             if (VBOX_FAILURE(rc))
     2005            if (RT_FAILURE(rc))
    20062006                break;
    20072007
     
    20132013                                 ((cbSize - cbRemaining) * 100) / cbSize,
    20142014                                 pvUser);
    2015                 if (VBOX_FAILURE(rc))
     2015                if (RT_FAILURE(rc))
    20162016                    break;
    20172017            }
     
    20402040    } while (0);
    20412041
    2042     if (VBOX_FAILURE(rc) && pImageTo)
     2042    if (RT_FAILURE(rc) && pImageTo)
    20432043    {
    20442044        /* Error detected, but new image created. Remove image from list. */
     
    20632063        RTMemTmpFree(pvBuf);
    20642064
    2065     if (VBOX_SUCCESS(rc) && pfnProgress)
     2065    if (RT_SUCCESS(rc) && pfnProgress)
    20662066        pfnProgress(NULL /* WARNING! pVM=NULL  */, 100, pvUser);
    20672067
     
    21302130        rc2 = pImage->Backend->pfnGetPCHSGeometry(pImage->pvBackendData,
    21312131                                                 &pDisk->PCHSGeometry);
    2132         if (VBOX_FAILURE(rc2))
     2132        if (RT_FAILURE(rc2))
    21332133        {
    21342134            pDisk->PCHSGeometry.cCylinders = 0;
     
    21472147        rc2 = pImage->Backend->pfnGetLCHSGeometry(pImage->pvBackendData,
    21482148                                                  &pDisk->LCHSGeometry);
    2149         if (VBOX_FAILURE(rc2))
     2149        if (RT_FAILURE(rc2))
    21502150        {
    21512151            pDisk->LCHSGeometry.cCylinders = 0;
     
    21912191            /* Close image. */
    21922192            int rc2 = pImage->Backend->pfnClose(pImage->pvBackendData, false);
    2193             if (VBOX_FAILURE(rc2) && VBOX_SUCCESS(rc))
     2193            if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
    21942194                rc = rc2;
    21952195            /* Free remaining resources related to the image. */
     
    22612261 * @returns VERR_VDI_NOT_OPENED if no image is opened in HDD container.
    22622262 * @param   pDisk           Pointer to HDD container.
    2263  * @param   uOffset         Offset of the first byte being 
     2263 * @param   uOffset         Offset of the first byte being
    22642264 *                          written from start of disk.
    22652265 * @param   pvBuf           Pointer to buffer for writing data.
     
    25472547                int rc2 = pImage->Backend->pfnGetPCHSGeometry(pImage->pvBackendData,
    25482548                                                              &pDisk->PCHSGeometry);
    2549                 if (VBOX_FAILURE(rc2))
     2549                if (RT_FAILURE(rc2))
    25502550                {
    25512551                    pDisk->PCHSGeometry.cCylinders = 0;
     
    25672567            rc = pImage->Backend->pfnGetPCHSGeometry(pImage->pvBackendData,
    25682568                                                     &PCHS);
    2569             if (    VBOX_FAILURE(rc)
     2569            if (    RT_FAILURE(rc)
    25702570                ||  pPCHSGeometry->cCylinders != PCHS.cCylinders
    25712571                ||  pPCHSGeometry->cHeads != PCHS.cHeads
     
    26932693                int rc2 = pImage->Backend->pfnGetLCHSGeometry(pImage->pvBackendData,
    26942694                                                              &pDisk->LCHSGeometry);
    2695                 if (VBOX_FAILURE(rc2))
     2695                if (RT_FAILURE(rc2))
    26962696                {
    26972697                    pDisk->LCHSGeometry.cCylinders = 0;
     
    27132713            rc = pImage->Backend->pfnGetLCHSGeometry(pImage->pvBackendData,
    27142714                                                     &LCHS);
    2715             if (    VBOX_FAILURE(rc)
     2715            if (    RT_FAILURE(rc)
    27162716                ||  pLCHSGeometry->cCylinders != LCHS.cCylinders
    27172717                ||  pLCHSGeometry->cHeads != LCHS.cHeads
     
    34153415 * @param   pvUser          User data which is passed on completion
    34163416 */
    3417 VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead, 
     3417VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead,
    34183418                              PPDMDATASEG paSeg, unsigned cSeg,
    34193419                              void *pvUser)
     
    35223522
    35233523        vdSetModifiedFlag(pDisk);
    3524         rc = pImage->Backend->pfnAsyncWrite(pImage->pvBackendData, 
    3525                                             uOffset, cbWrite, 
     3524        rc = pImage->Backend->pfnAsyncWrite(pImage->pvBackendData,
     3525                                            uOffset, cbWrite,
    35263526                                            paSeg, cSeg, pvUser);
    35273527    } while (0);
  • trunk/src/VBox/Devices/Storage/VBoxHDD.cpp

    r8155 r11266  
    9696    PVDIDISK pData = PDMIMEDIA_2_VDIDISK(pInterface);
    9797    int rc = VDIDiskGetLCHSGeometry(pData, pLCHSGeometry);
    98     if (VBOX_SUCCESS(rc))
     98    if (RT_SUCCESS(rc))
    9999    {
    100100        LogFlow(("%s: returns VINF_SUCCESS\n", __FUNCTION__));
     
    130130    PVDIDISK pData = PDMIMEDIA_2_VDIDISK(pInterface);
    131131    int rc = VDIDiskRead(pData, off, pvBuf, cbRead);
    132     if (VBOX_SUCCESS(rc))
     132    if (RT_SUCCESS(rc))
    133133        Log2(("vdiRead: off=%#llx pvBuf=%p cbRead=%d\n"
    134134              "%.*Vhxd\n",
     
    335335     */
    336336    int rc = VINF_SUCCESS;
    337     while (pCurNode && VBOX_SUCCESS(rc))
     337    while (pCurNode && RT_SUCCESS(rc))
    338338    {
    339339        /*
     
    341341         */
    342342        int rc = CFGMR3QueryStringAlloc(pCurNode, "Path", &pszName);
    343         if (VBOX_FAILURE(rc))
     343        if (RT_FAILURE(rc))
    344344            return PDMDRV_SET_ERROR(pDrvIns, rc,
    345345                                    N_("VHDD: Configuration error: Querying \"Path\" as string failed"));
     
    348348        if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    349349            fReadOnly = false;
    350         else if (VBOX_FAILURE(rc))
     350        else if (RT_FAILURE(rc))
    351351        {
    352352            MMR3HeapFree(pszName);
     
    360360            if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    361361                fHonorZeroWrites = false;
    362             else if (VBOX_FAILURE(rc))
     362            else if (RT_FAILURE(rc))
    363363            {
    364364                MMR3HeapFree(pszName);
     
    373373        rc = VDIDiskOpenImage(pData, pszName, fReadOnly ? VDI_OPEN_FLAGS_READONLY
    374374                                                        : VDI_OPEN_FLAGS_NORMAL);
    375         if (VBOX_SUCCESS(rc))
     375        if (RT_SUCCESS(rc))
    376376            Log(("vdiConstruct: %d - Opened '%s' in %s mode\n",
    377377                 iLevel, pszName, VDIDiskIsReadOnly(pData) ? "read-only" : "read-write"));
     
    386386
    387387    /* If any of the images has the flag set, handle zero writes like normal. */
    388     if (VBOX_SUCCESS(rc))
     388    if (RT_SUCCESS(rc))
    389389        pData->fHonorZeroWrites = fHonorZeroWrites;
    390390
  • trunk/src/VBox/Devices/Storage/VDICore.cpp

    r8512 r11266  
    422422                        pszFilename,
    423423                        RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_ALL | RTFILE_O_NOT_CONTENT_INDEXED);
    424     if (VBOX_SUCCESS(rc))
     424    if (RT_SUCCESS(rc))
    425425    {
    426426        /* Lock image exclusively to close any wrong access by VDI API calls. */
     
    434434            RTFOFF cbFree = 0;
    435435            rc = RTFsQuerySizes(pszFilename, NULL, &cbFree, NULL, NULL);
    436             if (VBOX_SUCCESS(rc) /* ignore errors */ && ((uint64_t)cbFree < cbLock))
     436            if (RT_SUCCESS(rc) /* ignore errors */ && ((uint64_t)cbFree < cbLock))
    437437            {
    438438                rc = VERR_DISK_FULL;
     
    444444        rc = RTFileLock(pImage->File,
    445445                        RTFILE_LOCK_WRITE | RTFILE_LOCK_IMMEDIATELY, 0, cbLock);
    446         if (VBOX_FAILURE(rc))
     446        if (RT_FAILURE(rc))
    447447        {
    448448            cbLock = 0;    /* Not locked. */
     
    463463            rc = RTFileSetSize(pImage->File, pImage->offStartData);
    464464        }
    465         if (VBOX_FAILURE(rc))
     465        if (RT_FAILURE(rc))
    466466            goto l_create_failed;
    467467
     
    471471        /* Write pre-header. */
    472472        rc = RTFileWrite(pImage->File, &pImage->PreHeader, sizeof(pImage->PreHeader), NULL);
    473         if (VBOX_FAILURE(rc))
     473        if (RT_FAILURE(rc))
    474474            goto l_create_failed;
    475475
    476476        /* Write header. */
    477477        rc = RTFileWrite(pImage->File, &pImage->Header.u.v1plus, sizeof(pImage->Header.u.v1plus), NULL);
    478         if (VBOX_FAILURE(rc))
     478        if (RT_FAILURE(rc))
    479479            goto l_create_failed;
    480480
    481481        /* Write blocks array. */
    482482        rc = RTFileSeek(pImage->File, pImage->offStartBlocks, RTFILE_SEEK_BEGIN, NULL);
    483         if (VBOX_FAILURE(rc))
     483        if (RT_FAILURE(rc))
    484484            goto l_create_failed;
    485485        rc = RTFileWrite(pImage->File,
     
    487487                         getImageBlocks(&pImage->Header) * sizeof(VDIIMAGEBLOCKPOINTER),
    488488                         NULL);
    489         if (VBOX_FAILURE(rc))
     489        if (RT_FAILURE(rc))
    490490            goto l_create_failed;
    491491
     
    500500
    501501            rc = RTFileSeek(pImage->File, pImage->offStartData, RTFILE_SEEK_BEGIN, NULL);
    502             if (VBOX_FAILURE(rc))
     502            if (RT_FAILURE(rc))
    503503                goto l_create_failed;
    504504
     
    517517
    518518                    rc = RTFileWrite(pImage->File, pvBuf, to_fill, NULL);
    519                     if (VBOX_FAILURE(rc))
     519                    if (RT_FAILURE(rc))
    520520                        break;
    521521
     
    527527                                         (unsigned)(((cbDisk - cbFill) * 100) / cbDisk),
    528528                                         pvUser);
    529                         if (VBOX_FAILURE(rc))
     529                        if (RT_FAILURE(rc))
    530530                            break;
    531531                    }
     
    549549
    550550        /* Delete image file if error occured while creating */
    551         if (VBOX_FAILURE(rc))
     551        if (RT_FAILURE(rc))
    552552            RTFileDelete(pszFilename);
    553553    }
     
    556556    RTMemFree(pImage);
    557557
    558     if (    VBOX_SUCCESS(rc)
     558    if (    RT_SUCCESS(rc)
    559559        &&  pfnProgress)
    560560        pfnProgress(NULL /* WARNING! pVM=NULL  */, 100, pvUser);
     
    603603                        ? RTFILE_O_READ      | RTFILE_O_OPEN | RTFILE_O_DENY_NONE
    604604                        : RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
    605     if (VBOX_FAILURE(rc))
     605    if (RT_FAILURE(rc))
    606606    {
    607607        if (!(fOpen & VDI_OPEN_FLAGS_READONLY))
     
    611611                            pImage->szFilename,
    612612                            RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    613             if (VBOX_SUCCESS(rc))
     613            if (RT_SUCCESS(rc))
    614614                pImage->fOpen |= VDI_OPEN_FLAGS_READONLY;
    615615        }
    616         if (VBOX_FAILURE(rc))
     616        if (RT_FAILURE(rc))
    617617        {
    618618            RTMemFree(pImage);
     
    630630    uint64_t cbLock = _1M;
    631631    rc = RTFileLock(pImage->File, RTFILE_LOCK_READ | RTFILE_LOCK_IMMEDIATELY, 0, cbLock);
    632     if (VBOX_FAILURE(rc))
     632    if (RT_FAILURE(rc))
    633633    {
    634634        cbLock = 0;
     
    639639    /* Read pre-header. */
    640640    rc = RTFileRead(pImage->File, &pImage->PreHeader, sizeof(pImage->PreHeader), NULL);
    641     if (VBOX_FAILURE(rc))
     641    if (RT_FAILURE(rc))
    642642        goto l_open_failed;
    643643    rc = vdiValidatePreHeader(&pImage->PreHeader);
    644     if (VBOX_FAILURE(rc))
     644    if (RT_FAILURE(rc))
    645645        goto l_open_failed;
    646646
     
    661661                     * supporting VDI 1.1 doesn't touch fields it doesn't know
    662662                     * about. And it accepts bigger headers. */
    663                     if (   VBOX_SUCCESS(rc)
     663                    if (   RT_SUCCESS(rc)
    664664                        && !pImage->fReadOnly
    665665                        && pImage->Header.u.v1.cbHeader < sizeof(pImage->Header.u.v1plus))
     
    672672                        pImage->Header.u.v1plus.LCHSGeometry.cbSector = VDI_GEOMETRY_SECTOR_SIZE;
    673673                    }
    674                     else if (   VBOX_SUCCESS(rc)
     674                    else if (   RT_SUCCESS(rc)
    675675                             && pImage->Header.u.v1.cbHeader >= sizeof(pImage->Header.u.v1plus))
    676676                    {
     
    688688            break;
    689689    }
    690     if (VBOX_FAILURE(rc))
     690    if (RT_FAILURE(rc))
    691691        goto l_open_failed;
    692692
    693693    rc = vdiValidateHeader(&pImage->Header);
    694     if (VBOX_FAILURE(rc))
     694    if (RT_FAILURE(rc))
    695695        goto l_open_failed;
    696696
     
    749749                    0,
    750750                    cbLock);
    751     if (    VBOX_FAILURE(rc)
     751    if (    RT_FAILURE(rc)
    752752        &&  !pImage->fReadOnly)
    753753    {
     
    755755        rc = RTFileLock(pImage->File,
    756756                        RTFILE_LOCK_READ | RTFILE_LOCK_IMMEDIATELY, 0, cbLock);
    757         if (VBOX_SUCCESS(rc))
     757        if (RT_SUCCESS(rc))
    758758            pImage->fReadOnly = true;
    759759    }
    760     if (VBOX_FAILURE(rc))
     760    if (RT_FAILURE(rc))
    761761    {
    762762        cbLock = 0;    /* Not locked. */
     
    775775    /* Read blocks array. */
    776776    rc = RTFileSeek(pImage->File, pImage->offStartBlocks, RTFILE_SEEK_BEGIN, NULL);
    777     if (VBOX_FAILURE(rc))
     777    if (RT_FAILURE(rc))
    778778        goto l_open_failed;
    779779    rc = RTFileRead(pImage->File, pImage->paBlocks,
    780780                    getImageBlocks(&pImage->Header) * sizeof(VDIIMAGEBLOCKPOINTER), NULL);
    781     if (VBOX_FAILURE(rc))
     781    if (RT_FAILURE(rc))
    782782        goto l_open_failed;
    783783
     
    807807    /* Seek to header start. */
    808808    int rc = RTFileSeek(pImage->File, sizeof(VDIPREHEADER), RTFILE_SEEK_BEGIN, NULL);
    809     if (VBOX_SUCCESS(rc))
     809    if (RT_SUCCESS(rc))
    810810    {
    811811        switch (GET_MAJOR_HEADER_VERSION(&pImage->Header))
     
    844844    /* Update image header. */
    845845    int rc = vdiUpdateHeader(pImage);
    846     if (VBOX_SUCCESS(rc))
     846    if (RT_SUCCESS(rc))
    847847    {
    848848        /* write only one block pointer. */
     
    851851                        RTFILE_SEEK_BEGIN,
    852852                        NULL);
    853         if (VBOX_SUCCESS(rc))
     853        if (RT_SUCCESS(rc))
    854854            rc = RTFileWrite(pImage->File,
    855855                             &pImage->paBlocks[uBlock],
     
    869869    /* Update image header. */
    870870    int rc = vdiUpdateHeader(pImage);
    871     if (VBOX_SUCCESS(rc))
     871    if (RT_SUCCESS(rc))
    872872    {
    873873        /* write the block pointers array. */
    874874        rc = RTFileSeek(pImage->File, pImage->offStartBlocks, RTFILE_SEEK_BEGIN, NULL);
    875         if (VBOX_SUCCESS(rc))
     875        if (RT_SUCCESS(rc))
    876876            rc = RTFileWrite(pImage->File,
    877877                             pImage->paBlocks,
     
    998998                           + (pImage->offStartData + pImage->offStartBlockData + offRead);
    999999        int rc = RTFileSeek(pImage->File, u64Offset, RTFILE_SEEK_BEGIN, NULL);
    1000         if (VBOX_SUCCESS(rc))
     1000        if (RT_SUCCESS(rc))
    10011001            rc = RTFileRead(pImage->File, pvBuf, cbToRead, NULL);
    1002         if (VBOX_FAILURE(rc))
     1002        if (RT_FAILURE(rc))
    10031003            Log(("vdiReadInBlock: rc=%Vrc filename=\"%s\" uBlock=%u offRead=%u cbToRead=%u u64Offset=%llu\n",
    10041004                 rc, pImage->szFilename, uBlock, offRead, cbToRead, u64Offset));
     
    10761076        cbToRead -= to_read;
    10771077        if (    cbToRead == 0
    1078             ||  VBOX_FAILURE(rc))
     1078            ||  RT_FAILURE(rc))
    10791079            break;
    10801080
     
    11021102                       + (pImage->offStartData + pImage->offStartBlockData);
    11031103    rc = RTFileSeek(pImage->File, u64Offset, RTFILE_SEEK_BEGIN, NULL);
    1104     if (VBOX_FAILURE(rc))
     1104    if (RT_FAILURE(rc))
    11051105    {
    11061106        Log(("vdiFillBlockByZeroes: seek rc=%Vrc filename=\"%s\" uBlock=%u u64Offset=%llu\n",
     
    11211121        unsigned to_fill = RT_MIN(cbFill, pDisk ? pDisk->cbBuf : VDIDISK_DEFAULT_BUFFER_SIZE);
    11221122        rc = RTFileWrite(pImage->File, pvBuf, to_fill, NULL);
    1123         if (VBOX_FAILURE(rc))
     1123        if (RT_FAILURE(rc))
    11241124        {
    11251125            Log(("vdiFillBlockByZeroes: write rc=%Vrc filename=\"%s\" uBlock=%u u64Offset=%llu cbFill=%u to_fill=%u\n",
     
    11781178                         + pImage->offStartData;
    11791179        rc = RTFileSetSize(pImage->File, u64Size);
    1180         if (VBOX_FAILURE(rc))
     1180        if (RT_FAILURE(rc))
    11811181        {
    11821182            Log(("vdiWriteInBlock: set size rc=%Vrc filename=\"%s\" uBlock=%u u64Size=%llu\n",
     
    11971197            {
    11981198                rc = vdiFillBlockByZeroes(pDisk, pImage, uBlock);
    1199                 if (VBOX_FAILURE(rc))
     1199                if (RT_FAILURE(rc))
    12001200                    return rc;
    12011201            }
     
    12031203
    12041204        rc = vdiUpdateBlockInfo(pImage, uBlock);
    1205         if (VBOX_FAILURE(rc))
     1205        if (RT_FAILURE(rc))
    12061206            return rc;
    12071207    }
     
    12111211                       + (pImage->offStartData + pImage->offStartBlockData + offWrite);
    12121212    rc = RTFileSeek(pImage->File, u64Offset, RTFILE_SEEK_BEGIN, NULL);
    1213     if (VBOX_SUCCESS(rc))
     1213    if (RT_SUCCESS(rc))
    12141214    {
    12151215        rc = RTFileWrite(pImage->File, pvBuf, cbToWrite, NULL);
    1216         if (VBOX_FAILURE(rc))
     1216        if (RT_FAILURE(rc))
    12171217            Log(("vdiWriteInBlock: write rc=%Vrc filename=\"%s\" uBlock=%u offWrite=%u u64Offset=%llu cbToWrite=%u\n",
    12181218                 rc, pImage->szFilename, uBlock, offWrite, u64Offset, cbToWrite));
     
    12561256        unsigned to_copy = RT_MIN(cbCopy, pDisk->cbBuf);
    12571257        rc = vdiReadInBlock(pImage, uBlock, offCopy, to_copy, pvBuf);
    1258         if (VBOX_FAILURE(rc))
     1258        if (RT_FAILURE(rc))
    12591259            break;
    12601260
    12611261        rc = vdiWriteInBlock(pDisk, pDisk->pLast, uBlock, offCopy, to_copy, pvBuf);
    1262         if (VBOX_FAILURE(rc))
     1262        if (RT_FAILURE(rc))
    12631263            break;
    12641264
     
    13381338                /* One of parent image has a block data, copy it into last image. */
    13391339                rc = vdiCopyBlock(pDisk, pImage, uBlock);
    1340                 if (VBOX_FAILURE(rc))
     1340                if (RT_FAILURE(rc))
    13411341                    break;
    13421342                pImage = pDisk->pLast;
     
    13491349        cbToWrite -= to_write;
    13501350        if (    cbToWrite == 0
    1351             || VBOX_FAILURE(rc))
     1351            || RT_FAILURE(rc))
    13521352            break;
    13531353
     
    14261426
    14271427                        rc = vdiReadInBlock(pImageFrom, uBlock, offCommit, cbToCopy, pvBuf);
    1428                         if (VBOX_FAILURE(rc))
     1428                        if (RT_FAILURE(rc))
    14291429                            break;
    14301430
    14311431                        rc = vdiWriteInBlock(NULL, pImageTo, uBlock, offCommit, cbToCopy, pvBuf);
    1432                         if (VBOX_FAILURE(rc))
     1432                        if (RT_FAILURE(rc))
    14331433                            break;
    14341434
     
    14361436                        offCommit += cbToCopy;
    14371437                    }
    1438                     if (VBOX_FAILURE(rc))
     1438                    if (RT_FAILURE(rc))
    14391439                        break;
    14401440                }
     
    14871487
    14881488                        rc = vdiReadInBlock(pImageFrom, uBlock, offCommit, cbToCopy, pvBuf);
    1489                         if (VBOX_FAILURE(rc))
     1489                        if (RT_FAILURE(rc))
    14901490                            break;
    14911491
    14921492                        rc = vdiWriteInBlock(NULL, pImageTo, uBlock, offCommit, cbToCopy, pvBuf);
    1493                         if (VBOX_FAILURE(rc))
     1493                        if (RT_FAILURE(rc))
    14941494                            break;
    14951495
     
    14971497                        offCommit += cbToCopy;
    14981498                    }
    1499                     if (VBOX_FAILURE(rc))
     1499                    if (RT_FAILURE(rc))
    15001500                        break;
    15011501                }
     
    15881588
    15891589                    rc = vdiReadInBlock(pImage, uBlock, offCommit, cbToCopy, pvBuf);
    1590                     if (VBOX_FAILURE(rc))
     1590                    if (RT_FAILURE(rc))
    15911591                        break;
    15921592
    15931593                    rc = vdiWriteInBlock(pDisk, pDstImage, uBlock, offCommit, cbToCopy, pvBuf);
    1594                     if (VBOX_FAILURE(rc))
     1594                    if (RT_FAILURE(rc))
    15951595                        break;
    15961596
     
    15981598                    offCommit += cbToCopy;
    15991599                }
    1600                 if (VBOX_FAILURE(rc))
     1600                if (RT_FAILURE(rc))
    16011601                    break;
    16021602            }
     
    16381638        /* Truncate file. */
    16391639        int rc2 = RTFileSetSize(pImage->File, pImage->offStartData);
    1640         if (VBOX_FAILURE(rc2))
     1640        if (RT_FAILURE(rc2))
    16411641        {
    16421642            rc = rc2;
     
    16471647        /* Save header and blocks array. */
    16481648        rc2 = vdiUpdateBlocks(pImage);
    1649         if (VBOX_FAILURE(rc2))
     1649        if (RT_FAILURE(rc2))
    16501650        {
    16511651            rc = rc2;
     
    16951695    PVDIIMAGEDESC pImage;
    16961696    int rc = vdiOpenImage(&pImage, pszFilename, VDI_OPEN_FLAGS_READONLY, NULL);
    1697     if (VBOX_SUCCESS(rc))
     1697    if (RT_SUCCESS(rc))
    16981698    {
    16991699        Log(("VDICheckImage: filename=\"%s\" version=%08X type=%X cbDisk=%llu uuid={%Vuuid}\n",
     
    17141714                rc = VERR_BUFFER_OVERFLOW;
    17151715        }
    1716         if (VBOX_SUCCESS(rc))
     1716        if (RT_SUCCESS(rc))
    17171717        {
    17181718            if (puVersion)
     
    17671767    PVDIIMAGEDESC pImage;
    17681768    int rc = vdiOpenImage(&pImage, pszFilename, VDI_OPEN_FLAGS_NORMAL, NULL);
    1769     if (VBOX_FAILURE(rc))
     1769    if (RT_FAILURE(rc))
    17701770    {
    17711771        Log(("VDISetImageComment: vdiOpenImage rc=%Vrc filename=\"%s\"!\n", rc, pszFilename));
     
    18661866    PVDIIMAGEDESC pParent;
    18671867    int rc = vdiOpenImage(&pParent, pszParent, VDI_OPEN_FLAGS_READONLY, NULL);
    1868     if (VBOX_SUCCESS(rc))
     1868    if (RT_SUCCESS(rc))
    18691869    {
    18701870        rc = vdiCreateImage(pszFilename, VDI_IMAGE_TYPE_DIFF, VDI_IMAGE_FLAGS_DEFAULT,
     
    18951895
    18961896    int rc = VDICheckImage(pszFilename, NULL, NULL, NULL, NULL, NULL, NULL, 0);
    1897     if (VBOX_SUCCESS(rc))
     1897    if (RT_SUCCESS(rc))
    18981898        rc = RTFileDelete(pszFilename);
    18991899
     
    19391939    PVDIIMAGEDESC pImage;
    19401940    int rc = vdiOpenImage(&pImage, pszSrcFilename, VDI_OPEN_FLAGS_READONLY, NULL);
    1941     if (VBOX_FAILURE(rc))
     1941    if (RT_FAILURE(rc))
    19421942    {
    19431943        Log(("VDICopyImage: src image \"%s\" open failed rc=%Vrc\n", pszSrcFilename, rc));
     
    19531953                    pszDstFilename,
    19541954                    RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_ALL | RTFILE_O_NOT_CONTENT_INDEXED);
    1955     if (VBOX_SUCCESS(rc))
     1955    if (RT_SUCCESS(rc))
    19561956    {
    19571957#ifndef RT_OS_WINDOWS
    19581958        /* lock new image exclusively to close any wrong access by VDI API calls. */
    19591959        rc = RTFileLock(File, RTFILE_LOCK_WRITE | RTFILE_LOCK_IMMEDIATELY, 0, cbFile);
    1960         if (VBOX_SUCCESS(rc))
     1960        if (RT_SUCCESS(rc))
    19611961#endif
    19621962        {
    19631963            /* Set the size of a new file. */
    19641964            rc = RTFileSetSize(File, cbFile);
    1965             if (VBOX_SUCCESS(rc))
     1965            if (RT_SUCCESS(rc))
    19661966            {
    19671967                /* A dirty trick - use original image data to fill the new image. */
     
    19801980                /* Write the pre-header to new image. */
    19811981                rc = RTFileSeek(pImage->File, 0, RTFILE_SEEK_BEGIN, NULL);
    1982                 if (VBOX_SUCCESS(rc))
     1982                if (RT_SUCCESS(rc))
    19831983                    rc = RTFileWrite(pImage->File,
    19841984                                     &pImage->PreHeader,
     
    19871987
    19881988                /* Write the header and the blocks array to new image. */
    1989                 if (VBOX_SUCCESS(rc))
     1989                if (RT_SUCCESS(rc))
    19901990                    rc = vdiUpdateBlocks(pImage);
    19911991
     
    19941994
    19951995                /* Seek to the data start in both images. */
    1996                 if (VBOX_SUCCESS(rc))
     1996                if (RT_SUCCESS(rc))
    19971997                    rc = RTFileSeek(pImage->File,
    19981998                                    pImage->offStartData,
    19991999                                    RTFILE_SEEK_BEGIN,
    20002000                                    NULL);
    2001                 if (VBOX_SUCCESS(rc))
     2001                if (RT_SUCCESS(rc))
    20022002                    rc = RTFileSeek(File,
    20032003                                    pImage->offStartData,
     
    20052005                                    NULL);
    20062006
    2007                 if (VBOX_SUCCESS(rc))
     2007                if (RT_SUCCESS(rc))
    20082008                {
    20092009                    /* alloc tmp buffer */
     
    20222022                            /* Read. */
    20232023                            rc = RTFileRead(pImage->File, pvBuf, cbToCopy, NULL);
    2024                             if (VBOX_FAILURE(rc))
     2024                            if (RT_FAILURE(rc))
    20252025                                break;
    20262026
    20272027                            /* Write. */
    20282028                            rc = RTFileWrite(File, pvBuf, cbToCopy, NULL);
    2029                             if (VBOX_FAILURE(rc))
     2029                            if (RT_FAILURE(rc))
    20302030                                break;
    20312031
     
    20362036                                                 (c * 100) / cBlocks,
    20372037                                                 pvUser);
    2038                                 if (VBOX_FAILURE(rc))
     2038                                if (RT_FAILURE(rc))
    20392039                                    break;
    20402040                            }
     
    20562056        RTFileClose(File);
    20572057
    2058         if (VBOX_FAILURE(rc))
     2058        if (RT_FAILURE(rc))
    20592059            RTFileDelete(pszDstFilename);
    20602060
     
    20922092    PVDIIMAGEDESC pImage;
    20932093    int rc = vdiOpenImage(&pImage, pszFilename, VDI_OPEN_FLAGS_NORMAL, NULL);
    2094     if (VBOX_FAILURE(rc))
     2094    if (RT_FAILURE(rc))
    20952095    {
    20962096        Log(("VDIShrinkImage: vdiOpenImage rc=%Vrc filename=\"%s\"\n", rc, pszFilename));
     
    21142114    uint64_t cbFile;
    21152115    rc = RTFileGetSize(pImage->File, &cbFile);
    2116     if (VBOX_FAILURE(rc))
     2116    if (RT_FAILURE(rc))
    21172117    {
    21182118        Log(("VDIShrinkImage: RTFileGetSize rc=%Vrc for file=\"%s\"\n", rc, pszFilename));
     
    21822182                                   + (pImage->offStartData + pImage->offStartBlockData);
    21832183                rc = RTFileSeek(pImage->File, u64Offset, RTFILE_SEEK_BEGIN, NULL);
    2184                 if (VBOX_FAILURE(rc))
     2184                if (RT_FAILURE(rc))
    21852185                {
    21862186                    Log(("VDIShrinkImage: seek rc=%Vrc filename=\"%s\" uBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     
    21892189                }
    21902190                rc = RTFileRead(pImage->File, pvBuf, cbBlock, NULL);
    2191                 if (VBOX_FAILURE(rc))
     2191                if (RT_FAILURE(rc))
    21922192                {
    21932193                    Log(("VDIShrinkImage: read rc=%Vrc filename=\"%s\" cbBlock=%u uBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     
    22072207                                  + (pImage->offStartData + pImage->offStartBlockData);
    22082208                        rc = RTFileSeek(pImage->File, u64Offset, RTFILE_SEEK_BEGIN, NULL);
    2209                         if (VBOX_FAILURE(rc))
     2209                        if (RT_FAILURE(rc))
    22102210                        {
    22112211                            Log(("VDIShrinkImage: seek(2) rc=%Vrc filename=\"%s\" uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     
    22142214                        }
    22152215                        rc = RTFileWrite(pImage->File, pvBuf, cbBlock, NULL);
    2216                         if (VBOX_FAILURE(rc))
     2216                        if (RT_FAILURE(rc))
    22172217                        {
    22182218                            Log(("VDIShrinkImage: write rc=%Vrc filename=\"%s\" cbBlock=%u uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
     
    22472247        RTMemTmpFree(pvBuf);
    22482248
    2249         if (    VBOX_SUCCESS(rc)
     2249        if (    RT_SUCCESS(rc)
    22502250            &&  uBlockWrite < cBlocksAllocated2)
    22512251        {
     
    22562256            rc = RTFileSetSize(pImage->File,
    22572257                               pImage->offStartData + ((uint64_t)uBlockWrite << pImage->uShiftIndex2Offset));
    2258             if (VBOX_FAILURE(rc))
     2258            if (RT_FAILURE(rc))
    22592259                Log(("VDIShrinkImage: RTFileSetSize rc=%Vrc\n", rc));
    22602260        }
     
    22682268
    22692269    /* Save header and blocks array. */
    2270     if (VBOX_SUCCESS(rc))
     2270    if (RT_SUCCESS(rc))
    22712271    {
    22722272        setImageBlocksAllocated(&pImage->Header, cBlocksAllocated2);
     
    23102310    PVDIIMAGEDESC pImage;
    23112311    int rc = vdiOpenImage(&pImage, pszFilename, VDI_OPEN_FLAGS_NORMAL, NULL);
    2312     if (VBOX_FAILURE(rc))
     2312    if (RT_FAILURE(rc))
    23132313    {
    23142314        Log(("VDIConvertImage: vdiOpenImage rc=%Vrc filename=\"%s\"\n", rc, pszFilename));
     
    23642364
    23652365    rc = RTFileGetSize(pImage->File, &cbFile);
    2366     if (VBOX_FAILURE(rc))
     2366    if (RT_FAILURE(rc))
    23672367        goto l_conversion_failed;
    23682368
     
    23782378    /* Expand file. */
    23792379    rc = RTFileSetSize(pImage->File, cbFile + off);
    2380     if (VBOX_FAILURE(rc))
     2380    if (RT_FAILURE(rc))
    23812381        goto l_conversion_failed;
    23822382
     
    24042404                /* Read. */
    24052405                rc = RTFileSeek(pImage->File, offFile, RTFILE_SEEK_BEGIN, NULL);
    2406                 if (VBOX_FAILURE(rc))
     2406                if (RT_FAILURE(rc))
    24072407                    break;
    24082408                rc = RTFileRead(pImage->File, pvBuf, cbToMove, NULL);
    2409                 if (VBOX_FAILURE(rc))
     2409                if (RT_FAILURE(rc))
    24102410                    break;
    24112411
    24122412                /* Write. */
    24132413                rc = RTFileSeek(pImage->File, offFile + off, RTFILE_SEEK_BEGIN, NULL);
    2414                 if (VBOX_FAILURE(rc))
     2414                if (RT_FAILURE(rc))
    24152415                    break;
    24162416                rc = RTFileWrite(pImage->File, pvBuf, cbToMove, NULL);
    2417                 if (VBOX_FAILURE(rc))
     2417                if (RT_FAILURE(rc))
    24182418                    break;
    24192419
     
    24382438
    24392439            /* Fill the beginning of file with zeroes to wipe out old headers etc. */
    2440             if (VBOX_SUCCESS(rc))
     2440            if (RT_SUCCESS(rc))
    24412441            {
    24422442                Assert(offFile + off <= VDIDISK_DEFAULT_BUFFER_SIZE);
    24432443                rc = RTFileSeek(pImage->File, 0, RTFILE_SEEK_BEGIN, NULL);
    2444                 if (VBOX_SUCCESS(rc))
     2444                if (RT_SUCCESS(rc))
    24452445                {
    24462446                    memset(pvBuf, 0, (unsigned)offFile + off);
     
    24542454            rc = VERR_NO_MEMORY;
    24552455
    2456         if (VBOX_FAILURE(rc))
     2456        if (RT_FAILURE(rc))
    24572457            goto l_conversion_failed;
    24582458    }
     
    24742474    /* Write pre-header. */
    24752475    rc = RTFileSeek(pImage->File, 0, RTFILE_SEEK_BEGIN, NULL);
    2476     if (VBOX_FAILURE(rc))
     2476    if (RT_FAILURE(rc))
    24772477        goto l_conversion_failed;
    24782478    rc = RTFileWrite(pImage->File, &pImage->PreHeader, sizeof(pImage->PreHeader), NULL);
    2479     if (VBOX_FAILURE(rc))
     2479    if (RT_FAILURE(rc))
    24802480        goto l_conversion_failed;
    24812481
     
    25192519    PVDIIMAGEDESC pImage;
    25202520    int rc = vdiOpenImage(&pImage, pszFilename, VDI_OPEN_FLAGS_NORMAL, NULL);
    2521     if (VBOX_FAILURE(rc))
     2521    if (RT_FAILURE(rc))
    25222522    {
    25232523        Log(("VDIGetImageUUIDs: vdiOpenImage rc=%Vrc filename=\"%s\"\n", rc, pszFilename));
     
    25952595    PVDIIMAGEDESC pImage;
    25962596    int rc = vdiOpenImage(&pImage, pszFilename, VDI_OPEN_FLAGS_NORMAL, NULL);
    2597     if (VBOX_FAILURE(rc))
     2597    if (RT_FAILURE(rc))
    25982598    {
    25992599        Log(("VDISetImageUUIDs: vdiOpenImage rc=%Vrc filename=\"%s\"\n", rc, pszFilename));
     
    26792679    PVDIIMAGEDESC pImageFrom;
    26802680    int rc = vdiOpenImage(&pImageFrom, pszFilenameFrom, VDI_OPEN_FLAGS_READONLY, NULL);
    2681     if (VBOX_FAILURE(rc))
     2681    if (RT_FAILURE(rc))
    26822682    {
    26832683        Log(("VDIMergeImage: vdiOpenImage rc=%Vrc pstFilenameFrom=\"%s\"\n", rc, pszFilenameFrom));
     
    26872687    PVDIIMAGEDESC pImageTo;
    26882688    rc = vdiOpenImage(&pImageTo, pszFilenameTo, VDI_OPEN_FLAGS_NORMAL, NULL);
    2689     if (VBOX_FAILURE(rc))
     2689    if (RT_FAILURE(rc))
    26902690    {
    26912691        Log(("VDIMergeImage: vdiOpenImage rc=%Vrc pszFilenameTo=\"%s\"\n", rc, pszFilenameTo));
     
    33453345                              cbLock);
    33463346#endif
    3347     if (VBOX_SUCCESS(rc))
     3347    if (RT_SUCCESS(rc))
    33483348    {
    33493349        pImage->fReadOnly = fReadOnly;
     
    33883388    {
    33893389        rc = vdiChangeImageMode(pImage, false);
    3390         if (VBOX_SUCCESS(rc))
     3390        if (RT_SUCCESS(rc))
    33913391        {
    33923392            VDIFlushImage(pImage);
     
    34373437    PVDIIMAGEDESC pImage;
    34383438    int rc = vdiOpenImage(&pImage, pszFilename, fOpen, pDisk->pLast);
    3439     if (VBOX_SUCCESS(rc))
     3439    if (RT_SUCCESS(rc))
    34403440    {
    34413441        if (pDisk->pLast)
     
    34603460        }
    34613461
    3462         if (VBOX_SUCCESS(rc))
     3462        if (RT_SUCCESS(rc))
    34633463            vdiAddImageToList(pDisk, pImage);
    34643464        else
     
    35833583        /* Change previous image mode to r/w. */
    35843584        rc = vdiChangeImageMode(pImage->pPrev, false);
    3585         if (VBOX_FAILURE(rc))
     3585        if (RT_FAILURE(rc))
    35863586        {
    35873587            Log(("VDIDiskCommitLastDiff: can't switch previous image into r/w mode, rc=%Vrc\n", rc));
     
    35913591
    35923592    rc = vdiCommitToImage(pDisk, pImage->pPrev, pfnProgress, pvUser);
    3593     if (VBOX_SUCCESS(rc) && fWasReadOnly)
     3593    if (RT_SUCCESS(rc) && fWasReadOnly)
    35943594    {
    35953595        /* Change previous image mode back to r/o. */
     
    35973597    }
    35983598
    3599     if (VBOX_FAILURE(rc))
     3599    if (RT_FAILURE(rc))
    36003600    {
    36013601        /* Failed! Close all images, can't work with VHDD at all. */
     
    36453645                            pDisk->pLast,
    36463646                            pfnProgress, pvUser);
    3647     if (VBOX_SUCCESS(rc))
     3647    if (RT_SUCCESS(rc))
    36483648    {
    36493649        rc = VDIDiskOpenImage(pDisk, pszFilename, VDI_OPEN_FLAGS_NORMAL);
    3650         if (VBOX_FAILURE(rc))
     3650        if (RT_FAILURE(rc))
    36513651            VDIDeleteImage(pszFilename);
    36523652    }
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r11176 r11266  
    374374    rc = RTFileOpen(&File, pImage->pszFilename,
    375375                    RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_ALL);
    376     if (VBOX_FAILURE(rc))
     376    if (RT_FAILURE(rc))
    377377    {
    378378        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: cannot create image '%s'"), pImage->pszFilename);
     
    390390        RTFOFF cbFree = 0;
    391391        rc = RTFsQuerySizes(pImage->pszFilename, NULL, &cbFree, NULL, NULL);
    392         if (VBOX_SUCCESS(rc) /* ignore errors */ && ((uint64_t)cbFree < cbTotal))
     392        if (RT_SUCCESS(rc) /* ignore errors */ && ((uint64_t)cbFree < cbTotal))
    393393        {
    394394            rc = vdiError(pImage, VERR_DISK_FULL, RT_SRC_POS, N_("VDI: disk would overflow creating image '%s'"), pImage->pszFilename);
     
    410410        rc = RTFileSetSize(pImage->File, pImage->offStartData);
    411411    }
    412     if (VBOX_FAILURE(rc))
     412    if (RT_FAILURE(rc))
    413413    {
    414414        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: setting image size failed for '%s'"), pImage->pszFilename);
     
    421421    /* Write pre-header. */
    422422    rc = RTFileWriteAt(File, 0, &pImage->PreHeader, sizeof(pImage->PreHeader), NULL);
    423     if (VBOX_FAILURE(rc))
     423    if (RT_FAILURE(rc))
    424424    {
    425425        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: writing pre-header failed for '%s'"), pImage->pszFilename);
     
    429429    /* Write header. */
    430430    rc = RTFileWriteAt(File, sizeof(pImage->PreHeader), &pImage->Header.u.v1plus, sizeof(pImage->Header.u.v1plus), NULL);
    431     if (VBOX_FAILURE(rc))
     431    if (RT_FAILURE(rc))
    432432    {
    433433        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: writing header failed for '%s'"), pImage->pszFilename);
     
    439439                       getImageBlocks(&pImage->Header) * sizeof(VDIIMAGEBLOCKPOINTER),
    440440                       NULL);
    441     if (VBOX_FAILURE(rc))
     441    if (RT_FAILURE(rc))
    442442    {
    443443        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: writing block pointers failed for '%s'"), pImage->pszFilename);
     
    472472            rc = RTFileWriteAt(File, pImage->offStartData + uOff,
    473473                               pvBuf, cbChunk, NULL);
    474             if (VBOX_FAILURE(rc))
     474            if (RT_FAILURE(rc))
    475475            {
    476476                rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: writing block failed for '%s'"), pImage->pszFilename);
     
    485485                                 uPercentStart + uOff * uPercentSpan / cbFill,
    486486                                 pvUser);
    487                 if (VBOX_FAILURE(rc))
     487                if (RT_FAILURE(rc))
    488488                    goto out;
    489489            }
     
    493493
    494494out:
    495     if (VBOX_SUCCESS(rc) && pfnProgress)
     495    if (RT_SUCCESS(rc) && pfnProgress)
    496496        pfnProgress(NULL /* WARNING! pVM=NULL  */,
    497497                    uPercentStart + uPercentSpan, pvUser);
    498498
    499     if (VBOX_FAILURE(rc))
     499    if (RT_FAILURE(rc))
    500500        vdiFreeImage(pImage, rc != VERR_ALREADY_EXISTS);
    501501    return rc;
     
    522522                     ? RTFILE_O_READ      | RTFILE_O_OPEN | RTFILE_O_DENY_NONE
    523523                     : RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    524     if (VBOX_FAILURE(rc))
     524    if (RT_FAILURE(rc))
    525525    {
    526526        /* Do NOT signal an appropriate error here, as the VD layer has the
     
    533533    rc = RTFileReadAt(File, 0, &pImage->PreHeader, sizeof(pImage->PreHeader),
    534534                      NULL);
    535     if (VBOX_FAILURE(rc))
     535    if (RT_FAILURE(rc))
    536536    {
    537537        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: error reading pre-header in '%s'"), pImage->pszFilename);
     
    539539    }
    540540    rc = vdiValidatePreHeader(&pImage->PreHeader);
    541     if (VBOX_FAILURE(rc))
     541    if (RT_FAILURE(rc))
    542542    {
    543543        rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: invalid pre-header in '%s'"), pImage->pszFilename);
     
    553553                              &pImage->Header.u.v0, sizeof(pImage->Header.u.v0),
    554554                              NULL);
    555             if (VBOX_FAILURE(rc))
     555            if (RT_FAILURE(rc))
    556556            {
    557557                rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: error reading v0 header in '%s'"), pImage->pszFilename);
     
    563563                              &pImage->Header.u.v1, sizeof(pImage->Header.u.v1),
    564564                              NULL);
    565             if (VBOX_FAILURE(rc))
     565            if (RT_FAILURE(rc))
    566566            {
    567567                rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: error reading v1 header in '%s'"), pImage->pszFilename);
     
    586586                /* Read the actual VDI 1.1+ header completely. */
    587587                rc = RTFileReadAt(File, sizeof(pImage->PreHeader), &pImage->Header.u.v1plus, sizeof(pImage->Header.u.v1plus), NULL);
    588                 if (VBOX_FAILURE(rc))
     588                if (RT_FAILURE(rc))
    589589                {
    590590                    rc = vdiError(pImage, rc, RT_SRC_POS, N_("VDI: error reading v1.1+ header in '%s'"), pImage->pszFilename);
     
    599599
    600600    rc = vdiValidateHeader(&pImage->Header);
    601     if (VBOX_FAILURE(rc))
     601    if (RT_FAILURE(rc))
    602602    {
    603603        rc = vdiError(pImage, VERR_VDI_UNSUPPORTED_VERSION, RT_SRC_POS, N_("VDI: invalid header in '%s'"), pImage->pszFilename);
     
    622622
    623623out:
    624     if (VBOX_FAILURE(rc))
     624    if (RT_FAILURE(rc))
    625625        vdiFreeImage(pImage, false);
    626626    return rc;
     
    659659    /* Update image header. */
    660660    int rc = vdiUpdateHeader(pImage);
    661     if (VBOX_SUCCESS(rc))
     661    if (RT_SUCCESS(rc))
    662662    {
    663663        /* write only one block pointer. */
     
    787787
    788788    rc = vdiOpenImage(pImage, uOpenFlags);
    789     if (VBOX_SUCCESS(rc))
     789    if (RT_SUCCESS(rc))
    790790        *ppBackendData = pImage;
    791791
     
    845845                        pPCHSGeometry, pLCHSGeometry,
    846846                        pfnProgress, pvUser, uPercentStart, uPercentSpan);
    847     if (VBOX_SUCCESS(rc))
     847    if (RT_SUCCESS(rc))
    848848    {
    849849        /* So far the image is opened in read/write mode. Make sure the
     
    853853            vdiFreeImage(pImage, false);
    854854            rc = vdiOpenImage(pImage, uOpenFlags);
    855             if (VBOX_FAILURE(rc))
     855            if (RT_FAILURE(rc))
    856856                goto out;
    857857        }
     
    886886    /* Rename the file. */
    887887    rc = RTFileMove(pImage->pszFilename, pszFilename, 0);
    888     if (VBOX_FAILURE(rc))
    889     {   
     888    if (RT_FAILURE(rc))
     889    {
    890890        /* The move failed, try to reopen the original image. */
    891891        int rc2 = vdiOpenImage(pImage, pImage->uOpenFlags);
    892         if (VBOX_FAILURE(rc2))
     892        if (RT_FAILURE(rc2))
    893893            rc = rc2;
    894894
     
    901901    /* Open the new image. */
    902902    rc = vdiOpenImage(pImage, pImage->uOpenFlags);
    903     if (VBOX_FAILURE(rc))
     903    if (RT_FAILURE(rc))
    904904        goto out;
    905905
     
    970970    }
    971971
    972     if (VBOX_SUCCESS(rc))
     972    if (RT_SUCCESS(rc))
    973973        *pcbActuallyRead = cbToRead;
    974974
     
    10461046                               + (pImage->offStartData + pImage->offStartBlockData);
    10471047            rc = RTFileWriteAt(pImage->File, u64Offset, pvBuf, cbToWrite, NULL);
    1048             if (VBOX_FAILURE(rc))
     1048            if (RT_FAILURE(rc))
    10491049                goto out;
    10501050            pImage->paBlocks[uBlock] = cBlocksAllocated;
     
    10521052
    10531053            rc = vdiUpdateBlockInfo(pImage, uBlock);
    1054             if (VBOX_FAILURE(rc))
     1054            if (RT_FAILURE(rc))
    10551055                goto out;
    10561056
     
    11681168        {
    11691169            int rc = RTFileGetSize(pImage->File, &cbFile);
    1170             if (VBOX_SUCCESS(rc))
     1170            if (RT_SUCCESS(rc))
    11711171                cb += cbFile;
    11721172        }
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r11176 r11266  
    368368    /** Async I/O interface callbacks. */
    369369    PVDINTERFACEASYNCIO pInterfaceAsyncIOCallbacks;
    370     /** 
     370    /**
    371371     * Pointer to an array of task handles for task submission.
    372372     * This is an optimization because the task number to submit is not known
     
    496496        pVmdkFile->fAsyncIO = false;
    497497    }
    498     if (VBOX_SUCCESS(rc))
     498    if (RT_SUCCESS(rc))
    499499    {
    500500        pVmdkFile->uReferences = 1;
     
    554554            rc = RTFileClose(pVmdkFile->File);
    555555        }
    556         if (VBOX_SUCCESS(rc) && pVmdkFile->fDelete)
     556        if (RT_SUCCESS(rc) && pVmdkFile->fDelete)
    557557            rc = RTFileDelete(pVmdkFile->pszFilename);
    558558        RTStrFree((char *)(void *)pVmdkFile->pszFilename);
     
    567567 * Internal: read from a file distinguishing between async and normal operation
    568568 */
    569 DECLINLINE(int) vmdkFileReadAt(PVMDKFILE pVmdkFile, 
    570                                uint64_t uOffset, void *pvBuf, 
     569DECLINLINE(int) vmdkFileReadAt(PVMDKFILE pVmdkFile,
     570                               uint64_t uOffset, void *pvBuf,
    571571                               size_t cbToRead, size_t *pcbRead)
    572572{
     
    584584 * Internal: write to a file distinguishing between async and normal operation
    585585 */
    586 DECLINLINE(int) vmdkFileWriteAt(PVMDKFILE pVmdkFile, 
    587                                 uint64_t uOffset, const void *pvBuf, 
     586DECLINLINE(int) vmdkFileWriteAt(PVMDKFILE pVmdkFile,
     587                                uint64_t uOffset, const void *pvBuf,
    588588                                size_t cbToWrite, size_t *pcbWritten)
    589589{
     
    663663            rc2 = RTFileClose(pVmdkFile->File);
    664664
    665         if (VBOX_SUCCESS(rc) && pVmdkFile->fDelete)
     665        if (RT_SUCCESS(rc) && pVmdkFile->fDelete)
    666666            rc2 = RTFileDelete(pVmdkFile->pszFilename);
    667667        RTStrFree((char *)(void *)pVmdkFile->pszFilename);
    668668        RTMemFree(pVmdkFile);
    669         if (VBOX_SUCCESS(rc))
     669        if (RT_SUCCESS(rc))
    670670            rc = rc2;
    671671    }
     
    781781                        pGD, cbGD, NULL);
    782782    AssertRC(rc);
    783     if (VBOX_FAILURE(rc))
     783    if (RT_FAILURE(rc))
    784784    {
    785785        rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: could not read grain directory in '%s'"), pExtent->pszFullname);
     
    801801                            pRGD, cbGD, NULL);
    802802        AssertRC(rc);
    803         if (VBOX_FAILURE(rc))
     803        if (RT_FAILURE(rc))
    804804        {
    805805            rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: could not read redundant grain directory in '%s'"), pExtent->pszFullname);
     
    845845            rc = vmdkFileReadAt(pExtent->pFile, VMDK_SECTOR2BYTE(*pGDTmp),
    846846                                pTmpGT1, cbGT, NULL);
    847             if (VBOX_FAILURE(rc))
     847            if (RT_FAILURE(rc))
    848848            {
    849849                rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error reading grain table in '%s'"), pExtent->pszFullname);
     
    854854            rc = vmdkFileReadAt(pExtent->pFile, VMDK_SECTOR2BYTE(*pRGDTmp),
    855855                                pTmpGT2, cbGT, NULL);
    856             if (VBOX_FAILURE(rc))
     856            if (RT_FAILURE(rc))
    857857            {
    858858                rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error reading backup grain table in '%s'"), pExtent->pszFullname);
     
    874874
    875875out:
    876     if (VBOX_FAILURE(rc))
     876    if (RT_FAILURE(rc))
    877877        vmdkFreeGrainDirectory(pExtent);
    878878    return rc;
     
    912912    cbOverhead = RT_ALIGN_64(VMDK_SECTOR2BYTE(uStartSector) + 2 * (cbGDRounded + cbGTRounded), VMDK_SECTOR2BYTE(pExtent->cSectorsPerGrain));
    913913    rc = vmdkFileSetSize(pExtent->pFile, cbOverhead);
    914     if (VBOX_FAILURE(rc))
     914    if (RT_FAILURE(rc))
    915915        goto out;
    916916    pExtent->uSectorRGD = uStartSector;
     
    931931                                 VMDK_SECTOR2BYTE(pExtent->uSectorRGD) + i * sizeof(uGTSectorLE),
    932932                                 &uGTSectorLE, sizeof(uGTSectorLE), NULL);
    933             if (VBOX_FAILURE(rc))
     933            if (RT_FAILURE(rc))
    934934                return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write new redundant grain directory entry in '%s'"), pExtent->pszFullname);
    935935            uOffsetSectors += VMDK_BYTE2SECTOR(pExtent->cGTEntries * sizeof(uint32_t));
     
    945945                                 VMDK_SECTOR2BYTE(pExtent->uSectorGD) + i * sizeof(uGTSectorLE),
    946946                                 &uGTSectorLE, sizeof(uGTSectorLE), NULL);
    947             if (VBOX_FAILURE(rc))
     947            if (RT_FAILURE(rc))
    948948                return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write new grain directory entry in '%s'"), pExtent->pszFullname);
    949949            uOffsetSectors += VMDK_BYTE2SECTOR(pExtent->cGTEntries * sizeof(uint32_t));
     
    953953
    954954out:
    955     if (VBOX_FAILURE(rc))
     955    if (RT_FAILURE(rc))
    956956        vmdkFreeGrainDirectory(pExtent);
    957957    return rc;
     
    11761176        return VERR_VDI_VALUE_NOT_FOUND;
    11771177    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    1178     if (VBOX_FAILURE(rc))
     1178    if (RT_FAILURE(rc))
    11791179        return rc;
    11801180    *ppszValue = pszValueUnquoted;
     
    11881188
    11891189    int rc = RTStrAPrintf(&pszValueQuoted, "\"%s\"", pszValue);
    1190     if (VBOX_FAILURE(rc))
     1190    if (RT_FAILURE(rc))
    11911191        return rc;
    11921192    rc = vmdkDescSetStr(pImage, pDescriptor, pDescriptor->uFirstDesc, pszKey,
     
    13051305        return VERR_VDI_VALUE_NOT_FOUND;
    13061306    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    1307     if (VBOX_FAILURE(rc))
     1307    if (RT_FAILURE(rc))
    13081308        return rc;
    13091309    *ppszValue = pszValueUnquoted;
     
    13211321        return VERR_VDI_VALUE_NOT_FOUND;
    13221322    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    1323     if (VBOX_FAILURE(rc))
     1323    if (RT_FAILURE(rc))
    13241324        return rc;
    13251325    rc = RTStrToUInt32Ex(pszValueUnquoted, NULL, 10, puValue);
     
    13381338        return VERR_VDI_VALUE_NOT_FOUND;
    13391339    int rc = vmdkStringUnquote(pImage, pszValue, &pszValueUnquoted, NULL);
    1340     if (VBOX_FAILURE(rc))
     1340    if (RT_FAILURE(rc))
    13411341        return rc;
    13421342    rc = RTUuidFromStr(pUuid, pszValueUnquoted);
     
    13541354    {
    13551355        rc = RTStrAPrintf(&pszValQuoted, "\"%s\"", pszVal);
    1356         if (VBOX_FAILURE(rc))
     1356        if (RT_FAILURE(rc))
    13571357            return rc;
    13581358    }
     
    13721372
    13731373    int rc = RTStrAPrintf(&pszUuid, "\"%Vuuid\"", pUuid);
    1374     if (VBOX_FAILURE(rc))
     1374    if (RT_FAILURE(rc))
    13751375        return rc;
    13761376    rc = vmdkDescSetStr(pImage, pDescriptor, pDescriptor->uFirstDDB, pszKey,
     
    13861386
    13871387    int rc = RTStrAPrintf(&pszValue, "\"%d\"", uValue);
    1388     if (VBOX_FAILURE(rc))
     1388    if (RT_FAILURE(rc))
    13891389        return rc;
    13901390    rc = vmdkDescSetStr(pImage, pDescriptor, pDescriptor->uFirstDDB, pszKey,
     
    15171517                           VMDK_DDB_GEO_PCHS_CYLINDERS,
    15181518                           pPCHSGeometry->cCylinders);
    1519     if (VBOX_FAILURE(rc))
     1519    if (RT_FAILURE(rc))
    15201520        return rc;
    15211521    rc = vmdkDescDDBSetU32(pImage, &pImage->Descriptor,
    15221522                           VMDK_DDB_GEO_PCHS_HEADS,
    15231523                           pPCHSGeometry->cHeads);
    1524     if (VBOX_FAILURE(rc))
     1524    if (RT_FAILURE(rc))
    15251525        return rc;
    15261526    rc = vmdkDescDDBSetU32(pImage, &pImage->Descriptor,
     
    15361536                           VMDK_DDB_GEO_LCHS_CYLINDERS,
    15371537                           pLCHSGeometry->cCylinders);
    1538     if (VBOX_FAILURE(rc))
     1538    if (RT_FAILURE(rc))
    15391539        return rc;
    15401540    rc = vmdkDescDDBSetU32(pImage, &pImage->Descriptor,
    15411541                           VMDK_DDB_GEO_LCHS_HEADS,
    15421542                           pLCHSGeometry->cHeads);
    1543     if (VBOX_FAILURE(rc))
     1543    if (RT_FAILURE(rc))
    15441544        return rc;
    15451545    rc = vmdkDescDDBSetU32(pImage, &pImage->Descriptor,
     
    15641564
    15651565    rc = vmdkDescInitStr(pImage, pDescriptor, "# Disk DescriptorFile");
    1566     if (VBOX_FAILURE(rc))
     1566    if (RT_FAILURE(rc))
    15671567        goto out;
    15681568    rc = vmdkDescInitStr(pImage, pDescriptor, "version=1");
    1569     if (VBOX_FAILURE(rc))
     1569    if (RT_FAILURE(rc))
    15701570        goto out;
    15711571    pDescriptor->uFirstDesc = pDescriptor->cLines - 1;
    15721572    rc = vmdkDescInitStr(pImage, pDescriptor, "");
    1573     if (VBOX_FAILURE(rc))
     1573    if (RT_FAILURE(rc))
    15741574        goto out;
    15751575    rc = vmdkDescInitStr(pImage, pDescriptor, "# Extent description");
    1576     if (VBOX_FAILURE(rc))
     1576    if (RT_FAILURE(rc))
    15771577        goto out;
    15781578    rc = vmdkDescInitStr(pImage, pDescriptor, "NOACCESS 0 ZERO ");
    1579     if (VBOX_FAILURE(rc))
     1579    if (RT_FAILURE(rc))
    15801580        goto out;
    15811581    pDescriptor->uFirstExtent = pDescriptor->cLines - 1;
    15821582    rc = vmdkDescInitStr(pImage, pDescriptor, "");
    1583     if (VBOX_FAILURE(rc))
     1583    if (RT_FAILURE(rc))
    15841584        goto out;
    15851585    /* The trailing space is created by VMware, too. */
    15861586    rc = vmdkDescInitStr(pImage, pDescriptor, "# The disk Data Base ");
    1587     if (VBOX_FAILURE(rc))
     1587    if (RT_FAILURE(rc))
    15881588        goto out;
    15891589    rc = vmdkDescInitStr(pImage, pDescriptor, "#DDB");
    1590     if (VBOX_FAILURE(rc))
     1590    if (RT_FAILURE(rc))
    15911591        goto out;
    15921592    rc = vmdkDescInitStr(pImage, pDescriptor, "");
    1593     if (VBOX_FAILURE(rc))
     1593    if (RT_FAILURE(rc))
    15941594        goto out;
    15951595    rc = vmdkDescInitStr(pImage, pDescriptor, "ddb.virtualHWVersion = \"4\"");
    1596     if (VBOX_FAILURE(rc))
     1596    if (RT_FAILURE(rc))
    15971597        goto out;
    15981598    pDescriptor->uFirstDDB = pDescriptor->cLines - 1;
     
    16041604    rc = vmdkDescSetStr(pImage, pDescriptor, pDescriptor->uFirstDesc,
    16051605                        "CID", szBuf);
    1606     if (VBOX_FAILURE(rc))
     1606    if (RT_FAILURE(rc))
    16071607        goto out;
    16081608    rc = vmdkDescSetStr(pImage, pDescriptor, pDescriptor->uFirstDesc,
    16091609                        "parentCID", "ffffffff");
    1610     if (VBOX_FAILURE(rc))
     1610    if (RT_FAILURE(rc))
    16111611        goto out;
    16121612
    16131613    rc = vmdkDescDDBSetStr(pImage, pDescriptor, "ddb.adapterType", "ide");
    1614     if (VBOX_FAILURE(rc))
     1614    if (RT_FAILURE(rc))
    16151615        goto out;
    16161616
     
    16281628    rc = vmdkPreprocessDescriptor(pImage, pDescData, cbDescData,
    16291629                                  &pImage->Descriptor);
    1630     if (VBOX_FAILURE(rc))
     1630    if (RT_FAILURE(rc))
    16311631        return rc;
    16321632
     
    16341634    uint32_t uVersion;
    16351635    rc = vmdkDescBaseGetU32(&pImage->Descriptor, "version", &uVersion);
    1636     if (VBOX_FAILURE(rc))
     1636    if (RT_FAILURE(rc))
    16371637        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error finding key 'version' in descriptor in '%s'"), pImage->pszFilename);
    16381638    if (uVersion != 1)
     
    16431643    rc = vmdkDescBaseGetStr(pImage, &pImage->Descriptor, "createType",
    16441644                            &pszCreateType);
    1645     if (VBOX_FAILURE(rc))
     1645    if (RT_FAILURE(rc))
    16461646        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: cannot get image type from descriptor in '%s'"), pImage->pszFilename);
    16471647    if (    !strcmp(pszCreateType, "twoGbMaxExtentSparse")
     
    16711671        /* Non-monolithic image, extents need to be allocated. */
    16721672        rc = vmdkCreateExtents(pImage, cExtents);
    1673         if (VBOX_FAILURE(rc))
     1673        if (RT_FAILURE(rc))
    16741674            return rc;
    16751675    }
     
    17041704        rc = RTStrToUInt64Ex(pszLine, &pszLine, 10,
    17051705                             &pImage->pExtents[i].cNominalSectors);
    1706         if (VBOX_FAILURE(rc))
     1706        if (RT_FAILURE(rc))
    17071707            return vmdkError(pImage, VERR_VDI_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
    17081708        if (*pszLine++ != ' ')
     
    17501750            char *pszBasename;
    17511751            rc = vmdkStringUnquote(pImage, pszLine, &pszBasename, &pszLine);
    1752             if (VBOX_FAILURE(rc))
     1752            if (RT_FAILURE(rc))
    17531753                return rc;
    17541754            pImage->pExtents[i].pszBasename = pszBasename;
     
    17611761                    rc = RTStrToUInt64Ex(pszLine, &pszLine, 10,
    17621762                                         &pImage->pExtents[i].uSectorOffset);
    1763                     if (VBOX_FAILURE(rc))
     1763                    if (RT_FAILURE(rc))
    17641764                        return vmdkError(pImage, VERR_VDI_INVALID_HEADER, RT_SRC_POS, N_("VMDK: parse error in extent description in '%s'"), pImage->pszFilename);
    17651765                }
     
    17771777    if (rc == VERR_VDI_VALUE_NOT_FOUND)
    17781778        pImage->PCHSGeometry.cCylinders = 0;
    1779     else if (VBOX_FAILURE(rc))
     1779    else if (RT_FAILURE(rc))
    17801780        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error getting PCHS geometry from extent description in '%s'"), pImage->pszFilename);
    17811781    rc = vmdkDescDDBGetU32(pImage, &pImage->Descriptor,
     
    17841784    if (rc == VERR_VDI_VALUE_NOT_FOUND)
    17851785        pImage->PCHSGeometry.cHeads = 0;
    1786     else if (VBOX_FAILURE(rc))
     1786    else if (RT_FAILURE(rc))
    17871787        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error getting PCHS geometry from extent description in '%s'"), pImage->pszFilename);
    17881788    rc = vmdkDescDDBGetU32(pImage, &pImage->Descriptor,
     
    17911791    if (rc == VERR_VDI_VALUE_NOT_FOUND)
    17921792        pImage->PCHSGeometry.cSectors = 0;
    1793     else if (VBOX_FAILURE(rc))
     1793    else if (RT_FAILURE(rc))
    17941794        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error getting PCHS geometry from extent description in '%s'"), pImage->pszFilename);
    17951795    if (    pImage->PCHSGeometry.cCylinders == 0
     
    18121812    if (rc == VERR_VDI_VALUE_NOT_FOUND)
    18131813        pImage->LCHSGeometry.cCylinders = 0;
    1814     else if (VBOX_FAILURE(rc))
     1814    else if (RT_FAILURE(rc))
    18151815        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error getting LCHS geometry from extent description in '%s'"), pImage->pszFilename);
    18161816    rc = vmdkDescDDBGetU32(pImage, &pImage->Descriptor,
     
    18191819    if (rc == VERR_VDI_VALUE_NOT_FOUND)
    18201820        pImage->LCHSGeometry.cHeads = 0;
    1821     else if (VBOX_FAILURE(rc))
     1821    else if (RT_FAILURE(rc))
    18221822        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error getting LCHS geometry from extent description in '%s'"), pImage->pszFilename);
    18231823    rc = vmdkDescDDBGetU32(pImage, &pImage->Descriptor,
     
    18261826    if (rc == VERR_VDI_VALUE_NOT_FOUND)
    18271827        pImage->LCHSGeometry.cSectors = 0;
    1828     else if (VBOX_FAILURE(rc))
     1828    else if (RT_FAILURE(rc))
    18291829        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error getting LCHS geometry from extent description in '%s'"), pImage->pszFilename);
    18301830    if (    pImage->LCHSGeometry.cCylinders == 0
     
    18501850        {
    18511851            rc = RTUuidCreate(&pImage->ImageUuid);
    1852             if (VBOX_FAILURE(rc))
     1852            if (RT_FAILURE(rc))
    18531853                return rc;
    18541854            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    18551855                                    VMDK_DDB_IMAGE_UUID, &pImage->ImageUuid);
    1856             if (VBOX_FAILURE(rc))
     1856            if (RT_FAILURE(rc))
    18571857                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing image UUID in descriptor in '%s'"), pImage->pszFilename);
    18581858        }
    18591859    }
    1860     else if (VBOX_FAILURE(rc))
     1860    else if (RT_FAILURE(rc))
    18611861        return rc;
    18621862
     
    18751875        {
    18761876            rc = RTUuidCreate(&pImage->ModificationUuid);
    1877             if (VBOX_FAILURE(rc))
     1877            if (RT_FAILURE(rc))
    18781878                return rc;
    18791879            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    18801880                                    VMDK_DDB_MODIFICATION_UUID,
    18811881                                    &pImage->ModificationUuid);
    1882             if (VBOX_FAILURE(rc))
     1882            if (RT_FAILURE(rc))
    18831883                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing image modification UUID in descriptor in '%s'"), pImage->pszFilename);
    18841884        }
    18851885    }
    1886     else if (VBOX_FAILURE(rc))
     1886    else if (RT_FAILURE(rc))
    18871887        return rc;
    18881888
     
    19001900        {
    19011901            rc = RTUuidClear(&pImage->ParentUuid);
    1902             if (VBOX_FAILURE(rc))
     1902            if (RT_FAILURE(rc))
    19031903                return rc;
    19041904            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    19051905                                    VMDK_DDB_PARENT_UUID, &pImage->ParentUuid);
    1906             if (VBOX_FAILURE(rc))
     1906            if (RT_FAILURE(rc))
    19071907                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing parent UUID in descriptor in '%s'"), pImage->pszFilename);
    19081908        }
    19091909    }
    1910     else if (VBOX_FAILURE(rc))
     1910    else if (RT_FAILURE(rc))
    19111911        return rc;
    19121912
     
    19251925        {
    19261926            rc = RTUuidCreate(&pImage->ParentModificationUuid);
    1927             if (VBOX_FAILURE(rc))
     1927            if (RT_FAILURE(rc))
    19281928                return rc;
    19291929            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    19301930                                    VMDK_DDB_PARENT_MODIFICATION_UUID,
    19311931                                    &pImage->ParentModificationUuid);
    1932             if (VBOX_FAILURE(rc))
     1932            if (RT_FAILURE(rc))
    19331933                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing parent modification UUID in descriptor in '%s'"), pImage->pszFilename);
    19341934        }
    19351935    }
    1936     else if (VBOX_FAILURE(rc))
     1936    else if (RT_FAILURE(rc))
    19371937        return rc;
    19381938
     
    19731973            return vmdkError(pImage, VERR_BUFFER_OVERFLOW, RT_SRC_POS, N_("VMDK: descriptor too long in '%s'"), pImage->pszFilename);
    19741974        rc = vmdkFileWriteAt(pDescFile, uOffset, psz, cb, NULL);
    1975         if (VBOX_FAILURE(rc))
     1975        if (RT_FAILURE(rc))
    19761976            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
    19771977        uOffset += cb;
    19781978        rc = vmdkFileWriteAt(pDescFile, uOffset, "\n", 1, NULL);
    1979         if (VBOX_FAILURE(rc))
     1979        if (RT_FAILURE(rc))
    19801980            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
    19811981        uOffset++;
     
    19871987        {
    19881988            rc = vmdkFileWriteAt(pDescFile, uOffset, "", 1, NULL);
    1989             if (VBOX_FAILURE(rc))
     1989            if (RT_FAILURE(rc))
    19901990                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
    19911991            uOffset++;
     
    19951995    {
    19961996        rc = vmdkFileSetSize(pDescFile, uOffset);
    1997         if (VBOX_FAILURE(rc))
     1997        if (RT_FAILURE(rc))
    19981998            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error truncating descriptor in '%s'"), pImage->pszFilename);
    19991999    }
     
    20122012    int rc = vmdkFileReadAt(pExtent->pFile, 0, &Header, sizeof(Header), NULL);
    20132013    AssertRC(rc);
    2014     if (VBOX_FAILURE(rc))
     2014    if (RT_FAILURE(rc))
    20152015    {
    20162016        rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error reading extent header in '%s'"), pExtent->pszFullname);
     
    20262026     * image is at least truncated, or even seriously garbled. */
    20272027    rc = vmdkFileGetSize(pExtent->pFile, &cbExtentSize);
    2028     if (VBOX_FAILURE(rc))
     2028    if (RT_FAILURE(rc))
    20292029    {
    20302030        rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error getting size in '%s'"), pExtent->pszFullname);
     
    20932093
    20942094out:
    2095     if (VBOX_FAILURE(rc))
     2095    if (RT_FAILURE(rc))
    20962096        vmdkFreeExtentData(pImage, pExtent, false);
    20972097
     
    21362136    int rc = vmdkFileWriteAt(pExtent->pFile, 0, &Header, sizeof(Header), NULL);
    21372137    AssertRC(rc);
    2138     if (VBOX_FAILURE(rc))
     2138    if (RT_FAILURE(rc))
    21392139        rc = vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error writing extent header in '%s'"), pExtent->pszFullname);
    21402140    return rc;
     
    21542154    int rc = vmdkFileReadAt(pExtent->pFile, 0, &Header, sizeof(Header), NULL);
    21552155    AssertRC(rc);
    2156     if (VBOX_FAILURE(rc))
     2156    if (RT_FAILURE(rc))
    21572157        goto out;
    21582158    if (    RT_LE2H_U32(Header.magicNumber) != VMDK_ESX_SPARSE_MAGICNUMBER
     
    22022202
    22032203out:
    2204     if (VBOX_FAILURE(rc))
     2204    if (RT_FAILURE(rc))
    22052205        vmdkFreeExtentData(pImage, pExtent, false);
    22062206
     
    23182318    /*
    23192319     * Open the image.
    2320      * We don't have to check for asynchronous access because 
     2320     * We don't have to check for asynchronous access because
    23212321     * we only support raw access and the opened file is a description
    23222322     * file were no data is stored.
     
    23262326                       ? RTFILE_O_READ      | RTFILE_O_OPEN | RTFILE_O_DENY_NONE
    23272327                       : RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE, false);
    2328     if (VBOX_FAILURE(rc))
     2328    if (RT_FAILURE(rc))
    23292329    {
    23302330        /* Do NOT signal an appropriate error here, as the VD layer has the
     
    23362336    /* Read magic (if present). */
    23372337    rc = vmdkFileReadAt(pFile, 0, &u32Magic, sizeof(u32Magic), NULL);
    2338     if (VBOX_FAILURE(rc))
     2338    if (RT_FAILURE(rc))
    23392339    {
    23402340        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error reading the magic number in '%s'"), pImage->pszFilename);
     
    23472347        /* It's a hosted sparse single-extent image. */
    23482348        rc = vmdkCreateExtents(pImage, 1);
    2349         if (VBOX_FAILURE(rc))
     2349        if (RT_FAILURE(rc))
    23502350            goto out;
    23512351        /* The opened file is passed to the extent. No separate descriptor
     
    23612361        }
    23622362        rc = vmdkReadMetaSparseExtent(pImage, pExtent);
    2363         if (VBOX_FAILURE(rc))
     2363        if (RT_FAILURE(rc))
    23642364            goto out;
    23652365        /* As we're dealing with a monolithic sparse image here, there must
     
    23822382                            VMDK_SECTOR2BYTE(pExtent->cDescriptorSectors), NULL);
    23832383        AssertRC(rc);
    2384         if (VBOX_FAILURE(rc))
     2384        if (RT_FAILURE(rc))
    23852385        {
    23862386            rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: read error for descriptor in '%s'"), pExtent->pszFullname);
     
    23902390        rc = vmdkParseDescriptor(pImage, pExtent->pDescData,
    23912391                                 VMDK_SECTOR2BYTE(pExtent->cDescriptorSectors));
    2392         if (VBOX_FAILURE(rc))
     2392        if (RT_FAILURE(rc))
    23932393            goto out;
    23942394
     
    24132413        rc = vmdkFileReadAt(pImage->pFile, 0, pImage->pDescData,
    24142414                            pImage->cbDescAlloc, &cbRead);
    2415         if (VBOX_FAILURE(rc))
     2415        if (RT_FAILURE(rc))
    24162416        {
    24172417            rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: read error for descriptor in '%s'"), pImage->pszFilename);
     
    24282428        rc = vmdkParseDescriptor(pImage, pImage->pDescData,
    24292429                                 pImage->cbDescAlloc);
    2430         if (VBOX_FAILURE(rc))
     2430        if (RT_FAILURE(rc))
    24312431            goto out;
    24322432
    2433         /* 
     2433        /*
    24342434         * We have to check for the asynchronous open flag. The
    24352435         * extents are parsed and the type of all are known now.
     
    24452445                    && (pExtent->enmType != VMDKETYPE_ZERO))
    24462446                {
    2447                     /* 
     2447                    /*
    24482448                     * Opened image contains at least one none flat or zero extent.
    24492449                     * Return error but don't set error message as the caller
     
    24902490                                      RTPATH_SLASH, pExtent->pszBasename);
    24912491                    RTStrFree(pszDirname);
    2492                     if (VBOX_FAILURE(rc))
     2492                    if (RT_FAILURE(rc))
    24932493                        goto out;
    24942494                }
     
    25052505                                        ? RTFILE_O_READ      | RTFILE_O_OPEN | RTFILE_O_DENY_NONE
    25062506                                        : RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE, false);
    2507                     if (VBOX_FAILURE(rc))
     2507                    if (RT_FAILURE(rc))
    25082508                    {
    25092509                        /* Do NOT signal an appropriate error here, as the VD
     
    25132513                    }
    25142514                    rc = vmdkReadMetaSparseExtent(pImage, pExtent);
    2515                     if (VBOX_FAILURE(rc))
     2515                    if (RT_FAILURE(rc))
    25162516                        goto out;
    25172517
     
    25282528                                        ? RTFILE_O_READ      | RTFILE_O_OPEN | RTFILE_O_DENY_NONE
    25292529                                        : RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE, true);
    2530                     if (VBOX_FAILURE(rc))
     2530                    if (RT_FAILURE(rc))
    25312531                    {
    25322532                        /* Do NOT signal an appropriate error here, as the VD
     
    25642564    /* Update the image metadata now in case has changed. */
    25652565    rc = vmdkFlushImage(pImage);
    2566     if (VBOX_FAILURE(rc))
     2566    if (RT_FAILURE(rc))
    25672567        goto out;
    25682568
     
    25992599
    26002600    rc = vmdkAllocateGrainTableCache(pImage);
    2601     if (VBOX_FAILURE(rc))
     2601    if (RT_FAILURE(rc))
    26022602        goto out;
    26032603
    26042604out:
    2605     if (VBOX_FAILURE(rc))
     2605    if (RT_FAILURE(rc))
    26062606        vmdkFreeImage(pImage, false);
    26072607    return rc;
     
    26222622         * file and open the (flat) raw disk. */
    26232623        rc = vmdkCreateExtents(pImage, 1);
    2624         if (VBOX_FAILURE(rc))
     2624        if (RT_FAILURE(rc))
    26252625            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new extent list in '%s'"), pImage->pszFilename);
    26262626        pExtent = &pImage->pExtents[0];
     
    26292629                          RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_NOT_CONTENT_INDEXED,
    26302630                          false);
    2631         if (VBOX_FAILURE(rc))
     2631        if (RT_FAILURE(rc))
    26322632            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new file '%s'"), pImage->pszFilename);
    26332633
     
    26522652        rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname,
    26532653                          RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE, false);
    2654         if (VBOX_FAILURE(rc))
     2654        if (RT_FAILURE(rc))
    26552655            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not open raw disk file '%s'"), pExtent->pszFullname);
    26562656    }
     
    26952695
    26962696        rc = vmdkCreateExtents(pImage, cExtents);
    2697         if (VBOX_FAILURE(rc))
     2697        if (RT_FAILURE(rc))
    26982698            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new extent list in '%s'"), pImage->pszFilename);
    26992699
     
    27022702                          RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_NOT_CONTENT_INDEXED,
    27032703                          false);
    2704         if (VBOX_FAILURE(rc))
     2704        if (RT_FAILURE(rc))
    27052705            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new file '%s'"), pImage->pszFilename);
    27062706
     
    27612761                                  RTPATH_SLASH, pExtent->pszBasename);
    27622762                RTStrFree(pszDirname);
    2763                 if (VBOX_FAILURE(rc))
     2763                if (RT_FAILURE(rc))
    27642764                    return rc;
    27652765                pExtent->pszFullname = pszFullname;
     
    27742774                                  RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_NOT_CONTENT_INDEXED,
    27752775                                  false);
    2776                 if (VBOX_FAILURE(rc))
     2776                if (RT_FAILURE(rc))
    27772777                    return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new partition data file '%s'"), pExtent->pszFullname);
    27782778                rc = vmdkFileWriteAt(pExtent->pFile,
     
    27802780                                     pPart->pvPartitionData,
    27812781                                     pPart->cbPartitionData, NULL);
    2782                 if (VBOX_FAILURE(rc))
     2782                if (RT_FAILURE(rc))
    27832783                    return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not write partition data to '%s'"), pExtent->pszFullname);
    27842784                uPartOffset += VMDK_BYTE2SECTOR(pPart->cbPartitionData);
     
    28222822                                      RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE,
    28232823                                      false);
    2824                     if (VBOX_FAILURE(rc))
     2824                    if (RT_FAILURE(rc))
    28252825                        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not open raw partition file '%s'"), pExtent->pszFullname);
    28262826                }
     
    28542854                            pRaw->fRawDisk ?
    28552855                            "fullDevice" : "partitionedDevice");
    2856     if (VBOX_FAILURE(rc))
     2856    if (RT_FAILURE(rc))
    28572857        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not set the image type in '%s'"), pImage->pszFilename);
    28582858    return rc;
     
    28812881    }
    28822882    rc = vmdkCreateExtents(pImage, cExtents);
    2883     if (VBOX_FAILURE(rc))
     2883    if (RT_FAILURE(rc))
    28842884        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new extent list in '%s'"), pImage->pszFilename);
    28852885
     
    28952895                          RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_NOT_CONTENT_INDEXED,
    28962896                          false);
    2897         if (VBOX_FAILURE(rc))
     2897        if (RT_FAILURE(rc))
    28982898            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new sparse descriptor file '%s'"), pImage->pszFilename);
    28992899        pImage->pszFilename = RTStrDup(pImage->pszFilename);
     
    29402940                                  pszBasenameExt);
    29412941            RTStrFree(pszBasenameBase);
    2942             if (VBOX_FAILURE(rc))
     2942            if (RT_FAILURE(rc))
    29432943                return rc;
    29442944            cbTmp = strlen(pszTmp) + 1;
     
    29582958                          RTPATH_SLASH, pExtent->pszBasename);
    29592959        RTStrFree(pszBasedirectory);
    2960         if (VBOX_FAILURE(rc))
     2960        if (RT_FAILURE(rc))
    29612961            return rc;
    29622962        pExtent->pszFullname = pszFullname;
     
    29662966                          RTFILE_O_READWRITE | RTFILE_O_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_NOT_CONTENT_INDEXED,
    29672967                          false);
    2968         if (VBOX_FAILURE(rc))
     2968        if (RT_FAILURE(rc))
    29692969            return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new file '%s'"), pExtent->pszFullname);
    29702970        if (enmType == VD_IMAGE_TYPE_FIXED)
    29712971        {
    29722972            rc = vmdkFileSetSize(pExtent->pFile, cbExtent);
    2973             if (VBOX_FAILURE(rc))
     2973            if (RT_FAILURE(rc))
    29742974                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not set size of new file '%s'"), pExtent->pszFullname);
    29752975
     
    29942994
    29952995                rc = vmdkFileWriteAt(pExtent->pFile, uOff, pvBuf, cbChunk, NULL);
    2996                 if (VBOX_FAILURE(rc))
     2996                if (RT_FAILURE(rc))
    29972997                {
    29982998                    RTMemFree(pvBuf);
     
    30073007                                     uPercentStart + uOff * uPercentSpan / cbExtent,
    30083008                                     pvUser);
    3009                     if (VBOX_FAILURE(rc))
     3009                    if (RT_FAILURE(rc))
    30103010                    {
    30113011                        RTMemFree(pvBuf);
     
    30553055                                                 1),
    30563056                                          true);
    3057             if (VBOX_FAILURE(rc))
     3057            if (RT_FAILURE(rc))
    30583058                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new grain directory in '%s'"), pExtent->pszFullname);
    30593059        }
    30603060
    3061         if (VBOX_SUCCESS(rc) && pfnProgress)
     3061        if (RT_SUCCESS(rc) && pfnProgress)
    30623062            pfnProgress(NULL /* WARNING! pVM=NULL  */,
    30633063                        uPercentStart + i * uPercentSpan / cExtents,
     
    30833083    rc = vmdkDescBaseSetStr(pImage, &pImage->Descriptor, "createType",
    30843084                            pszDescType);
    3085     if (VBOX_FAILURE(rc))
     3085    if (RT_FAILURE(rc))
    30863086        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not set the image type in '%s'"), pImage->pszFilename);
    30873087    return rc;
     
    31053105    rc = vmdkCreateDescriptor(pImage, pImage->pDescData, pImage->cbDescAlloc,
    31063106                              &pImage->Descriptor);
    3107     if (VBOX_FAILURE(rc))
     3107    if (RT_FAILURE(rc))
    31083108    {
    31093109        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not create new descriptor in '%s'"), pImage->pszFilename);
     
    31353135    }
    31363136
    3137     if (VBOX_FAILURE(rc))
    3138         goto out;
    3139 
    3140     if (VBOX_SUCCESS(rc) && pfnProgress)
     3137    if (RT_FAILURE(rc))
     3138        goto out;
     3139
     3140    if (RT_SUCCESS(rc) && pfnProgress)
    31413141        pfnProgress(NULL /* WARNING! pVM=NULL  */,
    31423142                    uPercentStart + uPercentSpan * 98 / 100, pvUser);
     
    31523152                               pExtent->cNominalSectors, pExtent->enmType,
    31533153                               pExtent->pszBasename, pExtent->uSectorOffset);
    3154         if (VBOX_FAILURE(rc))
     3154        if (RT_FAILURE(rc))
    31553155        {
    31563156            rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: could not insert the extent list into descriptor in '%s'"), pImage->pszFilename);
     
    31653165    {
    31663166        rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry);
    3167         if (VBOX_FAILURE(rc))
     3167        if (RT_FAILURE(rc))
    31683168            goto out;
    31693169    }
     
    31733173    {
    31743174        rc = vmdkDescSetLCHSGeometry(pImage, pLCHSGeometry);
    3175         if (VBOX_FAILURE(rc))
     3175        if (RT_FAILURE(rc))
    31763176            goto out;
    31773177    }
     
    31813181
    31823182    rc = RTUuidCreate(&pImage->ImageUuid);
    3183     if (VBOX_FAILURE(rc))
     3183    if (RT_FAILURE(rc))
    31843184        goto out;
    31853185    rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    31863186                            VMDK_DDB_IMAGE_UUID, &pImage->ImageUuid);
    3187     if (VBOX_FAILURE(rc))
     3187    if (RT_FAILURE(rc))
    31883188    {
    31893189        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing image UUID in new descriptor in '%s'"), pImage->pszFilename);
     
    31933193    rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    31943194                            VMDK_DDB_PARENT_UUID, &pImage->ParentUuid);
    3195     if (VBOX_FAILURE(rc))
     3195    if (RT_FAILURE(rc))
    31963196    {
    31973197        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing parent image UUID in new descriptor in '%s'"), pImage->pszFilename);
     
    32023202                            VMDK_DDB_MODIFICATION_UUID,
    32033203                            &pImage->ModificationUuid);
    3204     if (VBOX_FAILURE(rc))
     3204    if (RT_FAILURE(rc))
    32053205    {
    32063206        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing modification UUID in new descriptor in '%s'"), pImage->pszFilename);
     
    32113211                            VMDK_DDB_PARENT_MODIFICATION_UUID,
    32123212                            &pImage->ParentModificationUuid);
    3213     if (VBOX_FAILURE(rc))
     3213    if (RT_FAILURE(rc))
    32143214    {
    32153215        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing parent modification UUID in new descriptor in '%s'"), pImage->pszFilename);
     
    32183218
    32193219    rc = vmdkAllocateGrainTableCache(pImage);
    3220     if (VBOX_FAILURE(rc))
     3220    if (RT_FAILURE(rc))
    32213221        goto out;
    32223222
    32233223    rc = vmdkSetImageComment(pImage, pszComment);
    3224     if (VBOX_FAILURE(rc))
     3224    if (RT_FAILURE(rc))
    32253225    {
    32263226        rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: cannot set image comment in '%s'"), pImage->pszFilename);
     
    32283228    }
    32293229
    3230     if (VBOX_SUCCESS(rc) && pfnProgress)
     3230    if (RT_SUCCESS(rc) && pfnProgress)
    32313231        pfnProgress(NULL /* WARNING! pVM=NULL  */,
    32323232                    uPercentStart + uPercentSpan * 99 / 100, pvUser);
     
    32353235
    32363236out:
    3237     if (VBOX_SUCCESS(rc) && pfnProgress)
     3237    if (RT_SUCCESS(rc) && pfnProgress)
    32383238        pfnProgress(NULL /* WARNING! pVM=NULL  */,
    32393239                    uPercentStart + uPercentSpan, pvUser);
    32403240
    3241     if (VBOX_FAILURE(rc))
     3241    if (RT_FAILURE(rc))
    32423242        vmdkFreeImage(pImage, rc != VERR_ALREADY_EXISTS);
    32433243    return rc;
     
    32623262    if (pszComment)
    32633263        RTStrFree(pszCommentEncoded);
    3264     if (VBOX_FAILURE(rc))
     3264    if (RT_FAILURE(rc))
    32653265        return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing image comment in descriptor in '%s'"), pImage->pszFilename);
    32663266    return VINF_SUCCESS;
     
    33203320    {
    33213321        rc = vmdkWriteDescriptor(pImage);
    3322         if (VBOX_FAILURE(rc))
     3322        if (RT_FAILURE(rc))
    33233323            goto out;
    33243324    }
     
    33333333                case VMDKETYPE_HOSTED_SPARSE:
    33343334                    rc = vmdkWriteMetaSparseExtent(pExtent);
    3335                     if (VBOX_FAILURE(rc))
     3335                    if (RT_FAILURE(rc))
    33363336                        goto out;
    33373337                    break;
     
    34513451                            VMDK_SECTOR2BYTE(uGTSector) + (uGTBlock % (pExtent->cGTEntries / VMDK_GT_CACHELINE_SIZE)) * sizeof(aGTDataTmp),
    34523452                            aGTDataTmp, sizeof(aGTDataTmp), NULL);
    3453         if (VBOX_FAILURE(rc))
     3453        if (RT_FAILURE(rc))
    34543454            return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot read grain table entry in '%s'"), pExtent->pszFullname);
    34553455        pGTCacheEntry->uExtent = pExtent->uExtent;
     
    34983498         * a new grain table and put the reference to it in the GDs. */
    34993499        rc = vmdkFileGetSize(pExtent->pFile, &cbExtentSize);
    3500         if (VBOX_FAILURE(rc))
     3500        if (RT_FAILURE(rc))
    35013501            return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error getting size in '%s'"), pExtent->pszFullname);
    35023502        Assert(!(cbExtentSize % 512));
     
    35193519                                 VMDK_SECTOR2BYTE(uGTSector) + i * sizeof(aGTDataTmp),
    35203520                                 aGTDataTmp, sizeof(aGTDataTmp), NULL);
    3521             if (VBOX_FAILURE(rc))
     3521            if (RT_FAILURE(rc))
    35223522                return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write grain table allocation in '%s'"), pExtent->pszFullname);
    35233523        }
     
    35263526            AssertReturn(!uRGTSector, VERR_VDI_INVALID_HEADER);
    35273527            rc = vmdkFileGetSize(pExtent->pFile, &cbExtentSize);
    3528             if (VBOX_FAILURE(rc))
     3528            if (RT_FAILURE(rc))
    35293529                return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error getting size in '%s'"), pExtent->pszFullname);
    35303530            Assert(!(cbExtentSize % 512));
     
    35463546                                     VMDK_SECTOR2BYTE(uRGTSector) + i * sizeof(aGTDataTmp),
    35473547                                     aGTDataTmp, sizeof(aGTDataTmp), NULL);
    3548                 if (VBOX_FAILURE(rc))
     3548                if (RT_FAILURE(rc))
    35493549                    return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write backup grain table allocation in '%s'"), pExtent->pszFullname);
    35503550            }
     
    35593559                             VMDK_SECTOR2BYTE(pExtent->uSectorGD) + uGDIndex * sizeof(uGTSectorLE),
    35603560                             &uGTSectorLE, sizeof(uGTSectorLE), NULL);
    3561         if (VBOX_FAILURE(rc))
     3561        if (RT_FAILURE(rc))
    35623562            return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write grain directory entry in '%s'"), pExtent->pszFullname);
    35633563        if (pExtent->pRGD)
     
    35673567                                 VMDK_SECTOR2BYTE(pExtent->uSectorRGD) + uGDIndex * sizeof(uRGTSectorLE),
    35683568                                 &uRGTSectorLE, sizeof(uRGTSectorLE), NULL);
    3569             if (VBOX_FAILURE(rc))
     3569            if (RT_FAILURE(rc))
    35703570                return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write backup grain directory entry in '%s'"), pExtent->pszFullname);
    35713571        }
     
    35783578
    35793579    rc = vmdkFileGetSize(pExtent->pFile, &cbExtentSize);
    3580     if (VBOX_FAILURE(rc))
     3580    if (RT_FAILURE(rc))
    35813581        return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: error getting size in '%s'"), pExtent->pszFullname);
    35823582    Assert(!(cbExtentSize % 512));
     
    35843584    /* Write the data. */
    35853585    rc = vmdkFileWriteAt(pExtent->pFile, cbExtentSize, pvBuf, cbWrite, NULL);
    3586     if (VBOX_FAILURE(rc))
     3586    if (RT_FAILURE(rc))
    35873587        return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write allocated data block in '%s'"), pExtent->pszFullname);
    35883588
     
    35983598                            VMDK_SECTOR2BYTE(uGTSector) + (uGTBlock % (pExtent->cGTEntries / VMDK_GT_CACHELINE_SIZE)) * sizeof(aGTDataTmp),
    35993599                            aGTDataTmp, sizeof(aGTDataTmp), NULL);
    3600         if (VBOX_FAILURE(rc))
     3600        if (RT_FAILURE(rc))
    36013601            return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot read allocated grain table entry in '%s'"), pExtent->pszFullname);
    36023602        pGTCacheEntry->uExtent = pExtent->uExtent;
     
    36193619                         VMDK_SECTOR2BYTE(uGTSector) + (uGTBlock % (pExtent->cGTEntries / VMDK_GT_CACHELINE_SIZE)) * sizeof(aGTDataTmp),
    36203620                         aGTDataTmp, sizeof(aGTDataTmp), NULL);
    3621     if (VBOX_FAILURE(rc))
     3621    if (RT_FAILURE(rc))
    36223622        return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write updated grain table in '%s'"), pExtent->pszFullname);
    36233623    if (pExtent->pRGD)
     
    36273627                             VMDK_SECTOR2BYTE(uRGTSector) + (uGTBlock % (pExtent->cGTEntries / VMDK_GT_CACHELINE_SIZE)) * sizeof(aGTDataTmp),
    36283628                             aGTDataTmp, sizeof(aGTDataTmp), NULL);
    3629         if (VBOX_FAILURE(rc))
     3629        if (RT_FAILURE(rc))
    36303630            return vmdkError(pExtent->pImage, rc, RT_SRC_POS, N_("VMDK: cannot write updated backup grain table in '%s'"), pExtent->pszFullname);
    36313631    }
    36323632#ifdef VBOX_WITH_VMDK_ESX
    3633     if (VBOX_SUCCESS(rc) && pExtent->enmType == VMDKETYPE_ESX_SPARSE)
     3633    if (RT_SUCCESS(rc) && pExtent->enmType == VMDKETYPE_ESX_SPARSE)
    36343634    {
    36353635        pExtent->uFreeSector = uGTSector + VMDK_BYTE2SECTOR(cbWrite);
     
    37333733
    37343734    rc = vmdkOpenImage(pImage, uOpenFlags);
    3735     if (VBOX_SUCCESS(rc))
     3735    if (RT_SUCCESS(rc))
    37363736        *ppBackendData = pImage;
    37373737
     
    38093809                         pPCHSGeometry, pLCHSGeometry,
    38103810                         pfnProgress, pvUser, uPercentStart, uPercentSpan);
    3811     if (VBOX_SUCCESS(rc))
     3811    if (RT_SUCCESS(rc))
    38123812    {
    38133813        /* So far the image is opened in read/write mode. Make sure the
     
    38173817            vmdkFreeImage(pImage, false);
    38183818            rc = vmdkOpenImage(pImage, uOpenFlags);
    3819             if (VBOX_FAILURE(rc))
     3819            if (RT_FAILURE(rc))
    38203820                goto out;
    38213821        }
     
    38953895     * with zeros. We actually save stuff when and if we change it.
    38963896     */
    3897     apszOldName  = (char **)RTMemTmpAllocZ((cExtents + 1) * sizeof(char*)); 
    3898     apszNewName  = (char **)RTMemTmpAllocZ((cExtents + 1) * sizeof(char*)); 
    3899     apszNewLines = (char **)RTMemTmpAllocZ((cExtents) * sizeof(char*)); 
     3897    apszOldName  = (char **)RTMemTmpAllocZ((cExtents + 1) * sizeof(char*));
     3898    apszNewName  = (char **)RTMemTmpAllocZ((cExtents + 1) * sizeof(char*));
     3899    apszNewLines = (char **)RTMemTmpAllocZ((cExtents) * sizeof(char*));
    39003900    if (!apszOldName || !apszNewName || !apszNewLines)
    39013901    {
     
    39543954        pImage->Descriptor.aLines[line] = apszNewLines[i];
    39553955        /* Compose new name for the extent. */
    3956         apszNewName[i] = vmdkStrReplace(pExtent->pszFullname, 
     3956        apszNewName[i] = vmdkStrReplace(pExtent->pszFullname,
    39573957            pszOldBasename, pszNewBasename);
    39583958        if (!apszNewName[i])
     
    39623962        /* Rename the extent file. */
    39633963        rc = RTFileMove(pExtent->pszFullname, apszNewName[i], 0);
    3964         if (VBOX_FAILURE(rc))
     3964        if (RT_FAILURE(rc))
    39653965            goto rollback;
    39663966        /* Remember the old name. */
     
    39793979     */
    39803980    apszNewName[cExtents] = RTPathFilename(pszFilename);
    3981     /* Rename the descriptor file if it's separate. */ 
     3981    /* Rename the descriptor file if it's separate. */
    39823982    if (!fEmbeddedDesc)
    39833983    {
    39843984        rc = RTFileMove(pImage->pszFilename, apszNewName[cExtents], 0);
    3985         if (VBOX_FAILURE(rc))
     3985        if (RT_FAILURE(rc))
    39863986            goto rollback;
    39873987        /* Save old name only if we may need to change it back. */
     
    39943994    /* Open the new image. */
    39953995    rc = vmdkOpenImage(pImage, pImage->uOpenFlags);
    3996     if (VBOX_SUCCESS(rc))
     3996    if (RT_SUCCESS(rc))
    39973997        goto out;
    39983998
    39993999rollback:
    40004000    /* Roll back all changes in case of failure. */
    4001     if (VBOX_FAILURE(rc))
     4001    if (RT_FAILURE(rc))
    40024002    {
    40034003        int rrc;
     
    40054005        {
    40064006            /*
    4007              * Some extents may have been closed, close the rest. We will 
    4008              * re-open the whole thing later. 
     4007             * Some extents may have been closed, close the rest. We will
     4008             * re-open the whole thing later.
    40094009             */
    40104010            vmdkFreeImage(pImage, false);
     
    40994099    rc = vmdkFindExtent(pImage, VMDK_BYTE2SECTOR(uOffset),
    41004100                        &pExtent, &uSectorExtentRel);
    4101     if (VBOX_FAILURE(rc))
     4101    if (RT_FAILURE(rc))
    41024102        goto out;
    41034103
     
    41214121            rc = vmdkGetSector(pImage->pGTCache, pExtent, uSectorExtentRel,
    41224122                               &uSectorExtentAbs);
    4123             if (VBOX_FAILURE(rc))
     4123            if (RT_FAILURE(rc))
    41244124                goto out;
    41254125            /* Clip read range to at most the rest of the grain. */
     
    41864186    rc = vmdkFindExtent(pImage, VMDK_BYTE2SECTOR(uOffset),
    41874187                        &pExtent, &uSectorExtentRel);
    4188     if (VBOX_FAILURE(rc))
     4188    if (RT_FAILURE(rc))
    41894189        goto out;
    41904190
     
    42054205            rc = vmdkGetSector(pImage->pGTCache, pExtent, uSectorExtentRel,
    42064206                               &uSectorExtentAbs);
    4207             if (VBOX_FAILURE(rc))
     4207            if (RT_FAILURE(rc))
    42084208                goto out;
    42094209            /* Clip write range to at most the rest of the grain. */
     
    42664266    PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
    42674267    int rc;
    4268    
     4268
    42694269    Assert(pImage);
    42704270
     
    43364336        {
    43374337            int rc = vmdkFileGetSize(pImage->pFile, &cbFile);
    4338             if (VBOX_SUCCESS(rc))
     4338            if (RT_SUCCESS(rc))
    43394339                cb += cbFile;
    43404340            for (unsigned i = 0; i <= pImage->cExtents; i++)
    43414341            {
    43424342                rc = vmdkFileGetSize(pImage->pFile, &cbFile);
    4343                 if (VBOX_SUCCESS(rc))
     4343                if (RT_SUCCESS(rc))
    43444344                    cb += cbFile;
    43454345            }
     
    43964396        }
    43974397        rc = vmdkDescSetPCHSGeometry(pImage, pPCHSGeometry);
    4398         if (VBOX_FAILURE(rc))
     4398        if (RT_FAILURE(rc))
    43994399            goto out;
    44004400
     
    44554455        }
    44564456        rc = vmdkDescSetLCHSGeometry(pImage, pLCHSGeometry);
    4457         if (VBOX_FAILURE(rc))
     4457        if (RT_FAILURE(rc))
    44584458            goto out;
    44594459
     
    45464546        if (rc == VERR_VDI_VALUE_NOT_FOUND)
    45474547            pszCommentEncoded = NULL;
    4548         else if (VBOX_FAILURE(rc))
     4548        else if (RT_FAILURE(rc))
    45494549            goto out;
    45504550
     
    46274627            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    46284628                                    VMDK_DDB_IMAGE_UUID, pUuid);
    4629             if (VBOX_FAILURE(rc))
     4629            if (RT_FAILURE(rc))
    46304630                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing image UUID in descriptor in '%s'"), pImage->pszFilename);
    46314631            rc = VINF_SUCCESS;
     
    46784678            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    46794679                                    VMDK_DDB_MODIFICATION_UUID, pUuid);
    4680             if (VBOX_FAILURE(rc))
     4680            if (RT_FAILURE(rc))
    46814681                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing modification UUID in descriptor in '%s'"), pImage->pszFilename);
    46824682            rc = VINF_SUCCESS;
     
    47294729            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    47304730                                    VMDK_DDB_PARENT_UUID, pUuid);
    4731             if (VBOX_FAILURE(rc))
     4731            if (RT_FAILURE(rc))
    47324732                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing parent image UUID in descriptor in '%s'"), pImage->pszFilename);
    47334733            rc = VINF_SUCCESS;
     
    47804780            rc = vmdkDescDDBSetUuid(pImage, &pImage->Descriptor,
    47814781                                    VMDK_DDB_PARENT_MODIFICATION_UUID, pUuid);
    4782             if (VBOX_FAILURE(rc))
     4782            if (RT_FAILURE(rc))
    47834783                return vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error storing parent image UUID in descriptor in '%s'"), pImage->pszFilename);
    47844784            rc = VINF_SUCCESS;
     
    49014901        rc = vmdkFindExtent(pImage, VMDK_BYTE2SECTOR(uOffset),
    49024902                            &pExtent, &uSectorExtentRel);
    4903         if (VBOX_FAILURE(rc))
     4903        if (RT_FAILURE(rc))
    49044904            goto out;
    49054905
     
    49234923                void *pTask;
    49244924                rc = pImage->pInterfaceAsyncIOCallbacks->pfnPrepareRead(pImage->pInterfaceAsyncIO->pvUser, pExtent->pFile->pStorage,
    4925                                                                        VMDK_SECTOR2BYTE(uSectorExtentRel), 
     4925                                                                       VMDK_SECTOR2BYTE(uSectorExtentRel),
    49264926                                                                       (uint8_t *)paSegCurrent->pvSeg + uOffsetInCurrentSegment,
    49274927                                                                       cbToRead, &pTask);
    4928                 if (VBOX_FAILURE(rc))
     4928                if (RT_FAILURE(rc))
    49294929                {
    49304930                    AssertMsgFailed(("Preparing read failed rc=%Vrc\n", rc));
     
    49664966            }
    49674967            case VMDKETYPE_ZERO:
    4968                 memset((uint8_t *)paSegCurrent->pvSeg + uOffsetInCurrentSegment, 0, cbToRead); 
     4968                memset((uint8_t *)paSegCurrent->pvSeg + uOffsetInCurrentSegment, 0, cbToRead);
    49694969                break;
    49704970            default:
     
    50005000                                                                NULL, pvUser,
    50015001                                                                NULL /* Nothing required after read. */);
    5002         AssertMsg(VBOX_SUCCESS(rc), ("Failed to enqueue tasks rc=%Vrc\n", rc));
     5002        AssertMsg(RT_SUCCESS(rc), ("Failed to enqueue tasks rc=%Vrc\n", rc));
    50035003    }
    50045004
     
    50375037        rc = vmdkFindExtent(pImage, VMDK_BYTE2SECTOR(uOffset),
    50385038                            &pExtent, &uSectorExtentRel);
    5039         if (VBOX_FAILURE(rc))
     5039        if (RT_FAILURE(rc))
    50405040            goto out;
    50415041
     
    50595059                void *pTask;
    50605060                rc = pImage->pInterfaceAsyncIOCallbacks->pfnPrepareWrite(pImage->pInterfaceAsyncIO->pvUser, pExtent->pFile->pStorage,
    5061                                                                          VMDK_SECTOR2BYTE(uSectorExtentRel), 
     5061                                                                         VMDK_SECTOR2BYTE(uSectorExtentRel),
    50625062                                                                         (uint8_t *)paSegCurrent->pvSeg + uOffsetInCurrentSegment,
    50635063                                                                         cbToWrite, &pTask);
    5064                 if (VBOX_FAILURE(rc))
     5064                if (RT_FAILURE(rc))
    50655065                {
    50665066                    AssertMsgFailed(("Preparing read failed rc=%Vrc\n", rc));
     
    51345134        rc = pImage->pInterfaceAsyncIOCallbacks->pfnTasksSubmit(pImage->pInterfaceAsyncIO->pvUser,
    51355135                                                                pImage->apTask, cTasksToSubmit,
    5136                                                                 NULL, pvUser, 
     5136                                                                NULL, pvUser,
    51375137                                                                NULL /* Nothing required after read. */);
    5138         AssertMsg(VBOX_SUCCESS(rc), ("Failed to enqueue tasks rc=%Vrc\n", rc));
     5138        AssertMsg(RT_SUCCESS(rc), ("Failed to enqueue tasks rc=%Vrc\n", rc));
    51395139    }
    51405140
  • trunk/src/VBox/Devices/Storage/fdc.c

    r8155 r11266  
    13131313                rc = PDMDevHlpDMAReadMemory (fdctrl->pDevIns, nchan, tmpbuf,
    13141314                                             fdctrl->data_pos, len, &read);
    1315                 AssertMsg (VBOX_SUCCESS (rc), ("DMAReadMemory -> %Vrc\n", rc));
     1315                AssertMsg (RT_SUCCESS (rc), ("DMAReadMemory -> %Vrc\n", rc));
    13161316#else
    13171317                DMA_read_memory (nchan, tmpbuf, fdctrl->data_pos, len);
     
    25792579     */
    25802580    rc = PDMDevHlpDriverAttach (pDevIns, drv->iLUN, &drv->IBase, &drv->pDrvBase, descs[drv->iLUN]);
    2581     if (VBOX_SUCCESS (rc)) {
     2581    if (RT_SUCCESS (rc)) {
    25822582        drv->pDrvBlock = drv->pDrvBase->pfnQueryInterface (
    25832583            drv->pDrvBase,
     
    26872687    AssertMsg (rc != VERR_PDM_NO_ATTACHED_DRIVER,
    26882688               ("Configuration error: failed to configure drive %d, rc=%Vrc\n", rc));
    2689     if (VBOX_SUCCESS(rc)) {
     2689    if (RT_SUCCESS(rc)) {
    26902690        fd_revalidate (drv);
    26912691    }
     
    28992899     */
    29002900    rc = PDMDevHlpDriverAttach (pDevIns, PDM_STATUS_LUN, &fdctrl->IBaseStatus, &pBase, "Status Port");
    2901     if (VBOX_SUCCESS (rc)) {
     2901    if (RT_SUCCESS (rc)) {
    29022902        fdctrl->pLedsConnector =
    29032903            pBase->pfnQueryInterface (pBase, PDMINTERFACE_LED_CONNECTORS);
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r9662 r11266  
    782782                    uint32_t mappingsSize;
    783783                    pRequestHeader->rc = PGMR3MappingsSize(pVM, &mappingsSize);
    784                     if (VBOX_SUCCESS(pRequestHeader->rc) && hypervisorInfo->hypervisorSize == mappingsSize)
     784                    if (RT_SUCCESS(pRequestHeader->rc) && hypervisorInfo->hypervisorSize == mappingsSize)
    785785                    {
    786786                        /* new reservation */
     
    11571157
    11581158                    if (   ptr->u32Enable
    1159                         && VBOX_SUCCESS (pRequestHeader->rc))
     1159                        && RT_SUCCESS (pRequestHeader->rc))
    11601160                    {
    11611161                        ptr->fu32Status |= VBVA_F_STATUS_ENABLED;
     
    21582158    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    21592159        pData->fGetHostTimeDisabled = false;
    2160     else if (VBOX_FAILURE(rc))
     2160    else if (RT_FAILURE(rc))
    21612161        return PDMDEV_SET_ERROR(pDevIns, rc,
    21622162                                N_("Configuration error: Failed querying \"GetHostTimeDisabled\" as a boolean"));
     
    21652165    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    21662166        pData->fBackdoorLogDisabled = false;
    2167     else if (VBOX_FAILURE(rc))
     2167    else if (RT_FAILURE(rc))
    21682168        return PDMDEV_SET_ERROR(pDevIns, rc,
    21692169                                N_("Configuration error: Failed querying \"BackdoorLogDisabled\" as a boolean"));
     
    21722172    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    21732173        pData->fKeepCredentials = false;
    2174     else if (VBOX_FAILURE(rc))
     2174    else if (RT_FAILURE(rc))
    21752175        return PDMDEV_SET_ERROR(pDevIns, rc,
    21762176                                N_("Configuration error: Failed querying \"KeepCredentials\" as a boolean"));
     
    22552255     */
    22562256    rc = PDMDevHlpPCIRegister(pDevIns, &pData->dev);
    2257     if (VBOX_FAILURE(rc))
     2257    if (RT_FAILURE(rc))
    22582258        return rc;
    22592259    if (pData->dev.devfn == 32 || iInstance != 0)
    22602260        Log(("!!WARNING!!: pData->dev.devfn=%d (ignore if testcase or no started by Main)\n", pData->dev.devfn));
    22612261    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x20, PCI_ADDRESS_SPACE_IO, vmmdevIOPortRegionMap);
    2262     if (VBOX_FAILURE(rc))
     2262    if (RT_FAILURE(rc))
    22632263        return rc;
    22642264    rc = PDMDevHlpPCIIORegionRegister(pDevIns, 1, VMMDEV_RAM_SIZE, PCI_ADDRESS_SPACE_MEM, vmmdevIORAMRegionMap);
    2265     if (VBOX_FAILURE(rc))
     2265    if (RT_FAILURE(rc))
    22662266        return rc;
    22672267
     
    22702270     */
    22712271    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pData->Base, &pData->pDrvBase, "VMM Driver Port");
    2272     if (VBOX_SUCCESS(rc))
     2272    if (RT_SUCCESS(rc))
    22732273    {
    22742274        pData->pDrv = (PPDMIVMMDEVCONNECTOR)pData->pDrvBase->pfnQueryInterface(pData->pDrvBase, PDMINTERFACE_VMMDEV_CONNECTOR);
     
    22972297    PPDMIBASE pBase;
    22982298    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pData->Base, &pBase, "Status Port");
    2299     if (VBOX_SUCCESS(rc))
     2299    if (RT_SUCCESS(rc))
    23002300        pData->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)
    23012301            pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
  • trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp

    r9662 r11266  
    5050    /* Index of the parameter. */
    5151    int iParm;
    52    
     52
    5353    /* Offset in the first physical page of the region. */
    5454    size_t cbOffsetFirstPage;
    55    
     55
    5656    /* How many pages. */
    5757    uint32_t cPages;
    58    
    59     /* Pointer to array of the GC physical addresses for these pages. 
     58
     59    /* Pointer to array of the GC physical addresses for these pages.
    6060     * It is assumed that the physical address of the locked resident
    6161     * guest page does not change.
    6262     */
    6363    RTGCPHYS *paPages;
    64    
     64
    6565} VBOXHGCMLINPTR;
    6666
     
    111111
    112112    int rc = vmmdevHGCMCmdListLock (pVMMDevState);
    113    
    114     if (VBOX_SUCCESS (rc))
     113
     114    if (RT_SUCCESS (rc))
    115115    {
    116116        LogFlowFunc(("%p type %d\n", pCmd, enmCmdType));
     
    119119        pCmd->pNext = pVMMDevState->pHGCMCmdList;
    120120        pCmd->pPrev = NULL;
    121        
     121
    122122        if (pVMMDevState->pHGCMCmdList)
    123123        {
    124124            pVMMDevState->pHGCMCmdList->pPrev = pCmd;
    125125        }
    126        
     126
    127127        pVMMDevState->pHGCMCmdList = pCmd;
    128        
     128
    129129        pCmd->enmCmdType = enmCmdType;
    130130        pCmd->GCPhys = GCPhys;
    131131        pCmd->cbSize = cbSize;
    132        
     132
    133133        /* Automatically enable HGCM events, if there are HGCM commands. */
    134134        if (   enmCmdType == VBOXHGCMCMDTYPE_CONNECT
     
    145145        vmmdevHGCMCmdListUnlock (pVMMDevState);
    146146    }
    147    
     147
    148148    return rc;
    149149}
     
    154154
    155155    int rc = vmmdevHGCMCmdListLock (pVMMDevState);
    156    
    157     if (VBOX_SUCCESS (rc))
     156
     157    if (RT_SUCCESS (rc))
    158158    {
    159159        LogFlowFunc(("%p\n", pCmd));
     
    167167           /* Tail, do nothing. */
    168168        }
    169        
     169
    170170        if (pCmd->pPrev)
    171171        {
     
    179179        vmmdevHGCMCmdListUnlock (pVMMDevState);
    180180    }
    181    
     181
    182182    return rc;
    183183}
     
    189189
    190190    int rc = vmmdevHGCMCmdListLock (pVMMDevState);
    191    
    192     if (VBOX_SUCCESS (rc))
     191
     192    if (RT_SUCCESS (rc))
    193193    {
    194194        pCmd = pVMMDevState->pHGCMCmdList;
     
    205205        vmmdevHGCMCmdListUnlock (pVMMDevState);
    206206    }
    207    
     207
    208208    LogFlowFunc(("%p\n", pCmd));
    209209    return pCmd;
     
    220220{
    221221    int rc = VINF_SUCCESS;
    222    
     222
    223223    AssertRelease (u32Size > 0);
    224    
     224
    225225    VBOXHGCMLINPTR *pLinPtr = &paLinPtrs[iLinPtr];
    226    
     226
    227227    /* Take the offset into the current page also into account! */
    228228    u32Size += GCPtr & PAGE_OFFSET_MASK;
    229229
    230230    uint32_t cPages = (u32Size + PAGE_SIZE - 1) / PAGE_SIZE;
    231    
     231
    232232    Log(("vmmdevHGCMSaveLinPtr: parm %d: %VGv %d = %d pages\n", iParm, GCPtr, u32Size, cPages));
    233    
     233
    234234    pLinPtr->iParm             = iParm;
    235235    pLinPtr->cbOffsetFirstPage = (RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK;
    236236    pLinPtr->cPages            = cPages;
    237237    pLinPtr->paPages           = *ppPages;
    238    
     238
    239239    *ppPages += cPages;
    240    
     240
    241241    uint32_t iPage = 0;
    242    
     242
    243243    GCPtr &= PAGE_BASE_GC_MASK;
    244    
     244
    245245    /* Gonvert the guest linear pointers of pages to HC addresses. */
    246246    while (iPage < cPages)
     
    248248        /* convert */
    249249        RTGCPHYS GCPhys;
    250        
     250
    251251        rc = PDMDevHlpPhysGCPtr2GCPhys(pDevIns, GCPtr, &GCPhys);
    252        
     252
    253253        Log(("vmmdevHGCMSaveLinPtr: Page %d: %VGv -> %VGp. %Vrc\n", iPage, GCPtr, GCPhys, rc));
    254    
    255         if (VBOX_FAILURE (rc))
     254
     255        if (RT_FAILURE (rc))
    256256        {
    257257            break;
     
    264264        GCPtr += PAGE_SIZE;
    265265    }
    266    
     266
    267267    AssertRelease (iPage == cPages);
    268    
     268
    269269    return rc;
    270270}
     
    278278{
    279279    int rc = VINF_SUCCESS;
    280    
     280
    281281    VBOXHGCMLINPTR *pLinPtr = &paLinPtrs[iLinPtr];
    282    
     282
    283283    AssertRelease (u32Size > 0 && iParm == (uint32_t)pLinPtr->iParm);
    284    
     284
    285285    RTGCPHYS GCPhysDst = pLinPtr->paPages[0] + pLinPtr->cbOffsetFirstPage;
    286286    uint8_t *pu8Src    = (uint8_t *)pvHost;
    287    
     287
    288288    Log(("vmmdevHGCMWriteLinPtr: parm %d: size %d, cPages = %d\n", iParm, u32Size, pLinPtr->cPages));
    289    
     289
    290290    uint32_t iPage = 0;
    291    
     291
    292292    while (iPage < pLinPtr->cPages)
    293293    {
     
    296296                             PAGE_SIZE - pLinPtr->cbOffsetFirstPage:
    297297                             PAGE_SIZE;
    298                              
     298
    299299        Log(("vmmdevHGCMWriteLinPtr: page %d: dst %VGp, src %p, cbWrite %d\n", iPage, GCPhysDst, pu8Src, cbWrite));
    300        
     300
    301301        iPage++;
    302        
     302
    303303        if (cbWrite >= u32Size)
    304304        {
     
    307307            break;
    308308        }
    309        
     309
    310310        PDMDevHlpPhysWrite(pDevIns, GCPhysDst, pu8Src, cbWrite);
    311311
     
    313313        u32Size    -= cbWrite;
    314314        pu8Src     += cbWrite;
    315        
     315
    316316        GCPhysDst   = pLinPtr->paPages[iPage];
    317317    }
    318    
     318
    319319    AssertRelease (iPage == pLinPtr->cPages);
    320320    Assert(u32Size == 0);
    321    
     321
    322322    return rc;
    323323}
     
    332332    {
    333333        VMMDevHGCMConnect *pHGCMConnectCopy = (VMMDevHGCMConnect *)(pCmd+1);
    334        
     334
    335335        vmmdevHGCMAddCommand (pVMMDevState, pCmd, GCPhys, pHGCMConnect->header.header.size, VBOXHGCMCMDTYPE_CONNECT);
    336336
     
    417417
    418418        /* Look for pointer parameters, which require a host buffer. */
    419         for (i = 0; i < cParms && VBOX_SUCCESS(rc); i++, pGuestParm++)
     419        for (i = 0; i < cParms && RT_SUCCESS(rc); i++, pGuestParm++)
    420420        {
    421421            switch (pGuestParm->type)
     
    426426                {
    427427                    cbCmdSize += pGuestParm->u.Pointer.size;
    428                
     428
    429429                    if (pGuestParm->type != VMMDevHGCMParmType_LinAddr_In)
    430430                    {
     
    434434                                          + pGuestParm->u.Pointer.size + PAGE_SIZE - 1) / PAGE_SIZE;
    435435                    }
    436                
     436
    437437                    Log(("vmmdevHGCMCall: linptr size = %d\n", pGuestParm->u.Pointer.size));
    438438                } break;
     
    462462
    463463        /* Look for pointer parameters, which require a host buffer. */
    464         for (i = 0; i < cParms && VBOX_SUCCESS(rc); i++, pGuestParm++)
     464        for (i = 0; i < cParms && RT_SUCCESS(rc); i++, pGuestParm++)
    465465        {
    466466            switch (pGuestParm->type)
     
    471471                {
    472472                    cbCmdSize += pGuestParm->u.Pointer.size;
    473                
     473
    474474                    if (pGuestParm->type != VMMDevHGCMParmType_LinAddr_In)
    475475                    {
     
    479479                                          + pGuestParm->u.Pointer.size + PAGE_SIZE - 1) / PAGE_SIZE;
    480480                    }
    481                
     481
    482482                    Log(("vmmdevHGCMCall: linptr size = %d\n", pGuestParm->u.Pointer.size));
    483483                } break;
     
    499499    }
    500500
    501     if (VBOX_FAILURE (rc))
     501    if (RT_FAILURE (rc))
    502502    {
    503503        return rc;
     
    512512
    513513    memset (pCmd, 0, sizeof (*pCmd));
    514    
     514
    515515    pCmd->paHostParms = NULL;
    516516    pCmd->cLinPtrs    = cLinPtrs;
    517    
     517
    518518    if (cLinPtrs > 0)
    519519    {
    520520        pCmd->paLinPtrs = (VBOXHGCMLINPTR *)RTMemAlloc (  sizeof (VBOXHGCMLINPTR) * cLinPtrs
    521521                                                          + sizeof (RTGCPHYS) * cLinPtrPages);
    522    
     522
    523523        if (pCmd->paLinPtrs == NULL)
    524524        {
     
    541541        /* Compute addresses of host parms array and first memory buffer. */
    542542        VBOXHGCMSVCPARM *pHostParm = (VBOXHGCMSVCPARM *)((char *)pCmd + sizeof (struct VBOXHGCMCMD));
    543        
     543
    544544        uint8_t *pcBuf = (uint8_t *)pHostParm + cParms * sizeof (VBOXHGCMSVCPARM);
    545545
     
    559559
    560560
    561             for (i = 0; i < cParms && VBOX_SUCCESS(rc); i++, pGuestParm++, pHostParm++)
     561            for (i = 0; i < cParms && RT_SUCCESS(rc); i++, pGuestParm++, pHostParm++)
    562562            {
    563563                switch (pGuestParm->type)
     
    572572                         Log(("vmmdevHGCMCall: uint32 guest parameter %u\n", u32));
    573573                         break;
    574                      } 
     574                     }
    575575
    576576                     case VMMDevHGCMParmType_64bit:
     
    583583                         Log(("vmmdevHGCMCall: uint64 guest parameter %llu\n", u64));
    584584                         break;
    585                      } 
     585                     }
    586586
    587587                     case VMMDevHGCMParmType_PhysAddr:
     
    600600                         Log(("vmmdevHGCMCall: PhysAddr guest parameter %VGp\n", physAddr));
    601601                         break;
    602                      } 
     602                     }
    603603
    604604                     case VMMDevHGCMParmType_LinAddr_In:  /* In (read) */
     
    628628                                 rc = VINF_SUCCESS;
    629629
    630                              if (VBOX_SUCCESS(rc))
     630                             if (RT_SUCCESS(rc))
    631631                             {
    632632                                 pHostParm->u.pointer.addr = pcBuf;
    633633                                 pcBuf += size;
    634                              
     634
    635635                                 if (pGuestParm->type != VMMDevHGCMParmType_LinAddr_In)
    636636                                 {
    637                                      /* Remember the guest physical pages that belong to the virtual address 
     637                                     /* Remember the guest physical pages that belong to the virtual address
    638638                                      * region.
    639639                                      */
     
    661661#endif /* VBOX_WITH_64_BITS_GUESTS */
    662662
    663             for (i = 0; i < cParms && VBOX_SUCCESS(rc); i++, pGuestParm++, pHostParm++)
     663            for (i = 0; i < cParms && RT_SUCCESS(rc); i++, pGuestParm++, pHostParm++)
    664664            {
    665665                switch (pGuestParm->type)
     
    674674                         Log(("vmmdevHGCMCall: uint32 guest parameter %u\n", u32));
    675675                         break;
    676                      } 
     676                     }
    677677
    678678                     case VMMDevHGCMParmType_64bit:
     
    685685                         Log(("vmmdevHGCMCall: uint64 guest parameter %llu\n", u64));
    686686                         break;
    687                      } 
     687                     }
    688688
    689689                     case VMMDevHGCMParmType_PhysAddr:
     
    702702                         Log(("vmmdevHGCMCall: PhysAddr guest parameter %VGp\n", physAddr));
    703703                         break;
    704                      } 
     704                     }
    705705
    706706                     case VMMDevHGCMParmType_LinAddr_In:  /* In (read) */
     
    730730                                 rc = VINF_SUCCESS;
    731731
    732                              if (VBOX_SUCCESS(rc))
     732                             if (RT_SUCCESS(rc))
    733733                             {
    734734                                 pHostParm->u.pointer.addr = pcBuf;
    735735                                 pcBuf += size;
    736                              
     736
    737737                                 if (pGuestParm->type != VMMDevHGCMParmType_LinAddr_In)
    738738                                 {
    739                                      /* Remember the guest physical pages that belong to the virtual address 
     739                                     /* Remember the guest physical pages that belong to the virtual address
    740740                                      * region.
    741741                                      */
     
    757757    }
    758758
    759     if (VBOX_SUCCESS (rc))
     759    if (RT_SUCCESS (rc))
    760760    {
    761761        vmmdevHGCMAddCommand (pVMMDevState, pCmd, GCPhys, pHGCMCall->header.header.size, VBOXHGCMCMDTYPE_CALL);
     
    770770            RTMemFree (pCmd->paLinPtrs);
    771771        }
    772        
     772
    773773        RTMemFree (pCmd);
    774774    }
     
    901901        /* Setup return codes. */
    902902        pHeader->result = result;
    903        
     903
    904904        /* Verify the request type. */
    905905        rc = vmmdevHGCMCmdVerify (pCmd, pHeader);
    906906
    907         if (VBOX_SUCCESS (rc))
     907        if (RT_SUCCESS (rc))
    908908        {
    909909            /* Update parameters and data buffers. */
    910            
     910
    911911            switch (pHeader->header.requestType)
    912912            {
     
    11281128        RTMemFree (pCmd->paLinPtrs);
    11291129    }
    1130        
     1130
    11311131    RTMemFree (pCmd);
    11321132
     
    12421242    int rc = vmmdevHGCMCmdListLock (pVMMDevState);
    12431243
    1244     if (VBOX_SUCCESS (rc))
     1244    if (RT_SUCCESS (rc))
    12451245    {
    12461246        PVBOXHGCMCMD pIter = pVMMDevState->pHGCMCmdList;
     
    13741374        vmmdevHGCMCmdListUnlock (pVMMDevState);
    13751375    }
    1376    
     1376
    13771377    return rc;
    13781378}
  • trunk/src/VBox/Devices/vl_vbox.h

    r8155 r11266  
    125125{
    126126    int rc = SSMR3GetMem(f, buf, size);
    127     return VBOX_SUCCESS(rc) ? size : 0;
     127    return RT_SUCCESS(rc) ? size : 0;
    128128}
    129129
     
    132132    uint8_t u8;
    133133    int rc = SSMR3GetU8(f, &u8);
    134     return VBOX_SUCCESS(rc) ? (int)u8 : -1;
     134    return RT_SUCCESS(rc) ? (int)u8 : -1;
    135135}
    136136
     
    139139    uint16_t u16;
    140140    int rc = SSMR3GetU16(f, &u16);
    141     return VBOX_SUCCESS(rc) ? u16 : ~0;
     141    return RT_SUCCESS(rc) ? u16 : ~0;
    142142}
    143143
     
    146146    uint32_t u32;
    147147    int rc = SSMR3GetU32(f, &u32);
    148     return VBOX_SUCCESS(rc) ? u32 : ~0;
     148    return RT_SUCCESS(rc) ? u32 : ~0;
    149149}
    150150
     
    153153    uint64_t u64;
    154154    int rc = SSMR3GetU64(f, &u64);
    155     return VBOX_SUCCESS(rc) ? u64 : ~0;
     155    return RT_SUCCESS(rc) ? u64 : ~0;
    156156}
    157157
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