1 | /* $Id: VBoxWinDrvInst.h 107059 2024-11-20 13:50:22Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxWinDrvInst - Header for Windows driver installation handling.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | #ifndef VBOX_INCLUDED_GuestHost_VBoxWinDrvInst_h
|
---|
38 | #define VBOX_INCLUDED_GuestHost_VBoxWinDrvInst_h
|
---|
39 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
40 | # pragma once
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #include <iprt/types.h>
|
---|
44 |
|
---|
45 | RT_C_DECLS_BEGIN
|
---|
46 |
|
---|
47 | /** Windows driver installer handle. */
|
---|
48 | typedef R3PTRTYPE(struct VBOXWINDRVINSTINTERNAL *) VBOXWINDRVINST;
|
---|
49 | /** Pointer to a Windows driver installer handle. */
|
---|
50 | typedef VBOXWINDRVINST *PVBOXWINDRVINST;
|
---|
51 | /** Nil Windows driver installer handle. */
|
---|
52 | #define NIL_VBOXWINDRVINST ((VBOXWINDRVINST)0)
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * Enumeration for the Windows driver installation logging type.
|
---|
56 | *
|
---|
57 | * Used by the log message callback.
|
---|
58 | */
|
---|
59 | typedef enum VBOXWINDRIVERLOGTYPE
|
---|
60 | {
|
---|
61 | VBOXWINDRIVERLOGTYPE_INVALID = 0,
|
---|
62 | VBOXWINDRIVERLOGTYPE_INFO,
|
---|
63 | VBOXWINDRIVERLOGTYPE_VERBOSE,
|
---|
64 | VBOXWINDRIVERLOGTYPE_WARN,
|
---|
65 | VBOXWINDRIVERLOGTYPE_ERROR,
|
---|
66 | /** If the (un)installation indicates that a system reboot is required. */
|
---|
67 | VBOXWINDRIVERLOGTYPE_REBOOT_NEEDED
|
---|
68 | } VBOXWINDRIVERLOGTYPE;
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * Log message callback.
|
---|
72 | *
|
---|
73 | * @param enmType Log type.
|
---|
74 | * @param pszMsg Log message.
|
---|
75 | * @param pvUser User-supplied pointer. Might be NULL if not being used.
|
---|
76 | */
|
---|
77 | typedef DECLCALLBACKTYPE(void, FNVBOXWINDRIVERLOGMSG,(VBOXWINDRIVERLOGTYPE enmType, const char *pszMsg, void *pvUser));
|
---|
78 | /** Pointer to message callback function. */
|
---|
79 | typedef FNVBOXWINDRIVERLOGMSG *PFNVBOXWINDRIVERLOGMSG;
|
---|
80 |
|
---|
81 | /** No flags specified. */
|
---|
82 | #define VBOX_WIN_DRIVERINSTALL_F_NONE 0
|
---|
83 | /** Try a silent installation (if possible). */
|
---|
84 | #define VBOX_WIN_DRIVERINSTALL_F_SILENT RT_BIT(0)
|
---|
85 | /** Force driver installation, even if a newer driver version already is installed (overwrite). */
|
---|
86 | #define VBOX_WIN_DRIVERINSTALL_F_FORCE RT_BIT(1)
|
---|
87 | /** Run in dry mode (no real (un)installation performed). */
|
---|
88 | #define VBOX_WIN_DRIVERINSTALL_F_DRYRUN RT_BIT(2)
|
---|
89 | /** Validation mask. */
|
---|
90 | #define VBOX_WIN_DRIVERINSTALL_F_VALID_MASK 0x7
|
---|
91 |
|
---|
92 | int VBoxWinDrvInstCreate(PVBOXWINDRVINST hDrvInst);
|
---|
93 | int VBoxWinDrvInstCreateEx(PVBOXWINDRVINST phDrvInst, unsigned uVerbosity, PFNVBOXWINDRIVERLOGMSG pfnLog, void *pvUser);
|
---|
94 | int VBoxWinDrvInstDestroy(VBOXWINDRVINST hDrvInst);
|
---|
95 | unsigned VBoxWinDrvInstGetWarnings(VBOXWINDRVINST hDrvInst);
|
---|
96 | unsigned VBoxWinDrvInstGetErrors(VBOXWINDRVINST hDrvInst);
|
---|
97 | unsigned VBoxWinDrvInstSetVerbosity(VBOXWINDRVINST hDrvInst, uint8_t uVerbosity);
|
---|
98 | void VBoxWinDrvInstSetLogCallback(VBOXWINDRVINST hDrvInst, PFNVBOXWINDRIVERLOGMSG pfnLog, void *pvUser);
|
---|
99 | int VBoxWinDrvInstInstallEx(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszModel, const char *pszPnpId, uint32_t fFlags);
|
---|
100 | int VBoxWinDrvInstInstall(VBOXWINDRVINST hDrvInst, const char *pszInfFile, uint32_t fFlags);
|
---|
101 | int VBoxWinDrvInstInstallExecuteInf(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszSection, uint32_t fFlags);
|
---|
102 | int VBoxWinDrvInstUninstall(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszModel, const char *pszPnPId, uint32_t fFlags);
|
---|
103 | int VBoxWinDrvInstUninstallExecuteInf(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszSection, uint32_t fFlags);
|
---|
104 |
|
---|
105 | RT_C_DECLS_END
|
---|
106 |
|
---|
107 | #endif /* !VBOX_INCLUDED_GuestHost_VBoxWinDrvInst_h */
|
---|
108 |
|
---|