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
28 #define WIN32_NO_STATUS
35 #include <wine/debug.h>
36 #include <wine/unicode.h>
37 #define NTOS_MODE_USER
38 #include <ndk/ntndk.h>
41 #include "rpc_private.h"
48 #define SETUP_DEV_INFO_SET_MAGIC 0xd00ff057
49 #define SETUP_CLASS_IMAGE_LIST_MAGIC 0xd00ff058
51 struct DeviceInterface
/* Element of DeviceInfoElement.InterfaceListHead */
55 struct DeviceInfoElement
* DeviceInfo
;
56 GUID InterfaceClassGuid
;
59 /* SPINT_ACTIVE : the interface is active/enabled
60 * SPINT_DEFAULT: the interface is the default interface for the device class
61 * SPINT_REMOVED: the interface is removed
65 WCHAR SymbolicLink
[ANYSIZE_ARRAY
]; /* \\?\ACPI#PNP0501#4&2658d0a0&0#{GUID} */
68 /* We don't want to open the .inf file to read only one information in it, so keep a handle to it once it
69 * has been already loaded once. Keep also a reference counter */
75 /* May contain no directory if the file is already in %SYSTEMROOT%\Inf */
76 WCHAR FullInfFileName
[ANYSIZE_ARRAY
];
79 struct DriverInfoElement
/* Element of DeviceInfoSet.DriverListHead and DeviceInfoElement.DriverListHead */
84 ULARGE_INTEGER DriverDate
;
85 SP_DRVINFO_DATA_V2_W Info
;
86 SP_DRVINFO_DETAIL_DATA_W Details
;
89 struct InfFileDetails
*InfFileDetails
;
92 struct ClassInstallParams
94 PSP_PROPCHANGE_PARAMS PropChange
;
97 struct DeviceInfoElement
/* Element of DeviceInfoSet.ListHead */
100 DEVINST dnDevInst
; /* Used in CM_* functions */
102 /* Reserved Field points to a struct DriverInfoElement */
103 SP_DEVINSTALL_PARAMS_W InstallParams
;
105 /* Information about devnode:
107 * "Root\*PNP0501" for example.
108 * It doesn't contain the unique ID for the device
109 * (points into the Data field at the end of the structure)
110 * WARNING: no NULL char exist between DeviceName and UniqueId
113 * "5&1be2108e&0" or "0000"
114 * If DICD_GENERATE_ID is specified in creation flags,
115 * this unique ID is autogenerated using 4 digits, base 10
116 * (points into the Data field at the end of the structure)
117 * - DeviceDescription
118 * String which identifies the device. Can be NULL. If not NULL,
119 * points into the Data field at the end of the structure
121 * Identifies the class of this device. It is GUID_NULL if the
122 * device has not been installed
124 * Is a combination of:
126 * the unique ID needs to be generated
127 * - DICD_INHERIT_CLASSDRVS
128 * inherit driver of the device info set (== same pointer)
132 PCWSTR DeviceDescription
;
136 /* If CreationFlags contains DICD_INHERIT_CLASSDRVS, this list is invalid */
137 /* If the driver is not searched/detected, this list is empty */
138 LIST_ENTRY DriverListHead
; /* List of struct DriverInfoElement */
140 /* List of interfaces implemented by this device */
141 LIST_ENTRY InterfaceListHead
; /* List of struct DeviceInterface */
143 /* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */
144 struct ClassInstallParams ClassInstallParams
;
146 WCHAR Data
[ANYSIZE_ARRAY
];
149 struct DeviceInfoSet
/* HDEVINFO */
151 DWORD magic
; /* SETUP_DEV_INFO_SET_MAGIC */
152 GUID ClassGuid
; /* If != GUID_NULL, only devices of this class can be in the device info set */
153 HKEY HKLM
; /* Local or distant HKEY_LOCAL_MACHINE registry key */
154 HMACHINE hMachine
; /* Used in CM_* functions */
156 /* Reserved Field points to a struct DriverInfoElement */
157 SP_DEVINSTALL_PARAMS_W InstallParams
;
159 /* If the driver is not searched/detected, this list is empty */
160 LIST_ENTRY DriverListHead
; /* List of struct DriverInfoElement */
162 LIST_ENTRY ListHead
; /* List of struct DeviceInfoElement */
163 struct DeviceInfoElement
*SelectedDevice
;
165 /* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */
166 struct ClassInstallParams ClassInstallParams
;
168 /* Contains the name of the remote computer ('\\COMPUTERNAME' for example),
169 * or NULL if related to local machine. Points into szData field at the
170 * end of the structure */
172 WCHAR szData
[ANYSIZE_ARRAY
];
175 struct ClassImageList
177 DWORD magic
; /* SETUP_CLASS_IMAGE_LIST_MAGIC */
179 /* Contains the name of the remote computer ('\\COMPUTERNAME' for example),
180 * or NULL if related to local machine. Points into szData field at the
181 * end of the structure */
183 WCHAR szData
[ANYSIZE_ARRAY
];
186 extern HINSTANCE hInstance
;
187 #define RC_STRING_MAX_SIZE 256
189 #define REG_INSTALLEDFILES "System\\CurrentControlSet\\Control\\InstalledFiles"
190 #define REGPART_RENAME "\\Rename"
191 #define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager"
193 /* string substitutions */
196 extern const WCHAR
*DIRID_get_string( int dirid
);
197 extern const WCHAR
*PARSER_get_inf_filename( HINF hinf
);
198 extern unsigned int PARSER_string_substA( struct inf_file
*file
, const WCHAR
*text
,
199 char *buffer
, unsigned int size
);
200 extern unsigned int PARSER_string_substW( struct inf_file
*file
, const WCHAR
*text
,
201 WCHAR
*buffer
, unsigned int size
);
202 extern WCHAR
*PARSER_get_src_root( HINF hinf
);
203 extern WCHAR
*PARSER_get_dest_dir( INFCONTEXT
*context
);
205 /* support for Ascii queue callback functions */
207 struct callback_WtoA_context
210 PSP_FILE_CALLBACK_A orig_handler
;
213 UINT CALLBACK
QUEUE_callback_WtoA( void *context
, UINT notification
, UINT_PTR
, UINT_PTR
);
215 /* from msvcrt/sys/stat.h */
216 #define _S_IWRITE 0x0080
217 #define _S_IREAD 0x0100
219 extern HINSTANCE hInstance
;
220 extern OSVERSIONINFOW OsVersionInfo
;
222 DWORD WINAPI
CaptureAndConvertAnsiArg(LPCSTR pSrc
, LPWSTR
*pDst
);
224 BOOL
GetStringField( PINFCONTEXT context
, DWORD index
, PWSTR
*value
);
226 #endif /* __SETUPAPI_PRIVATE_H */