VirtualBox

source: vbox/trunk/include/VBox/GuestHost/VBoxWinDrvInst.h@ 107059

Last change on this file since 107059 was 107059, checked in by vboxsync, 2 months ago

Windows driver installation: Added VBOX_WIN_DRIVERINSTALL_F_DRYRUN to make it possible to run in dry-run mode (no actual installation performed). Required for testcases. bugref:10762

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
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
45RT_C_DECLS_BEGIN
46
47/** Windows driver installer handle. */
48typedef R3PTRTYPE(struct VBOXWINDRVINSTINTERNAL *) VBOXWINDRVINST;
49/** Pointer to a Windows driver installer handle. */
50typedef 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 */
59typedef 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 */
77typedef DECLCALLBACKTYPE(void, FNVBOXWINDRIVERLOGMSG,(VBOXWINDRIVERLOGTYPE enmType, const char *pszMsg, void *pvUser));
78/** Pointer to message callback function. */
79typedef 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
92int VBoxWinDrvInstCreate(PVBOXWINDRVINST hDrvInst);
93int VBoxWinDrvInstCreateEx(PVBOXWINDRVINST phDrvInst, unsigned uVerbosity, PFNVBOXWINDRIVERLOGMSG pfnLog, void *pvUser);
94int VBoxWinDrvInstDestroy(VBOXWINDRVINST hDrvInst);
95unsigned VBoxWinDrvInstGetWarnings(VBOXWINDRVINST hDrvInst);
96unsigned VBoxWinDrvInstGetErrors(VBOXWINDRVINST hDrvInst);
97unsigned VBoxWinDrvInstSetVerbosity(VBOXWINDRVINST hDrvInst, uint8_t uVerbosity);
98void VBoxWinDrvInstSetLogCallback(VBOXWINDRVINST hDrvInst, PFNVBOXWINDRIVERLOGMSG pfnLog, void *pvUser);
99int VBoxWinDrvInstInstallEx(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszModel, const char *pszPnpId, uint32_t fFlags);
100int VBoxWinDrvInstInstall(VBOXWINDRVINST hDrvInst, const char *pszInfFile, uint32_t fFlags);
101int VBoxWinDrvInstInstallExecuteInf(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszSection, uint32_t fFlags);
102int VBoxWinDrvInstUninstall(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszModel, const char *pszPnPId, uint32_t fFlags);
103int VBoxWinDrvInstUninstallExecuteInf(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszSection, uint32_t fFlags);
104
105RT_C_DECLS_END
106
107#endif /* !VBOX_INCLUDED_GuestHost_VBoxWinDrvInst_h */
108
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