winapi_ui_automation/um/
setupapi.rs

1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms.
6//! Public header file for Windows NT Setup and Device Installer services Dll.
7use ctypes::c_int;
8use shared::basetsd::{DWORD_PTR, UINT_PTR, ULONG_PTR};
9use shared::devpropdef::{DEVPROPKEY, DEVPROPTYPE};
10use shared::guiddef::{GUID, LPGUID};
11use shared::minwindef::{
12    BOOL, BYTE, DWORD, FILETIME, HINSTANCE, HKEY, INT, LPARAM, LPCVOID, LPDWORD, MAX_PATH, PBOOL,
13    PBYTE, PDWORD, PINT, PUINT, UINT, USHORT, WORD,
14};
15use shared::windef::{HDC, HICON, HWND, RECT};
16use um::commctrl::HIMAGELIST;
17use um::prsht::{HPROPSHEETPAGE, LPPROPSHEETHEADERA, LPPROPSHEETHEADERW};
18use um::spapidef::SP_LOG_TOKEN;
19use um::winnt::{
20    ANYSIZE_ARRAY, APPLICATION_ERROR_MASK, CHAR, DWORDLONG, ERROR_SEVERITY_ERROR, HANDLE, LONG,
21    LONGLONG, LPCSTR, LPCWSTR, PCSTR, PCWSTR, PSTR, PVOID, PWSTR, WCHAR,
22};
23use um::winreg::REGSAM;
24pub const LINE_LEN: usize = 256;
25pub const MAX_INF_STRING_LENGTH: usize = 4096;
26pub const MAX_INF_SECTION_NAME_LENGTH: usize = 255;
27pub const MAX_TITLE_LEN: usize = 60;
28pub const MAX_INSTRUCTION_LEN: usize = 256;
29pub const MAX_LABEL_LEN: usize = 30;
30pub const MAX_SERVICE_NAME_LEN: usize = 256;
31pub const MAX_SUBTITLE_LEN: usize = 256;
32pub const SP_MAX_MACHINENAME_LENGTH: usize = MAX_PATH + 3;
33pub type HINF = PVOID;
34STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct INFCONTEXT {
35    Inf: PVOID,
36    CurrentInf: PVOID,
37    Section: UINT,
38    Line: UINT,
39}}
40pub type PINFCONTEXT = *mut INFCONTEXT;
41STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_INFORMATION {
42    InfStyle: DWORD,
43    InfCount: DWORD,
44    VersionData: [BYTE; ANYSIZE_ARRAY],
45}}
46pub type PSP_INF_INFORMATION = *mut SP_INF_INFORMATION;
47UNION!{#[cfg_attr(target_arch = "x86", repr(packed))] union SP_ALTPLATFORM_INFO_V3_u {
48    [u16; 1],
49    Reserved Reserved_mut: WORD,
50    Flags Flags_mut: WORD,
51}}
52STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ALTPLATFORM_INFO_V3 {
53    cbSize: DWORD,
54    Platform: DWORD,
55    MajorVersion: DWORD,
56    MinorVersion: DWORD,
57    ProcessorArchitecture: WORD,
58    u: SP_ALTPLATFORM_INFO_V3_u,
59    FirstValidatedMajorVersion: DWORD,
60    FirstValidatedMinorVersion: DWORD,
61    ProductType: BYTE,
62    SuiteMask: WORD,
63    BuildNumber: DWORD,
64}}
65pub type PSP_ALTPLATFORM_INFO_V3 = *mut SP_ALTPLATFORM_INFO_V3;
66UNION!{#[cfg_attr(target_arch = "x86", repr(packed))] union SP_ALTPLATFORM_INFO_V2_u {
67    [u16; 1],
68    Reserved Reserved_mut: WORD,
69    Flags Flags_mut: WORD,
70}}
71STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ALTPLATFORM_INFO_V2 {
72    cbSize: DWORD,
73    Platform: DWORD,
74    MajorVersion: DWORD,
75    MinorVersion: DWORD,
76    ProcessorArchitecture: WORD,
77    u: SP_ALTPLATFORM_INFO_V2_u,
78    FirstValidatedMajorVersion: DWORD,
79    FirstValidatedMinorVersion: DWORD,
80}}
81pub type PSP_ALTPLATFORM_INFO_V2 = *mut SP_ALTPLATFORM_INFO_V2;
82STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ALTPLATFORM_INFO_V1 {
83    cbSize: DWORD,
84    Platform: DWORD,
85    MajorVersion: DWORD,
86    MinorVersion: DWORD,
87    ProcessorArchitecture: WORD,
88    Reserved: WORD,
89}}
90pub type PSP_ALTPLATFORM_INFO_V1 = *mut SP_ALTPLATFORM_INFO_V1;
91pub type SP_ALTPLATFORM_INFO = SP_ALTPLATFORM_INFO_V2;
92pub type PSP_ALTPLATFORM_INFO = PSP_ALTPLATFORM_INFO_V2;
93pub const SP_ALTPLATFORM_FLAGS_VERSION_RANGE: WORD = 0x0001;
94pub const SP_ALTPLATFORM_FLAGS_SUITE_MASK: WORD = 0x0002;
95STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ORIGINAL_FILE_INFO_A {
96    cbSize: DWORD,
97    OriginalInfName: [CHAR; MAX_PATH],
98    OriginalCatalogName: [CHAR; MAX_PATH],
99}}
100pub type PSP_ORIGINAL_FILE_INFO_A = *mut SP_ORIGINAL_FILE_INFO_A;
101STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ORIGINAL_FILE_INFO_W {
102    cbSize: DWORD,
103    OriginalInfName: [WCHAR; MAX_PATH],
104    OriginalCatalogName: [WCHAR; MAX_PATH],
105}}
106pub type PSP_ORIGINAL_FILE_INFO_W = *mut SP_ORIGINAL_FILE_INFO_W;
107pub const INF_STYLE_NONE: DWORD = 0x00000000;
108pub const INF_STYLE_OLDNT: DWORD = 0x00000001;
109pub const INF_STYLE_WIN4: DWORD = 0x00000002;
110pub const INF_STYLE_CACHE_ENABLE: DWORD = 0x00000010;
111pub const INF_STYLE_CACHE_DISABLE: DWORD = 0x00000020;
112pub const INF_STYLE_CACHE_IGNORE: DWORD = 0x00000040;
113pub const DIRID_ABSOLUTE: DWORD = -1i32 as u32;
114pub const DIRID_ABSOLUTE_16BIT: DWORD = 0xffff;
115pub const DIRID_NULL: DWORD = 0;
116pub const DIRID_SRCPATH: DWORD = 1;
117pub const DIRID_WINDOWS: DWORD = 10;
118pub const DIRID_SYSTEM: DWORD = 11;
119pub const DIRID_DRIVERS: DWORD = 12;
120pub const DIRID_IOSUBSYS: DWORD = DIRID_DRIVERS;
121pub const DIRID_DRIVER_STORE: DWORD = 13;
122pub const DIRID_INF: DWORD = 17;
123pub const DIRID_HELP: DWORD = 18;
124pub const DIRID_FONTS: DWORD = 20;
125pub const DIRID_VIEWERS: DWORD = 21;
126pub const DIRID_COLOR: DWORD = 23;
127pub const DIRID_APPS: DWORD = 24;
128pub const DIRID_SHARED: DWORD = 25;
129pub const DIRID_BOOT: DWORD = 30;
130pub const DIRID_SYSTEM16: DWORD = 50;
131pub const DIRID_SPOOL: DWORD = 51;
132pub const DIRID_SPOOLDRIVERS: DWORD = 52;
133pub const DIRID_USERPROFILE: DWORD = 53;
134pub const DIRID_LOADER: DWORD = 54;
135pub const DIRID_PRINTPROCESSOR: DWORD = 55;
136pub const DIRID_DEFAULT: DWORD = DIRID_SYSTEM;
137pub const DIRID_COMMON_STARTMENU: DWORD = 16406;
138pub const DIRID_COMMON_PROGRAMS: DWORD = 16407;
139pub const DIRID_COMMON_STARTUP: DWORD = 16408;
140pub const DIRID_COMMON_DESKTOPDIRECTORY: DWORD = 16409;
141pub const DIRID_COMMON_FAVORITES: DWORD = 16415;
142pub const DIRID_COMMON_APPDATA: DWORD = 16419;
143pub const DIRID_PROGRAM_FILES: DWORD = 16422;
144pub const DIRID_SYSTEM_X86: DWORD = 16425;
145pub const DIRID_PROGRAM_FILES_X86: DWORD = 16426;
146pub const DIRID_PROGRAM_FILES_COMMON: DWORD = 16427;
147pub const DIRID_PROGRAM_FILES_COMMONX86: DWORD = 16428;
148pub const DIRID_COMMON_TEMPLATES: DWORD = 16429;
149pub const DIRID_COMMON_DOCUMENTS: DWORD = 16430;
150pub const DIRID_USER: DWORD = 0x8000;
151FN!{stdcall PSP_FILE_CALLBACK_A(
152    Context: PVOID,
153    Notification: UINT,
154    Param1: UINT_PTR,
155    Param2: UINT_PTR,
156) -> UINT}
157FN!{stdcall PSP_FILE_CALLBACK_W(
158    Context: PVOID,
159    Notification: UINT,
160    Param1: UINT_PTR,
161    Param2: UINT_PTR,
162) -> UINT}
163pub const SPFILENOTIFY_STARTQUEUE: UINT = 0x00000001;
164pub const SPFILENOTIFY_ENDQUEUE: UINT = 0x00000002;
165pub const SPFILENOTIFY_STARTSUBQUEUE: UINT = 0x00000003;
166pub const SPFILENOTIFY_ENDSUBQUEUE: UINT = 0x00000004;
167pub const SPFILENOTIFY_STARTDELETE: UINT = 0x00000005;
168pub const SPFILENOTIFY_ENDDELETE: UINT = 0x00000006;
169pub const SPFILENOTIFY_DELETEERROR: UINT = 0x00000007;
170pub const SPFILENOTIFY_STARTRENAME: UINT = 0x00000008;
171pub const SPFILENOTIFY_ENDRENAME: UINT = 0x00000009;
172pub const SPFILENOTIFY_RENAMEERROR: UINT = 0x0000000a;
173pub const SPFILENOTIFY_STARTCOPY: UINT = 0x0000000b;
174pub const SPFILENOTIFY_ENDCOPY: UINT = 0x0000000c;
175pub const SPFILENOTIFY_COPYERROR: UINT = 0x0000000d;
176pub const SPFILENOTIFY_NEEDMEDIA: UINT = 0x0000000e;
177pub const SPFILENOTIFY_QUEUESCAN: UINT = 0x0000000f;
178pub const SPFILENOTIFY_CABINETINFO: UINT = 0x00000010;
179pub const SPFILENOTIFY_FILEINCABINET: UINT = 0x00000011;
180pub const SPFILENOTIFY_NEEDNEWCABINET: UINT = 0x00000012;
181pub const SPFILENOTIFY_FILEEXTRACTED: UINT = 0x00000013;
182pub const SPFILENOTIFY_FILEOPDELAYED: UINT = 0x00000014;
183pub const SPFILENOTIFY_STARTBACKUP: UINT = 0x00000015;
184pub const SPFILENOTIFY_BACKUPERROR: UINT = 0x00000016;
185pub const SPFILENOTIFY_ENDBACKUP: UINT = 0x00000017;
186pub const SPFILENOTIFY_QUEUESCAN_EX: UINT = 0x00000018;
187pub const SPFILENOTIFY_STARTREGISTRATION: UINT = 0x00000019;
188pub const SPFILENOTIFY_ENDREGISTRATION: UINT = 0x00000020;
189pub const SPFILENOTIFY_QUEUESCAN_SIGNERINFO: UINT = 0x00000040;
190pub const SPFILENOTIFY_LANGMISMATCH: UINT = 0x00010000;
191pub const SPFILENOTIFY_TARGETEXISTS: UINT = 0x00020000;
192pub const SPFILENOTIFY_TARGETNEWER: UINT = 0x00040000;
193pub const FILEOP_COPY: UINT = 0;
194pub const FILEOP_RENAME: UINT = 1;
195pub const FILEOP_DELETE: UINT = 2;
196pub const FILEOP_BACKUP: UINT = 3;
197pub const FILEOP_ABORT: UINT = 0;
198pub const FILEOP_DOIT: UINT = 1;
199pub const FILEOP_SKIP: UINT = 2;
200pub const FILEOP_RETRY: UINT = FILEOP_DOIT;
201pub const FILEOP_NEWPATH: UINT = 4;
202pub const COPYFLG_WARN_IF_SKIP: UINT = 0x00000001;
203pub const COPYFLG_NOSKIP: UINT = 0x00000002;
204pub const COPYFLG_NOVERSIONCHECK: UINT = 0x00000004;
205pub const COPYFLG_FORCE_FILE_IN_USE: UINT = 0x00000008;
206pub const COPYFLG_NO_OVERWRITE: UINT = 0x00000010;
207pub const COPYFLG_NO_VERSION_DIALOG: UINT = 0x00000020;
208pub const COPYFLG_OVERWRITE_OLDER_ONLY: UINT = 0x00000040;
209pub const COPYFLG_PROTECTED_WINDOWS_DRIVER_FILE: UINT = 0x00000100;
210pub const COPYFLG_REPLACEONLY: UINT = 0x00000400;
211pub const COPYFLG_NODECOMP: UINT = 0x00000800;
212pub const COPYFLG_REPLACE_BOOT_FILE: UINT = 0x00001000;
213pub const COPYFLG_NOPRUNE: UINT = 0x00002000;
214pub const COPYFLG_IN_USE_TRY_RENAME: UINT = 0x00004000;
215pub const DELFLG_IN_USE: UINT = 0x00000001;
216pub const DELFLG_IN_USE1: UINT = 0x00010000;
217STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_A {
218    Target: PCSTR,
219    Source: PCSTR,
220    Win32Error: UINT,
221    Flags: DWORD,
222}}
223pub type PFILEPATHS_A = *mut FILEPATHS_A;
224STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_W {
225    Target: PCWSTR,
226    Source: PCWSTR,
227    Win32Error: UINT,
228    Flags: DWORD,
229}}
230pub type PFILEPATHS_W = *mut FILEPATHS_W;
231STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_SIGNERINFO_A {
232    Target: PCSTR,
233    Source: PCSTR,
234    Win32Error: UINT,
235    Flags: DWORD,
236    DigitalSigner: PCSTR,
237    Version: PCSTR,
238    CatalogFile: PCSTR,
239}}
240pub type PFILEPATHS_SIGNERINFO_A = *mut FILEPATHS_SIGNERINFO_A;
241STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_SIGNERINFO_W {
242    Target: PCWSTR,
243    Source: PCWSTR,
244    Win32Error: UINT,
245    Flags: DWORD,
246    DigitalSigner: PCWSTR,
247    Version: PCWSTR,
248    CatalogFile: PCWSTR,
249}}
250pub type PFILEPATHS_SIGNERINFO_W = *mut FILEPATHS_SIGNERINFO_W;
251STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SOURCE_MEDIA_A {
252    Reserved: PCSTR,
253    Tagfile: PCSTR,
254    Description: PCSTR,
255    SourcePath: PCSTR,
256    SourceFile: PCSTR,
257    Flags: DWORD,
258}}
259pub type PSOURCE_MEDIA_A = *mut SOURCE_MEDIA_A;
260STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SOURCE_MEDIA_W {
261    Reserved: PCWSTR,
262    Tagfile: PCWSTR,
263    Description: PCWSTR,
264    SourcePath: PCWSTR,
265    SourceFile: PCWSTR,
266    Flags: DWORD,
267}}
268pub type PSOURCE_MEDIA_W = *mut SOURCE_MEDIA_W;
269STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CABINET_INFO_A {
270    CabinetPath: PCSTR,
271    CabinetFile: PCSTR,
272    DiskName: PCSTR,
273    SetId: USHORT,
274    CabinetNumber: USHORT,
275}}
276pub type PCABINET_INFO_A = *mut CABINET_INFO_A;
277STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CABINET_INFO_W {
278    CabinetPath: PCWSTR,
279    CabinetFile: PCWSTR,
280    DiskName: PCWSTR,
281    SetId: USHORT,
282    CabinetNumber: USHORT,
283}}
284pub type PCABINET_INFO_W = *mut CABINET_INFO_W;
285STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILE_IN_CABINET_INFO_A {
286    NameInCabinet: PCSTR,
287    FileSize: DWORD,
288    Win32Error: DWORD,
289    DosDate: WORD,
290    DosTime: WORD,
291    DosAttribs: WORD,
292    FullTargetName: [CHAR; MAX_PATH],
293}}
294pub type PFILE_IN_CABINET_INFO_A = *mut FILE_IN_CABINET_INFO_A;
295STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILE_IN_CABINET_INFO_W {
296    NameInCabinet: PCWSTR,
297    FileSize: DWORD,
298    Win32Error: DWORD,
299    DosDate: WORD,
300    DosTime: WORD,
301    DosAttribs: WORD,
302    FullTargetName: [WCHAR; MAX_PATH],
303}}
304pub type PFILE_IN_CABINET_INFO_W = *mut FILE_IN_CABINET_INFO_W;
305STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_REGISTER_CONTROL_STATUSA {
306    cbSize: DWORD,
307    FileName: PCSTR,
308    Win32Error: DWORD,
309    FailureCode: DWORD,
310}}
311pub type PSP_REGISTER_CONTROL_STATUSA = *mut SP_REGISTER_CONTROL_STATUSA;
312STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_REGISTER_CONTROL_STATUSW {
313    cbSize: DWORD,
314    FileName: PCWSTR,
315    Win32Error: DWORD,
316    FailureCode: DWORD,
317}}
318pub type PSP_REGISTER_CONTROL_STATUSW = *mut SP_REGISTER_CONTROL_STATUSW;
319pub const SPREG_SUCCESS: DWORD = 0x00000000;
320pub const SPREG_LOADLIBRARY: DWORD = 0x00000001;
321pub const SPREG_GETPROCADDR: DWORD = 0x00000002;
322pub const SPREG_REGSVR: DWORD = 0x00000003;
323pub const SPREG_DLLINSTALL: DWORD = 0x00000004;
324pub const SPREG_TIMEOUT: DWORD = 0x00000005;
325pub const SPREG_UNKNOWN: DWORD = 0xFFFFFFFF;
326pub type HSPFILEQ = PVOID;
327STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_FILE_COPY_PARAMS_A {
328    cbSize: DWORD,
329    QueueHandle: HSPFILEQ,
330    SourceRootPath: PCSTR,
331    SourcePath: PCSTR,
332    SourceFilename: PCSTR,
333    SourceDescription: PCSTR,
334    SourceTagfile: PCSTR,
335    TargetDirectory: PCSTR,
336    TargetFilename: PCSTR,
337    CopyStyle: DWORD,
338    LayoutInf: HINF,
339    SecurityDescriptor: PCSTR,
340}}
341pub type PSP_FILE_COPY_PARAMS_A = *mut SP_FILE_COPY_PARAMS_A;
342STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_FILE_COPY_PARAMS_W {
343    cbSize: DWORD,
344    QueueHandle: HSPFILEQ,
345    SourceRootPath: PCWSTR,
346    SourcePath: PCWSTR,
347    SourceFilename: PCWSTR,
348    SourceDescription: PCWSTR,
349    SourceTagfile: PCWSTR,
350    TargetDirectory: PCWSTR,
351    TargetFilename: PCWSTR,
352    CopyStyle: DWORD,
353    LayoutInf: HINF,
354    SecurityDescriptor: PCWSTR,
355}}
356pub type PSP_FILE_COPY_PARAMS_W = *mut SP_FILE_COPY_PARAMS_W;
357pub type HDSKSPC = PVOID;
358pub type HDEVINFO = PVOID;
359STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINFO_DATA {
360    cbSize: DWORD,
361    ClassGuid: GUID,
362    DevInst: DWORD,
363    Reserved: ULONG_PTR,
364}}
365pub type PSP_DEVINFO_DATA = *mut SP_DEVINFO_DATA;
366STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVICE_INTERFACE_DATA {
367    cbSize: DWORD,
368    InterfaceClassGuid: GUID,
369    Flags: DWORD,
370    Reserved: ULONG_PTR,
371}}
372pub type PSP_DEVICE_INTERFACE_DATA = *mut SP_DEVICE_INTERFACE_DATA;
373pub const SPINT_ACTIVE: DWORD = 0x00000001;
374pub const SPINT_DEFAULT: DWORD = 0x00000002;
375pub const SPINT_REMOVED: DWORD = 0x00000004;
376pub type SP_INTERFACE_DEVICE_DATA = SP_DEVICE_INTERFACE_DATA;
377pub type PSP_INTERFACE_DEVICE_DATA = PSP_DEVICE_INTERFACE_DATA;
378pub const SPID_ACTIVE: DWORD = SPINT_ACTIVE;
379pub const SPID_DEFAULT: DWORD = SPINT_DEFAULT;
380pub const SPID_REMOVED: DWORD = SPINT_REMOVED;
381STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVICE_INTERFACE_DETAIL_DATA_A {
382    cbSize: DWORD,
383    DevicePath: [CHAR; ANYSIZE_ARRAY],
384}}
385pub type PSP_DEVICE_INTERFACE_DETAIL_DATA_A = *mut SP_DEVICE_INTERFACE_DETAIL_DATA_A;
386STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVICE_INTERFACE_DETAIL_DATA_W {
387    cbSize: DWORD,
388    DevicePath: [WCHAR; ANYSIZE_ARRAY],
389}}
390pub type PSP_DEVICE_INTERFACE_DETAIL_DATA_W = *mut SP_DEVICE_INTERFACE_DETAIL_DATA_W;
391STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINFO_LIST_DETAIL_DATA_A {
392    cbSize: DWORD,
393    ClassGuid: GUID,
394    RemoteMachineHandle: HANDLE,
395    RemoteMachineName: [CHAR; SP_MAX_MACHINENAME_LENGTH],
396}}
397pub type PSP_DEVINFO_LIST_DETAIL_DATA_A = *mut SP_DEVINFO_LIST_DETAIL_DATA_A;
398STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINFO_LIST_DETAIL_DATA_W {
399    cbSize: DWORD,
400    ClassGuid: GUID,
401    RemoteMachineHandle: HANDLE,
402    RemoteMachineName: [WCHAR; SP_MAX_MACHINENAME_LENGTH],
403}}
404pub type PSP_DEVINFO_LIST_DETAIL_DATA_W = *mut SP_DEVINFO_LIST_DETAIL_DATA_W;
405pub const DIF_SELECTDEVICE: DI_FUNCTION = 0x00000001;
406pub const DIF_INSTALLDEVICE: DI_FUNCTION = 0x00000002;
407pub const DIF_ASSIGNRESOURCES: DI_FUNCTION = 0x00000003;
408pub const DIF_PROPERTIES: DI_FUNCTION = 0x00000004;
409pub const DIF_REMOVE: DI_FUNCTION = 0x00000005;
410pub const DIF_FIRSTTIMESETUP: DI_FUNCTION = 0x00000006;
411pub const DIF_FOUNDDEVICE: DI_FUNCTION = 0x00000007;
412pub const DIF_SELECTCLASSDRIVERS: DI_FUNCTION = 0x00000008;
413pub const DIF_VALIDATECLASSDRIVERS: DI_FUNCTION = 0x00000009;
414pub const DIF_INSTALLCLASSDRIVERS: DI_FUNCTION = 0x0000000A;
415pub const DIF_CALCDISKSPACE: DI_FUNCTION = 0x0000000B;
416pub const DIF_DESTROYPRIVATEDATA: DI_FUNCTION = 0x0000000C;
417pub const DIF_VALIDATEDRIVER: DI_FUNCTION = 0x0000000D;
418pub const DIF_DETECT: DI_FUNCTION = 0x0000000F;
419pub const DIF_INSTALLWIZARD: DI_FUNCTION = 0x00000010;
420pub const DIF_DESTROYWIZARDDATA: DI_FUNCTION = 0x00000011;
421pub const DIF_PROPERTYCHANGE: DI_FUNCTION = 0x00000012;
422pub const DIF_ENABLECLASS: DI_FUNCTION = 0x00000013;
423pub const DIF_DETECTVERIFY: DI_FUNCTION = 0x00000014;
424pub const DIF_INSTALLDEVICEFILES: DI_FUNCTION = 0x00000015;
425pub const DIF_UNREMOVE: DI_FUNCTION = 0x00000016;
426pub const DIF_SELECTBESTCOMPATDRV: DI_FUNCTION = 0x00000017;
427pub const DIF_ALLOW_INSTALL: DI_FUNCTION = 0x00000018;
428pub const DIF_REGISTERDEVICE: DI_FUNCTION = 0x00000019;
429pub const DIF_NEWDEVICEWIZARD_PRESELECT: DI_FUNCTION = 0x0000001A;
430pub const DIF_NEWDEVICEWIZARD_SELECT: DI_FUNCTION = 0x0000001B;
431pub const DIF_NEWDEVICEWIZARD_PREANALYZE: DI_FUNCTION = 0x0000001C;
432pub const DIF_NEWDEVICEWIZARD_POSTANALYZE: DI_FUNCTION = 0x0000001D;
433pub const DIF_NEWDEVICEWIZARD_FINISHINSTALL: DI_FUNCTION = 0x0000001E;
434pub const DIF_UNUSED1: DI_FUNCTION = 0x0000001F;
435pub const DIF_INSTALLINTERFACES: DI_FUNCTION = 0x00000020;
436pub const DIF_DETECTCANCEL: DI_FUNCTION = 0x00000021;
437pub const DIF_REGISTER_COINSTALLERS: DI_FUNCTION = 0x00000022;
438pub const DIF_ADDPROPERTYPAGE_ADVANCED: DI_FUNCTION = 0x00000023;
439pub const DIF_ADDPROPERTYPAGE_BASIC: DI_FUNCTION = 0x00000024;
440pub const DIF_RESERVED1: DI_FUNCTION = 0x00000025;
441pub const DIF_TROUBLESHOOTER: DI_FUNCTION = 0x00000026;
442pub const DIF_POWERMESSAGEWAKE: DI_FUNCTION = 0x00000027;
443pub const DIF_ADDREMOTEPROPERTYPAGE_ADVANCED: DI_FUNCTION = 0x00000028;
444pub const DIF_UPDATEDRIVER_UI: DI_FUNCTION = 0x00000029;
445pub const DIF_FINISHINSTALL_ACTION: DI_FUNCTION = 0x0000002A;
446pub const DIF_RESERVED2: DI_FUNCTION = 0x00000030;
447pub const DIF_MOVEDEVICE: DI_FUNCTION = 0x0000000E;
448pub type DI_FUNCTION = UINT;
449STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINSTALL_PARAMS_A {
450    cbSize: DWORD,
451    Flags: DWORD,
452    FlagsEx: DWORD,
453    hwndParent: HWND,
454    InstallMsgHandler: PSP_FILE_CALLBACK_A,
455    InstallMsgHandlerContext: PVOID,
456    FileQueue: HSPFILEQ,
457    ClassInstallReserved: ULONG_PTR,
458    Reserved: DWORD,
459    DriverPath: [CHAR; MAX_PATH],
460}}
461pub type PSP_DEVINSTALL_PARAMS_A = *mut SP_DEVINSTALL_PARAMS_A;
462STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINSTALL_PARAMS_W {
463    cbSize: DWORD,
464    Flags: DWORD,
465    FlagsEx: DWORD,
466    hwndParent: HWND,
467    InstallMsgHandler: PSP_FILE_CALLBACK_W,
468    InstallMsgHandlerContext: PVOID,
469    FileQueue: HSPFILEQ,
470    ClassInstallReserved: ULONG_PTR,
471    Reserved: DWORD,
472    DriverPath: [WCHAR; MAX_PATH],
473}}
474pub type PSP_DEVINSTALL_PARAMS_W = *mut SP_DEVINSTALL_PARAMS_W;
475pub const DI_SHOWOEM: DWORD = 0x00000001;
476pub const DI_SHOWCOMPAT: DWORD = 0x00000002;
477pub const DI_SHOWCLASS: DWORD = 0x00000004;
478pub const DI_SHOWALL: DWORD = 0x00000007;
479pub const DI_NOVCP: DWORD = 0x00000008;
480pub const DI_DIDCOMPAT: DWORD = 0x00000010;
481pub const DI_DIDCLASS: DWORD = 0x00000020;
482pub const DI_AUTOASSIGNRES: DWORD = 0x00000040;
483pub const DI_NEEDRESTART: DWORD = 0x00000080;
484pub const DI_NEEDREBOOT: DWORD = 0x00000100;
485pub const DI_NOBROWSE: DWORD = 0x00000200;
486pub const DI_MULTMFGS: DWORD = 0x00000400;
487pub const DI_DISABLED: DWORD = 0x00000800;
488pub const DI_GENERALPAGE_ADDED: DWORD = 0x00001000;
489pub const DI_RESOURCEPAGE_ADDED: DWORD = 0x00002000;
490pub const DI_PROPERTIES_CHANGE: DWORD = 0x00004000;
491pub const DI_INF_IS_SORTED: DWORD = 0x00008000;
492pub const DI_ENUMSINGLEINF: DWORD = 0x00010000;
493pub const DI_DONOTCALLCONFIGMG: DWORD = 0x00020000;
494pub const DI_INSTALLDISABLED: DWORD = 0x00040000;
495pub const DI_COMPAT_FROM_CLASS: DWORD = 0x00080000;
496pub const DI_CLASSINSTALLPARAMS: DWORD = 0x00100000;
497pub const DI_NODI_DEFAULTACTION: DWORD = 0x00200000;
498pub const DI_QUIETINSTALL: DWORD = 0x00800000;
499pub const DI_NOFILECOPY: DWORD = 0x01000000;
500pub const DI_FORCECOPY: DWORD = 0x02000000;
501pub const DI_DRIVERPAGE_ADDED: DWORD = 0x04000000;
502pub const DI_USECI_SELECTSTRINGS: DWORD = 0x08000000;
503pub const DI_OVERRIDE_INFFLAGS: DWORD = 0x10000000;
504pub const DI_PROPS_NOCHANGEUSAGE: DWORD = 0x20000000;
505pub const DI_NOSELECTICONS: DWORD = 0x40000000;
506pub const DI_NOWRITE_IDS: DWORD = 0x80000000;
507pub const DI_FLAGSEX_RESERVED2: DWORD = 0x00000001;
508pub const DI_FLAGSEX_RESERVED3: DWORD = 0x00000002;
509pub const DI_FLAGSEX_CI_FAILED: DWORD = 0x00000004;
510pub const DI_FLAGSEX_FINISHINSTALL_ACTION: DWORD = 0x00000008;
511pub const DI_FLAGSEX_DIDINFOLIST: DWORD = 0x00000010;
512pub const DI_FLAGSEX_DIDCOMPATINFO: DWORD = 0x00000020;
513pub const DI_FLAGSEX_FILTERCLASSES: DWORD = 0x00000040;
514pub const DI_FLAGSEX_SETFAILEDINSTALL: DWORD = 0x00000080;
515pub const DI_FLAGSEX_DEVICECHANGE: DWORD = 0x00000100;
516pub const DI_FLAGSEX_ALWAYSWRITEIDS: DWORD = 0x00000200;
517pub const DI_FLAGSEX_PROPCHANGE_PENDING: DWORD = 0x00000400;
518pub const DI_FLAGSEX_ALLOWEXCLUDEDDRVS: DWORD = 0x00000800;
519pub const DI_FLAGSEX_NOUIONQUERYREMOVE: DWORD = 0x00001000;
520pub const DI_FLAGSEX_USECLASSFORCOMPAT: DWORD = 0x00002000;
521pub const DI_FLAGSEX_RESERVED4: DWORD = 0x00004000;
522pub const DI_FLAGSEX_NO_DRVREG_MODIFY: DWORD = 0x00008000;
523pub const DI_FLAGSEX_IN_SYSTEM_SETUP: DWORD = 0x00010000;
524pub const DI_FLAGSEX_INET_DRIVER: DWORD = 0x00020000;
525pub const DI_FLAGSEX_APPENDDRIVERLIST: DWORD = 0x00040000;
526pub const DI_FLAGSEX_PREINSTALLBACKUP: DWORD = 0x00080000;
527pub const DI_FLAGSEX_BACKUPONREPLACE: DWORD = 0x00100000;
528pub const DI_FLAGSEX_DRIVERLIST_FROM_URL: DWORD = 0x00200000;
529pub const DI_FLAGSEX_RESERVED1: DWORD = 0x00400000;
530pub const DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS: DWORD = 0x00800000;
531pub const DI_FLAGSEX_POWERPAGE_ADDED: DWORD = 0x01000000;
532pub const DI_FLAGSEX_FILTERSIMILARDRIVERS: DWORD = 0x02000000;
533pub const DI_FLAGSEX_INSTALLEDDRIVER: DWORD = 0x04000000;
534pub const DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE: DWORD = 0x08000000;
535pub const DI_FLAGSEX_ALTPLATFORM_DRVSEARCH: DWORD = 0x10000000;
536pub const DI_FLAGSEX_RESTART_DEVICE_ONLY: DWORD = 0x20000000;
537pub const DI_FLAGSEX_RECURSIVESEARCH: DWORD = 0x40000000;
538pub const DI_FLAGSEX_SEARCH_PUBLISHED_INFS: DWORD = 0x80000000;
539STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_CLASSINSTALL_HEADER {
540    cbSize: DWORD,
541    InstallFunction: DI_FUNCTION,
542}}
543pub type PSP_CLASSINSTALL_HEADER = *mut SP_CLASSINSTALL_HEADER;
544STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ENABLECLASS_PARAMS {
545    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
546    ClassGuid: GUID,
547    EnableMessage: DWORD,
548}}
549pub type PSP_ENABLECLASS_PARAMS = *mut SP_ENABLECLASS_PARAMS;
550pub const ENABLECLASS_QUERY: DWORD = 0;
551pub const ENABLECLASS_SUCCESS: DWORD = 1;
552pub const ENABLECLASS_FAILURE: DWORD = 2;
553pub const DICS_ENABLE: DWORD = 0x00000001;
554pub const DICS_DISABLE: DWORD = 0x00000002;
555pub const DICS_PROPCHANGE: DWORD = 0x00000003;
556pub const DICS_START: DWORD = 0x00000004;
557pub const DICS_STOP: DWORD = 0x00000005;
558pub const DICS_FLAG_GLOBAL: DWORD = 0x00000001;
559pub const DICS_FLAG_CONFIGSPECIFIC: DWORD = 0x00000002;
560pub const DICS_FLAG_CONFIGGENERAL: DWORD = 0x00000004;
561STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_PROPCHANGE_PARAMS {
562    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
563    StateChange: DWORD,
564    Scope: DWORD,
565    HwProfile: DWORD,
566}}
567pub type PSP_PROPCHANGE_PARAMS = *mut SP_PROPCHANGE_PARAMS;
568STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_REMOVEDEVICE_PARAMS {
569    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
570    Scope: DWORD,
571    HwProfile: DWORD,
572}}
573pub type PSP_REMOVEDEVICE_PARAMS = *mut SP_REMOVEDEVICE_PARAMS;
574pub const DI_REMOVEDEVICE_GLOBAL: DWORD = 0x00000001;
575pub const DI_REMOVEDEVICE_CONFIGSPECIFIC: DWORD = 0x00000002;
576STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_UNREMOVEDEVICE_PARAMS {
577    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
578    Scope: DWORD,
579    HwProfile: DWORD,
580}}
581pub type PSP_UNREMOVEDEVICE_PARAMS = *mut SP_UNREMOVEDEVICE_PARAMS;
582pub const DI_UNREMOVEDEVICE_CONFIGSPECIFIC: DWORD = 0x00000002;
583STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_SELECTDEVICE_PARAMS_A {
584    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
585    Title: [CHAR; MAX_TITLE_LEN],
586    Instructions: [CHAR; MAX_INSTRUCTION_LEN],
587    ListLabel: [CHAR; MAX_LABEL_LEN],
588    SubTitle: [CHAR; MAX_SUBTITLE_LEN],
589    Reserved: [BYTE; 2],
590}}
591pub type PSP_SELECTDEVICE_PARAMS_A = *mut SP_SELECTDEVICE_PARAMS_A;
592STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_SELECTDEVICE_PARAMS_W {
593    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
594    Title: [WCHAR; MAX_TITLE_LEN],
595    Instructions: [WCHAR; MAX_INSTRUCTION_LEN],
596    ListLabel: [WCHAR; MAX_LABEL_LEN],
597    SubTitle: [WCHAR; MAX_SUBTITLE_LEN],
598}}
599pub type PSP_SELECTDEVICE_PARAMS_W = *mut SP_SELECTDEVICE_PARAMS_W;
600FN!{stdcall PDETECT_PROGRESS_NOTIFY(
601    ProgressNotifyParam: PVOID,
602    DetectComplete: DWORD,
603) -> BOOL}
604STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DETECTDEVICE_PARAMS {
605    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
606    DetectProgressNotify: PDETECT_PROGRESS_NOTIFY,
607    ProgressNotifyParam: PVOID,
608}}
609pub type PSP_DETECTDEVICE_PARAMS = *mut SP_DETECTDEVICE_PARAMS;
610pub const MAX_INSTALLWIZARD_DYNAPAGES: usize = 20;
611STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INSTALLWIZARD_DATA {
612    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
613    Flags: DWORD,
614    DynamicPages: [HPROPSHEETPAGE; MAX_INSTALLWIZARD_DYNAPAGES],
615    NumDynamicPages: DWORD,
616    DynamicPageFlags: DWORD,
617    PrivateFlags: DWORD,
618    PrivateData: LPARAM,
619    hwndWizardDlg: HWND,
620}}
621pub type PSP_INSTALLWIZARD_DATA = *mut SP_INSTALLWIZARD_DATA;
622pub const NDW_INSTALLFLAG_DIDFACTDEFS: DWORD = 0x00000001;
623pub const NDW_INSTALLFLAG_HARDWAREALLREADYIN: DWORD = 0x00000002;
624pub const NDW_INSTALLFLAG_NEEDRESTART: DWORD = DI_NEEDRESTART;
625pub const NDW_INSTALLFLAG_NEEDREBOOT: DWORD = DI_NEEDREBOOT;
626pub const NDW_INSTALLFLAG_NEEDSHUTDOWN: DWORD = 0x00000200;
627pub const NDW_INSTALLFLAG_EXPRESSINTRO: DWORD = 0x00000400;
628pub const NDW_INSTALLFLAG_SKIPISDEVINSTALLED: DWORD = 0x00000800;
629pub const NDW_INSTALLFLAG_NODETECTEDDEVS: DWORD = 0x00001000;
630pub const NDW_INSTALLFLAG_INSTALLSPECIFIC: DWORD = 0x00002000;
631pub const NDW_INSTALLFLAG_SKIPCLASSLIST: DWORD = 0x00004000;
632pub const NDW_INSTALLFLAG_CI_PICKED_OEM: DWORD = 0x00008000;
633pub const NDW_INSTALLFLAG_PCMCIAMODE: DWORD = 0x00010000;
634pub const NDW_INSTALLFLAG_PCMCIADEVICE: DWORD = 0x00020000;
635pub const NDW_INSTALLFLAG_USERCANCEL: DWORD = 0x00040000;
636pub const NDW_INSTALLFLAG_KNOWNCLASS: DWORD = 0x00080000;
637pub const DYNAWIZ_FLAG_PAGESADDED: DWORD = 0x00000001;
638pub const DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT: DWORD = 0x00000008;
639pub const DYNAWIZ_FLAG_INSTALLDET_NEXT: DWORD = 0x00000002;
640pub const DYNAWIZ_FLAG_INSTALLDET_PREV: DWORD = 0x00000004;
641pub const MIN_IDD_DYNAWIZ_RESOURCE_ID: c_int = 10000;
642pub const MAX_IDD_DYNAWIZ_RESOURCE_ID: c_int = 11000;
643pub const IDD_DYNAWIZ_FIRSTPAGE: c_int = 10000;
644pub const IDD_DYNAWIZ_SELECT_PREVPAGE: c_int = 10001;
645pub const IDD_DYNAWIZ_SELECT_NEXTPAGE: c_int = 10002;
646pub const IDD_DYNAWIZ_ANALYZE_PREVPAGE: c_int = 10003;
647pub const IDD_DYNAWIZ_ANALYZE_NEXTPAGE: c_int = 10004;
648pub const IDD_DYNAWIZ_SELECTDEV_PAGE: c_int = 10009;
649pub const IDD_DYNAWIZ_ANALYZEDEV_PAGE: c_int = 10010;
650pub const IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE: c_int = 10011;
651pub const IDD_DYNAWIZ_SELECTCLASS_PAGE: c_int = 10012;
652pub const IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE: c_int = 10006;
653pub const IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE: c_int = 10007;
654pub const IDD_DYNAWIZ_INSTALLDETECTED_NODEVS: c_int = 10008;
655STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_NEWDEVICEWIZARD_DATA {
656    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
657    Flags: DWORD,
658    DynamicPages: [HPROPSHEETPAGE; MAX_INSTALLWIZARD_DYNAPAGES],
659    NumDynamicPages: DWORD,
660    hwndWizardDlg: HWND,
661}}
662pub type PSP_NEWDEVICEWIZARD_DATA = *mut SP_NEWDEVICEWIZARD_DATA;
663pub type SP_ADDPROPERTYPAGE_DATA = SP_NEWDEVICEWIZARD_DATA;
664pub type PSP_ADDPROPERTYPAGE_DATA = PSP_NEWDEVICEWIZARD_DATA;
665STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_TROUBLESHOOTER_PARAMS_A {
666    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
667    ChmFile: [CHAR; MAX_PATH],
668    HtmlTroubleShooter: [CHAR; MAX_PATH],
669}}
670pub type PSP_TROUBLESHOOTER_PARAMS_A = *mut SP_TROUBLESHOOTER_PARAMS_A;
671STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_TROUBLESHOOTER_PARAMS_W {
672    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
673    ChmFile: [WCHAR; MAX_PATH],
674    HtmlTroubleShooter: [WCHAR; MAX_PATH],
675}}
676pub type PSP_TROUBLESHOOTER_PARAMS_W = *mut SP_TROUBLESHOOTER_PARAMS_W;
677STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_POWERMESSAGEWAKE_PARAMS_A {
678    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
679    PowerMessageWake: [CHAR; LINE_LEN * 2],
680}}
681pub type PSP_POWERMESSAGEWAKE_PARAMS_A = *mut SP_POWERMESSAGEWAKE_PARAMS_A;
682STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_POWERMESSAGEWAKE_PARAMS_W {
683    ClassInstallHeader: SP_CLASSINSTALL_HEADER,
684    PowerMessageWake: [WCHAR; LINE_LEN * 2],
685}}
686pub type PSP_POWERMESSAGEWAKE_PARAMS_W = *mut SP_POWERMESSAGEWAKE_PARAMS_W;
687STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V2_A {
688    cbSize: DWORD,
689    DriverType: DWORD,
690    Reserved: ULONG_PTR,
691    Description: [CHAR; LINE_LEN],
692    MfgName: [CHAR; LINE_LEN],
693    ProviderName: [CHAR; LINE_LEN],
694    DriverDate: FILETIME,
695    DriverVersion: DWORDLONG,
696}}
697pub type PSP_DRVINFO_DATA_V2_A = *mut SP_DRVINFO_DATA_V2_A;
698STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V2_W {
699    cbSize: DWORD,
700    DriverType: DWORD,
701    Reserved: ULONG_PTR,
702    Description: [WCHAR; LINE_LEN],
703    MfgName: [WCHAR; LINE_LEN],
704    ProviderName: [WCHAR; LINE_LEN],
705    DriverDate: FILETIME,
706    DriverVersion: DWORDLONG,
707}}
708pub type PSP_DRVINFO_DATA_V2_W = *mut SP_DRVINFO_DATA_V2_W;
709STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V1_A {
710    cbSize: DWORD,
711    DriverType: DWORD,
712    Reserved: ULONG_PTR,
713    Description: [CHAR; LINE_LEN],
714    MfgName: [CHAR; LINE_LEN],
715    ProviderName: [CHAR; LINE_LEN],
716}}
717pub type PSP_DRVINFO_DATA_V1_A = *mut SP_DRVINFO_DATA_V1_A;
718STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V1_W {
719    cbSize: DWORD,
720    DriverType: DWORD,
721    Reserved: ULONG_PTR,
722    Description: [WCHAR; LINE_LEN],
723    MfgName: [WCHAR; LINE_LEN],
724    ProviderName: [WCHAR; LINE_LEN],
725}}
726pub type PSP_DRVINFO_DATA_V1_W = *mut SP_DRVINFO_DATA_V1_W;
727pub type SP_DRVINFO_DATA_A = SP_DRVINFO_DATA_V2_A;
728pub type PSP_DRVINFO_DATA_A = PSP_DRVINFO_DATA_V2_A;
729pub type SP_DRVINFO_DATA_W = SP_DRVINFO_DATA_V2_W;
730pub type PSP_DRVINFO_DATA_W = PSP_DRVINFO_DATA_V2_W;
731STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DETAIL_DATA_A {
732    cbSize: DWORD,
733    InfDate: FILETIME,
734    CompatIDsOffset: DWORD,
735    CompatIDsLength: DWORD,
736    Reserved: ULONG_PTR,
737    SectionName: [CHAR; LINE_LEN],
738    InfFileName: [CHAR; MAX_PATH],
739    DrvDescription: [CHAR; LINE_LEN],
740    HardwareID: [CHAR; ANYSIZE_ARRAY],
741}}
742pub type PSP_DRVINFO_DETAIL_DATA_A = *mut SP_DRVINFO_DETAIL_DATA_A;
743STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DETAIL_DATA_W {
744    cbSize: DWORD,
745    InfDate: FILETIME,
746    CompatIDsOffset: DWORD,
747    CompatIDsLength: DWORD,
748    Reserved: ULONG_PTR,
749    SectionName: [WCHAR; LINE_LEN],
750    InfFileName: [WCHAR; MAX_PATH],
751    DrvDescription: [WCHAR; LINE_LEN],
752    HardwareID: [WCHAR; ANYSIZE_ARRAY],
753}}
754pub type PSP_DRVINFO_DETAIL_DATA_W = *mut SP_DRVINFO_DETAIL_DATA_W;
755STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINSTALL_PARAMS {
756    cbSize: DWORD,
757    Rank: DWORD,
758    Flags: DWORD,
759    PrivateData: DWORD_PTR,
760    Reserved: DWORD,
761}}
762pub type PSP_DRVINSTALL_PARAMS = *mut SP_DRVINSTALL_PARAMS;
763pub const DNF_DUPDESC: DWORD = 0x00000001;
764pub const DNF_OLDDRIVER: DWORD = 0x00000002;
765pub const DNF_EXCLUDEFROMLIST: DWORD = 0x00000004;
766pub const DNF_NODRIVER: DWORD = 0x00000008;
767pub const DNF_LEGACYINF: DWORD = 0x00000010;
768pub const DNF_CLASS_DRIVER: DWORD = 0x00000020;
769pub const DNF_COMPATIBLE_DRIVER: DWORD = 0x00000040;
770pub const DNF_INET_DRIVER: DWORD = 0x00000080;
771pub const DNF_UNUSED1: DWORD = 0x00000100;
772pub const DNF_UNUSED2: DWORD = 0x00000200;
773pub const DNF_OLD_INET_DRIVER: DWORD = 0x00000400;
774pub const DNF_BAD_DRIVER: DWORD = 0x00000800;
775pub const DNF_DUPPROVIDER: DWORD = 0x00001000;
776pub const DNF_INF_IS_SIGNED: DWORD = 0x00002000;
777pub const DNF_OEM_F6_INF: DWORD = 0x00004000;
778pub const DNF_DUPDRIVERVER: DWORD = 0x00008000;
779pub const DNF_BASIC_DRIVER: DWORD = 0x00010000;
780pub const DNF_AUTHENTICODE_SIGNED: DWORD = 0x00020000;
781pub const DNF_INSTALLEDDRIVER: DWORD = 0x00040000;
782pub const DNF_ALWAYSEXCLUDEFROMLIST: DWORD = 0x00080000;
783pub const DNF_INBOX_DRIVER: DWORD = 0x00100000;
784pub const DNF_REQUESTADDITIONALSOFTWARE: DWORD = 0x00200000;
785pub const DNF_UNUSED_22: DWORD = 0x00400000;
786pub const DNF_UNUSED_23: DWORD = 0x00800000;
787pub const DNF_UNUSED_24: DWORD = 0x01000000;
788pub const DNF_UNUSED_25: DWORD = 0x02000000;
789pub const DNF_UNUSED_26: DWORD = 0x04000000;
790pub const DNF_UNUSED_27: DWORD = 0x08000000;
791pub const DNF_UNUSED_28: DWORD = 0x10000000;
792pub const DNF_UNUSED_29: DWORD = 0x20000000;
793pub const DNF_UNUSED_30: DWORD = 0x40000000;
794pub const DNF_UNUSED_31: DWORD = 0x80000000;
795pub const DRIVER_HARDWAREID_RANK: DWORD = 0x00000FFF;
796pub const DRIVER_HARDWAREID_MASK: DWORD = 0x80000FFF;
797pub const DRIVER_UNTRUSTED_RANK: DWORD = 0x80000000;
798pub const DRIVER_W9X_SUSPECT_RANK: DWORD = 0xC0000000;
799FN!{stdcall PSP_DETSIG_CMPPROC(
800    DeviceInfoSet: HDEVINFO,
801    NewDeviceData: PSP_DEVINFO_DATA,
802    ExistingDeviceData: PSP_DEVINFO_DATA,
803    CompareContext: PVOID,
804) -> DWORD}
805STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct COINSTALLER_CONTEXT_DATA {
806    PostProcessing: BOOL,
807    InstallResult: DWORD,
808    PrivateData: PVOID,
809}}
810pub type PCOINSTALLER_CONTEXT_DATA = *mut COINSTALLER_CONTEXT_DATA;
811STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_CLASSIMAGELIST_DATA {
812    cbSize: DWORD,
813    ImageList: HIMAGELIST,
814    Reserved: ULONG_PTR,
815}}
816pub type PSP_CLASSIMAGELIST_DATA = *mut SP_CLASSIMAGELIST_DATA;
817STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_PROPSHEETPAGE_REQUEST {
818    cbSize: DWORD,
819    PageRequested: DWORD,
820    DeviceInfoSet: HDEVINFO,
821    DeviceInfoData: PSP_DEVINFO_DATA,
822}}
823pub type PSP_PROPSHEETPAGE_REQUEST = *mut SP_PROPSHEETPAGE_REQUEST;
824pub const SPPSR_SELECT_DEVICE_RESOURCES: DWORD = 1;
825pub const SPPSR_ENUM_BASIC_DEVICE_PROPERTIES: DWORD = 2;
826pub const SPPSR_ENUM_ADV_DEVICE_PROPERTIES: DWORD = 3;
827STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V2_A {
828    cbSize: DWORD,
829    FullInfPath: [CHAR; MAX_PATH],
830    FilenameOffset: INT,
831    ReinstallInstance: [CHAR; MAX_PATH],
832}}
833pub type PSP_BACKUP_QUEUE_PARAMS_V2_A = *mut SP_BACKUP_QUEUE_PARAMS_V2_A;
834STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V2_W {
835    cbSize: DWORD,
836    FullInfPath: [WCHAR; MAX_PATH],
837    FilenameOffset: INT,
838    ReinstallInstance: [WCHAR; MAX_PATH],
839}}
840pub type PSP_BACKUP_QUEUE_PARAMS_V2_W = *mut SP_BACKUP_QUEUE_PARAMS_V2_W;
841STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V1_A {
842    cbSize: DWORD,
843    FullInfPath: [CHAR; MAX_PATH],
844    FilenameOffset: INT,
845}}
846pub type PSP_BACKUP_QUEUE_PARAMS_V1_A = *mut SP_BACKUP_QUEUE_PARAMS_V1_A;
847STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V1_W {
848    cbSize: DWORD,
849    FullInfPath: [WCHAR; MAX_PATH],
850    FilenameOffset: INT,
851}}
852pub type PSP_BACKUP_QUEUE_PARAMS_V1_W = *mut SP_BACKUP_QUEUE_PARAMS_V1_W;
853pub type SP_BACKUP_QUEUE_PARAMS_A = SP_BACKUP_QUEUE_PARAMS_V2_A;
854pub type PSP_BACKUP_QUEUE_PARAMS_A = PSP_BACKUP_QUEUE_PARAMS_V2_A;
855pub type SP_BACKUP_QUEUE_PARAMS_W = SP_BACKUP_QUEUE_PARAMS_V2_W;
856pub type PSP_BACKUP_QUEUE_PARAMS_W = PSP_BACKUP_QUEUE_PARAMS_V2_W;
857pub const ERROR_EXPECTED_SECTION_NAME: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0;
858pub const ERROR_BAD_SECTION_NAME_LINE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 1;
859pub const ERROR_SECTION_NAME_TOO_LONG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 2;
860pub const ERROR_GENERAL_SYNTAX: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 3;
861pub const ERROR_WRONG_INF_STYLE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x100;
862pub const ERROR_SECTION_NOT_FOUND: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x101;
863pub const ERROR_LINE_NOT_FOUND: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x102;
864pub const ERROR_NO_BACKUP: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x103;
865pub const ERROR_NO_ASSOCIATED_CLASS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x200;
866pub const ERROR_CLASS_MISMATCH: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x201;
867pub const ERROR_DUPLICATE_FOUND: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x202;
868pub const ERROR_NO_DRIVER_SELECTED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x203;
869pub const ERROR_KEY_DOES_NOT_EXIST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x204;
870pub const ERROR_INVALID_DEVINST_NAME: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
871    | 0x205;
872pub const ERROR_INVALID_CLASS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x206;
873pub const ERROR_DEVINST_ALREADY_EXISTS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
874    | 0x207;
875pub const ERROR_DEVINFO_NOT_REGISTERED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
876    | 0x208;
877pub const ERROR_INVALID_REG_PROPERTY: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
878    | 0x209;
879pub const ERROR_NO_INF: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20A;
880pub const ERROR_NO_SUCH_DEVINST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20B;
881pub const ERROR_CANT_LOAD_CLASS_ICON: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
882    | 0x20C;
883pub const ERROR_INVALID_CLASS_INSTALLER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
884    | 0x20D;
885pub const ERROR_DI_DO_DEFAULT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20E;
886pub const ERROR_DI_NOFILECOPY: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20F;
887pub const ERROR_INVALID_HWPROFILE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x210;
888pub const ERROR_NO_DEVICE_SELECTED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x211;
889pub const ERROR_DEVINFO_LIST_LOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x212;
890pub const ERROR_DEVINFO_DATA_LOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x213;
891pub const ERROR_DI_BAD_PATH: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x214;
892pub const ERROR_NO_CLASSINSTALL_PARAMS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
893    | 0x215;
894pub const ERROR_FILEQUEUE_LOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x216;
895pub const ERROR_BAD_SERVICE_INSTALLSECT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
896    | 0x217;
897pub const ERROR_NO_CLASS_DRIVER_LIST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
898    | 0x218;
899pub const ERROR_NO_ASSOCIATED_SERVICE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
900    | 0x219;
901pub const ERROR_NO_DEFAULT_DEVICE_INTERFACE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
902    | 0x21A;
903pub const ERROR_DEVICE_INTERFACE_ACTIVE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
904    | 0x21B;
905pub const ERROR_DEVICE_INTERFACE_REMOVED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
906    | 0x21C;
907pub const ERROR_BAD_INTERFACE_INSTALLSECT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
908    | 0x21D;
909pub const ERROR_NO_SUCH_INTERFACE_CLASS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
910    | 0x21E;
911pub const ERROR_INVALID_REFERENCE_STRING: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
912    | 0x21F;
913pub const ERROR_INVALID_MACHINENAME: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x220;
914pub const ERROR_REMOTE_COMM_FAILURE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x221;
915pub const ERROR_MACHINE_UNAVAILABLE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x222;
916pub const ERROR_NO_CONFIGMGR_SERVICES: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
917    | 0x223;
918pub const ERROR_INVALID_PROPPAGE_PROVIDER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
919    | 0x224;
920pub const ERROR_NO_SUCH_DEVICE_INTERFACE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
921    | 0x225;
922pub const ERROR_DI_POSTPROCESSING_REQUIRED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
923    | 0x226;
924pub const ERROR_INVALID_COINSTALLER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x227;
925pub const ERROR_NO_COMPAT_DRIVERS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x228;
926pub const ERROR_NO_DEVICE_ICON: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x229;
927pub const ERROR_INVALID_INF_LOGCONFIG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
928    | 0x22A;
929pub const ERROR_DI_DONT_INSTALL: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x22B;
930pub const ERROR_INVALID_FILTER_DRIVER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
931    | 0x22C;
932pub const ERROR_NON_WINDOWS_NT_DRIVER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
933    | 0x22D;
934pub const ERROR_NON_WINDOWS_DRIVER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x22E;
935pub const ERROR_NO_CATALOG_FOR_OEM_INF: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
936    | 0x22F;
937pub const ERROR_DEVINSTALL_QUEUE_NONNATIVE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
938    | 0x230;
939pub const ERROR_NOT_DISABLEABLE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x231;
940pub const ERROR_CANT_REMOVE_DEVINST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x232;
941pub const ERROR_INVALID_TARGET: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x233;
942pub const ERROR_DRIVER_NONNATIVE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x234;
943pub const ERROR_IN_WOW64: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x235;
944pub const ERROR_SET_SYSTEM_RESTORE_POINT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
945    | 0x236;
946pub const ERROR_SCE_DISABLED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x238;
947pub const ERROR_UNKNOWN_EXCEPTION: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x239;
948pub const ERROR_PNP_REGISTRY_ERROR: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x23A;
949pub const ERROR_REMOTE_REQUEST_UNSUPPORTED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
950    | 0x23B;
951pub const ERROR_NOT_AN_INSTALLED_OEM_INF: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
952    | 0x23C;
953pub const ERROR_INF_IN_USE_BY_DEVICES: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
954    | 0x23D;
955pub const ERROR_DI_FUNCTION_OBSOLETE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
956    | 0x23E;
957pub const ERROR_NO_AUTHENTICODE_CATALOG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
958    | 0x23F;
959pub const ERROR_AUTHENTICODE_DISALLOWED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
960    | 0x240;
961pub const ERROR_AUTHENTICODE_TRUSTED_PUBLISHER: DWORD = APPLICATION_ERROR_MASK
962    | ERROR_SEVERITY_ERROR | 0x241;
963pub const ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED: DWORD = APPLICATION_ERROR_MASK
964    | ERROR_SEVERITY_ERROR | 0x242;
965pub const ERROR_AUTHENTICODE_PUBLISHER_NOT_TRUSTED: DWORD = APPLICATION_ERROR_MASK
966    | ERROR_SEVERITY_ERROR | 0x243;
967pub const ERROR_SIGNATURE_OSATTRIBUTE_MISMATCH: DWORD = APPLICATION_ERROR_MASK
968    | ERROR_SEVERITY_ERROR | 0x244;
969pub const ERROR_ONLY_VALIDATE_VIA_AUTHENTICODE: DWORD = APPLICATION_ERROR_MASK
970    | ERROR_SEVERITY_ERROR | 0x245;
971pub const ERROR_DEVICE_INSTALLER_NOT_READY: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
972    | 0x246;
973pub const ERROR_DRIVER_STORE_ADD_FAILED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
974    | 0x247;
975pub const ERROR_DEVICE_INSTALL_BLOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
976    | 0x248;
977pub const ERROR_DRIVER_INSTALL_BLOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
978    | 0x249;
979pub const ERROR_WRONG_INF_TYPE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x24A;
980pub const ERROR_FILE_HASH_NOT_IN_CATALOG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
981    | 0x24B;
982pub const ERROR_DRIVER_STORE_DELETE_FAILED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
983    | 0x24C;
984pub const ERROR_UNRECOVERABLE_STACK_OVERFLOW: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
985    | 0x300;
986pub const EXCEPTION_SPAPI_UNRECOVERABLE_STACK_OVERFLOW: DWORD = ERROR_UNRECOVERABLE_STACK_OVERFLOW;
987pub const ERROR_NO_DEFAULT_INTERFACE_DEVICE: DWORD = ERROR_NO_DEFAULT_DEVICE_INTERFACE;
988pub const ERROR_INTERFACE_DEVICE_ACTIVE: DWORD = ERROR_DEVICE_INTERFACE_ACTIVE;
989pub const ERROR_INTERFACE_DEVICE_REMOVED: DWORD = ERROR_DEVICE_INTERFACE_REMOVED;
990pub const ERROR_NO_SUCH_INTERFACE_DEVICE: DWORD = ERROR_NO_SUCH_DEVICE_INTERFACE;
991pub const ERROR_NOT_INSTALLED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR
992    | 0x1000;
993extern "system" {
994    pub fn SetupGetInfInformationA(
995        InfSpec: LPCVOID,
996        SearchControl: DWORD,
997        ReturnBuffer: PSP_INF_INFORMATION,
998        ReturnBufferSize: DWORD,
999        RequiredSize: PDWORD,
1000    ) -> BOOL;
1001    pub fn SetupGetInfInformationW(
1002        InfSpec: LPCVOID,
1003        SearchControl: DWORD,
1004        ReturnBuffer: PSP_INF_INFORMATION,
1005        ReturnBufferSize: DWORD,
1006        RequiredSize: PDWORD,
1007    ) -> BOOL;
1008}
1009pub const INFINFO_INF_SPEC_IS_HINF: DWORD = 1;
1010pub const INFINFO_INF_NAME_IS_ABSOLUTE: DWORD = 2;
1011pub const INFINFO_DEFAULT_SEARCH: DWORD = 3;
1012pub const INFINFO_REVERSE_DEFAULT_SEARCH: DWORD = 4;
1013pub const INFINFO_INF_PATH_LIST_SEARCH: DWORD = 5;
1014extern "system" {
1015    pub fn SetupQueryInfFileInformationA(
1016        InfInformation: PSP_INF_INFORMATION,
1017        InfIndex: UINT,
1018        ReturnBuffer: PSTR,
1019        ReturnBufferSize: DWORD,
1020        RequiredSize: PDWORD,
1021    ) -> BOOL;
1022    pub fn SetupQueryInfFileInformationW(
1023        InfInformation: PSP_INF_INFORMATION,
1024        InfIndex: UINT,
1025        ReturnBuffer: PWSTR,
1026        ReturnBufferSize: DWORD,
1027        RequiredSize: PDWORD,
1028    ) -> BOOL;
1029    pub fn SetupQueryInfOriginalFileInformationA(
1030        InfInformation: PSP_INF_INFORMATION,
1031        InfIndex: UINT,
1032        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
1033        OriginalFileInfo: PSP_ORIGINAL_FILE_INFO_A,
1034    ) -> BOOL;
1035    pub fn SetupQueryInfOriginalFileInformationW(
1036        InfInformation: PSP_INF_INFORMATION,
1037        InfIndex: UINT,
1038        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
1039        OriginalFileInfo: PSP_ORIGINAL_FILE_INFO_W,
1040    ) -> BOOL;
1041    pub fn SetupQueryInfVersionInformationA(
1042        InfInformation: PSP_INF_INFORMATION,
1043        InfIndex: UINT,
1044        Key: PCSTR,
1045        ReturnBuffer: PSTR,
1046        ReturnBufferSize: DWORD,
1047        RequiredSize: PDWORD,
1048    ) -> BOOL;
1049    pub fn SetupQueryInfVersionInformationW(
1050        InfInformation: PSP_INF_INFORMATION,
1051        InfIndex: UINT,
1052        Key: PCWSTR,
1053        ReturnBuffer: PWSTR,
1054        ReturnBufferSize: DWORD,
1055        RequiredSize: PDWORD,
1056    ) -> BOOL;
1057    pub fn SetupGetInfDriverStoreLocationA(
1058        FileName: PCSTR,
1059        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
1060        LocaleName: PCSTR,
1061        ReturnBuffer: PSTR,
1062        ReturnBufferSize: DWORD,
1063        RequiredSize: PDWORD,
1064    ) -> BOOL;
1065    pub fn SetupGetInfDriverStoreLocationW(
1066        FileName: PCWSTR,
1067        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
1068        LocaleName: PCWSTR,
1069        ReturnBuffer: PWSTR,
1070        ReturnBufferSize: DWORD,
1071        RequiredSize: PDWORD,
1072    ) -> BOOL;
1073    pub fn SetupGetInfPublishedNameA(
1074        DriverStoreLocation: PCSTR,
1075        ReturnBuffer: PSTR,
1076        ReturnBufferSize: DWORD,
1077        RequiredSize: PDWORD,
1078    ) -> BOOL;
1079    pub fn SetupGetInfPublishedNameW(
1080        DriverStoreLocation: PCWSTR,
1081        ReturnBuffer: PWSTR,
1082        ReturnBufferSize: DWORD,
1083        RequiredSize: PDWORD,
1084    ) -> BOOL;
1085    pub fn SetupGetInfFileListA(
1086        DirectoryPath: PCSTR,
1087        InfStyle: DWORD,
1088        ReturnBuffer: PSTR,
1089        ReturnBufferSize: DWORD,
1090        RequiredSize: PDWORD,
1091    ) -> BOOL;
1092    pub fn SetupGetInfFileListW(
1093        DirectoryPath: PCWSTR,
1094        InfStyle: DWORD,
1095        ReturnBuffer: PWSTR,
1096        ReturnBufferSize: DWORD,
1097        RequiredSize: PDWORD,
1098    ) -> BOOL;
1099    pub fn SetupOpenInfFileW(
1100        FileName: PCWSTR,
1101        InfClass: PCWSTR,
1102        InfStyle: DWORD,
1103        ErrorLine: PUINT,
1104    ) -> HINF;
1105    pub fn SetupOpenInfFileA(
1106        FileName: PCSTR,
1107        InfClass: PCSTR,
1108        InfStyle: DWORD,
1109        ErrorLine: PUINT,
1110    ) -> HINF;
1111    pub fn SetupOpenMasterInf() -> HINF;
1112    pub fn SetupOpenAppendInfFileW(
1113        FileName: PCWSTR,
1114        InfHandle: HINF,
1115        ErrorLine: PUINT,
1116    ) -> BOOL;
1117    pub fn SetupOpenAppendInfFileA(
1118        FileName: PCSTR,
1119        InfHandle: HINF,
1120        ErrorLine: PUINT,
1121    ) -> BOOL;
1122    pub fn SetupCloseInfFile(
1123        InfHandle: HINF,
1124    ) -> ();
1125    pub fn SetupFindFirstLineA(
1126        InfHandle: HINF,
1127        Section: PCSTR,
1128        Key: PCSTR,
1129        Context: PINFCONTEXT,
1130    ) -> BOOL;
1131    pub fn SetupFindFirstLineW(
1132        InfHandle: HINF,
1133        Section: PCWSTR,
1134        Key: PCWSTR,
1135        Context: PINFCONTEXT,
1136    ) -> BOOL;
1137    pub fn SetupFindNextLine(
1138        ContextIn: PINFCONTEXT,
1139        ContextOut: PINFCONTEXT,
1140    ) -> BOOL;
1141    pub fn SetupFindNextMatchLineA(
1142        ContextIn: PINFCONTEXT,
1143        Key: PCSTR,
1144        ContextOut: PINFCONTEXT,
1145    ) -> BOOL;
1146    pub fn SetupFindNextMatchLineW(
1147        ContextIn: PINFCONTEXT,
1148        Key: PCWSTR,
1149        ContextOut: PINFCONTEXT,
1150    ) -> BOOL;
1151    pub fn SetupGetLineByIndexA(
1152        InfHandle: HINF,
1153        Section: PCSTR,
1154        Index: DWORD,
1155        Context: PINFCONTEXT,
1156    ) -> BOOL;
1157    pub fn SetupGetLineByIndexW(
1158        InfHandle: HINF,
1159        Section: PCWSTR,
1160        Index: DWORD,
1161        Context: PINFCONTEXT,
1162    ) -> BOOL;
1163    pub fn SetupGetLineCountA(
1164        InfHandle: HINF,
1165        Section: PCSTR,
1166    ) -> LONG;
1167    pub fn SetupGetLineCountW(
1168        InfHandle: HINF,
1169        Section: PCWSTR,
1170    ) -> LONG;
1171    pub fn SetupGetLineTextA(
1172        Context: PINFCONTEXT,
1173        InfHandle: HINF,
1174        Section: PCSTR,
1175        Key: PCSTR,
1176        ReturnBuffer: PSTR,
1177        ReturnBufferSize: DWORD,
1178        ReturnBufferSize: PDWORD,
1179    ) -> BOOL;
1180    pub fn SetupGetLineTextW(
1181        Context: PINFCONTEXT,
1182        InfHandle: HINF,
1183        Section: PCWSTR,
1184        Key: PCWSTR,
1185        ReturnBuffer: PWSTR,
1186        ReturnBufferSize: DWORD,
1187        ReturnBufferSize: PDWORD,
1188    ) -> BOOL;
1189    pub fn SetupGetFieldCount(
1190        Context: PINFCONTEXT,
1191    ) -> DWORD;
1192    pub fn SetupGetStringFieldA(
1193        Context: PINFCONTEXT,
1194        FieldIndex: DWORD,
1195        ReturnBuffer: PSTR,
1196        ReturnBufferSize: DWORD,
1197        RequiredSize: PDWORD,
1198    ) -> BOOL;
1199    pub fn SetupGetStringFieldW(
1200        Context: PINFCONTEXT,
1201        FieldIndex: DWORD,
1202        ReturnBuffer: PWSTR,
1203        ReturnBufferSize: DWORD,
1204        RequiredSize: PDWORD,
1205    ) -> BOOL;
1206    pub fn SetupGetIntField(
1207        Context: PINFCONTEXT,
1208        FieldIndex: DWORD,
1209        IntegerValue: PINT,
1210    ) -> BOOL;
1211    pub fn SetupGetMultiSzFieldA(
1212        Context: PINFCONTEXT,
1213        FieldIndex: DWORD,
1214        ReturnBuffer: PSTR,
1215        ReturnBufferSize: DWORD,
1216        RequiredSize: LPDWORD,
1217    ) -> BOOL;
1218    pub fn SetupGetMultiSzFieldW(
1219        Context: PINFCONTEXT,
1220        FieldIndex: DWORD,
1221        ReturnBuffer: PWSTR,
1222        ReturnBufferSize: DWORD,
1223        RequiredSize: LPDWORD,
1224    ) -> BOOL;
1225    pub fn SetupGetBinaryField(
1226        Context: PINFCONTEXT,
1227        FieldIndex: DWORD,
1228        ReturnBuffer: PBYTE,
1229        ReturnBufferSize: DWORD,
1230        RequiredSize: LPDWORD,
1231    ) -> BOOL;
1232    pub fn SetupGetFileCompressionInfoA(
1233        SourceFileName: PCSTR,
1234        ActualSourceFileName: *mut PSTR,
1235        SourceFileSize: PDWORD,
1236        TargetFileSize: PDWORD,
1237        CompressionType: PUINT,
1238    ) -> DWORD;
1239    pub fn SetupGetFileCompressionInfoW(
1240        SourceFileName: PCWSTR,
1241        ActualSourceFileName: *mut PWSTR,
1242        SourceFileSize: PDWORD,
1243        TargetFileSize: PDWORD,
1244        CompressionType: PUINT,
1245    ) -> DWORD;
1246    pub fn SetupGetFileCompressionInfoExA(
1247        SourceFileName: PCSTR,
1248        ActualSourceFileNameBuffer: PSTR,
1249        ActualSourceFileNameBufferLen: DWORD,
1250        RequiredBufferLen: PDWORD,
1251        SourceFileSize: PDWORD,
1252        TargetFileSize: PDWORD,
1253        CompressionType: PUINT,
1254    ) -> BOOL;
1255    pub fn SetupGetFileCompressionInfoExW(
1256        SourceFileName: PCWSTR,
1257        ActualSourceFileNameBuffer: PWSTR,
1258        ActualSourceFileNameBufferLen: DWORD,
1259        RequiredBufferLen: PDWORD,
1260        SourceFileSize: PDWORD,
1261        TargetFileSize: PDWORD,
1262        CompressionType: PUINT,
1263    ) -> BOOL;
1264}
1265pub const FILE_COMPRESSION_NONE: UINT = 0;
1266pub const FILE_COMPRESSION_WINLZA: UINT = 1;
1267pub const FILE_COMPRESSION_MSZIP: UINT = 2;
1268pub const FILE_COMPRESSION_NTCAB: UINT = 3;
1269extern "system" {
1270    pub fn SetupDecompressOrCopyFileA(
1271        SourceFileName: PCSTR,
1272        TargetFileName: PCSTR,
1273        CompressionType: PUINT,
1274    ) -> DWORD;
1275    pub fn SetupDecompressOrCopyFileW(
1276        SourceFileName: PCWSTR,
1277        TargetFileName: PCWSTR,
1278        CompressionType: PUINT,
1279    ) -> DWORD;
1280    pub fn SetupGetSourceFileLocationA(
1281        InfHandle: HINF,
1282        InfContext: PINFCONTEXT,
1283        FileName: PCSTR,
1284        SourceId: PUINT,
1285        ReturnBuffer: PSTR,
1286        ReturnBufferSize: DWORD,
1287        RequiredSize: PDWORD,
1288    ) -> BOOL;
1289    pub fn SetupGetSourceFileLocationW(
1290        InfHandle: HINF,
1291        InfContext: PINFCONTEXT,
1292        FileName: PCWSTR,
1293        SourceId: PUINT,
1294        ReturnBuffer: PWSTR,
1295        ReturnBufferSize: DWORD,
1296        RequiredSize: PDWORD,
1297    ) -> BOOL;
1298    pub fn SetupGetSourceFileSizeA(
1299        InfHandle: HINF,
1300        InfContext: PINFCONTEXT,
1301        FileName: PCSTR,
1302        Section: PCSTR,
1303        FileSize: PDWORD,
1304        RoundingFactor: UINT,
1305    ) -> BOOL;
1306    pub fn SetupGetSourceFileSizeW(
1307        InfHandle: HINF,
1308        InfContext: PINFCONTEXT,
1309        FileName: PCWSTR,
1310        Section: PCWSTR,
1311        FileSize: PDWORD,
1312        RoundingFactor: UINT,
1313    ) -> BOOL;
1314    pub fn SetupGetTargetPathA(
1315        InfHandle: HINF,
1316        InfContext: PINFCONTEXT,
1317        Section: PCSTR,
1318        ReturnBuffer: PSTR,
1319        ReturnBufferSize: DWORD,
1320        RequiredSize: PDWORD,
1321    ) -> BOOL;
1322    pub fn SetupGetTargetPathW(
1323        InfHandle: HINF,
1324        InfContext: PINFCONTEXT,
1325        Section: PCWSTR,
1326        ReturnBuffer: PWSTR,
1327        ReturnBufferSize: DWORD,
1328        RequiredSize: PDWORD,
1329    ) -> BOOL;
1330}
1331pub const SRCLIST_TEMPORARY: DWORD = 0x00000001;
1332pub const SRCLIST_NOBROWSE: DWORD = 0x00000002;
1333pub const SRCLIST_SYSTEM: DWORD = 0x00000010;
1334pub const SRCLIST_USER: DWORD = 0x00000020;
1335pub const SRCLIST_SYSIFADMIN: DWORD = 0x00000040;
1336pub const SRCLIST_SUBDIRS: DWORD = 0x00000100;
1337pub const SRCLIST_APPEND: DWORD = 0x00000200;
1338pub const SRCLIST_NOSTRIPPLATFORM: DWORD = 0x00000400;
1339extern "system" {
1340    pub fn SetupSetSourceListA(
1341        Flags: DWORD,
1342        SourceList: *mut PCSTR,
1343        SourceCount: UINT,
1344    ) -> BOOL;
1345    pub fn SetupSetSourceListW(
1346        Flags: DWORD,
1347        SourceList: *mut PCWSTR,
1348        SourceCount: UINT,
1349    ) -> BOOL;
1350    pub fn SetupCancelTemporarySourceList() -> BOOL;
1351    pub fn SetupAddToSourceListA(
1352        Flags: DWORD,
1353        Source: PCSTR,
1354    ) -> BOOL;
1355    pub fn SetupAddToSourceListW(
1356        Flags: DWORD,
1357        Source: PCWSTR,
1358    ) -> BOOL;
1359    pub fn SetupRemoveFromSourceListA(
1360        Flags: DWORD,
1361        Source: PCSTR,
1362    ) -> BOOL;
1363    pub fn SetupRemoveFromSourceListW(
1364        Flags: DWORD,
1365        Source: PCWSTR,
1366    ) -> BOOL;
1367    pub fn SetupQuerySourceListA(
1368        Flags: DWORD,
1369        List: *mut *mut PCSTR,
1370        Count: PUINT,
1371    ) -> BOOL;
1372    pub fn SetupQuerySourceListW(
1373        Flags: DWORD,
1374        List: *mut *mut PCWSTR,
1375        Count: PUINT,
1376    ) -> BOOL;
1377    pub fn SetupFreeSourceListA(
1378        List: *mut *mut PCSTR,
1379        Count: UINT,
1380    ) -> BOOL;
1381    pub fn SetupFreeSourceListW(
1382        List: *mut *mut PCWSTR,
1383        Count: UINT,
1384    ) -> BOOL;
1385    pub fn SetupPromptForDiskA(
1386        hwndParent: HWND,
1387        DialogTitle: PCSTR,
1388        DiskName: PCSTR,
1389        PathToSource: PCSTR,
1390        FileSought: PCSTR,
1391        TagFile: PCSTR,
1392        DiskPromptStyle: DWORD,
1393        PathBuffer: PSTR,
1394        PathBufferSize: DWORD,
1395        PathRequiredSize: PDWORD,
1396    ) -> UINT;
1397    pub fn SetupPromptForDiskW(
1398        hwndParent: HWND,
1399        DialogTitle: PCWSTR,
1400        DiskName: PCWSTR,
1401        PathToSource: PCWSTR,
1402        FileSought: PCWSTR,
1403        TagFile: PCWSTR,
1404        DiskPromptStyle: DWORD,
1405        PathBuffer: PWSTR,
1406        PathBufferSize: DWORD,
1407        PathRequiredSize: PDWORD,
1408    ) -> UINT;
1409    pub fn SetupCopyErrorA(
1410        hwndParent: HWND,
1411        DialogTitle: PCSTR,
1412        DiskName: PCSTR,
1413        PathToSource: PCSTR,
1414        SourceFile: PCSTR,
1415        TargetPathFile: PCSTR,
1416        Win32ErrorCode: UINT,
1417        Style: DWORD,
1418        PathBuffer: PSTR,
1419        PathBufferSize: DWORD,
1420        PathRequiredSize: PDWORD,
1421    ) -> UINT;
1422    pub fn SetupCopyErrorW(
1423        hwndParent: HWND,
1424        DialogTitle: PCWSTR,
1425        DiskName: PCWSTR,
1426        PathToSource: PCWSTR,
1427        SourceFile: PCWSTR,
1428        TargetPathFile: PCWSTR,
1429        Win32ErrorCode: UINT,
1430        Style: DWORD,
1431        PathBuffer: PWSTR,
1432        PathBufferSize: DWORD,
1433        PathRequiredSize: PDWORD,
1434    ) -> UINT;
1435    pub fn SetupRenameErrorA(
1436        hwndParent: HWND,
1437        DialogTitle: PCSTR,
1438        SourceFile: PCSTR,
1439        TargetFile: PCSTR,
1440        Win32ErrorCode: UINT,
1441        Style: DWORD,
1442    ) -> UINT;
1443    pub fn SetupRenameErrorW(
1444        hwndParent: HWND,
1445        DialogTitle: PCWSTR,
1446        SourceFile: PCWSTR,
1447        TargetFile: PCWSTR,
1448        Win32ErrorCode: UINT,
1449        Style: DWORD,
1450    ) -> UINT;
1451    pub fn SetupDeleteErrorA(
1452        hwndParent: HWND,
1453        DialogTitle: PCSTR,
1454        File: PCSTR,
1455        Win32ErrorCode: UINT,
1456        Style: DWORD,
1457    ) -> UINT;
1458    pub fn SetupDeleteErrorW(
1459        hwndParent: HWND,
1460        DialogTitle: PCWSTR,
1461        File: PCWSTR,
1462        Win32ErrorCode: UINT,
1463        Style: DWORD,
1464    ) -> UINT;
1465    pub fn SetupBackupErrorA(
1466        hwndParent: HWND,
1467        DialogTitle: PCSTR,
1468        SourceFile: PCSTR,
1469        TargetFile: PCSTR,
1470        Win32ErrorCode: UINT,
1471        Style: DWORD,
1472    ) -> UINT;
1473    pub fn SetupBackupErrorW(
1474        hwndParent: HWND,
1475        DialogTitle: PCWSTR,
1476        SourceFile: PCWSTR,
1477        TargetFile: PCWSTR,
1478        Win32ErrorCode: UINT,
1479        Style: DWORD,
1480    ) -> UINT;
1481}
1482pub const IDF_NOBROWSE: DWORD = 0x00000001;
1483pub const IDF_NOSKIP: DWORD = 0x00000002;
1484pub const IDF_NODETAILS: DWORD = 0x00000004;
1485pub const IDF_NOCOMPRESSED: DWORD = 0x00000008;
1486pub const IDF_CHECKFIRST: DWORD = 0x00000100;
1487pub const IDF_NOBEEP: DWORD = 0x00000200;
1488pub const IDF_NOFOREGROUND: DWORD = 0x00000400;
1489pub const IDF_WARNIFSKIP: DWORD = 0x00000800;
1490pub const IDF_NOREMOVABLEMEDIAPROMPT: DWORD = 0x00001000;
1491pub const IDF_USEDISKNAMEASPROMPT: DWORD = 0x00002000;
1492pub const IDF_OEMDISK: DWORD = 0x80000000;
1493pub const DPROMPT_SUCCESS: UINT = 0;
1494pub const DPROMPT_CANCEL: UINT = 1;
1495pub const DPROMPT_SKIPFILE: UINT = 2;
1496pub const DPROMPT_BUFFERTOOSMALL: UINT = 3;
1497pub const DPROMPT_OUTOFMEMORY: UINT = 4;
1498extern "system" {
1499    pub fn SetupSetDirectoryIdA(
1500        InfHandle: HINF,
1501        Id: DWORD,
1502        Directory: PCSTR,
1503    ) -> BOOL;
1504    pub fn SetupSetDirectoryIdW(
1505        InfHandle: HINF,
1506        Id: DWORD,
1507        Directory: PCWSTR,
1508    ) -> BOOL;
1509    pub fn SetupSetDirectoryIdExA(
1510        InfHandle: HINF,
1511        Id: DWORD,
1512        Directory: PCSTR,
1513        Flags: DWORD,
1514        Reserved1: DWORD,
1515        Reserved2: PVOID,
1516    ) -> BOOL;
1517    pub fn SetupSetDirectoryIdExW(
1518        InfHandle: HINF,
1519        Id: DWORD,
1520        Directory: PCWSTR,
1521        Flags: DWORD,
1522        Reserved1: DWORD,
1523        Reserved2: PVOID,
1524    ) -> BOOL;
1525}
1526pub const SETDIRID_NOT_FULL_PATH: DWORD = 0x00000001;
1527extern "system" {
1528    pub fn SetupGetSourceInfoA(
1529        InfHandle: HINF,
1530        SourceId: UINT,
1531        InfoDesired: UINT,
1532        ReturnBuffer: PSTR,
1533        ReturnBufferSize: DWORD,
1534        RequiredSize: PDWORD,
1535    ) -> BOOL;
1536    pub fn SetupGetSourceInfoW(
1537        InfHandle: HINF,
1538        SourceId: UINT,
1539        InfoDesired: UINT,
1540        ReturnBuffer: PWSTR,
1541        ReturnBufferSize: DWORD,
1542        RequiredSize: PDWORD,
1543    ) -> BOOL;
1544}
1545pub const SRCINFO_PATH: UINT = 1;
1546pub const SRCINFO_TAGFILE: UINT = 2;
1547pub const SRCINFO_DESCRIPTION: UINT = 3;
1548pub const SRCINFO_FLAGS: UINT = 4;
1549pub const SRCINFO_TAGFILE2: UINT = 4;
1550pub const SRC_FLAGS_CABFILE: UINT = 0x0010;
1551extern "system" {
1552    pub fn SetupInstallFileA(
1553        InfHandle: HINF,
1554        InfContext: PINFCONTEXT,
1555        SourceFile: PCSTR,
1556        SourcePathRoot: PCSTR,
1557        DestinationName: PCSTR,
1558        CopyStyle: DWORD,
1559        CopyMsgHandler: PSP_FILE_CALLBACK_A,
1560        Context: PVOID,
1561    ) -> BOOL;
1562    pub fn SetupInstallFileW(
1563        InfHandle: HINF,
1564        InfContext: PINFCONTEXT,
1565        SourceFile: PCWSTR,
1566        SourcePathRoot: PCWSTR,
1567        DestinationName: PCWSTR,
1568        CopyStyle: DWORD,
1569        CopyMsgHandler: PSP_FILE_CALLBACK_W,
1570        Context: PVOID,
1571    ) -> BOOL;
1572    pub fn SetupInstallFileExA(
1573        InfHandle: HINF,
1574        InfContext: PINFCONTEXT,
1575        SourceFile: PCSTR,
1576        SourcePathRoot: PCSTR,
1577        DestinationName: PCSTR,
1578        CopyStyle: DWORD,
1579        CopyMsgHandler: PSP_FILE_CALLBACK_A,
1580        Context: PVOID,
1581        FileWasInUse: PBOOL,
1582    ) -> BOOL;
1583    pub fn SetupInstallFileExW(
1584        InfHandle: HINF,
1585        InfContext: PINFCONTEXT,
1586        SourceFile: PCWSTR,
1587        SourcePathRoot: PCWSTR,
1588        DestinationName: PCWSTR,
1589        CopyStyle: DWORD,
1590        CopyMsgHandler: PSP_FILE_CALLBACK_W,
1591        Context: PVOID,
1592        FileWasInUse: PBOOL,
1593    ) -> BOOL;
1594}
1595pub const SP_COPY_DELETESOURCE: DWORD = 0x0000001;
1596pub const SP_COPY_REPLACEONLY: DWORD = 0x0000002;
1597pub const SP_COPY_NEWER: DWORD = 0x0000004;
1598pub const SP_COPY_NEWER_OR_SAME: DWORD = SP_COPY_NEWER;
1599pub const SP_COPY_NOOVERWRITE: DWORD = 0x0000008;
1600pub const SP_COPY_NODECOMP: DWORD = 0x0000010;
1601pub const SP_COPY_LANGUAGEAWARE: DWORD = 0x0000020;
1602pub const SP_COPY_SOURCE_ABSOLUTE: DWORD = 0x0000040;
1603pub const SP_COPY_SOURCEPATH_ABSOLUTE: DWORD = 0x0000080;
1604pub const SP_COPY_IN_USE_NEEDS_REBOOT: DWORD = 0x0000100;
1605pub const SP_COPY_FORCE_IN_USE: DWORD = 0x0000200;
1606pub const SP_COPY_NOSKIP: DWORD = 0x0000400;
1607pub const SP_FLAG_CABINETCONTINUATION: DWORD = 0x0000800;
1608pub const SP_COPY_FORCE_NOOVERWRITE: DWORD = 0x0001000;
1609pub const SP_COPY_FORCE_NEWER: DWORD = 0x0002000;
1610pub const SP_COPY_WARNIFSKIP: DWORD = 0x0004000;
1611pub const SP_COPY_NOBROWSE: DWORD = 0x0008000;
1612pub const SP_COPY_NEWER_ONLY: DWORD = 0x0010000;
1613pub const SP_COPY_RESERVED: DWORD = 0x0020000;
1614pub const SP_COPY_OEMINF_CATALOG_ONLY: DWORD = 0x0040000;
1615pub const SP_COPY_REPLACE_BOOT_FILE: DWORD = 0x0080000;
1616pub const SP_COPY_NOPRUNE: DWORD = 0x0100000;
1617pub const SP_COPY_OEM_F6_INF: DWORD = 0x0200000;
1618pub const SP_COPY_ALREADYDECOMP: DWORD = 0x0400000;
1619pub const SP_COPY_WINDOWS_SIGNED: DWORD = 0x1000000;
1620pub const SP_COPY_PNPLOCKED: DWORD = 0x2000000;
1621pub const SP_COPY_IN_USE_TRY_RENAME: DWORD = 0x4000000;
1622pub const SP_COPY_INBOX_INF: DWORD = 0x8000000;
1623pub const SP_COPY_HARDLINK: DWORD = 0x10000000;
1624pub const SP_BACKUP_BACKUPPASS: DWORD = 0x00000001;
1625pub const SP_BACKUP_DEMANDPASS: DWORD = 0x00000002;
1626pub const SP_BACKUP_SPECIAL: DWORD = 0x00000004;
1627pub const SP_BACKUP_BOOTFILE: DWORD = 0x00000008;
1628extern "system" {
1629    pub fn SetupOpenFileQueue() -> HSPFILEQ;
1630    pub fn SetupCloseFileQueue(
1631        QueueHandle: HSPFILEQ,
1632    ) -> BOOL;
1633    pub fn SetupSetFileQueueAlternatePlatformA(
1634        QueueHandle: HSPFILEQ,
1635        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
1636        AlternateDefaultCatalogFile: PCSTR,
1637    ) -> BOOL;
1638    pub fn SetupSetFileQueueAlternatePlatformW(
1639        QueueHandle: HSPFILEQ,
1640        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
1641        AlternateDefaultCatalogFile: PCWSTR,
1642    ) -> BOOL;
1643    pub fn SetupSetPlatformPathOverrideA(
1644        Override: PCSTR,
1645    ) -> BOOL;
1646    pub fn SetupSetPlatformPathOverrideW(
1647        Override: PCWSTR,
1648    ) -> BOOL;
1649    pub fn SetupQueueCopyA(
1650        QueueHandle: HSPFILEQ,
1651        SourceRootPath: PCSTR,
1652        SourcePath: PCSTR,
1653        SourceFilename: PCSTR,
1654        SourceDescription: PCSTR,
1655        SourceTagfile: PCSTR,
1656        TargetDirectory: PCSTR,
1657        TargetFilename: PCSTR,
1658        CopyStyle: DWORD,
1659    ) -> BOOL;
1660    pub fn SetupQueueCopyW(
1661        QueueHandle: HSPFILEQ,
1662        SourceRootPath: PCWSTR,
1663        SourcePath: PCWSTR,
1664        SourceFilename: PCWSTR,
1665        SourceDescription: PCWSTR,
1666        SourceTagfile: PCWSTR,
1667        TargetDirectory: PCWSTR,
1668        TargetFilename: PCWSTR,
1669        CopyStyle: DWORD,
1670    ) -> BOOL;
1671    pub fn SetupQueueCopyIndirectA(
1672        CopyParams: PSP_FILE_COPY_PARAMS_A,
1673    ) -> BOOL;
1674    pub fn SetupQueueCopyIndirectW(
1675        CopyParams: PSP_FILE_COPY_PARAMS_W,
1676    ) -> BOOL;
1677    pub fn SetupQueueDefaultCopyA(
1678        QueueHandle: HSPFILEQ,
1679        InfHandle: HINF,
1680        SourceRootPath: PCSTR,
1681        SourceFilename: PCSTR,
1682        TargetFilename: PCSTR,
1683        CopyStyle: DWORD,
1684    ) -> BOOL;
1685    pub fn SetupQueueDefaultCopyW(
1686        QueueHandle: HSPFILEQ,
1687        InfHandle: HINF,
1688        SourceRootPath: PCWSTR,
1689        SourceFilename: PCWSTR,
1690        TargetFilename: PCWSTR,
1691        CopyStyle: DWORD,
1692    ) -> BOOL;
1693    pub fn SetupQueueCopySectionA(
1694        QueueHandle: HSPFILEQ,
1695        SourceRootPath: PCSTR,
1696        InfHandle: HINF,
1697        ListInfHandle: HINF,
1698        Section: PCSTR,
1699        CopyStyle: DWORD,
1700    ) -> BOOL;
1701    pub fn SetupQueueCopySectionW(
1702        QueueHandle: HSPFILEQ,
1703        SourceRootPath: PCWSTR,
1704        InfHandle: HINF,
1705        ListInfHandle: HINF,
1706        Section: PCWSTR,
1707        CopyStyle: DWORD,
1708    ) -> BOOL;
1709    pub fn SetupQueueDeleteA(
1710        QueueHandle: HSPFILEQ,
1711        PathPart1: PCSTR,
1712        PathPart2: PCSTR,
1713    ) -> BOOL;
1714    pub fn SetupQueueDeleteW(
1715        QueueHandle: HSPFILEQ,
1716        PathPart1: PCWSTR,
1717        PathPart2: PCWSTR,
1718    ) -> BOOL;
1719    pub fn SetupQueueDeleteSectionA(
1720        QueueHandle: HSPFILEQ,
1721        InfHandle: HINF,
1722        ListInfHandle: HINF,
1723        Section: PCSTR,
1724    ) -> BOOL;
1725    pub fn SetupQueueDeleteSectionW(
1726        QueueHandle: HSPFILEQ,
1727        InfHandle: HINF,
1728        ListInfHandle: HINF,
1729        Section: PCWSTR,
1730    ) -> BOOL;
1731    pub fn SetupQueueRenameA(
1732        QueueHandle: HSPFILEQ,
1733        SourcePath: PCSTR,
1734        SourceFilename: PCSTR,
1735        TargetPath: PCSTR,
1736        TargetFilename: PCSTR,
1737    ) -> BOOL;
1738    pub fn SetupQueueRenameW(
1739        QueueHandle: HSPFILEQ,
1740        SourcePath: PCWSTR,
1741        SourceFilename: PCWSTR,
1742        TargetPath: PCWSTR,
1743        TargetFilename: PCWSTR,
1744    ) -> BOOL;
1745    pub fn SetupQueueRenameSectionA(
1746        QueueHandle: HSPFILEQ,
1747        InfHandle: HINF,
1748        ListInfHandle: HINF,
1749        Section: PCSTR,
1750    ) -> BOOL;
1751    pub fn SetupQueueRenameSectionW(
1752        QueueHandle: HSPFILEQ,
1753        InfHandle: HINF,
1754        ListInfHandle: HINF,
1755        Section: PCWSTR,
1756    ) -> BOOL;
1757    pub fn SetupCommitFileQueueA(
1758        Owner: HWND,
1759        QueueHandle: HSPFILEQ,
1760        MsgHandler: PSP_FILE_CALLBACK_A,
1761        Context: PVOID,
1762    ) -> BOOL;
1763    pub fn SetupCommitFileQueueW(
1764        Owner: HWND,
1765        QueueHandle: HSPFILEQ,
1766        MsgHandler: PSP_FILE_CALLBACK_W,
1767        Context: PVOID,
1768    ) -> BOOL;
1769    pub fn SetupScanFileQueueA(
1770        FileQueue: HSPFILEQ,
1771        Flags: DWORD,
1772        Window: HWND,
1773        CallbackRoutine: PSP_FILE_CALLBACK_A,
1774        CallbackContext: PVOID,
1775        Result: PDWORD,
1776    ) -> BOOL;
1777    pub fn SetupScanFileQueueW(
1778        FileQueue: HSPFILEQ,
1779        Flags: DWORD,
1780        Window: HWND,
1781        CallbackRoutine: PSP_FILE_CALLBACK_W,
1782        CallbackContext: PVOID,
1783        Result: PDWORD,
1784    ) -> BOOL;
1785}
1786pub const SPQ_SCAN_FILE_PRESENCE: DWORD = 0x00000001;
1787pub const SPQ_SCAN_FILE_VALIDITY: DWORD = 0x00000002;
1788pub const SPQ_SCAN_USE_CALLBACK: DWORD = 0x00000004;
1789pub const SPQ_SCAN_USE_CALLBACKEX: DWORD = 0x00000008;
1790pub const SPQ_SCAN_INFORM_USER: DWORD = 0x00000010;
1791pub const SPQ_SCAN_PRUNE_COPY_QUEUE: DWORD = 0x00000020;
1792pub const SPQ_SCAN_USE_CALLBACK_SIGNERINFO: DWORD = 0x00000040;
1793pub const SPQ_SCAN_PRUNE_DELREN: DWORD = 0x00000080;
1794pub const SPQ_SCAN_FILE_PRESENCE_WITHOUT_SOURCE: DWORD = 0x00000100;
1795pub const SPQ_SCAN_FILE_COMPARISON: DWORD = 0x00000200;
1796pub const SPQ_SCAN_ACTIVATE_DRP: DWORD = 0x00000400;
1797pub const SPQ_DELAYED_COPY: DWORD = 0x00000001;
1798extern "system" {
1799    pub fn SetupGetFileQueueCount(
1800        FileQueue: HSPFILEQ,
1801        SubQueueFileOp: UINT,
1802        NumOperations: PUINT,
1803    ) -> BOOL;
1804    pub fn SetupGetFileQueueFlags(
1805        FileQueue: HSPFILEQ,
1806        Flags: PDWORD,
1807    ) -> BOOL;
1808    pub fn SetupSetFileQueueFlags(
1809        FileQueue: HSPFILEQ,
1810        FlagMask: DWORD,
1811        Flags: DWORD,
1812    ) -> BOOL;
1813}
1814pub const SPQ_FLAG_BACKUP_AWARE: DWORD = 0x00000001;
1815pub const SPQ_FLAG_ABORT_IF_UNSIGNED: DWORD = 0x00000002;
1816pub const SPQ_FLAG_FILES_MODIFIED: DWORD = 0x00000004;
1817pub const SPQ_FLAG_DO_SHUFFLEMOVE: DWORD = 0x00000008;
1818pub const SPQ_FLAG_VALID: DWORD = 0x0000000F;
1819pub const SPOST_NONE: DWORD = 0;
1820pub const SPOST_PATH: DWORD = 1;
1821pub const SPOST_URL: DWORD = 2;
1822pub const SPOST_MAX: DWORD = 3;
1823extern "system" {
1824    pub fn SetupCopyOEMInfA(
1825        SourceInfFileName: PCSTR,
1826        OEMSourceMediaLocation: PCSTR,
1827        OEMSourceMediaType: DWORD,
1828        CopyStyle: DWORD,
1829        DestinationInfFileName: PSTR,
1830        DestinationInfFileNameSize: DWORD,
1831        RequiredSize: PDWORD,
1832        DestinationInfFileNameComponent: *mut PSTR,
1833    ) -> BOOL;
1834    pub fn SetupCopyOEMInfW(
1835        SourceInfFileName: PCWSTR,
1836        OEMSourceMediaLocation: PCWSTR,
1837        OEMSourceMediaType: DWORD,
1838        CopyStyle: DWORD,
1839        DestinationInfFileName: PWSTR,
1840        DestinationInfFileNameSize: DWORD,
1841        RequiredSize: PDWORD,
1842        DestinationInfFileNameComponent: *mut PWSTR,
1843    ) -> BOOL;
1844}
1845pub const SUOI_FORCEDELETE: DWORD = 0x00000001;
1846pub const SUOI_INTERNAL1: DWORD = 0x00000002;
1847extern "system" {
1848    pub fn SetupUninstallOEMInfA(
1849        InfFileName: PCSTR,
1850        Flags: DWORD,
1851        Reserved: PVOID,
1852    ) -> BOOL;
1853    pub fn SetupUninstallOEMInfW(
1854        InfFileName: PCWSTR,
1855        Flags: DWORD,
1856        Reserved: PVOID,
1857    ) -> BOOL;
1858    pub fn SetupUninstallNewlyCopiedInfs(
1859        FileQueue: HSPFILEQ,
1860        Flags: DWORD,
1861        Reserved: PVOID,
1862    ) -> BOOL;
1863    pub fn SetupCreateDiskSpaceListA(
1864        Reserved1: PVOID,
1865        Reserved2: DWORD,
1866        Flags: UINT,
1867    ) -> HDSKSPC;
1868    pub fn SetupCreateDiskSpaceListW(
1869        Reserved1: PVOID,
1870        Reserved2: DWORD,
1871        Flags: UINT,
1872    ) -> HDSKSPC;
1873}
1874pub const SPDSL_IGNORE_DISK: UINT = 0x00000001;
1875pub const SPDSL_DISALLOW_NEGATIVE_ADJUST: UINT = 0x00000002;
1876extern "system" {
1877    pub fn SetupDuplicateDiskSpaceListA(
1878        DiskSpace: HDSKSPC,
1879        Reserved1: PVOID,
1880        Reserved2: DWORD,
1881        Flags: UINT,
1882    ) -> HDSKSPC;
1883    pub fn SetupDuplicateDiskSpaceListW(
1884        DiskSpace: HDSKSPC,
1885        Reserved1: PVOID,
1886        Reserved2: DWORD,
1887        Flags: UINT,
1888    ) -> HDSKSPC;
1889    pub fn SetupDestroyDiskSpaceList(
1890        DiskSpace: HDSKSPC,
1891    ) -> BOOL;
1892    pub fn SetupQueryDrivesInDiskSpaceListA(
1893        DiskSpace: HDSKSPC,
1894        ReturnBuffer: PSTR,
1895        ReturnBufferSize: DWORD,
1896        RequiredSize: PDWORD,
1897    ) -> BOOL;
1898    pub fn SetupQueryDrivesInDiskSpaceListW(
1899        DiskSpace: HDSKSPC,
1900        ReturnBuffer: PWSTR,
1901        ReturnBufferSize: DWORD,
1902        RequiredSize: PDWORD,
1903    ) -> BOOL;
1904    pub fn SetupQuerySpaceRequiredOnDriveA(
1905        DiskSpace: HDSKSPC,
1906        DriveSpec: PCSTR,
1907        SpaceRequired: *mut LONGLONG,
1908        Reserved1: PVOID,
1909        Reserved2: UINT,
1910    ) -> BOOL;
1911    pub fn SetupQuerySpaceRequiredOnDriveW(
1912        DiskSpace: HDSKSPC,
1913        DriveSpec: PCWSTR,
1914        SpaceRequired: *mut LONGLONG,
1915        Reserved1: PVOID,
1916        Reserved2: UINT,
1917    ) -> BOOL;
1918    pub fn SetupAdjustDiskSpaceListA(
1919        DiskSpace: HDSKSPC,
1920        DriveRoot: LPCSTR,
1921        Amount: LONGLONG,
1922        Reserved1: PVOID,
1923        Reserved2: UINT,
1924    ) -> BOOL;
1925    pub fn SetupAdjustDiskSpaceListW(
1926        DiskSpace: HDSKSPC,
1927        DriveRoot: LPCWSTR,
1928        Amount: LONGLONG,
1929        Reserved1: PVOID,
1930        Reserved2: UINT,
1931    ) -> BOOL;
1932    pub fn SetupAddToDiskSpaceListA(
1933        DiskSpace: HDSKSPC,
1934        TargetFilespec: PCSTR,
1935        FileSize: LONGLONG,
1936        Operation: UINT,
1937        Reserved1: PVOID,
1938        Reserved2: UINT,
1939    ) -> BOOL;
1940    pub fn SetupAddToDiskSpaceListW(
1941        DiskSpace: HDSKSPC,
1942        TargetFilespec: PCWSTR,
1943        FileSize: LONGLONG,
1944        Operation: UINT,
1945        Reserved1: PVOID,
1946        Reserved2: UINT,
1947    ) -> BOOL;
1948    pub fn SetupAddSectionToDiskSpaceListA(
1949        DiskSpace: HDSKSPC,
1950        InfHandle: HINF,
1951        ListInfHandle: HINF,
1952        SectionName: PCSTR,
1953        Operation: UINT,
1954        Reserved1: PVOID,
1955        Reserved2: UINT,
1956    ) -> BOOL;
1957    pub fn SetupAddSectionToDiskSpaceListW(
1958        DiskSpace: HDSKSPC,
1959        InfHandle: HINF,
1960        ListInfHandle: HINF,
1961        SectionName: PCWSTR,
1962        Operation: UINT,
1963        Reserved1: PVOID,
1964        Reserved2: UINT,
1965    ) -> BOOL;
1966    pub fn SetupAddInstallSectionToDiskSpaceListA(
1967        DiskSpace: HDSKSPC,
1968        InfHandle: HINF,
1969        LayoutInfHandle: HINF,
1970        SectionName: PCSTR,
1971        Reserved1: PVOID,
1972        Reserved2: UINT,
1973    ) -> BOOL;
1974    pub fn SetupAddInstallSectionToDiskSpaceListW(
1975        DiskSpace: HDSKSPC,
1976        InfHandle: HINF,
1977        LayoutInfHandle: HINF,
1978        SectionName: PCWSTR,
1979        Reserved1: PVOID,
1980        Reserved2: UINT,
1981    ) -> BOOL;
1982    pub fn SetupRemoveFromDiskSpaceListA(
1983        DiskSpace: HDSKSPC,
1984        TargetFilespec: PCSTR,
1985        Operation: UINT,
1986        Reserved1: PVOID,
1987        Reserved2: UINT,
1988    ) -> BOOL;
1989    pub fn SetupRemoveFromDiskSpaceListW(
1990        DiskSpace: HDSKSPC,
1991        TargetFilespec: PCWSTR,
1992        Operation: UINT,
1993        Reserved1: PVOID,
1994        Reserved2: UINT,
1995    ) -> BOOL;
1996    pub fn SetupRemoveSectionFromDiskSpaceListA(
1997        DiskSpace: HDSKSPC,
1998        InfHandle: HINF,
1999        ListInfHandle: HINF,
2000        SectionName: PCSTR,
2001        Operation: UINT,
2002        Reserved1: PVOID,
2003        Reserved2: UINT,
2004    ) -> BOOL;
2005    pub fn SetupRemoveSectionFromDiskSpaceListW(
2006        DiskSpace: HDSKSPC,
2007        InfHandle: HINF,
2008        ListInfHandle: HINF,
2009        SectionName: PCWSTR,
2010        Operation: UINT,
2011        Reserved1: PVOID,
2012        Reserved2: UINT,
2013    ) -> BOOL;
2014    pub fn SetupRemoveInstallSectionFromDiskSpaceListA(
2015        DiskSpace: HDSKSPC,
2016        InfHandle: HINF,
2017        LayoutInfHandle: HINF,
2018        SectionName: PCSTR,
2019        Reserved1: PVOID,
2020        Reserved2: UINT,
2021    ) -> BOOL;
2022    pub fn SetupRemoveInstallSectionFromDiskSpaceListW(
2023        DiskSpace: HDSKSPC,
2024        InfHandle: HINF,
2025        LayoutInfHandle: HINF,
2026        SectionName: PCWSTR,
2027        Reserved1: PVOID,
2028        Reserved2: UINT,
2029    ) -> BOOL;
2030    pub fn SetupIterateCabinetA(
2031        CabinetFile: PCSTR,
2032        Reserved: DWORD,
2033        MsgHandler: PSP_FILE_CALLBACK_A,
2034        Context: PVOID,
2035    ) -> BOOL;
2036    pub fn SetupIterateCabinetW(
2037        CabinetFile: PCWSTR,
2038        Reserved: DWORD,
2039        MsgHandler: PSP_FILE_CALLBACK_W,
2040        Context: PVOID,
2041    ) -> BOOL;
2042    pub fn SetupPromptReboot(
2043        FileQueue: HSPFILEQ,
2044        Owner: HWND,
2045        ScanOnly: BOOL,
2046    ) -> INT;
2047}
2048pub const SPFILEQ_FILE_IN_USE: INT = 0x00000001;
2049pub const SPFILEQ_REBOOT_RECOMMENDED: INT = 0x00000002;
2050pub const SPFILEQ_REBOOT_IN_PROGRESS: INT = 0x00000004;
2051extern "system" {
2052    pub fn SetupInitDefaultQueueCallback(
2053        OwnerWindow: HWND,
2054    ) -> PVOID;
2055    pub fn SetupInitDefaultQueueCallbackEx(
2056        OwnerWindow: HWND,
2057        AlternateProgressWindow: HWND,
2058        ProgressMessage: UINT,
2059        Reserved1: DWORD,
2060        Reserved2: PVOID,
2061    ) -> PVOID;
2062    pub fn SetupTermDefaultQueueCallback(
2063        Context: PVOID,
2064    ) -> ();
2065    pub fn SetupDefaultQueueCallbackA(
2066        Context: PVOID,
2067        Notification: UINT,
2068        Param1: UINT_PTR,
2069        Param2: UINT_PTR,
2070    ) -> UINT;
2071    pub fn SetupDefaultQueueCallbackW(
2072        Context: PVOID,
2073        Notification: UINT,
2074        Param1: UINT_PTR,
2075        Param2: UINT_PTR,
2076    ) -> UINT;
2077}
2078pub const FLG_ADDREG_DELREG_BIT: DWORD = 0x00008000;
2079pub const FLG_ADDREG_BINVALUETYPE: DWORD = 0x00000001;
2080pub const FLG_ADDREG_NOCLOBBER: DWORD = 0x00000002;
2081pub const FLG_ADDREG_DELVAL: DWORD = 0x00000004;
2082pub const FLG_ADDREG_APPEND: DWORD = 0x00000008;
2083pub const FLG_ADDREG_KEYONLY: DWORD = 0x00000010;
2084pub const FLG_ADDREG_OVERWRITEONLY: DWORD = 0x00000020;
2085pub const FLG_ADDREG_64BITKEY: DWORD = 0x00001000;
2086pub const FLG_ADDREG_KEYONLY_COMMON: DWORD = 0x00002000;
2087pub const FLG_ADDREG_32BITKEY: DWORD = 0x00004000;
2088pub const FLG_ADDREG_TYPE_MASK: DWORD = 0xFFFF0000 | FLG_ADDREG_BINVALUETYPE;
2089pub const FLG_ADDREG_TYPE_SZ: DWORD = 0x00000000;
2090pub const FLG_ADDREG_TYPE_MULTI_SZ: DWORD = 0x00010000;
2091pub const FLG_ADDREG_TYPE_EXPAND_SZ: DWORD = 0x00020000;
2092pub const FLG_ADDREG_TYPE_BINARY: DWORD = 0x00000000 | FLG_ADDREG_BINVALUETYPE;
2093pub const FLG_ADDREG_TYPE_DWORD: DWORD = 0x00010000 | FLG_ADDREG_BINVALUETYPE;
2094pub const FLG_ADDREG_TYPE_NONE: DWORD = 0x00020000 | FLG_ADDREG_BINVALUETYPE;
2095pub const FLG_DELREG_VALUE: DWORD = 0x00000000;
2096pub const FLG_DELREG_TYPE_MASK: DWORD = FLG_ADDREG_TYPE_MASK;
2097pub const FLG_DELREG_TYPE_SZ: DWORD = FLG_ADDREG_TYPE_SZ;
2098pub const FLG_DELREG_TYPE_MULTI_SZ: DWORD = FLG_ADDREG_TYPE_MULTI_SZ;
2099pub const FLG_DELREG_TYPE_EXPAND_SZ: DWORD = FLG_ADDREG_TYPE_EXPAND_SZ;
2100pub const FLG_DELREG_TYPE_BINARY: DWORD = FLG_ADDREG_TYPE_BINARY;
2101pub const FLG_DELREG_TYPE_DWORD: DWORD = FLG_ADDREG_TYPE_DWORD;
2102pub const FLG_DELREG_TYPE_NONE: DWORD = FLG_ADDREG_TYPE_NONE;
2103pub const FLG_DELREG_64BITKEY: DWORD = FLG_ADDREG_64BITKEY;
2104pub const FLG_DELREG_KEYONLY_COMMON: DWORD = FLG_ADDREG_KEYONLY_COMMON;
2105pub const FLG_DELREG_32BITKEY: DWORD = FLG_ADDREG_32BITKEY;
2106pub const FLG_DELREG_OPERATION_MASK: DWORD = 0x000000FE;
2107pub const FLG_DELREG_MULTI_SZ_DELSTRING: DWORD = FLG_DELREG_TYPE_MULTI_SZ | FLG_ADDREG_DELREG_BIT
2108    | 0x00000002;
2109pub const FLG_BITREG_CLEARBITS: DWORD = 0x00000000;
2110pub const FLG_BITREG_SETBITS: DWORD = 0x00000001;
2111pub const FLG_BITREG_64BITKEY: DWORD = 0x00001000;
2112pub const FLG_BITREG_32BITKEY: DWORD = 0x00004000;
2113pub const FLG_INI2REG_64BITKEY: DWORD = 0x00001000;
2114pub const FLG_INI2REG_32BITKEY: DWORD = 0x00004000;
2115pub const FLG_REGSVR_DLLREGISTER: DWORD = 0x00000001;
2116pub const FLG_REGSVR_DLLINSTALL: DWORD = 0x00000002;
2117pub const FLG_PROFITEM_CURRENTUSER: DWORD = 0x00000001;
2118pub const FLG_PROFITEM_DELETE: DWORD = 0x00000002;
2119pub const FLG_PROFITEM_GROUP: DWORD = 0x00000004;
2120pub const FLG_PROFITEM_CSIDL: DWORD = 0x00000008;
2121pub const FLG_ADDPROPERTY_NOCLOBBER: DWORD = 0x00000001;
2122pub const FLG_ADDPROPERTY_OVERWRITEONLY: DWORD = 0x00000002;
2123pub const FLG_ADDPROPERTY_APPEND: DWORD = 0x00000004;
2124pub const FLG_ADDPROPERTY_OR: DWORD = 0x00000008;
2125pub const FLG_ADDPROPERTY_AND: DWORD = 0x00000010;
2126pub const FLG_DELPROPERTY_MULTI_SZ_DELSTRING: DWORD = 0x00000001;
2127extern "system" {
2128    pub fn SetupInstallFromInfSectionA(
2129        Owner: HWND,
2130        InfHandle: HINF,
2131        SectionName: PCSTR,
2132        Flags: UINT,
2133        RelativeKeyRoot: HKEY,
2134        SourceRootPath: PCSTR,
2135        CopyFlags: UINT,
2136        MsgHandler: PSP_FILE_CALLBACK_A,
2137        Context: PVOID,
2138        DeviceInfoSet: HDEVINFO,
2139        DeviceInfoData: PSP_DEVINFO_DATA,
2140    ) -> BOOL;
2141    pub fn SetupInstallFromInfSectionW(
2142        Owner: HWND,
2143        InfHandle: HINF,
2144        SectionName: PCWSTR,
2145        Flags: UINT,
2146        RelativeKeyRoot: HKEY,
2147        SourceRootPath: PCWSTR,
2148        CopyFlags: UINT,
2149        MsgHandler: PSP_FILE_CALLBACK_W,
2150        Context: PVOID,
2151        DeviceInfoSet: HDEVINFO,
2152        DeviceInfoData: PSP_DEVINFO_DATA,
2153    ) -> BOOL;
2154}
2155pub const SPINST_LOGCONFIG: UINT = 0x00000001;
2156pub const SPINST_INIFILES: UINT = 0x00000002;
2157pub const SPINST_REGISTRY: UINT = 0x00000004;
2158pub const SPINST_INI2REG: UINT = 0x00000008;
2159pub const SPINST_FILES: UINT = 0x00000010;
2160pub const SPINST_BITREG: UINT = 0x00000020;
2161pub const SPINST_REGSVR: UINT = 0x00000040;
2162pub const SPINST_UNREGSVR: UINT = 0x00000080;
2163pub const SPINST_PROFILEITEMS: UINT = 0x00000100;
2164pub const SPINST_COPYINF: UINT = 0x00000200;
2165pub const SPINST_PROPERTIES: UINT = 0x00000400;
2166pub const SPINST_ALL: UINT = 0x000007ff;
2167pub const SPINST_SINGLESECTION: UINT = 0x00010000;
2168pub const SPINST_LOGCONFIG_IS_FORCED: UINT = 0x00020000;
2169pub const SPINST_LOGCONFIGS_ARE_OVERRIDES: UINT = 0x00040000;
2170pub const SPINST_REGISTERCALLBACKAWARE: UINT = 0x00080000;
2171pub const SPINST_DEVICEINSTALL: UINT = 0x00100000;
2172extern "system" {
2173    pub fn SetupInstallFilesFromInfSectionA(
2174        InfHandle: HINF,
2175        LayoutInfHandle: HINF,
2176        FileQueue: HSPFILEQ,
2177        SectionName: PCSTR,
2178        SourceRootPath: PCSTR,
2179        CopyFlags: UINT,
2180    ) -> BOOL;
2181    pub fn SetupInstallFilesFromInfSectionW(
2182        InfHandle: HINF,
2183        LayoutInfHandle: HINF,
2184        FileQueue: HSPFILEQ,
2185        SectionName: PCWSTR,
2186        SourceRootPath: PCWSTR,
2187        CopyFlags: UINT,
2188    ) -> BOOL;
2189}
2190pub const SPSVCINST_TAGTOFRONT: DWORD = 0x00000001;
2191pub const SPSVCINST_ASSOCSERVICE: DWORD = 0x00000002;
2192pub const SPSVCINST_DELETEEVENTLOGENTRY: DWORD = 0x00000004;
2193pub const SPSVCINST_NOCLOBBER_DISPLAYNAME: DWORD = 0x00000008;
2194pub const SPSVCINST_NOCLOBBER_STARTTYPE: DWORD = 0x00000010;
2195pub const SPSVCINST_NOCLOBBER_ERRORCONTROL: DWORD = 0x00000020;
2196pub const SPSVCINST_NOCLOBBER_LOADORDERGROUP: DWORD = 0x00000040;
2197pub const SPSVCINST_NOCLOBBER_DEPENDENCIES: DWORD = 0x00000080;
2198pub const SPSVCINST_NOCLOBBER_DESCRIPTION: DWORD = 0x00000100;
2199pub const SPSVCINST_STOPSERVICE: DWORD = 0x00000200;
2200pub const SPSVCINST_CLOBBER_SECURITY: DWORD = 0x00000400;
2201pub const SPSVCINST_STARTSERVICE: DWORD = 0x00000800;
2202pub const SPSVCINST_NOCLOBBER_REQUIREDPRIVILEGES: DWORD = 0x00001000;
2203extern "system" {
2204    pub fn SetupInstallServicesFromInfSectionA(
2205        InfHandle: HINF,
2206        SectionName: PCSTR,
2207        Flags: DWORD,
2208    ) -> BOOL;
2209    pub fn SetupInstallServicesFromInfSectionW(
2210        InfHandle: HINF,
2211        SectionName: PCWSTR,
2212        Flags: DWORD,
2213    ) -> BOOL;
2214    pub fn SetupInstallServicesFromInfSectionExA(
2215        InfHandle: HINF,
2216        SectionName: PCSTR,
2217        Flags: DWORD,
2218        DeviceInfoSet: HDEVINFO,
2219        DeviceInfoData: PSP_DEVINFO_DATA,
2220        Reserved1: PVOID,
2221        Reserved2: PVOID,
2222    ) -> BOOL;
2223    pub fn SetupInstallServicesFromInfSectionExW(
2224        InfHandle: HINF,
2225        SectionName: PCWSTR,
2226        Flags: DWORD,
2227        DeviceInfoSet: HDEVINFO,
2228        DeviceInfoData: PSP_DEVINFO_DATA,
2229        Reserved1: PVOID,
2230        Reserved2: PVOID,
2231    ) -> BOOL;
2232    pub fn InstallHinfSectionA(
2233        Window: HWND,
2234        ModuleHandle: HINSTANCE,
2235        CommandLine: PCSTR,
2236        ShowCommand: INT,
2237    ) -> ();
2238    pub fn InstallHinfSectionW(
2239        Window: HWND,
2240        ModuleHandle: HINSTANCE,
2241        CommandLine: PCWSTR,
2242        ShowCommand: INT,
2243    ) -> ();
2244}
2245pub type HSPFILELOG = PVOID;
2246extern "system" {
2247    pub fn SetupInitializeFileLogA(
2248        LogFileName: PCSTR,
2249        Flags: DWORD,
2250    ) -> HSPFILELOG;
2251    pub fn SetupInitializeFileLogW(
2252        LogFileName: PCWSTR,
2253        Flags: DWORD,
2254    ) -> HSPFILELOG;
2255}
2256pub const SPFILELOG_SYSTEMLOG: DWORD = 0x00000001;
2257pub const SPFILELOG_FORCENEW: DWORD = 0x00000002;
2258pub const SPFILELOG_QUERYONLY: DWORD = 0x00000004;
2259extern "system" {
2260    pub fn SetupTerminateFileLog(
2261        FileLogHandle: HSPFILELOG,
2262    ) -> BOOL;
2263    pub fn SetupLogFileA(
2264        FileLogHandle: HSPFILELOG,
2265        LogSectionName: PCSTR,
2266        SourceFilename: PCSTR,
2267        TargetFilename: PCSTR,
2268        Checksum: DWORD,
2269        DiskTagfile: PCSTR,
2270        DiskDescription: PCSTR,
2271        OtherInfo: PCSTR,
2272        Flags: DWORD,
2273    ) -> BOOL;
2274    pub fn SetupLogFileW(
2275        FileLogHandle: HSPFILELOG,
2276        LogSectionName: PCWSTR,
2277        SourceFilename: PCWSTR,
2278        TargetFilename: PCWSTR,
2279        Checksum: DWORD,
2280        DiskTagfile: PCWSTR,
2281        DiskDescription: PCWSTR,
2282        OtherInfo: PCWSTR,
2283        Flags: DWORD,
2284    ) -> BOOL;
2285}
2286pub const SPFILELOG_OEMFILE: DWORD = 0x00000001;
2287extern "system" {
2288    pub fn SetupRemoveFileLogEntryA(
2289        FileLogHandle: HSPFILELOG,
2290        LogSectionName: PCSTR,
2291        TargetFilename: PCSTR,
2292    ) -> BOOL;
2293    pub fn SetupRemoveFileLogEntryW(
2294        FileLogHandle: HSPFILELOG,
2295        LogSectionName: PCWSTR,
2296        TargetFilename: PCWSTR,
2297    ) -> BOOL;
2298}
2299ENUM!{enum SetupFileLogInfo {
2300    SetupFileLogSourceFilename,
2301    SetupFileLogChecksum,
2302    SetupFileLogDiskTagfile,
2303    SetupFileLogDiskDescription,
2304    SetupFileLogOtherInfo,
2305    SetupFileLogMax,
2306}}
2307extern "system" {
2308    pub fn SetupQueryFileLogA(
2309        FileLogHandle: HSPFILELOG,
2310        LogSectionName: PCSTR,
2311        TargetFilename: PCSTR,
2312        DesiredInfo: SetupFileLogInfo,
2313        DataOut: PSTR,
2314        ReturnBufferSize: DWORD,
2315        RequiredSize: PDWORD,
2316    ) -> BOOL;
2317    pub fn SetupQueryFileLogW(
2318        FileLogHandle: HSPFILELOG,
2319        LogSectionName: PCWSTR,
2320        TargetFilename: PCWSTR,
2321        DesiredInfo: SetupFileLogInfo,
2322        DataOut: PWSTR,
2323        ReturnBufferSize: DWORD,
2324        RequiredSize: PDWORD,
2325    ) -> BOOL;
2326}
2327pub type LogSeverity = DWORD;
2328pub const LogSevInformation: LogSeverity = 0x00000000;
2329pub const LogSevWarning: LogSeverity = 0x00000001;
2330pub const LogSevError: LogSeverity = 0x00000002;
2331pub const LogSevFatalError: LogSeverity = 0x00000003;
2332pub const LogSevMaximum: LogSeverity = 0x00000004;
2333extern "system" {
2334    pub fn SetupOpenLog(
2335        Erase: BOOL,
2336    ) -> BOOL;
2337    pub fn SetupLogErrorA(
2338        MessageString: LPCSTR,
2339        Severity: LogSeverity,
2340    ) -> BOOL;
2341    pub fn SetupLogErrorW(
2342        MessageString: LPCWSTR,
2343        Severity: LogSeverity,
2344    ) -> BOOL;
2345    pub fn SetupCloseLog() -> ();
2346    pub fn SetupGetThreadLogToken() -> SP_LOG_TOKEN;
2347    pub fn SetupSetThreadLogToken(
2348        LogToken: SP_LOG_TOKEN,
2349    ) -> ();
2350}
2351//pub fn SetupWriteTextLog() -> ();
2352//pub fn SetupWriteTextLogError() -> ();
2353extern "system" {
2354    pub fn SetupWriteTextLogInfLine(
2355        LogToken: SP_LOG_TOKEN,
2356        Flags: DWORD,
2357        InfHandle: HINF,
2358        Context: PINFCONTEXT,
2359    ) -> ();
2360    pub fn SetupGetBackupInformationA(
2361        QueueHandle: HSPFILEQ,
2362        BackupParams: PSP_BACKUP_QUEUE_PARAMS_A,
2363    ) -> BOOL;
2364    pub fn SetupGetBackupInformationW(
2365        QueueHandle: HSPFILEQ,
2366        BackupParams: PSP_BACKUP_QUEUE_PARAMS_W,
2367    ) -> BOOL;
2368    pub fn SetupPrepareQueueForRestoreA(
2369        QueueHandle: HSPFILEQ,
2370        BackupPath: PCSTR,
2371        RestoreFlags: DWORD,
2372    ) -> BOOL;
2373    pub fn SetupPrepareQueueForRestoreW(
2374        QueueHandle: HSPFILEQ,
2375        BackupPath: PCWSTR,
2376        RestoreFlags: DWORD,
2377    ) -> BOOL;
2378    pub fn SetupSetNonInteractiveMode(
2379        NonInteractiveFlag: BOOL,
2380    ) -> BOOL;
2381    pub fn SetupGetNonInteractiveMode() -> BOOL;
2382    pub fn SetupDiCreateDeviceInfoList(
2383        ClassGuid: *const GUID,
2384        hwndParent: HWND,
2385    ) -> HDEVINFO;
2386    pub fn SetupDiCreateDeviceInfoListExA(
2387        ClassGuid: *const GUID,
2388        hwndParent: HWND,
2389        MachineName: PCSTR,
2390        Reserved: PVOID,
2391    ) -> HDEVINFO;
2392    pub fn SetupDiCreateDeviceInfoListExW(
2393        ClassGuid: *const GUID,
2394        hwndParent: HWND,
2395        MachineName: PCWSTR,
2396        Reserved: PVOID,
2397    ) -> HDEVINFO;
2398    pub fn SetupDiGetDeviceInfoListClass(
2399        DeviceInfoSet: HDEVINFO,
2400        ClassGuid: LPGUID,
2401    ) -> BOOL;
2402    pub fn SetupDiGetDeviceInfoListDetailA(
2403        DeviceInfoSet: HDEVINFO,
2404        DeviceInfoSetDetailData: PSP_DEVINFO_LIST_DETAIL_DATA_A,
2405    ) -> BOOL;
2406    pub fn SetupDiGetDeviceInfoListDetailW(
2407        DeviceInfoSet: HDEVINFO,
2408        DeviceInfoSetDetailData: PSP_DEVINFO_LIST_DETAIL_DATA_W,
2409    ) -> BOOL;
2410}
2411pub const DICD_GENERATE_ID: DWORD = 0x00000001;
2412pub const DICD_INHERIT_CLASSDRVS: DWORD = 0x00000002;
2413extern "system" {
2414    pub fn SetupDiCreateDeviceInfoA(
2415        DeviceInfoSet: HDEVINFO,
2416        DeviceName: PCSTR,
2417        ClassGuid: *const GUID,
2418        DeviceDescription: PCSTR,
2419        hwndParent: HWND,
2420        CreationFlags: DWORD,
2421        DeviceInfoData: PSP_DEVINFO_DATA,
2422    ) -> BOOL;
2423    pub fn SetupDiCreateDeviceInfoW(
2424        DeviceInfoSet: HDEVINFO,
2425        DeviceName: PCWSTR,
2426        ClassGuid: *const GUID,
2427        DeviceDescription: PCWSTR,
2428        hwndParent: HWND,
2429        CreationFlags: DWORD,
2430        DeviceInfoData: PSP_DEVINFO_DATA,
2431    ) -> BOOL;
2432}
2433pub const DIOD_INHERIT_CLASSDRVS: DWORD = 0x00000002;
2434pub const DIOD_CANCEL_REMOVE: DWORD = 0x00000004;
2435extern "system" {
2436    pub fn SetupDiOpenDeviceInfoA(
2437        DeviceInfoSet: HDEVINFO,
2438        DeviceInstanceId: PCSTR,
2439        hwndParent: HWND,
2440        OpenFlags: DWORD,
2441        DeviceInfoData: PSP_DEVINFO_DATA,
2442    ) -> BOOL;
2443    pub fn SetupDiOpenDeviceInfoW(
2444        DeviceInfoSet: HDEVINFO,
2445        DeviceInstanceId: PCWSTR,
2446        hwndParent: HWND,
2447        OpenFlags: DWORD,
2448        DeviceInfoData: PSP_DEVINFO_DATA,
2449    ) -> BOOL;
2450    pub fn SetupDiGetDeviceInstanceIdA(
2451        DeviceInfoSet: HDEVINFO,
2452        DeviceInfoData: PSP_DEVINFO_DATA,
2453        DeviceInstanceId: PSTR,
2454        DeviceInstanceIdSize: DWORD,
2455        RequiredSize: PDWORD,
2456    ) -> BOOL;
2457    pub fn SetupDiGetDeviceInstanceIdW(
2458        DeviceInfoSet: HDEVINFO,
2459        DeviceInfoData: PSP_DEVINFO_DATA,
2460        DeviceInstanceId: PWSTR,
2461        DeviceInstanceIdSize: DWORD,
2462        RequiredSize: PDWORD,
2463    ) -> BOOL;
2464    pub fn SetupDiDeleteDeviceInfo(
2465        DeviceInfoSet: HDEVINFO,
2466        DeviceInfoData: PSP_DEVINFO_DATA,
2467    ) -> BOOL;
2468    pub fn SetupDiEnumDeviceInfo(
2469        DeviceInfoSet: HDEVINFO,
2470        MemberIndex: DWORD,
2471        DeviceInfoData: PSP_DEVINFO_DATA,
2472    ) -> BOOL;
2473    pub fn SetupDiDestroyDeviceInfoList(
2474        DeviceInfoSet: HDEVINFO,
2475    ) -> BOOL;
2476    pub fn SetupDiEnumDeviceInterfaces(
2477        DeviceInfoSet: HDEVINFO,
2478        DeviceInfoData: PSP_DEVINFO_DATA,
2479        InterfaceClassGuid: *const GUID,
2480        MemberIndex: DWORD,
2481        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2482    ) -> BOOL;
2483    pub fn SetupDiCreateDeviceInterfaceA(
2484        DeviceInfoSet: HDEVINFO,
2485        DeviceInfoData: PSP_DEVINFO_DATA,
2486        InterfaceClassGuid: *const GUID,
2487        ReferenceString: PCSTR,
2488        CreationFlags: DWORD,
2489        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2490    ) -> BOOL;
2491    pub fn SetupDiCreateDeviceInterfaceW(
2492        DeviceInfoSet: HDEVINFO,
2493        DeviceInfoData: PSP_DEVINFO_DATA,
2494        InterfaceClassGuid: *const GUID,
2495        ReferenceString: PCWSTR,
2496        CreationFlags: DWORD,
2497        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2498    ) -> BOOL;
2499}
2500pub const DIODI_NO_ADD: DWORD = 0x00000001;
2501extern "system" {
2502    pub fn SetupDiOpenDeviceInterfaceA(
2503        DeviceInfoSet: HDEVINFO,
2504        DevicePath: PCSTR,
2505        OpenFlags: DWORD,
2506        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2507    ) -> BOOL;
2508    pub fn SetupDiOpenDeviceInterfaceW(
2509        DeviceInfoSet: HDEVINFO,
2510        DevicePath: PCWSTR,
2511        OpenFlags: DWORD,
2512        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2513    ) -> BOOL;
2514    pub fn SetupDiGetDeviceInterfaceAlias(
2515        DeviceInfoSet: HDEVINFO,
2516        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2517        AliasInterfaceClassGuid: *const GUID,
2518        AliasDeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2519    ) -> BOOL;
2520    pub fn SetupDiDeleteDeviceInterfaceData(
2521        DeviceInfoSet: HDEVINFO,
2522        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2523    ) -> BOOL;
2524    pub fn SetupDiRemoveDeviceInterface(
2525        DeviceInfoSet: HDEVINFO,
2526        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2527    ) -> BOOL;
2528    pub fn SetupDiGetDeviceInterfaceDetailA(
2529        DeviceInfoSet: HDEVINFO,
2530        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2531        DeviceInterfaceDetailData: PSP_DEVICE_INTERFACE_DETAIL_DATA_A,
2532        DeviceInterfaceDetailDataSize: DWORD,
2533        RequiredSize: PDWORD,
2534        DeviceInfoData: PSP_DEVINFO_DATA,
2535    ) -> BOOL;
2536    pub fn SetupDiGetDeviceInterfaceDetailW(
2537        DeviceInfoSet: HDEVINFO,
2538        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2539        DeviceInterfaceDetailData: PSP_DEVICE_INTERFACE_DETAIL_DATA_W,
2540        DeviceInterfaceDetailDataSize: DWORD,
2541        RequiredSize: PDWORD,
2542        DeviceInfoData: PSP_DEVINFO_DATA,
2543    ) -> BOOL;
2544    pub fn SetupDiInstallDeviceInterfaces(
2545        DeviceInfoSet: HDEVINFO,
2546        DeviceInfoData: PSP_DEVINFO_DATA,
2547    ) -> BOOL;
2548    pub fn SetupDiSetDeviceInterfaceDefault(
2549        DeviceInfoSet: HDEVINFO,
2550        DeviceInfoData: PSP_DEVINFO_DATA,
2551        Flags: DWORD,
2552        Reserved: PVOID,
2553    ) -> BOOL;
2554}
2555pub const SPRDI_FIND_DUPS: DWORD = 0x00000001;
2556extern "system" {
2557    pub fn SetupDiRegisterDeviceInfo(
2558        DeviceInfoSet: HDEVINFO,
2559        DeviceInfoData: PSP_DEVINFO_DATA,
2560        Flags: DWORD,
2561        CompareProc: PSP_DETSIG_CMPPROC,
2562        CompareContext: PVOID,
2563        DupDeviceInfoData: PSP_DEVINFO_DATA,
2564    ) -> BOOL;
2565}
2566pub const SPDIT_NODRIVER: DWORD = 0x00000000;
2567pub const SPDIT_CLASSDRIVER: DWORD = 0x00000001;
2568pub const SPDIT_COMPATDRIVER: DWORD = 0x00000002;
2569extern "system" {
2570    pub fn SetupDiBuildDriverInfoList(
2571        DeviceInfoSet: HDEVINFO,
2572        DeviceInfoData: PSP_DEVINFO_DATA,
2573        DriverType: DWORD,
2574    ) -> BOOL;
2575    pub fn SetupDiCancelDriverInfoSearch(
2576        DeviceInfoSet: HDEVINFO,
2577    ) -> BOOL;
2578    pub fn SetupDiEnumDriverInfoA(
2579        DeviceInfoSet: HDEVINFO,
2580        DeviceInfoData: PSP_DEVINFO_DATA,
2581        DriverType: DWORD,
2582        MemberIndex: DWORD,
2583        DriverInfoData: PSP_DRVINFO_DATA_A,
2584    ) -> BOOL;
2585    pub fn SetupDiEnumDriverInfoW(
2586        DeviceInfoSet: HDEVINFO,
2587        DeviceInfoData: PSP_DEVINFO_DATA,
2588        DriverType: DWORD,
2589        MemberIndex: DWORD,
2590        DriverInfoData: PSP_DRVINFO_DATA_W,
2591    ) -> BOOL;
2592    pub fn SetupDiGetSelectedDriverA(
2593        DeviceInfoSet: HDEVINFO,
2594        DeviceInfoData: PSP_DEVINFO_DATA,
2595        DriverInfoData: PSP_DRVINFO_DATA_A,
2596    ) -> BOOL;
2597    pub fn SetupDiGetSelectedDriverW(
2598        DeviceInfoSet: HDEVINFO,
2599        DeviceInfoData: PSP_DEVINFO_DATA,
2600        DriverInfoData: PSP_DRVINFO_DATA_W,
2601    ) -> BOOL;
2602    pub fn SetupDiSetSelectedDriverA(
2603        DeviceInfoSet: HDEVINFO,
2604        DeviceInfoData: PSP_DEVINFO_DATA,
2605        DriverInfoData: PSP_DRVINFO_DATA_A,
2606    ) -> BOOL;
2607    pub fn SetupDiSetSelectedDriverW(
2608        DeviceInfoSet: HDEVINFO,
2609        DeviceInfoData: PSP_DEVINFO_DATA,
2610        DriverInfoData: PSP_DRVINFO_DATA_W,
2611    ) -> BOOL;
2612    pub fn SetupDiGetDriverInfoDetailA(
2613        DeviceInfoSet: HDEVINFO,
2614        DeviceInfoData: PSP_DEVINFO_DATA,
2615        DriverInfoData: PSP_DRVINFO_DATA_A,
2616        DriverInfoDetailData: PSP_DRVINFO_DETAIL_DATA_A,
2617        DriverInfoDetailDataSize: DWORD,
2618        RequiredSize: PDWORD,
2619    ) -> BOOL;
2620    pub fn SetupDiGetDriverInfoDetailW(
2621        DeviceInfoSet: HDEVINFO,
2622        DeviceInfoData: PSP_DEVINFO_DATA,
2623        DriverInfoData: PSP_DRVINFO_DATA_W,
2624        DriverInfoDetailData: PSP_DRVINFO_DETAIL_DATA_W,
2625        DriverInfoDetailDataSize: DWORD,
2626        RequiredSize: PDWORD,
2627    ) -> BOOL;
2628    pub fn SetupDiDestroyDriverInfoList(
2629        DeviceInfoSet: HDEVINFO,
2630        DeviceInfoData: PSP_DEVINFO_DATA,
2631        DriverType: DWORD,
2632    ) -> BOOL;
2633}
2634pub const DIGCF_DEFAULT: DWORD = 0x00000001;
2635pub const DIGCF_PRESENT: DWORD = 0x00000002;
2636pub const DIGCF_ALLCLASSES: DWORD = 0x00000004;
2637pub const DIGCF_PROFILE: DWORD = 0x00000008;
2638pub const DIGCF_DEVICEINTERFACE: DWORD = 0x00000010;
2639extern "system" {
2640    pub fn SetupDiGetClassDevsA(
2641        ClassGuid: *const GUID,
2642        Enumerator: PCSTR,
2643        hwndParent: HWND,
2644        Flags: DWORD,
2645    ) -> HDEVINFO;
2646    pub fn SetupDiGetClassDevsW(
2647        ClassGuid: *const GUID,
2648        Enumerator: PCWSTR,
2649        hwndParent: HWND,
2650        Flags: DWORD,
2651    ) -> HDEVINFO;
2652    pub fn SetupDiGetClassDevsExA(
2653        ClassGuid: *const GUID,
2654        Enumerator: PCSTR,
2655        hwndParent: HWND,
2656        Flags: DWORD,
2657        DeviceInfoSet: HDEVINFO,
2658        MachineName: PCSTR,
2659        Reserved: PVOID,
2660    ) -> HDEVINFO;
2661    pub fn SetupDiGetClassDevsExW(
2662        ClassGuid: *const GUID,
2663        Enumerator: PCWSTR,
2664        hwndParent: HWND,
2665        Flags: DWORD,
2666        DeviceInfoSet: HDEVINFO,
2667        MachineName: PCWSTR,
2668        Reserved: PVOID,
2669    ) -> HDEVINFO;
2670    pub fn SetupDiGetINFClassA(
2671        InfName: PCSTR,
2672        ClassGuid: LPGUID,
2673        ClassName: PSTR,
2674        ClassNameSize: DWORD,
2675        RequiredSize: PDWORD,
2676    ) -> BOOL;
2677    pub fn SetupDiGetINFClassW(
2678        InfName: PCWSTR,
2679        ClassGuid: LPGUID,
2680        ClassName: PWSTR,
2681        ClassNameSize: DWORD,
2682        RequiredSize: PDWORD,
2683    ) -> BOOL;
2684}
2685pub const DIBCI_NOINSTALLCLASS: DWORD = 0x00000001;
2686pub const DIBCI_NODISPLAYCLASS: DWORD = 0x00000002;
2687extern "system" {
2688    pub fn SetupDiBuildClassInfoList(
2689        Flags: DWORD,
2690        ClassGuidList: LPGUID,
2691        ClassGuidListSize: DWORD,
2692        RequiredSize: PDWORD,
2693    ) -> BOOL;
2694    pub fn SetupDiBuildClassInfoListExA(
2695        Flags: DWORD,
2696        ClassGuidList: LPGUID,
2697        ClassGuidListSize: DWORD,
2698        RequiredSize: PDWORD,
2699        MachineName: PCSTR,
2700        Reserved: PVOID,
2701    ) -> BOOL;
2702    pub fn SetupDiBuildClassInfoListExW(
2703        Flags: DWORD,
2704        ClassGuidList: LPGUID,
2705        ClassGuidListSize: DWORD,
2706        RequiredSize: PDWORD,
2707        MachineName: PCWSTR,
2708        Reserved: PVOID,
2709    ) -> BOOL;
2710    pub fn SetupDiGetClassDescriptionA(
2711        ClassGuid: *const GUID,
2712        ClassDescription: PSTR,
2713        ClassDescriptionSize: DWORD,
2714        RequiredSize: PDWORD,
2715    ) -> BOOL;
2716    pub fn SetupDiGetClassDescriptionW(
2717        ClassGuid: *const GUID,
2718        ClassDescription: PWSTR,
2719        ClassDescriptionSize: DWORD,
2720        RequiredSize: PDWORD,
2721    ) -> BOOL;
2722    pub fn SetupDiGetClassDescriptionExA(
2723        ClassGuid: *const GUID,
2724        ClassDescription: PSTR,
2725        ClassDescriptionSize: DWORD,
2726        RequiredSize: PDWORD,
2727        MachineName: PCSTR,
2728        Reserved: PVOID,
2729    ) -> BOOL;
2730    pub fn SetupDiGetClassDescriptionExW(
2731        ClassGuid: *const GUID,
2732        ClassDescription: PWSTR,
2733        ClassDescriptionSize: DWORD,
2734        RequiredSize: PDWORD,
2735        MachineName: PCWSTR,
2736        Reserved: PVOID,
2737    ) -> BOOL;
2738    pub fn SetupDiCallClassInstaller(
2739        InstallFunction: DI_FUNCTION,
2740        DeviceInfoSet: HDEVINFO,
2741        DeviceInfoData: PSP_DEVINFO_DATA,
2742    ) -> BOOL;
2743    pub fn SetupDiSelectDevice(
2744        DeviceInfoSet: HDEVINFO,
2745        DeviceInfoData: PSP_DEVINFO_DATA,
2746    ) -> BOOL;
2747    pub fn SetupDiSelectBestCompatDrv(
2748        DeviceInfoSet: HDEVINFO,
2749        DeviceInfoData: PSP_DEVINFO_DATA,
2750    ) -> BOOL;
2751    pub fn SetupDiInstallDevice(
2752        DeviceInfoSet: HDEVINFO,
2753        DeviceInfoData: PSP_DEVINFO_DATA,
2754    ) -> BOOL;
2755    pub fn SetupDiInstallDriverFiles(
2756        DeviceInfoSet: HDEVINFO,
2757        DeviceInfoData: PSP_DEVINFO_DATA,
2758    ) -> BOOL;
2759    pub fn SetupDiRegisterCoDeviceInstallers(
2760        DeviceInfoSet: HDEVINFO,
2761        DeviceInfoData: PSP_DEVINFO_DATA,
2762    ) -> BOOL;
2763    pub fn SetupDiRemoveDevice(
2764        DeviceInfoSet: HDEVINFO,
2765        DeviceInfoData: PSP_DEVINFO_DATA,
2766    ) -> BOOL;
2767    pub fn SetupDiUnremoveDevice(
2768        DeviceInfoSet: HDEVINFO,
2769        DeviceInfoData: PSP_DEVINFO_DATA,
2770    ) -> BOOL;
2771    pub fn SetupDiRestartDevices(
2772        DeviceInfoSet: HDEVINFO,
2773        DeviceInfoData: PSP_DEVINFO_DATA,
2774    ) -> BOOL;
2775    pub fn SetupDiChangeState(
2776        DeviceInfoSet: HDEVINFO,
2777        DeviceInfoData: PSP_DEVINFO_DATA,
2778    ) -> BOOL;
2779    pub fn SetupDiInstallClassA(
2780        hwndParent: HWND,
2781        InfFileName: PCSTR,
2782        Flags: DWORD,
2783        FileQueue: HSPFILEQ,
2784    ) -> BOOL;
2785    pub fn SetupDiInstallClassW(
2786        hwndParent: HWND,
2787        InfFileName: PCWSTR,
2788        Flags: DWORD,
2789        FileQueue: HSPFILEQ,
2790    ) -> BOOL;
2791    pub fn SetupDiInstallClassExA(
2792        hwndParent: HWND,
2793        InfFileName: PCSTR,
2794        Flags: DWORD,
2795        FileQueue: HSPFILEQ,
2796        InterfaceClassGuid: *const GUID,
2797        Reserved1: PVOID,
2798        Reserved2: PVOID,
2799    ) -> BOOL;
2800    pub fn SetupDiInstallClassExW(
2801        hwndParent: HWND,
2802        InfFileName: PCWSTR,
2803        Flags: DWORD,
2804        FileQueue: HSPFILEQ,
2805        InterfaceClassGuid: *const GUID,
2806        Reserved1: PVOID,
2807        Reserved2: PVOID,
2808    ) -> BOOL;
2809    pub fn SetupDiOpenClassRegKey(
2810        ClassGuid: *const GUID,
2811        samDesired: REGSAM,
2812    ) -> HKEY;
2813}
2814pub const DIOCR_INSTALLER: DWORD = 0x00000001;
2815pub const DIOCR_INTERFACE: DWORD = 0x00000002;
2816extern "system" {
2817    pub fn SetupDiOpenClassRegKeyExA(
2818        ClassGuid: *const GUID,
2819        samDesired: REGSAM,
2820        Flags: DWORD,
2821        MachineName: PCSTR,
2822        Reserved: PVOID,
2823    ) -> HKEY;
2824    pub fn SetupDiOpenClassRegKeyExW(
2825        ClassGuid: *const GUID,
2826        samDesired: REGSAM,
2827        Flags: DWORD,
2828        MachineName: PCWSTR,
2829        Reserved: PVOID,
2830    ) -> HKEY;
2831    pub fn SetupDiCreateDeviceInterfaceRegKeyA(
2832        DeviceInfoSet: HDEVINFO,
2833        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2834        Reserved: DWORD,
2835        samDesired: REGSAM,
2836        InfHandle: HINF,
2837        InfSectionName: PCSTR,
2838    ) -> HKEY;
2839    pub fn SetupDiCreateDeviceInterfaceRegKeyW(
2840        DeviceInfoSet: HDEVINFO,
2841        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2842        Reserved: DWORD,
2843        samDesired: REGSAM,
2844        InfHandle: HINF,
2845        InfSectionName: PCWSTR,
2846    ) -> HKEY;
2847    pub fn SetupDiOpenDeviceInterfaceRegKey(
2848        DeviceInfoSet: HDEVINFO,
2849        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2850        Reserved: DWORD,
2851        samDesired: REGSAM,
2852    ) -> HKEY;
2853    pub fn SetupDiDeleteDeviceInterfaceRegKey(
2854        DeviceInfoSet: HDEVINFO,
2855        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2856        Reserved: DWORD,
2857    ) -> BOOL;
2858}
2859pub const DIREG_DEV: DWORD = 0x00000001;
2860pub const DIREG_DRV: DWORD = 0x00000002;
2861pub const DIREG_BOTH: DWORD = 0x00000004;
2862extern "system" {
2863    pub fn SetupDiCreateDevRegKeyA(
2864        DeviceInfoSet: HDEVINFO,
2865        DeviceInfoData: PSP_DEVINFO_DATA,
2866        Scope: DWORD,
2867        HwProfile: DWORD,
2868        KeyType: DWORD,
2869        InfHandle: HINF,
2870        InfSectionName: PCSTR,
2871    ) -> HKEY;
2872    pub fn SetupDiCreateDevRegKeyW(
2873        DeviceInfoSet: HDEVINFO,
2874        DeviceInfoData: PSP_DEVINFO_DATA,
2875        Scope: DWORD,
2876        HwProfile: DWORD,
2877        KeyType: DWORD,
2878        InfHandle: HINF,
2879        InfSectionName: PCWSTR,
2880    ) -> HKEY;
2881    pub fn SetupDiOpenDevRegKey(
2882        DeviceInfoSet: HDEVINFO,
2883        DeviceInfoData: PSP_DEVINFO_DATA,
2884        Scope: DWORD,
2885        HwProfile: DWORD,
2886        KeyType: DWORD,
2887        samDesired: REGSAM,
2888    ) -> HKEY;
2889    pub fn SetupDiDeleteDevRegKey(
2890        DeviceInfoSet: HDEVINFO,
2891        DeviceInfoData: PSP_DEVINFO_DATA,
2892        Scope: DWORD,
2893        HwProfile: DWORD,
2894        KeyType: DWORD,
2895    ) -> BOOL;
2896    pub fn SetupDiGetHwProfileList(
2897        HwProfileList: PDWORD,
2898        HwProfileListSize: DWORD,
2899        RequiredSize: PDWORD,
2900        CurrentlyActiveIndex: PDWORD,
2901    ) -> BOOL;
2902    pub fn SetupDiGetHwProfileListExA(
2903        HwProfileList: PDWORD,
2904        HwProfileListSize: DWORD,
2905        RequiredSize: PDWORD,
2906        CurrentlyActiveIndex: PDWORD,
2907        MachineName: PCSTR,
2908        Reserved: PVOID,
2909    ) -> BOOL;
2910    pub fn SetupDiGetHwProfileListExW(
2911        HwProfileList: PDWORD,
2912        HwProfileListSize: DWORD,
2913        RequiredSize: PDWORD,
2914        CurrentlyActiveIndex: PDWORD,
2915        MachineName: PCWSTR,
2916        Reserved: PVOID,
2917    ) -> BOOL;
2918    pub fn SetupDiGetDevicePropertyKeys(
2919        DeviceInfoSet: HDEVINFO,
2920        DeviceInfoData: PSP_DEVINFO_DATA,
2921        PropertyKeyArray: *mut DEVPROPKEY,
2922        PropertyKeyCount: DWORD,
2923        RequiredPropertyKeyCount: PDWORD,
2924        Flags: DWORD,
2925    ) -> BOOL;
2926    pub fn SetupDiGetDevicePropertyW(
2927        DeviceInfoSet: HDEVINFO,
2928        DeviceInfoData: PSP_DEVINFO_DATA,
2929        PropertyKey: *const DEVPROPKEY,
2930        PropertyType: *mut DEVPROPTYPE,
2931        PropertyBuffer: PBYTE,
2932        PropertyBufferSize: DWORD,
2933        RequiredSize: PDWORD,
2934        Flags: DWORD,
2935    ) -> BOOL;
2936    pub fn SetupDiSetDevicePropertyW(
2937        DeviceInfoSet: HDEVINFO,
2938        DeviceInfoData: PSP_DEVINFO_DATA,
2939        PropertyKey: *const DEVPROPKEY,
2940        PropertyType: DEVPROPTYPE,
2941        PropertyBuffer: *const BYTE,
2942        PropertyBufferSize: DWORD,
2943        Flags: DWORD,
2944    ) -> BOOL;
2945    pub fn SetupDiGetDeviceInterfacePropertyKeys(
2946        DeviceInfoSet: HDEVINFO,
2947        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2948        PropertyKeyArray: *mut DEVPROPKEY,
2949        PropertyKeyCount: DWORD,
2950        RequiredPropertyKeyCount: PDWORD,
2951        Flags: DWORD,
2952    ) -> BOOL;
2953    pub fn SetupDiGetDeviceInterfacePropertyW(
2954        DeviceInfoSet: HDEVINFO,
2955        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2956        PropertyKey: *const DEVPROPKEY,
2957        PropertyType: *mut DEVPROPTYPE,
2958        PropertyBuffer: PBYTE,
2959        PropertyBufferSize: DWORD,
2960        RequiredSize: PDWORD,
2961        Flags: DWORD,
2962    ) -> BOOL;
2963    pub fn SetupDiSetDeviceInterfacePropertyW(
2964        DeviceInfoSet: HDEVINFO,
2965        DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA,
2966        PropertyKey: *const DEVPROPKEY,
2967        PropertyType: DEVPROPTYPE,
2968        PropertyBuffer: *const BYTE,
2969        PropertyBufferSize: DWORD,
2970        Flags: DWORD,
2971    ) -> BOOL;
2972}
2973pub const DICLASSPROP_INSTALLER: DWORD = 0x00000001;
2974pub const DICLASSPROP_INTERFACE: DWORD = 0x00000002;
2975extern "system" {
2976    pub fn SetupDiGetClassPropertyKeys(
2977        ClassGuid: *const GUID,
2978        PropertyKeyArray: *mut DEVPROPKEY,
2979        PropertyKeyCount: DWORD,
2980        RequiredPropertyKeyCount: PDWORD,
2981        Flags: DWORD,
2982    ) -> BOOL;
2983    pub fn SetupDiGetClassPropertyKeysExW(
2984        ClassGuid: *const GUID,
2985        PropertyKeyArray: *mut DEVPROPKEY,
2986        PropertyKeyCount: DWORD,
2987        RequiredPropertyKeyCount: PDWORD,
2988        Flags: DWORD,
2989        MachineName: PCWSTR,
2990        Reserved: PVOID,
2991    ) -> BOOL;
2992    pub fn SetupDiGetClassPropertyW(
2993        ClassGuid: *const GUID,
2994        PropertyKey: *const DEVPROPKEY,
2995        PropertyType: *mut DEVPROPTYPE,
2996        PropertyBuffer: PBYTE,
2997        PropertyBufferSize: DWORD,
2998        RequiredSize: PDWORD,
2999        Flags: DWORD,
3000    ) -> BOOL;
3001    pub fn SetupDiGetClassPropertyExW(
3002        ClassGuid: *const GUID,
3003        PropertyKey: *const DEVPROPKEY,
3004        PropertyType: *mut DEVPROPTYPE,
3005        PropertyBuffer: PBYTE,
3006        PropertyBufferSize: DWORD,
3007        RequiredSize: PDWORD,
3008        Flags: DWORD,
3009        MachineName: PCWSTR,
3010        Reserved: PVOID,
3011    ) -> BOOL;
3012    pub fn SetupDiSetClassPropertyW(
3013        ClassGuid: *const GUID,
3014        PropertyKey: *const DEVPROPKEY,
3015        PropertyType: DEVPROPTYPE,
3016        PropertyBuffer: *const BYTE,
3017        PropertyBufferSize: DWORD,
3018        Flags: DWORD,
3019    ) -> BOOL;
3020    pub fn SetupDiSetClassPropertyExW(
3021        ClassGuid: *const GUID,
3022        PropertyKey: *const DEVPROPKEY,
3023        PropertyType: DEVPROPTYPE,
3024        PropertyBuffer: *const BYTE,
3025        PropertyBufferSize: DWORD,
3026        Flags: DWORD,
3027        MachineName: PCWSTR,
3028        Reserved: PVOID,
3029    ) -> BOOL;
3030}
3031pub const SPDRP_DEVICEDESC: DWORD = 0x00000000;
3032pub const SPDRP_HARDWAREID: DWORD = 0x00000001;
3033pub const SPDRP_COMPATIBLEIDS: DWORD = 0x00000002;
3034pub const SPDRP_UNUSED0: DWORD = 0x00000003;
3035pub const SPDRP_SERVICE: DWORD = 0x00000004;
3036pub const SPDRP_UNUSED1: DWORD = 0x00000005;
3037pub const SPDRP_UNUSED2: DWORD = 0x00000006;
3038pub const SPDRP_CLASS: DWORD = 0x00000007;
3039pub const SPDRP_CLASSGUID: DWORD = 0x00000008;
3040pub const SPDRP_DRIVER: DWORD = 0x00000009;
3041pub const SPDRP_CONFIGFLAGS: DWORD = 0x0000000A;
3042pub const SPDRP_MFG: DWORD = 0x0000000B;
3043pub const SPDRP_FRIENDLYNAME: DWORD = 0x0000000C;
3044pub const SPDRP_LOCATION_INFORMATION: DWORD = 0x0000000D;
3045pub const SPDRP_PHYSICAL_DEVICE_OBJECT_NAME: DWORD = 0x0000000E;
3046pub const SPDRP_CAPABILITIES: DWORD = 0x0000000F;
3047pub const SPDRP_UI_NUMBER: DWORD = 0x00000010;
3048pub const SPDRP_UPPERFILTERS: DWORD = 0x00000011;
3049pub const SPDRP_LOWERFILTERS: DWORD = 0x00000012;
3050pub const SPDRP_BUSTYPEGUID: DWORD = 0x00000013;
3051pub const SPDRP_LEGACYBUSTYPE: DWORD = 0x00000014;
3052pub const SPDRP_BUSNUMBER: DWORD = 0x00000015;
3053pub const SPDRP_ENUMERATOR_NAME: DWORD = 0x00000016;
3054pub const SPDRP_SECURITY: DWORD = 0x00000017;
3055pub const SPDRP_SECURITY_SDS: DWORD = 0x00000018;
3056pub const SPDRP_DEVTYPE: DWORD = 0x00000019;
3057pub const SPDRP_EXCLUSIVE: DWORD = 0x0000001A;
3058pub const SPDRP_CHARACTERISTICS: DWORD = 0x0000001B;
3059pub const SPDRP_ADDRESS: DWORD = 0x0000001C;
3060pub const SPDRP_UI_NUMBER_DESC_FORMAT: DWORD = 0x0000001D;
3061pub const SPDRP_DEVICE_POWER_DATA: DWORD = 0x0000001E;
3062pub const SPDRP_REMOVAL_POLICY: DWORD = 0x0000001F;
3063pub const SPDRP_REMOVAL_POLICY_HW_DEFAULT: DWORD = 0x00000020;
3064pub const SPDRP_REMOVAL_POLICY_OVERRIDE: DWORD = 0x00000021;
3065pub const SPDRP_INSTALL_STATE: DWORD = 0x00000022;
3066pub const SPDRP_LOCATION_PATHS: DWORD = 0x00000023;
3067pub const SPDRP_BASE_CONTAINERID: DWORD = 0x00000024;
3068pub const SPDRP_MAXIMUM_PROPERTY: DWORD = 0x00000025;
3069pub const SPCRP_UPPERFILTERS: DWORD = 0x00000011;
3070pub const SPCRP_LOWERFILTERS: DWORD = 0x00000012;
3071pub const SPCRP_SECURITY: DWORD = 0x00000017;
3072pub const SPCRP_SECURITY_SDS: DWORD = 0x00000018;
3073pub const SPCRP_DEVTYPE: DWORD = 0x00000019;
3074pub const SPCRP_EXCLUSIVE: DWORD = 0x0000001A;
3075pub const SPCRP_CHARACTERISTICS: DWORD = 0x0000001B;
3076pub const SPCRP_MAXIMUM_PROPERTY: DWORD = 0x0000001C;
3077extern "system" {
3078    pub fn SetupDiGetDeviceRegistryPropertyA(
3079        DeviceInfoSet: HDEVINFO,
3080        DeviceInfoData: PSP_DEVINFO_DATA,
3081        Property: DWORD,
3082        PropertyRegDataType: PDWORD,
3083        PropertyBuffer: PBYTE,
3084        PropertyBufferSize: DWORD,
3085        RequiredSize: PDWORD,
3086    ) -> BOOL;
3087    pub fn SetupDiGetDeviceRegistryPropertyW(
3088        DeviceInfoSet: HDEVINFO,
3089        DeviceInfoData: PSP_DEVINFO_DATA,
3090        Property: DWORD,
3091        PropertyRegDataType: PDWORD,
3092        PropertyBuffer: PBYTE,
3093        PropertyBufferSize: DWORD,
3094        RequiredSize: PDWORD,
3095    ) -> BOOL;
3096    pub fn SetupDiGetClassRegistryPropertyA(
3097        ClassGuid: *const GUID,
3098        Property: DWORD,
3099        PropertyRegDataType: PDWORD,
3100        PropertyBuffer: PBYTE,
3101        PropertyBufferSize: DWORD,
3102        RequiredSize: PDWORD,
3103        MachineName: PCSTR,
3104        Reserved: PVOID,
3105    ) -> BOOL;
3106    pub fn SetupDiGetClassRegistryPropertyW(
3107        ClassGuid: *const GUID,
3108        Property: DWORD,
3109        PropertyRegDataType: PDWORD,
3110        PropertyBuffer: PBYTE,
3111        PropertyBufferSize: DWORD,
3112        RequiredSize: PDWORD,
3113        MachineName: PCWSTR,
3114        Reserved: PVOID,
3115    ) -> BOOL;
3116    pub fn SetupDiSetDeviceRegistryPropertyA(
3117        DeviceInfoSet: HDEVINFO,
3118        DeviceInfoData: PSP_DEVINFO_DATA,
3119        Property: DWORD,
3120        PropertyBuffer: *const BYTE,
3121        PropertyBufferSize: DWORD,
3122    ) -> BOOL;
3123    pub fn SetupDiSetDeviceRegistryPropertyW(
3124        DeviceInfoSet: HDEVINFO,
3125        DeviceInfoData: PSP_DEVINFO_DATA,
3126        Property: DWORD,
3127        PropertyBuffer: *const BYTE,
3128        PropertyBufferSize: DWORD,
3129    ) -> BOOL;
3130    pub fn SetupDiSetClassRegistryPropertyA(
3131        ClassGuid: *const GUID,
3132        Property: DWORD,
3133        PropertyBuffer: *const BYTE,
3134        PropertyBufferSize: DWORD,
3135        MachineName: PCSTR,
3136        Reserved: PVOID,
3137    ) -> BOOL;
3138    pub fn SetupDiSetClassRegistryPropertyW(
3139        ClassGuid: *const GUID,
3140        Property: DWORD,
3141        PropertyBuffer: *const BYTE,
3142        PropertyBufferSize: DWORD,
3143        MachineName: PCWSTR,
3144        Reserved: PVOID,
3145    ) -> BOOL;
3146    pub fn SetupDiGetDeviceInstallParamsA(
3147        DeviceInfoSet: HDEVINFO,
3148        DeviceInfoData: PSP_DEVINFO_DATA,
3149        DeviceInstallParams: PSP_DEVINSTALL_PARAMS_A,
3150    ) -> BOOL;
3151    pub fn SetupDiGetDeviceInstallParamsW(
3152        DeviceInfoSet: HDEVINFO,
3153        DeviceInfoData: PSP_DEVINFO_DATA,
3154        DeviceInstallParams: PSP_DEVINSTALL_PARAMS_W,
3155    ) -> BOOL;
3156    pub fn SetupDiGetClassInstallParamsA(
3157        DeviceInfoSet: HDEVINFO,
3158        DeviceInfoData: PSP_DEVINFO_DATA,
3159        ClassInstallParams: PSP_CLASSINSTALL_HEADER,
3160        ClassInstallParamsSize: DWORD,
3161        RequiredSize: PDWORD,
3162    ) -> BOOL;
3163    pub fn SetupDiGetClassInstallParamsW(
3164        DeviceInfoSet: HDEVINFO,
3165        DeviceInfoData: PSP_DEVINFO_DATA,
3166        ClassInstallParams: PSP_CLASSINSTALL_HEADER,
3167        ClassInstallParamsSize: DWORD,
3168        RequiredSize: PDWORD,
3169    ) -> BOOL;
3170    pub fn SetupDiSetDeviceInstallParamsA(
3171        DeviceInfoSet: HDEVINFO,
3172        DeviceInfoData: PSP_DEVINFO_DATA,
3173        DeviceInstallParams: PSP_DEVINSTALL_PARAMS_A,
3174    ) -> BOOL;
3175    pub fn SetupDiSetDeviceInstallParamsW(
3176        DeviceInfoSet: HDEVINFO,
3177        DeviceInfoData: PSP_DEVINFO_DATA,
3178        DeviceInstallParams: PSP_DEVINSTALL_PARAMS_W,
3179    ) -> BOOL;
3180    pub fn SetupDiSetClassInstallParamsA(
3181        DeviceInfoSet: HDEVINFO,
3182        DeviceInfoData: PSP_DEVINFO_DATA,
3183        ClassInstallParams: PSP_CLASSINSTALL_HEADER,
3184        ClassInstallParamsSize: DWORD,
3185    ) -> BOOL;
3186    pub fn SetupDiSetClassInstallParamsW(
3187        DeviceInfoSet: HDEVINFO,
3188        DeviceInfoData: PSP_DEVINFO_DATA,
3189        ClassInstallParams: PSP_CLASSINSTALL_HEADER,
3190        ClassInstallParamsSize: DWORD,
3191    ) -> BOOL;
3192    pub fn SetupDiGetDriverInstallParamsA(
3193        DeviceInfoSet: HDEVINFO,
3194        DeviceInfoData: PSP_DEVINFO_DATA,
3195        DriverInfoData: PSP_DRVINFO_DATA_A,
3196        DriverInstallParams: PSP_DRVINSTALL_PARAMS,
3197    ) -> BOOL;
3198    pub fn SetupDiGetDriverInstallParamsW(
3199        DeviceInfoSet: HDEVINFO,
3200        DeviceInfoData: PSP_DEVINFO_DATA,
3201        DriverInfoData: PSP_DRVINFO_DATA_W,
3202        DriverInstallParams: PSP_DRVINSTALL_PARAMS,
3203    ) -> BOOL;
3204    pub fn SetupDiSetDriverInstallParamsA(
3205        DeviceInfoSet: HDEVINFO,
3206        DeviceInfoData: PSP_DEVINFO_DATA,
3207        DriverInfoData: PSP_DRVINFO_DATA_A,
3208        DriverInstallParams: PSP_DRVINSTALL_PARAMS,
3209    ) -> BOOL;
3210    pub fn SetupDiSetDriverInstallParamsW(
3211        DeviceInfoSet: HDEVINFO,
3212        DeviceInfoData: PSP_DEVINFO_DATA,
3213        DriverInfoData: PSP_DRVINFO_DATA_W,
3214        DriverInstallParams: PSP_DRVINSTALL_PARAMS,
3215    ) -> BOOL;
3216    pub fn SetupDiLoadClassIcon(
3217        ClassGuid: *const GUID,
3218        LargeIcon: *mut HICON,
3219        MiniIconIndex: PINT,
3220    ) -> BOOL;
3221    pub fn SetupDiLoadDeviceIcon(
3222        DeviceInfoSet: HDEVINFO,
3223        DeviceInfoData: PSP_DEVINFO_DATA,
3224        cxIcon: UINT,
3225        cyIcon: UINT,
3226        Flags: DWORD,
3227        hIcon: *mut HICON,
3228    ) -> BOOL;
3229}
3230pub const DMI_MASK: DWORD = 0x00000001;
3231pub const DMI_BKCOLOR: DWORD = 0x00000002;
3232pub const DMI_USERECT: DWORD = 0x00000004;
3233extern "system" {
3234    pub fn SetupDiDrawMiniIcon(
3235        hdc: HDC,
3236        rc: RECT,
3237        MiniIconIndex: INT,
3238        Flags: DWORD,
3239    ) -> INT;
3240    pub fn SetupDiGetClassBitmapIndex(
3241        ClassGuid: *const GUID,
3242        MiniIconIndex: PINT,
3243    ) -> BOOL;
3244    pub fn SetupDiGetClassImageList(
3245        ClassImageListData: PSP_CLASSIMAGELIST_DATA,
3246    ) -> BOOL;
3247    pub fn SetupDiGetClassImageListExA(
3248        ClassImageListData: PSP_CLASSIMAGELIST_DATA,
3249        MachineName: PCSTR,
3250        Reserved: PVOID,
3251    ) -> BOOL;
3252    pub fn SetupDiGetClassImageListExW(
3253        ClassImageListData: PSP_CLASSIMAGELIST_DATA,
3254        MachineName: PCWSTR,
3255        Reserved: PVOID,
3256    ) -> BOOL;
3257    pub fn SetupDiGetClassImageIndex(
3258        ClassImageListData: PSP_CLASSIMAGELIST_DATA,
3259        ClassGuid: *const GUID,
3260        ImageIndex: PINT,
3261    ) -> BOOL;
3262    pub fn SetupDiDestroyClassImageList(
3263        ClassImageListData: PSP_CLASSIMAGELIST_DATA,
3264    ) -> BOOL;
3265}
3266pub const DIGCDP_FLAG_BASIC: DWORD = 0x00000001;
3267pub const DIGCDP_FLAG_ADVANCED: DWORD = 0x00000002;
3268pub const DIGCDP_FLAG_REMOTE_BASIC: DWORD = 0x00000003;
3269pub const DIGCDP_FLAG_REMOTE_ADVANCED: DWORD = 0x00000004;
3270extern "system" {
3271    pub fn SetupDiGetClassDevPropertySheetsA(
3272        DeviceInfoSet: HDEVINFO,
3273        DeviceInfoData: PSP_DEVINFO_DATA,
3274        PropertySheetHeader: LPPROPSHEETHEADERA,
3275        PropertySheetHeaderPageListSize: DWORD,
3276        RequiredSize: PDWORD,
3277        PropertySheetType: DWORD,
3278    ) -> BOOL;
3279    pub fn SetupDiGetClassDevPropertySheetsW(
3280        DeviceInfoSet: HDEVINFO,
3281        DeviceInfoData: PSP_DEVINFO_DATA,
3282        PropertySheetHeader: LPPROPSHEETHEADERW,
3283        PropertySheetHeaderPageListSize: DWORD,
3284        RequiredSize: PDWORD,
3285        PropertySheetType: DWORD,
3286    ) -> BOOL;
3287}
3288pub const IDI_RESOURCEFIRST: c_int = 159;
3289pub const IDI_RESOURCE: c_int = 159;
3290pub const IDI_RESOURCELAST: c_int = 161;
3291pub const IDI_RESOURCEOVERLAYFIRST: c_int = 161;
3292pub const IDI_RESOURCEOVERLAYLAST: c_int = 161;
3293pub const IDI_CONFLICT: c_int = 161;
3294pub const IDI_CLASSICON_OVERLAYFIRST: c_int = 500;
3295pub const IDI_CLASSICON_OVERLAYLAST: c_int = 502;
3296pub const IDI_PROBLEM_OVL: c_int = 500;
3297pub const IDI_DISABLED_OVL: c_int = 501;
3298pub const IDI_FORCED_OVL: c_int = 502;
3299extern "system" {
3300    pub fn SetupDiAskForOEMDisk(
3301        DeviceInfoSet: HDEVINFO,
3302        DeviceInfoData: PSP_DEVINFO_DATA,
3303    ) -> BOOL;
3304    pub fn SetupDiSelectOEMDrv(
3305        hwndParent: HWND,
3306        DeviceInfoSet: HDEVINFO,
3307        DeviceInfoData: PSP_DEVINFO_DATA,
3308    ) -> BOOL;
3309    pub fn SetupDiClassNameFromGuidA(
3310        ClassGuid: *const GUID,
3311        ClassName: PSTR,
3312        ClassNameSize: DWORD,
3313        RequiredSize: PDWORD,
3314    ) -> BOOL;
3315    pub fn SetupDiClassNameFromGuidW(
3316        ClassGuid: *const GUID,
3317        ClassName: PWSTR,
3318        ClassNameSize: DWORD,
3319        RequiredSize: PDWORD,
3320    ) -> BOOL;
3321    pub fn SetupDiClassNameFromGuidExA(
3322        ClassGuid: *const GUID,
3323        ClassName: PSTR,
3324        ClassNameSize: DWORD,
3325        RequiredSize: PDWORD,
3326        MachineName: PCSTR,
3327        Reserved: PVOID,
3328    ) -> BOOL;
3329    pub fn SetupDiClassNameFromGuidExW(
3330        ClassGuid: *const GUID,
3331        ClassName: PWSTR,
3332        ClassNameSize: DWORD,
3333        RequiredSize: PDWORD,
3334        MachineName: PCWSTR,
3335        Reserved: PVOID,
3336    ) -> BOOL;
3337    pub fn SetupDiClassGuidsFromNameA(
3338        ClassName: PCSTR,
3339        ClassGuidList: LPGUID,
3340        ClassGuidListSize: DWORD,
3341        RequiredSize: PDWORD,
3342    ) -> BOOL;
3343    pub fn SetupDiClassGuidsFromNameW(
3344        ClassName: PCWSTR,
3345        ClassGuidList: LPGUID,
3346        ClassGuidListSize: DWORD,
3347        RequiredSize: PDWORD,
3348    ) -> BOOL;
3349    pub fn SetupDiClassGuidsFromNameExA(
3350        ClassName: PCSTR,
3351        ClassGuidList: LPGUID,
3352        ClassGuidListSize: DWORD,
3353        RequiredSize: PDWORD,
3354        MachineName: PCSTR,
3355        Reserved: PVOID,
3356    ) -> BOOL;
3357    pub fn SetupDiClassGuidsFromNameExW(
3358        ClassName: PCWSTR,
3359        ClassGuidList: LPGUID,
3360        ClassGuidListSize: DWORD,
3361        RequiredSize: PDWORD,
3362        MachineName: PCWSTR,
3363        Reserved: PVOID,
3364    ) -> BOOL;
3365    pub fn SetupDiGetHwProfileFriendlyNameA(
3366        HwProfile: DWORD,
3367        FriendlyName: PSTR,
3368        FriendlyNameSize: DWORD,
3369        RequiredSize: PDWORD,
3370    ) -> BOOL;
3371    pub fn SetupDiGetHwProfileFriendlyNameW(
3372        HwProfile: DWORD,
3373        FriendlyName: PWSTR,
3374        FriendlyNameSize: DWORD,
3375        RequiredSize: PDWORD,
3376    ) -> BOOL;
3377    pub fn SetupDiGetHwProfileFriendlyNameExA(
3378        HwProfile: DWORD,
3379        FriendlyName: PSTR,
3380        FriendlyNameSize: DWORD,
3381        RequiredSize: PDWORD,
3382        MachineName: PCSTR,
3383        Reserved: PVOID,
3384    ) -> BOOL;
3385    pub fn SetupDiGetHwProfileFriendlyNameExW(
3386        HwProfile: DWORD,
3387        FriendlyName: PWSTR,
3388        FriendlyNameSize: DWORD,
3389        RequiredSize: PDWORD,
3390        MachineName: PCWSTR,
3391        Reserved: PVOID,
3392    ) -> BOOL;
3393}
3394pub const SPWPT_SELECTDEVICE: DWORD = 0x00000001;
3395pub const SPWP_USE_DEVINFO_DATA: DWORD = 0x00000001;
3396extern "system" {
3397    pub fn SetupDiGetWizardPage(
3398        DeviceInfoSet: HDEVINFO,
3399        DeviceInfoData: PSP_DEVINFO_DATA,
3400        InstallWizardData: PSP_INSTALLWIZARD_DATA,
3401        PageType: DWORD,
3402        Flags: DWORD,
3403    ) -> HPROPSHEETPAGE;
3404    pub fn SetupDiGetSelectedDevice(
3405        DeviceInfoSet: HDEVINFO,
3406        DeviceInfoData: PSP_DEVINFO_DATA,
3407    ) -> BOOL;
3408    pub fn SetupDiSetSelectedDevice(
3409        DeviceInfoSet: HDEVINFO,
3410        DeviceInfoData: PSP_DEVINFO_DATA,
3411    ) -> BOOL;
3412    pub fn SetupDiGetActualModelsSectionA(
3413        Context: PINFCONTEXT,
3414        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
3415        InfSectionWithExt: PSTR,
3416        InfSectionWithExtSize: DWORD,
3417        RequiredSize: PDWORD,
3418        Reserved: PVOID,
3419    ) -> BOOL;
3420    pub fn SetupDiGetActualModelsSectionW(
3421        Context: PINFCONTEXT,
3422        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
3423        InfSectionWithExt: PWSTR,
3424        InfSectionWithExtSize: DWORD,
3425        RequiredSize: PDWORD,
3426        Reserved: PVOID,
3427    ) -> BOOL;
3428    pub fn SetupDiGetActualSectionToInstallA(
3429        InfHandle: HINF,
3430        InfSectionName: PCSTR,
3431        InfSectionWithExt: PSTR,
3432        InfSectionWithExtSize: DWORD,
3433        RequiredSize: PDWORD,
3434        Extension: *mut PSTR,
3435    ) -> BOOL;
3436    pub fn SetupDiGetActualSectionToInstallW(
3437        InfHandle: HINF,
3438        InfSectionName: PCWSTR,
3439        InfSectionWithExt: PWSTR,
3440        InfSectionWithExtSize: DWORD,
3441        RequiredSize: PDWORD,
3442        Extension: *mut PWSTR,
3443    ) -> BOOL;
3444    pub fn SetupDiGetActualSectionToInstallExA(
3445        InfHandle: HINF,
3446        InfSectionName: PCSTR,
3447        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
3448        InfSectionWithExt: PSTR,
3449        InfSectionWithExtSize: DWORD,
3450        RequiredSize: PDWORD,
3451        Extension: *mut PSTR,
3452        Reserved: PVOID,
3453    ) -> BOOL;
3454    pub fn SetupDiGetActualSectionToInstallExW(
3455        InfHandle: HINF,
3456        InfSectionName: PCWSTR,
3457        AlternatePlatformInfo: PSP_ALTPLATFORM_INFO,
3458        InfSectionWithExt: PWSTR,
3459        InfSectionWithExtSize: DWORD,
3460        RequiredSize: PDWORD,
3461        Extension: *mut PWSTR,
3462        Reserved: PVOID,
3463    ) -> BOOL;
3464    pub fn SetupEnumInfSectionsA(
3465        InfHandle: HINF,
3466        Index: UINT,
3467        Buffer: PSTR,
3468        Size: UINT,
3469        SizeNeeded: *mut UINT,
3470    ) -> BOOL;
3471    pub fn SetupEnumInfSectionsW(
3472        InfHandle: HINF,
3473        Index: UINT,
3474        Buffer: PWSTR,
3475        Size: UINT,
3476        SizeNeeded: *mut UINT,
3477    ) -> BOOL;
3478}
3479STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V1_A {
3480    cbSize: DWORD,
3481    CatalogFile: [CHAR; MAX_PATH],
3482    DigitalSigner: [CHAR; MAX_PATH],
3483    DigitalSignerVersion: [CHAR; MAX_PATH],
3484}}
3485pub type PSP_INF_SIGNER_INFO_V1_A = *mut SP_INF_SIGNER_INFO_V1_A;
3486STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V1_W {
3487    cbSize: DWORD,
3488    CatalogFile: [WCHAR; MAX_PATH],
3489    DigitalSigner: [WCHAR; MAX_PATH],
3490    DigitalSignerVersion: [WCHAR; MAX_PATH],
3491}}
3492pub type PSP_INF_SIGNER_INFO_V1_W = *mut SP_INF_SIGNER_INFO_V1_W;
3493STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V2_A {
3494    cbSize: DWORD,
3495    CatalogFile: [CHAR; MAX_PATH],
3496    DigitalSigner: [CHAR; MAX_PATH],
3497    DigitalSignerVersion: [CHAR; MAX_PATH],
3498    SignerScore: DWORD,
3499}}
3500pub type PSP_INF_SIGNER_INFO_V2_A = *mut SP_INF_SIGNER_INFO_V2_A;
3501STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V2_W {
3502    cbSize: DWORD,
3503    CatalogFile: [WCHAR; MAX_PATH],
3504    DigitalSigner: [WCHAR; MAX_PATH],
3505    DigitalSignerVersion: [WCHAR; MAX_PATH],
3506    SignerScore: DWORD,
3507}}
3508pub type PSP_INF_SIGNER_INFO_V2_W = *mut SP_INF_SIGNER_INFO_V2_W;
3509pub const SIGNERSCORE_UNKNOWN: DWORD = 0xFF000000;
3510pub const SIGNERSCORE_W9X_SUSPECT: DWORD = 0xC0000000;
3511pub const SIGNERSCORE_UNSIGNED: DWORD = 0x80000000;
3512pub const SIGNERSCORE_AUTHENTICODE: DWORD = 0x0F000000;
3513pub const SIGNERSCORE_WHQL: DWORD = 0x0D000005;
3514pub const SIGNERSCORE_UNCLASSIFIED: DWORD = 0x0D000004;
3515pub const SIGNERSCORE_INBOX: DWORD = 0x0D000003;
3516pub const SIGNERSCORE_LOGO_STANDARD: DWORD = 0x0D000002;
3517pub const SIGNERSCORE_LOGO_PREMIUM: DWORD = 0x0D000001;
3518pub const SIGNERSCORE_MASK: DWORD = 0xFF000000;
3519pub const SIGNERSCORE_SIGNED_MASK: DWORD = 0xF0000000;
3520pub type SP_INF_SIGNER_INFO_A = SP_INF_SIGNER_INFO_V2_A;
3521pub type PSP_INF_SIGNER_INFO_A = PSP_INF_SIGNER_INFO_V2_A;
3522pub type SP_INF_SIGNER_INFO_W = SP_INF_SIGNER_INFO_V2_W;
3523pub type PSP_INF_SIGNER_INFO_W = PSP_INF_SIGNER_INFO_V2_W;
3524extern "system" {
3525    pub fn SetupVerifyInfFileA(
3526        InfName: PCSTR,
3527        AltPlatformInfo: PSP_ALTPLATFORM_INFO,
3528        InfSignerInfo: PSP_INF_SIGNER_INFO_A,
3529    ) -> BOOL;
3530    pub fn SetupVerifyInfFileW(
3531        InfName: PCWSTR,
3532        AltPlatformInfo: PSP_ALTPLATFORM_INFO,
3533        InfSignerInfo: PSP_INF_SIGNER_INFO_W,
3534    ) -> BOOL;
3535}
3536pub const DICUSTOMDEVPROP_MERGE_MULTISZ: DWORD = 0x00000001;
3537extern "system" {
3538    pub fn SetupDiGetCustomDevicePropertyA(
3539        DeviceInfoSet: HDEVINFO,
3540        DeviceInfoData: PSP_DEVINFO_DATA,
3541        CustomPropertyName: PCSTR,
3542        Flags: DWORD,
3543        PropertyRegDataType: PDWORD,
3544        PropertyBuffer: PBYTE,
3545        PropertyBufferSize: DWORD,
3546        RequiredSize: PDWORD,
3547    ) -> BOOL;
3548    pub fn SetupDiGetCustomDevicePropertyW(
3549        DeviceInfoSet: HDEVINFO,
3550        DeviceInfoData: PSP_DEVINFO_DATA,
3551        CustomPropertyName: PCWSTR,
3552        Flags: DWORD,
3553        PropertyRegDataType: PDWORD,
3554        PropertyBuffer: PBYTE,
3555        PropertyBufferSize: DWORD,
3556        RequiredSize: PDWORD,
3557    ) -> BOOL;
3558}
3559pub const SCWMI_CLOBBER_SECURITY: DWORD = 0x00000001;
3560extern "system" {
3561    pub fn SetupConfigureWmiFromInfSectionA(
3562        InfHandle: HINF,
3563        SectionName: PCSTR,
3564        Flags: DWORD,
3565    ) -> BOOL;
3566    pub fn SetupConfigureWmiFromInfSectionW(
3567        InfHandle: HINF,
3568        SectionName: PCWSTR,
3569        Flags: DWORD,
3570    ) -> BOOL;
3571}