1 | /** @file
|
---|
2 | *
|
---|
3 | * Main driver registration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * 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 | #include "AudioSnifferInterface.h"
|
---|
27 | #include "ConsoleImpl.h"
|
---|
28 |
|
---|
29 | #include "Logging.h"
|
---|
30 |
|
---|
31 | #include <VBox/pdmdrv.h>
|
---|
32 | #include <VBox/version.h>
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Register the main drivers.
|
---|
36 | *
|
---|
37 | * @returns VBox status code.
|
---|
38 | * @param pCallbacks Pointer to the callback table.
|
---|
39 | * @param u32Version VBox version number.
|
---|
40 | */
|
---|
41 | extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
|
---|
42 | {
|
---|
43 | LogFlow(("VBoxDriversRegister: u32Version=%#x\n", u32Version));
|
---|
44 | AssertReleaseMsg(u32Version == VBOX_VERSION, ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION));
|
---|
45 |
|
---|
46 | int rc = pCallbacks->pfnRegister(pCallbacks, &Mouse::DrvReg);
|
---|
47 | if (VBOX_FAILURE(rc))
|
---|
48 | return rc;
|
---|
49 |
|
---|
50 | rc = pCallbacks->pfnRegister(pCallbacks, &Keyboard::DrvReg);
|
---|
51 | if (VBOX_FAILURE(rc))
|
---|
52 | return rc;
|
---|
53 |
|
---|
54 | rc = pCallbacks->pfnRegister(pCallbacks, &Display::DrvReg);
|
---|
55 | if (VBOX_FAILURE(rc))
|
---|
56 | return rc;
|
---|
57 |
|
---|
58 | rc = pCallbacks->pfnRegister(pCallbacks, &VMMDev::DrvReg);
|
---|
59 | if (VBOX_FAILURE(rc))
|
---|
60 | return rc;
|
---|
61 |
|
---|
62 | rc = pCallbacks->pfnRegister(pCallbacks, &AudioSniffer::DrvReg);
|
---|
63 | if (VBOX_FAILURE(rc))
|
---|
64 | return rc;
|
---|
65 |
|
---|
66 | rc = pCallbacks->pfnRegister(pCallbacks, &Console::DrvStatusReg);
|
---|
67 | if (VBOX_FAILURE(rc))
|
---|
68 | return rc;
|
---|
69 | return VINF_SUCCESS;
|
---|
70 | }
|
---|
71 |
|
---|