VirtualBox

source: vbox/trunk/src/VBox/GuestHost/installation/VBoxWinDrvCommon.h@ 108071

Last change on this file since 108071 was 108071, checked in by vboxsync, 2 weeks ago

Windows driver installation: Added VBoxWinDrvRegQueryDWORD[W] to have a common base for querying registry values. Required as a prerequisite for unifying the InstallHelper.dll. bugref:10762

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: VBoxWinDrvCommon.h 108071 2025-02-05 14:14:02Z 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 */
44typedef 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
57int VBoxWinDrvInfOpenEx(PCRTUTF16 pwszInfFile, PRTUTF16 pwszClassName, HINF *phInf);
58int VBoxWinDrvInfOpen(PCRTUTF16 pwszInfFile, HINF *phInf);
59int VBoxWinDrvInfOpenUtf8(const char *pszInfFile, HINF *phInf);
60int VBoxWinDrvInfClose(HINF hInf);
61VBOXWINDRVINFTYPE VBoxWinDrvInfGetTypeEx(HINF hInf, PRTUTF16 *ppwszSection);
62VBOXWINDRVINFTYPE VBoxWinDrvInfGetType(HINF hInf);
63int VBoxWinDrvInfQueryFirstModel(HINF hInf, PCRTUTF16 pwszSection, PRTUTF16 *ppwszModel);
64int VBoxWinDrvInfQueryFirstPnPId(HINF hInf, PRTUTF16 pwszModel, PRTUTF16 *ppwszPnPId);
65int VBoxWinDrvInfQueryKeyValue(PINFCONTEXT pCtx, DWORD iValue, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
66int VBoxWinDrvInfQueryModelEx(HINF hInf, PCRTUTF16 pwszSection, unsigned uIndex, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
67int VBoxWinDrvInfQueryModel(HINF hInf, PCRTUTF16 pwszSection, unsigned uIndex, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
68int VBoxWinDrvInfQueryInstallSectionEx(HINF hInf, PCRTUTF16 pwszModel, PRTUTF16 *ppwszValue, PDWORD pcwcValue);
69int VBoxWinDrvInfQueryInstallSection(HINF hInf, PCRTUTF16 pwszModel, PRTUTF16 *ppwszValue);
70int VBoxWinDrvInfQuerySectionVerEx(HINF hInf, UINT uIndex, PVBOXWINDRVINFSECVERSION pVer);
71int VBoxWinDrvInfQuerySectionVer(HINF hInf, PVBOXWINDRVINFSECVERSION pVer);
72
73const char *VBoxWinDrvSetupApiErrToStr(const DWORD dwErr);
74const char *VBoxWinDrvWinErrToStr(const DWORD dwErr);
75int VBoxWinDrvInstErrorFromWin32(unsigned uNativeCode);
76
77int VBoxWinDrvRegQueryDWORDW(HKEY hKey, LPCWSTR pwszName, DWORD *pdwValue);
78int VBoxWinDrvRegQueryDWORD(HKEY hKey, const char *pszName, DWORD *pdwValue);
79
80#endif /* !VBOX_INCLUDED_SRC_installation_VBoxWinDrvCommon_h */
81
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