VirtualBox

Ignore:
Timestamp:
Jan 22, 2010 11:15:43 AM (15 years ago)
Author:
vboxsync
Message:

PDMIBASE refactoring; use UUID as interface IDs.

File:
1 edited

Legend:

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

    r25893 r25966  
    11/* $Id$ */
    2 
    32/** @file
    4  *
    53 * VirtualBox COM class implementation
    64 */
    75
    86/*
    9  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    108 *
    119 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4846/**
    4947 * Display driver instance data.
     48 *
     49 * @implements PDMIDISPLAYCONNECTOR
    5050 */
    5151typedef struct DRVMAINDISPLAY
     
    6666
    6767/** Converts PDMIDISPLAYCONNECTOR pointer to a DRVMAINDISPLAY pointer. */
    68 #define PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface) ( (PDRVMAINDISPLAY) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINDISPLAY, Connector)) )
     68#define PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface)  RT_FROM_MEMBER(pInterface, DRVMAINDISPLAY, Connector)
    6969
    7070#ifdef DEBUG_sunlover
     
    7676/////////////////////////////////////////////////////////////////////////////
    7777
    78 DEFINE_EMPTY_CTOR_DTOR (Display)
     78DEFINE_EMPTY_CTOR_DTOR(Display)
    7979
    8080HRESULT Display::FinalConstruct()
     
    33633363
    33643364/**
    3365  * Queries an interface to the driver.
    3366  *
    3367  * @returns Pointer to interface.
    3368  * @returns NULL if the interface was not supported by the driver.
    3369  * @param   pInterface          Pointer to this interface structure.
    3370  * @param   enmInterface        The requested interface identification.
     3365 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    33713366 */
    3372 DECLCALLBACK(void *)  Display::drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface)
     3367DECLCALLBACK(void *)  Display::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    33733368{
    33743369    PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    33753370    PDRVMAINDISPLAY pDrv = PDMINS_2_DATA(pDrvIns, PDRVMAINDISPLAY);
    3376     switch (enmInterface)
    3377     {
    3378         case PDMINTERFACE_BASE:
    3379             return &pDrvIns->IBase;
    3380         case PDMINTERFACE_DISPLAY_CONNECTOR:
    3381             return &pDrv->Connector;
    3382         default:
    3383             return NULL;
    3384     }
     3371    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
     3372        return &pDrvIns->IBase;
     3373    if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_DISPLAY_CONNECTOR) == 0)
     3374        return &pDrv->Connector;
     3375    return NULL;
    33853376}
    33863377
Note: See TracChangeset for help on using the changeset viewer.

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