VirtualBox

Changeset 25984 in vbox


Ignore:
Timestamp:
Jan 23, 2010 12:19:47 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56849
Message:

pdmifs.h: the penultimate batch of refactored interface ID code.

Location:
trunk
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmifs.h

    r25981 r25984  
    3838/** @defgroup grp_pdm_interfaces    The PDM Interface Definitions
    3939 * @ingroup grp_pdm
     40 *
     41 * For historical reasons (the PDMINTERFACE enum) a lot of interface was stuffed
     42 * together in this group instead, dragging stuff into global space that didn't
     43 * need to be there and making this file huge (>2500 lines).  Since we're using
     44 * UUIDs as interface identifiers (IIDs) now, no only generic PDM interface will
     45 * be added to this file.  Component specific interface should be defined in the
     46 * header file of that component.
     47 *
     48 * Interfaces consists of a method table (typedef'ed struct) and an interface
     49 * ID.  The typename of the method table should have an 'I' in it, be all
     50 * capitals and according to the rules, no underscores.  The interface ID is a
     51 * \#define constructed by appending '_IID' to the typename. The IID value is a
     52 * UUID string on the form "a2299c0d-b709-4551-aa5a-73f59ffbed74".  If you stick
     53 * to these rules, you can make use of the PDMIBASE_QUERY_INTERFACE and
     54 * PDMIBASE_RETURN_INTERFACE when querying interface and implementing
     55 * PDMIBASE::pfnQueryInterface respectively.
     56 *
    4057 * @{
    4158 */
     
    4663 * @{
    4764 */
    48 /** PDMIAUDIOCONNECTOR      - The audio driver interface.           (Up)    No coupling. */
    49 #define PDMINTERFACE_AUDIO_CONNECTOR            "85d52af5-b3aa-4b3e-b176-4b5ebfc52f47"
    50 
    51 /** PDMIAUDIOSNIFFERPORT    - The Audio Sniffer Device port interface. */
    52 #define PDMINTERFACE_AUDIO_SNIFFER_PORT         "83b95e02-68cb-470d-9dfc-25a0f8efe197"
    53 /** PDMIAUDIOSNIFFERCONNECTOR - The Audio Sniffer Driver connector interface. */
    54 #define PDMINTERFACE_AUDIO_SNIFFER_CONNECTOR    "433b64ab-e603-4933-bc97-8fe79b2bd0e0"
    55 
    56 /** PDMIVMMDEVPORT          - The VMM Device port interface. */
    57 #define PDMINTERFACE_VMMDEV_PORT                "d7e52035-3b6c-422e-9215-2a75646a945d"
    58 /** PDMIVMMDEVCONNECTOR     - The VMM Device connector interface. */
    59 #define PDMINTERFACE_VMMDEV_CONNECTOR           "38b96194-ee83-489e-b92e-73ee28a29439"
    60 
    61 /** PDMILEDPORTS            - The generic LED port interface.       (Down)  Coupled with PDMINTERFACE_LED_CONNECTORS. */
    62 #define PDMINTERFACE_LED_PORTS                  "435e0cec-8549-4ca0-8c0d-98e52f1dc038"
    63 /** PDMILEDCONNECTORS       - The generic LED connector interface.  (Up)    Coupled with PDMINTERFACE_LED_PORTS.  */
    64 #define PDMINTERFACE_LED_CONNECTORS             "8ed63568-82a7-4193-b57b-db8085ac4495"
    65 
    66 /** PDMIACPIPORT            - ACPI port interface.                  (Down)   Coupled with PDMINTERFACE_ACPI_CONNECTOR. */
    67 #define PDMINTERFACE_ACPI_PORT                  "30d3dc4c-6a73-40c8-80e9-34309deacbb3"
    68 /** PDMIACPICONNECTOR       - ACPI connector interface.             (Up)     Coupled with PDMINTERFACE_ACPI_PORT. */
    69 #define PDMINTERFACE_ACPI_CONNECTOR             "5f14bf8d-1edf-4e3a-a1e1-cca9fd08e359"
    70 
    71 /** PDMIHGCMPORT            - The Host-Guest communication manager port interface. Normally implemented by VMMDev. */
    72 #define PDMINTERFACE_HGCM_PORT                  "e00a0cbf-b75a-45c3-87f4-41cddbc5ae0b"
    73 /** PDMIHGCMCONNECTOR       - The Host-Guest communication manager connector interface. Normally implemented by Main::VMMDevInterface. */
    74 #define PDMINTERFACE_HGCM_CONNECTOR             "a1104758-c888-4437-8f2a-7bac17865b5c"
    75 
    76 /** VUSBIROOTHUBPORT        - VUSB RootHub port interface.          (Down)   Coupled with PDMINTERFACE_USB_RH_CONNECTOR. */
    77 #define PDMINTERFACE_VUSB_RH_PORT               "e38e2978-7aa2-4860-94b6-9ef4a066d8a0"
    78 /** VUSBIROOTHUBCONNECTOR   - VUSB RootHub connector interface.     (Up)     Coupled with PDMINTERFACE_USB_RH_PORT. */
    79 #define PDMINTERFACE_VUSB_RH_CONNECTOR          "d9a90c59-e3ff-4dff-9754-844557c3f7a0"
    80 /** VUSBIRHCONFIG           - VUSB RootHub configuration interface. (Main)   Used by the managment api. */
    81 #define PDMINTERFACE_VUSB_RH_CONFIG             "c354cd97-e85f-465e-bc12-b58798465f52"
    82 
    83 /** VUSBIDEVICE             - VUSB Device interface.                (Up)     No coupling. */
    84 #define PDMINTERFACE_VUSB_DEVICE                "88732dd3-0ccd-4625-b040-48804ac7a217"
    85 
    86 /** PDMIHOSTPARALLELPORT    - The Host Parallel port interface.     (Down)   Coupled with PDMINTERFACE_HOST_PARALLEL_CONNECTOR. */
    87 #define PDMINTERFACE_HOST_PARALLEL_PORT         "ac13e437-cd30-47ac-a271-6120571f3a22"
    88 /** PDMIHOSTPARALLELCONNECTOR - The Host Parallel connector interface (Up)   Coupled with PDMINTERFACE_HOST_PARALLEL_PORT. */
    89 #define PDMINTERFACE_HOST_PARALLEL_CONNECTOR    "a03567ca-b29e-4a1b-b2f3-a12435fa2982"
    90 
    91 /** PDMISCSIPORT            - The SCSI command execution port interface (Down) Coupled with PDMINTERFACE_SCSI_CONNECTOR. */
    92 #define PDMINTERFACE_SCSI_PORT                  "0f894add-714d-4a77-818e-a32fe3586ba4"
    93 /** PDMISCSICONNECTOR       - The SCSI command execution connector interface (Up) Coupled with PDMINTERFACE_SCSI_PORT. */
    94 #define PDMINTERFACE_SCSI_CONNECTOR             "94465fbd-a2f2-447e-88c9-7366421bfbfe"
     65
     66/* gsrc -r PDMINTERFACE */
     67
     68
    9569/** @} */
    9670
     
    14191393typedef struct PDMIHOSTPARALLELPORT *PPDMIHOSTPARALLELPORT;
    14201394/**
    1421  * Host parallel port interface.
     1395 * Host parallel port interface (down).
    14221396 * Pair with PDMIHOSTPARALLELCONNECTOR.
    14231397 */
     
    14441418    DECLR3CALLBACKMEMBER(int, pfnNotifyInterrupt,(PPDMIHOSTPARALLELPORT pInterface));
    14451419} PDMIHOSTPARALLELPORT;
     1420/** PDMIHOSTPARALLELPORT interface ID. */
     1421#define PDMIHOSTPARALLELPORT_IID                "ac13e437-cd30-47ac-a271-6120571f3a22"
    14461422
    14471423
     
    14501426typedef struct PDMIHOSTPARALLELCONNECTOR *PPDMIHOSTPARALLELCONNECTOR;
    14511427/**
    1452  * Host parallel connector interface
     1428 * Host parallel connector interface (up).
    14531429 * Pair with PDMIHOSTPARALLELPORT.
    14541430 */
     
    15171493    DECLR3CALLBACKMEMBER(int, pfnSetMode,(PPDMIHOSTPARALLELCONNECTOR pInterface, PDMPARALLELPORTMODE enmMode));
    15181494} PDMIHOSTPARALLELCONNECTOR;
     1495/** PDMIHOSTPARALLELCONNECTOR interface ID. */
     1496#define PDMIHOSTPARALLELCONNECTOR_IID           "a03567ca-b29e-4a1b-b2f3-a12435fa2982"
    15191497
    15201498
     
    15531531typedef struct PDMIACPIPORT *PPDMIACPIPORT;
    15541532/**
    1555  * ACPI port interface.
     1533 * ACPI port interface (down). Used by both the ACPI driver and (grumble) main.
     1534 * Pair with PDMIACPICONNECTOR.
    15561535 */
    15571536typedef struct PDMIACPIPORT
     
    16011580    DECLR3CALLBACKMEMBER(int, pfnGetCpuStatus,(PPDMIACPIPORT pInterface, unsigned uCpu, bool *pfLocked));
    16021581} PDMIACPIPORT;
     1582/** PDMIACPIPORT interface ID. */
     1583#define PDMIACPIPORT_IID                        "30d3dc4c-6a73-40c8-80e9-34309deacbb3"
     1584
    16031585
    16041586/** Pointer to an ACPI connector interface. */
    16051587typedef struct PDMIACPICONNECTOR *PPDMIACPICONNECTOR;
    16061588/**
    1607  * ACPI connector interface.
     1589 * ACPI connector interface (up).
     1590 * Pair with PDMIACPIPORT.
    16081591 */
    16091592typedef struct PDMIACPICONNECTOR
     
    16311614                                                     PPDMACPIBATSTATE penmBatteryState, uint32_t *pu32PresentRate));
    16321615} PDMIACPICONNECTOR;
     1616/** PDMIACPICONNECTOR interface ID. */
     1617#define PDMIACPICONNECTOR_IID                   "5f14bf8d-1edf-4e3a-a1e1-cca9fd08e359"
    16331618
    16341619
     
    16361621typedef struct PDMIVMMDEVPORT *PPDMIVMMDEVPORT;
    16371622/**
    1638  * VMMDevice port interface.
     1623 * VMMDevice port interface (down).
     1624 * Pair with PDMIVMMDEVCONNECTOR.
    16391625 */
    16401626typedef struct PDMIVMMDEVPORT
     
    17731759
    17741760} PDMIVMMDEVPORT;
     1761/** PDMIVMMDEVPORT interface ID. */
     1762#define PDMIVMMDEVPORT_IID                      "d7e52035-3b6c-422e-9215-2a75646a945d"
    17751763
    17761764/** @name Flags for PDMIVMMDEVPORT::pfnSetCredentials.
     
    17971785typedef struct PDMIVMMDEVCONNECTOR *PPDMIVMMDEVCONNECTOR;
    17981786/**
    1799  * VMMDev connector interface.
     1787 * VMMDev connector interface (up).
    18001788 * Pair with PDMIVMMDEVPORT.
    18011789 */
     
    19651953
    19661954} PDMIVMMDEVCONNECTOR;
     1955/** PDMIVMMDEVCONNECTOR interface ID. */
     1956#define PDMIVMMDEVCONNECTOR_IID                 "38b96194-ee83-489e-b92e-73ee28a29439"
    19671957
    19681958
     
    21112101typedef struct PDMIAUDIOCONNECTOR *PPDMIAUDIOCONNECTOR;
    21122102/**
    2113  * Audio connector interface.
     2103 * Audio connector interface (up).
     2104 * No interface pair yet.
    21142105 */
    21152106typedef struct PDMIAUDIOCONNECTOR
     
    21202111
    21212112} PDMIAUDIOCONNECTOR;
     2113/** PDMIAUDIOCONNECTOR interface ID. */
     2114#define PDMIAUDIOCONNECTOR_IID                  "85d52af5-b3aa-4b3e-b176-4b5ebfc52f47"
    21222115
    21232116
     
    21272120/** Pointer to a Audio Sniffer Device port interface. */
    21282121typedef struct PDMIAUDIOSNIFFERPORT *PPDMIAUDIOSNIFFERPORT;
    2129 
    2130 /**
    2131  * Audio Sniffer port interface.
     2122/**
     2123 * Audio Sniffer port interface (down).
     2124 * Pair with PDMIAUDIOSNIFFERCONNECTOR.
    21322125 */
    21332126typedef struct PDMIAUDIOSNIFFERPORT
    21342127{
    21352128    /**
    2136      * Enables or disables sniffing. If sniffing is being enabled also sets a flag
    2137      * whether the audio must be also left on the host.
     2129     * Enables or disables sniffing.
     2130     *
     2131     * If sniffing is being enabled also sets a flag whether the audio must be also
     2132     * left on the host.
    21382133     *
    21392134     * @returns VBox status code
     
    21472142
    21482143} PDMIAUDIOSNIFFERPORT;
     2144/** PDMIAUDIOSNIFFERPORT interface ID. */
     2145#define PDMIAUDIOSNIFFERPORT_IID                "83b95e02-68cb-470d-9dfc-25a0f8efe197"
     2146
    21492147
    21502148/** Pointer to a Audio Sniffer connector interface. */
     
    21522150
    21532151/**
    2154  * Audio Sniffer connector interface.
     2152 * Audio Sniffer connector interface (up).
    21552153 * Pair with PDMIAUDIOSNIFFERPORT.
    21562154 */
     
    21842182
    21852183} PDMIAUDIOSNIFFERCONNECTOR;
     2184/** PDMIAUDIOSNIFFERCONNECTOR - The Audio Sniffer Driver connector interface. */
     2185#define PDMIAUDIOSNIFFERCONNECTOR_IID           "433b64ab-e603-4933-bc97-8fe79b2bd0e0"
    21862186
    21872187
     
    22442244typedef const PDMLED *PCPDMLED;
    22452245
    2246 #define PDMLED_MAGIC ( 0x11335577 )
     2246/** Magic value for PDMLED::u32Magic. */
     2247#define PDMLED_MAGIC    UINT32_C(0x11335577)
    22472248
    22482249/** Pointer to an LED ports interface. */
    22492250typedef struct PDMILEDPORTS      *PPDMILEDPORTS;
    22502251/**
    2251  * Interface for exporting LEDs.
     2252 * Interface for exporting LEDs (down).
     2253 * Pair with PDMILEDCONNECTORS.
    22522254 */
    22532255typedef struct PDMILEDPORTS
     
    22642266
    22652267} PDMILEDPORTS;
     2268/** PDMILEDPORTS interface ID. */
     2269#define PDMILEDPORTS_IID                        "435e0cec-8549-4ca0-8c0d-98e52f1dc038"
    22662270
    22672271
     
    22692273typedef struct PDMILEDCONNECTORS *PPDMILEDCONNECTORS;
    22702274/**
    2271  * Interface for reading LEDs.
     2275 * Interface for reading LEDs (up).
     2276 * Pair with PDMILEDPORTS.
    22722277 */
    22732278typedef struct PDMILEDCONNECTORS
     
    22842289    DECLR3CALLBACKMEMBER(void, pfnUnitChanged,(PPDMILEDCONNECTORS pInterface, unsigned iLUN));
    22852290} PDMILEDCONNECTORS;
     2291/** PDMILEDCONNECTORS interface ID. */
     2292#define PDMILEDCONNECTORS_IID                   "8ed63568-82a7-4193-b57b-db8085ac4495"
    22862293
    22872294
     
    23032310/** Pointer to a HGCM port interface. */
    23042311typedef struct PDMIHGCMPORT *PPDMIHGCMPORT;
    2305 
    2306 /**
    2307  * HGCM port interface. Normally implemented by VMMDev.
     2312/**
     2313 * Host-Guest communication manager port interface (down). Normally implemented
     2314 * by VMMDev.
     2315 * Pair with PDMIHGCMCONNECTOR.
    23082316 */
    23092317typedef struct PDMIHGCMPORT
     
    23212329
    23222330} PDMIHGCMPORT;
    2323 
     2331/** PDMIHGCMPORT interface ID. */
     2332# define PDMIHGCMPORT_IID                       "e00a0cbf-b75a-45c3-87f4-41cddbc5ae0b"
     2333
     2334
     2335/** Pointer to a HGCM service location structure. */
     2336typedef struct HGCMSERVICELOCATION *PHGCMSERVICELOCATION;
    23242337
    23252338/** Pointer to a HGCM connector interface. */
    23262339typedef struct PDMIHGCMCONNECTOR *PPDMIHGCMCONNECTOR;
    2327 
    2328 /** Pointer to a HGCM service location structure. */
    2329 typedef struct HGCMSERVICELOCATION *PHGCMSERVICELOCATION;
    2330 
    2331 /**
    2332  * HGCM connector interface.
     2340/**
     2341 * The Host-Guest communication manager connector interface (up). Normally
     2342 * implemented by Main::VMMDevInterface.
    23332343 * Pair with PDMIHGCMPORT.
    23342344 */
     
    23742384
    23752385} PDMIHGCMCONNECTOR;
    2376 
    2377 #endif
     2386/** PDMIHGCMCONNECTOR interface ID. */
     2387# define PDMIHGCMCONNECTOR_IID                  "a1104758-c888-4437-8f2a-7bac17865b5c"
     2388
     2389#endif /* VBOX_WITH_HGCM */
    23782390
    23792391/**
     
    24222434/** Pointer to a SCSI port interface. */
    24232435typedef struct PDMISCSIPORT *PPDMISCSIPORT;
    2424 
    2425 /**
    2426  * SCSI port interface.
     2436/**
     2437 * SCSI command execution port interface (down).
    24272438 * Pair with PDMISCSICONNECTOR.
    24282439 */
     
    24412452
    24422453} PDMISCSIPORT;
     2454/** PDMISCSIPORT interface ID. */
     2455#define PDMISCSIPORT_IID                        "0f894add-714d-4a77-818e-a32fe3586ba4"
    24432456
    24442457
     
    24462459typedef struct PDMISCSICONNECTOR *PPDMISCSICONNECTOR;
    24472460/**
    2448  * SCSI connector interface.
     2461 * SCSI command execution connector interface (up).
    24492462 * Pair with PDMISCSIPORT.
    24502463 */
     
    24622475
    24632476} PDMISCSICONNECTOR;
     2477/** PDMISCSICONNECTOR interface ID. */
     2478#define PDMISCSICONNECTOR_IID                   "94465fbd-a2f2-447e-88c9-7366421bfbfe"
    24642479
    24652480
  • trunk/include/VBox/vusb.h

    r25728 r25984  
    352352
    353353/**
    354  * The VUSB RootHub port interface provided by the HCI.
     354 * The VUSB RootHub port interface provided by the HCI (down).
     355 * Pair with VUSBIROOTCONNECTOR
    355356 */
    356357typedef struct VUSBIROOTHUBPORT
     
    427428
    428429} VUSBIROOTHUBPORT;
     430/** VUSBIROOTHUBPORT interface ID. */
     431#define VUSBIROOTHUBPORT_IID                    "e38e2978-7aa2-4860-94b6-9ef4a066d8a0"
    429432
    430433
    431434/** Pointer to a VUSB RootHub connector interface. */
    432435typedef struct VUSBIROOTHUBCONNECTOR *PVUSBIROOTHUBCONNECTOR;
    433 
    434 /**
    435  * The VUSB RootHub connector interface provided by the VBox USB RootHub driver.
     436/**
     437 * The VUSB RootHub connector interface provided by the VBox USB RootHub driver
     438 * (up).
     439 * Pair with VUSBIROOTHUBPORT.
    436440 */
    437441typedef struct VUSBIROOTHUBCONNECTOR
     
    510514
    511515} VUSBIROOTHUBCONNECTOR;
     516/** VUSBIROOTHUBCONNECTOR interface ID. */
     517#define VUSBIROOTHUBCONNECTOR_IID               "d9a90c59-e3ff-4dff-9754-844557c3f7a0"
    512518
    513519
     
    554560/** Pointer to a Root Hub Configuration Interface. */
    555561typedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
    556 
    557562/**
    558563 * Root Hub Configuration Interface (intended for MAIN).
     564 * No interface pair.
    559565 */
    560566typedef struct VUSBIRHCONFIG
     
    583589
    584590} VUSBIRHCONFIG;
     591/** VUSBIRHCONFIG interface ID. */
     592#define VUSBIRHCONFIG_IID                       "c354cd97-e85f-465e-bc12-b58798465f52"
     593
    585594
    586595#ifdef IN_RING3
     
    641650
    642651/**
    643  * USB Device Interface.
     652 * USB Device Interface (up).
     653 * No interface pair.
    644654 */
    645655typedef struct VUSBIDEVICE
     
    698708
    699709} VUSBIDEVICE;
     710/** VUSBIDEVICE interface ID. */
     711#define VUSBIDEVICE_IID                         "88732dd3-0ccd-4625-b040-48804ac7a217"
    700712
    701713
  • trunk/include/iprt/assert.h

    r25647 r25984  
    672672#endif
    673673
     674/** @def AssertMsgStmt
     675 * Assert that an expression is true.  If it's not print message and hit
     676 * breakpoint and execute the statement.
     677 *
     678 * @param   expr    Expression which should be true.
     679 * @param   a       printf argument list (in parenthesis).
     680 * @param   stmt    Statement to execute in case of a failed assertion.
     681 *
     682 * @remarks The expression and statement will be evaluated in all build types.
     683 */
     684#ifdef RT_STRICT
     685# define AssertMsgStmt(expr, a, stmt)  \
     686    do { \
     687        if (RT_UNLIKELY(!(expr))) \
     688        { \
     689            RTAssertMsg1Weak(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
     690            RTAssertMsg2Weak a; \
     691            RTAssertPanic(); \
     692            stmt; \
     693        } \
     694    } while (0)
     695#else
     696# define AssertMsgStmt(expr, a, stmt)  \
     697    do { \
     698        if (RT_UNLIKELY(!(expr))) \
     699        { \
     700            stmt; \
     701        } \
     702    } while (0)
     703#endif
     704
    674705/** @def AssertMsgReturn
    675706 * Assert that an expression is true and returns if it isn't.
  • trunk/src/VBox/Devices/Audio/audio.c

    r25966 r25984  
    5454#define SW_NAME(sw) (sw)->name ? (sw)->name : "unknown"
    5555
     56/**
     57 * @implements PDMIAUDIOCONNECTOR
     58 */
    5659typedef struct DRVAUDIO
    5760{
     
    19341937    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    19351938        return &pDrvIns->IBase;
    1936     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_AUDIO_CONNECTOR) == 0)
    1937         return &pThis->IAudioConnector;
     1939    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIAUDIOCONNECTOR, &pThis->IAudioConnector);
    19381940    return NULL;
    19391941}
  • trunk/src/VBox/Devices/Audio/audiosniffer.c

    r25966 r25984  
    127127    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    128128        return &pThis->Base;
    129     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_AUDIO_SNIFFER_PORT) == 0)
    130         return &pThis->Port;
     129    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIAUDIOSNIFFERPORT, &pThis->Port);
    131130    return NULL;
    132131}
     
    184183    if (RT_SUCCESS(rc))
    185184    {
    186         pThis->pDrv = (PPDMIAUDIOSNIFFERCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_AUDIO_SNIFFER_CONNECTOR);
    187 
    188         if (!pThis->pDrv)
    189         {
    190             AssertMsgFailed(("LUN #0 doesn't have a Audio Sniffer connector interface rc=%Rrc\n", rc));
    191             rc = VERR_PDM_MISSING_INTERFACE;
    192         }
     185        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIAUDIOSNIFFERCONNECTOR);
     186        AssertMsgStmt(pThis->pDrv, ("LUN #0 doesn't have a Audio Sniffer connector interface rc=%Rrc\n", rc),
     187                      rc = VERR_PDM_MISSING_INTERFACE);
    193188    }
    194189    else if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r25981 r25984  
    44714471    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
    44724472    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    4473     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    4474         return &pThis->ILeds;
     4473    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    44754474    return NULL;
    44764475}
     
    50615060    if (RT_FAILURE(rc))
    50625061        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the status LUN"));
    5063     pState->pLedsConnector = (PPDMILEDCONNECTORS)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     5062    pState->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    50645063
    50655064    rc = PDMDevHlpDriverAttach(pDevIns, 0, &pState->IBase, &pState->pDrvBase, "Network Port");
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r25981 r25984  
    44914491    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKPORT, &pThis->INetworkPort);
    44924492    PDMIBASE_RETURN_INTERFACE(pszIID, PDMINETWORKCONFIG, &pThis->INetworkConfig);
    4493     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    4494         return &pThis->ILeds;
     4493    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    44954494    return NULL;
    44964495}
     
    51915190    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    51925191    if (RT_SUCCESS(rc))
    5193         pThis->pLedsConnector = (PPDMILEDCONNECTORS)
    5194             pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     5192        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    51955193    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    51965194    {
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r25968 r25984  
    19431943    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    19441944        return &pThis->IBase;
    1945     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_ACPI_PORT) == 0)
    1946         return &pThis->IACPIPort;
     1945    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIACPIPORT, &pThis->IACPIPort);
    19471946    return NULL;
    19481947}
     
    25042503   if (RT_SUCCESS(rc))
    25052504   {
    2506        s->pDrv = (PPDMIACPICONNECTOR)s->pDrvBase->pfnQueryInterface(s->pDrvBase, PDMINTERFACE_ACPI_CONNECTOR);
     2505       s->pDrv = PDMIBASE_QUERY_INTERFACE(s->pDrvBase, PDMIACPICONNECTOR);
    25072506       if (!s->pDrv)
    25082507           return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_MISSING_INTERFACE,
  • trunk/src/VBox/Devices/PC/DrvACPI.cpp

    r25966 r25984  
    9191    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    9292        return &pDrvIns->IBase;
    93     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_ACPI_CONNECTOR) == 0)
    94         return &pThis->IACPIConnector;
     93    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIACPICONNECTOR, &pThis->IACPIConnector);
    9594    return NULL;
    9695}
     
    751750     * Query the ACPI port interface.
    752751     */
    753     pThis->pPort = (PPDMIACPIPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase,
    754                                                                       PDMINTERFACE_ACPI_PORT);
     752    pThis->pPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIACPIPORT);
    755753    if (!pThis->pPort)
    756754    {
  • trunk/src/VBox/Devices/Parallel/DevParallel.cpp

    r25966 r25984  
    658658    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    659659        return &pThis->IBase;
    660     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HOST_PARALLEL_PORT) == 0)
    661         return &pThis->IHostParallelPort;
     660    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHOSTPARALLELPORT, &pThis->IHostParallelPort);
    662661    return NULL;
    663662}
     
    832831    if (RT_SUCCESS(rc))
    833832    {
    834         pThis->pDrvHostParallelConnector = (PDMIHOSTPARALLELCONNECTOR *)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase,
    835                                                                                                            PDMINTERFACE_HOST_PARALLEL_CONNECTOR);
    836         if (!pThis->pDrvHostParallelConnector)
    837         {
    838             AssertMsgFailed(("Configuration error: instance %d has no host parallel interface!\n", iInstance));
    839             return VERR_PDM_MISSING_INTERFACE;
    840         }
     833        pThis->pDrvHostParallelConnector = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIHOSTPARALLELCONNECTOR);
     834        AssertMsgReturn(pThis->pDrvHostParallelConnector,
     835                        ("Configuration error: instance %d has no host parallel interface!\n", iInstance),
     836                        VERR_PDM_MISSING_INTERFACE);
    841837        /** @todo provide read notification interface!!!! */
    842838    }
  • trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp

    r25971 r25984  
    9393    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    9494        return &pDrvIns->IBase;
    95     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HOST_PARALLEL_CONNECTOR) == 0)
    96         return &pThis->IHostParallelConnector;
     95    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHOSTPARALLELCONNECTOR, &pThis->IHostParallelConnector);
    9796    return NULL;
    9897}
     
    323322     * Get the IHostParallelPort interface of the above driver/device.
    324323     */
    325     pThis->pDrvHostParallelPort = (PPDMIHOSTPARALLELPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_HOST_PARALLEL_PORT);
     324    pThis->pDrvHostParallelPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIHOSTPARALLELPORT);
    326325    if (!pThis->pDrvHostParallelPort)
    327326        return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_MISSING_INTERFACE_ABOVE, RT_SRC_POS, N_("Parallel#%d has no parallel port interface above"),
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r25974 r25984  
    23932393    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    23942394        return &pThis->IBase;
    2395     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    2396         return &pThis->ILeds;
     2395    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    23972396    return NULL;
    23982397}
     
    68596858    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    68606859    if (RT_SUCCESS(rc))
    6861         pThis->pLedsConnector = (PDMILEDCONNECTORS *)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     6860        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    68626861    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    68636862    {
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r25974 r25984  
    52365236    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    52375237        return &pThis->IBase;
    5238     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    5239         return &pThis->ILeds;
     5238    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    52405239    return NULL;
    52415240}
     
    67756774    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    67766775    if (RT_SUCCESS(rc))
    6777         pThis->pLedsConnector = (PDMILEDCONNECTORS *)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     6776        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    67786777    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    67796778    {
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r25966 r25984  
    23572357    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    23582358        return &pDevice->IBase;
    2359     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_SCSI_PORT) == 0)
    2360         return &pDevice->ISCSIPort;
    2361     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    2362         return &pDevice->ILed;
     2359    PDMIBASE_RETURN_INTERFACE(pszIID, PDMISCSIPORT, &pDevice->ISCSIPort);
     2360    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pDevice->ILed);
    23632361    return NULL;
    23642362}
     
    23922390    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    23932391        return &pThis->IBase;
    2394     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    2395         return &pThis->ILeds;
     2392    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    23962393    return NULL;
    23972394}
     
    24582455    {
    24592456        /* Get SCSI connector interface. */
    2460         pDevice->pDrvSCSIConnector = (PPDMISCSICONNECTOR)pDevice->pDrvBase->pfnQueryInterface(pDevice->pDrvBase, PDMINTERFACE_SCSI_CONNECTOR);
     2457        pDevice->pDrvSCSIConnector = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMISCSICONNECTOR);
    24612458        AssertMsgReturn(pDevice->pDrvSCSIConnector, ("Missing SCSI interface below\n"), VERR_PDM_MISSING_INTERFACE);
    24622459        pDevice->fPresent = true;
     
    26422639        {
    26432640            /* Get SCSI connector interface. */
    2644             pDevice->pDrvSCSIConnector = (PPDMISCSICONNECTOR)pDevice->pDrvBase->pfnQueryInterface(pDevice->pDrvBase, PDMINTERFACE_SCSI_CONNECTOR);
     2641            pDevice->pDrvSCSIConnector = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMISCSICONNECTOR);
    26452642            AssertMsgReturn(pDevice->pDrvSCSIConnector, ("Missing SCSI interface below\n"), VERR_PDM_MISSING_INTERFACE);
    26462643
     
    26672664    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    26682665    if (RT_SUCCESS(rc))
    2669         pThis->pLedsConnector = (PDMILEDCONNECTORS *)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     2666        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    26702667    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    26712668    {
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r25966 r25984  
    42034203    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    42044204        return &pDevice->IBase;
    4205     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_SCSI_PORT) == 0)
    4206         return &pDevice->ISCSIPort;
    4207     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    4208         return &pDevice->ILed;
     4205    PDMIBASE_RETURN_INTERFACE(pszIID, PDMISCSIPORT, &pDevice->ISCSIPort);
     4206    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pDevice->ILed);
    42094207    return NULL;
    42104208}
     
    42384236    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    42394237        return &pThis->IBase;
    4240     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    4241         return &pThis->ILeds;
     4238    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    42424239    return NULL;
    42434240}
     
    43094306    {
    43104307        /* Get SCSI connector interface. */
    4311         pDevice->pDrvSCSIConnector = (PPDMISCSICONNECTOR)pDevice->pDrvBase->pfnQueryInterface(pDevice->pDrvBase, PDMINTERFACE_SCSI_CONNECTOR);
     4308        pDevice->pDrvSCSIConnector = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMISCSICONNECTOR);
    43124309        AssertMsgReturn(pDevice->pDrvSCSIConnector, ("Missing SCSI interface below\n"), VERR_PDM_MISSING_INTERFACE);
    43134310    }
     
    45954592        {
    45964593            /* Get SCSI connector interface. */
    4597             pDevice->pDrvSCSIConnector = (PPDMISCSICONNECTOR)pDevice->pDrvBase->pfnQueryInterface(pDevice->pDrvBase, PDMINTERFACE_SCSI_CONNECTOR);
     4594            pDevice->pDrvSCSIConnector = PDMIBASE_QUERY_INTERFACE(pDevice->pDrvBase, PDMISCSICONNECTOR);
    45984595            AssertMsgReturn(pDevice->pDrvSCSIConnector, ("Missing SCSI interface below\n"), VERR_PDM_MISSING_INTERFACE);
    45994596        }
     
    46174614    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
    46184615    if (RT_SUCCESS(rc))
    4619         pThis->pLedsConnector = (PDMILEDCONNECTORS *)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     4616        pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    46204617    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    46214618    {
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r25974 r25984  
    807807    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    808808        return &pDrvIns->IBase;
    809     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_SCSI_CONNECTOR) == 0)
    810         return &pThis->ISCSIConnector;
     809    PDMIBASE_RETURN_INTERFACE(pszIID, PDMISCSICONNECTOR, &pThis->ISCSIConnector);
    811810    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBLOCKPORT, &pThis->IPort);
    812811    return NULL;
     
    972971
    973972    /* Query the SCSI port interface above. */
    974     pThis->pDevScsiPort = (PPDMISCSIPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_SCSI_PORT);
     973    pThis->pDevScsiPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMISCSIPORT);
    975974    AssertMsgReturn(pThis->pDevScsiPort, ("Missing SCSI port interface above\n"), VERR_PDM_MISSING_INTERFACE);
    976975
     
    978977
    979978    /* Query the optional LED interface above. */
    980     pThis->pLedPort = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS);
     979    pThis->pLedPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMILEDPORTS);
    981980    if (pThis->pLedPort != NULL)
    982981    {
  • trunk/src/VBox/Devices/Storage/DrvSCSIHost.cpp

    r25966 r25984  
    406406    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    407407        return &pDrvIns->IBase;
    408     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_SCSI_CONNECTOR) == 0)
    409         return &pThis->ISCSIConnector;
     408    PDMIBASE_RETURN_INTERFACE(pszIID, PDMISCSICONNECTOR, &pThis->ISCSIConnector);
    410409    return NULL;
    411410}
     
    465464
    466465    /* Query the SCSI port interface above. */
    467     pThis->pDevScsiPort = (PPDMISCSIPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_SCSI_PORT);
     466    pThis->pDevScsiPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMISCSIPORT);
    468467    AssertMsgReturn(pThis->pDevScsiPort, ("Missing SCSI port interface above\n"), VERR_PDM_MISSING_INTERFACE);
    469468
  • trunk/src/VBox/Devices/Storage/fdc.c

    r25974 r25984  
    25422542    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    25432543        return &pThis->IBaseStatus;
    2544     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    2545         return &pThis->ILeds;
     2544    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    25462545    return NULL;
    25472546}
     
    28882887    rc = PDMDevHlpDriverAttach (pDevIns, PDM_STATUS_LUN, &fdctrl->IBaseStatus, &pBase, "Status Port");
    28892888    if (RT_SUCCESS (rc)) {
    2890         fdctrl->pLedsConnector =
    2891             pBase->pfnQueryInterface (pBase, PDMINTERFACE_LED_CONNECTORS);
     2889        fdctrl->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    28922890    } else if (rc != VERR_PDM_NO_ATTACHED_DRIVER) {
    28932891        AssertMsgFailed (("Failed to attach to status driver. rc=%Rrc\n",
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r25966 r25984  
    18361836    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    18371837        return &pThis->Base;
    1838     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_VMMDEV_PORT) == 0)
    1839         return &pThis->Port;
     1838    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIVMMDEVPORT, &pThis->Port);
    18401839#ifdef VBOX_WITH_HGCM
    1841     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HGCM_PORT) == 0)
    1842         return &pThis->HGCMPort;
     1840    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHGCMPORT, &pThis->HGCMPort);
    18431841#endif
    1844     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    1845         /* Currently only for shared folders */
    1846         return &pThis->SharedFolders.ILeds;
     1842    /* Currently only for shared folders. */
     1843    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->SharedFolders.ILeds);
    18471844    return NULL;
    18481845}
     
    25902587    if (RT_SUCCESS(rc))
    25912588    {
    2592         pThis->pDrv = (PPDMIVMMDEVCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_VMMDEV_CONNECTOR);
    2593         if (!pThis->pDrv)
    2594             AssertMsgFailedReturn(("LUN #0 doesn't have a VMMDev connector interface!\n"), VERR_PDM_MISSING_INTERFACE);
     2589        pThis->pDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIVMMDEVCONNECTOR);
     2590        AssertMsgReturn(pThis->pDrv, ("LUN #0 doesn't have a VMMDev connector interface!\n"), VERR_PDM_MISSING_INTERFACE);
    25952591#ifdef VBOX_WITH_HGCM
    2596         pThis->pHGCMDrv = (PPDMIHGCMCONNECTOR)pThis->pDrvBase->pfnQueryInterface(pThis->pDrvBase, PDMINTERFACE_HGCM_CONNECTOR);
     2592        pThis->pHGCMDrv = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIHGCMCONNECTOR);
    25972593        if (!pThis->pHGCMDrv)
    25982594        {
     
    26162612    rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->Base, &pBase, "Status Port");
    26172613    if (RT_SUCCESS(rc))
    2618         pThis->SharedFolders.pLedsConnector = (PPDMILEDCONNECTORS)
    2619             pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     2614        pThis->SharedFolders.pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    26202615    else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
    26212616    {
  • trunk/src/VBox/Devices/VirtIO/Virtio.cpp

    r25966 r25984  
    533533    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    534534        return &pThis->IBase;
    535     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0)
    536         return &pThis->ILeds;
     535    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    537536    return NULL;
    538537}
     
    837836    if (RT_FAILURE(rc))
    838837        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the status LUN"));
    839     pState->pLedsConnector = (PPDMILEDCONNECTORS)pBase->pfnQueryInterface(pBase, PDMINTERFACE_LED_CONNECTORS);
     838    pState->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
    840839
    841840    pState->nQueues = nQueues;
  • trunk/src/VBox/Frontends/VBoxBFE/HostUSBImpl.cpp

    r23021 r25984  
    224224        return setError (E_FAIL,
    225225                         tr ("Device is not in a capturable state"));
    226     PVUSBIRHCONFIG pRhConfig = (PVUSBIRHCONFIG)pBase->pfnQueryInterface (pBase, PDMINTERFACE_VUSB_RH_CONFIG);
    227     AssertReturn (pRhConfig, E_FAIL);
     226    PVUSBIRHCONFIG pRhConfig = PDMIBASE_QUERY_INTERFACE(pBase, VUSBIRHCONFIG);
     227    AssertReturn(pRhConfig, E_FAIL);
    228228
    229229    /*
     
    293293        if (RT_SUCCESS (vrc))
    294294        {
    295             PVUSBIRHCONFIG pRhConfig = (PVUSBIRHCONFIG)pBase->pfnQueryInterface (pBase, PDMINTERFACE_VUSB_RH_CONFIG);
    296             Assert (pRhConfig);
     295            PVUSBIRHCONFIG pRhConfig = PDMIBASE_QUERY_INTERFACE(pBase, VUSBIRHCONFIG);
     296            Assert(pRhConfig);
    297297
    298298            RTUUID Uuid = aDevice->id();
  • trunk/src/VBox/Frontends/VBoxBFE/StatusImpl.cpp

    r25966 r25984  
    66
    77/*
    8  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9393    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    9494        return &pDrvIns->IBase;
    95     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_CONNECTORS) == 0)
    96         return &pDrv->ILedConnectors;
     95    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDCONNECTORS, &pDrv->ILedConnectors);
    9796    return NULL;
    9897}
     
    180179     * query the LEDs we want.
    181180     */
    182     pData->pLedPorts = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS);
    183     if (!pData->pLedPorts)
    184     {
    185         AssertMsgFailed(("Configuration error: No led ports interface above!\n"));
    186         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    187     }
     181    pData->pLedPorts = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMILEDPORTS);
     182    AssertMsgReturn(pData->pLedPorts, ("Configuration error: No led ports interface above!\n"),
     183                    VERR_PDM_MISSING_INTERFACE_ABOVE);
    188184
    189185    for (unsigned i = pData->iFirstLUN; i <= pData->iLastLUN; i++)
  • trunk/src/VBox/Frontends/VBoxBFE/VMControl.cpp

    r25771 r25984  
    103103    {
    104104        Assert (pBase);
    105         PPDMIACPIPORT pPort =
    106             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     105        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    107106        vrc = pPort ? pPort->pfnPowerButtonPress(pPort) : VERR_INVALID_POINTER;
    108107    }
     
    121120    {
    122121        Assert (pBase);
    123         PPDMIACPIPORT pPort =
    124             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     122        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    125123        vrc = pPort ? pPort->pfnSleepButtonPress(pPort) : VERR_INVALID_POINTER;
    126124    }
  • trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp

    r25966 r25984  
    66
    77/*
    8  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    353353    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    354354        return &pDrvIns->IBase;
    355     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_VMMDEV_CONNECTOR) == 0)
    356         return &pDrv->Connector;
    357 #ifdef VBOX_WITH_HGCM
    358     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HGCM_CONNECTOR) == 0)
    359     {
    360         if (fActivateHGCM())
    361             return &pDrv->HGCMConnector;
    362         return NULL;
    363     }
     355    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIVMMDEVCONNECTOR, &pDrv->Connector);
     356#ifdef VBOX_WITH_HGCM
     357    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHGCMCONNECTOR, fActivateHGCM() ? &pDrv->HGCMConnector : NULL);
    364358#endif
    365359    return NULL;
     
    426420     * Get the IVMMDevPort interface of the above driver/device.
    427421     */
    428     pData->pUpPort = (PPDMIVMMDEVPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_VMMDEV_PORT);
    429     if (!pData->pUpPort)
    430     {
    431         AssertMsgFailed(("Configuration error: No VMMDev port interface above!\n"));
    432         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    433     }
     422    pData->pUpPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIVMMDEVPORT);
     423    AssertMsgReturn(pData->pUpPort, ("Configuration error: No VMMDev port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
    434424
    435425#ifdef VBOX_WITH_HGCM
    436426    if (fActivateHGCM())
    437427    {
    438         pData->pHGCMPort = (PPDMIHGCMPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_HGCM_PORT);
    439         if (!pData->pHGCMPort)
    440         {
    441             AssertMsgFailed(("Configuration error: No HGCM port interface above!\n"));
    442             return VERR_PDM_MISSING_INTERFACE_ABOVE;
    443         }
     428        pData->pHGCMPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIHGCMPORT);
     429        AssertMsgReturn(pData->pHGCMPort, ("Configuration error: No HGCM port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
    444430    }
    445431#endif
  • trunk/src/VBox/Main/AudioSnifferInterface.cpp

    r25966 r25984  
    126126    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    127127        return &pDrvIns->IBase;
    128     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_AUDIO_SNIFFER_CONNECTOR) == 0)
    129         return &pDrv->Connector;
     128    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIAUDIOSNIFFERCONNECTOR, &pDrv->Connector);
    130129    return NULL;
    131130}
     
    181180     * Get the Audio Sniffer Port interface of the above driver/device.
    182181     */
    183     pThis->pUpPort = (PPDMIAUDIOSNIFFERPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_AUDIO_SNIFFER_PORT);
     182    pThis->pUpPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIAUDIOSNIFFERPORT);
    184183    if (!pThis->pUpPort)
    185184    {
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r25981 r25984  
    17871787        Assert(pBase);
    17881788
    1789         PPDMIACPIPORT pPort =
    1790             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     1789        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    17911790
    17921791        vrc = getVMMDev()->getVMMDevPort()->pfnCpuHotUnplug(getVMMDev()->getVMMDevPort(), idCpuCore, idCpuPackage);
     
    20832082    {
    20842083        Assert(pBase);
    2085         PPDMIACPIPORT pPort =
    2086             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2084        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    20872085        vrc = pPort ? pPort->pfnPowerButtonPress(pPort) : VERR_INVALID_POINTER;
    20882086    }
     
    21282126    {
    21292127        Assert(pBase);
    2130         PPDMIACPIPORT pPort =
    2131             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2128        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    21322129        vrc = pPort ? pPort->pfnGetPowerButtonHandled(pPort, &handled) : VERR_INVALID_POINTER;
    21332130    }
     
    21752172    {
    21762173        Assert(pBase);
    2177         PPDMIACPIPORT pPort =
    2178             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2174        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    21792175        vrc = pPort ? pPort->pfnGetGuestEnteredACPIMode(pPort, &entered) : VERR_INVALID_POINTER;
    21802176    }
     
    22092205    {
    22102206        Assert(pBase);
    2211         PPDMIACPIPORT pPort =
    2212             (PPDMIACPIPORT) pBase->pfnQueryInterface(pBase, PDMINTERFACE_ACPI_PORT);
     2207        PPDMIACPIPORT pPort = PDMIBASE_QUERY_INTERFACE(pBase, PDMIACPIPORT);
    22132208        vrc = pPort ? pPort->pfnSleepButtonPress(pPort) : VERR_INVALID_POINTER;
    22142209    }
     
    81378132    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    81388133        return &pDrvIns->IBase;
    8139     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_CONNECTORS) == 0)
    8140         return &pThis->ILedConnectors;
     8134    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDCONNECTORS, &pThis->ILedConnectors);
    81418135    return NULL;
    81428136}
     
    82248218     * query the LEDs we want.
    82258219     */
    8226     pData->pLedPorts = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS);
    8227     if (!pData->pLedPorts)
    8228     {
    8229         AssertMsgFailed(("Configuration error: No led ports interface above!\n"));
    8230         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    8231     }
     8220    pData->pLedPorts = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMILEDPORTS);
     8221    AssertMsgReturn(pData->pLedPorts, ("Configuration error: No led ports interface above!\n"),
     8222                    VERR_PDM_MISSING_INTERFACE_ABOVE);
    82328223
    82338224    for (unsigned i = pData->iFirstLUN; i <= pData->iLastLUN; ++i)
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r25973 r25984  
    661661    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    662662        return &pDrvIns->IBase;
    663     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_VMMDEV_CONNECTOR) == 0)
    664         return &pDrv->Connector;
    665 #ifdef VBOX_WITH_HGCM
    666     if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_HGCM_CONNECTOR) == 0)
    667         return &pDrv->HGCMConnector;
     663    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIVMMDEVCONNECTOR, &pDrv->Connector);
     664#ifdef VBOX_WITH_HGCM
     665    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHGCMCONNECTOR, &pDrv->HGCMConnector);
    668666#endif
    669667    return NULL;
     
    751749     * Get the IVMMDevPort interface of the above driver/device.
    752750     */
    753     pData->pUpPort = (PPDMIVMMDEVPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_VMMDEV_PORT);
    754     if (!pData->pUpPort)
    755     {
    756         AssertMsgFailed(("Configuration error: No VMMDev port interface above!\n"));
    757         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    758     }
    759 
    760 #ifdef VBOX_WITH_HGCM
    761     pData->pHGCMPort = (PPDMIHGCMPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_HGCM_PORT);
    762     if (!pData->pHGCMPort)
    763     {
    764         AssertMsgFailed(("Configuration error: No HGCM port interface above!\n"));
    765         return VERR_PDM_MISSING_INTERFACE_ABOVE;
    766     }
     751    pData->pUpPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIVMMDEVPORT);
     752    AssertMsgReturn(pData->pUpPort, ("Configuration error: No VMMDev port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
     753
     754#ifdef VBOX_WITH_HGCM
     755    pData->pHGCMPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMIHGCMPORT);
     756    AssertMsgReturn(pData->pHGCMPort, ("Configuration error: No HGCM port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
    767757#endif
    768758
     
    791781
    792782        LogRel(("Shared Folders service loaded.\n"));
    793         pLedPort = (PPDMILEDPORTS)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_LED_PORTS);
    794         if (!pLedPort)
    795         {
    796             AssertMsgFailed(("Configuration error: No LED port interface above!\n"));
    797             return VERR_PDM_MISSING_INTERFACE_ABOVE;
    798         }
     783        pLedPort = PDMIBASE_QUERY_INTERFACE(pDrvIns->pUpBase, PDMILEDPORTS);
     784        AssertMsgReturn(pLedPort, ("Configuration error: No LED port interface above!\n"), VERR_PDM_MISSING_INTERFACE_ABOVE);
    799785        rc = pLedPort->pfnQueryStatusLed(pLedPort, 0, &pLed);
    800786        if (RT_SUCCESS(rc) && pLed)
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