VirtualBox

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

Last change on this file since 98273 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

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

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