VirtualBox

Changeset 63886 in vbox for trunk/src/VBox/Devices/Samples


Ignore:
Timestamp:
Sep 19, 2016 1:02:14 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110750
Message:

Devices/Samples: more version paranoia (solves unused parameters and is more safe)

Location:
trunk/src/VBox/Devices/Samples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Samples/DrvStorageFilter.cpp

    r63878 r63886  
    2323#include <VBox/vmm/pdmdrv.h>
    2424#include <VBox/vmm/pdmstorageifs.h>
     25#include <VBox/version.h>
    2526#include <VBox/log.h>
    2627
     
    414415             u32Version, pCallbacks->u32Version));
    415416
     417    AssertLogRelMsgReturn(u32Version >= VBOX_VERSION,
     418                          ("VirtualBox version %#x, expected %#x or higher\n", u32Version, VBOX_VERSION),
     419                          VERR_VERSION_MISMATCH);
    416420    AssertLogRelMsgReturn(pCallbacks->u32Version == PDM_DRVREG_CB_VERSION,
    417                           ("%#x, expected %#x\n", pCallbacks->u32Version, PDM_DRVREG_CB_VERSION),
     421                          ("callback version %#x, expected %#x\n", pCallbacks->u32Version, PDM_DRVREG_CB_VERSION),
    418422                          VERR_VERSION_MISMATCH);
    419423
  • trunk/src/VBox/Devices/Samples/VBoxSampleDevice.cpp

    r63884 r63886  
    154154    LogFlow(("VBoxSampleDevice::VBoxDevicesRegister: u32Version=%#x pCallbacks->u32Version=%#x\n", u32Version, pCallbacks->u32Version));
    155155
     156    AssertLogRelMsgReturn(u32Version >= VBOX_VERSION,
     157                          ("VirtualBox version %#x, expected %#x or higher\n", u32Version, VBOX_VERSION),
     158                          VERR_VERSION_MISMATCH);
    156159    AssertLogRelMsgReturn(pCallbacks->u32Version == PDM_DEVREG_CB_VERSION,
    157                           ("%#x, expected %#x\n", pCallbacks->u32Version, PDM_DEVREG_CB_VERSION),
     160                          ("callback version %#x, expected %#x\n", pCallbacks->u32Version, PDM_DEVREG_CB_VERSION),
    158161                          VERR_VERSION_MISMATCH);
    159162
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