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/Frontends/VBoxBFE/KeyboardImpl.cpp

    r25893 r25966  
     1/* $Id$ */
    12/** @file
    2  *
    33 * VBox frontends: Basic Frontend (BFE):
    44 * Implementation of Keyboard class and related things
     
    3333#include <VBox/log.h>
    3434#include <iprt/asm.h>
     35#include <iprt/uuid.h>
    3536#include "KeyboardImpl.h"
    3637
     
    157158
    158159/**
    159  * Queries an interface to the driver.
    160  *
    161  * @returns Pointer to interface.
    162  * @returns NULL if the interface was not supported by the driver.
    163  * @param   pInterface          Pointer to this interface structure.
    164  * @param   enmInterface        The requested interface identification.
    165  */
    166 DECLCALLBACK(void *)  Keyboard::drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface)
     160 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
     161 */
     162DECLCALLBACK(void *)  Keyboard::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    167163{
    168164    PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    169165    PDRVMAINKEYBOARD pDrv = PDMINS_2_DATA(pDrvIns, PDRVMAINKEYBOARD);
    170     switch (enmInterface)
    171     {
    172         case PDMINTERFACE_BASE:
    173             return &pDrvIns->IBase;
    174         case PDMINTERFACE_KEYBOARD_CONNECTOR:
    175             return &pDrv->Connector;
    176         default:
    177             return NULL;
    178     }
     166    if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
     167        return &pDrvIns->IBase;
     168    if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_KEYBOARD_CONNECTOR) == 0)
     169        return &pDrv->Connector;
     170    return NULL;
    179171}
    180172
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