1 | /* $Id: VBoxWinDrvCommon.h 107901 2025-01-22 22:21:48Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxWinDrvCommon - Common Windows driver functions.
|
---|
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 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef VBOX_INCLUDED_SRC_installation_VBoxWinDrvCommon_h
|
---|
29 | #define VBOX_INCLUDED_SRC_installation_VBoxWinDrvCommon_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <iprt/win/windows.h>
|
---|
35 | #include <iprt/win/setupapi.h>
|
---|
36 |
|
---|
37 | #include <iprt/utf16.h>
|
---|
38 |
|
---|
39 | #include <VBox/GuestHost/VBoxWinDrvDefs.h>
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * Enumeration specifying the INF (driver) type.
|
---|
43 | */
|
---|
44 | typedef enum VBOXWINDRVINFTYPE
|
---|
45 | {
|
---|
46 | /** Invalid type. */
|
---|
47 | VBOXWINDRVINFTYPE_INVALID = 0,
|
---|
48 | /** Primitive driver.
|
---|
49 | * This uses a "DefaultInstall" (plus optionally "DefaultUninstall") sections
|
---|
50 | * and does not have a PnP ID. */
|
---|
51 | VBOXWINDRVINFTYPE_PRIMITIVE,
|
---|
52 | /** Normal driver.
|
---|
53 | * Uses a "Manufacturer" section and can have a PnP ID. */
|
---|
54 | VBOXWINDRVINFTYPE_NORMAL
|
---|
55 | } VBOXWINDRVINFTYPE;
|
---|
56 |
|
---|
57 | int VBoxWinDrvInfOpenEx(PCRTUTF16 pwszInfFile, PRTUTF16 pwszClassName, HINF *phInf);
|
---|
58 | int VBoxWinDrvInfOpen(PCRTUTF16 pwszInfFile, HINF *phInf);
|
---|
59 | int VBoxWinDrvInfOpenUtf8(const char *pszInfFile, HINF *phInf);
|
---|
60 | int VBoxWinDrvInfClose(HINF hInf);
|
---|
61 | VBOXWINDRVINFTYPE VBoxWinDrvInfGetTypeEx(HINF hInf, PRTUTF16 *ppwszSection);
|
---|
62 | VBOXWINDRVINFTYPE VBoxWinDrvInfGetType(HINF hInf);
|
---|
63 | int VBoxWinDrvInfQueryFirstModel(HINF hInf, PCRTUTF16 pwszSection, PRTUTF16 *ppwszModel);
|
---|
64 | int VBoxWinDrvInfQueryFirstPnPId(HINF hInf, PRTUTF16 pwszModel, PRTUTF16 *ppwszPnPId);
|
---|
65 | int VBoxWinDrvInfQueryKeyValue(PINFCONTEXT pCtx, DWORD iValue, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
|
---|
66 | int VBoxWinDrvInfQueryModelEx(HINF hInf, PCRTUTF16 pwszSection, unsigned uIndex, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
|
---|
67 | int VBoxWinDrvInfQueryModel(HINF hInf, PCRTUTF16 pwszSection, unsigned uIndex, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
|
---|
68 | int VBoxWinDrvInfQueryInstallSectionEx(HINF hInf, PCRTUTF16 pwszModel, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
|
---|
69 | int VBoxWinDrvInfQueryInstallSection(HINF hInf, PCRTUTF16 pwszModel, PRTUTF16 *ppwszValue);
|
---|
70 | int VBoxWinDrvInfQuerySectionVerEx(HINF hInf, UINT uIndex, PVBOXWINDRVINFSECVERSION pVer);
|
---|
71 | int VBoxWinDrvInfQuerySectionVer(HINF hInf, PVBOXWINDRVINFSECVERSION pVer);
|
---|
72 |
|
---|
73 | const char *VBoxWinDrvSetupApiErrToStr(const DWORD dwErr);
|
---|
74 | const char *VBoxWinDrvWinErrToStr(const DWORD dwErr);
|
---|
75 | int VBoxWinDrvInstErrorFromWin32(unsigned uNativeCode);
|
---|
76 |
|
---|
77 | #endif /* !VBOX_INCLUDED_SRC_installation_VBoxWinDrvCommon_h */
|
---|
78 |
|
---|