VirtualBox

source: vbox/trunk/src/VBox/Main/src-client/VBoxDriversRegister.cpp@ 53442

Last change on this file since 53442 was 53442, checked in by vboxsync, 10 years ago

PDM Audio: Branch -> trunk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/** @file
2 *
3 * Main driver registration.
4 */
5
6/*
7 * Copyright (C) 2006-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include "MouseImpl.h"
23#include "KeyboardImpl.h"
24#include "DisplayImpl.h"
25#include "VMMDev.h"
26#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
27#include "DrvAudioVRDE.h"
28#else
29#include "AudioSnifferInterface.h"
30#endif
31#include "Nvram.h"
32#include "UsbWebcamInterface.h"
33#ifdef VBOX_WITH_USB_CARDREADER
34# include "UsbCardReader.h"
35#endif
36#include "ConsoleImpl.h"
37#ifdef VBOX_WITH_PCI_PASSTHROUGH
38# include "PCIRawDevImpl.h"
39#endif
40
41#include "Logging.h"
42
43#include <VBox/vmm/pdmdrv.h>
44#include <VBox/version.h>
45
46/**
47 * Register the main drivers.
48 *
49 * @returns VBox status code.
50 * @param pCallbacks Pointer to the callback table.
51 * @param u32Version VBox version number.
52 */
53extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
54{
55 LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
56 AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
57
58 int rc = pCallbacks->pfnRegister(pCallbacks, &Mouse::DrvReg);
59 if (RT_FAILURE(rc))
60 return rc;
61
62 rc = pCallbacks->pfnRegister(pCallbacks, &Keyboard::DrvReg);
63 if (RT_FAILURE(rc))
64 return rc;
65
66 rc = pCallbacks->pfnRegister(pCallbacks, &Display::DrvReg);
67 if (RT_FAILURE(rc))
68 return rc;
69
70 rc = pCallbacks->pfnRegister(pCallbacks, &VMMDev::DrvReg);
71 if (RT_FAILURE(rc))
72 return rc;
73
74#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
75 rc = pCallbacks->pfnRegister(pCallbacks, &AudioVRDE::DrvReg);
76#else
77 rc = pCallbacks->pfnRegister(pCallbacks, &AudioSniffer::DrvReg);
78#endif
79 if (RT_FAILURE(rc))
80 return rc;
81
82 rc = pCallbacks->pfnRegister(pCallbacks, &Nvram::DrvReg);
83 if (RT_FAILURE(rc))
84 return rc;
85
86 rc = pCallbacks->pfnRegister(pCallbacks, &EmWebcam::DrvReg);
87 if (RT_FAILURE(rc))
88 return rc;
89
90#ifdef VBOX_WITH_USB_CARDREADER
91 rc = pCallbacks->pfnRegister(pCallbacks, &UsbCardReader::DrvReg);
92 if (RT_FAILURE(rc))
93 return rc;
94#endif
95
96 rc = pCallbacks->pfnRegister(pCallbacks, &Console::DrvStatusReg);
97 if (RT_FAILURE(rc))
98 return rc;
99
100#ifdef VBOX_WITH_PCI_PASSTHROUGH
101 rc = pCallbacks->pfnRegister(pCallbacks, &PCIRawDev::DrvReg);
102 if (RT_FAILURE(rc))
103 return rc;
104#endif
105
106 return VINF_SUCCESS;
107}
108/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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