VirtualBox

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

Last change on this file since 94521 was 93115, checked in by vboxsync, 2 years ago

scm --update-copyright-year

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

© 2023 Oracle
ContactPrivacy policyTerms of Use