2 * Copyright 2001 Andreas Mohr
3 * Copyright 2005 Hervé Poussineau
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef __SETUPAPI_PRIVATE_H
21 #define __SETUPAPI_PRIVATE_H
27 #define WIN32_NO_STATUS
33 #include <wine/debug.h>
34 #include <wine/unicode.h>
35 #define NTOS_MODE_USER
36 #include <ndk/ntndk.h>
39 #include "rpc_private.h"
42 #define SETUP_DEV_INFO_SET_MAGIC 0xd00ff057
44 struct DeviceInterface
/* Element of DeviceInfoElement.InterfaceListHead */
48 struct DeviceInfoElement
* DeviceInfo
;
49 GUID InterfaceClassGuid
;
52 /* SPINT_ACTIVE : the interface is active/enabled
53 * SPINT_DEFAULT: the interface is the default interface for the device class FIXME???
54 * SPINT_REMOVED: the interface is removed
58 WCHAR SymbolicLink
[0]; /* \\?\ACPI#PNP0501#4&2658d0a0&0#{GUID} */
61 /* We don't want to open the .inf file to read only one information in it, so keep a handle to it once it
62 * has been already loaded once. Keep also a reference counter */
68 /* May contain no directory if the file is already in %SYSTEMROOT%\Inf */
69 WCHAR FullInfFileName
[0];
72 struct DriverInfoElement
/* Element of DeviceInfoSet.DriverListHead and DeviceInfoElement.DriverListHead */
77 SP_DRVINFO_DATA_V2_W Info
;
78 SP_DRVINFO_DETAIL_DATA_W Details
;
81 struct InfFileDetails
*InfFileDetails
;
84 struct DeviceInfoElement
/* Element of DeviceInfoSet.ListHead */
88 /* Reserved Field points to a struct DriverInfoElement */
89 SP_DEVINSTALL_PARAMS_W InstallParams
;
91 /* Information about devnode:
93 * "Root\*PNP0501" for example.
94 * It doesn't contain the unique ID for the device
95 * (points into the Data field at the end of the structure)
96 * WARNING: no NULL char exist between DeviceName and UniqueId
99 * "5&1be2108e&0" or "0000"
100 * If DICD_GENERATE_ID is specified in creation flags,
101 * this unique ID is autogenerated using 4 digits, base 10
102 * (points into the Data field at the end of the structure)
103 * - DeviceDescription
104 * String which identifies the device. Can be NULL. If not NULL,
105 * points into the Data field at the end of the structure
107 * Identifies the class of this device. It is GUID_NULL if the
108 * device has not been installed
110 * Is a combination of:
112 * the unique ID needs to be generated
113 * - DICD_INHERIT_CLASSDRVS
114 * inherit driver of the device info set (== same pointer)
118 PCWSTR DeviceDescription
;
122 /* If CreationFlags contains DICD_INHERIT_CLASSDRVS, this list is invalid */
123 /* If the driver is not searched/detected, this list is empty */
124 LIST_ENTRY DriverListHead
; /* List of struct DriverInfoElement */
126 /* List of interfaces implemented by this device */
127 LIST_ENTRY InterfaceListHead
; /* List of struct DeviceInterface */
132 struct DeviceInfoSet
/* HDEVINFO */
134 DWORD magic
; /* SETUP_DEV_INFO_SET_MAGIC */
135 GUID ClassGuid
; /* If != GUID_NULL, only devices of this class can be in the device info set */
136 HKEY HKLM
; /* Local or distant HKEY_LOCAL_MACHINE registry key */
137 HMACHINE hMachine
; /* Used in CM_* functions */
139 /* Reserved Field points to a struct DriverInfoElement */
140 SP_DEVINSTALL_PARAMS_W InstallParams
;
142 /* If the driver is not searched/detected, this list is empty */
143 LIST_ENTRY DriverListHead
; /* List of struct DriverInfoElement */
145 LIST_ENTRY ListHead
; /* List of struct DeviceInfoElement */
148 extern HINSTANCE hInstance
;
149 #define RC_STRING_MAX_SIZE 256
151 #define REG_INSTALLEDFILES "System\\CurrentControlSet\\Control\\InstalledFiles"
152 #define REGPART_RENAME "\\Rename"
153 #define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager"
155 /* string substitutions */
158 extern const WCHAR
*DIRID_get_string( HINF hinf
, int dirid
);
159 extern unsigned int PARSER_string_substA( struct inf_file
*file
, const WCHAR
*text
,
160 char *buffer
, unsigned int size
);
161 extern unsigned int PARSER_string_substW( struct inf_file
*file
, const WCHAR
*text
,
162 WCHAR
*buffer
, unsigned int size
);
163 extern const WCHAR
*PARSER_get_src_root( HINF hinf
);
164 extern WCHAR
*PARSER_get_dest_dir( INFCONTEXT
*context
);
166 /* support for Ascii queue callback functions */
168 struct callback_WtoA_context
171 PSP_FILE_CALLBACK_A orig_handler
;
174 UINT CALLBACK
QUEUE_callback_WtoA( void *context
, UINT notification
, UINT_PTR
, UINT_PTR
);
176 /* from msvcrt/sys/stat.h */
177 #define _S_IWRITE 0x0080
178 #define _S_IREAD 0x0100
180 extern HINSTANCE hInstance
;
181 extern OSVERSIONINFOW OsVersionInfo
;
183 DWORD WINAPI
CaptureAndConvertAnsiArg(LPCSTR pSrc
, LPWSTR
*pDst
);
185 #endif /* __SETUPAPI_PRIVATE_H */