VirtualBox

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

Last change on this file since 76573 was 76553, checked in by vboxsync, 6 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 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 *
4 * Main driver registration.
5 */
6
7/*
8 * Copyright (C) 2006-2019 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#ifdef VBOX_WITH_AUDIO_VRDE
31# include "DrvAudioVRDE.h"
32#endif
33#ifdef VBOX_WITH_AUDIO_RECORDING
34# include "DrvAudioRec.h"
35#endif
36#include "Nvram.h"
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 rc = pCallbacks->pfnRegister(pCallbacks, &Nvram::DrvReg);
88 if (RT_FAILURE(rc))
89 return rc;
90
91 rc = pCallbacks->pfnRegister(pCallbacks, &EmWebcam::DrvReg);
92 if (RT_FAILURE(rc))
93 return rc;
94
95#ifdef VBOX_WITH_USB_CARDREADER
96 rc = pCallbacks->pfnRegister(pCallbacks, &UsbCardReader::DrvReg);
97 if (RT_FAILURE(rc))
98 return rc;
99#endif
100
101 rc = pCallbacks->pfnRegister(pCallbacks, &Console::DrvStatusReg);
102 if (RT_FAILURE(rc))
103 return rc;
104
105#ifdef VBOX_WITH_PCI_PASSTHROUGH
106 rc = pCallbacks->pfnRegister(pCallbacks, &PCIRawDev::DrvReg);
107 if (RT_FAILURE(rc))
108 return rc;
109#endif
110
111 return VINF_SUCCESS;
112}
113/* 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