KeyboardImpl.cpp revision 84fdcc72b1724a0e3cb516f7732241fe6768578c
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * VirtualBox COM class implementation
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * Copyright (C) 2006-2008 Oracle Corporation
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * available from http://www.virtualbox.org. This file is free software;
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * you can redistribute it and/or modify it under the terms of the GNU
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * General Public License (GPL) as published by the Free Software
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync////////////////////////////////////////////////////////////////////////////////
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync////////////////////////////////////////////////////////////////////////////////
5330cda3253fc3d94ed03a7609774e8c85a4c56dvboxsync/** @name Keyboard device capabilities bitfield
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /** The keyboard device does not wish to receive keystrokes. */
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /** The keyboard device does wishes to receive keystrokes. */
5330cda3253fc3d94ed03a7609774e8c85a4c56dvboxsync * Keyboard driver instance data.
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /** Pointer to the keyboard object. */
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /** Pointer to the driver instance structure. */
5330cda3253fc3d94ed03a7609774e8c85a4c56dvboxsync /** Pointer to the keyboard port interface of the driver/device above us. */
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /** Our keyboard connector interface. */
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /** The capabilities of this device. */
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync/** Converts PDMIVMMDEVCONNECTOR pointer to a DRVMAINVMMDEV pointer. */
5330cda3253fc3d94ed03a7609774e8c85a4c56dvboxsync#define PPDMIKEYBOARDCONNECTOR_2_MAINKEYBOARD(pInterface) ( (PDRVMAINKEYBOARD) ((uintptr_t)pInterface - RT_OFFSETOF(DRVMAINKEYBOARD, IConnector)) )
5330cda3253fc3d94ed03a7609774e8c85a4c56dvboxsync// constructor / destructor
5330cda3253fc3d94ed03a7609774e8c85a4c56dvboxsync////////////////////////////////////////////////////////////////////////////////
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync// public methods
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync////////////////////////////////////////////////////////////////////////////////
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * Initializes the keyboard object.
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * @returns COM result indicator
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync * @param parent handle of our parent object
c74a793852e1fd8994bf9bd2495e1b731ed4ac09vboxsync /* Enclose the state transition NotReady->InInit->Ready */
return S_OK;
for (unsigned i = 0; i < KEYBOARD_MAX_DEVICES; ++i)
if (mpDrv[i])
mfVMMDevInited = true;
if (!pUpPort)
return rc;
return rc;
return E_INVALIDARG;
if (!pUpPort)
return rc;
vrc);
if (codesStored)
return rc;
return NULL;
if (fActive)
return VERR_PDM_MISSING_INTERFACE_ABOVE;
void *pv;
return rc;
unsigned cDev;
return VERR_NO_MORE_HANDLES;
return VINF_SUCCESS;
sizeof(DRVMAINKEYBOARD),
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,