VirtualBox

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

Last change on this file since 107973 was 107973, checked in by vboxsync, 4 weeks ago

Windows driver installation: Fixed the ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED error, added documentation and give a clue to users why this might have failed. See source for details. bugref:10762

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.4 KB
Line 
1/* $Id: VBoxWinDrvInst.h 107973 2025-01-29 09:30:26Z 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 *
85 * When having this flag set, this will result in an ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED error
86 * if drivers get installed with our mixed SHA1 / SH256 certificates on older Windows OSes (7, Vista, ++).
87 *
88 * However, if VBOX_WIN_DRIVERINSTALL_F_SILENT is missing, this will result in a
89 * (desired) Windows driver installation dialog to confirm (or reject) the installation
90 * by the user.
91 *
92 * On the other hand, for unattended installs we need VBOX_WIN_DRIVERINSTALL_F_SILENT
93 * being set, as our certificates will get installed into the Windows certificate
94 * store *before* we perform any driver installation.
95 *
96 * So be careful using this flag to not break installations.
97 */
98#define VBOX_WIN_DRIVERINSTALL_F_SILENT RT_BIT(0)
99/** Force driver installation, even if a newer driver version already is installed (overwrite). */
100#define VBOX_WIN_DRIVERINSTALL_F_FORCE RT_BIT(1)
101/** Run in dry mode (no real (un)installation performed). */
102#define VBOX_WIN_DRIVERINSTALL_F_DRYRUN RT_BIT(2)
103/** Do not destroy internal data for later inspection.
104 * Only used by testcases and should be avoided in general. */
105#define VBOX_WIN_DRIVERINSTALL_F_NO_DESTROY RT_BIT(3)
106/** Validation mask. */
107#define VBOX_WIN_DRIVERINSTALL_F_VALID_MASK 0xf
108
109int VBoxWinDrvInstCreate(PVBOXWINDRVINST hDrvInst);
110int VBoxWinDrvInstCreateEx(PVBOXWINDRVINST phDrvInst, unsigned uVerbosity, PFNVBOXWINDRIVERLOGMSG pfnLog, void *pvUser);
111int VBoxWinDrvInstDestroy(VBOXWINDRVINST hDrvInst);
112unsigned VBoxWinDrvInstGetWarnings(VBOXWINDRVINST hDrvInst);
113unsigned VBoxWinDrvInstGetErrors(VBOXWINDRVINST hDrvInst);
114void VBoxWinDrvInstSetOsVersion(VBOXWINDRVINST hDrvInst, uint64_t uOsVer);
115unsigned VBoxWinDrvInstSetVerbosity(VBOXWINDRVINST hDrvInst, uint8_t uVerbosity);
116void VBoxWinDrvInstSetLogCallback(VBOXWINDRVINST hDrvInst, PFNVBOXWINDRIVERLOGMSG pfnLog, void *pvUser);
117int VBoxWinDrvInstInstallEx(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszModel, const char *pszPnpId, uint32_t fFlags);
118int VBoxWinDrvInstInstall(VBOXWINDRVINST hDrvInst, const char *pszInfFile, uint32_t fFlags);
119int VBoxWinDrvInstInstallExecuteInf(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszSection, uint32_t fFlags);
120int VBoxWinDrvInstUninstall(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszModel, const char *pszPnPId, uint32_t fFlags);
121int VBoxWinDrvInstUninstallExecuteInf(VBOXWINDRVINST hDrvInst, const char *pszInfFile, const char *pszSection, uint32_t fFlags);
122
123RT_C_DECLS_END
124
125#endif /* !VBOX_INCLUDED_GuestHost_VBoxWinDrvInst_h */
126
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