1 | /* $Id: VBoxWinDrvCommon.h 106392 2024-10-16 15:26:41Z 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 | * 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_VBoxWinDrvCommon_h
|
---|
38 | #define VBOX_INCLUDED_GuestHost_VBoxWinDrvCommon_h
|
---|
39 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
40 | # pragma once
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #include <iprt/win/windows.h>
|
---|
44 | #include <iprt/win/setupapi.h>
|
---|
45 |
|
---|
46 | #if defined(RT_ARCH_AMD64)
|
---|
47 | # define VBOXWINDRVINF_NATIVE_ARCH_STR "AMD64"
|
---|
48 | #elif defined(RT_ARCH_X86)
|
---|
49 | # define VBOXWINDRVINF_NATIVE_ARCH_STR "X86"
|
---|
50 | #elif defined(RT_ARCH_ARM64)
|
---|
51 | # define VBOXWINDRVINF_NATIVE_ARCH_STR "ARM64"
|
---|
52 | #else
|
---|
53 | # error "Port me!"
|
---|
54 | #endif
|
---|
55 |
|
---|
56 | /** Defines a string which emits the bulld target's native architeture, e.g. ".NTAMD64". */
|
---|
57 | #define VBOXWINDRVINF_DOT_NT_NATIVE_ARCH_STR ".NT" VBOXWINDRVINF_NATIVE_ARCH_STR
|
---|
58 |
|
---|
59 | /** Maximum catalog file (.cat) length (in characters). */
|
---|
60 | #define VBOXWINDRVINF_MAX_CATALOG_FILE 255
|
---|
61 | /** Maximum driver version length (in characters). */
|
---|
62 | #define VBOXWINDRVINF_MAX_DRIVER_VER 255
|
---|
63 | /** Maximum provider name length (in characters). */
|
---|
64 | #define VBOXWINDRVINF_MAX_PROVIDER_FILE 255
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Structure for keeping INF Version section information.
|
---|
68 | */
|
---|
69 | typedef struct _VBOXWINDRVINFSEC_VERSION
|
---|
70 | {
|
---|
71 | /** Catalog (.cat) file. */
|
---|
72 | RTUTF16 wszCatalogFile[VBOXWINDRVINF_MAX_CATALOG_FILE];
|
---|
73 | /** Driver version. */
|
---|
74 | RTUTF16 wszDriverVer[VBOXWINDRVINF_MAX_DRIVER_VER];
|
---|
75 | /** Provider name. */
|
---|
76 | RTUTF16 wszProvider[VBOXWINDRVINF_MAX_PROVIDER_FILE];
|
---|
77 | } VBOXWINDRVINFSEC_VERSION;
|
---|
78 | /** Pointer to structure for keeping INF Version section information. */
|
---|
79 | typedef VBOXWINDRVINFSEC_VERSION *PVBOXWINDRVINFSEC_VERSION;
|
---|
80 |
|
---|
81 | int VBoxWinDrvInfOpenEx(PCRTUTF16 pwszInfFile, PRTUTF16 pwszClassName, HINF *phInf);
|
---|
82 | int VBoxWinDrvInfOpen(PCRTUTF16 pwszInfFile, HINF *phInf);
|
---|
83 | int VBoxWinDrvInfOpenUtf8(const char *pszInfFile, HINF *phInf);
|
---|
84 | int VBoxWinDrvInfClose(HINF hInf);
|
---|
85 | int VBoxWinDrvInfQueryFirstModel(HINF hInf, PRTUTF16 *ppwszModel);
|
---|
86 | int VBoxWinDrvInfQueryFirstPnPId(HINF hInf, PRTUTF16 pwszModel, PRTUTF16 *ppwszPnPId);
|
---|
87 | int VBoxWinDrvInfQueryKeyValue(PINFCONTEXT pCtx, DWORD iValue, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
|
---|
88 | int VBoxWinDrvInfQueryModelsSectionName(HINF hInf, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
|
---|
89 | int VBoxWinDrvInfQuerySectionVerEx(HINF hInf, UINT uIndex, PVBOXWINDRVINFSEC_VERSION pVer);
|
---|
90 | int VBoxWinDrvInfQuerySectionVer(HINF hInf, PVBOXWINDRVINFSEC_VERSION pVer);
|
---|
91 |
|
---|
92 | #endif /* !VBOX_INCLUDED_GuestHost_VBoxWinDrvCommon_h */
|
---|
93 |
|
---|