VirtualBox

Changeset 14972 in vbox


Ignore:
Timestamp:
Dec 4, 2008 12:10:37 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40340
Message:

#3285: Improve error handling API to include unique error numbers

The mega commit that implements Main-wide usage of new CheckCom*
macros, mostly CheckComArgNotNull, CheckComArgStrNotEmptyOrNull,
CheckComArgOutSafeArrayPointerValid, CheckComArgExpr.
Note that some methods incorrectly returned E_INVALIDARG where they
should have returned E_POINTER and vice versa. If any higher level
function tests these, they will behave differently now...

Special thanks to: vi macros, making it easy to semi-automatically
find and replace several hundred instances of if (!aName) ...

Location:
trunk/src/VBox/Main
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r14959 r14972  
    161161STDMETHODIMP AudioAdapter::COMGETTER(Enabled)(BOOL *aEnabled)
    162162{
    163     if (!aEnabled)
    164         return E_POINTER;
     163    CheckComArgOutPointerValid(aEnabled);
    165164
    166165    AutoCaller autoCaller (this);
     
    196195STDMETHODIMP AudioAdapter::COMGETTER(AudioDriver)(AudioDriverType_T *aAudioDriver)
    197196{
    198     if (!aAudioDriver)
    199         return E_POINTER;
     197    CheckComArgOutPointerValid(aAudioDriver);
    200198
    201199    AutoCaller autoCaller (this);
     
    274272STDMETHODIMP AudioAdapter::COMGETTER(AudioController)(AudioControllerType_T *aAudioController)
    275273{
    276     if (!aAudioController)
    277         return E_POINTER;
     274    CheckComArgOutPointerValid(aAudioController);
    278275
    279276    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/BIOSSettingsImpl.cpp

    r14959 r14972  
    412412STDMETHODIMP BIOSSettings::COMGETTER(IDEControllerType)(IDEControllerType_T *aControllerType)
    413413{
    414     if (!aControllerType)
    415         return E_POINTER;
     414    CheckComArgOutPointerValid(aControllerType);
    416415
    417416    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r14959 r14972  
    11601160STDMETHODIMP Console::COMGETTER(Machine) (IMachine **aMachine)
    11611161{
    1162     if (!aMachine)
    1163         return E_POINTER;
     1162    CheckComArgOutPointerValid(aMachine);
    11641163
    11651164    AutoCaller autoCaller (this);
     
    11741173STDMETHODIMP Console::COMGETTER(State) (MachineState_T *aMachineState)
    11751174{
    1176     if (!aMachineState)
    1177         return E_POINTER;
     1175    CheckComArgOutPointerValid(aMachineState);
    11781176
    11791177    AutoCaller autoCaller (this);
     
    11901188STDMETHODIMP Console::COMGETTER(Guest) (IGuest **aGuest)
    11911189{
    1192     if (!aGuest)
    1193         return E_POINTER;
     1190    CheckComArgOutPointerValid(aGuest);
    11941191
    11951192    AutoCaller autoCaller (this);
     
    12041201STDMETHODIMP Console::COMGETTER(Keyboard) (IKeyboard **aKeyboard)
    12051202{
    1206     if (!aKeyboard)
    1207         return E_POINTER;
     1203    CheckComArgOutPointerValid(aKeyboard);
    12081204
    12091205    AutoCaller autoCaller (this);
     
    12181214STDMETHODIMP Console::COMGETTER(Mouse) (IMouse **aMouse)
    12191215{
    1220     if (!aMouse)
    1221         return E_POINTER;
     1216    CheckComArgOutPointerValid(aMouse);
    12221217
    12231218    AutoCaller autoCaller (this);
     
    12321227STDMETHODIMP Console::COMGETTER(Display) (IDisplay **aDisplay)
    12331228{
    1234     if (!aDisplay)
    1235         return E_POINTER;
     1229    CheckComArgOutPointerValid(aDisplay);
    12361230
    12371231    AutoCaller autoCaller (this);
     
    12461240STDMETHODIMP Console::COMGETTER(Debugger) (IMachineDebugger **aDebugger)
    12471241{
    1248     if (!aDebugger)
    1249         return E_POINTER;
     1242    CheckComArgOutPointerValid(aDebugger);
    12501243
    12511244    AutoCaller autoCaller (this);
     
    12691262STDMETHODIMP Console::COMGETTER(USBDevices) (IUSBDeviceCollection **aUSBDevices)
    12701263{
    1271     if (!aUSBDevices)
    1272         return E_POINTER;
     1264    CheckComArgOutPointerValid(aUSBDevices);
    12731265
    12741266    AutoCaller autoCaller (this);
     
    12871279STDMETHODIMP Console::COMGETTER(RemoteUSBDevices) (IHostUSBDeviceCollection **aRemoteUSBDevices)
    12881280{
    1289     if (!aRemoteUSBDevices)
    1290         return E_POINTER;
     1281    CheckComArgOutPointerValid(aRemoteUSBDevices);
    12911282
    12921283    AutoCaller autoCaller (this);
     
    13051296STDMETHODIMP Console::COMGETTER(RemoteDisplayInfo) (IRemoteDisplayInfo **aRemoteDisplayInfo)
    13061297{
    1307     if (!aRemoteDisplayInfo)
    1308         return E_POINTER;
     1298    CheckComArgOutPointerValid(aRemoteDisplayInfo);
    13091299
    13101300    AutoCaller autoCaller (this);
     
    13201310Console::COMGETTER(SharedFolders) (ISharedFolderCollection **aSharedFolders)
    13211311{
    1322     if (!aSharedFolders)
    1323         return E_POINTER;
     1312    CheckComArgOutPointerValid(aSharedFolders);
    13241313
    13251314    AutoCaller autoCaller (this);
     
    16021591    LogFlowThisFuncEnter();
    16031592
    1604     if (!aHandled)
    1605         return E_POINTER;
     1593    CheckComArgOutPointerValid(aHandled);
    16061594
    16071595    *aHandled = FALSE;
     
    16451633    LogFlowThisFuncEnter();
    16461634
    1647     if (!aEntered)
    1648         return E_POINTER;
     1635    CheckComArgOutPointerValid(aEntered);
    16491636
    16501637    *aEntered = FALSE;
     
    17221709    LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
    17231710
    1724     if (!aProgress)
    1725         return E_POINTER;
     1711    CheckComArgOutPointerValid(aProgress);
    17261712
    17271713    AutoCaller autoCaller (this);
     
    18621848STDMETHODIMP Console::AdoptSavedState (INPTR BSTR aSavedStateFile)
    18631849{
    1864     if (!aSavedStateFile)
    1865         return E_INVALIDARG;
     1850    CheckComArgNotNull(aSavedStateFile);
    18661851
    18671852    AutoCaller autoCaller (this);
     
    19151900                                         DeviceActivity_T *aDeviceActivity)
    19161901{
    1917     if (!aDeviceActivity)
    1918         return E_INVALIDARG;
     1902    CheckComArgNotNull(aDeviceActivity);
    19191903
    19201904    AutoCaller autoCaller (this);
     
    20562040{
    20572041#ifdef VBOX_WITH_USB
    2058     if (!aDevice)
    2059         return E_POINTER;
     2042    CheckComArgOutPointerValid(aDevice);
    20602043
    20612044    AutoCaller autoCaller (this);
     
    21172100Console::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable)
    21182101{
    2119     if (!aName || !aHostPath)
    2120         return E_INVALIDARG;
     2102    CheckComArgNotNull(aName);
     2103    CheckComArgNotNull(aHostPath);
    21212104
    21222105    AutoCaller autoCaller (this);
     
    21892172STDMETHODIMP Console::RemoveSharedFolder (INPTR BSTR aName)
    21902173{
    2191     if (!aName)
    2192         return E_INVALIDARG;
     2174    CheckComArgNotNull(aName);
    21932175
    21942176    AutoCaller autoCaller (this);
     
    22522234    LogFlowThisFunc (("aName='%ls' mMachineState=%08X\n", aName, mMachineState));
    22532235
    2254     if (!aName)
    2255         return E_INVALIDARG;
    2256     if (!aProgress)
    2257         return E_POINTER;
     2236    CheckComArgNotNull(aName);
     2237    CheckComArgOutPointerValid(aProgress);
    22582238
    22592239    AutoCaller autoCaller (this);
     
    24232403STDMETHODIMP Console::DiscardSnapshot (INPTR GUIDPARAM aId, IProgress **aProgress)
    24242404{
    2425     if (Guid (aId).isEmpty())
    2426         return E_INVALIDARG;
    2427     if (!aProgress)
    2428         return E_POINTER;
     2405    CheckComArgExpr(aId, Guid (aId).isEmpty() == false);
     2406    CheckComArgOutPointerValid(aProgress);
    24292407
    24302408    AutoCaller autoCaller (this);
     
    24922470STDMETHODIMP Console::RegisterCallback (IConsoleCallback *aCallback)
    24932471{
    2494     if (!aCallback)
    2495         return E_INVALIDARG;
     2472    CheckComArgNotNull(aCallback);
    24962473
    24972474    AutoCaller autoCaller (this);
     
    25342511STDMETHODIMP Console::UnregisterCallback (IConsoleCallback *aCallback)
    25352512{
    2536     if (!aCallback)
    2537         return E_INVALIDARG;
     2513    CheckComArgNotNull(aCallback);
    25382514
    25392515    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/DVDDriveImpl.cpp

    r14959 r14972  
    194194STDMETHODIMP DVDDrive::COMGETTER(State) (DriveState_T *aState)
    195195{
    196     if (!aState)
    197         return E_POINTER;
     196    CheckComArgOutPointerValid(aState);
    198197
    199198    AutoCaller autoCaller (this);
     
    209208STDMETHODIMP DVDDrive::COMGETTER(Passthrough) (BOOL *aPassthrough)
    210209{
    211     if (!aPassthrough)
    212         return E_POINTER;
     210    CheckComArgOutPointerValid(aPassthrough);
    213211
    214212    AutoCaller autoCaller (this);
     
    297295STDMETHODIMP DVDDrive::CaptureHostDrive (IHostDVDDrive *aHostDVDDrive)
    298296{
    299     if (!aHostDVDDrive)
    300         return E_INVALIDARG;
     297    CheckComArgNotNull(aHostDVDDrive);
    301298
    302299    AutoCaller autoCaller (this);
     
    358355STDMETHODIMP DVDDrive::GetImage (IDVDImage2 **aDVDImage)
    359356{
    360     if (!aDVDImage)
    361         return E_POINTER;
     357    CheckComArgOutPointerValid(aDVDImage);
    362358
    363359    AutoCaller autoCaller (this);
     
    373369STDMETHODIMP DVDDrive::GetHostDrive(IHostDVDDrive **aHostDrive)
    374370{
    375     if (!aHostDrive)
    376         return E_POINTER;
     371    CheckComArgOutPointerValid(aHostDrive);
    377372
    378373    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r14942 r14972  
    14601460    LogFlowFunc (("\n"));
    14611461
    1462     if (!aFramebuffer)
    1463         return E_POINTER;
     1462    CheckComArgOutPointerValid(aFramebuffer);
    14641463
    14651464    AutoCaller autoCaller (this);
     
    15011500    LogFlowFunc (("aScreenId = %d\n", aScreenId));
    15021501
    1503     if (!aFramebuffer)
    1504         return E_POINTER;
     1502    CheckComArgOutPointerValid(aFramebuffer);
    15051503
    15061504    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/FloppyDriveImpl.cpp

    r14959 r14972  
    194194STDMETHODIMP FloppyDrive::COMGETTER(Enabled) (BOOL *aEnabled)
    195195{
    196     if (!aEnabled)
    197         return E_POINTER;
     196    CheckComArgOutPointerValid(aEnabled);
    198197
    199198    AutoCaller autoCaller (this);
     
    236235STDMETHODIMP FloppyDrive::COMGETTER(State) (DriveState_T *aState)
    237236{
    238     if (!aState)
    239         return E_POINTER;
     237    CheckComArgOutPointerValid(aState);
    240238
    241239    AutoCaller autoCaller (this);
     
    304302STDMETHODIMP FloppyDrive::CaptureHostDrive (IHostFloppyDrive *aHostFloppyDrive)
    305303{
    306     if (!aHostFloppyDrive)
    307         return E_INVALIDARG;
     304    CheckComArgNotNull(aHostFloppyDrive);
    308305
    309306    AutoCaller autoCaller (this);
     
    365362STDMETHODIMP FloppyDrive::GetImage (IFloppyImage2 **aFloppyImage)
    366363{
    367     if (!aFloppyImage)
    368         return E_POINTER;
     364    CheckComArgOutPointerValid(aFloppyImage);
    369365
    370366    AutoCaller autoCaller (this);
     
    380376STDMETHODIMP FloppyDrive::GetHostDrive (IHostFloppyDrive **aHostDrive)
    381377{
    382     if (!aHostDrive)
    383         return E_POINTER;
     378    CheckComArgOutPointerValid(aHostDrive);
    384379
    385380    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/FramebufferImpl.cpp

    r14942 r14972  
    5959STDMETHODIMP InternalFramebuffer::COMGETTER(Address) (BYTE **address)
    6060{
    61     if (!address)
    62         return E_POINTER;
     61    CheckComArgOutPointerValid(address);
    6362    *address = mData;
    6463    return S_OK;
     
    6766STDMETHODIMP InternalFramebuffer::COMGETTER(Width) (ULONG *width)
    6867{
    69     if (!width)
    70         return E_POINTER;
     68    CheckComArgOutPointerValid(width);
    7169    *width = mWidth;
    7270    return S_OK;
     
    7573STDMETHODIMP InternalFramebuffer::COMGETTER(Height) (ULONG *height)
    7674{
    77     if (!height)
    78         return E_POINTER;
     75    CheckComArgOutPointerValid(height);
    7976    *height = mHeight;
    8077    return S_OK;
     
    8380STDMETHODIMP InternalFramebuffer::COMGETTER(BitsPerPixel) (ULONG *bitsPerPixel)
    8481{
    85     if (!bitsPerPixel)
    86         return E_POINTER;
     82    CheckComArgOutPointerValid(bitsPerPixel);
    8783    *bitsPerPixel = mBitsPerPixel;
    8884    return S_OK;
     
    9187STDMETHODIMP InternalFramebuffer::COMGETTER(BytesPerLine) (ULONG *bytesPerLine)
    9288{
    93     if (!bytesPerLine)
    94         return E_POINTER;
     89    CheckComArgOutPointerValid(bytesPerLine);
    9590    *bytesPerLine = mBytesPerLine;
    9691    return S_OK;
     
    9994STDMETHODIMP InternalFramebuffer::COMGETTER(PixelFormat) (ULONG *pixelFormat)
    10095{
    101     if (!pixelFormat)
    102         return E_POINTER;
     96    CheckComArgOutPointerValid(pixelFormat);
    10397    *pixelFormat = FramebufferPixelFormat_FOURCC_RGB;
    10498    return S_OK;
     
    107101STDMETHODIMP InternalFramebuffer::COMGETTER(UsesGuestVRAM) (BOOL *usesGuestVRAM)
    108102{
    109     if (!usesGuestVRAM)
    110         return E_POINTER;
     103    CheckComArgOutPointerValid(usesGuestVRAM);
    111104    *usesGuestVRAM = FALSE;
    112105    return S_OK;
     
    115108STDMETHODIMP InternalFramebuffer::COMGETTER(HeightReduction) (ULONG *heightReduction)
    116109{
    117     if (!heightReduction)
    118         return E_POINTER;
     110    CheckComArgOutPointerValid(heightReduction);
    119111    /* no reduction */
    120112    *heightReduction = 0;
     
    124116STDMETHODIMP InternalFramebuffer::COMGETTER(Overlay) (IFramebufferOverlay **aOverlay)
    125117{
    126     if (!aOverlay)
    127         return E_POINTER;
     118    CheckComArgOutPointerValid(aOverlay);
    128119    /* no overlay */
    129120    *aOverlay = 0;
     
    133124STDMETHODIMP InternalFramebuffer::COMGETTER(WinId) (ULONG64 *winId)
    134125{
    135     if (!winId)
    136         return E_POINTER;
     126    CheckComArgOutPointerValid(winId);
    137127    *winId = 0;
    138128    return S_OK;
     
    158148                                               BOOL *finished)
    159149{
    160     if (!finished)
    161         return E_POINTER;
     150    CheckComArgOutPointerValid(finished);
    162151    // no need for the caller to wait
    163152    *finished = true;
     
    173162    NOREF (bpl);
    174163
    175     if (!finished)
    176         return E_POINTER;
     164    CheckComArgOutPointerValid(finished);
    177165    // no need for the caller to wait
    178166    *finished = true;
     
    192180                                                     BOOL *supported)
    193181{
    194     if (!supported)
    195         return E_POINTER;
     182    CheckComArgOutPointerValid(supported);
    196183    /* no acceleration please, we're a slow fallback implementation! */
    197184    *supported = false;
     
    202189                                                     BOOL *supported)
    203190{
    204     if (!supported)
    205         return E_POINTER;
     191    CheckComArgOutPointerValid(supported);
    206192    /* whatever you want! */
    207193    *supported = true;
     
    212198                                             ULONG color, BOOL *handled)
    213199{
    214     if (!handled)
    215         return E_POINTER;
     200    CheckComArgOutPointerValid(handled);
    216201    /* eek, what do you expect from us?! */
    217202    *handled = false;
     
    222207                                                 ULONG width, ULONG height, BOOL *handled)
    223208{
    224     if (!handled)
    225         return E_POINTER;
     209    CheckComArgOutPointerValid(handled);
    226210    /* eek, what do you expect from us?! */
    227211    *handled = false;
     
    232216                                                   ULONG *aCountCopied)
    233217{
     218    CheckComArgOutPointerValid(aRectangles);
     219
    234220    PRTRECT rects = (PRTRECT)aRectangles;
    235 
    236     if (!rects)
    237         return E_POINTER;
    238221
    239222    /// @todo
     
    248231STDMETHODIMP InternalFramebuffer::SetVisibleRegion(BYTE *aRectangles, ULONG aCount)
    249232{
     233    CheckComArgOutPointerValid(aRectangles);
     234
    250235    PRTRECT rects = (PRTRECT)aRectangles;
    251 
    252     if (!rects)
    253         return E_POINTER;
    254236
    255237    /// @todo
  • trunk/src/VBox/Main/GuestImpl.cpp

    r14772 r14972  
    118118STDMETHODIMP Guest::COMGETTER(OSTypeId) (BSTR *aOSTypeId)
    119119{
    120     if (!aOSTypeId)
    121         return E_POINTER;
     120    CheckComArgOutPointerValid(aOSTypeId);
    122121
    123122    AutoCaller autoCaller (this);
     
    137136STDMETHODIMP Guest::COMGETTER(AdditionsActive) (BOOL *aAdditionsActive)
    138137{
    139     if (!aAdditionsActive)
    140         return E_POINTER;
     138    CheckComArgOutPointerValid(aAdditionsActive);
    141139
    142140    AutoCaller autoCaller (this);
     
    152150STDMETHODIMP Guest::COMGETTER(AdditionsVersion) (BSTR *aAdditionsVersion)
    153151{
    154     if (!aAdditionsVersion)
    155         return E_POINTER;
     152    CheckComArgOutPointerValid(aAdditionsVersion);
    156153
    157154    AutoCaller autoCaller (this);
     
    167164STDMETHODIMP Guest::COMGETTER(SupportsSeamless) (BOOL *aSupportsSeamless)
    168165{
    169     if (!aSupportsSeamless)
    170         return E_POINTER;
     166    CheckComArgOutPointerValid(aSupportsSeamless);
    171167
    172168    AutoCaller autoCaller (this);
     
    182178STDMETHODIMP Guest::COMGETTER(SupportsGraphics) (BOOL *aSupportsGraphics)
    183179{
    184     if (!aSupportsGraphics)
    185         return E_POINTER;
     180    CheckComArgOutPointerValid(aSupportsGraphics);
    186181
    187182    AutoCaller autoCaller (this);
     
    197192STDMETHODIMP Guest::COMGETTER(MemoryBalloonSize) (ULONG *aMemoryBalloonSize)
    198193{
    199     if (!aMemoryBalloonSize)
    200         return E_POINTER;
     194    CheckComArgOutPointerValid(aMemoryBalloonSize);
    201195
    202196    AutoCaller autoCaller (this);
     
    232226STDMETHODIMP Guest::COMGETTER(StatisticsUpdateInterval) (ULONG *aUpdateInterval)
    233227{
    234     if (!aUpdateInterval)
    235         return E_POINTER;
     228    CheckComArgOutPointerValid(aUpdateInterval);
    236229
    237230    AutoCaller autoCaller (this);
     
    268261                                   INPTR BSTR aDomain, BOOL aAllowInteractiveLogon)
    269262{
    270     if (!aUserName || !aPassword || !aDomain)
    271         return E_INVALIDARG;
     263    CheckComArgNotNull(aUserName);
     264    CheckComArgNotNull(aPassword);
     265    CheckComArgNotNull(aDomain);
    272266
    273267    AutoCaller autoCaller (this);
     
    294288STDMETHODIMP Guest::GetStatistic(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG *aStatVal)
    295289{
    296     if (!aStatVal)
    297         return E_INVALIDARG;
    298 
    299     if (aCpuId != 0)
    300         return E_INVALIDARG;
    301 
    302     if (aStatistic >= GuestStatisticType_MaxVal)
    303         return E_INVALIDARG;
     290    CheckComArgExpr(aCpuId, aCpuId = 0);
     291    CheckComArgExpr(aStatistic, aStatistic < GuestStatisticType_MaxVal);
     292    CheckComArgOutPointerValid(aStatVal);
    304293
    305294    /* not available or not yet reported? */
    306     if (mCurrentGuestStat[aStatistic] == GUEST_STAT_INVALID)
    307         return E_INVALIDARG;
     295    CheckComArgExpr(aStatistic, mCurrentGuestStat[aStatistic] != GUEST_STAT_INVALID);
    308296
    309297    *aStatVal = mCurrentGuestStat[aStatistic];
     
    313301STDMETHODIMP Guest::SetStatistic(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal)
    314302{
    315     if (aCpuId != 0)
    316         return E_INVALIDARG;
    317 
    318     if (aStatistic >= GuestStatisticType_MaxVal)
    319         return E_INVALIDARG;
    320 
    321     /* internal method assumes that the caller known what he's doing (no boundary checks) */
     303    CheckComArgExpr(aCpuId, aCpuId = 0);
     304    CheckComArgExpr(aStatistic, aStatistic < GuestStatisticType_MaxVal);
     305
     306    /* internal method assumes that the caller knows what he's doing (no boundary checks) */
    322307    mCurrentGuestStat[aStatistic] = aStatVal;
    323308    return S_OK;
  • trunk/src/VBox/Main/GuestOSTypeImpl.cpp

    r14930 r14972  
    133133STDMETHODIMP GuestOSType::COMGETTER(FamilyId) (BSTR *aFamilyId)
    134134{
    135     if (!aFamilyId)
    136         return E_POINTER;
     135    CheckComArgOutPointerValid(aFamilyId);
    137136
    138137    AutoCaller autoCaller (this);
     
    147146STDMETHODIMP GuestOSType::COMGETTER(FamilyDescription) (BSTR *aFamilyDescription)
    148147{
    149     if (!aFamilyDescription)
    150         return E_POINTER;
     148    CheckComArgOutPointerValid(aFamilyDescription);
    151149
    152150    AutoCaller autoCaller (this);
     
    161159STDMETHODIMP GuestOSType::COMGETTER(Id) (BSTR *aId)
    162160{
    163     if (!aId)
    164         return E_POINTER;
     161    CheckComArgOutPointerValid(aId);
    165162
    166163    AutoCaller autoCaller (this);
     
    175172STDMETHODIMP GuestOSType::COMGETTER(Description) (BSTR *aDescription)
    176173{
    177     if (!aDescription)
    178         return E_POINTER;
     174    CheckComArgOutPointerValid(aDescription);
    179175
    180176    AutoCaller autoCaller (this);
     
    189185STDMETHODIMP GuestOSType::COMGETTER(Is64Bit) (BOOL *aIs64Bit)
    190186{
    191     if (!aIs64Bit)
    192         return E_POINTER;
     187    CheckComArgOutPointerValid(aIs64Bit);
    193188
    194189    AutoCaller autoCaller (this);
     
    203198STDMETHODIMP GuestOSType::COMGETTER(RecommendedIOAPIC) (BOOL *aRecommendedIOAPIC)
    204199{
    205     if (!aRecommendedIOAPIC)
    206         return E_POINTER;
     200    CheckComArgOutPointerValid(aRecommendedIOAPIC);
    207201
    208202    AutoCaller autoCaller (this);
     
    217211STDMETHODIMP GuestOSType::COMGETTER(RecommendedVirtEx) (BOOL *aRecommendedVirtEx)
    218212{
    219     if (!aRecommendedVirtEx)
    220         return E_POINTER;
     213    CheckComArgOutPointerValid(aRecommendedVirtEx);
    221214
    222215    AutoCaller autoCaller (this);
     
    231224STDMETHODIMP GuestOSType::COMGETTER(RecommendedRAM) (ULONG *aRAMSize)
    232225{
    233     if (!aRAMSize)
    234         return E_POINTER;
     226    CheckComArgOutPointerValid(aRAMSize);
    235227
    236228    AutoCaller autoCaller (this);
     
    245237STDMETHODIMP GuestOSType::COMGETTER(RecommendedVRAM) (ULONG *aVRAMSize)
    246238{
    247     if (!aVRAMSize)
    248         return E_POINTER;
     239    CheckComArgOutPointerValid(aVRAMSize);
    249240
    250241    AutoCaller autoCaller (this);
     
    259250STDMETHODIMP GuestOSType::COMGETTER(RecommendedHDD) (ULONG *aHDDSize)
    260251{
    261     if (!aHDDSize)
    262         return E_POINTER;
     252    CheckComArgOutPointerValid(aHDDSize);
    263253
    264254    AutoCaller autoCaller (this);
     
    273263STDMETHODIMP GuestOSType::COMGETTER(AdapterType) (NetworkAdapterType_T *aNetworkAdapterType)
    274264{
    275     if (!aNetworkAdapterType)
    276         return E_POINTER;
     265    CheckComArgOutPointerValid(aNetworkAdapterType);
    277266
    278267    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/HardDiskAttachmentImpl.cpp

    r14772 r14972  
    8888STDMETHODIMP HardDisk2Attachment::COMGETTER(HardDisk) (IHardDisk2 **aHardDisk)
    8989{
    90     if (!aHardDisk)
    91         return E_POINTER;
     90    CheckComArgOutPointerValid(aHardDisk);
    9291
    9392    AutoCaller autoCaller (this);
     
    103102STDMETHODIMP HardDisk2Attachment::COMGETTER(Bus) (StorageBus_T *aBus)
    104103{
    105     if (!aBus)
    106         return E_POINTER;
     104    CheckComArgOutPointerValid(aBus);
    107105
    108106    AutoCaller autoCaller (this);
     
    117115STDMETHODIMP HardDisk2Attachment::COMGETTER(Channel) (LONG *aChannel)
    118116{
    119     if (!aChannel)
    120         return E_INVALIDARG;
     117    CheckComArgOutPointerValid(aChannel);
    121118
    122119    AutoCaller autoCaller (this);
     
    131128STDMETHODIMP HardDisk2Attachment::COMGETTER(Device) (LONG *aDevice)
    132129{
    133     if (!aDevice)
    134         return E_INVALIDARG;
     130    CheckComArgOutPointerValid(aDevice);
    135131
    136132    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/HardDiskFormatImpl.cpp

    r14780 r14972  
    173173STDMETHODIMP HardDiskFormat::COMGETTER(Id)(BSTR *aId)
    174174{
    175     if (!aId)
    176         return E_POINTER;
     175    CheckComArgOutPointerValid(aId);
    177176
    178177    AutoCaller autoCaller (this);
     
    187186STDMETHODIMP HardDiskFormat::COMGETTER(Name)(BSTR *aName)
    188187{
    189     if (!aName)
    190         return E_POINTER;
     188    CheckComArgOutPointerValid(aName);
    191189
    192190    AutoCaller autoCaller (this);
     
    221219STDMETHODIMP HardDiskFormat::COMGETTER(Capabilities)(ULONG *aCaps)
    222220{
    223     if (!aCaps)
    224         return E_POINTER;
     221    CheckComArgOutPointerValid(aCaps);
    225222
    226223    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/HostDVDDriveImpl.cpp

    r14772 r14972  
    9090STDMETHODIMP HostDVDDrive::COMGETTER(Name) (BSTR *aName)
    9191{
    92     if (!aName)
    93         return E_POINTER;
     92    CheckComArgOutPointerValid(aName);
    9493
    9594    AutoCaller autoCaller (this);
     
    105104STDMETHODIMP HostDVDDrive::COMGETTER(Description) (BSTR *aDescription)
    106105{
    107     if (!aDescription)
    108         return E_POINTER;
     106    CheckComArgOutPointerValid(aDescription);
    109107
    110108    AutoCaller autoCaller (this);
     
    120118STDMETHODIMP HostDVDDrive::COMGETTER(Udi) (BSTR *aUdi)
    121119{
    122     if (!aUdi)
    123         return E_POINTER;
     120    CheckComArgOutPointerValid(aUdi);
    124121
    125122    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/HostFloppyDriveImpl.cpp

    r14772 r14972  
    9090STDMETHODIMP HostFloppyDrive::COMGETTER(Name) (BSTR *aName)
    9191{
    92     if (!aName)
    93         return E_POINTER;
     92    CheckComArgOutPointerValid(aName);
    9493
    9594    AutoCaller autoCaller (this);
     
    105104STDMETHODIMP HostFloppyDrive::COMGETTER(Description) (BSTR *aDescription)
    106105{
    107     if (!aDescription)
    108         return E_POINTER;
     106    CheckComArgOutPointerValid(aDescription);
    109107
    110108    AutoCaller autoCaller (this);
     
    120118STDMETHODIMP HostFloppyDrive::COMGETTER(Udi) (BSTR *aUdi)
    121119{
    122     if (!aUdi)
    123         return E_POINTER;
     120    CheckComArgOutPointerValid(aUdi);
    124121
    125122    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/HostImpl.cpp

    r14953 r14972  
    11201120{
    11211121#ifdef VBOX_WITH_USB
    1122     if (!aUSBDevices)
    1123         return E_POINTER;
     1122    CheckComArgOutPointerValid(aUSBDevices);
    11241123
    11251124    AutoWriteLock alock (this);
     
    11421141{
    11431142#ifdef VBOX_WITH_USB
    1144     if (!aUSBDeviceFilters)
    1145         return E_POINTER;
     1143    CheckComArgOutPointerValid(aUSBDeviceFilters);
    11461144
    11471145    AutoWriteLock alock (this);
     
    13501348STDMETHODIMP Host::COMGETTER(UTCTime)(LONG64 *aUTCTime)
    13511349{
    1352     if (!aUTCTime)
    1353         return E_POINTER;
     1350    CheckComArgOutPointerValid(aUTCTime);
    13541351    AutoWriteLock alock (this);
    13551352    CHECK_READY();
     
    14271424                                  IProgress **aProgress)
    14281425{
    1429     if (!aName)
    1430         return E_INVALIDARG;
    1431     if (!aHostNetworkInterface)
    1432         return E_POINTER;
    1433     if (!aProgress)
    1434         return E_POINTER;
     1426    CheckComArgNotNull(aName);
     1427    CheckComArgOutPointerValid(aHostNetworkInterface);
     1428    CheckComArgOutPointerValid(aProgress);
    14351429
    14361430    AutoWriteLock alock (this);
     
    14931487                                  IProgress **aProgress)
    14941488{
    1495     if (!aHostNetworkInterface)
    1496         return E_POINTER;
    1497     if (!aProgress)
    1498         return E_POINTER;
     1489    CheckComArgOutPointerValid(aHostNetworkInterface);
     1490    CheckComArgOutPointerValid(aProgress);
    14991491
    15001492    AutoWriteLock alock (this);
     
    15551547{
    15561548#ifdef VBOX_WITH_USB
    1557     if (!aFilter)
    1558         return E_POINTER;
    1559 
    15601549    CheckComArgStrNotEmptyOrNull(aName);
     1550    CheckComArgOutPointerValid(aFilter);
    15611551
    15621552    AutoWriteLock alock (this);
     
    15811571{
    15821572#ifdef VBOX_WITH_USB
    1583     if (!aFilter)
    1584         return E_INVALIDARG;
     1573    CheckComArgNotNull(aFilter);
    15851574
    15861575    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
     
    16291618{
    16301619#ifdef VBOX_WITH_USB
    1631     if (!aFilter)
    1632         return E_POINTER;
     1620    CheckComArgOutPointerValid(aFilter);
    16331621
    16341622    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
  • trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp

    r14772 r14972  
    8282STDMETHODIMP HostNetworkInterface::COMGETTER(Name) (BSTR *aInterfaceName)
    8383{
    84     if (!aInterfaceName)
    85         return E_POINTER;
     84    CheckComArgOutPointerValid(aInterfaceName);
    8685
    8786    AutoCaller autoCaller (this);
     
    101100STDMETHODIMP HostNetworkInterface::COMGETTER(Id) (GUIDPARAMOUT aGuid)
    102101{
    103     if (!aGuid)
    104         return E_POINTER;
     102    CheckComArgOutPointerValid(aGuid);
    105103
    106104    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/MachineDebuggerImpl.cpp

    r14772 r14972  
    122122STDMETHODIMP MachineDebugger::COMGETTER(Singlestep) (BOOL *aEnabled)
    123123{
    124     if (!aEnabled)
    125         return E_POINTER;
     124    CheckComArgOutPointerValid(aEnabled);
    126125
    127126    AutoCaller autoCaller (this);
     
    155154STDMETHODIMP MachineDebugger::COMGETTER(RecompileUser) (BOOL *aEnabled)
    156155{
    157     if (!aEnabled)
    158         return E_POINTER;
     156    CheckComArgOutPointerValid(aEnabled);
    159157
    160158    AutoCaller autoCaller (this);
     
    224222STDMETHODIMP MachineDebugger::COMGETTER(RecompileSupervisor) (BOOL *aEnabled)
    225223{
    226     if (!aEnabled)
    227         return E_POINTER;
     224    CheckComArgOutPointerValid(aEnabled);
    228225
    229226    AutoCaller autoCaller (this);
     
    293290STDMETHODIMP MachineDebugger::COMGETTER(PATMEnabled) (BOOL *aEnabled)
    294291{
    295     if (!aEnabled)
    296         return E_POINTER;
     292    CheckComArgOutPointerValid(aEnabled);
    297293
    298294    AutoCaller autoCaller (this);
     
    372368STDMETHODIMP MachineDebugger::COMGETTER(CSAMEnabled) (BOOL *aEnabled)
    373369{
    374     if (!aEnabled)
    375         return E_POINTER;
     370    CheckComArgOutPointerValid(aEnabled);
    376371
    377372    AutoCaller autoCaller (this);
     
    437432STDMETHODIMP MachineDebugger::COMGETTER(LogEnabled) (BOOL *aEnabled)
    438433{
    439     if (!aEnabled)
    440         return E_POINTER;
     434    CheckComArgOutPointerValid(aEnabled);
    441435
    442436    AutoCaller autoCaller (this);
     
    499493STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExEnabled) (BOOL *aEnabled)
    500494{
    501     if (!aEnabled)
    502         return E_POINTER;
     495    CheckComArgOutPointerValid(aEnabled);
    503496
    504497    AutoCaller autoCaller (this);
     
    525518STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExNestedPagingEnabled) (BOOL *aEnabled)
    526519{
    527     if (!aEnabled)
    528         return E_POINTER;
     520    CheckComArgOutPointerValid(aEnabled);
    529521
    530522    AutoCaller autoCaller (this);
     
    551543STDMETHODIMP MachineDebugger::COMGETTER(HWVirtExVPIDEnabled) (BOOL *aEnabled)
    552544{
    553     if (!aEnabled)
    554         return E_POINTER;
     545    CheckComArgOutPointerValid(aEnabled);
    555546
    556547    AutoCaller autoCaller (this);
     
    577568STDMETHODIMP MachineDebugger::COMGETTER(PAEEnabled) (BOOL *aEnabled)
    578569{
    579     if (!aEnabled)
    580         return E_POINTER;
     570    CheckComArgOutPointerValid(aEnabled);
    581571
    582572    AutoCaller autoCaller (this);
     
    606596STDMETHODIMP MachineDebugger::COMGETTER(VirtualTimeRate) (ULONG *aPct)
    607597{
    608     if (!aPct)
    609         return E_POINTER;
     598    CheckComArgOutPointerValid(aPct);
    610599
    611600    AutoCaller autoCaller (this);
     
    670659STDMETHODIMP MachineDebugger::COMGETTER(VM) (ULONG64 *aVm)
    671660{
    672     if (!aVm)
    673         return E_POINTER;
     661    CheckComArgOutPointerValid(aVm);
    674662
    675663    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r14959 r14972  
    717717STDMETHODIMP Machine::COMGETTER(Parent) (IVirtualBox **aParent)
    718718{
    719     if (!aParent)
    720         return E_POINTER;
     719    CheckComArgOutPointerValid(aParent);
    721720
    722721    AutoLimitedCaller autoCaller (this);
     
    731730STDMETHODIMP Machine::COMGETTER(Accessible) (BOOL *aAccessible)
    732731{
    733     if (!aAccessible)
    734         return E_POINTER;
     732    CheckComArgOutPointerValid(aAccessible);
    735733
    736734    AutoLimitedCaller autoCaller (this);
     
    769767STDMETHODIMP Machine::COMGETTER(AccessError) (IVirtualBoxErrorInfo **aAccessError)
    770768{
    771     if (!aAccessError)
    772         return E_POINTER;
     769    CheckComArgOutPointerValid(aAccessError);
    773770
    774771    AutoLimitedCaller autoCaller (this);
     
    802799STDMETHODIMP Machine::COMGETTER(Name) (BSTR *aName)
    803800{
    804     if (!aName)
    805         return E_POINTER;
     801    CheckComArgOutPointerValid(aName);
    806802
    807803    AutoCaller autoCaller (this);
     
    817813STDMETHODIMP Machine::COMSETTER(Name) (INPTR BSTR aName)
    818814{
    819     if (!aName)
    820         return E_INVALIDARG;
     815    CheckComArgNotNull(aName);
    821816
    822817    if (!*aName)
     
    840835STDMETHODIMP Machine::COMGETTER(Description) (BSTR *aDescription)
    841836{
    842     if (!aDescription)
    843         return E_POINTER;
     837    CheckComArgOutPointerValid(aDescription);
    844838
    845839    AutoCaller autoCaller (this);
     
    871865STDMETHODIMP Machine::COMGETTER(Id) (GUIDPARAMOUT aId)
    872866{
    873     if (!aId)
    874         return E_POINTER;
     867    CheckComArgOutPointerValid(aId);
    875868
    876869    AutoLimitedCaller autoCaller (this);
     
    886879STDMETHODIMP Machine::COMGETTER(OSTypeId) (BSTR *aOSTypeId)
    887880{
    888     if (!aOSTypeId)
    889         return E_POINTER;
     881    CheckComArgOutPointerValid(aOSTypeId);
    890882
    891883    AutoCaller autoCaller (this);
     
    901893STDMETHODIMP Machine::COMSETTER(OSTypeId) (INPTR BSTR aOSTypeId)
    902894{
    903     if (!aOSTypeId)
    904         return E_INVALIDARG;
     895    CheckComArgNotNull(aOSTypeId);
    905896
    906897    AutoCaller autoCaller (this);
     
    13301321STDMETHODIMP Machine::COMGETTER(SnapshotFolder) (BSTR *aSnapshotFolder)
    13311322{
    1332     if (!aSnapshotFolder)
    1333         return E_POINTER;
     1323    CheckComArgOutPointerValid(aSnapshotFolder);
    13341324
    13351325    AutoCaller autoCaller (this);
     
    14801470{
    14811471#ifdef VBOX_WITH_USB
    1482     if (!aUSBController)
    1483         return E_POINTER;
     1472    CheckComArgOutPointerValid(aUSBController);
    14841473
    14851474    AutoCaller autoCaller (this);
     
    15031492{
    15041493#ifdef VBOX_WITH_AHCI
    1505     if (!aSATAController)
    1506         return E_POINTER;
     1494    CheckComArgOutPointerValid(aSATAController);
    15071495
    15081496    AutoCaller autoCaller (this);
     
    15221510STDMETHODIMP Machine::COMGETTER(SettingsFilePath) (BSTR *aFilePath)
    15231511{
    1524     if (!aFilePath)
    1525         return E_POINTER;
     1512    CheckComArgOutPointerValid(aFilePath);
    15261513
    15271514    AutoLimitedCaller autoCaller (this);
     
    15371524COMGETTER(SettingsFileVersion) (BSTR *aSettingsFileVersion)
    15381525{
    1539     if (!aSettingsFileVersion)
    1540         return E_INVALIDARG;
     1526    CheckComArgOutPointerValid(aSettingsFileVersion);
    15411527
    15421528    AutoCaller autoCaller (this);
     
    15511537STDMETHODIMP Machine::COMGETTER(SettingsModified) (BOOL *aModified)
    15521538{
    1553     if (!aModified)
    1554         return E_POINTER;
     1539    CheckComArgOutPointerValid(aModified);
    15551540
    15561541    AutoCaller autoCaller (this);
     
    15801565STDMETHODIMP Machine::COMGETTER(SessionState) (SessionState_T *aSessionState)
    15811566{
    1582     if (!aSessionState)
    1583         return E_POINTER;
     1567    CheckComArgOutPointerValid(aSessionState);
    15841568
    15851569    AutoCaller autoCaller (this);
     
    15951579STDMETHODIMP Machine::COMGETTER(SessionType) (BSTR *aSessionType)
    15961580{
    1597     if (!aSessionType)
    1598         return E_POINTER;
     1581    CheckComArgOutPointerValid(aSessionType);
    15991582
    16001583    AutoCaller autoCaller (this);
     
    16101593STDMETHODIMP Machine::COMGETTER(SessionPid) (ULONG *aSessionPid)
    16111594{
    1612     if (!aSessionPid)
    1613         return E_POINTER;
     1595    CheckComArgOutPointerValid(aSessionPid);
    16141596
    16151597    AutoCaller autoCaller (this);
     
    16401622STDMETHODIMP Machine::COMGETTER(LastStateChange) (LONG64 *aLastStateChange)
    16411623{
    1642     if (!aLastStateChange)
    1643         return E_POINTER;
     1624    CheckComArgOutPointerValid(aLastStateChange);
    16441625
    16451626    AutoCaller autoCaller (this);
     
    16551636STDMETHODIMP Machine::COMGETTER(StateFilePath) (BSTR *aStateFilePath)
    16561637{
    1657     if (!aStateFilePath)
    1658         return E_POINTER;
     1638    CheckComArgOutPointerValid(aStateFilePath);
    16591639
    16601640    AutoCaller autoCaller (this);
     
    16701650STDMETHODIMP Machine::COMGETTER(LogFolder) (BSTR *aLogFolder)
    16711651{
    1672     if (!aLogFolder)
    1673         return E_POINTER;
     1652    CheckComArgOutPointerValid(aLogFolder);
    16741653
    16751654    AutoCaller autoCaller (this);
     
    16881667STDMETHODIMP Machine::COMGETTER(CurrentSnapshot) (ISnapshot **aCurrentSnapshot)
    16891668{
    1690     if (!aCurrentSnapshot)
    1691         return E_POINTER;
     1669    CheckComArgOutPointerValid(aCurrentSnapshot);
    16921670
    16931671    AutoCaller autoCaller (this);
     
    17031681STDMETHODIMP Machine::COMGETTER(SnapshotCount) (ULONG *aSnapshotCount)
    17041682{
    1705     if (!aSnapshotCount)
    1706         return E_POINTER;
     1683    CheckComArgOutPointerValid(aSnapshotCount);
    17071684
    17081685    AutoCaller autoCaller (this);
     
    17191696STDMETHODIMP Machine::COMGETTER(CurrentStateModified) (BOOL *aCurrentStateModified)
    17201697{
    1721     if (!aCurrentStateModified)
    1722         return E_POINTER;
     1698    CheckComArgOutPointerValid(aCurrentStateModified);
    17231699
    17241700    AutoCaller autoCaller (this);
     
    17401716Machine::COMGETTER(SharedFolders) (ISharedFolderCollection **aSharedFolders)
    17411717{
    1742     if (!aSharedFolders)
    1743         return E_POINTER;
     1718    CheckComArgOutPointerValid(aSharedFolders);
    17441719
    17451720    AutoCaller autoCaller (this);
     
    17591734Machine::COMGETTER(ClipboardMode) (ClipboardMode_T *aClipboardMode)
    17601735{
    1761     if (!aClipboardMode)
    1762         return E_POINTER;
     1736    CheckComArgOutPointerValid(aClipboardMode);
    17631737
    17641738    AutoCaller autoCaller (this);
     
    17921766Machine::COMGETTER(GuestPropertyNotificationPatterns) (BSTR *aPatterns)
    17931767{
    1794     if (!aPatterns)
    1795         return E_POINTER;
     1768    CheckComArgOutPointerValid(aPatterns);
    17961769
    17971770    AutoCaller autoCaller (this);
     
    23662339STDMETHODIMP Machine::GetNextExtraDataKey (INPTR BSTR aKey, BSTR *aNextKey, BSTR *aNextValue)
    23672340{
    2368     if (!aNextKey)
    2369         return E_POINTER;
     2341    CheckComArgOutPointerValid(aNextKey);
    23702342
    23712343    AutoCaller autoCaller (this);
     
    24702442STDMETHODIMP Machine::GetExtraData (INPTR BSTR aKey, BSTR *aValue)
    24712443{
    2472     if (!aKey)
    2473         return E_INVALIDARG;
    2474     if (!aValue)
    2475         return E_POINTER;
     2444    CheckComArgNotNull(aKey);
     2445    CheckComArgOutPointerValid(aValue);
    24762446
    24772447    AutoCaller autoCaller (this);
     
    25382508STDMETHODIMP Machine::SetExtraData (INPTR BSTR aKey, INPTR BSTR aValue)
    25392509{
    2540     if (!aKey)
    2541         return E_INVALIDARG;
     2510    CheckComArgNotNull(aKey);
    25422511
    25432512    AutoCaller autoCaller (this);
     
    26782647STDMETHODIMP Machine::SaveSettingsWithBackup (BSTR *aBakFileName)
    26792648{
    2680     if (!aBakFileName)
    2681         return E_POINTER;
     2649    CheckComArgOutPointerValid(aBakFileName);
    26822650
    26832651    AutoCaller autoCaller (this);
     
    28082776STDMETHODIMP Machine::GetSnapshot (INPTR GUIDPARAM aId, ISnapshot **aSnapshot)
    28092777{
    2810     if (!aSnapshot)
    2811         return E_POINTER;
     2778    CheckComArgOutPointerValid(aSnapshot);
    28122779
    28132780    AutoCaller autoCaller (this);
     
    28272794STDMETHODIMP Machine::FindSnapshot (INPTR BSTR aName, ISnapshot **aSnapshot)
    28282795{
    2829     if (!aName)
    2830         return E_INVALIDARG;
    2831     if (!aSnapshot)
    2832         return E_POINTER;
     2796    CheckComArgNotNull(aName);
     2797    CheckComArgOutPointerValid(aSnapshot);
    28332798
    28342799    AutoCaller autoCaller (this);
     
    28562821Machine::CreateSharedFolder (INPTR BSTR aName, INPTR BSTR aHostPath, BOOL aWritable)
    28572822{
    2858     if (!aName || !aHostPath)
    2859         return E_INVALIDARG;
     2823    CheckComArgNotNull(aName);
     2824    CheckComArgNotNull(aHostPath);
    28602825
    28612826    AutoCaller autoCaller (this);
     
    28972862STDMETHODIMP Machine::RemoveSharedFolder (INPTR BSTR aName)
    28982863{
    2899     if (!aName)
    2900         return E_INVALIDARG;
     2864    CheckComArgNotNull(aName);
    29012865
    29022866    AutoCaller autoCaller (this);
     
    29242888STDMETHODIMP Machine::CanShowConsoleWindow (BOOL *aCanShow)
    29252889{
    2926     if (!aCanShow)
    2927         return E_POINTER;
     2890    CheckComArgOutPointerValid(aCanShow);
    29282891
    29292892    /* start with No */
     
    29552918STDMETHODIMP Machine::ShowConsoleWindow (ULONG64 *aWinId)
    29562919{
    2957     if (!aWinId)
    2958         return E_POINTER;
     2920    CheckComArgOutPointerValid(aWinId);
    29592921
    29602922    AutoCaller autoCaller (this);
     
    81198081    LogFlowThisFunc (("\n"));
    81208082
    8121     if (!aUSBDevice)
    8122         return E_INVALIDARG;
    8123     if (!aMatched)
    8124         return E_POINTER;
     8083    CheckComArgNotNull(aUSBDevice);
     8084    CheckComArgOutPointerValid(aMatched);
    81258085
    81268086    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/MediumImpl.cpp

    r14931 r14972  
    5353STDMETHODIMP MediumBase::COMGETTER(Id) (GUIDPARAMOUT aId)
    5454{
    55     if (!aId)
    56         return E_POINTER;
     55    CheckComArgOutPointerValid(aId);
    5756
    5857    AutoCaller autoCaller (this);
     
    6867STDMETHODIMP MediumBase::COMGETTER(Description) (BSTR *aDescription)
    6968{
    70     if (!aDescription)
    71         return E_POINTER;
     69    CheckComArgOutPointerValid(aDescription);
    7270
    7371    AutoCaller autoCaller (this);
     
    8381STDMETHODIMP MediumBase::COMSETTER(Description) (INPTR BSTR aDescription)
    8482{
    85     if (!aDescription)
    86         return E_INVALIDARG;
     83    CheckComArgNotNull(aDescription);
    8784
    8885    AutoCaller autoCaller (this);
     
    10097STDMETHODIMP MediumBase::COMGETTER(State) (MediaState_T *aState)
    10198{
    102     if (!aState)
    103         return E_POINTER;
     99    CheckComArgOutPointerValid(aState);
    104100
    105101    AutoCaller autoCaller (this);
     
    132128STDMETHODIMP MediumBase::COMGETTER(Location) (BSTR *aLocation)
    133129{
    134     if (!aLocation)
    135         return E_POINTER;
     130    CheckComArgOutPointerValid(aLocation);
    136131
    137132    AutoCaller autoCaller (this);
     
    147142STDMETHODIMP MediumBase::COMSETTER(Location) (INPTR BSTR aLocation)
    148143{
    149     if (!aLocation)
    150         return E_INVALIDARG;
     144    CheckComArgNotNull(aLocation);
    151145
    152146    AutoCaller autoCaller (this);
     
    169163STDMETHODIMP MediumBase::COMGETTER(Name) (BSTR *aName)
    170164{
    171     if (!aName)
    172         return E_POINTER;
     165    CheckComArgOutPointerValid(aName);
    173166
    174167    AutoCaller autoCaller (this);
     
    184177STDMETHODIMP MediumBase::COMGETTER(Size) (ULONG64 *aSize)
    185178{
    186     if (!aSize)
    187         return E_POINTER;
     179    CheckComArgOutPointerValid(aSize);
    188180
    189181    AutoCaller autoCaller (this);
     
    199191STDMETHODIMP MediumBase::COMGETTER(LastAccessError) (BSTR *aLastAccessError)
    200192{
    201     if (!aLastAccessError)
    202         return E_POINTER;
     193    CheckComArgOutPointerValid(aLastAccessError);
    203194
    204195    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/NetworkAdapterImpl.cpp

    r14959 r14972  
    177177STDMETHODIMP NetworkAdapter::COMGETTER(AdapterType) (NetworkAdapterType_T *aAdapterType)
    178178{
    179     if (!aAdapterType)
    180         return E_POINTER;
     179    CheckComArgOutPointerValid(aAdapterType);
    181180
    182181    AutoCaller autoCaller (this);
     
    233232STDMETHODIMP NetworkAdapter::COMGETTER(Slot) (ULONG *aSlot)
    234233{
    235     if (!aSlot)
    236         return E_POINTER;
     234    CheckComArgOutPointerValid(aSlot);
    237235
    238236    AutoCaller autoCaller (this);
     
    248246STDMETHODIMP NetworkAdapter::COMGETTER(Enabled) (BOOL *aEnabled)
    249247{
    250     if (!aEnabled)
    251         return E_POINTER;
     248    CheckComArgOutPointerValid(aEnabled);
    252249
    253250    AutoCaller autoCaller (this);
     
    288285STDMETHODIMP NetworkAdapter::COMGETTER(MACAddress)(BSTR *aMACAddress)
    289286{
    290     if (!aMACAddress)
    291         return E_POINTER;
     287    CheckComArgOutPointerValid(aMACAddress);
    292288
    293289    AutoCaller autoCaller (this);
     
    386382    NetworkAttachmentType_T *aAttachmentType)
    387383{
    388     if (!aAttachmentType)
    389         return E_POINTER;
     384    CheckComArgOutPointerValid(aAttachmentType);
    390385
    391386    AutoCaller autoCaller (this);
     
    401396STDMETHODIMP NetworkAdapter::COMGETTER(HostInterface)(BSTR *aHostInterface)
    402397{
    403     if (!aHostInterface)
    404         return E_POINTER;
     398    CheckComArgOutPointerValid(aHostInterface);
    405399
    406400    AutoCaller autoCaller (this);
     
    422416    // (because the @name attribute of <HostInterface> must be always present,
    423417    // but can be empty).
    424     if (!aHostInterface)
    425         return E_INVALIDARG;
     418    CheckComArgNotNull(aHostInterface);
    426419#else
    427420    CheckComArgStrNotEmptyOrNull(aHostInterface);
     
    456449{
    457450# ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    458     if (!aTAPFileDescriptor)
    459         return E_POINTER;
     451    CheckComArgOutPointerValid(aTAPFileDescriptor);
    460452
    461453    AutoCaller autoCaller (this);
     
    517509{
    518510# ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    519     if (!aTAPSetupApplication)
    520         return E_POINTER;
     511    CheckComArgOutPointerValid(aTAPSetupApplication);
    521512
    522513    AutoCaller autoCaller (this);
     
    572563{
    573564# ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    574     if (!aTAPTerminateApplication)
    575         return E_POINTER;
     565    CheckComArgOutPointerValid(aTAPTerminateApplication);
    576566
    577567    AutoCaller autoCaller (this);
     
    627617STDMETHODIMP NetworkAdapter::COMGETTER(InternalNetwork) (BSTR *aInternalNetwork)
    628618{
    629     if (!aInternalNetwork)
    630         return E_POINTER;
     619    CheckComArgOutPointerValid(aInternalNetwork);
    631620
    632621    AutoCaller autoCaller (this);
     
    676665STDMETHODIMP NetworkAdapter::COMGETTER(NATNetwork) (BSTR *aNATNetwork)
    677666{
    678     if (!aNATNetwork)
    679         return E_POINTER;
     667    CheckComArgOutPointerValid(aNATNetwork);
    680668
    681669    AutoCaller autoCaller (this);
     
    716704STDMETHODIMP NetworkAdapter::COMGETTER(CableConnected) (BOOL *aConnected)
    717705{
    718     if (!aConnected)
    719         return E_POINTER;
     706    CheckComArgOutPointerValid(aConnected);
    720707
    721708    AutoCaller autoCaller (this);
     
    756743STDMETHODIMP NetworkAdapter::COMGETTER(LineSpeed) (ULONG *aSpeed)
    757744{
    758     if (!aSpeed)
    759         return E_POINTER;
     745    CheckComArgOutPointerValid(aSpeed);
    760746
    761747    AutoCaller autoCaller (this);
     
    796782STDMETHODIMP NetworkAdapter::COMGETTER(TraceEnabled) (BOOL *aEnabled)
    797783{
    798     if (!aEnabled)
    799         return E_POINTER;
     784    CheckComArgOutPointerValid(aEnabled);
    800785
    801786    AutoCaller autoCaller (this);
     
    835820STDMETHODIMP NetworkAdapter::COMGETTER(TraceFile) (BSTR *aTraceFile)
    836821{
    837     if (!aTraceFile)
    838         return E_POINTER;
     822    CheckComArgOutPointerValid(aTraceFile);
    839823
    840824    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/ParallelPortImpl.cpp

    r14772 r14972  
    323323STDMETHODIMP ParallelPort::COMGETTER(Enabled) (BOOL *aEnabled)
    324324{
    325     if (!aEnabled)
    326         return E_POINTER;
     325    CheckComArgOutPointerValid(aEnabled);
    327326
    328327    AutoCaller autoCaller (this);
     
    372371STDMETHODIMP ParallelPort::COMGETTER(Slot) (ULONG *aSlot)
    373372{
    374     if (!aSlot)
    375         return E_POINTER;
     373    CheckComArgOutPointerValid(aSlot);
    376374
    377375    AutoCaller autoCaller (this);
     
    387385STDMETHODIMP ParallelPort::COMGETTER(IRQ) (ULONG *aIRQ)
    388386{
    389     if (!aIRQ)
    390         return E_POINTER;
     387    CheckComArgOutPointerValid(aIRQ);
    391388
    392389    AutoCaller autoCaller (this);
     
    442439STDMETHODIMP ParallelPort::COMGETTER(IOBase) (ULONG *aIOBase)
    443440{
    444     if (!aIOBase)
    445         return E_POINTER;
     441    CheckComArgOutPointerValid(aIOBase);
    446442
    447443    AutoCaller autoCaller (this);
     
    497493STDMETHODIMP ParallelPort::COMGETTER(Path) (BSTR *aPath)
    498494{
    499     if (!aPath)
    500         return E_POINTER;
     495    CheckComArgOutPointerValid(aPath);
    501496
    502497    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/ProgressImpl.cpp

    r14772 r14972  
    195195STDMETHODIMP ProgressBase::COMGETTER(Id) (GUIDPARAMOUT aId)
    196196{
    197     if (!aId)
    198         return E_POINTER;
     197    CheckComArgOutPointerValid(aId);
    199198
    200199    AutoCaller autoCaller (this);
     
    209208STDMETHODIMP ProgressBase::COMGETTER(Description) (BSTR *aDescription)
    210209{
    211     if (!aDescription)
    212         return E_POINTER;
     210    CheckComArgOutPointerValid(aDescription);
    213211
    214212    AutoCaller autoCaller (this);
     
    223221STDMETHODIMP ProgressBase::COMGETTER(Initiator) (IUnknown **aInitiator)
    224222{
    225     if (!aInitiator)
    226         return E_POINTER;
     223    CheckComArgOutPointerValid(aInitiator);
    227224
    228225    AutoCaller autoCaller (this);
     
    245242STDMETHODIMP ProgressBase::COMGETTER(Cancelable) (BOOL *aCancelable)
    246243{
    247     if (!aCancelable)
    248         return E_POINTER;
     244    CheckComArgOutPointerValid(aCancelable);
    249245
    250246    AutoCaller autoCaller (this);
     
    260256STDMETHODIMP ProgressBase::COMGETTER(Percent) (LONG *aPercent)
    261257{
    262     if (!aPercent)
    263         return E_POINTER;
     258    CheckComArgOutPointerValid(aPercent);
    264259
    265260    AutoCaller autoCaller (this);
     
    283278STDMETHODIMP ProgressBase::COMGETTER(Completed) (BOOL *aCompleted)
    284279{
    285     if (!aCompleted)
    286         return E_POINTER;
     280    CheckComArgOutPointerValid(aCompleted);
    287281
    288282    AutoCaller autoCaller (this);
     
    298292STDMETHODIMP ProgressBase::COMGETTER(Canceled) (BOOL *aCanceled)
    299293{
    300     if (!aCanceled)
    301         return E_POINTER;
     294    CheckComArgOutPointerValid(aCanceled);
    302295
    303296    AutoCaller autoCaller (this);
     
    313306STDMETHODIMP ProgressBase::COMGETTER(ResultCode) (HRESULT *aResultCode)
    314307{
    315     if (!aResultCode)
    316         return E_POINTER;
     308    CheckComArgOutPointerValid(aResultCode);
    317309
    318310    AutoCaller autoCaller (this);
     
    332324STDMETHODIMP ProgressBase::COMGETTER(ErrorInfo) (IVirtualBoxErrorInfo **aErrorInfo)
    333325{
    334     if (!aErrorInfo)
    335         return E_POINTER;
     326    CheckComArgOutPointerValid(aErrorInfo);
    336327
    337328    AutoCaller autoCaller (this);
     
    351342STDMETHODIMP ProgressBase::COMGETTER(OperationCount) (ULONG *aOperationCount)
    352343{
    353     if (!aOperationCount)
    354         return E_POINTER;
     344    CheckComArgOutPointerValid(aOperationCount);
    355345
    356346    AutoCaller autoCaller (this);
     
    366356STDMETHODIMP ProgressBase::COMGETTER(Operation) (ULONG *aOperation)
    367357{
    368     if (!aOperation)
    369         return E_POINTER;
     358    CheckComArgOutPointerValid(aOperation);
    370359
    371360    AutoCaller autoCaller (this);
     
    381370STDMETHODIMP ProgressBase::COMGETTER(OperationDescription) (BSTR *aOperationDescription)
    382371{
    383     if (!aOperationDescription)
    384         return E_POINTER;
     372    CheckComArgOutPointerValid(aOperationDescription);
    385373
    386374    AutoCaller autoCaller (this);
     
    396384STDMETHODIMP ProgressBase::COMGETTER(OperationPercent) (LONG *aOperationPercent)
    397385{
    398     if (!aOperationPercent)
    399         return E_POINTER;
     386    CheckComArgOutPointerValid(aOperationPercent);
    400387
    401388    AutoCaller autoCaller (this);
     
    11391126STDMETHODIMP CombinedProgress::COMGETTER(Percent) (LONG *aPercent)
    11401127{
    1141     if (!aPercent)
    1142         return E_POINTER;
     1128    CheckComArgOutPointerValid(aPercent);
    11431129
    11441130    AutoCaller autoCaller (this);
     
    11661152STDMETHODIMP CombinedProgress::COMGETTER(Completed) (BOOL *aCompleted)
    11671153{
    1168     if (!aCompleted)
    1169         return E_POINTER;
     1154    CheckComArgOutPointerValid(aCompleted);
    11701155
    11711156    AutoCaller autoCaller (this);
     
    11831168STDMETHODIMP CombinedProgress::COMGETTER(Canceled) (BOOL *aCanceled)
    11841169{
    1185     if (!aCanceled)
    1186         return E_POINTER;
     1170    CheckComArgOutPointerValid(aCanceled);
    11871171
    11881172    AutoCaller autoCaller (this);
     
    12001184STDMETHODIMP CombinedProgress::COMGETTER(ResultCode) (HRESULT *aResultCode)
    12011185{
    1202     if (!aResultCode)
    1203         return E_POINTER;
     1186    CheckComArgOutPointerValid(aResultCode);
    12041187
    12051188    AutoCaller autoCaller (this);
     
    12171200STDMETHODIMP CombinedProgress::COMGETTER(ErrorInfo) (IVirtualBoxErrorInfo **aErrorInfo)
    12181201{
    1219     if (!aErrorInfo)
    1220         return E_POINTER;
     1202    CheckComArgOutPointerValid(aErrorInfo);
    12211203
    12221204    AutoCaller autoCaller (this);
     
    12341216STDMETHODIMP CombinedProgress::COMGETTER(Operation) (ULONG *aOperation)
    12351217{
    1236     if (!aOperation)
    1237         return E_POINTER;
     1218    CheckComArgOutPointerValid(aOperation);
    12381219
    12391220    AutoCaller autoCaller (this);
     
    12511232STDMETHODIMP CombinedProgress::COMGETTER(OperationDescription) (BSTR *aOperationDescription)
    12521233{
    1253     if (!aOperationDescription)
    1254         return E_POINTER;
     1234    CheckComArgOutPointerValid(aOperationDescription);
    12551235
    12561236    AutoCaller autoCaller (this);
     
    12681248STDMETHODIMP CombinedProgress::COMGETTER(OperationPercent) (LONG *aOperationPercent)
    12691249{
    1270     if (!aOperationPercent)
    1271         return E_POINTER;
     1250    CheckComArgOutPointerValid(aOperationPercent);
    12721251
    12731252    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp

    r14772 r14972  
    134134STDMETHODIMP RemoteUSBDevice::COMGETTER(Id) (GUIDPARAMOUT aId)
    135135{
    136     if (!aId)
    137         return E_INVALIDARG;
     136    CheckComArgOutPointerValid(aId);
    138137
    139138    AutoCaller autoCaller (this);
     
    148147STDMETHODIMP RemoteUSBDevice::COMGETTER(VendorId) (USHORT *aVendorId)
    149148{
    150     if (!aVendorId)
    151         return E_INVALIDARG;
     149    CheckComArgOutPointerValid(aVendorId);
    152150
    153151    AutoCaller autoCaller (this);
     
    162160STDMETHODIMP RemoteUSBDevice::COMGETTER(ProductId) (USHORT *aProductId)
    163161{
    164     if (!aProductId)
    165         return E_INVALIDARG;
     162    CheckComArgOutPointerValid(aProductId);
    166163
    167164    AutoCaller autoCaller (this);
     
    176173STDMETHODIMP RemoteUSBDevice::COMGETTER(Revision) (USHORT *aRevision)
    177174{
    178     if (!aRevision)
    179         return E_INVALIDARG;
     175    CheckComArgOutPointerValid(aRevision);
    180176
    181177    AutoCaller autoCaller (this);
     
    190186STDMETHODIMP RemoteUSBDevice::COMGETTER(Manufacturer) (BSTR *aManufacturer)
    191187{
    192     if (!aManufacturer)
    193         return E_INVALIDARG;
     188    CheckComArgOutPointerValid(aManufacturer);
    194189
    195190    AutoCaller autoCaller (this);
     
    204199STDMETHODIMP RemoteUSBDevice::COMGETTER(Product) (BSTR *aProduct)
    205200{
    206     if (!aProduct)
    207         return E_INVALIDARG;
     201    CheckComArgOutPointerValid(aProduct);
    208202
    209203    AutoCaller autoCaller (this);
     
    218212STDMETHODIMP RemoteUSBDevice::COMGETTER(SerialNumber) (BSTR *aSerialNumber)
    219213{
    220     if (!aSerialNumber)
    221         return E_INVALIDARG;
     214    CheckComArgOutPointerValid(aSerialNumber);
    222215
    223216    AutoCaller autoCaller (this);
     
    232225STDMETHODIMP RemoteUSBDevice::COMGETTER(Address) (BSTR *aAddress)
    233226{
    234     if (!aAddress)
    235         return E_INVALIDARG;
     227    CheckComArgOutPointerValid(aAddress);
    236228
    237229    AutoCaller autoCaller (this);
     
    246238STDMETHODIMP RemoteUSBDevice::COMGETTER(Port) (USHORT *aPort)
    247239{
    248     if (!aPort)
    249         return E_INVALIDARG;
     240    CheckComArgOutPointerValid(aPort);
    250241
    251242    AutoCaller autoCaller (this);
     
    260251STDMETHODIMP RemoteUSBDevice::COMGETTER(Version) (USHORT *aVersion)
    261252{
    262     if (!aVersion)
    263         return E_INVALIDARG;
     253    CheckComArgOutPointerValid(aVersion);
    264254
    265255    AutoCaller autoCaller (this);
     
    274264STDMETHODIMP RemoteUSBDevice::COMGETTER(PortVersion) (USHORT *aPortVersion)
    275265{
    276     if (!aPortVersion)
    277         return E_INVALIDARG;
     266    CheckComArgOutPointerValid(aPortVersion);
    278267
    279268    AutoCaller autoCaller (this);
     
    288277STDMETHODIMP RemoteUSBDevice::COMGETTER(Remote) (BOOL *aRemote)
    289278{
    290     if (!aRemote)
    291         return E_INVALIDARG;
     279    CheckComArgOutPointerValid(aRemote);
    292280
    293281    AutoCaller autoCaller (this);
     
    302290
    303291// IHostUSBDevice properties
    304 /////////////////////////////////////////////////////////////////////////////
     292////////////////////////////////////////////////////////////////////////////////
    305293
    306294STDMETHODIMP RemoteUSBDevice::COMGETTER(State) (USBDeviceState_T *aState)
    307295{
    308     if (!aState)
    309         return E_POINTER;
     296    CheckComArgOutPointerValid(aState);
    310297
    311298    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/SATAControllerImpl.cpp

    r14772 r14972  
    175175STDMETHODIMP SATAController::COMGETTER(Enabled) (BOOL *aEnabled)
    176176{
    177     if (!aEnabled)
    178         return E_POINTER;
     177    CheckComArgOutPointerValid(aEnabled);
    179178
    180179    AutoCaller autoCaller (this);
     
    218217STDMETHODIMP SATAController::COMGETTER(PortCount) (ULONG *aPortCount)
    219218{
    220     if (!aPortCount)
    221         return E_POINTER;
     219    CheckComArgOutPointerValid(aPortCount);
    222220
    223221    AutoCaller autoCaller (this);
     
    270268STDMETHODIMP SATAController::GetIDEEmulationPort(LONG DevicePosition, LONG *aPortNumber)
    271269{
    272     if (!aPortNumber)
    273         return E_POINTER;
     270    CheckComArgOutPointerValid(aPortNumber);
    274271
    275272    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/SerialPortImpl.cpp

    r14959 r14972  
    359359STDMETHODIMP SerialPort::COMGETTER(Enabled) (BOOL *aEnabled)
    360360{
    361     if (!aEnabled)
    362         return E_POINTER;
     361    CheckComArgOutPointerValid(aEnabled);
    363362
    364363    AutoCaller autoCaller (this);
     
    401400STDMETHODIMP SerialPort::COMGETTER(HostMode) (PortMode_T *aHostMode)
    402401{
    403     if (!aHostMode)
    404         return E_POINTER;
     402    CheckComArgOutPointerValid(aHostMode);
    405403
    406404    AutoCaller autoCaller (this);
     
    469467STDMETHODIMP SerialPort::COMGETTER(Slot) (ULONG *aSlot)
    470468{
    471     if (!aSlot)
    472         return E_POINTER;
     469    CheckComArgOutPointerValid(aSlot);
    473470
    474471    AutoCaller autoCaller (this);
     
    484481STDMETHODIMP SerialPort::COMGETTER(IRQ) (ULONG *aIRQ)
    485482{
    486     if (!aIRQ)
    487         return E_POINTER;
     483    CheckComArgOutPointerValid(aIRQ);
    488484
    489485    AutoCaller autoCaller (this);
     
    539535STDMETHODIMP SerialPort::COMGETTER(IOBase) (ULONG *aIOBase)
    540536{
    541     if (!aIOBase)
    542         return E_POINTER;
     537    CheckComArgOutPointerValid(aIOBase);
    543538
    544539    AutoCaller autoCaller (this);
     
    594589STDMETHODIMP SerialPort::COMGETTER(Path) (BSTR *aPath)
    595590{
    596     if (!aPath)
    597         return E_POINTER;
     591    CheckComArgOutPointerValid(aPath);
    598592
    599593    AutoCaller autoCaller (this);
     
    659653STDMETHODIMP SerialPort::COMGETTER(Server) (BOOL *aServer)
    660654{
    661     if (!aServer)
    662         return E_POINTER;
     655    CheckComArgOutPointerValid(aServer);
    663656
    664657    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/SessionImpl.cpp

    r14772 r14972  
    150150STDMETHODIMP Session::COMGETTER(State) (SessionState_T *aState)
    151151{
    152     if (!aState)
    153         return E_POINTER;
     152    CheckComArgOutPointerValid(aState);
    154153
    155154    AutoCaller autoCaller (this);
     
    165164STDMETHODIMP Session::COMGETTER(Type) (SessionType_T *aType)
    166165{
    167     if (!aType)
    168         return E_POINTER;
     166    CheckComArgOutPointerValid(aType);
    169167
    170168    AutoCaller autoCaller (this);
     
    181179STDMETHODIMP Session::COMGETTER(Machine) (IMachine **aMachine)
    182180{
    183     if (!aMachine)
    184         return E_POINTER;
     181    CheckComArgOutPointerValid(aMachine);
    185182
    186183    AutoCaller autoCaller (this);
     
    204201STDMETHODIMP Session::COMGETTER(Console) (IConsole **aConsole)
    205202{
    206     if (!aConsole)
    207         return E_POINTER;
     203    CheckComArgOutPointerValid(aConsole);
    208204
    209205    AutoCaller autoCaller (this);
     
    683679            mState);
    684680    AssertReturn (mType == SessionType_Direct, E_UNEXPECTED);
    685     if (!VALID_PTR (aName))
    686         return E_POINTER;
     681    CheckComArgNotNull(aName);
    687682    if (!aIsSetter && !VALID_PTR (aRetValue))
    688683        return E_POINTER;
  • trunk/src/VBox/Main/SharedFolderImpl.cpp

    r14790 r14972  
    257257STDMETHODIMP SharedFolder::COMGETTER(Name) (BSTR *aName)
    258258{
    259     if (!aName)
    260         return E_POINTER;
     259    CheckComArgOutPointerValid(aName);
    261260
    262261    AutoCaller autoCaller (this);
     
    271270STDMETHODIMP SharedFolder::COMGETTER(HostPath) (BSTR *aHostPath)
    272271{
    273     if (!aHostPath)
    274         return E_POINTER;
     272    CheckComArgOutPointerValid(aHostPath);
    275273
    276274    AutoCaller autoCaller (this);
     
    285283STDMETHODIMP SharedFolder::COMGETTER(Accessible) (BOOL *aAccessible)
    286284{
    287     if (!aAccessible)
    288         return E_POINTER;
     285    CheckComArgOutPointerValid(aAccessible);
    289286
    290287    AutoCaller autoCaller (this);
     
    318315STDMETHODIMP SharedFolder::COMGETTER(Writable) (BOOL *aWritable)
    319316{
    320     if (!aWritable)
    321         return E_POINTER;
     317    CheckComArgOutPointerValid(aWritable);
    322318
    323319    *aWritable = mData.mWritable;
  • trunk/src/VBox/Main/SnapshotImpl.cpp

    r14772 r14972  
    167167STDMETHODIMP Snapshot::COMGETTER(Id) (GUIDPARAMOUT aId)
    168168{
    169     if (!aId)
    170         return E_POINTER;
     169    CheckComArgOutPointerValid(aId);
    171170
    172171    AutoWriteLock alock (this);
     
    179178STDMETHODIMP Snapshot::COMGETTER(Name) (BSTR *aName)
    180179{
    181     if (!aName)
    182         return E_POINTER;
     180    CheckComArgOutPointerValid(aName);
    183181
    184182    AutoWriteLock alock (this);
     
    195193STDMETHODIMP Snapshot::COMSETTER(Name) (INPTR BSTR aName)
    196194{
    197     if (!aName)
    198         return E_INVALIDARG;
     195    CheckComArgNotNull(aName);
    199196
    200197    AutoWriteLock alock (this);
     
    215212STDMETHODIMP Snapshot::COMGETTER(Description) (BSTR *aDescription)
    216213{
    217     if (!aDescription)
    218         return E_POINTER;
     214    CheckComArgOutPointerValid(aDescription);
    219215
    220216    AutoWriteLock alock (this);
     
    227223STDMETHODIMP Snapshot::COMSETTER(Description) (INPTR BSTR aDescription)
    228224{
    229     if (!aDescription)
    230         return E_INVALIDARG;
     225    CheckComArgNotNull(aDescription);
    231226
    232227    AutoWriteLock alock (this);
     
    247242STDMETHODIMP Snapshot::COMGETTER(TimeStamp) (LONG64 *aTimeStamp)
    248243{
    249     if (!aTimeStamp)
    250         return E_POINTER;
     244    CheckComArgOutPointerValid(aTimeStamp);
    251245
    252246    AutoWriteLock alock (this);
     
    259253STDMETHODIMP Snapshot::COMGETTER(Online) (BOOL *aOnline)
    260254{
    261     if (!aOnline)
    262         return E_POINTER;
     255    CheckComArgOutPointerValid(aOnline);
    263256
    264257    AutoWriteLock alock (this);
     
    271264STDMETHODIMP Snapshot::COMGETTER(Machine) (IMachine **aMachine)
    272265{
    273     if (!aMachine)
    274         return E_POINTER;
     266    CheckComArgOutPointerValid(aMachine);
    275267
    276268    AutoWriteLock alock (this);
     
    283275STDMETHODIMP Snapshot::COMGETTER(Parent) (ISnapshot **aParent)
    284276{
    285     if (!aParent)
    286         return E_POINTER;
     277    CheckComArgOutPointerValid(aParent);
    287278
    288279    AutoWriteLock alock (this);
     
    295286STDMETHODIMP Snapshot::COMGETTER(Children) (ISnapshotCollection **aChildren)
    296287{
    297     if (!aChildren)
    298         return E_POINTER;
     288    CheckComArgOutPointerValid(aChildren);
    299289
    300290    AutoWriteLock alock (this);
  • trunk/src/VBox/Main/SystemPropertiesImpl.cpp

    r14772 r14972  
    275275STDMETHODIMP SystemProperties::COMGETTER(MaxBootPosition)(ULONG *aMaxBootPosition)
    276276{
    277     if (!aMaxBootPosition)
    278         return E_POINTER;
     277    CheckComArgOutPointerValid(aMaxBootPosition);
    279278
    280279    AutoCaller autoCaller (this);
     
    289288STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder) (BSTR *aDefaultMachineFolder)
    290289{
    291     if (!aDefaultMachineFolder)
    292         return E_POINTER;
     290    CheckComArgOutPointerValid(aDefaultMachineFolder);
    293291
    294292    AutoCaller autoCaller (this);
     
    319317STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFolder) (BSTR *aDefaultHardDiskFolder)
    320318{
    321     if (!aDefaultHardDiskFolder)
    322         return E_POINTER;
     319    CheckComArgOutPointerValid(aDefaultHardDiskFolder);
    323320
    324321    AutoCaller autoCaller (this);
     
    366363STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat) (BSTR *aDefaultHardDiskFormat)
    367364{
    368     if (!aDefaultHardDiskFormat)
    369         return E_POINTER;
     365    CheckComArgOutPointerValid(aDefaultHardDiskFormat);
    370366
    371367    AutoCaller autoCaller (this);
     
    396392STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary)
    397393{
    398     if (!aRemoteDisplayAuthLibrary)
    399         return E_POINTER;
     394    CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary);
    400395
    401396    AutoCaller autoCaller (this);
     
    426421STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary) (BSTR *aWebServiceAuthLibrary)
    427422{
    428     if (!aWebServiceAuthLibrary)
    429         return E_POINTER;
     423    CheckComArgOutPointerValid(aWebServiceAuthLibrary);
    430424
    431425    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r14938 r14972  
    214214STDMETHODIMP USBController::COMGETTER(Enabled) (BOOL *aEnabled)
    215215{
    216     if (!aEnabled)
    217         return E_POINTER;
     216    CheckComArgOutPointerValid(aEnabled);
    218217
    219218    AutoCaller autoCaller (this);
     
    257256STDMETHODIMP USBController::COMGETTER(EnabledEhci) (BOOL *aEnabled)
    258257{
    259     if (!aEnabled)
    260         return E_POINTER;
     258    CheckComArgOutPointerValid(aEnabled);
    261259
    262260    AutoCaller autoCaller (this);
     
    299297STDMETHODIMP USBController::COMGETTER(USBStandard) (USHORT *aUSBStandard)
    300298{
    301     if (!aUSBStandard)
    302         return E_POINTER;
     299    CheckComArgOutPointerValid(aUSBStandard);
    303300
    304301    AutoCaller autoCaller (this);
     
    367364STDMETHODIMP USBController::COMGETTER(DeviceFilters) (IUSBDeviceFilterCollection **aDevicesFilters)
    368365{
    369     if (!aDevicesFilters)
    370         return E_POINTER;
     366    CheckComArgOutPointerValid(aDevicesFilters);
    371367
    372368    AutoCaller autoCaller (this);
     
    392388{
    393389#ifdef VBOX_WITH_USB
    394     if (!aFilter)
    395         return E_POINTER;
     390    CheckComArgOutPointerValid(aFilter);
    396391
    397392    CheckComArgStrNotEmptyOrNull(aName);
     
    423418{
    424419#ifdef VBOX_WITH_USB
    425     if (!aFilter)
    426         return E_INVALIDARG;
     420    CheckComArgNotNull(aFilter);
    427421
    428422    AutoCaller autoCaller (this);
     
    488482{
    489483#ifdef VBOX_WITH_USB
    490     if (!aFilter)
    491         return E_POINTER;
     484    CheckComArgOutPointerValid(aFilter);
    492485
    493486    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/USBDeviceImpl.cpp

    r14772 r14972  
    146146STDMETHODIMP OUSBDevice::COMGETTER(Id)(GUIDPARAMOUT aId)
    147147{
    148     if (!aId)
    149         return E_POINTER;
     148    CheckComArgOutPointerValid(aId);
    150149
    151150    AutoCaller autoCaller (this);
     
    167166STDMETHODIMP OUSBDevice::COMGETTER(VendorId)(USHORT *aVendorId)
    168167{
    169     if (!aVendorId)
    170         return E_POINTER;
     168    CheckComArgOutPointerValid(aVendorId);
    171169
    172170    AutoCaller autoCaller (this);
     
    188186STDMETHODIMP OUSBDevice::COMGETTER(ProductId)(USHORT *aProductId)
    189187{
    190     if (!aProductId)
    191         return E_POINTER;
     188    CheckComArgOutPointerValid(aProductId);
    192189
    193190    AutoCaller autoCaller (this);
     
    209206STDMETHODIMP OUSBDevice::COMGETTER(Revision)(USHORT *aRevision)
    210207{
    211     if (!aRevision)
    212         return E_POINTER;
     208    CheckComArgOutPointerValid(aRevision);
    213209
    214210    AutoCaller autoCaller (this);
     
    229225STDMETHODIMP OUSBDevice::COMGETTER(Manufacturer)(BSTR *aManufacturer)
    230226{
    231     if (!aManufacturer)
    232         return E_POINTER;
     227    CheckComArgOutPointerValid(aManufacturer);
    233228
    234229    AutoCaller autoCaller (this);
     
    250245STDMETHODIMP OUSBDevice::COMGETTER(Product)(BSTR *aProduct)
    251246{
    252     if (!aProduct)
    253         return E_POINTER;
     247    CheckComArgOutPointerValid(aProduct);
    254248
    255249    AutoCaller autoCaller (this);
     
    271265STDMETHODIMP OUSBDevice::COMGETTER(SerialNumber)(BSTR *aSerialNumber)
    272266{
    273     if (!aSerialNumber)
    274         return E_POINTER;
     267    CheckComArgOutPointerValid(aSerialNumber);
    275268
    276269    AutoCaller autoCaller (this);
     
    292285STDMETHODIMP OUSBDevice::COMGETTER(Address)(BSTR *aAddress)
    293286{
    294     if (!aAddress)
    295         return E_POINTER;
     287    CheckComArgOutPointerValid(aAddress);
    296288
    297289    AutoCaller autoCaller (this);
     
    306298STDMETHODIMP OUSBDevice::COMGETTER(Port)(USHORT *aPort)
    307299{
    308     if (!aPort)
    309         return E_POINTER;
     300    CheckComArgOutPointerValid(aPort);
    310301
    311302    AutoCaller autoCaller (this);
     
    320311STDMETHODIMP OUSBDevice::COMGETTER(Version)(USHORT *aVersion)
    321312{
    322     if (!aVersion)
    323         return E_POINTER;
     313    CheckComArgOutPointerValid(aVersion);
    324314
    325315    AutoCaller autoCaller (this);
     
    334324STDMETHODIMP OUSBDevice::COMGETTER(PortVersion)(USHORT *aPortVersion)
    335325{
    336     if (!aPortVersion)
    337         return E_POINTER;
     326    CheckComArgOutPointerValid(aPortVersion);
    338327
    339328    AutoCaller autoCaller (this);
     
    348337STDMETHODIMP OUSBDevice::COMGETTER(Remote)(BOOL *aRemote)
    349338{
    350     if (!aRemote)
    351         return E_POINTER;
     339    CheckComArgOutPointerValid(aRemote);
    352340
    353341    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp

    r14950 r14972  
    4444STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(ResultCode) (HRESULT *aResultCode)
    4545{
    46     if (!aResultCode)
    47         return E_POINTER;
     46    CheckComArgOutPointerValid(aResultCode);
    4847
    4948    *aResultCode = mResultCode;
     
    5352STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(InterfaceID) (GUIDPARAMOUT aIID)
    5453{
    55     if (!aIID)
    56         return E_POINTER;
     54    CheckComArgOutPointerValid(aIID);
    5755
    5856    mIID.cloneTo (aIID);
     
    6260STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Component) (BSTR *aComponent)
    6361{
    64     if (!aComponent)
    65         return E_POINTER;
     62    CheckComArgOutPointerValid(aComponent);
    6663
    6764    mComponent.cloneTo (aComponent);
     
    7168STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Text) (BSTR *aText)
    7269{
    73     if (!aText)
    74         return E_POINTER;
     70    CheckComArgOutPointerValid(aText);
    7571
    7672    mText.cloneTo (aText);
     
    8076STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Next) (IVirtualBoxErrorInfo **aNext)
    8177{
    82     if (!aNext)
    83         return E_POINTER;
     78    CheckComArgOutPointerValid(aNext);
    8479
    8580    /* this will set aNext to NULL if mNext is null */
     
    174169NS_IMETHODIMP VirtualBoxErrorInfo::GetMessage (char **aMessage)
    175170{
    176     if (!aMessage)
    177         return NS_ERROR_INVALID_POINTER;
     171    CheckComArgOutPointerValid(aMessage);
    178172
    179173    Utf8Str (mText).cloneTo (aMessage);
  • trunk/src/VBox/Main/include/FramebufferImpl.h

    r14949 r14972  
    8080
    8181private:
     82    // FIXME: declare these here until VBoxSupportsTranslation base
     83    //        is available in this class.
     84    static const char *tr (const char *a) { return a; }
     85    static HRESULT setError (HRESULT rc, const char *a,
     86                             const char *b, void *c) { return rc; }
     87
    8288    int mWidth;
    8389    int mHeight;
  • trunk/src/VBox/Main/include/VirtualBoxErrorInfoImpl.h

    r14949 r14972  
    8181
    8282private:
     83    // FIXME: declare these here until VBoxSupportsTranslation base
     84    //        is available in this class.
     85    static const char *tr (const char *a) { return a; }
     86    static HRESULT setError (HRESULT rc, const char *a,
     87                             const char *b, void *c) { return rc; }
    8388
    8489    HRESULT mResultCode;
Note: See TracChangeset for help on using the changeset viewer.

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