Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6847 lines
195 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. setupapi.h
  5. Abstract:
  6. Public header file for Windows NT Setup and Device Installer services Dll.
  7. --*/
  8. #ifndef _INC_SETUPAPI
  9. #define _INC_SETUPAPI
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. //
  14. // Define API decoration for direct importing of DLL references.
  15. //
  16. #if !defined(_SETUPAPI_)
  17. #define WINSETUPAPI DECLSPEC_IMPORT
  18. #else
  19. #define WINSETUPAPI
  20. #endif
  21. //
  22. // determine version of setupapi based on _WIN32_WINDOWS and _WIN32_WINNT
  23. //
  24. // NT4 version of setupapi (0x0400) is earliest, and installed onto Win95 by IE.
  25. // Win2k version of setupapi (0x0500) also shipped in WinME
  26. // we'll use "0x0410" to indicate version of setupapi shipped with Win98
  27. //
  28. #ifndef _SETUPAPI_VER
  29. #if defined(_WIN32_WINNT) && (!defined(_WIN32_WINDOWS) || (_WIN32_WINNT < _WIN32_WINDOWS))
  30. #define _SETUPAPI_VER _WIN32_WINNT // SetupAPI version follows Windows NT version
  31. #elif defined(_WIN32_WINDOWS)
  32. #if _WIN32_WINDOWS >= 0x0490
  33. #define _SETUPAPI_VER 0x0500 // WinME uses same version of SetupAPI as Win2k
  34. #elif _WIN32_WINDOWS >= 0x0410
  35. #define _SETUPAPI_VER 0x0410 // Indicates version of SetupAPI shipped with Win98
  36. #else
  37. #define _SETUPAPI_VER 0x0400 // Earliest SetupAPI version
  38. #endif // _WIN32_WINDOWS
  39. #else // _WIN32_WINNT/_WIN32_WINDOWS
  40. #define _SETUPAPI_VER 0x0501
  41. #endif // _WIN32_WINNT/_WIN32_WINDOWS
  42. #endif // !_SETUPAPI_VER
  43. #ifndef __LPGUID_DEFINED__
  44. #define __LPGUID_DEFINED__
  45. typedef GUID *LPGUID;
  46. #endif
  47. //
  48. // Include commctrl.h for our use of HIMAGELIST and wizard support.
  49. //
  50. #include <commctrl.h>
  51. #ifdef _WIN64
  52. #include <pshpack8.h> // Assume 8-byte (64-bit) packing throughout
  53. #else
  54. #include <pshpack1.h> // Assume byte packing throughout (32-bit processor)
  55. #endif
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. //
  60. // Define maximum string length constants
  61. //
  62. #define LINE_LEN 256 // Windows 9x-compatible maximum for
  63. // displayable strings coming from a
  64. // device INF.
  65. #define MAX_INF_STRING_LENGTH 4096 // Actual maximum size of an INF string
  66. // (including string substitutions).
  67. #define MAX_INF_SECTION_NAME_LENGTH 255 // For Windows 9x compatibility, INF
  68. // section names should be constrained
  69. // to 32 characters.
  70. #define MAX_TITLE_LEN 60
  71. #define MAX_INSTRUCTION_LEN 256
  72. #define MAX_LABEL_LEN 30
  73. #define MAX_SERVICE_NAME_LEN 256
  74. #define MAX_SUBTITLE_LEN 256
  75. //
  76. // Define maximum length of a machine name in the format expected by ConfigMgr32
  77. // CM_Connect_Machine (i.e., "\\\\MachineName\0").
  78. //
  79. #define SP_MAX_MACHINENAME_LENGTH (MAX_PATH + 3)
  80. //
  81. // Define type for reference to loaded inf file
  82. //
  83. typedef PVOID HINF;
  84. //
  85. // Inf context structure. Applications must not interpret or
  86. // overwrite values in these structures.
  87. //
  88. typedef struct _INFCONTEXT {
  89. PVOID Inf;
  90. PVOID CurrentInf;
  91. UINT Section;
  92. UINT Line;
  93. } INFCONTEXT, *PINFCONTEXT;
  94. //
  95. // Inf file information structure.
  96. //
  97. typedef struct _SP_INF_INFORMATION {
  98. DWORD InfStyle;
  99. DWORD InfCount;
  100. BYTE VersionData[ANYSIZE_ARRAY];
  101. } SP_INF_INFORMATION, *PSP_INF_INFORMATION;
  102. //
  103. // Define structure for passing alternate platform info into
  104. // SetupSetFileQueueAlternatePlatform and SetupQueryInfOriginalFileInformation.
  105. //
  106. typedef struct _SP_ALTPLATFORM_INFO_V2 {
  107. DWORD cbSize;
  108. //
  109. // platform to use (VER_PLATFORM_WIN32_WINDOWS or VER_PLATFORM_WIN32_NT)
  110. //
  111. DWORD Platform;
  112. //
  113. // major and minor version numbers to use
  114. //
  115. DWORD MajorVersion;
  116. DWORD MinorVersion;
  117. //
  118. // processor architecture to use (PROCESSOR_ARCHITECTURE_INTEL,
  119. // PROCESSOR_ARCHITECTURE_AMD64, or PROCESSOR_ARCHITECTURE_IA64.
  120. //
  121. WORD ProcessorArchitecture;
  122. union {
  123. WORD Reserved; // for compatibility with V1 structure
  124. WORD Flags; // indicates validity of non V1 fields
  125. };
  126. //
  127. // specify SP_ALTPLATFORM_FLAGS_VERSION_RANGE in Flags
  128. // to use FirstValidatedMajorVersion and FirstValidatedMinorVersion
  129. //
  130. // Major and minor versions of the oldest previous OS for which this
  131. // package's digital signature may be considered valid. For example, say
  132. // the alternate platform is VER_PLATFORM_WIN32_NT, version 5.1. However,
  133. // it is wished that driver packages signed with a 5.0 osattr also be
  134. // considered valid. In this case, you'd have a MajorVersion/MinorVersion
  135. // of 5.1, and a FirstValidatedMajorVersion/FirstValidatedMinorVersion of
  136. // 5.0. To validate packages signed for any previous OS release, specify
  137. // 0 for these fields. To only validate against the target alternate
  138. // platform, specify the same values as those in the MajorVersion and
  139. // MinorVersion fields.
  140. //
  141. DWORD FirstValidatedMajorVersion;
  142. DWORD FirstValidatedMinorVersion;
  143. } SP_ALTPLATFORM_INFO_V2, *PSP_ALTPLATFORM_INFO_V2;
  144. typedef struct _SP_ALTPLATFORM_INFO_V1 {
  145. DWORD cbSize;
  146. //
  147. // platform to use (VER_PLATFORM_WIN32_WINDOWS or VER_PLATFORM_WIN32_NT)
  148. //
  149. DWORD Platform;
  150. //
  151. // major and minor version numbers to use
  152. //
  153. DWORD MajorVersion;
  154. DWORD MinorVersion;
  155. //
  156. // processor architecture to use (PROCESSOR_ARCHITECTURE_INTEL,
  157. // PROCESSOR_ARCHITECTURE_AMD64, or PROCESSOR_ARCHITECTURE_IA64.
  158. //
  159. WORD ProcessorArchitecture;
  160. WORD Reserved; // must be zero.
  161. } SP_ALTPLATFORM_INFO_V1, *PSP_ALTPLATFORM_INFO_V1;
  162. #if USE_SP_ALTPLATFORM_INFO_V1 || (_SETUPAPI_VER < 0x0501) // use version 1 altplatform info data structure
  163. typedef SP_ALTPLATFORM_INFO_V1 SP_ALTPLATFORM_INFO;
  164. typedef PSP_ALTPLATFORM_INFO_V1 PSP_ALTPLATFORM_INFO;
  165. #else // use version 2 altplatform info data structure
  166. typedef SP_ALTPLATFORM_INFO_V2 SP_ALTPLATFORM_INFO;
  167. typedef PSP_ALTPLATFORM_INFO_V2 PSP_ALTPLATFORM_INFO;
  168. //
  169. // the following flags are available to SP_ALTPLATFORM_INFO_V2
  170. //
  171. #define SP_ALTPLATFORM_FLAGS_VERSION_RANGE (0x0001) // FirstValidatedMajor/MinorVersion
  172. #endif // use current version of altplatform info data structure
  173. //
  174. // Define structure that is filled in by SetupQueryInfOriginalFileInformation
  175. // to indicate the INF's original name and the original name of the (potentially
  176. // platform-specific) catalog file specified by that INF.
  177. //
  178. typedef struct _SP_ORIGINAL_FILE_INFO_A {
  179. DWORD cbSize;
  180. CHAR OriginalInfName[MAX_PATH];
  181. CHAR OriginalCatalogName[MAX_PATH];
  182. } SP_ORIGINAL_FILE_INFO_A, *PSP_ORIGINAL_FILE_INFO_A;
  183. typedef struct _SP_ORIGINAL_FILE_INFO_W {
  184. DWORD cbSize;
  185. WCHAR OriginalInfName[MAX_PATH];
  186. WCHAR OriginalCatalogName[MAX_PATH];
  187. } SP_ORIGINAL_FILE_INFO_W, *PSP_ORIGINAL_FILE_INFO_W;
  188. #ifdef UNICODE
  189. typedef SP_ORIGINAL_FILE_INFO_W SP_ORIGINAL_FILE_INFO;
  190. typedef PSP_ORIGINAL_FILE_INFO_W PSP_ORIGINAL_FILE_INFO;
  191. #else
  192. typedef SP_ORIGINAL_FILE_INFO_A SP_ORIGINAL_FILE_INFO;
  193. typedef PSP_ORIGINAL_FILE_INFO_A PSP_ORIGINAL_FILE_INFO;
  194. #endif
  195. //
  196. // SP_INF_INFORMATION.InfStyle values
  197. //
  198. #define INF_STYLE_NONE 0x00000000 // unrecognized or non-existent
  199. #define INF_STYLE_OLDNT 0x00000001 // winnt 3.x
  200. #define INF_STYLE_WIN4 0x00000002 // Win95
  201. //
  202. // Additional InfStyle flags that may be specified when calling SetupOpenInfFile.
  203. //
  204. //
  205. #define INF_STYLE_CACHE_ENABLE 0x00000010 // always cache INF, even outside of %windir%\Inf
  206. #define INF_STYLE_CACHE_DISABLE 0x00000020 // delete cached INF information
  207. #if _SETUPAPI_VER >= 0x0502
  208. #define INF_STYLE_CACHE_IGNORE 0x00000040 // ignore any cached INF information
  209. #endif
  210. //
  211. // Target directory specs.
  212. //
  213. #define DIRID_ABSOLUTE -1 // real 32-bit -1
  214. #define DIRID_ABSOLUTE_16BIT 0xffff // 16-bit -1 for compat w/setupx
  215. #define DIRID_NULL 0
  216. #define DIRID_SRCPATH 1
  217. #define DIRID_WINDOWS 10
  218. #define DIRID_SYSTEM 11 // system32
  219. #define DIRID_DRIVERS 12
  220. #define DIRID_IOSUBSYS DIRID_DRIVERS
  221. #define DIRID_INF 17
  222. #define DIRID_HELP 18
  223. #define DIRID_FONTS 20
  224. #define DIRID_VIEWERS 21
  225. #define DIRID_COLOR 23
  226. #define DIRID_APPS 24
  227. #define DIRID_SHARED 25
  228. #define DIRID_BOOT 30
  229. #define DIRID_SYSTEM16 50
  230. #define DIRID_SPOOL 51
  231. #define DIRID_SPOOLDRIVERS 52
  232. #define DIRID_USERPROFILE 53
  233. #define DIRID_LOADER 54
  234. #define DIRID_PRINTPROCESSOR 55
  235. #define DIRID_DEFAULT DIRID_SYSTEM
  236. //
  237. // The following DIRIDs are for commonly-used shell "special folders". The
  238. // complete list of such folders is contained in shlobj.h. In that headerfile,
  239. // each folder is assigned a CSIDL_* value. The DIRID values below are created
  240. // by taking the CSIDL value in shlobj.h and OR'ing it with 0x4000. Thus, if
  241. // an INF needs to reference other special folders not defined below, it may
  242. // generate one using the above mechanism, and setupapi will automatically deal
  243. // with it and use the corresponding shell's path where appropriate. (Remember
  244. // that DIRIDs must be specified in decimal, not hex, in an INF when used for
  245. // string substitution.)
  246. //
  247. #define DIRID_COMMON_STARTMENU 16406 // All Users\Start Menu
  248. #define DIRID_COMMON_PROGRAMS 16407 // All Users\Start Menu\Programs
  249. #define DIRID_COMMON_STARTUP 16408 // All Users\Start Menu\Programs\Startup
  250. #define DIRID_COMMON_DESKTOPDIRECTORY 16409 // All Users\Desktop
  251. #define DIRID_COMMON_FAVORITES 16415 // All Users\Favorites
  252. #define DIRID_COMMON_APPDATA 16419 // All Users\Application Data
  253. #define DIRID_PROGRAM_FILES 16422 // Program Files
  254. #define DIRID_SYSTEM_X86 16425 // system32 on RISC
  255. #define DIRID_PROGRAM_FILES_X86 16426 // Program Files on RISC
  256. #define DIRID_PROGRAM_FILES_COMMON 16427 // Program Files\Common
  257. #define DIRID_PROGRAM_FILES_COMMONX86 16428 // x86 Program Files\Common on RISC
  258. #define DIRID_COMMON_TEMPLATES 16429 // All Users\Templates
  259. #define DIRID_COMMON_DOCUMENTS 16430 // All Users\Documents
  260. //
  261. // First user-definable dirid. See SetupSetDirectoryId().
  262. //
  263. #define DIRID_USER 0x8000
  264. //
  265. // Setup callback notification routine type
  266. //
  267. typedef UINT (CALLBACK* PSP_FILE_CALLBACK_A)(
  268. IN PVOID Context,
  269. IN UINT Notification,
  270. IN UINT_PTR Param1,
  271. IN UINT_PTR Param2
  272. );
  273. typedef UINT (CALLBACK* PSP_FILE_CALLBACK_W)(
  274. IN PVOID Context,
  275. IN UINT Notification,
  276. IN UINT_PTR Param1,
  277. IN UINT_PTR Param2
  278. );
  279. #ifdef UNICODE
  280. #define PSP_FILE_CALLBACK PSP_FILE_CALLBACK_W
  281. #else
  282. #define PSP_FILE_CALLBACK PSP_FILE_CALLBACK_A
  283. #endif
  284. //
  285. // Operation/queue start/end notification. These are ordinal values.
  286. //
  287. #define SPFILENOTIFY_STARTQUEUE 0x00000001
  288. #define SPFILENOTIFY_ENDQUEUE 0x00000002
  289. #define SPFILENOTIFY_STARTSUBQUEUE 0x00000003
  290. #define SPFILENOTIFY_ENDSUBQUEUE 0x00000004
  291. #define SPFILENOTIFY_STARTDELETE 0x00000005
  292. #define SPFILENOTIFY_ENDDELETE 0x00000006
  293. #define SPFILENOTIFY_DELETEERROR 0x00000007
  294. #define SPFILENOTIFY_STARTRENAME 0x00000008
  295. #define SPFILENOTIFY_ENDRENAME 0x00000009
  296. #define SPFILENOTIFY_RENAMEERROR 0x0000000a
  297. #define SPFILENOTIFY_STARTCOPY 0x0000000b
  298. #define SPFILENOTIFY_ENDCOPY 0x0000000c
  299. #define SPFILENOTIFY_COPYERROR 0x0000000d
  300. #define SPFILENOTIFY_NEEDMEDIA 0x0000000e
  301. #define SPFILENOTIFY_QUEUESCAN 0x0000000f
  302. //
  303. // These are used with SetupIterateCabinet().
  304. //
  305. #define SPFILENOTIFY_CABINETINFO 0x00000010
  306. #define SPFILENOTIFY_FILEINCABINET 0x00000011
  307. #define SPFILENOTIFY_NEEDNEWCABINET 0x00000012
  308. #define SPFILENOTIFY_FILEEXTRACTED 0x00000013
  309. #define SPFILENOTIFY_FILEOPDELAYED 0x00000014
  310. //
  311. // These are used for backup operations
  312. //
  313. #define SPFILENOTIFY_STARTBACKUP 0x00000015
  314. #define SPFILENOTIFY_BACKUPERROR 0x00000016
  315. #define SPFILENOTIFY_ENDBACKUP 0x00000017
  316. //
  317. // Extended notification for SetupScanFileQueue(Flags=SPQ_SCAN_USE_CALLBACKEX)
  318. //
  319. #define SPFILENOTIFY_QUEUESCAN_EX 0x00000018
  320. #define SPFILENOTIFY_STARTREGISTRATION 0x00000019
  321. #define SPFILENOTIFY_ENDREGISTRATION 0x00000020
  322. #if _SETUPAPI_VER >= 0x0501
  323. //
  324. // Extended notification for SetupScanFileQueue(Flags=SPQ_SCAN_USE_CALLBACK_SIGNERINFO)
  325. //
  326. #define SPFILENOTIFY_QUEUESCAN_SIGNERINFO 0x00000040
  327. #endif
  328. //
  329. // Copy notification. These are bit flags that may be combined.
  330. //
  331. #define SPFILENOTIFY_LANGMISMATCH 0x00010000
  332. #define SPFILENOTIFY_TARGETEXISTS 0x00020000
  333. #define SPFILENOTIFY_TARGETNEWER 0x00040000
  334. //
  335. // File operation codes and callback outcomes.
  336. //
  337. #define FILEOP_COPY 0
  338. #define FILEOP_RENAME 1
  339. #define FILEOP_DELETE 2
  340. #define FILEOP_BACKUP 3
  341. #define FILEOP_ABORT 0
  342. #define FILEOP_DOIT 1
  343. #define FILEOP_SKIP 2
  344. #define FILEOP_RETRY FILEOP_DOIT
  345. #define FILEOP_NEWPATH 4
  346. //
  347. // Flags in inf copy sections
  348. //
  349. #define COPYFLG_WARN_IF_SKIP 0x00000001 // warn if user tries to skip file
  350. #define COPYFLG_NOSKIP 0x00000002 // disallow skipping this file
  351. #define COPYFLG_NOVERSIONCHECK 0x00000004 // ignore versions and overwrite target
  352. #define COPYFLG_FORCE_FILE_IN_USE 0x00000008 // force file-in-use behavior
  353. #define COPYFLG_NO_OVERWRITE 0x00000010 // do not copy if file exists on target
  354. #define COPYFLG_NO_VERSION_DIALOG 0x00000020 // do not copy if target is newer
  355. #define COPYFLG_OVERWRITE_OLDER_ONLY 0x00000040 // leave target alone if version same as source
  356. #define COPYFLG_REPLACEONLY 0x00000400 // copy only if file exists on target
  357. #define COPYFLG_NODECOMP 0x00000800 // don't attempt to decompress file; copy as-is
  358. #define COPYFLG_REPLACE_BOOT_FILE 0x00001000 // file must be present upon reboot (i.e., it's
  359. // needed by the loader); this flag implies a reboot
  360. #define COPYFLG_NOPRUNE 0x00002000 // never prune this file
  361. //
  362. // Flags in inf delete sections
  363. // New flags go in high word
  364. //
  365. #define DELFLG_IN_USE 0x00000001 // queue in-use file for delete
  366. #define DELFLG_IN_USE1 0x00010000 // high-word version of DELFLG_IN_USE
  367. //
  368. // Source and file paths. Used when notifying queue callback
  369. // of SPFILENOTIFY_STARTxxx, SPFILENOTIFY_ENDxxx, and SPFILENOTIFY_xxxERROR.
  370. //
  371. typedef struct _FILEPATHS_A {
  372. PCSTR Target;
  373. PCSTR Source; // not used for delete operations
  374. UINT Win32Error;
  375. DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
  376. } FILEPATHS_A, *PFILEPATHS_A;
  377. typedef struct _FILEPATHS_W {
  378. PCWSTR Target;
  379. PCWSTR Source; // not used for delete operations
  380. UINT Win32Error;
  381. DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
  382. } FILEPATHS_W, *PFILEPATHS_W;
  383. #ifdef UNICODE
  384. typedef FILEPATHS_W FILEPATHS;
  385. typedef PFILEPATHS_W PFILEPATHS;
  386. #else
  387. typedef FILEPATHS_A FILEPATHS;
  388. typedef PFILEPATHS_A PFILEPATHS;
  389. #endif
  390. #if _SETUPAPI_VER >= 0x0501
  391. typedef struct _FILEPATHS_SIGNERINFO_A {
  392. PCSTR Target;
  393. PCSTR Source; // not used for delete operations
  394. UINT Win32Error;
  395. DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
  396. PCSTR DigitalSigner;
  397. PCSTR Version;
  398. PCSTR CatalogFile;
  399. } FILEPATHS_SIGNERINFO_A, *PFILEPATHS_SIGNERINFO_A;
  400. typedef struct _FILEPATHS_SIGNERINFO_W {
  401. PCWSTR Target;
  402. PCWSTR Source; // not used for delete operations
  403. UINT Win32Error;
  404. DWORD Flags; // such as SP_COPY_NOSKIP for copy errors
  405. PCWSTR DigitalSigner;
  406. PCWSTR Version;
  407. PCWSTR CatalogFile;
  408. } FILEPATHS_SIGNERINFO_W, *PFILEPATHS_SIGNERINFO_W;
  409. #ifdef UNICODE
  410. typedef FILEPATHS_SIGNERINFO_W FILEPATHS_SIGNERINFO;
  411. typedef PFILEPATHS_SIGNERINFO_W PFILEPATHS_SIGNERINFO;
  412. #else
  413. typedef FILEPATHS_SIGNERINFO_A FILEPATHS_SIGNERINFO;
  414. typedef PFILEPATHS_SIGNERINFO_A PFILEPATHS_SIGNERINFO;
  415. #endif
  416. #endif // _SETUPAPI_VER >= 0x0501
  417. //
  418. // Structure used with SPFILENOTIFY_NEEDMEDIA
  419. //
  420. typedef struct _SOURCE_MEDIA_A {
  421. PCSTR Reserved;
  422. PCSTR Tagfile; // may be NULL
  423. PCSTR Description;
  424. //
  425. // Pathname part and filename part of source file
  426. // that caused us to need the media.
  427. //
  428. PCSTR SourcePath;
  429. PCSTR SourceFile;
  430. DWORD Flags; // subset of SP_COPY_xxx
  431. } SOURCE_MEDIA_A, *PSOURCE_MEDIA_A;
  432. typedef struct _SOURCE_MEDIA_W {
  433. PCWSTR Reserved;
  434. PCWSTR Tagfile; // may be NULL
  435. PCWSTR Description;
  436. //
  437. // Pathname part and filename part of source file
  438. // that caused us to need the media.
  439. //
  440. PCWSTR SourcePath;
  441. PCWSTR SourceFile;
  442. DWORD Flags; // subset of SP_COPY_xxx
  443. } SOURCE_MEDIA_W, *PSOURCE_MEDIA_W;
  444. #ifdef UNICODE
  445. typedef SOURCE_MEDIA_W SOURCE_MEDIA;
  446. typedef PSOURCE_MEDIA_W PSOURCE_MEDIA;
  447. #else
  448. typedef SOURCE_MEDIA_A SOURCE_MEDIA;
  449. typedef PSOURCE_MEDIA_A PSOURCE_MEDIA;
  450. #endif
  451. //
  452. // Structure used with SPFILENOTIFY_CABINETINFO and
  453. // SPFILENOTIFY_NEEDNEWCABINET
  454. //
  455. typedef struct _CABINET_INFO_A {
  456. PCSTR CabinetPath;
  457. PCSTR CabinetFile;
  458. PCSTR DiskName;
  459. USHORT SetId;
  460. USHORT CabinetNumber;
  461. } CABINET_INFO_A, *PCABINET_INFO_A;
  462. typedef struct _CABINET_INFO_W {
  463. PCWSTR CabinetPath;
  464. PCWSTR CabinetFile;
  465. PCWSTR DiskName;
  466. USHORT SetId;
  467. USHORT CabinetNumber;
  468. } CABINET_INFO_W, *PCABINET_INFO_W;
  469. #ifdef UNICODE
  470. typedef CABINET_INFO_W CABINET_INFO;
  471. typedef PCABINET_INFO_W PCABINET_INFO;
  472. #else
  473. typedef CABINET_INFO_A CABINET_INFO;
  474. typedef PCABINET_INFO_A PCABINET_INFO;
  475. #endif
  476. //
  477. // Structure used with SPFILENOTIFY_FILEINCABINET
  478. //
  479. typedef struct _FILE_IN_CABINET_INFO_A {
  480. PCSTR NameInCabinet;
  481. DWORD FileSize;
  482. DWORD Win32Error;
  483. WORD DosDate;
  484. WORD DosTime;
  485. WORD DosAttribs;
  486. CHAR FullTargetName[MAX_PATH];
  487. } FILE_IN_CABINET_INFO_A, *PFILE_IN_CABINET_INFO_A;
  488. typedef struct _FILE_IN_CABINET_INFO_W {
  489. PCWSTR NameInCabinet;
  490. DWORD FileSize;
  491. DWORD Win32Error;
  492. WORD DosDate;
  493. WORD DosTime;
  494. WORD DosAttribs;
  495. WCHAR FullTargetName[MAX_PATH];
  496. } FILE_IN_CABINET_INFO_W, *PFILE_IN_CABINET_INFO_W;
  497. #ifdef UNICODE
  498. typedef FILE_IN_CABINET_INFO_W FILE_IN_CABINET_INFO;
  499. typedef PFILE_IN_CABINET_INFO_W PFILE_IN_CABINET_INFO;
  500. #else
  501. typedef FILE_IN_CABINET_INFO_A FILE_IN_CABINET_INFO;
  502. typedef PFILE_IN_CABINET_INFO_A PFILE_IN_CABINET_INFO;
  503. #endif
  504. //
  505. // Structure used for SPFILENOTIFY_***REGISTRATION
  506. // callback
  507. //
  508. typedef struct _SP_REGISTER_CONTROL_STATUSA {
  509. DWORD cbSize;
  510. PCSTR FileName;
  511. DWORD Win32Error;
  512. DWORD FailureCode;
  513. } SP_REGISTER_CONTROL_STATUSA, *PSP_REGISTER_CONTROL_STATUSA;
  514. typedef struct _SP_REGISTER_CONTROL_STATUSW {
  515. DWORD cbSize;
  516. PCWSTR FileName;
  517. DWORD Win32Error;
  518. DWORD FailureCode;
  519. } SP_REGISTER_CONTROL_STATUSW, *PSP_REGISTER_CONTROL_STATUSW;
  520. #ifdef UNICODE
  521. typedef SP_REGISTER_CONTROL_STATUSW SP_REGISTER_CONTROL_STATUS;
  522. typedef PSP_REGISTER_CONTROL_STATUSW PSP_REGISTER_CONTROL_STATUS;
  523. #else
  524. typedef SP_REGISTER_CONTROL_STATUSA SP_REGISTER_CONTROL_STATUS;
  525. typedef PSP_REGISTER_CONTROL_STATUSA PSP_REGISTER_CONTROL_STATUS;
  526. #endif
  527. //
  528. // valid values for SP_REGISTER_CONTROL_STATUS.FailureCode field
  529. //
  530. #define SPREG_SUCCESS 0x00000000
  531. #define SPREG_LOADLIBRARY 0x00000001
  532. #define SPREG_GETPROCADDR 0x00000002
  533. #define SPREG_REGSVR 0x00000003
  534. #define SPREG_DLLINSTALL 0x00000004
  535. #define SPREG_TIMEOUT 0x00000005
  536. #define SPREG_UNKNOWN 0xFFFFFFFF
  537. //
  538. // Define type for setup file queue
  539. //
  540. typedef PVOID HSPFILEQ;
  541. //
  542. // Structure used with SetupQueueCopyIndirect
  543. //
  544. typedef struct _SP_FILE_COPY_PARAMS_A {
  545. DWORD cbSize;
  546. HSPFILEQ QueueHandle;
  547. PCSTR SourceRootPath; OPTIONAL
  548. PCSTR SourcePath; OPTIONAL
  549. PCSTR SourceFilename;
  550. PCSTR SourceDescription; OPTIONAL
  551. PCSTR SourceTagfile; OPTIONAL
  552. PCSTR TargetDirectory;
  553. PCSTR TargetFilename; OPTIONAL
  554. DWORD CopyStyle;
  555. HINF LayoutInf; OPTIONAL
  556. PCSTR SecurityDescriptor; OPTIONAL
  557. } SP_FILE_COPY_PARAMS_A, *PSP_FILE_COPY_PARAMS_A;
  558. typedef struct _SP_FILE_COPY_PARAMS_W {
  559. DWORD cbSize;
  560. HSPFILEQ QueueHandle;
  561. PCWSTR SourceRootPath; OPTIONAL
  562. PCWSTR SourcePath; OPTIONAL
  563. PCWSTR SourceFilename;
  564. PCWSTR SourceDescription; OPTIONAL
  565. PCWSTR SourceTagfile; OPTIONAL
  566. PCWSTR TargetDirectory;
  567. PCWSTR TargetFilename; OPTIONAL
  568. DWORD CopyStyle;
  569. HINF LayoutInf; OPTIONAL
  570. PCWSTR SecurityDescriptor; OPTIONAL
  571. } SP_FILE_COPY_PARAMS_W, *PSP_FILE_COPY_PARAMS_W;
  572. #ifdef UNICODE
  573. typedef SP_FILE_COPY_PARAMS_W SP_FILE_COPY_PARAMS;
  574. typedef PSP_FILE_COPY_PARAMS_W PSP_FILE_COPY_PARAMS;
  575. #else
  576. typedef SP_FILE_COPY_PARAMS_A SP_FILE_COPY_PARAMS;
  577. typedef PSP_FILE_COPY_PARAMS_A PSP_FILE_COPY_PARAMS;
  578. #endif
  579. //
  580. // Define type for setup disk space list
  581. //
  582. typedef PVOID HDSKSPC;
  583. //
  584. // Define type for reference to device information set
  585. //
  586. typedef PVOID HDEVINFO;
  587. //
  588. // Device information structure (references a device instance
  589. // that is a member of a device information set)
  590. //
  591. typedef struct _SP_DEVINFO_DATA {
  592. DWORD cbSize;
  593. GUID ClassGuid;
  594. DWORD DevInst; // DEVINST handle
  595. ULONG_PTR Reserved;
  596. } SP_DEVINFO_DATA, *PSP_DEVINFO_DATA;
  597. //
  598. // Device interface information structure (references a device
  599. // interface that is associated with the device information
  600. // element that owns it).
  601. //
  602. typedef struct _SP_DEVICE_INTERFACE_DATA {
  603. DWORD cbSize;
  604. GUID InterfaceClassGuid;
  605. DWORD Flags;
  606. ULONG_PTR Reserved;
  607. } SP_DEVICE_INTERFACE_DATA, *PSP_DEVICE_INTERFACE_DATA;
  608. //
  609. // Flags for SP_DEVICE_INTERFACE_DATA.Flags field.
  610. //
  611. #define SPINT_ACTIVE 0x00000001
  612. #define SPINT_DEFAULT 0x00000002
  613. #define SPINT_REMOVED 0x00000004
  614. //
  615. // Backward compatibility--do not use.
  616. //
  617. typedef SP_DEVICE_INTERFACE_DATA SP_INTERFACE_DEVICE_DATA;
  618. typedef PSP_DEVICE_INTERFACE_DATA PSP_INTERFACE_DEVICE_DATA;
  619. #define SPID_ACTIVE SPINT_ACTIVE
  620. #define SPID_DEFAULT SPINT_DEFAULT
  621. #define SPID_REMOVED SPINT_REMOVED
  622. typedef struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A {
  623. DWORD cbSize;
  624. CHAR DevicePath[ANYSIZE_ARRAY];
  625. } SP_DEVICE_INTERFACE_DETAIL_DATA_A, *PSP_DEVICE_INTERFACE_DETAIL_DATA_A;
  626. typedef struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W {
  627. DWORD cbSize;
  628. WCHAR DevicePath[ANYSIZE_ARRAY];
  629. } SP_DEVICE_INTERFACE_DETAIL_DATA_W, *PSP_DEVICE_INTERFACE_DETAIL_DATA_W;
  630. #ifdef UNICODE
  631. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA;
  632. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_W PSP_DEVICE_INTERFACE_DETAIL_DATA;
  633. #else
  634. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_DEVICE_INTERFACE_DETAIL_DATA;
  635. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_A PSP_DEVICE_INTERFACE_DETAIL_DATA;
  636. #endif
  637. //
  638. // Backward compatibility--do not use.
  639. //
  640. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_INTERFACE_DEVICE_DETAIL_DATA_W;
  641. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_W PSP_INTERFACE_DEVICE_DETAIL_DATA_W;
  642. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_INTERFACE_DEVICE_DETAIL_DATA_A;
  643. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_A PSP_INTERFACE_DEVICE_DETAIL_DATA_A;
  644. #ifdef UNICODE
  645. typedef SP_INTERFACE_DEVICE_DETAIL_DATA_W SP_INTERFACE_DEVICE_DETAIL_DATA;
  646. typedef PSP_INTERFACE_DEVICE_DETAIL_DATA_W PSP_INTERFACE_DEVICE_DETAIL_DATA;
  647. #else
  648. typedef SP_INTERFACE_DEVICE_DETAIL_DATA_A SP_INTERFACE_DEVICE_DETAIL_DATA;
  649. typedef PSP_INTERFACE_DEVICE_DETAIL_DATA_A PSP_INTERFACE_DEVICE_DETAIL_DATA;
  650. #endif
  651. //
  652. // Structure for detailed information on a device information set (used for
  653. // SetupDiGetDeviceInfoListDetail which supercedes the functionality of
  654. // SetupDiGetDeviceInfoListClass).
  655. //
  656. typedef struct _SP_DEVINFO_LIST_DETAIL_DATA_A {
  657. DWORD cbSize;
  658. GUID ClassGuid;
  659. HANDLE RemoteMachineHandle;
  660. CHAR RemoteMachineName[SP_MAX_MACHINENAME_LENGTH];
  661. } SP_DEVINFO_LIST_DETAIL_DATA_A, *PSP_DEVINFO_LIST_DETAIL_DATA_A;
  662. typedef struct _SP_DEVINFO_LIST_DETAIL_DATA_W {
  663. DWORD cbSize;
  664. GUID ClassGuid;
  665. HANDLE RemoteMachineHandle;
  666. WCHAR RemoteMachineName[SP_MAX_MACHINENAME_LENGTH];
  667. } SP_DEVINFO_LIST_DETAIL_DATA_W, *PSP_DEVINFO_LIST_DETAIL_DATA_W;
  668. #ifdef UNICODE
  669. typedef SP_DEVINFO_LIST_DETAIL_DATA_W SP_DEVINFO_LIST_DETAIL_DATA;
  670. typedef PSP_DEVINFO_LIST_DETAIL_DATA_W PSP_DEVINFO_LIST_DETAIL_DATA;
  671. #else
  672. typedef SP_DEVINFO_LIST_DETAIL_DATA_A SP_DEVINFO_LIST_DETAIL_DATA;
  673. typedef PSP_DEVINFO_LIST_DETAIL_DATA_A PSP_DEVINFO_LIST_DETAIL_DATA;
  674. #endif
  675. //
  676. // Class installer function codes
  677. //
  678. #define DIF_SELECTDEVICE 0x00000001
  679. #define DIF_INSTALLDEVICE 0x00000002
  680. #define DIF_ASSIGNRESOURCES 0x00000003
  681. #define DIF_PROPERTIES 0x00000004
  682. #define DIF_REMOVE 0x00000005
  683. #define DIF_FIRSTTIMESETUP 0x00000006
  684. #define DIF_FOUNDDEVICE 0x00000007
  685. #define DIF_SELECTCLASSDRIVERS 0x00000008
  686. #define DIF_VALIDATECLASSDRIVERS 0x00000009
  687. #define DIF_INSTALLCLASSDRIVERS 0x0000000A
  688. #define DIF_CALCDISKSPACE 0x0000000B
  689. #define DIF_DESTROYPRIVATEDATA 0x0000000C
  690. #define DIF_VALIDATEDRIVER 0x0000000D
  691. #define DIF_DETECT 0x0000000F
  692. #define DIF_INSTALLWIZARD 0x00000010
  693. #define DIF_DESTROYWIZARDDATA 0x00000011
  694. #define DIF_PROPERTYCHANGE 0x00000012
  695. #define DIF_ENABLECLASS 0x00000013
  696. #define DIF_DETECTVERIFY 0x00000014
  697. #define DIF_INSTALLDEVICEFILES 0x00000015
  698. #define DIF_UNREMOVE 0x00000016
  699. #define DIF_SELECTBESTCOMPATDRV 0x00000017
  700. #define DIF_ALLOW_INSTALL 0x00000018
  701. #define DIF_REGISTERDEVICE 0x00000019
  702. #define DIF_NEWDEVICEWIZARD_PRESELECT 0x0000001A
  703. #define DIF_NEWDEVICEWIZARD_SELECT 0x0000001B
  704. #define DIF_NEWDEVICEWIZARD_PREANALYZE 0x0000001C
  705. #define DIF_NEWDEVICEWIZARD_POSTANALYZE 0x0000001D
  706. #define DIF_NEWDEVICEWIZARD_FINISHINSTALL 0x0000001E
  707. #define DIF_UNUSED1 0x0000001F
  708. #define DIF_INSTALLINTERFACES 0x00000020
  709. #define DIF_DETECTCANCEL 0x00000021
  710. #define DIF_REGISTER_COINSTALLERS 0x00000022
  711. #define DIF_ADDPROPERTYPAGE_ADVANCED 0x00000023
  712. #define DIF_ADDPROPERTYPAGE_BASIC 0x00000024
  713. #define DIF_RESERVED1 0x00000025
  714. #define DIF_TROUBLESHOOTER 0x00000026
  715. #define DIF_POWERMESSAGEWAKE 0x00000027
  716. #define DIF_ADDREMOTEPROPERTYPAGE_ADVANCED 0x00000028
  717. #define DIF_UPDATEDRIVER_UI 0x00000029
  718. #define DIF_RESERVED2 0x00000030
  719. //
  720. // Obsoleted DIF codes (do not use)
  721. //
  722. #define DIF_MOVEDEVICE 0x0000000E
  723. typedef UINT DI_FUNCTION; // Function type for device installer
  724. //
  725. // Device installation parameters structure (associated with a
  726. // particular device information element, or globally with a device
  727. // information set)
  728. //
  729. typedef struct _SP_DEVINSTALL_PARAMS_A {
  730. DWORD cbSize;
  731. DWORD Flags;
  732. DWORD FlagsEx;
  733. HWND hwndParent;
  734. PSP_FILE_CALLBACK InstallMsgHandler;
  735. PVOID InstallMsgHandlerContext;
  736. HSPFILEQ FileQueue;
  737. ULONG_PTR ClassInstallReserved;
  738. DWORD Reserved;
  739. CHAR DriverPath[MAX_PATH];
  740. } SP_DEVINSTALL_PARAMS_A, *PSP_DEVINSTALL_PARAMS_A;
  741. typedef struct _SP_DEVINSTALL_PARAMS_W {
  742. DWORD cbSize;
  743. DWORD Flags;
  744. DWORD FlagsEx;
  745. HWND hwndParent;
  746. PSP_FILE_CALLBACK InstallMsgHandler;
  747. PVOID InstallMsgHandlerContext;
  748. HSPFILEQ FileQueue;
  749. ULONG_PTR ClassInstallReserved;
  750. DWORD Reserved;
  751. WCHAR DriverPath[MAX_PATH];
  752. } SP_DEVINSTALL_PARAMS_W, *PSP_DEVINSTALL_PARAMS_W;
  753. #ifdef UNICODE
  754. typedef SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS;
  755. typedef PSP_DEVINSTALL_PARAMS_W PSP_DEVINSTALL_PARAMS;
  756. #else
  757. typedef SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS;
  758. typedef PSP_DEVINSTALL_PARAMS_A PSP_DEVINSTALL_PARAMS;
  759. #endif
  760. //
  761. // SP_DEVINSTALL_PARAMS.Flags values
  762. //
  763. // Flags for choosing a device
  764. //
  765. #define DI_SHOWOEM 0x00000001L // support Other... button
  766. #define DI_SHOWCOMPAT 0x00000002L // show compatibility list
  767. #define DI_SHOWCLASS 0x00000004L // show class list
  768. #define DI_SHOWALL 0x00000007L // both class & compat list shown
  769. #define DI_NOVCP 0x00000008L // don't create a new copy queue--use
  770. // caller-supplied FileQueue
  771. #define DI_DIDCOMPAT 0x00000010L // Searched for compatible devices
  772. #define DI_DIDCLASS 0x00000020L // Searched for class devices
  773. #define DI_AUTOASSIGNRES 0x00000040L // No UI for resources if possible
  774. // flags returned by DiInstallDevice to indicate need to reboot/restart
  775. #define DI_NEEDRESTART 0x00000080L // Reboot required to take effect
  776. #define DI_NEEDREBOOT 0x00000100L // ""
  777. // flags for device installation
  778. #define DI_NOBROWSE 0x00000200L // no Browse... in InsertDisk
  779. // Flags set by DiBuildDriverInfoList
  780. #define DI_MULTMFGS 0x00000400L // Set if multiple manufacturers in
  781. // class driver list
  782. // Flag indicates that device is disabled
  783. #define DI_DISABLED 0x00000800L // Set if device disabled
  784. // Flags for Device/Class Properties
  785. #define DI_GENERALPAGE_ADDED 0x00001000L
  786. #define DI_RESOURCEPAGE_ADDED 0x00002000L
  787. // Flag to indicate the setting properties for this Device (or class) caused a change
  788. // so the Dev Mgr UI probably needs to be updatd.
  789. #define DI_PROPERTIES_CHANGE 0x00004000L
  790. // Flag to indicate that the sorting from the INF file should be used.
  791. #define DI_INF_IS_SORTED 0x00008000L
  792. // Flag to indicate that only the the INF specified by SP_DEVINSTALL_PARAMS.DriverPath
  793. // should be searched.
  794. #define DI_ENUMSINGLEINF 0x00010000L
  795. // Flag that prevents ConfigMgr from removing/re-enumerating devices during device
  796. // registration, installation, and deletion.
  797. #define DI_DONOTCALLCONFIGMG 0x00020000L
  798. // The following flag can be used to install a device disabled
  799. #define DI_INSTALLDISABLED 0x00040000L
  800. // Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver
  801. // list from its existing class driver list, instead of the normal INF search.
  802. #define DI_COMPAT_FROM_CLASS 0x00080000L
  803. // This flag is set if the Class Install params should be used.
  804. #define DI_CLASSINSTALLPARAMS 0x00100000L
  805. // This flag is set if the caller of DiCallClassInstaller does NOT
  806. // want the internal default action performed if the Class installer
  807. // returns ERROR_DI_DO_DEFAULT.
  808. #define DI_NODI_DEFAULTACTION 0x00200000L
  809. // The setupx flag, DI_NOSYNCPROCESSING (0x00400000L) is not support in the Setup APIs.
  810. // flags for device installation
  811. #define DI_QUIETINSTALL 0x00800000L // don't confuse the user with
  812. // questions or excess info
  813. #define DI_NOFILECOPY 0x01000000L // No file Copy necessary
  814. #define DI_FORCECOPY 0x02000000L // Force files to be copied from install path
  815. #define DI_DRIVERPAGE_ADDED 0x04000000L // Prop provider added Driver page.
  816. #define DI_USECI_SELECTSTRINGS 0x08000000L // Use Class Installer Provided strings in the Select Device Dlg
  817. #define DI_OVERRIDE_INFFLAGS 0x10000000L // Override INF flags
  818. #define DI_PROPS_NOCHANGEUSAGE 0x20000000L // No Enable/Disable in General Props
  819. #define DI_NOSELECTICONS 0x40000000L // No small icons in select device dialogs
  820. #define DI_NOWRITE_IDS 0x80000000L // Don't write HW & Compat IDs on install
  821. //
  822. // SP_DEVINSTALL_PARAMS.FlagsEx values
  823. //
  824. #define DI_FLAGSEX_USEOLDINFSEARCH 0x00000001L // Inf Search functions should not use Index Search
  825. #define DI_FLAGSEX_RESERVED2 0x00000002L // DI_FLAGSEX_AUTOSELECTRANK0 is obsolete
  826. #define DI_FLAGSEX_CI_FAILED 0x00000004L // Failed to Load/Call class installer
  827. #define DI_FLAGSEX_DIDINFOLIST 0x00000010L // Did the Class Info List
  828. #define DI_FLAGSEX_DIDCOMPATINFO 0x00000020L // Did the Compat Info List
  829. #define DI_FLAGSEX_FILTERCLASSES 0x00000040L
  830. #define DI_FLAGSEX_SETFAILEDINSTALL 0x00000080L
  831. #define DI_FLAGSEX_DEVICECHANGE 0x00000100L
  832. #define DI_FLAGSEX_ALWAYSWRITEIDS 0x00000200L
  833. #define DI_FLAGSEX_PROPCHANGE_PENDING 0x00000400L // One or more device property sheets have had changes made
  834. // to them, and need to have a DIF_PROPERTYCHANGE occur.
  835. #define DI_FLAGSEX_ALLOWEXCLUDEDDRVS 0x00000800L
  836. #define DI_FLAGSEX_NOUIONQUERYREMOVE 0x00001000L
  837. #define DI_FLAGSEX_USECLASSFORCOMPAT 0x00002000L // Use the device's class when building compat drv list.
  838. // (Ignored if DI_COMPAT_FROM_CLASS flag is specified.)
  839. #define DI_FLAGSEX_RESERVED3 0x00004000L
  840. #define DI_FLAGSEX_NO_DRVREG_MODIFY 0x00008000L // Don't run AddReg and DelReg for device's software (driver) key.
  841. #define DI_FLAGSEX_IN_SYSTEM_SETUP 0x00010000L // Installation is occurring during initial system setup.
  842. #define DI_FLAGSEX_INET_DRIVER 0x00020000L // Driver came from Windows Update
  843. #define DI_FLAGSEX_APPENDDRIVERLIST 0x00040000L // Cause SetupDiBuildDriverInfoList to append
  844. // a new driver list to an existing list.
  845. #define DI_FLAGSEX_PREINSTALLBACKUP 0x00080000L // backup all files required by old inf before install
  846. #define DI_FLAGSEX_BACKUPONREPLACE 0x00100000L // backup files required by old inf as they are replaced
  847. #define DI_FLAGSEX_DRIVERLIST_FROM_URL 0x00200000L // build driver list from INF(s) retrieved from URL specified
  848. // in SP_DEVINSTALL_PARAMS.DriverPath (empty string means
  849. // Windows Update website)
  850. #define DI_FLAGSEX_RESERVED1 0x00400000L
  851. #define DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS 0x00800000L // Don't include old Internet drivers when building
  852. // a driver list.
  853. #define DI_FLAGSEX_POWERPAGE_ADDED 0x01000000L // class installer added their own power page
  854. #if _SETUPAPI_VER >= 0x0501
  855. #define DI_FLAGSEX_FILTERSIMILARDRIVERS 0x02000000L // only include similar drivers in class list
  856. #define DI_FLAGSEX_INSTALLEDDRIVER 0x04000000L // only add the installed driver to the class or compat
  857. // driver list. Used in calls to SetupDiBuildDriverInfoList
  858. #define DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE 0x08000000L // Don't remove identical driver nodes from the class list
  859. #define DI_FLAGSEX_ALTPLATFORM_DRVSEARCH 0x10000000L // Build driver list based on alternate platform information
  860. // specified in associated file queue
  861. #define DI_FLAGSEX_RESTART_DEVICE_ONLY 0x20000000L // only restart the device drivers are being installed on as
  862. // opposed to restarting all devices using those drivers.
  863. #endif // _SETUPAPI_VER >= 0x0501
  864. //
  865. // Class installation parameters header. This must be the first field of any
  866. // class install parameter structure. The InstallFunction field must be set to
  867. // the function code corresponding to the structure, and the cbSize field must
  868. // be set to the size of the header structure. E.g.,
  869. //
  870. // SP_ENABLECLASS_PARAMS EnableClassParams;
  871. //
  872. // EnableClassParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
  873. // EnableClassParams.ClassInstallHeader.InstallFunction = DIF_ENABLECLASS;
  874. //
  875. typedef struct _SP_CLASSINSTALL_HEADER {
  876. DWORD cbSize;
  877. DI_FUNCTION InstallFunction;
  878. } SP_CLASSINSTALL_HEADER, *PSP_CLASSINSTALL_HEADER;
  879. //
  880. // Structure corresponding to a DIF_ENABLECLASS install function.
  881. //
  882. typedef struct _SP_ENABLECLASS_PARAMS {
  883. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  884. GUID ClassGuid;
  885. DWORD EnableMessage;
  886. } SP_ENABLECLASS_PARAMS, *PSP_ENABLECLASS_PARAMS;
  887. #define ENABLECLASS_QUERY 0
  888. #define ENABLECLASS_SUCCESS 1
  889. #define ENABLECLASS_FAILURE 2
  890. //
  891. // Values indicating a change in a device's state
  892. //
  893. #define DICS_ENABLE 0x00000001
  894. #define DICS_DISABLE 0x00000002
  895. #define DICS_PROPCHANGE 0x00000003
  896. #define DICS_START 0x00000004
  897. #define DICS_STOP 0x00000005
  898. //
  899. // Values specifying the scope of a device property change
  900. //
  901. #define DICS_FLAG_GLOBAL 0x00000001 // make change in all hardware profiles
  902. #define DICS_FLAG_CONFIGSPECIFIC 0x00000002 // make change in specified profile only
  903. #define DICS_FLAG_CONFIGGENERAL 0x00000004 // 1 or more hardware profile-specific
  904. // changes to follow.
  905. //
  906. // Structure corresponding to a DIF_PROPERTYCHANGE install function.
  907. //
  908. typedef struct _SP_PROPCHANGE_PARAMS {
  909. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  910. DWORD StateChange;
  911. DWORD Scope;
  912. DWORD HwProfile;
  913. } SP_PROPCHANGE_PARAMS, *PSP_PROPCHANGE_PARAMS;
  914. //
  915. // Structure corresponding to a DIF_REMOVE install function.
  916. //
  917. typedef struct _SP_REMOVEDEVICE_PARAMS {
  918. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  919. DWORD Scope;
  920. DWORD HwProfile;
  921. } SP_REMOVEDEVICE_PARAMS, *PSP_REMOVEDEVICE_PARAMS;
  922. #define DI_REMOVEDEVICE_GLOBAL 0x00000001
  923. #define DI_REMOVEDEVICE_CONFIGSPECIFIC 0x00000002
  924. //
  925. // Structure corresponding to a DIF_UNREMOVE install function.
  926. //
  927. typedef struct _SP_UNREMOVEDEVICE_PARAMS {
  928. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  929. DWORD Scope;
  930. DWORD HwProfile;
  931. } SP_UNREMOVEDEVICE_PARAMS, *PSP_UNREMOVEDEVICE_PARAMS;
  932. #define DI_UNREMOVEDEVICE_CONFIGSPECIFIC 0x00000002
  933. //
  934. // Structure corresponding to a DIF_SELECTDEVICE install function.
  935. //
  936. typedef struct _SP_SELECTDEVICE_PARAMS_A {
  937. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  938. CHAR Title[MAX_TITLE_LEN];
  939. CHAR Instructions[MAX_INSTRUCTION_LEN];
  940. CHAR ListLabel[MAX_LABEL_LEN];
  941. CHAR SubTitle[MAX_SUBTITLE_LEN];
  942. BYTE Reserved[2]; // DWORD size alignment
  943. } SP_SELECTDEVICE_PARAMS_A, *PSP_SELECTDEVICE_PARAMS_A;
  944. typedef struct _SP_SELECTDEVICE_PARAMS_W {
  945. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  946. WCHAR Title[MAX_TITLE_LEN];
  947. WCHAR Instructions[MAX_INSTRUCTION_LEN];
  948. WCHAR ListLabel[MAX_LABEL_LEN];
  949. WCHAR SubTitle[MAX_SUBTITLE_LEN];
  950. } SP_SELECTDEVICE_PARAMS_W, *PSP_SELECTDEVICE_PARAMS_W;
  951. #ifdef UNICODE
  952. typedef SP_SELECTDEVICE_PARAMS_W SP_SELECTDEVICE_PARAMS;
  953. typedef PSP_SELECTDEVICE_PARAMS_W PSP_SELECTDEVICE_PARAMS;
  954. #else
  955. typedef SP_SELECTDEVICE_PARAMS_A SP_SELECTDEVICE_PARAMS;
  956. typedef PSP_SELECTDEVICE_PARAMS_A PSP_SELECTDEVICE_PARAMS;
  957. #endif
  958. //
  959. // Callback routine for giving progress notification during detection
  960. //
  961. typedef BOOL (CALLBACK* PDETECT_PROGRESS_NOTIFY)(
  962. IN PVOID ProgressNotifyParam,
  963. IN DWORD DetectComplete
  964. );
  965. // where:
  966. // ProgressNotifyParam - value supplied by caller requesting detection.
  967. // DetectComplete - Percent completion, to be incremented by class
  968. // installer, as it steps thru its detection.
  969. //
  970. // Return Value - If TRUE, then detection is cancelled. Allows caller
  971. // requesting detection to stop detection asap.
  972. //
  973. //
  974. // Structure corresponding to a DIF_DETECT install function.
  975. //
  976. typedef struct _SP_DETECTDEVICE_PARAMS {
  977. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  978. PDETECT_PROGRESS_NOTIFY DetectProgressNotify;
  979. PVOID ProgressNotifyParam;
  980. } SP_DETECTDEVICE_PARAMS, *PSP_DETECTDEVICE_PARAMS;
  981. //
  982. // 'Add New Device' installation wizard structure (backward-compatibility
  983. // only--respond to DIF_NEWDEVICEWIZARD_* requests instead).
  984. //
  985. // Structure corresponding to a DIF_INSTALLWIZARD install function.
  986. // (NOTE: This structure is also applicable for DIF_DESTROYWIZARDDATA,
  987. // but DIF_INSTALLWIZARD is the associated function code in the class
  988. // installation parameter structure in both cases.)
  989. //
  990. // Define maximum number of dynamic wizard pages that can be added to
  991. // hardware install wizard.
  992. //
  993. #define MAX_INSTALLWIZARD_DYNAPAGES 20
  994. typedef struct _SP_INSTALLWIZARD_DATA {
  995. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  996. DWORD Flags;
  997. HPROPSHEETPAGE DynamicPages[MAX_INSTALLWIZARD_DYNAPAGES];
  998. DWORD NumDynamicPages;
  999. DWORD DynamicPageFlags;
  1000. DWORD PrivateFlags;
  1001. LPARAM PrivateData;
  1002. HWND hwndWizardDlg;
  1003. } SP_INSTALLWIZARD_DATA, *PSP_INSTALLWIZARD_DATA;
  1004. //
  1005. // SP_INSTALLWIZARD_DATA.Flags values
  1006. //
  1007. #define NDW_INSTALLFLAG_DIDFACTDEFS 0x00000001
  1008. #define NDW_INSTALLFLAG_HARDWAREALLREADYIN 0x00000002
  1009. #define NDW_INSTALLFLAG_NEEDRESTART DI_NEEDRESTART
  1010. #define NDW_INSTALLFLAG_NEEDREBOOT DI_NEEDREBOOT
  1011. #define NDW_INSTALLFLAG_NEEDSHUTDOWN 0x00000200
  1012. #define NDW_INSTALLFLAG_EXPRESSINTRO 0x00000400
  1013. #define NDW_INSTALLFLAG_SKIPISDEVINSTALLED 0x00000800
  1014. #define NDW_INSTALLFLAG_NODETECTEDDEVS 0x00001000
  1015. #define NDW_INSTALLFLAG_INSTALLSPECIFIC 0x00002000
  1016. #define NDW_INSTALLFLAG_SKIPCLASSLIST 0x00004000
  1017. #define NDW_INSTALLFLAG_CI_PICKED_OEM 0x00008000
  1018. #define NDW_INSTALLFLAG_PCMCIAMODE 0x00010000
  1019. #define NDW_INSTALLFLAG_PCMCIADEVICE 0x00020000
  1020. #define NDW_INSTALLFLAG_USERCANCEL 0x00040000
  1021. #define NDW_INSTALLFLAG_KNOWNCLASS 0x00080000
  1022. //
  1023. // SP_INSTALLWIZARD_DATA.DynamicPageFlags values
  1024. //
  1025. // This flag is set if a Class installer has added pages to the install wizard.
  1026. //
  1027. #define DYNAWIZ_FLAG_PAGESADDED 0x00000001
  1028. //
  1029. // Set this flag if you jump to the analyze page, and want it to
  1030. // handle conflicts for you. NOTE. You will not get control back
  1031. // in the event of a conflict if you set this flag.
  1032. //
  1033. #define DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT 0x00000008
  1034. //
  1035. // The following flags are not used by the Windows NT hardware wizard.
  1036. //
  1037. #define DYNAWIZ_FLAG_INSTALLDET_NEXT 0x00000002
  1038. #define DYNAWIZ_FLAG_INSTALLDET_PREV 0x00000004
  1039. //
  1040. // Reserve a range of wizard page resource IDs for internal use. Some of
  1041. // these IDs are for use by class installers that respond to the obsolete
  1042. // DIF_INSTALLWIZARD/DIF_DESTROYWIZARDDATA messages. These IDs are listed
  1043. // below.
  1044. //
  1045. #define MIN_IDD_DYNAWIZ_RESOURCE_ID 10000
  1046. #define MAX_IDD_DYNAWIZ_RESOURCE_ID 11000
  1047. //
  1048. // Define wizard page resource IDs to be used when adding custom pages to the
  1049. // hardware install wizard via DIF_INSTALLWIZARD. Pages marked with
  1050. // (CLASS INSTALLER PROVIDED) _must_ be supplied by the class installer if it
  1051. // responds to the DIF_INSTALLWIZARD request.
  1052. //
  1053. //
  1054. // Resource ID for the first page that the install wizard will go to after
  1055. // adding the class installer pages. (CLASS INSTALLER PROVIDED)
  1056. //
  1057. #define IDD_DYNAWIZ_FIRSTPAGE 10000
  1058. //
  1059. // Resource ID for the page that the Select Device page will go back to.
  1060. // (CLASS INSTALLER PROVIDED)
  1061. //
  1062. #define IDD_DYNAWIZ_SELECT_PREVPAGE 10001
  1063. //
  1064. // Resource ID for the page that the Select Device page will go forward to.
  1065. // (CLASS INSTALLER PROVIDED)
  1066. //
  1067. #define IDD_DYNAWIZ_SELECT_NEXTPAGE 10002
  1068. //
  1069. // Resource ID for the page that the Analyze dialog should go back to
  1070. // This will only be used in the event that there is a problem, and the user
  1071. // selects Back from the analyze proc. (CLASS INSTALLER PROVIDED)
  1072. //
  1073. #define IDD_DYNAWIZ_ANALYZE_PREVPAGE 10003
  1074. //
  1075. // Resource ID for the page that the Analyze dialog should go to if it
  1076. // continues from the analyze proc. (CLASS INSTALLER PROVIDED)
  1077. //
  1078. #define IDD_DYNAWIZ_ANALYZE_NEXTPAGE 10004
  1079. //
  1080. // Resource ID of the hardware install wizard's select device page.
  1081. // This ID can be used to go directly to the hardware install wizard's select
  1082. // device page. (This is the resource ID of the Select Device wizard page
  1083. // retrieved via SetupDiGetWizardPage when SPWPT_SELECTDEVICE is the requested
  1084. // PageType.)
  1085. //
  1086. #define IDD_DYNAWIZ_SELECTDEV_PAGE 10009
  1087. //
  1088. // Resource ID of the hardware install wizard's device analysis page.
  1089. // This ID can be use to go directly to the hardware install wizard's analysis
  1090. // page.
  1091. //
  1092. #define IDD_DYNAWIZ_ANALYZEDEV_PAGE 10010
  1093. //
  1094. // Resource ID of the hardware install wizard's install detected devices page.
  1095. // This ID can be use to go directly to the hardware install wizard's install
  1096. // detected devices page.
  1097. //
  1098. #define IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE 10011
  1099. //
  1100. // Resource ID of the hardware install wizard's select class page.
  1101. // This ID can be use to go directly to the hardware install wizard's select
  1102. // class page.
  1103. //
  1104. #define IDD_DYNAWIZ_SELECTCLASS_PAGE 10012
  1105. //
  1106. // The following class installer-provided wizard page resource IDs are not used
  1107. // by the Windows NT hardware wizard.
  1108. //
  1109. #define IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE 10006
  1110. #define IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE 10007
  1111. #define IDD_DYNAWIZ_INSTALLDETECTED_NODEVS 10008
  1112. //
  1113. // Structure corresponding to the following DIF_NEWDEVICEWIZARD_* install
  1114. // functions:
  1115. //
  1116. // DIF_NEWDEVICEWIZARD_PRESELECT
  1117. // DIF_NEWDEVICEWIZARD_SELECT
  1118. // DIF_NEWDEVICEWIZARD_PREANALYZE
  1119. // DIF_NEWDEVICEWIZARD_POSTANALYZE
  1120. // DIF_NEWDEVICEWIZARD_FINISHINSTALL
  1121. //
  1122. typedef struct _SP_NEWDEVICEWIZARD_DATA {
  1123. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  1124. DWORD Flags; // presently unused--must be zero.
  1125. HPROPSHEETPAGE DynamicPages[MAX_INSTALLWIZARD_DYNAPAGES];
  1126. DWORD NumDynamicPages;
  1127. HWND hwndWizardDlg;
  1128. } SP_NEWDEVICEWIZARD_DATA, *PSP_NEWDEVICEWIZARD_DATA;
  1129. //
  1130. // The same structure is also used for retrieval of property pages via the
  1131. // following install functions:
  1132. //
  1133. // DIF_ADDPROPERTYPAGE_ADVANCED
  1134. // DIF_ADDPROPERTYPAGE_BASIC
  1135. // DIF_ADDREMOTEPROPERTYPAGE_ADVANCED
  1136. //
  1137. typedef SP_NEWDEVICEWIZARD_DATA SP_ADDPROPERTYPAGE_DATA;
  1138. typedef PSP_NEWDEVICEWIZARD_DATA PSP_ADDPROPERTYPAGE_DATA;
  1139. //
  1140. // Structure corresponding to the DIF_TROUBLESHOOTER install function
  1141. //
  1142. typedef struct _SP_TROUBLESHOOTER_PARAMS_A {
  1143. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  1144. CHAR ChmFile[MAX_PATH];
  1145. CHAR HtmlTroubleShooter[MAX_PATH];
  1146. } SP_TROUBLESHOOTER_PARAMS_A, *PSP_TROUBLESHOOTER_PARAMS_A;
  1147. typedef struct _SP_TROUBLESHOOTER_PARAMS_W {
  1148. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  1149. WCHAR ChmFile[MAX_PATH];
  1150. WCHAR HtmlTroubleShooter[MAX_PATH];
  1151. } SP_TROUBLESHOOTER_PARAMS_W, *PSP_TROUBLESHOOTER_PARAMS_W;
  1152. #ifdef UNICODE
  1153. typedef SP_TROUBLESHOOTER_PARAMS_W SP_TROUBLESHOOTER_PARAMS;
  1154. typedef PSP_TROUBLESHOOTER_PARAMS_W PSP_TROUBLESHOOTER_PARAMS;
  1155. #else
  1156. typedef SP_TROUBLESHOOTER_PARAMS_A SP_TROUBLESHOOTER_PARAMS;
  1157. typedef PSP_TROUBLESHOOTER_PARAMS_A PSP_TROUBLESHOOTER_PARAMS;
  1158. #endif
  1159. //
  1160. // Structure corresponding to the DIF_POWERMESSAGEWAKE install function
  1161. //
  1162. typedef struct _SP_POWERMESSAGEWAKE_PARAMS_A {
  1163. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  1164. CHAR PowerMessageWake[LINE_LEN*2];
  1165. } SP_POWERMESSAGEWAKE_PARAMS_A, *PSP_POWERMESSAGEWAKE_PARAMS_A;
  1166. typedef struct _SP_POWERMESSAGEWAKE_PARAMS_W {
  1167. SP_CLASSINSTALL_HEADER ClassInstallHeader;
  1168. WCHAR PowerMessageWake[LINE_LEN*2];
  1169. } SP_POWERMESSAGEWAKE_PARAMS_W, *PSP_POWERMESSAGEWAKE_PARAMS_W;
  1170. #ifdef UNICODE
  1171. typedef SP_POWERMESSAGEWAKE_PARAMS_W SP_POWERMESSAGEWAKE_PARAMS;
  1172. typedef PSP_POWERMESSAGEWAKE_PARAMS_W PSP_POWERMESSAGEWAKE_PARAMS;
  1173. #else
  1174. typedef SP_POWERMESSAGEWAKE_PARAMS_A SP_POWERMESSAGEWAKE_PARAMS;
  1175. typedef PSP_POWERMESSAGEWAKE_PARAMS_A PSP_POWERMESSAGEWAKE_PARAMS;
  1176. #endif
  1177. //
  1178. // Driver information structure (member of a driver info list that may be associated
  1179. // with a particular device instance, or (globally) with a device information set)
  1180. //
  1181. typedef struct _SP_DRVINFO_DATA_V2_A {
  1182. DWORD cbSize;
  1183. DWORD DriverType;
  1184. ULONG_PTR Reserved;
  1185. CHAR Description[LINE_LEN];
  1186. CHAR MfgName[LINE_LEN];
  1187. CHAR ProviderName[LINE_LEN];
  1188. FILETIME DriverDate;
  1189. DWORDLONG DriverVersion;
  1190. } SP_DRVINFO_DATA_V2_A, *PSP_DRVINFO_DATA_V2_A;
  1191. typedef struct _SP_DRVINFO_DATA_V2_W {
  1192. DWORD cbSize;
  1193. DWORD DriverType;
  1194. ULONG_PTR Reserved;
  1195. WCHAR Description[LINE_LEN];
  1196. WCHAR MfgName[LINE_LEN];
  1197. WCHAR ProviderName[LINE_LEN];
  1198. FILETIME DriverDate;
  1199. DWORDLONG DriverVersion;
  1200. } SP_DRVINFO_DATA_V2_W, *PSP_DRVINFO_DATA_V2_W;
  1201. //
  1202. // Version 1 of the SP_DRVINFO_DATA structures, used only for compatibility
  1203. // with Windows NT 4.0/Windows 95/98 SETUPAPI.DLL
  1204. //
  1205. typedef struct _SP_DRVINFO_DATA_V1_A {
  1206. DWORD cbSize;
  1207. DWORD DriverType;
  1208. ULONG_PTR Reserved;
  1209. CHAR Description[LINE_LEN];
  1210. CHAR MfgName[LINE_LEN];
  1211. CHAR ProviderName[LINE_LEN];
  1212. } SP_DRVINFO_DATA_V1_A, *PSP_DRVINFO_DATA_V1_A;
  1213. typedef struct _SP_DRVINFO_DATA_V1_W {
  1214. DWORD cbSize;
  1215. DWORD DriverType;
  1216. ULONG_PTR Reserved;
  1217. WCHAR Description[LINE_LEN];
  1218. WCHAR MfgName[LINE_LEN];
  1219. WCHAR ProviderName[LINE_LEN];
  1220. } SP_DRVINFO_DATA_V1_W, *PSP_DRVINFO_DATA_V1_W;
  1221. #ifdef UNICODE
  1222. typedef SP_DRVINFO_DATA_V1_W SP_DRVINFO_DATA_V1;
  1223. typedef PSP_DRVINFO_DATA_V1_W PSP_DRVINFO_DATA_V1;
  1224. typedef SP_DRVINFO_DATA_V2_W SP_DRVINFO_DATA_V2;
  1225. typedef PSP_DRVINFO_DATA_V2_W PSP_DRVINFO_DATA_V2;
  1226. #else
  1227. typedef SP_DRVINFO_DATA_V1_A SP_DRVINFO_DATA_V1;
  1228. typedef PSP_DRVINFO_DATA_V1_A PSP_DRVINFO_DATA_V1;
  1229. typedef SP_DRVINFO_DATA_V2_A SP_DRVINFO_DATA_V2;
  1230. typedef PSP_DRVINFO_DATA_V2_A PSP_DRVINFO_DATA_V2;
  1231. #endif
  1232. #if USE_SP_DRVINFO_DATA_V1 || (_SETUPAPI_VER < 0x0500) // use version 1 driver info data structure
  1233. typedef SP_DRVINFO_DATA_V1_A SP_DRVINFO_DATA_A;
  1234. typedef PSP_DRVINFO_DATA_V1_A PSP_DRVINFO_DATA_A;
  1235. typedef SP_DRVINFO_DATA_V1_W SP_DRVINFO_DATA_W;
  1236. typedef PSP_DRVINFO_DATA_V1_W PSP_DRVINFO_DATA_W;
  1237. typedef SP_DRVINFO_DATA_V1 SP_DRVINFO_DATA;
  1238. typedef PSP_DRVINFO_DATA_V1 PSP_DRVINFO_DATA;
  1239. #else // use version 2 driver info data structure
  1240. typedef SP_DRVINFO_DATA_V2_A SP_DRVINFO_DATA_A;
  1241. typedef PSP_DRVINFO_DATA_V2_A PSP_DRVINFO_DATA_A;
  1242. typedef SP_DRVINFO_DATA_V2_W SP_DRVINFO_DATA_W;
  1243. typedef PSP_DRVINFO_DATA_V2_W PSP_DRVINFO_DATA_W;
  1244. typedef SP_DRVINFO_DATA_V2 SP_DRVINFO_DATA;
  1245. typedef PSP_DRVINFO_DATA_V2 PSP_DRVINFO_DATA;
  1246. #endif // use current version of driver info data structure
  1247. //
  1248. // Driver information details structure (provides detailed information about a
  1249. // particular driver information structure)
  1250. //
  1251. typedef struct _SP_DRVINFO_DETAIL_DATA_A {
  1252. DWORD cbSize;
  1253. FILETIME InfDate;
  1254. DWORD CompatIDsOffset;
  1255. DWORD CompatIDsLength;
  1256. ULONG_PTR Reserved;
  1257. CHAR SectionName[LINE_LEN];
  1258. CHAR InfFileName[MAX_PATH];
  1259. CHAR DrvDescription[LINE_LEN];
  1260. CHAR HardwareID[ANYSIZE_ARRAY];
  1261. } SP_DRVINFO_DETAIL_DATA_A, *PSP_DRVINFO_DETAIL_DATA_A;
  1262. typedef struct _SP_DRVINFO_DETAIL_DATA_W {
  1263. DWORD cbSize;
  1264. FILETIME InfDate;
  1265. DWORD CompatIDsOffset;
  1266. DWORD CompatIDsLength;
  1267. ULONG_PTR Reserved;
  1268. WCHAR SectionName[LINE_LEN];
  1269. WCHAR InfFileName[MAX_PATH];
  1270. WCHAR DrvDescription[LINE_LEN];
  1271. WCHAR HardwareID[ANYSIZE_ARRAY];
  1272. } SP_DRVINFO_DETAIL_DATA_W, *PSP_DRVINFO_DETAIL_DATA_W;
  1273. #ifdef UNICODE
  1274. typedef SP_DRVINFO_DETAIL_DATA_W SP_DRVINFO_DETAIL_DATA;
  1275. typedef PSP_DRVINFO_DETAIL_DATA_W PSP_DRVINFO_DETAIL_DATA;
  1276. #else
  1277. typedef SP_DRVINFO_DETAIL_DATA_A SP_DRVINFO_DETAIL_DATA;
  1278. typedef PSP_DRVINFO_DETAIL_DATA_A PSP_DRVINFO_DETAIL_DATA;
  1279. #endif
  1280. //
  1281. // Driver installation parameters (associated with a particular driver
  1282. // information element)
  1283. //
  1284. typedef struct _SP_DRVINSTALL_PARAMS {
  1285. DWORD cbSize;
  1286. DWORD Rank;
  1287. DWORD Flags;
  1288. DWORD_PTR PrivateData;
  1289. DWORD Reserved;
  1290. } SP_DRVINSTALL_PARAMS, *PSP_DRVINSTALL_PARAMS;
  1291. //
  1292. // SP_DRVINSTALL_PARAMS.Flags values
  1293. //
  1294. #define DNF_DUPDESC 0x00000001 // Multiple providers have same desc
  1295. #define DNF_OLDDRIVER 0x00000002 // Driver node specifies old/current driver
  1296. #define DNF_EXCLUDEFROMLIST 0x00000004 // If set, this driver node will not be
  1297. // displayed in any driver select dialogs.
  1298. #define DNF_NODRIVER 0x00000008 // if we want to install no driver
  1299. // (e.g no mouse drv)
  1300. #define DNF_LEGACYINF 0x00000010 // Driver node came from an old-style INF (obsolete)
  1301. #define DNF_CLASS_DRIVER 0x00000020 // Driver node represents a class driver
  1302. #define DNF_COMPATIBLE_DRIVER 0x00000040 // Driver node represents a compatible driver
  1303. #define DNF_INET_DRIVER 0x00000080 // Driver comes from an internet source
  1304. #define DNF_UNUSED1 0x00000100
  1305. #define DNF_INDEXED_DRIVER 0x00000200 // Driver is contained in the Windows Driver Index
  1306. #define DNF_OLD_INET_DRIVER 0x00000400 // Driver came from the Internet, but we don't currently
  1307. // have access to it's source files. Never attempt to
  1308. // install a driver with this flag!
  1309. #define DNF_BAD_DRIVER 0x00000800 // Driver node should not be used at all
  1310. #define DNF_DUPPROVIDER 0x00001000 // Multiple drivers have the same provider and desc
  1311. #if _SETUPAPI_VER >= 0x0501
  1312. #define DNF_INF_IS_SIGNED 0x00002000 // If file is digitally signed
  1313. #define DNF_OEM_F6_INF 0x00004000 // INF specified from F6 during textmode setup.
  1314. #define DNF_DUPDRIVERVER 0x00008000 // Multipe drivers have the same desc, provider, and DriverVer values
  1315. #define DNF_BASIC_DRIVER 0x00010000 // Driver provides basic functionality, but should
  1316. // not be chosen if other signed drivers exist.
  1317. #endif // _SETUPAPI_VER >= 0x0501
  1318. #if _SETUPAPI_VER >= 0x0502
  1319. #define DNF_AUTHENTICODE_SIGNED 0x00020000 // Inf file is signed by an Authenticode(tm) catalog.
  1320. #endif // _SETUPAPI_VER >= 0x0502
  1321. //
  1322. // Rank values (the lower the Rank number, the better the Rank)
  1323. //
  1324. #define DRIVER_HARDWAREID_RANK 0x00000FFF // Any rank less than or equal to
  1325. // this value is a trusted
  1326. // HardwareID match
  1327. #define DRIVER_COMPATID_RANK 0x00003FFF // Any rank less than or equal to
  1328. // this (and greater than
  1329. // DRIVER_HARDWAREID_RANK) is a
  1330. // trusted CompatibleID match
  1331. #define DRIVER_UNTRUSTED_RANK 0x00008000 // Any rank with this bit set is an
  1332. // "untrusted" rank, meaning that
  1333. // the INF was unsigned.
  1334. #define DRIVER_UNTRUSTED_HARDWAREID_RANK 0x00008FFF // Any rank less than or equal to
  1335. // this value (and greater than
  1336. // or equal to DRIVER_UNTRUSTED_RANK)
  1337. // is an untrusted HardwareID match
  1338. #define DRIVER_UNTRUSTED_COMPATID_RANK 0x0000BFFF // Any rank less than or equal to
  1339. // this value (and greater than
  1340. // DRIVER_UNTRUSTED_HARDWAREID_RANK)
  1341. // is an untrusted CompatibleID match
  1342. #define DRIVER_W9X_SUSPECT_RANK 0x0000C000 // Any rank that is greater than
  1343. // or equal to this value, and lesser
  1344. // than or equal to 0xFFFF is suspected
  1345. // to be a Win9x-only driver, because
  1346. // (a) it isn't signed, and (b) there
  1347. // is no NT-specific decoration to
  1348. // explicitly indicate that the INF
  1349. // supports Windows NT/2000/XP
  1350. #define DRIVER_W9X_SUSPECT_HARDWAREID_RANK 0x0000CFFF // Any rank less than or equal to this
  1351. // (and greater than or equal to
  1352. // DRIVER_W9X_SUSPECT_RANK) is a
  1353. // hardware ID match suspected of being
  1354. // only for Windows 9x platforms.
  1355. #define DRIVER_W9X_SUSPECT_COMPATID_RANK 0x0000FFFF // Any rank less than or equal to
  1356. // this (and greater than
  1357. // DRIVER_W9X_SUSPECT_HARDWAREID_RANK)
  1358. // is a compatible ID match suspected
  1359. // of being only for Windows 9x
  1360. // platforms.
  1361. //
  1362. // Setup callback routine for comparing detection signatures
  1363. //
  1364. typedef DWORD (CALLBACK* PSP_DETSIG_CMPPROC)(
  1365. IN HDEVINFO DeviceInfoSet,
  1366. IN PSP_DEVINFO_DATA NewDeviceData,
  1367. IN PSP_DEVINFO_DATA ExistingDeviceData,
  1368. IN PVOID CompareContext OPTIONAL
  1369. );
  1370. //
  1371. // Define context structure handed to co-installers
  1372. //
  1373. typedef struct _COINSTALLER_CONTEXT_DATA {
  1374. BOOL PostProcessing;
  1375. DWORD InstallResult;
  1376. PVOID PrivateData;
  1377. } COINSTALLER_CONTEXT_DATA, *PCOINSTALLER_CONTEXT_DATA;
  1378. //
  1379. // Structure containing class image list information.
  1380. //
  1381. typedef struct _SP_CLASSIMAGELIST_DATA {
  1382. DWORD cbSize;
  1383. HIMAGELIST ImageList;
  1384. ULONG_PTR Reserved;
  1385. } SP_CLASSIMAGELIST_DATA, *PSP_CLASSIMAGELIST_DATA;
  1386. //
  1387. // Structure to be passed as first parameter (LPVOID lpv) to ExtensionPropSheetPageProc
  1388. // entry point in setupapi.dll or to "EnumPropPages32" or "BasicProperties32" entry
  1389. // points provided by class/device property page providers. Used to retrieve a handle
  1390. // (or, potentially, multiple handles) to property pages for a specified property page type.
  1391. //
  1392. typedef struct _SP_PROPSHEETPAGE_REQUEST {
  1393. DWORD cbSize;
  1394. DWORD PageRequested;
  1395. HDEVINFO DeviceInfoSet;
  1396. PSP_DEVINFO_DATA DeviceInfoData;
  1397. } SP_PROPSHEETPAGE_REQUEST, *PSP_PROPSHEETPAGE_REQUEST;
  1398. //
  1399. // Property sheet codes used in SP_PROPSHEETPAGE_REQUEST.PageRequested
  1400. //
  1401. #define SPPSR_SELECT_DEVICE_RESOURCES 1 // supplied by setupapi.dll
  1402. #define SPPSR_ENUM_BASIC_DEVICE_PROPERTIES 2 // supplied by device's BasicProperties32 provider
  1403. #define SPPSR_ENUM_ADV_DEVICE_PROPERTIES 3 // supplied by class and/or device's EnumPropPages32 provider
  1404. //
  1405. // Structure used with SetupGetBackupInformation/SetupSetBackupInformation
  1406. //
  1407. typedef struct _SP_BACKUP_QUEUE_PARAMS_V2_A {
  1408. DWORD cbSize; // size of structure
  1409. CHAR FullInfPath[MAX_PATH]; // buffer to hold ANSI pathname of INF file
  1410. INT FilenameOffset; // offset in CHAR's of filename part (after '\')
  1411. CHAR ReinstallInstance[MAX_PATH]; // Instance ID (if present)
  1412. } SP_BACKUP_QUEUE_PARAMS_V2_A, *PSP_BACKUP_QUEUE_PARAMS_V2_A;
  1413. typedef struct _SP_BACKUP_QUEUE_PARAMS_V2_W {
  1414. DWORD cbSize; // size of structure
  1415. WCHAR FullInfPath[MAX_PATH]; // buffer to hold UNICODE pathname of INF file
  1416. INT FilenameOffset; // offset in WCHAR's of filename part (after '\')
  1417. WCHAR ReinstallInstance[MAX_PATH]; // Instance ID (if present)
  1418. } SP_BACKUP_QUEUE_PARAMS_V2_W, *PSP_BACKUP_QUEUE_PARAMS_V2_W;
  1419. //
  1420. // Version 1 of the SP_BACKUP_QUEUE_PARAMS structures, used only for compatibility
  1421. // with Windows 2000/Windows 95/98/ME SETUPAPI.DLL
  1422. //
  1423. typedef struct _SP_BACKUP_QUEUE_PARAMS_V1_A {
  1424. DWORD cbSize; // size of structure
  1425. CHAR FullInfPath[MAX_PATH]; // buffer to hold ANSI pathname of INF file
  1426. INT FilenameOffset; // offset in CHAR's of filename part (after '\')
  1427. } SP_BACKUP_QUEUE_PARAMS_V1_A, *PSP_BACKUP_QUEUE_PARAMS_V1_A;
  1428. typedef struct _SP_BACKUP_QUEUE_PARAMS_V1_W {
  1429. DWORD cbSize; // size of structure
  1430. WCHAR FullInfPath[MAX_PATH]; // buffer to hold UNICODE pathname of INF file
  1431. INT FilenameOffset; // offset in WCHAR's of filename part (after '\')
  1432. } SP_BACKUP_QUEUE_PARAMS_V1_W, *PSP_BACKUP_QUEUE_PARAMS_V1_W;
  1433. #ifdef UNICODE
  1434. typedef SP_BACKUP_QUEUE_PARAMS_V1_W SP_BACKUP_QUEUE_PARAMS_V1;
  1435. typedef PSP_BACKUP_QUEUE_PARAMS_V1_W PSP_BACKUP_QUEUE_PARAMS_V1;
  1436. typedef SP_BACKUP_QUEUE_PARAMS_V2_W SP_BACKUP_QUEUE_PARAMS_V2;
  1437. typedef PSP_BACKUP_QUEUE_PARAMS_V2_W PSP_BACKUP_QUEUE_PARAMS_V2;
  1438. #else
  1439. typedef SP_BACKUP_QUEUE_PARAMS_V1_A SP_BACKUP_QUEUE_PARAMS_V1;
  1440. typedef PSP_BACKUP_QUEUE_PARAMS_V1_A PSP_BACKUP_QUEUE_PARAMS_V1;
  1441. typedef SP_BACKUP_QUEUE_PARAMS_V2_A SP_BACKUP_QUEUE_PARAMS_V2;
  1442. typedef PSP_BACKUP_QUEUE_PARAMS_V2_A PSP_BACKUP_QUEUE_PARAMS_V2;
  1443. #endif
  1444. #if USE_SP_BACKUP_QUEUE_PARAMS_V1 || (_SETUPAPI_VER < 0x0501) // use version 1 driver info data structure
  1445. typedef SP_BACKUP_QUEUE_PARAMS_V1_A SP_BACKUP_QUEUE_PARAMS_A;
  1446. typedef PSP_BACKUP_QUEUE_PARAMS_V1_A PSP_BACKUP_QUEUE_PARAMS_A;
  1447. typedef SP_BACKUP_QUEUE_PARAMS_V1_W SP_BACKUP_QUEUE_PARAMS_W;
  1448. typedef PSP_BACKUP_QUEUE_PARAMS_V1_W PSP_BACKUP_QUEUE_PARAMS_W;
  1449. typedef SP_BACKUP_QUEUE_PARAMS_V1 SP_BACKUP_QUEUE_PARAMS;
  1450. typedef PSP_BACKUP_QUEUE_PARAMS_V1 PSP_BACKUP_QUEUE_PARAMS;
  1451. #else // use version 2 driver info data structure
  1452. typedef SP_BACKUP_QUEUE_PARAMS_V2_A SP_BACKUP_QUEUE_PARAMS_A;
  1453. typedef PSP_BACKUP_QUEUE_PARAMS_V2_A PSP_BACKUP_QUEUE_PARAMS_A;
  1454. typedef SP_BACKUP_QUEUE_PARAMS_V2_W SP_BACKUP_QUEUE_PARAMS_W;
  1455. typedef PSP_BACKUP_QUEUE_PARAMS_V2_W PSP_BACKUP_QUEUE_PARAMS_W;
  1456. typedef SP_BACKUP_QUEUE_PARAMS_V2 SP_BACKUP_QUEUE_PARAMS;
  1457. typedef PSP_BACKUP_QUEUE_PARAMS_V2 PSP_BACKUP_QUEUE_PARAMS;
  1458. #endif // use current version of driver info data structure
  1459. //
  1460. // Setupapi-specific error codes
  1461. //
  1462. // Inf parse outcomes
  1463. //
  1464. #define ERROR_EXPECTED_SECTION_NAME (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0)
  1465. #define ERROR_BAD_SECTION_NAME_LINE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|1)
  1466. #define ERROR_SECTION_NAME_TOO_LONG (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|2)
  1467. #define ERROR_GENERAL_SYNTAX (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|3)
  1468. //
  1469. // Inf runtime errors
  1470. //
  1471. #define ERROR_WRONG_INF_STYLE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x100)
  1472. #define ERROR_SECTION_NOT_FOUND (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x101)
  1473. #define ERROR_LINE_NOT_FOUND (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x102)
  1474. #define ERROR_NO_BACKUP (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x103)
  1475. //
  1476. // Device Installer/other errors
  1477. //
  1478. #define ERROR_NO_ASSOCIATED_CLASS (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x200)
  1479. #define ERROR_CLASS_MISMATCH (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x201)
  1480. #define ERROR_DUPLICATE_FOUND (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x202)
  1481. #define ERROR_NO_DRIVER_SELECTED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x203)
  1482. #define ERROR_KEY_DOES_NOT_EXIST (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x204)
  1483. #define ERROR_INVALID_DEVINST_NAME (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x205)
  1484. #define ERROR_INVALID_CLASS (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x206)
  1485. #define ERROR_DEVINST_ALREADY_EXISTS (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x207)
  1486. #define ERROR_DEVINFO_NOT_REGISTERED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x208)
  1487. #define ERROR_INVALID_REG_PROPERTY (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x209)
  1488. #define ERROR_NO_INF (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20A)
  1489. #define ERROR_NO_SUCH_DEVINST (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20B)
  1490. #define ERROR_CANT_LOAD_CLASS_ICON (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20C)
  1491. #define ERROR_INVALID_CLASS_INSTALLER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20D)
  1492. #define ERROR_DI_DO_DEFAULT (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20E)
  1493. #define ERROR_DI_NOFILECOPY (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20F)
  1494. #define ERROR_INVALID_HWPROFILE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x210)
  1495. #define ERROR_NO_DEVICE_SELECTED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x211)
  1496. #define ERROR_DEVINFO_LIST_LOCKED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x212)
  1497. #define ERROR_DEVINFO_DATA_LOCKED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x213)
  1498. #define ERROR_DI_BAD_PATH (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x214)
  1499. #define ERROR_NO_CLASSINSTALL_PARAMS (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x215)
  1500. #define ERROR_FILEQUEUE_LOCKED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x216)
  1501. #define ERROR_BAD_SERVICE_INSTALLSECT (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x217)
  1502. #define ERROR_NO_CLASS_DRIVER_LIST (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x218)
  1503. #define ERROR_NO_ASSOCIATED_SERVICE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x219)
  1504. #define ERROR_NO_DEFAULT_DEVICE_INTERFACE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21A)
  1505. #define ERROR_DEVICE_INTERFACE_ACTIVE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21B)
  1506. #define ERROR_DEVICE_INTERFACE_REMOVED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21C)
  1507. #define ERROR_BAD_INTERFACE_INSTALLSECT (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21D)
  1508. #define ERROR_NO_SUCH_INTERFACE_CLASS (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21E)
  1509. #define ERROR_INVALID_REFERENCE_STRING (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21F)
  1510. #define ERROR_INVALID_MACHINENAME (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x220)
  1511. #define ERROR_REMOTE_COMM_FAILURE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x221)
  1512. #define ERROR_MACHINE_UNAVAILABLE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x222)
  1513. #define ERROR_NO_CONFIGMGR_SERVICES (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x223)
  1514. #define ERROR_INVALID_PROPPAGE_PROVIDER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x224)
  1515. #define ERROR_NO_SUCH_DEVICE_INTERFACE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x225)
  1516. #define ERROR_DI_POSTPROCESSING_REQUIRED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x226)
  1517. #define ERROR_INVALID_COINSTALLER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x227)
  1518. #define ERROR_NO_COMPAT_DRIVERS (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x228)
  1519. #define ERROR_NO_DEVICE_ICON (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x229)
  1520. #define ERROR_INVALID_INF_LOGCONFIG (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22A)
  1521. #define ERROR_DI_DONT_INSTALL (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22B)
  1522. #define ERROR_INVALID_FILTER_DRIVER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22C)
  1523. #define ERROR_NON_WINDOWS_NT_DRIVER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22D)
  1524. #define ERROR_NON_WINDOWS_DRIVER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22E)
  1525. #define ERROR_NO_CATALOG_FOR_OEM_INF (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22F)
  1526. #define ERROR_DEVINSTALL_QUEUE_NONNATIVE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x230)
  1527. #define ERROR_NOT_DISABLEABLE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x231)
  1528. #define ERROR_CANT_REMOVE_DEVINST (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x232)
  1529. #define ERROR_INVALID_TARGET (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x233)
  1530. #define ERROR_DRIVER_NONNATIVE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x234)
  1531. #define ERROR_IN_WOW64 (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x235)
  1532. #define ERROR_SET_SYSTEM_RESTORE_POINT (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x236)
  1533. #define ERROR_INCORRECTLY_COPIED_INF (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x237)
  1534. #define ERROR_SCE_DISABLED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x238)
  1535. #define ERROR_UNKNOWN_EXCEPTION (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x239)
  1536. #define ERROR_PNP_REGISTRY_ERROR (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x23A)
  1537. #define ERROR_REMOTE_REQUEST_UNSUPPORTED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x23B)
  1538. #define ERROR_NOT_AN_INSTALLED_OEM_INF (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x23C)
  1539. #define ERROR_INF_IN_USE_BY_DEVICES (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x23D)
  1540. #define ERROR_DI_FUNCTION_OBSOLETE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x23E)
  1541. #define ERROR_NO_AUTHENTICODE_CATALOG (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x23F)
  1542. #define ERROR_AUTHENTICODE_DISALLOWED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x240)
  1543. #define ERROR_AUTHENTICODE_TRUSTED_PUBLISHER (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x241)
  1544. #define ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x242)
  1545. #define ERROR_AUTHENTICODE_PUBLISHER_NOT_TRUSTED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x243)
  1546. #define ERROR_SIGNATURE_OSATTRIBUTE_MISMATCH (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x244)
  1547. #define ERROR_ONLY_VALIDATE_VIA_AUTHENTICODE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x245)
  1548. //
  1549. // Setupapi exception codes
  1550. //
  1551. #define ERROR_UNRECOVERABLE_STACK_OVERFLOW (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x300)
  1552. #define EXCEPTION_SPAPI_UNRECOVERABLE_STACK_OVERFLOW ERROR_UNRECOVERABLE_STACK_OVERFLOW
  1553. //
  1554. // Backward compatibility--do not use.
  1555. //
  1556. #define ERROR_NO_DEFAULT_INTERFACE_DEVICE ERROR_NO_DEFAULT_DEVICE_INTERFACE
  1557. #define ERROR_INTERFACE_DEVICE_ACTIVE ERROR_DEVICE_INTERFACE_ACTIVE
  1558. #define ERROR_INTERFACE_DEVICE_REMOVED ERROR_DEVICE_INTERFACE_REMOVED
  1559. #define ERROR_NO_SUCH_INTERFACE_DEVICE ERROR_NO_SUCH_DEVICE_INTERFACE
  1560. //
  1561. // Win9x migration DLL error code
  1562. //
  1563. #define ERROR_NOT_INSTALLED (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x1000)
  1564. WINSETUPAPI
  1565. BOOL
  1566. WINAPI
  1567. SetupGetInfInformationA(
  1568. IN LPCVOID InfSpec,
  1569. IN DWORD SearchControl,
  1570. OUT PSP_INF_INFORMATION ReturnBuffer, OPTIONAL
  1571. IN DWORD ReturnBufferSize,
  1572. OUT PDWORD RequiredSize OPTIONAL
  1573. );
  1574. WINSETUPAPI
  1575. BOOL
  1576. WINAPI
  1577. SetupGetInfInformationW(
  1578. IN LPCVOID InfSpec,
  1579. IN DWORD SearchControl,
  1580. OUT PSP_INF_INFORMATION ReturnBuffer, OPTIONAL
  1581. IN DWORD ReturnBufferSize,
  1582. OUT PDWORD RequiredSize OPTIONAL
  1583. );
  1584. //
  1585. // SearchControl flags for SetupGetInfInformation
  1586. //
  1587. #define INFINFO_INF_SPEC_IS_HINF 1
  1588. #define INFINFO_INF_NAME_IS_ABSOLUTE 2
  1589. #define INFINFO_DEFAULT_SEARCH 3
  1590. #define INFINFO_REVERSE_DEFAULT_SEARCH 4
  1591. #define INFINFO_INF_PATH_LIST_SEARCH 5
  1592. #ifdef UNICODE
  1593. #define SetupGetInfInformation SetupGetInfInformationW
  1594. #else
  1595. #define SetupGetInfInformation SetupGetInfInformationA
  1596. #endif
  1597. WINSETUPAPI
  1598. BOOL
  1599. WINAPI
  1600. SetupQueryInfFileInformationA(
  1601. IN PSP_INF_INFORMATION InfInformation,
  1602. IN UINT InfIndex,
  1603. OUT PSTR ReturnBuffer, OPTIONAL
  1604. IN DWORD ReturnBufferSize,
  1605. OUT PDWORD RequiredSize OPTIONAL
  1606. );
  1607. WINSETUPAPI
  1608. BOOL
  1609. WINAPI
  1610. SetupQueryInfFileInformationW(
  1611. IN PSP_INF_INFORMATION InfInformation,
  1612. IN UINT InfIndex,
  1613. OUT PWSTR ReturnBuffer, OPTIONAL
  1614. IN DWORD ReturnBufferSize,
  1615. OUT PDWORD RequiredSize OPTIONAL
  1616. );
  1617. #ifdef UNICODE
  1618. #define SetupQueryInfFileInformation SetupQueryInfFileInformationW
  1619. #else
  1620. #define SetupQueryInfFileInformation SetupQueryInfFileInformationA
  1621. #endif
  1622. WINSETUPAPI
  1623. BOOL
  1624. WINAPI
  1625. SetupQueryInfOriginalFileInformationA(
  1626. IN PSP_INF_INFORMATION InfInformation,
  1627. IN UINT InfIndex,
  1628. IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo, OPTIONAL
  1629. OUT PSP_ORIGINAL_FILE_INFO_A OriginalFileInfo
  1630. );
  1631. WINSETUPAPI
  1632. BOOL
  1633. WINAPI
  1634. SetupQueryInfOriginalFileInformationW(
  1635. IN PSP_INF_INFORMATION InfInformation,
  1636. IN UINT InfIndex,
  1637. IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo, OPTIONAL
  1638. OUT PSP_ORIGINAL_FILE_INFO_W OriginalFileInfo
  1639. );
  1640. #ifdef UNICODE
  1641. #define SetupQueryInfOriginalFileInformation SetupQueryInfOriginalFileInformationW
  1642. #else
  1643. #define SetupQueryInfOriginalFileInformation SetupQueryInfOriginalFileInformationA
  1644. #endif
  1645. WINSETUPAPI
  1646. BOOL
  1647. WINAPI
  1648. SetupQueryInfVersionInformationA(
  1649. IN PSP_INF_INFORMATION InfInformation,
  1650. IN UINT InfIndex,
  1651. IN PCSTR Key, OPTIONAL
  1652. OUT PSTR ReturnBuffer, OPTIONAL
  1653. IN DWORD ReturnBufferSize,
  1654. OUT PDWORD RequiredSize OPTIONAL
  1655. );
  1656. WINSETUPAPI
  1657. BOOL
  1658. WINAPI
  1659. SetupQueryInfVersionInformationW(
  1660. IN PSP_INF_INFORMATION InfInformation,
  1661. IN UINT InfIndex,
  1662. IN PCWSTR Key, OPTIONAL
  1663. OUT PWSTR ReturnBuffer, OPTIONAL
  1664. IN DWORD ReturnBufferSize,
  1665. OUT PDWORD RequiredSize OPTIONAL
  1666. );
  1667. #ifdef UNICODE
  1668. #define SetupQueryInfVersionInformation SetupQueryInfVersionInformationW
  1669. #else
  1670. #define SetupQueryInfVersionInformation SetupQueryInfVersionInformationA
  1671. #endif
  1672. WINSETUPAPI
  1673. BOOL
  1674. WINAPI
  1675. SetupGetInfFileListA(
  1676. IN PCSTR DirectoryPath, OPTIONAL
  1677. IN DWORD InfStyle,
  1678. OUT PSTR ReturnBuffer, OPTIONAL
  1679. IN DWORD ReturnBufferSize,
  1680. OUT PDWORD RequiredSize OPTIONAL
  1681. );
  1682. WINSETUPAPI
  1683. BOOL
  1684. WINAPI
  1685. SetupGetInfFileListW(
  1686. IN PCWSTR DirectoryPath, OPTIONAL
  1687. IN DWORD InfStyle,
  1688. OUT PWSTR ReturnBuffer, OPTIONAL
  1689. IN DWORD ReturnBufferSize,
  1690. OUT PDWORD RequiredSize OPTIONAL
  1691. );
  1692. #ifdef UNICODE
  1693. #define SetupGetInfFileList SetupGetInfFileListW
  1694. #else
  1695. #define SetupGetInfFileList SetupGetInfFileListA
  1696. #endif
  1697. WINSETUPAPI
  1698. HINF
  1699. WINAPI
  1700. SetupOpenInfFileW(
  1701. IN PCWSTR FileName,
  1702. IN PCWSTR InfClass, OPTIONAL
  1703. IN DWORD InfStyle,
  1704. OUT PUINT ErrorLine OPTIONAL
  1705. );
  1706. WINSETUPAPI
  1707. HINF
  1708. WINAPI
  1709. SetupOpenInfFileA(
  1710. IN PCSTR FileName,
  1711. IN PCSTR InfClass, OPTIONAL
  1712. IN DWORD InfStyle,
  1713. OUT PUINT ErrorLine OPTIONAL
  1714. );
  1715. #ifdef UNICODE
  1716. #define SetupOpenInfFile SetupOpenInfFileW
  1717. #else
  1718. #define SetupOpenInfFile SetupOpenInfFileA
  1719. #endif
  1720. WINSETUPAPI
  1721. HINF
  1722. WINAPI
  1723. SetupOpenMasterInf(
  1724. VOID
  1725. );
  1726. WINSETUPAPI
  1727. BOOL
  1728. WINAPI
  1729. SetupOpenAppendInfFileW(
  1730. IN PCWSTR FileName, OPTIONAL
  1731. IN HINF InfHandle,
  1732. OUT PUINT ErrorLine OPTIONAL
  1733. );
  1734. WINSETUPAPI
  1735. BOOL
  1736. WINAPI
  1737. SetupOpenAppendInfFileA(
  1738. IN PCSTR FileName, OPTIONAL
  1739. IN HINF InfHandle,
  1740. OUT PUINT ErrorLine OPTIONAL
  1741. );
  1742. #ifdef UNICODE
  1743. #define SetupOpenAppendInfFile SetupOpenAppendInfFileW
  1744. #else
  1745. #define SetupOpenAppendInfFile SetupOpenAppendInfFileA
  1746. #endif
  1747. WINSETUPAPI
  1748. VOID
  1749. WINAPI
  1750. SetupCloseInfFile(
  1751. IN HINF InfHandle
  1752. );
  1753. WINSETUPAPI
  1754. BOOL
  1755. WINAPI
  1756. SetupFindFirstLineA(
  1757. IN HINF InfHandle,
  1758. IN PCSTR Section,
  1759. IN PCSTR Key, OPTIONAL
  1760. OUT PINFCONTEXT Context
  1761. );
  1762. WINSETUPAPI
  1763. BOOL
  1764. WINAPI
  1765. SetupFindFirstLineW(
  1766. IN HINF InfHandle,
  1767. IN PCWSTR Section,
  1768. IN PCWSTR Key, OPTIONAL
  1769. OUT PINFCONTEXT Context
  1770. );
  1771. #ifdef UNICODE
  1772. #define SetupFindFirstLine SetupFindFirstLineW
  1773. #else
  1774. #define SetupFindFirstLine SetupFindFirstLineA
  1775. #endif
  1776. WINSETUPAPI
  1777. BOOL
  1778. WINAPI
  1779. SetupFindNextLine(
  1780. IN PINFCONTEXT ContextIn,
  1781. OUT PINFCONTEXT ContextOut
  1782. );
  1783. WINSETUPAPI
  1784. BOOL
  1785. WINAPI
  1786. SetupFindNextMatchLineA(
  1787. IN PINFCONTEXT ContextIn,
  1788. IN PCSTR Key, OPTIONAL
  1789. OUT PINFCONTEXT ContextOut
  1790. );
  1791. WINSETUPAPI
  1792. BOOL
  1793. WINAPI
  1794. SetupFindNextMatchLineW(
  1795. IN PINFCONTEXT ContextIn,
  1796. IN PCWSTR Key, OPTIONAL
  1797. OUT PINFCONTEXT ContextOut
  1798. );
  1799. #ifdef UNICODE
  1800. #define SetupFindNextMatchLine SetupFindNextMatchLineW
  1801. #else
  1802. #define SetupFindNextMatchLine SetupFindNextMatchLineA
  1803. #endif
  1804. WINSETUPAPI
  1805. BOOL
  1806. WINAPI
  1807. SetupGetLineByIndexA(
  1808. IN HINF InfHandle,
  1809. IN PCSTR Section,
  1810. IN DWORD Index,
  1811. OUT PINFCONTEXT Context
  1812. );
  1813. WINSETUPAPI
  1814. BOOL
  1815. WINAPI
  1816. SetupGetLineByIndexW(
  1817. IN HINF InfHandle,
  1818. IN PCWSTR Section,
  1819. IN DWORD Index,
  1820. OUT PINFCONTEXT Context
  1821. );
  1822. #ifdef UNICODE
  1823. #define SetupGetLineByIndex SetupGetLineByIndexW
  1824. #else
  1825. #define SetupGetLineByIndex SetupGetLineByIndexA
  1826. #endif
  1827. WINSETUPAPI
  1828. LONG
  1829. WINAPI
  1830. SetupGetLineCountA(
  1831. IN HINF InfHandle,
  1832. IN PCSTR Section
  1833. );
  1834. WINSETUPAPI
  1835. LONG
  1836. WINAPI
  1837. SetupGetLineCountW(
  1838. IN HINF InfHandle,
  1839. IN PCWSTR Section
  1840. );
  1841. #ifdef UNICODE
  1842. #define SetupGetLineCount SetupGetLineCountW
  1843. #else
  1844. #define SetupGetLineCount SetupGetLineCountA
  1845. #endif
  1846. WINSETUPAPI
  1847. BOOL
  1848. WINAPI
  1849. SetupGetLineTextA(
  1850. IN PINFCONTEXT Context, OPTIONAL
  1851. IN HINF InfHandle, OPTIONAL
  1852. IN PCSTR Section, OPTIONAL
  1853. IN PCSTR Key, OPTIONAL
  1854. OUT PSTR ReturnBuffer, OPTIONAL
  1855. IN DWORD ReturnBufferSize,
  1856. OUT PDWORD RequiredSize OPTIONAL
  1857. );
  1858. WINSETUPAPI
  1859. BOOL
  1860. WINAPI
  1861. SetupGetLineTextW(
  1862. IN PINFCONTEXT Context, OPTIONAL
  1863. IN HINF InfHandle, OPTIONAL
  1864. IN PCWSTR Section, OPTIONAL
  1865. IN PCWSTR Key, OPTIONAL
  1866. OUT PWSTR ReturnBuffer, OPTIONAL
  1867. IN DWORD ReturnBufferSize,
  1868. OUT PDWORD RequiredSize OPTIONAL
  1869. );
  1870. #ifdef UNICODE
  1871. #define SetupGetLineText SetupGetLineTextW
  1872. #else
  1873. #define SetupGetLineText SetupGetLineTextA
  1874. #endif
  1875. WINSETUPAPI
  1876. DWORD
  1877. WINAPI
  1878. SetupGetFieldCount(
  1879. IN PINFCONTEXT Context
  1880. );
  1881. WINSETUPAPI
  1882. BOOL
  1883. WINAPI
  1884. SetupGetStringFieldA(
  1885. IN PINFCONTEXT Context,
  1886. IN DWORD FieldIndex,
  1887. OUT PSTR ReturnBuffer, OPTIONAL
  1888. IN DWORD ReturnBufferSize,
  1889. OUT PDWORD RequiredSize OPTIONAL
  1890. );
  1891. WINSETUPAPI
  1892. BOOL
  1893. WINAPI
  1894. SetupGetStringFieldW(
  1895. IN PINFCONTEXT Context,
  1896. IN DWORD FieldIndex,
  1897. OUT PWSTR ReturnBuffer, OPTIONAL
  1898. IN DWORD ReturnBufferSize,
  1899. OUT PDWORD RequiredSize OPTIONAL
  1900. );
  1901. #ifdef UNICODE
  1902. #define SetupGetStringField SetupGetStringFieldW
  1903. #else
  1904. #define SetupGetStringField SetupGetStringFieldA
  1905. #endif
  1906. WINSETUPAPI
  1907. BOOL
  1908. WINAPI
  1909. SetupGetIntField(
  1910. IN PINFCONTEXT Context,
  1911. IN DWORD FieldIndex,
  1912. OUT PINT IntegerValue
  1913. );
  1914. WINSETUPAPI
  1915. BOOL
  1916. WINAPI
  1917. SetupGetMultiSzFieldA(
  1918. IN PINFCONTEXT Context,
  1919. IN DWORD FieldIndex,
  1920. OUT PSTR ReturnBuffer, OPTIONAL
  1921. IN DWORD ReturnBufferSize,
  1922. OUT LPDWORD RequiredSize OPTIONAL
  1923. );
  1924. WINSETUPAPI
  1925. BOOL
  1926. WINAPI
  1927. SetupGetMultiSzFieldW(
  1928. IN PINFCONTEXT Context,
  1929. IN DWORD FieldIndex,
  1930. OUT PWSTR ReturnBuffer, OPTIONAL
  1931. IN DWORD ReturnBufferSize,
  1932. OUT LPDWORD RequiredSize OPTIONAL
  1933. );
  1934. #ifdef UNICODE
  1935. #define SetupGetMultiSzField SetupGetMultiSzFieldW
  1936. #else
  1937. #define SetupGetMultiSzField SetupGetMultiSzFieldA
  1938. #endif
  1939. WINSETUPAPI
  1940. BOOL
  1941. WINAPI
  1942. SetupGetBinaryField(
  1943. IN PINFCONTEXT Context,
  1944. IN DWORD FieldIndex,
  1945. OUT PBYTE ReturnBuffer, OPTIONAL
  1946. IN DWORD ReturnBufferSize,
  1947. OUT LPDWORD RequiredSize OPTIONAL
  1948. );
  1949. //
  1950. // SetupGetFileCompressionInfo is depreciated
  1951. // use SetupGetFileCompressionInfoEx instead
  1952. //
  1953. // ActualSourceFileName returned by SetupGetFileCompressionInfo
  1954. // must be freed by the export setupapi!MyFree (NT4+ Win95+)
  1955. // or LocalFree (Win2k+)
  1956. //
  1957. WINSETUPAPI
  1958. DWORD
  1959. WINAPI
  1960. SetupGetFileCompressionInfoA(
  1961. IN PCSTR SourceFileName,
  1962. OUT PSTR *ActualSourceFileName,
  1963. OUT PDWORD SourceFileSize,
  1964. OUT PDWORD TargetFileSize,
  1965. OUT PUINT CompressionType
  1966. );
  1967. WINSETUPAPI
  1968. DWORD
  1969. WINAPI
  1970. SetupGetFileCompressionInfoW(
  1971. IN PCWSTR SourceFileName,
  1972. OUT PWSTR *ActualSourceFileName,
  1973. OUT PDWORD SourceFileSize,
  1974. OUT PDWORD TargetFileSize,
  1975. OUT PUINT CompressionType
  1976. );
  1977. #ifdef UNICODE
  1978. #define SetupGetFileCompressionInfo SetupGetFileCompressionInfoW
  1979. #else
  1980. #define SetupGetFileCompressionInfo SetupGetFileCompressionInfoA
  1981. #endif
  1982. #if _SETUPAPI_VER >= 0x0501
  1983. //
  1984. // SetupGetFileCompressionInfoEx is the preferred API over
  1985. // SetupGetFileCompressionInfo. It follows the normal
  1986. // conventions of returning BOOL and writing to user-supplied
  1987. // buffer.
  1988. //
  1989. WINSETUPAPI
  1990. BOOL
  1991. WINAPI
  1992. SetupGetFileCompressionInfoExA(
  1993. IN PCSTR SourceFileName,
  1994. IN PSTR ActualSourceFileNameBuffer,
  1995. IN DWORD ActualSourceFileNameBufferLen,
  1996. OUT PDWORD RequiredBufferLen, OPTIONAL
  1997. OUT PDWORD SourceFileSize,
  1998. OUT PDWORD TargetFileSize,
  1999. OUT PUINT CompressionType
  2000. );
  2001. WINSETUPAPI
  2002. BOOL
  2003. WINAPI
  2004. SetupGetFileCompressionInfoExW(
  2005. IN PCWSTR SourceFileName,
  2006. IN PWSTR ActualSourceFileNameBuffer,
  2007. IN DWORD ActualSourceFileNameBufferLen,
  2008. OUT PDWORD RequiredBufferLen, OPTIONAL
  2009. OUT PDWORD SourceFileSize,
  2010. OUT PDWORD TargetFileSize,
  2011. OUT PUINT CompressionType
  2012. );
  2013. #ifdef UNICODE
  2014. #define SetupGetFileCompressionInfoEx SetupGetFileCompressionInfoExW
  2015. #else
  2016. #define SetupGetFileCompressionInfoEx SetupGetFileCompressionInfoExA
  2017. #endif
  2018. #endif // _SETUPAPI_VER >= 0x0501
  2019. //
  2020. // Compression types
  2021. //
  2022. #define FILE_COMPRESSION_NONE 0
  2023. #define FILE_COMPRESSION_WINLZA 1
  2024. #define FILE_COMPRESSION_MSZIP 2
  2025. #define FILE_COMPRESSION_NTCAB 3
  2026. WINSETUPAPI
  2027. DWORD
  2028. WINAPI
  2029. SetupDecompressOrCopyFileA(
  2030. IN PCSTR SourceFileName,
  2031. IN PCSTR TargetFileName,
  2032. IN PUINT CompressionType OPTIONAL
  2033. );
  2034. WINSETUPAPI
  2035. DWORD
  2036. WINAPI
  2037. SetupDecompressOrCopyFileW(
  2038. IN PCWSTR SourceFileName,
  2039. IN PCWSTR TargetFileName,
  2040. IN PUINT CompressionType OPTIONAL
  2041. );
  2042. #ifdef UNICODE
  2043. #define SetupDecompressOrCopyFile SetupDecompressOrCopyFileW
  2044. #else
  2045. #define SetupDecompressOrCopyFile SetupDecompressOrCopyFileA
  2046. #endif
  2047. WINSETUPAPI
  2048. BOOL
  2049. WINAPI
  2050. SetupGetSourceFileLocationA(
  2051. IN HINF InfHandle,
  2052. IN PINFCONTEXT InfContext, OPTIONAL
  2053. IN PCSTR FileName, OPTIONAL
  2054. OUT PUINT SourceId,
  2055. OUT PSTR ReturnBuffer, OPTIONAL
  2056. IN DWORD ReturnBufferSize,
  2057. OUT PDWORD RequiredSize OPTIONAL
  2058. );
  2059. WINSETUPAPI
  2060. BOOL
  2061. WINAPI
  2062. SetupGetSourceFileLocationW(
  2063. IN HINF InfHandle,
  2064. IN PINFCONTEXT InfContext, OPTIONAL
  2065. IN PCWSTR FileName, OPTIONAL
  2066. OUT PUINT SourceId,
  2067. OUT PWSTR ReturnBuffer, OPTIONAL
  2068. IN DWORD ReturnBufferSize,
  2069. OUT PDWORD RequiredSize OPTIONAL
  2070. );
  2071. #ifdef UNICODE
  2072. #define SetupGetSourceFileLocation SetupGetSourceFileLocationW
  2073. #else
  2074. #define SetupGetSourceFileLocation SetupGetSourceFileLocationA
  2075. #endif
  2076. WINSETUPAPI
  2077. BOOL
  2078. WINAPI
  2079. SetupGetSourceFileSizeA(
  2080. IN HINF InfHandle,
  2081. IN PINFCONTEXT InfContext, OPTIONAL
  2082. IN PCSTR FileName, OPTIONAL
  2083. IN PCSTR Section, OPTIONAL
  2084. OUT PDWORD FileSize,
  2085. IN UINT RoundingFactor OPTIONAL
  2086. );
  2087. WINSETUPAPI
  2088. BOOL
  2089. WINAPI
  2090. SetupGetSourceFileSizeW(
  2091. IN HINF InfHandle,
  2092. IN PINFCONTEXT InfContext, OPTIONAL
  2093. IN PCWSTR FileName, OPTIONAL
  2094. IN PCWSTR Section, OPTIONAL
  2095. OUT PDWORD FileSize,
  2096. IN UINT RoundingFactor OPTIONAL
  2097. );
  2098. #ifdef UNICODE
  2099. #define SetupGetSourceFileSize SetupGetSourceFileSizeW
  2100. #else
  2101. #define SetupGetSourceFileSize SetupGetSourceFileSizeA
  2102. #endif
  2103. WINSETUPAPI
  2104. BOOL
  2105. WINAPI
  2106. SetupGetTargetPathA(
  2107. IN HINF InfHandle,
  2108. IN PINFCONTEXT InfContext, OPTIONAL
  2109. IN PCSTR Section, OPTIONAL
  2110. OUT PSTR ReturnBuffer, OPTIONAL
  2111. IN DWORD ReturnBufferSize,
  2112. OUT PDWORD RequiredSize OPTIONAL
  2113. );
  2114. WINSETUPAPI
  2115. BOOL
  2116. WINAPI
  2117. SetupGetTargetPathW(
  2118. IN HINF InfHandle,
  2119. IN PINFCONTEXT InfContext, OPTIONAL
  2120. IN PCWSTR Section, OPTIONAL
  2121. OUT PWSTR ReturnBuffer, OPTIONAL
  2122. IN DWORD ReturnBufferSize,
  2123. OUT PDWORD RequiredSize OPTIONAL
  2124. );
  2125. #ifdef UNICODE
  2126. #define SetupGetTargetPath SetupGetTargetPathW
  2127. #else
  2128. #define SetupGetTargetPath SetupGetTargetPathA
  2129. #endif
  2130. //
  2131. // Define flags for SourceList APIs.
  2132. //
  2133. #define SRCLIST_TEMPORARY 0x00000001
  2134. #define SRCLIST_NOBROWSE 0x00000002
  2135. #define SRCLIST_SYSTEM 0x00000010
  2136. #define SRCLIST_USER 0x00000020
  2137. #define SRCLIST_SYSIFADMIN 0x00000040
  2138. #define SRCLIST_SUBDIRS 0x00000100
  2139. #define SRCLIST_APPEND 0x00000200
  2140. #define SRCLIST_NOSTRIPPLATFORM 0x00000400
  2141. WINSETUPAPI
  2142. BOOL
  2143. WINAPI
  2144. SetupSetSourceListA(
  2145. IN DWORD Flags,
  2146. IN PCSTR *SourceList,
  2147. IN UINT SourceCount
  2148. );
  2149. WINSETUPAPI
  2150. BOOL
  2151. WINAPI
  2152. SetupSetSourceListW(
  2153. IN DWORD Flags,
  2154. IN PCWSTR *SourceList,
  2155. IN UINT SourceCount
  2156. );
  2157. #ifdef UNICODE
  2158. #define SetupSetSourceList SetupSetSourceListW
  2159. #else
  2160. #define SetupSetSourceList SetupSetSourceListA
  2161. #endif
  2162. WINSETUPAPI
  2163. BOOL
  2164. WINAPI
  2165. SetupCancelTemporarySourceList(
  2166. VOID
  2167. );
  2168. WINSETUPAPI
  2169. BOOL
  2170. WINAPI
  2171. SetupAddToSourceListA(
  2172. IN DWORD Flags,
  2173. IN PCSTR Source
  2174. );
  2175. WINSETUPAPI
  2176. BOOL
  2177. WINAPI
  2178. SetupAddToSourceListW(
  2179. IN DWORD Flags,
  2180. IN PCWSTR Source
  2181. );
  2182. #ifdef UNICODE
  2183. #define SetupAddToSourceList SetupAddToSourceListW
  2184. #else
  2185. #define SetupAddToSourceList SetupAddToSourceListA
  2186. #endif
  2187. WINSETUPAPI
  2188. BOOL
  2189. WINAPI
  2190. SetupRemoveFromSourceListA(
  2191. IN DWORD Flags,
  2192. IN PCSTR Source
  2193. );
  2194. WINSETUPAPI
  2195. BOOL
  2196. WINAPI
  2197. SetupRemoveFromSourceListW(
  2198. IN DWORD Flags,
  2199. IN PCWSTR Source
  2200. );
  2201. #ifdef UNICODE
  2202. #define SetupRemoveFromSourceList SetupRemoveFromSourceListW
  2203. #else
  2204. #define SetupRemoveFromSourceList SetupRemoveFromSourceListA
  2205. #endif
  2206. WINSETUPAPI
  2207. BOOL
  2208. WINAPI
  2209. SetupQuerySourceListA(
  2210. IN DWORD Flags,
  2211. OUT PCSTR **List,
  2212. OUT PUINT Count
  2213. );
  2214. WINSETUPAPI
  2215. BOOL
  2216. WINAPI
  2217. SetupQuerySourceListW(
  2218. IN DWORD Flags,
  2219. OUT PCWSTR **List,
  2220. OUT PUINT Count
  2221. );
  2222. #ifdef UNICODE
  2223. #define SetupQuerySourceList SetupQuerySourceListW
  2224. #else
  2225. #define SetupQuerySourceList SetupQuerySourceListA
  2226. #endif
  2227. WINSETUPAPI
  2228. BOOL
  2229. WINAPI
  2230. SetupFreeSourceListA(
  2231. IN OUT PCSTR **List,
  2232. IN UINT Count
  2233. );
  2234. WINSETUPAPI
  2235. BOOL
  2236. WINAPI
  2237. SetupFreeSourceListW(
  2238. IN OUT PCWSTR **List,
  2239. IN UINT Count
  2240. );
  2241. #ifdef UNICODE
  2242. #define SetupFreeSourceList SetupFreeSourceListW
  2243. #else
  2244. #define SetupFreeSourceList SetupFreeSourceListA
  2245. #endif
  2246. WINSETUPAPI
  2247. UINT
  2248. WINAPI
  2249. SetupPromptForDiskA(
  2250. IN HWND hwndParent,
  2251. IN PCSTR DialogTitle, OPTIONAL
  2252. IN PCSTR DiskName, OPTIONAL
  2253. IN PCSTR PathToSource, OPTIONAL
  2254. IN PCSTR FileSought,
  2255. IN PCSTR TagFile, OPTIONAL
  2256. IN DWORD DiskPromptStyle,
  2257. OUT PSTR PathBuffer,
  2258. IN DWORD PathBufferSize,
  2259. OUT PDWORD PathRequiredSize
  2260. );
  2261. WINSETUPAPI
  2262. UINT
  2263. WINAPI
  2264. SetupPromptForDiskW(
  2265. IN HWND hwndParent,
  2266. IN PCWSTR DialogTitle, OPTIONAL
  2267. IN PCWSTR DiskName, OPTIONAL
  2268. IN PCWSTR PathToSource, OPTIONAL
  2269. IN PCWSTR FileSought,
  2270. IN PCWSTR TagFile, OPTIONAL
  2271. IN DWORD DiskPromptStyle,
  2272. OUT PWSTR PathBuffer,
  2273. IN DWORD PathBufferSize,
  2274. OUT PDWORD PathRequiredSize
  2275. );
  2276. #ifdef UNICODE
  2277. #define SetupPromptForDisk SetupPromptForDiskW
  2278. #else
  2279. #define SetupPromptForDisk SetupPromptForDiskA
  2280. #endif
  2281. WINSETUPAPI
  2282. UINT
  2283. WINAPI
  2284. SetupCopyErrorA(
  2285. IN HWND hwndParent,
  2286. IN PCSTR DialogTitle, OPTIONAL
  2287. IN PCSTR DiskName, OPTIONAL
  2288. IN PCSTR PathToSource,
  2289. IN PCSTR SourceFile,
  2290. IN PCSTR TargetPathFile, OPTIONAL
  2291. IN UINT Win32ErrorCode,
  2292. IN DWORD Style,
  2293. OUT PSTR PathBuffer, OPTIONAL
  2294. IN DWORD PathBufferSize,
  2295. OUT PDWORD PathRequiredSize OPTIONAL
  2296. );
  2297. WINSETUPAPI
  2298. UINT
  2299. WINAPI
  2300. SetupCopyErrorW(
  2301. IN HWND hwndParent,
  2302. IN PCWSTR DialogTitle, OPTIONAL
  2303. IN PCWSTR DiskName, OPTIONAL
  2304. IN PCWSTR PathToSource,
  2305. IN PCWSTR SourceFile,
  2306. IN PCWSTR TargetPathFile, OPTIONAL
  2307. IN UINT Win32ErrorCode,
  2308. IN DWORD Style,
  2309. OUT PWSTR PathBuffer, OPTIONAL
  2310. IN DWORD PathBufferSize,
  2311. OUT PDWORD PathRequiredSize OPTIONAL
  2312. );
  2313. #ifdef UNICODE
  2314. #define SetupCopyError SetupCopyErrorW
  2315. #else
  2316. #define SetupCopyError SetupCopyErrorA
  2317. #endif
  2318. WINSETUPAPI
  2319. UINT
  2320. WINAPI
  2321. SetupRenameErrorA(
  2322. IN HWND hwndParent,
  2323. IN PCSTR DialogTitle, OPTIONAL
  2324. IN PCSTR SourceFile,
  2325. IN PCSTR TargetFile,
  2326. IN UINT Win32ErrorCode,
  2327. IN DWORD Style
  2328. );
  2329. WINSETUPAPI
  2330. UINT
  2331. WINAPI
  2332. SetupRenameErrorW(
  2333. IN HWND hwndParent,
  2334. IN PCWSTR DialogTitle, OPTIONAL
  2335. IN PCWSTR SourceFile,
  2336. IN PCWSTR TargetFile,
  2337. IN UINT Win32ErrorCode,
  2338. IN DWORD Style
  2339. );
  2340. #ifdef UNICODE
  2341. #define SetupRenameError SetupRenameErrorW
  2342. #else
  2343. #define SetupRenameError SetupRenameErrorA
  2344. #endif
  2345. WINSETUPAPI
  2346. UINT
  2347. WINAPI
  2348. SetupDeleteErrorA(
  2349. IN HWND hwndParent,
  2350. IN PCSTR DialogTitle, OPTIONAL
  2351. IN PCSTR File,
  2352. IN UINT Win32ErrorCode,
  2353. IN DWORD Style
  2354. );
  2355. WINSETUPAPI
  2356. UINT
  2357. WINAPI
  2358. SetupDeleteErrorW(
  2359. IN HWND hwndParent,
  2360. IN PCWSTR DialogTitle, OPTIONAL
  2361. IN PCWSTR File,
  2362. IN UINT Win32ErrorCode,
  2363. IN DWORD Style
  2364. );
  2365. #ifdef UNICODE
  2366. #define SetupDeleteError SetupDeleteErrorW
  2367. #else
  2368. #define SetupDeleteError SetupDeleteErrorA
  2369. #endif
  2370. WINSETUPAPI
  2371. UINT
  2372. WINAPI
  2373. SetupBackupErrorA(
  2374. IN HWND hwndParent,
  2375. IN PCSTR DialogTitle, OPTIONAL
  2376. IN PCSTR SourceFile,
  2377. IN PCSTR TargetFile, OPTIONAL
  2378. IN UINT Win32ErrorCode,
  2379. IN DWORD Style
  2380. );
  2381. WINSETUPAPI
  2382. UINT
  2383. WINAPI
  2384. SetupBackupErrorW(
  2385. IN HWND hwndParent,
  2386. IN PCWSTR DialogTitle, OPTIONAL
  2387. IN PCWSTR SourceFile,
  2388. IN PCWSTR TargetFile, OPTIONAL
  2389. IN UINT Win32ErrorCode,
  2390. IN DWORD Style
  2391. );
  2392. #ifdef UNICODE
  2393. #define SetupBackupError SetupBackupErrorW
  2394. #else
  2395. #define SetupBackupError SetupBackupErrorA
  2396. #endif
  2397. //
  2398. // Styles for SetupPromptForDisk, SetupCopyError,
  2399. // SetupRenameError, SetupDeleteError
  2400. //
  2401. #define IDF_NOBROWSE 0x00000001
  2402. #define IDF_NOSKIP 0x00000002
  2403. #define IDF_NODETAILS 0x00000004
  2404. #define IDF_NOCOMPRESSED 0x00000008
  2405. #define IDF_CHECKFIRST 0x00000100
  2406. #define IDF_NOBEEP 0x00000200
  2407. #define IDF_NOFOREGROUND 0x00000400
  2408. #define IDF_WARNIFSKIP 0x00000800
  2409. #if _SETUPAPI_VER >= 0x0501
  2410. #define IDF_NOREMOVABLEMEDIAPROMPT 0x00001000
  2411. #define IDF_USEDISKNAMEASPROMPT 0x00002000
  2412. #define IDF_OEMDISK 0x80000000
  2413. #endif // _SETUPAPI_VER >= 0x0501
  2414. //
  2415. // Return values for SetupPromptForDisk, SetupCopyError,
  2416. // SetupRenameError, SetupDeleteError, SetupBackupError
  2417. //
  2418. #define DPROMPT_SUCCESS 0
  2419. #define DPROMPT_CANCEL 1
  2420. #define DPROMPT_SKIPFILE 2
  2421. #define DPROMPT_BUFFERTOOSMALL 3
  2422. #define DPROMPT_OUTOFMEMORY 4
  2423. WINSETUPAPI
  2424. BOOL
  2425. WINAPI
  2426. SetupSetDirectoryIdA(
  2427. IN HINF InfHandle,
  2428. IN DWORD Id, OPTIONAL
  2429. IN PCSTR Directory OPTIONAL
  2430. );
  2431. WINSETUPAPI
  2432. BOOL
  2433. WINAPI
  2434. SetupSetDirectoryIdW(
  2435. IN HINF InfHandle,
  2436. IN DWORD Id, OPTIONAL
  2437. IN PCWSTR Directory OPTIONAL
  2438. );
  2439. #ifdef UNICODE
  2440. #define SetupSetDirectoryId SetupSetDirectoryIdW
  2441. #else
  2442. #define SetupSetDirectoryId SetupSetDirectoryIdA
  2443. #endif
  2444. WINSETUPAPI
  2445. BOOL
  2446. WINAPI
  2447. SetupSetDirectoryIdExA(
  2448. IN HINF InfHandle,
  2449. IN DWORD Id, OPTIONAL
  2450. IN PCSTR Directory, OPTIONAL
  2451. IN DWORD Flags,
  2452. IN DWORD Reserved1,
  2453. IN PVOID Reserved2
  2454. );
  2455. WINSETUPAPI
  2456. BOOL
  2457. WINAPI
  2458. SetupSetDirectoryIdExW(
  2459. IN HINF InfHandle,
  2460. IN DWORD Id, OPTIONAL
  2461. IN PCWSTR Directory, OPTIONAL
  2462. IN DWORD Flags,
  2463. IN DWORD Reserved1,
  2464. IN PVOID Reserved2
  2465. );
  2466. #ifdef UNICODE
  2467. #define SetupSetDirectoryIdEx SetupSetDirectoryIdExW
  2468. #else
  2469. #define SetupSetDirectoryIdEx SetupSetDirectoryIdExA
  2470. #endif
  2471. //
  2472. // Flags for SetupSetDirectoryIdEx
  2473. //
  2474. #define SETDIRID_NOT_FULL_PATH 0x00000001
  2475. WINSETUPAPI
  2476. BOOL
  2477. WINAPI
  2478. SetupGetSourceInfoA(
  2479. IN HINF InfHandle,
  2480. IN UINT SourceId,
  2481. IN UINT InfoDesired,
  2482. OUT PSTR ReturnBuffer, OPTIONAL
  2483. IN DWORD ReturnBufferSize,
  2484. OUT PDWORD RequiredSize OPTIONAL
  2485. );
  2486. WINSETUPAPI
  2487. BOOL
  2488. WINAPI
  2489. SetupGetSourceInfoW(
  2490. IN HINF InfHandle,
  2491. IN UINT SourceId,
  2492. IN UINT InfoDesired,
  2493. OUT PWSTR ReturnBuffer, OPTIONAL
  2494. IN DWORD ReturnBufferSize,
  2495. OUT PDWORD RequiredSize OPTIONAL
  2496. );
  2497. #ifdef UNICODE
  2498. #define SetupGetSourceInfo SetupGetSourceInfoW
  2499. #else
  2500. #define SetupGetSourceInfo SetupGetSourceInfoA
  2501. #endif
  2502. //
  2503. // InfoDesired values for SetupGetSourceInfo
  2504. //
  2505. #define SRCINFO_PATH 1
  2506. #define SRCINFO_TAGFILE 2
  2507. #define SRCINFO_DESCRIPTION 3
  2508. #define SRCINFO_FLAGS 4
  2509. #if _SETUPAPI_VER >= 0x0501
  2510. //
  2511. // SRC_FLAGS allow special treatment of source
  2512. // lower 4 bits are reserved for OS use
  2513. // the flags may determine what other parameters exist
  2514. //
  2515. #define SRCINFO_TAGFILE2 5 // alternate tagfile, when SRCINFO_TAGFILE is a cabfile
  2516. #define SRC_FLAGS_CABFILE (0x0010) // if set, treat SRCINFO_TAGFILE as a cabfile and specify alternate tagfile
  2517. #endif // _SETUPAPI_VER >= 0x0501
  2518. WINSETUPAPI
  2519. BOOL
  2520. WINAPI
  2521. SetupInstallFileA(
  2522. IN HINF InfHandle, OPTIONAL
  2523. IN PINFCONTEXT InfContext, OPTIONAL
  2524. IN PCSTR SourceFile, OPTIONAL
  2525. IN PCSTR SourcePathRoot, OPTIONAL
  2526. IN PCSTR DestinationName, OPTIONAL
  2527. IN DWORD CopyStyle,
  2528. IN PSP_FILE_CALLBACK_A CopyMsgHandler, OPTIONAL
  2529. IN PVOID Context OPTIONAL
  2530. );
  2531. WINSETUPAPI
  2532. BOOL
  2533. WINAPI
  2534. SetupInstallFileW(
  2535. IN HINF InfHandle, OPTIONAL
  2536. IN PINFCONTEXT InfContext, OPTIONAL
  2537. IN PCWSTR SourceFile, OPTIONAL
  2538. IN PCWSTR SourcePathRoot, OPTIONAL
  2539. IN PCWSTR DestinationName, OPTIONAL
  2540. IN DWORD CopyStyle,
  2541. IN PSP_FILE_CALLBACK_W CopyMsgHandler, OPTIONAL
  2542. IN PVOID Context OPTIONAL
  2543. );
  2544. #ifdef UNICODE
  2545. #define SetupInstallFile SetupInstallFileW
  2546. #else
  2547. #define SetupInstallFile SetupInstallFileA
  2548. #endif
  2549. WINSETUPAPI
  2550. BOOL
  2551. WINAPI
  2552. SetupInstallFileExA(
  2553. IN HINF InfHandle, OPTIONAL
  2554. IN PINFCONTEXT InfContext, OPTIONAL
  2555. IN PCSTR SourceFile, OPTIONAL
  2556. IN PCSTR SourcePathRoot, OPTIONAL
  2557. IN PCSTR DestinationName, OPTIONAL
  2558. IN DWORD CopyStyle,
  2559. IN PSP_FILE_CALLBACK_A CopyMsgHandler, OPTIONAL
  2560. IN PVOID Context, OPTIONAL
  2561. OUT PBOOL FileWasInUse
  2562. );
  2563. WINSETUPAPI
  2564. BOOL
  2565. WINAPI
  2566. SetupInstallFileExW(
  2567. IN HINF InfHandle, OPTIONAL
  2568. IN PINFCONTEXT InfContext, OPTIONAL
  2569. IN PCWSTR SourceFile, OPTIONAL
  2570. IN PCWSTR SourcePathRoot, OPTIONAL
  2571. IN PCWSTR DestinationName, OPTIONAL
  2572. IN DWORD CopyStyle,
  2573. IN PSP_FILE_CALLBACK_W CopyMsgHandler, OPTIONAL
  2574. IN PVOID Context, OPTIONAL
  2575. OUT PBOOL FileWasInUse
  2576. );
  2577. #ifdef UNICODE
  2578. #define SetupInstallFileEx SetupInstallFileExW
  2579. #else
  2580. #define SetupInstallFileEx SetupInstallFileExA
  2581. #endif
  2582. //
  2583. // CopyStyle values for copy and queue-related APIs
  2584. //
  2585. #define SP_COPY_DELETESOURCE 0x0000001 // delete source file on successful copy
  2586. #define SP_COPY_REPLACEONLY 0x0000002 // copy only if target file already present
  2587. #define SP_COPY_NEWER 0x0000004 // copy only if source newer than or same as target
  2588. #define SP_COPY_NEWER_OR_SAME SP_COPY_NEWER
  2589. #define SP_COPY_NOOVERWRITE 0x0000008 // copy only if target doesn't exist
  2590. #define SP_COPY_NODECOMP 0x0000010 // don't decompress source file while copying
  2591. #define SP_COPY_LANGUAGEAWARE 0x0000020 // don't overwrite file of different language
  2592. #define SP_COPY_SOURCE_ABSOLUTE 0x0000040 // SourceFile is a full source path
  2593. #define SP_COPY_SOURCEPATH_ABSOLUTE 0x0000080 // SourcePathRoot is the full path
  2594. #define SP_COPY_IN_USE_NEEDS_REBOOT 0x0000100 // System needs reboot if file in use
  2595. #define SP_COPY_FORCE_IN_USE 0x0000200 // Force target-in-use behavior
  2596. #define SP_COPY_NOSKIP 0x0000400 // Skip is disallowed for this file or section
  2597. #define SP_FLAG_CABINETCONTINUATION 0x0000800 // Used with need media notification
  2598. #define SP_COPY_FORCE_NOOVERWRITE 0x0001000 // like NOOVERWRITE but no callback nofitication
  2599. #define SP_COPY_FORCE_NEWER 0x0002000 // like NEWER but no callback nofitication
  2600. #define SP_COPY_WARNIFSKIP 0x0004000 // system critical file: warn if user tries to skip
  2601. #define SP_COPY_NOBROWSE 0x0008000 // Browsing is disallowed for this file or section
  2602. #define SP_COPY_NEWER_ONLY 0x0010000 // copy only if source file newer than target
  2603. #define SP_COPY_SOURCE_SIS_MASTER 0x0020000 // source is single-instance store master
  2604. #define SP_COPY_OEMINF_CATALOG_ONLY 0x0040000 // (SetupCopyOEMInf only) don't copy INF--just catalog
  2605. #define SP_COPY_REPLACE_BOOT_FILE 0x0080000 // file must be present upon reboot (i.e., it's
  2606. // needed by the loader); this flag implies a reboot
  2607. #define SP_COPY_NOPRUNE 0x0100000 // never prune this file
  2608. #if _SETUPAPI_VER >= 0x0501
  2609. #define SP_COPY_OEM_F6_INF 0x0200000 // Used when calling SetupCopyOemInf
  2610. #endif //_SETUPAPI_VER >= 0x0501
  2611. #if _SETUPAPI_VER >= 0x0501
  2612. //
  2613. // Flags passed to Backup notification
  2614. //
  2615. #define SP_BACKUP_BACKUPPASS 0x00000001 // file backed up during backup pass
  2616. #define SP_BACKUP_DEMANDPASS 0x00000002 // file backed up on demand
  2617. #define SP_BACKUP_SPECIAL 0x00000004 // if set, special type of backup
  2618. #define SP_BACKUP_BOOTFILE 0x00000008 // file marked with COPYFLG_REPLACE_BOOT_FILE
  2619. #endif //_SETUPAPI_VER >= 0x0501
  2620. WINSETUPAPI
  2621. HSPFILEQ
  2622. WINAPI
  2623. SetupOpenFileQueue(
  2624. VOID
  2625. );
  2626. WINSETUPAPI
  2627. BOOL
  2628. WINAPI
  2629. SetupCloseFileQueue(
  2630. IN HSPFILEQ QueueHandle
  2631. );
  2632. WINSETUPAPI
  2633. BOOL
  2634. WINAPI
  2635. SetupSetFileQueueAlternatePlatformA(
  2636. IN HSPFILEQ QueueHandle,
  2637. IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo, OPTIONAL
  2638. IN PCSTR AlternateDefaultCatalogFile OPTIONAL
  2639. );
  2640. WINSETUPAPI
  2641. BOOL
  2642. WINAPI
  2643. SetupSetFileQueueAlternatePlatformW(
  2644. IN HSPFILEQ QueueHandle,
  2645. IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo, OPTIONAL
  2646. IN PCWSTR AlternateDefaultCatalogFile OPTIONAL
  2647. );
  2648. #ifdef UNICODE
  2649. #define SetupSetFileQueueAlternatePlatform SetupSetFileQueueAlternatePlatformW
  2650. #else
  2651. #define SetupSetFileQueueAlternatePlatform SetupSetFileQueueAlternatePlatformA
  2652. #endif
  2653. WINSETUPAPI
  2654. BOOL
  2655. WINAPI
  2656. SetupSetPlatformPathOverrideA(
  2657. IN PCSTR Override OPTIONAL
  2658. );
  2659. WINSETUPAPI
  2660. BOOL
  2661. WINAPI
  2662. SetupSetPlatformPathOverrideW(
  2663. IN PCWSTR Override OPTIONAL
  2664. );
  2665. #ifdef UNICODE
  2666. #define SetupSetPlatformPathOverride SetupSetPlatformPathOverrideW
  2667. #else
  2668. #define SetupSetPlatformPathOverride SetupSetPlatformPathOverrideA
  2669. #endif
  2670. WINSETUPAPI
  2671. BOOL
  2672. WINAPI
  2673. SetupQueueCopyA(
  2674. IN HSPFILEQ QueueHandle,
  2675. IN PCSTR SourceRootPath, OPTIONAL
  2676. IN PCSTR SourcePath, OPTIONAL
  2677. IN PCSTR SourceFilename,
  2678. IN PCSTR SourceDescription, OPTIONAL
  2679. IN PCSTR SourceTagfile, OPTIONAL
  2680. IN PCSTR TargetDirectory,
  2681. IN PCSTR TargetFilename, OPTIONAL
  2682. IN DWORD CopyStyle
  2683. );
  2684. WINSETUPAPI
  2685. BOOL
  2686. WINAPI
  2687. SetupQueueCopyW(
  2688. IN HSPFILEQ QueueHandle,
  2689. IN PCWSTR SourceRootPath, OPTIONAL
  2690. IN PCWSTR SourcePath, OPTIONAL
  2691. IN PCWSTR SourceFilename,
  2692. IN PCWSTR SourceDescription, OPTIONAL
  2693. IN PCWSTR SourceTagfile, OPTIONAL
  2694. IN PCWSTR TargetDirectory,
  2695. IN PCWSTR TargetFilename, OPTIONAL
  2696. IN DWORD CopyStyle
  2697. );
  2698. #ifdef UNICODE
  2699. #define SetupQueueCopy SetupQueueCopyW
  2700. #else
  2701. #define SetupQueueCopy SetupQueueCopyA
  2702. #endif
  2703. WINSETUPAPI
  2704. BOOL
  2705. WINAPI
  2706. SetupQueueCopyIndirectA(
  2707. IN PSP_FILE_COPY_PARAMS_A CopyParams
  2708. );
  2709. WINSETUPAPI
  2710. BOOL
  2711. WINAPI
  2712. SetupQueueCopyIndirectW(
  2713. IN PSP_FILE_COPY_PARAMS_W CopyParams
  2714. );
  2715. #ifdef UNICODE
  2716. #define SetupQueueCopyIndirect SetupQueueCopyIndirectW
  2717. #else
  2718. #define SetupQueueCopyIndirect SetupQueueCopyIndirectA
  2719. #endif
  2720. WINSETUPAPI
  2721. BOOL
  2722. WINAPI
  2723. SetupQueueDefaultCopyA(
  2724. IN HSPFILEQ QueueHandle,
  2725. IN HINF InfHandle,
  2726. IN PCSTR SourceRootPath,
  2727. IN PCSTR SourceFilename,
  2728. IN PCSTR TargetFilename,
  2729. IN DWORD CopyStyle
  2730. );
  2731. WINSETUPAPI
  2732. BOOL
  2733. WINAPI
  2734. SetupQueueDefaultCopyW(
  2735. IN HSPFILEQ QueueHandle,
  2736. IN HINF InfHandle,
  2737. IN PCWSTR SourceRootPath,
  2738. IN PCWSTR SourceFilename,
  2739. IN PCWSTR TargetFilename,
  2740. IN DWORD CopyStyle
  2741. );
  2742. #ifdef UNICODE
  2743. #define SetupQueueDefaultCopy SetupQueueDefaultCopyW
  2744. #else
  2745. #define SetupQueueDefaultCopy SetupQueueDefaultCopyA
  2746. #endif
  2747. WINSETUPAPI
  2748. BOOL
  2749. WINAPI
  2750. SetupQueueCopySectionA(
  2751. IN HSPFILEQ QueueHandle,
  2752. IN PCSTR SourceRootPath,
  2753. IN HINF InfHandle,
  2754. IN HINF ListInfHandle, OPTIONAL
  2755. IN PCSTR Section,
  2756. IN DWORD CopyStyle
  2757. );
  2758. WINSETUPAPI
  2759. BOOL
  2760. WINAPI
  2761. SetupQueueCopySectionW(
  2762. IN HSPFILEQ QueueHandle,
  2763. IN PCWSTR SourceRootPath,
  2764. IN HINF InfHandle,
  2765. IN HINF ListInfHandle, OPTIONAL
  2766. IN PCWSTR Section,
  2767. IN DWORD CopyStyle
  2768. );
  2769. #ifdef UNICODE
  2770. #define SetupQueueCopySection SetupQueueCopySectionW
  2771. #else
  2772. #define SetupQueueCopySection SetupQueueCopySectionA
  2773. #endif
  2774. WINSETUPAPI
  2775. BOOL
  2776. WINAPI
  2777. SetupQueueDeleteA(
  2778. IN HSPFILEQ QueueHandle,
  2779. IN PCSTR PathPart1,
  2780. IN PCSTR PathPart2 OPTIONAL
  2781. );
  2782. WINSETUPAPI
  2783. BOOL
  2784. WINAPI
  2785. SetupQueueDeleteW(
  2786. IN HSPFILEQ QueueHandle,
  2787. IN PCWSTR PathPart1,
  2788. IN PCWSTR PathPart2 OPTIONAL
  2789. );
  2790. #ifdef UNICODE
  2791. #define SetupQueueDelete SetupQueueDeleteW
  2792. #else
  2793. #define SetupQueueDelete SetupQueueDeleteA
  2794. #endif
  2795. WINSETUPAPI
  2796. BOOL
  2797. WINAPI
  2798. SetupQueueDeleteSectionA(
  2799. IN HSPFILEQ QueueHandle,
  2800. IN HINF InfHandle,
  2801. IN HINF ListInfHandle, OPTIONAL
  2802. IN PCSTR Section
  2803. );
  2804. WINSETUPAPI
  2805. BOOL
  2806. WINAPI
  2807. SetupQueueDeleteSectionW(
  2808. IN HSPFILEQ QueueHandle,
  2809. IN HINF InfHandle,
  2810. IN HINF ListInfHandle, OPTIONAL
  2811. IN PCWSTR Section
  2812. );
  2813. #ifdef UNICODE
  2814. #define SetupQueueDeleteSection SetupQueueDeleteSectionW
  2815. #else
  2816. #define SetupQueueDeleteSection SetupQueueDeleteSectionA
  2817. #endif
  2818. WINSETUPAPI
  2819. BOOL
  2820. WINAPI
  2821. SetupQueueRenameA(
  2822. IN HSPFILEQ QueueHandle,
  2823. IN PCSTR SourcePath,
  2824. IN PCSTR SourceFilename, OPTIONAL
  2825. IN PCSTR TargetPath, OPTIONAL
  2826. IN PCSTR TargetFilename
  2827. );
  2828. WINSETUPAPI
  2829. BOOL
  2830. WINAPI
  2831. SetupQueueRenameW(
  2832. IN HSPFILEQ QueueHandle,
  2833. IN PCWSTR SourcePath,
  2834. IN PCWSTR SourceFilename, OPTIONAL
  2835. IN PCWSTR TargetPath, OPTIONAL
  2836. IN PCWSTR TargetFilename
  2837. );
  2838. #ifdef UNICODE
  2839. #define SetupQueueRename SetupQueueRenameW
  2840. #else
  2841. #define SetupQueueRename SetupQueueRenameA
  2842. #endif
  2843. WINSETUPAPI
  2844. BOOL
  2845. WINAPI
  2846. SetupQueueRenameSectionA(
  2847. IN HSPFILEQ QueueHandle,
  2848. IN HINF InfHandle,
  2849. IN HINF ListInfHandle, OPTIONAL
  2850. IN PCSTR Section
  2851. );
  2852. WINSETUPAPI
  2853. BOOL
  2854. WINAPI
  2855. SetupQueueRenameSectionW(
  2856. IN HSPFILEQ QueueHandle,
  2857. IN HINF InfHandle,
  2858. IN HINF ListInfHandle, OPTIONAL
  2859. IN PCWSTR Section
  2860. );
  2861. #ifdef UNICODE
  2862. #define SetupQueueRenameSection SetupQueueRenameSectionW
  2863. #else
  2864. #define SetupQueueRenameSection SetupQueueRenameSectionA
  2865. #endif
  2866. WINSETUPAPI
  2867. BOOL
  2868. WINAPI
  2869. SetupCommitFileQueueA(
  2870. IN HWND Owner, OPTIONAL
  2871. IN HSPFILEQ QueueHandle,
  2872. IN PSP_FILE_CALLBACK_A MsgHandler,
  2873. IN PVOID Context
  2874. );
  2875. WINSETUPAPI
  2876. BOOL
  2877. WINAPI
  2878. SetupCommitFileQueueW(
  2879. IN HWND Owner, OPTIONAL
  2880. IN HSPFILEQ QueueHandle,
  2881. IN PSP_FILE_CALLBACK_W MsgHandler,
  2882. IN PVOID Context
  2883. );
  2884. #ifdef UNICODE
  2885. #define SetupCommitFileQueue SetupCommitFileQueueW
  2886. #else
  2887. #define SetupCommitFileQueue SetupCommitFileQueueA
  2888. #endif
  2889. WINSETUPAPI
  2890. BOOL
  2891. WINAPI
  2892. SetupScanFileQueueA(
  2893. IN HSPFILEQ FileQueue,
  2894. IN DWORD Flags,
  2895. IN HWND Window, OPTIONAL
  2896. IN PSP_FILE_CALLBACK_A CallbackRoutine, OPTIONAL
  2897. IN PVOID CallbackContext, OPTIONAL
  2898. OUT PDWORD Result
  2899. );
  2900. WINSETUPAPI
  2901. BOOL
  2902. WINAPI
  2903. SetupScanFileQueueW(
  2904. IN HSPFILEQ FileQueue,
  2905. IN DWORD Flags,
  2906. IN HWND Window, OPTIONAL
  2907. IN PSP_FILE_CALLBACK_W CallbackRoutine, OPTIONAL
  2908. IN PVOID CallbackContext, OPTIONAL
  2909. OUT PDWORD Result
  2910. );
  2911. #ifdef UNICODE
  2912. #define SetupScanFileQueue SetupScanFileQueueW
  2913. #else
  2914. #define SetupScanFileQueue SetupScanFileQueueA
  2915. #endif
  2916. //
  2917. // Define flags for SetupScanFileQueue.
  2918. //
  2919. #define SPQ_SCAN_FILE_PRESENCE 0x00000001
  2920. #define SPQ_SCAN_FILE_VALIDITY 0x00000002
  2921. #define SPQ_SCAN_USE_CALLBACK 0x00000004
  2922. #define SPQ_SCAN_USE_CALLBACKEX 0x00000008
  2923. #define SPQ_SCAN_INFORM_USER 0x00000010
  2924. #define SPQ_SCAN_PRUNE_COPY_QUEUE 0x00000020
  2925. #if _SETUPAPI_VER >= 0x0501
  2926. #define SPQ_SCAN_USE_CALLBACK_SIGNERINFO 0x00000040
  2927. #define SPQ_SCAN_PRUNE_DELREN 0x00000080 // remote Delete/Rename queue
  2928. #endif // _SETUPAPI_VER >= 0x0501
  2929. //
  2930. // Define flags used with Param2 for SPFILENOTIFY_QUEUESCAN
  2931. //
  2932. #define SPQ_DELAYED_COPY 0x00000001 // file was in use; registered for delayed copy
  2933. #if _SETUPAPI_VER >= 0x0501
  2934. WINSETUPAPI
  2935. BOOL
  2936. WINAPI
  2937. SetupGetFileQueueCount(
  2938. IN HSPFILEQ FileQueue,
  2939. IN UINT SubQueueFileOp,
  2940. OUT PUINT NumOperations
  2941. );
  2942. WINSETUPAPI
  2943. BOOL
  2944. WINAPI
  2945. SetupGetFileQueueFlags(
  2946. IN HSPFILEQ FileQueue,
  2947. OUT PDWORD Flags
  2948. );
  2949. WINSETUPAPI
  2950. BOOL
  2951. WINAPI
  2952. SetupSetFileQueueFlags(
  2953. IN HSPFILEQ FileQueue,
  2954. IN DWORD FlagMask,
  2955. IN DWORD Flags
  2956. );
  2957. //
  2958. // Flags/FlagMask for use with SetupSetFileQueueFlags and returned by SetupGetFileQueueFlags
  2959. //
  2960. #define SPQ_FLAG_BACKUP_AWARE 0x00000001 // If set, SetupCommitFileQueue will
  2961. // issue backup notifications.
  2962. #define SPQ_FLAG_ABORT_IF_UNSIGNED 0x00000002 // If set, SetupCommitFileQueue will
  2963. // fail with ERROR_SET_SYSTEM_RESTORE_POINT
  2964. // if the user elects to proceed with an
  2965. // unsigned queue committal. This allows
  2966. // the caller to set a system restore point,
  2967. // then re-commit the file queue.
  2968. #define SPQ_FLAG_FILES_MODIFIED 0x00000004 // If set, at least one file was
  2969. // replaced by a different version
  2970. #define SPQ_FLAG_VALID 0x00000007 // mask of valid flags (can be passed as FlagMask)
  2971. #endif // _SETUPAPI_VER >= 0x0501
  2972. //
  2973. // Define OEM Source Type values for use in SetupCopyOEMInf.
  2974. //
  2975. #define SPOST_NONE 0
  2976. #define SPOST_PATH 1
  2977. #define SPOST_URL 2
  2978. #define SPOST_MAX 3
  2979. WINSETUPAPI
  2980. BOOL
  2981. WINAPI
  2982. SetupCopyOEMInfA(
  2983. IN PCSTR SourceInfFileName,
  2984. IN PCSTR OEMSourceMediaLocation, OPTIONAL
  2985. IN DWORD OEMSourceMediaType,
  2986. IN DWORD CopyStyle,
  2987. OUT PSTR DestinationInfFileName, OPTIONAL
  2988. IN DWORD DestinationInfFileNameSize,
  2989. OUT PDWORD RequiredSize, OPTIONAL
  2990. OUT PSTR *DestinationInfFileNameComponent OPTIONAL
  2991. );
  2992. WINSETUPAPI
  2993. BOOL
  2994. WINAPI
  2995. SetupCopyOEMInfW(
  2996. IN PCWSTR SourceInfFileName,
  2997. IN PCWSTR OEMSourceMediaLocation, OPTIONAL
  2998. IN DWORD OEMSourceMediaType,
  2999. IN DWORD CopyStyle,
  3000. OUT PWSTR DestinationInfFileName, OPTIONAL
  3001. IN DWORD DestinationInfFileNameSize,
  3002. OUT PDWORD RequiredSize, OPTIONAL
  3003. OUT PWSTR *DestinationInfFileNameComponent OPTIONAL
  3004. );
  3005. #ifdef UNICODE
  3006. #define SetupCopyOEMInf SetupCopyOEMInfW
  3007. #else
  3008. #define SetupCopyOEMInf SetupCopyOEMInfA
  3009. #endif
  3010. #if _SETUPAPI_VER >= 0x0501
  3011. //
  3012. // Flags used by SetupUninstallOEMInf
  3013. //
  3014. #define SUOI_FORCEDELETE 0x00000001
  3015. WINSETUPAPI
  3016. BOOL
  3017. WINAPI
  3018. SetupUninstallOEMInfA(
  3019. IN PCSTR InfFileName,
  3020. IN DWORD Flags,
  3021. IN PVOID Reserved
  3022. );
  3023. WINSETUPAPI
  3024. BOOL
  3025. WINAPI
  3026. SetupUninstallOEMInfW(
  3027. IN PCWSTR InfFileName,
  3028. IN DWORD Flags,
  3029. IN PVOID Reserved
  3030. );
  3031. #ifdef UNICODE
  3032. #define SetupUninstallOEMInf SetupUninstallOEMInfW
  3033. #else
  3034. #define SetupUninstallOEMInf SetupUninstallOEMInfA
  3035. #endif
  3036. WINSETUPAPI
  3037. BOOL
  3038. WINAPI
  3039. SetupUninstallNewlyCopiedInfs(
  3040. IN HSPFILEQ FileQueue,
  3041. IN DWORD Flags,
  3042. IN PVOID Reserved
  3043. );
  3044. #endif // _SETUPAPI_VER >= 0x0501
  3045. //
  3046. // Disk space list APIs
  3047. //
  3048. WINSETUPAPI
  3049. HDSKSPC
  3050. WINAPI
  3051. SetupCreateDiskSpaceListA(
  3052. IN PVOID Reserved1,
  3053. IN DWORD Reserved2,
  3054. IN UINT Flags
  3055. );
  3056. WINSETUPAPI
  3057. HDSKSPC
  3058. WINAPI
  3059. SetupCreateDiskSpaceListW(
  3060. IN PVOID Reserved1,
  3061. IN DWORD Reserved2,
  3062. IN UINT Flags
  3063. );
  3064. #ifdef UNICODE
  3065. #define SetupCreateDiskSpaceList SetupCreateDiskSpaceListW
  3066. #else
  3067. #define SetupCreateDiskSpaceList SetupCreateDiskSpaceListA
  3068. #endif
  3069. //
  3070. // Flags for SetupCreateDiskSpaceList
  3071. //
  3072. #define SPDSL_IGNORE_DISK 0x00000001 // ignore deletes and on-disk files in copies
  3073. #define SPDSL_DISALLOW_NEGATIVE_ADJUST 0x00000002
  3074. WINSETUPAPI
  3075. HDSKSPC
  3076. WINAPI
  3077. SetupDuplicateDiskSpaceListA(
  3078. IN HDSKSPC DiskSpace,
  3079. IN PVOID Reserved1,
  3080. IN DWORD Reserved2,
  3081. IN UINT Flags
  3082. );
  3083. WINSETUPAPI
  3084. HDSKSPC
  3085. WINAPI
  3086. SetupDuplicateDiskSpaceListW(
  3087. IN HDSKSPC DiskSpace,
  3088. IN PVOID Reserved1,
  3089. IN DWORD Reserved2,
  3090. IN UINT Flags
  3091. );
  3092. #ifdef UNICODE
  3093. #define SetupDuplicateDiskSpaceList SetupDuplicateDiskSpaceListW
  3094. #else
  3095. #define SetupDuplicateDiskSpaceList SetupDuplicateDiskSpaceListA
  3096. #endif
  3097. WINSETUPAPI
  3098. BOOL
  3099. WINAPI
  3100. SetupDestroyDiskSpaceList(
  3101. IN OUT HDSKSPC DiskSpace
  3102. );
  3103. WINSETUPAPI
  3104. BOOL
  3105. WINAPI
  3106. SetupQueryDrivesInDiskSpaceListA(
  3107. IN HDSKSPC DiskSpace,
  3108. OUT PSTR ReturnBuffer, OPTIONAL
  3109. IN DWORD ReturnBufferSize,
  3110. OUT PDWORD RequiredSize OPTIONAL
  3111. );
  3112. WINSETUPAPI
  3113. BOOL
  3114. WINAPI
  3115. SetupQueryDrivesInDiskSpaceListW(
  3116. IN HDSKSPC DiskSpace,
  3117. OUT PWSTR ReturnBuffer, OPTIONAL
  3118. IN DWORD ReturnBufferSize,
  3119. OUT PDWORD RequiredSize OPTIONAL
  3120. );
  3121. #ifdef UNICODE
  3122. #define SetupQueryDrivesInDiskSpaceList SetupQueryDrivesInDiskSpaceListW
  3123. #else
  3124. #define SetupQueryDrivesInDiskSpaceList SetupQueryDrivesInDiskSpaceListA
  3125. #endif
  3126. WINSETUPAPI
  3127. BOOL
  3128. WINAPI
  3129. SetupQuerySpaceRequiredOnDriveA(
  3130. IN HDSKSPC DiskSpace,
  3131. IN PCSTR DriveSpec,
  3132. OUT LONGLONG *SpaceRequired,
  3133. IN PVOID Reserved1,
  3134. IN UINT Reserved2
  3135. );
  3136. WINSETUPAPI
  3137. BOOL
  3138. WINAPI
  3139. SetupQuerySpaceRequiredOnDriveW(
  3140. IN HDSKSPC DiskSpace,
  3141. IN PCWSTR DriveSpec,
  3142. OUT LONGLONG *SpaceRequired,
  3143. IN PVOID Reserved1,
  3144. IN UINT Reserved2
  3145. );
  3146. #ifdef UNICODE
  3147. #define SetupQuerySpaceRequiredOnDrive SetupQuerySpaceRequiredOnDriveW
  3148. #else
  3149. #define SetupQuerySpaceRequiredOnDrive SetupQuerySpaceRequiredOnDriveA
  3150. #endif
  3151. WINSETUPAPI
  3152. BOOL
  3153. WINAPI
  3154. SetupAdjustDiskSpaceListA(
  3155. IN HDSKSPC DiskSpace,
  3156. IN LPCSTR DriveRoot,
  3157. IN LONGLONG Amount,
  3158. IN PVOID Reserved1,
  3159. IN UINT Reserved2
  3160. );
  3161. WINSETUPAPI
  3162. BOOL
  3163. WINAPI
  3164. SetupAdjustDiskSpaceListW(
  3165. IN HDSKSPC DiskSpace,
  3166. IN LPCWSTR DriveRoot,
  3167. IN LONGLONG Amount,
  3168. IN PVOID Reserved1,
  3169. IN UINT Reserved2
  3170. );
  3171. #ifdef UNICODE
  3172. #define SetupAdjustDiskSpaceList SetupAdjustDiskSpaceListW
  3173. #else
  3174. #define SetupAdjustDiskSpaceList SetupAdjustDiskSpaceListA
  3175. #endif
  3176. WINSETUPAPI
  3177. BOOL
  3178. WINAPI
  3179. SetupAddToDiskSpaceListA(
  3180. IN HDSKSPC DiskSpace,
  3181. IN PCSTR TargetFilespec,
  3182. IN LONGLONG FileSize,
  3183. IN UINT Operation,
  3184. IN PVOID Reserved1,
  3185. IN UINT Reserved2
  3186. );
  3187. WINSETUPAPI
  3188. BOOL
  3189. WINAPI
  3190. SetupAddToDiskSpaceListW(
  3191. IN HDSKSPC DiskSpace,
  3192. IN PCWSTR TargetFilespec,
  3193. IN LONGLONG FileSize,
  3194. IN UINT Operation,
  3195. IN PVOID Reserved1,
  3196. IN UINT Reserved2
  3197. );
  3198. #ifdef UNICODE
  3199. #define SetupAddToDiskSpaceList SetupAddToDiskSpaceListW
  3200. #else
  3201. #define SetupAddToDiskSpaceList SetupAddToDiskSpaceListA
  3202. #endif
  3203. WINSETUPAPI
  3204. BOOL
  3205. WINAPI
  3206. SetupAddSectionToDiskSpaceListA(
  3207. IN HDSKSPC DiskSpace,
  3208. IN HINF InfHandle,
  3209. IN HINF ListInfHandle, OPTIONAL
  3210. IN PCSTR SectionName,
  3211. IN UINT Operation,
  3212. IN PVOID Reserved1,
  3213. IN UINT Reserved2
  3214. );
  3215. WINSETUPAPI
  3216. BOOL
  3217. WINAPI
  3218. SetupAddSectionToDiskSpaceListW(
  3219. IN HDSKSPC DiskSpace,
  3220. IN HINF InfHandle,
  3221. IN HINF ListInfHandle, OPTIONAL
  3222. IN PCWSTR SectionName,
  3223. IN UINT Operation,
  3224. IN PVOID Reserved1,
  3225. IN UINT Reserved2
  3226. );
  3227. #ifdef UNICODE
  3228. #define SetupAddSectionToDiskSpaceList SetupAddSectionToDiskSpaceListW
  3229. #else
  3230. #define SetupAddSectionToDiskSpaceList SetupAddSectionToDiskSpaceListA
  3231. #endif
  3232. WINSETUPAPI
  3233. BOOL
  3234. WINAPI
  3235. SetupAddInstallSectionToDiskSpaceListA(
  3236. IN HDSKSPC DiskSpace,
  3237. IN HINF InfHandle,
  3238. IN HINF LayoutInfHandle, OPTIONAL
  3239. IN PCSTR SectionName,
  3240. IN PVOID Reserved1,
  3241. IN UINT Reserved2
  3242. );
  3243. WINSETUPAPI
  3244. BOOL
  3245. WINAPI
  3246. SetupAddInstallSectionToDiskSpaceListW(
  3247. IN HDSKSPC DiskSpace,
  3248. IN HINF InfHandle,
  3249. IN HINF LayoutInfHandle, OPTIONAL
  3250. IN PCWSTR SectionName,
  3251. IN PVOID Reserved1,
  3252. IN UINT Reserved2
  3253. );
  3254. #ifdef UNICODE
  3255. #define SetupAddInstallSectionToDiskSpaceList SetupAddInstallSectionToDiskSpaceListW
  3256. #else
  3257. #define SetupAddInstallSectionToDiskSpaceList SetupAddInstallSectionToDiskSpaceListA
  3258. #endif
  3259. WINSETUPAPI
  3260. BOOL
  3261. WINAPI
  3262. SetupRemoveFromDiskSpaceListA(
  3263. IN HDSKSPC DiskSpace,
  3264. IN PCSTR TargetFilespec,
  3265. IN UINT Operation,
  3266. IN PVOID Reserved1,
  3267. IN UINT Reserved2
  3268. );
  3269. WINSETUPAPI
  3270. BOOL
  3271. WINAPI
  3272. SetupRemoveFromDiskSpaceListW(
  3273. IN HDSKSPC DiskSpace,
  3274. IN PCWSTR TargetFilespec,
  3275. IN UINT Operation,
  3276. IN PVOID Reserved1,
  3277. IN UINT Reserved2
  3278. );
  3279. #ifdef UNICODE
  3280. #define SetupRemoveFromDiskSpaceList SetupRemoveFromDiskSpaceListW
  3281. #else
  3282. #define SetupRemoveFromDiskSpaceList SetupRemoveFromDiskSpaceListA
  3283. #endif
  3284. WINSETUPAPI
  3285. BOOL
  3286. WINAPI
  3287. SetupRemoveSectionFromDiskSpaceListA(
  3288. IN HDSKSPC DiskSpace,
  3289. IN HINF InfHandle,
  3290. IN HINF ListInfHandle, OPTIONAL
  3291. IN PCSTR SectionName,
  3292. IN UINT Operation,
  3293. IN PVOID Reserved1,
  3294. IN UINT Reserved2
  3295. );
  3296. WINSETUPAPI
  3297. BOOL
  3298. WINAPI
  3299. SetupRemoveSectionFromDiskSpaceListW(
  3300. IN HDSKSPC DiskSpace,
  3301. IN HINF InfHandle,
  3302. IN HINF ListInfHandle, OPTIONAL
  3303. IN PCWSTR SectionName,
  3304. IN UINT Operation,
  3305. IN PVOID Reserved1,
  3306. IN UINT Reserved2
  3307. );
  3308. #ifdef UNICODE
  3309. #define SetupRemoveSectionFromDiskSpaceList SetupRemoveSectionFromDiskSpaceListW
  3310. #else
  3311. #define SetupRemoveSectionFromDiskSpaceList SetupRemoveSectionFromDiskSpaceListA
  3312. #endif
  3313. WINSETUPAPI
  3314. BOOL
  3315. WINAPI
  3316. SetupRemoveInstallSectionFromDiskSpaceListA(
  3317. IN HDSKSPC DiskSpace,
  3318. IN HINF InfHandle,
  3319. IN HINF LayoutInfHandle, OPTIONAL
  3320. IN PCSTR SectionName,
  3321. IN PVOID Reserved1,
  3322. IN UINT Reserved2
  3323. );
  3324. WINSETUPAPI
  3325. BOOL
  3326. WINAPI
  3327. SetupRemoveInstallSectionFromDiskSpaceListW(
  3328. IN HDSKSPC DiskSpace,
  3329. IN HINF InfHandle,
  3330. IN HINF LayoutInfHandle, OPTIONAL
  3331. IN PCWSTR SectionName,
  3332. IN PVOID Reserved1,
  3333. IN UINT Reserved2
  3334. );
  3335. #ifdef UNICODE
  3336. #define SetupRemoveInstallSectionFromDiskSpaceList SetupRemoveInstallSectionFromDiskSpaceListW
  3337. #else
  3338. #define SetupRemoveInstallSectionFromDiskSpaceList SetupRemoveInstallSectionFromDiskSpaceListA
  3339. #endif
  3340. //
  3341. // Cabinet APIs
  3342. //
  3343. WINSETUPAPI
  3344. BOOL
  3345. WINAPI
  3346. SetupIterateCabinetA(
  3347. IN PCSTR CabinetFile,
  3348. IN DWORD Reserved,
  3349. IN PSP_FILE_CALLBACK_A MsgHandler,
  3350. IN PVOID Context
  3351. );
  3352. WINSETUPAPI
  3353. BOOL
  3354. WINAPI
  3355. SetupIterateCabinetW(
  3356. IN PCWSTR CabinetFile,
  3357. IN DWORD Reserved,
  3358. IN PSP_FILE_CALLBACK_W MsgHandler,
  3359. IN PVOID Context
  3360. );
  3361. #ifdef UNICODE
  3362. #define SetupIterateCabinet SetupIterateCabinetW
  3363. #else
  3364. #define SetupIterateCabinet SetupIterateCabinetA
  3365. #endif
  3366. WINSETUPAPI
  3367. INT
  3368. WINAPI
  3369. SetupPromptReboot(
  3370. IN HSPFILEQ FileQueue, OPTIONAL
  3371. IN HWND Owner,
  3372. IN BOOL ScanOnly
  3373. );
  3374. //
  3375. // Define flags that are returned by SetupPromptReboot
  3376. //
  3377. #define SPFILEQ_FILE_IN_USE 0x00000001
  3378. #define SPFILEQ_REBOOT_RECOMMENDED 0x00000002
  3379. #define SPFILEQ_REBOOT_IN_PROGRESS 0x00000004
  3380. WINSETUPAPI
  3381. PVOID
  3382. WINAPI
  3383. SetupInitDefaultQueueCallback(
  3384. IN HWND OwnerWindow
  3385. );
  3386. WINSETUPAPI
  3387. PVOID
  3388. WINAPI
  3389. SetupInitDefaultQueueCallbackEx(
  3390. IN HWND OwnerWindow,
  3391. IN HWND AlternateProgressWindow, OPTIONAL
  3392. IN UINT ProgressMessage,
  3393. IN DWORD Reserved1,
  3394. IN PVOID Reserved2
  3395. );
  3396. WINSETUPAPI
  3397. VOID
  3398. WINAPI
  3399. SetupTermDefaultQueueCallback(
  3400. IN PVOID Context
  3401. );
  3402. WINSETUPAPI
  3403. UINT
  3404. WINAPI
  3405. SetupDefaultQueueCallbackA(
  3406. IN PVOID Context,
  3407. IN UINT Notification,
  3408. IN UINT_PTR Param1,
  3409. IN UINT_PTR Param2
  3410. );
  3411. WINSETUPAPI
  3412. UINT
  3413. WINAPI
  3414. SetupDefaultQueueCallbackW(
  3415. IN PVOID Context,
  3416. IN UINT Notification,
  3417. IN UINT_PTR Param1,
  3418. IN UINT_PTR Param2
  3419. );
  3420. #ifdef UNICODE
  3421. #define SetupDefaultQueueCallback SetupDefaultQueueCallbackW
  3422. #else
  3423. #define SetupDefaultQueueCallback SetupDefaultQueueCallbackA
  3424. #endif
  3425. //
  3426. // Flags for AddReg section lines in INF. The corresponding value
  3427. // is <ValueType> in the AddReg line format given below:
  3428. //
  3429. // <RegRootString>,<SubKey>,<ValueName>,<ValueType>,<Value>...
  3430. //
  3431. // The low word contains basic flags concerning the general data type
  3432. // and AddReg action. The high word contains values that more specifically
  3433. // identify the data type of the registry value. The high word is ignored
  3434. // by the 16-bit Windows 95 SETUPX APIs.
  3435. //
  3436. // If <ValueType> has FLG_ADDREG_DELREG_BIT set, it will be ignored by AddReg
  3437. // (not supported by SetupX).
  3438. //
  3439. #if _SETUPAPI_VER >= 0x0501
  3440. #define FLG_ADDREG_DELREG_BIT ( 0x00008000 ) // if set, interpret as DELREG, see below
  3441. #endif // _SETUPAPI_VER >= 0x0501
  3442. #define FLG_ADDREG_BINVALUETYPE ( 0x00000001 )
  3443. #define FLG_ADDREG_NOCLOBBER ( 0x00000002 )
  3444. #define FLG_ADDREG_DELVAL ( 0x00000004 )
  3445. #define FLG_ADDREG_APPEND ( 0x00000008 ) // Currently supported only
  3446. // for REG_MULTI_SZ values.
  3447. #define FLG_ADDREG_KEYONLY ( 0x00000010 ) // Just create the key, ignore value
  3448. #define FLG_ADDREG_OVERWRITEONLY ( 0x00000020 ) // Set only if value already exists
  3449. #if _SETUPAPI_VER >= 0x0501
  3450. #define FLG_ADDREG_64BITKEY ( 0x00001000 ) // make this change in the 64 bit registry.
  3451. #define FLG_ADDREG_KEYONLY_COMMON ( 0x00002000 ) // same as FLG_ADDREG_KEYONLY but also works for DELREG
  3452. #define FLG_ADDREG_32BITKEY ( 0x00004000 ) // make this change in the 32 bit registry.
  3453. #endif // _SETUPAPI_VER >= 0x0501
  3454. //
  3455. // The INF may supply any arbitrary data type ordinal in the highword except
  3456. // for the following: REG_NONE, REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ. If this
  3457. // technique is used, then the data is given in binary format, one byte per
  3458. // field.
  3459. //
  3460. #define FLG_ADDREG_TYPE_MASK ( 0xFFFF0000 | FLG_ADDREG_BINVALUETYPE )
  3461. #define FLG_ADDREG_TYPE_SZ ( 0x00000000 )
  3462. #define FLG_ADDREG_TYPE_MULTI_SZ ( 0x00010000 )
  3463. #define FLG_ADDREG_TYPE_EXPAND_SZ ( 0x00020000 )
  3464. #define FLG_ADDREG_TYPE_BINARY ( 0x00000000 | FLG_ADDREG_BINVALUETYPE )
  3465. #define FLG_ADDREG_TYPE_DWORD ( 0x00010000 | FLG_ADDREG_BINVALUETYPE )
  3466. #define FLG_ADDREG_TYPE_NONE ( 0x00020000 | FLG_ADDREG_BINVALUETYPE )
  3467. //
  3468. // Flags for DelReg section lines in INF. The corresponding value
  3469. // is <Operation> in the extended DelReg line format given below:
  3470. //
  3471. // <RegRootString>,<SubKey>,<ValueName>,<Operation>[,...]
  3472. //
  3473. // In SetupX and some versions of SetupAPI, <Operation> will be ignored and <ValueName> will
  3474. // be deleted. Use with care.
  3475. //
  3476. // The bits determined by mask FLG_DELREG_TYPE_MASK indicates type of data expected.
  3477. // <Operation> must have FLG_ADDREG_DELREG_BIT set, otherwise it is ignored and specified
  3478. // value will be deleted (allowing an AddReg section to also be used as a DelReg section)
  3479. // if <Operation> is not specified, <ValueName> will be deleted (if specified) otherwise
  3480. // <SubKey> will be deleted.
  3481. //
  3482. // the compatability flag
  3483. //
  3484. #define FLG_DELREG_VALUE (0x00000000)
  3485. #if _SETUPAPI_VER >= 0x0501
  3486. #define FLG_DELREG_TYPE_MASK FLG_ADDREG_TYPE_MASK // 0xFFFF0001
  3487. #define FLG_DELREG_TYPE_SZ FLG_ADDREG_TYPE_SZ // 0x00000000
  3488. #define FLG_DELREG_TYPE_MULTI_SZ FLG_ADDREG_TYPE_MULTI_SZ // 0x00010000
  3489. #define FLG_DELREG_TYPE_EXPAND_SZ FLG_ADDREG_TYPE_EXPAND_SZ // 0x00020000
  3490. #define FLG_DELREG_TYPE_BINARY FLG_ADDREG_TYPE_BINARY // 0x00000001
  3491. #define FLG_DELREG_TYPE_DWORD FLG_ADDREG_TYPE_DWORD // 0x00010001
  3492. #define FLG_DELREG_TYPE_NONE FLG_ADDREG_TYPE_NONE // 0x00020001
  3493. #define FLG_DELREG_64BITKEY FLG_ADDREG_64BITKEY // 0x00001000
  3494. #define FLG_DELREG_KEYONLY_COMMON FLG_ADDREG_KEYONLY_COMMON // 0x00002000
  3495. #define FLG_DELREG_32BITKEY FLG_ADDREG_32BITKEY // 0x00004000
  3496. //
  3497. // <Operation> = FLG_DELREG_MULTI_SZ_DELSTRING
  3498. // <RegRootString>,<SubKey>,<ValueName>,0x00018002,<String>
  3499. // removes all entries matching <String> (case ignored) from multi-sz registry value
  3500. //
  3501. #define FLG_DELREG_OPERATION_MASK (0x000000FE)
  3502. #define FLG_DELREG_MULTI_SZ_DELSTRING ( FLG_DELREG_TYPE_MULTI_SZ | FLG_ADDREG_DELREG_BIT | 0x00000002 ) // 0x00018002
  3503. #endif // _SETUPAPI_VER >= 0x0501
  3504. //
  3505. // Flags for BitReg section lines in INF.
  3506. //
  3507. #define FLG_BITREG_CLEARBITS ( 0x00000000 )
  3508. #define FLG_BITREG_SETBITS ( 0x00000001 )
  3509. #if _SETUPAPI_VER >= 0x0501
  3510. #define FLG_BITREG_64BITKEY ( 0x00001000 )
  3511. #define FLG_BITREG_32BITKEY ( 0x00004000 )
  3512. #endif // _SETUPAPI_VER >= 0x0501
  3513. //
  3514. // Flags for Ini2Reg section lines in INF.
  3515. //
  3516. #if _SETUPAPI_VER >= 0x0501
  3517. #define FLG_INI2REG_64BITKEY ( 0x00001000 )
  3518. #define FLG_INI2REG_32BITKEY ( 0x00004000 )
  3519. #endif // _SETUPAPI_VER >= 0x0501
  3520. //
  3521. // Flags for RegSvr section lines in INF
  3522. //
  3523. #define FLG_REGSVR_DLLREGISTER ( 0x00000001 )
  3524. #define FLG_REGSVR_DLLINSTALL ( 0x00000002 )
  3525. // Flags for RegSvr section lines in INF
  3526. //
  3527. #define FLG_PROFITEM_CURRENTUSER ( 0x00000001 )
  3528. #define FLG_PROFITEM_DELETE ( 0x00000002 )
  3529. #define FLG_PROFITEM_GROUP ( 0x00000004 )
  3530. #define FLG_PROFITEM_CSIDL ( 0x00000008 )
  3531. WINSETUPAPI
  3532. BOOL
  3533. WINAPI
  3534. SetupInstallFromInfSectionA(
  3535. IN HWND Owner,
  3536. IN HINF InfHandle,
  3537. IN PCSTR SectionName,
  3538. IN UINT Flags,
  3539. IN HKEY RelativeKeyRoot, OPTIONAL
  3540. IN PCSTR SourceRootPath, OPTIONAL
  3541. IN UINT CopyFlags, OPTIONAL
  3542. IN PSP_FILE_CALLBACK_A MsgHandler, OPTIONAL
  3543. IN PVOID Context, OPTIONAL
  3544. IN HDEVINFO DeviceInfoSet, OPTIONAL
  3545. IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  3546. );
  3547. WINSETUPAPI
  3548. BOOL
  3549. WINAPI
  3550. SetupInstallFromInfSectionW(
  3551. IN HWND Owner,
  3552. IN HINF InfHandle,
  3553. IN PCWSTR SectionName,
  3554. IN UINT Flags,
  3555. IN HKEY RelativeKeyRoot, OPTIONAL
  3556. IN PCWSTR SourceRootPath, OPTIONAL
  3557. IN UINT CopyFlags, OPTIONAL
  3558. IN PSP_FILE_CALLBACK_W MsgHandler, OPTIONAL
  3559. IN PVOID Context, OPTIONAL
  3560. IN HDEVINFO DeviceInfoSet, OPTIONAL
  3561. IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  3562. );
  3563. #ifdef UNICODE
  3564. #define SetupInstallFromInfSection SetupInstallFromInfSectionW
  3565. #else
  3566. #define SetupInstallFromInfSection SetupInstallFromInfSectionA
  3567. #endif
  3568. //
  3569. // Flags for SetupInstallFromInfSection
  3570. //
  3571. #define SPINST_LOGCONFIG 0x00000001
  3572. #define SPINST_INIFILES 0x00000002
  3573. #define SPINST_REGISTRY 0x00000004
  3574. #define SPINST_INI2REG 0x00000008
  3575. #define SPINST_FILES 0x00000010
  3576. #define SPINST_BITREG 0x00000020
  3577. #define SPINST_REGSVR 0x00000040
  3578. #define SPINST_UNREGSVR 0x00000080
  3579. #define SPINST_PROFILEITEMS 0x00000100
  3580. #if _SETUPAPI_VER >= 0x0501
  3581. #define SPINST_COPYINF 0x00000200
  3582. #define SPINST_ALL 0x000003ff
  3583. #else
  3584. #define SPINST_ALL 0x000001ff
  3585. #endif // _SETUPAPI_VER >= 0x0501
  3586. #define SPINST_SINGLESECTION 0x00010000
  3587. #define SPINST_LOGCONFIG_IS_FORCED 0x00020000
  3588. #define SPINST_LOGCONFIGS_ARE_OVERRIDES 0x00040000
  3589. #if _SETUPAPI_VER >= 0x0501
  3590. #define SPINST_REGISTERCALLBACKAWARE 0x00080000
  3591. #endif // _SETUPAPI_VER >= 0x0501
  3592. WINSETUPAPI
  3593. BOOL
  3594. WINAPI
  3595. SetupInstallFilesFromInfSectionA(
  3596. IN HINF InfHandle,
  3597. IN HINF LayoutInfHandle, OPTIONAL
  3598. IN HSPFILEQ FileQueue,
  3599. IN PCSTR SectionName,
  3600. IN PCSTR SourceRootPath, OPTIONAL
  3601. IN UINT CopyFlags
  3602. );
  3603. WINSETUPAPI
  3604. BOOL
  3605. WINAPI
  3606. SetupInstallFilesFromInfSectionW(
  3607. IN HINF InfHandle,
  3608. IN HINF LayoutInfHandle, OPTIONAL
  3609. IN HSPFILEQ FileQueue,
  3610. IN PCWSTR SectionName,
  3611. IN PCWSTR SourceRootPath, OPTIONAL
  3612. IN UINT CopyFlags
  3613. );
  3614. #ifdef UNICODE
  3615. #define SetupInstallFilesFromInfSection SetupInstallFilesFromInfSectionW
  3616. #else
  3617. #define SetupInstallFilesFromInfSection SetupInstallFilesFromInfSectionA
  3618. #endif
  3619. //
  3620. // Flags for SetupInstallServicesFromInfSection(Ex). These flags are also used
  3621. // in the flags field of AddService or DelService lines in a device INF. Some
  3622. // of these flags are not permitted in the non-Ex API. These flags are marked
  3623. // as such below.
  3624. //
  3625. //
  3626. // (AddService) move service's tag to front of its group order list
  3627. //
  3628. #define SPSVCINST_TAGTOFRONT (0x00000001)
  3629. //
  3630. // (AddService) **Ex API only** mark this service as the function driver for the
  3631. // device being installed
  3632. //
  3633. #define SPSVCINST_ASSOCSERVICE (0x00000002)
  3634. //
  3635. // (DelService) delete the associated event log entry for a service specified in
  3636. // a DelService entry
  3637. //
  3638. #define SPSVCINST_DELETEEVENTLOGENTRY (0x00000004)
  3639. //
  3640. // (AddService) don't overwrite display name if it already exists
  3641. //
  3642. #define SPSVCINST_NOCLOBBER_DISPLAYNAME (0x00000008)
  3643. //
  3644. // (AddService) don't overwrite start type value if service already exists
  3645. //
  3646. #define SPSVCINST_NOCLOBBER_STARTTYPE (0x00000010)
  3647. //
  3648. // (AddService) don't overwrite error control value if service already exists
  3649. //
  3650. #define SPSVCINST_NOCLOBBER_ERRORCONTROL (0x00000020)
  3651. //
  3652. // (AddService) don't overwrite load order group if it already exists
  3653. //
  3654. #define SPSVCINST_NOCLOBBER_LOADORDERGROUP (0x00000040)
  3655. //
  3656. // (AddService) don't overwrite dependencies list if it already exists
  3657. //
  3658. #define SPSVCINST_NOCLOBBER_DEPENDENCIES (0x00000080)
  3659. //
  3660. // (AddService) don't overwrite description if it already exists
  3661. //
  3662. #define SPSVCINST_NOCLOBBER_DESCRIPTION (0x00000100)
  3663. //
  3664. // (DelService) stop the associated service specified in
  3665. // a DelService entry before deleting the service
  3666. //
  3667. #define SPSVCINST_STOPSERVICE (0x00000200)
  3668. #if _SETUPAPI_VER >= 0x0501
  3669. //
  3670. // (AddService) force overwrite of security settings
  3671. //
  3672. #define SPSVCINST_CLOBBER_SECURITY (0x00000400)
  3673. #endif // _SETUPAPI_VER >= 0x0501
  3674. WINSETUPAPI
  3675. BOOL
  3676. WINAPI
  3677. SetupInstallServicesFromInfSectionA(
  3678. IN HINF InfHandle,
  3679. IN PCSTR SectionName,
  3680. IN DWORD Flags
  3681. );
  3682. WINSETUPAPI
  3683. BOOL
  3684. WINAPI
  3685. SetupInstallServicesFromInfSectionW(
  3686. IN HINF InfHandle,
  3687. IN PCWSTR SectionName,
  3688. IN DWORD Flags
  3689. );
  3690. #ifdef UNICODE
  3691. #define SetupInstallServicesFromInfSection SetupInstallServicesFromInfSectionW
  3692. #else
  3693. #define SetupInstallServicesFromInfSection SetupInstallServicesFromInfSectionA
  3694. #endif
  3695. WINSETUPAPI
  3696. BOOL
  3697. WINAPI
  3698. SetupInstallServicesFromInfSectionExA(
  3699. IN HINF InfHandle,
  3700. IN PCSTR SectionName,
  3701. IN DWORD Flags,
  3702. IN HDEVINFO DeviceInfoSet, OPTIONAL
  3703. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  3704. IN PVOID Reserved1,
  3705. IN PVOID Reserved2
  3706. );
  3707. WINSETUPAPI
  3708. BOOL
  3709. WINAPI
  3710. SetupInstallServicesFromInfSectionExW(
  3711. IN HINF InfHandle,
  3712. IN PCWSTR SectionName,
  3713. IN DWORD Flags,
  3714. IN HDEVINFO DeviceInfoSet, OPTIONAL
  3715. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  3716. IN PVOID Reserved1,
  3717. IN PVOID Reserved2
  3718. );
  3719. #ifdef UNICODE
  3720. #define SetupInstallServicesFromInfSectionEx SetupInstallServicesFromInfSectionExW
  3721. #else
  3722. #define SetupInstallServicesFromInfSectionEx SetupInstallServicesFromInfSectionExA
  3723. #endif
  3724. //
  3725. // High level routine, usually used via rundll32.dll
  3726. // to perform right-click install action on INFs
  3727. // May be called directly:
  3728. //
  3729. // wsprintf(CmdLineBuffer,TEXT("DefaultInstall 132 %s"),InfPath);
  3730. // InstallHinfSection(NULL,NULL,CmdLineBuffer,0);
  3731. //
  3732. VOID
  3733. WINAPI
  3734. InstallHinfSectionA(
  3735. IN HWND Window,
  3736. IN HINSTANCE ModuleHandle,
  3737. IN PCSTR CommandLine,
  3738. IN INT ShowCommand
  3739. );
  3740. VOID
  3741. WINAPI
  3742. InstallHinfSectionW(
  3743. IN HWND Window,
  3744. IN HINSTANCE ModuleHandle,
  3745. IN PCWSTR CommandLine,
  3746. IN INT ShowCommand
  3747. );
  3748. #ifdef UNICODE
  3749. #define InstallHinfSection InstallHinfSectionW
  3750. #else
  3751. #define InstallHinfSection InstallHinfSectionA
  3752. #endif
  3753. //
  3754. // Define handle type for Setup file log.
  3755. //
  3756. typedef PVOID HSPFILELOG;
  3757. WINSETUPAPI
  3758. HSPFILELOG
  3759. WINAPI
  3760. SetupInitializeFileLogA(
  3761. IN PCSTR LogFileName, OPTIONAL
  3762. IN DWORD Flags
  3763. );
  3764. WINSETUPAPI
  3765. HSPFILELOG
  3766. WINAPI
  3767. SetupInitializeFileLogW(
  3768. IN PCWSTR LogFileName, OPTIONAL
  3769. IN DWORD Flags
  3770. );
  3771. #ifdef UNICODE
  3772. #define SetupInitializeFileLog SetupInitializeFileLogW
  3773. #else
  3774. #define SetupInitializeFileLog SetupInitializeFileLogA
  3775. #endif
  3776. //
  3777. // Flags for SetupInitializeFileLog
  3778. //
  3779. #define SPFILELOG_SYSTEMLOG 0x00000001 // use system log -- must be Administrator
  3780. #define SPFILELOG_FORCENEW 0x00000002 // not valid with SPFILELOG_SYSTEMLOG
  3781. #define SPFILELOG_QUERYONLY 0x00000004 // allows non-administrators to read system log
  3782. WINSETUPAPI
  3783. BOOL
  3784. WINAPI
  3785. SetupTerminateFileLog(
  3786. IN HSPFILELOG FileLogHandle
  3787. );
  3788. WINSETUPAPI
  3789. BOOL
  3790. WINAPI
  3791. SetupLogFileA(
  3792. IN HSPFILELOG FileLogHandle,
  3793. IN PCSTR LogSectionName, OPTIONAL
  3794. IN PCSTR SourceFilename,
  3795. IN PCSTR TargetFilename,
  3796. IN DWORD Checksum, OPTIONAL
  3797. IN PCSTR DiskTagfile, OPTIONAL
  3798. IN PCSTR DiskDescription, OPTIONAL
  3799. IN PCSTR OtherInfo, OPTIONAL
  3800. IN DWORD Flags
  3801. );
  3802. WINSETUPAPI
  3803. BOOL
  3804. WINAPI
  3805. SetupLogFileW(
  3806. IN HSPFILELOG FileLogHandle,
  3807. IN PCWSTR LogSectionName, OPTIONAL
  3808. IN PCWSTR SourceFilename,
  3809. IN PCWSTR TargetFilename,
  3810. IN DWORD Checksum, OPTIONAL
  3811. IN PCWSTR DiskTagfile, OPTIONAL
  3812. IN PCWSTR DiskDescription, OPTIONAL
  3813. IN PCWSTR OtherInfo, OPTIONAL
  3814. IN DWORD Flags
  3815. );
  3816. #ifdef UNICODE
  3817. #define SetupLogFile SetupLogFileW
  3818. #else
  3819. #define SetupLogFile SetupLogFileA
  3820. #endif
  3821. //
  3822. // Flags for SetupLogFile
  3823. //
  3824. #define SPFILELOG_OEMFILE 0x00000001
  3825. WINSETUPAPI
  3826. BOOL
  3827. WINAPI
  3828. SetupRemoveFileLogEntryA(
  3829. IN HSPFILELOG FileLogHandle,
  3830. IN PCSTR LogSectionName, OPTIONAL
  3831. IN PCSTR TargetFilename OPTIONAL
  3832. );
  3833. WINSETUPAPI
  3834. BOOL
  3835. WINAPI
  3836. SetupRemoveFileLogEntryW(
  3837. IN HSPFILELOG FileLogHandle,
  3838. IN PCWSTR LogSectionName, OPTIONAL
  3839. IN PCWSTR TargetFilename OPTIONAL
  3840. );
  3841. #ifdef UNICODE
  3842. #define SetupRemoveFileLogEntry SetupRemoveFileLogEntryW
  3843. #else
  3844. #define SetupRemoveFileLogEntry SetupRemoveFileLogEntryA
  3845. #endif
  3846. //
  3847. // Items retrievable from SetupQueryFileLog()
  3848. //
  3849. typedef enum {
  3850. SetupFileLogSourceFilename,
  3851. SetupFileLogChecksum,
  3852. SetupFileLogDiskTagfile,
  3853. SetupFileLogDiskDescription,
  3854. SetupFileLogOtherInfo,
  3855. SetupFileLogMax
  3856. } SetupFileLogInfo;
  3857. WINSETUPAPI
  3858. BOOL
  3859. WINAPI
  3860. SetupQueryFileLogA(
  3861. IN HSPFILELOG FileLogHandle,
  3862. IN PCSTR LogSectionName, OPTIONAL
  3863. IN PCSTR TargetFilename,
  3864. IN SetupFileLogInfo DesiredInfo,
  3865. OUT PSTR DataOut, OPTIONAL
  3866. IN DWORD ReturnBufferSize,
  3867. OUT PDWORD RequiredSize OPTIONAL
  3868. );
  3869. WINSETUPAPI
  3870. BOOL
  3871. WINAPI
  3872. SetupQueryFileLogW(
  3873. IN HSPFILELOG FileLogHandle,
  3874. IN PCWSTR LogSectionName, OPTIONAL
  3875. IN PCWSTR TargetFilename,
  3876. IN SetupFileLogInfo DesiredInfo,
  3877. OUT PWSTR DataOut, OPTIONAL
  3878. IN DWORD ReturnBufferSize,
  3879. OUT PDWORD RequiredSize OPTIONAL
  3880. );
  3881. #ifdef UNICODE
  3882. #define SetupQueryFileLog SetupQueryFileLogW
  3883. #else
  3884. #define SetupQueryFileLog SetupQueryFileLogA
  3885. #endif
  3886. //
  3887. // Text logging APIs
  3888. //
  3889. #define LogSeverity DWORD
  3890. #define LogSevInformation 0x00000000
  3891. #define LogSevWarning 0x00000001
  3892. #define LogSevError 0x00000002
  3893. #define LogSevFatalError 0x00000003
  3894. #define LogSevMaximum 0x00000004
  3895. WINSETUPAPI
  3896. BOOL
  3897. WINAPI
  3898. SetupOpenLog (
  3899. BOOL Erase
  3900. );
  3901. WINSETUPAPI
  3902. BOOL
  3903. WINAPI
  3904. SetupLogErrorA (
  3905. IN LPCSTR MessageString,
  3906. IN LogSeverity Severity
  3907. );
  3908. WINSETUPAPI
  3909. BOOL
  3910. WINAPI
  3911. SetupLogErrorW (
  3912. IN LPCWSTR MessageString,
  3913. IN LogSeverity Severity
  3914. );
  3915. #ifdef UNICODE
  3916. #define SetupLogError SetupLogErrorW
  3917. #else
  3918. #define SetupLogError SetupLogErrorA
  3919. #endif
  3920. WINSETUPAPI
  3921. VOID
  3922. WINAPI
  3923. SetupCloseLog (
  3924. VOID
  3925. );
  3926. //
  3927. // Backup Information API's
  3928. //
  3929. WINSETUPAPI
  3930. BOOL
  3931. WINAPI
  3932. SetupGetBackupInformationA(
  3933. IN HSPFILEQ QueueHandle,
  3934. OUT PSP_BACKUP_QUEUE_PARAMS_A BackupParams
  3935. );
  3936. WINSETUPAPI
  3937. BOOL
  3938. WINAPI
  3939. SetupGetBackupInformationW(
  3940. IN HSPFILEQ QueueHandle,
  3941. OUT PSP_BACKUP_QUEUE_PARAMS_W BackupParams
  3942. );
  3943. #ifdef UNICODE
  3944. #define SetupGetBackupInformation SetupGetBackupInformationW
  3945. #else
  3946. #define SetupGetBackupInformation SetupGetBackupInformationA
  3947. #endif
  3948. #if _SETUPAPI_VER >= 0x0501
  3949. WINSETUPAPI
  3950. BOOL
  3951. WINAPI
  3952. SetupPrepareQueueForRestoreA(
  3953. IN HSPFILEQ QueueHandle,
  3954. IN PCSTR BackupPath,
  3955. IN DWORD RestoreFlags
  3956. );
  3957. WINSETUPAPI
  3958. BOOL
  3959. WINAPI
  3960. SetupPrepareQueueForRestoreW(
  3961. IN HSPFILEQ QueueHandle,
  3962. IN PCWSTR BackupPath,
  3963. IN DWORD RestoreFlags
  3964. );
  3965. #ifdef UNICODE
  3966. #define SetupPrepareQueueForRestore SetupPrepareQueueForRestoreW
  3967. #else
  3968. #define SetupPrepareQueueForRestore SetupPrepareQueueForRestoreA
  3969. #endif
  3970. #endif // _SETUPAPI_VER >= 0x0501
  3971. #if _SETUPAPI_VER >= 0x0501
  3972. //
  3973. // Control forcing of Non-Interactive Mode
  3974. // Overriden if SetupAPI is run in non-interactive window session
  3975. //
  3976. WINSETUPAPI
  3977. BOOL
  3978. WINAPI
  3979. SetupSetNonInteractiveMode(
  3980. IN BOOL NonInteractiveFlag
  3981. );
  3982. WINSETUPAPI
  3983. BOOL
  3984. WINAPI
  3985. SetupGetNonInteractiveMode(
  3986. VOID
  3987. );
  3988. #endif // _SETUPAPI_VER >= 0x0501
  3989. //
  3990. // Device Installer APIs
  3991. //
  3992. WINSETUPAPI
  3993. HDEVINFO
  3994. WINAPI
  3995. SetupDiCreateDeviceInfoList(
  3996. IN CONST GUID *ClassGuid, OPTIONAL
  3997. IN HWND hwndParent OPTIONAL
  3998. );
  3999. WINSETUPAPI
  4000. HDEVINFO
  4001. WINAPI
  4002. SetupDiCreateDeviceInfoListExA(
  4003. IN CONST GUID *ClassGuid, OPTIONAL
  4004. IN HWND hwndParent, OPTIONAL
  4005. IN PCSTR MachineName, OPTIONAL
  4006. IN PVOID Reserved
  4007. );
  4008. WINSETUPAPI
  4009. HDEVINFO
  4010. WINAPI
  4011. SetupDiCreateDeviceInfoListExW(
  4012. IN CONST GUID *ClassGuid, OPTIONAL
  4013. IN HWND hwndParent, OPTIONAL
  4014. IN PCWSTR MachineName, OPTIONAL
  4015. IN PVOID Reserved
  4016. );
  4017. #ifdef UNICODE
  4018. #define SetupDiCreateDeviceInfoListEx SetupDiCreateDeviceInfoListExW
  4019. #else
  4020. #define SetupDiCreateDeviceInfoListEx SetupDiCreateDeviceInfoListExA
  4021. #endif
  4022. WINSETUPAPI
  4023. BOOL
  4024. WINAPI
  4025. SetupDiGetDeviceInfoListClass(
  4026. IN HDEVINFO DeviceInfoSet,
  4027. OUT LPGUID ClassGuid
  4028. );
  4029. WINSETUPAPI
  4030. BOOL
  4031. WINAPI
  4032. SetupDiGetDeviceInfoListDetailA(
  4033. IN HDEVINFO DeviceInfoSet,
  4034. OUT PSP_DEVINFO_LIST_DETAIL_DATA_A DeviceInfoSetDetailData
  4035. );
  4036. WINSETUPAPI
  4037. BOOL
  4038. WINAPI
  4039. SetupDiGetDeviceInfoListDetailW(
  4040. IN HDEVINFO DeviceInfoSet,
  4041. OUT PSP_DEVINFO_LIST_DETAIL_DATA_W DeviceInfoSetDetailData
  4042. );
  4043. #ifdef UNICODE
  4044. #define SetupDiGetDeviceInfoListDetail SetupDiGetDeviceInfoListDetailW
  4045. #else
  4046. #define SetupDiGetDeviceInfoListDetail SetupDiGetDeviceInfoListDetailA
  4047. #endif
  4048. //
  4049. // Flags for SetupDiCreateDeviceInfo
  4050. //
  4051. #define DICD_GENERATE_ID 0x00000001
  4052. #define DICD_INHERIT_CLASSDRVS 0x00000002
  4053. WINSETUPAPI
  4054. BOOL
  4055. WINAPI
  4056. SetupDiCreateDeviceInfoA(
  4057. IN HDEVINFO DeviceInfoSet,
  4058. IN PCSTR DeviceName,
  4059. IN CONST GUID *ClassGuid,
  4060. IN PCSTR DeviceDescription, OPTIONAL
  4061. IN HWND hwndParent, OPTIONAL
  4062. IN DWORD CreationFlags,
  4063. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4064. );
  4065. WINSETUPAPI
  4066. BOOL
  4067. WINAPI
  4068. SetupDiCreateDeviceInfoW(
  4069. IN HDEVINFO DeviceInfoSet,
  4070. IN PCWSTR DeviceName,
  4071. IN CONST GUID *ClassGuid,
  4072. IN PCWSTR DeviceDescription, OPTIONAL
  4073. IN HWND hwndParent, OPTIONAL
  4074. IN DWORD CreationFlags,
  4075. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4076. );
  4077. #ifdef UNICODE
  4078. #define SetupDiCreateDeviceInfo SetupDiCreateDeviceInfoW
  4079. #else
  4080. #define SetupDiCreateDeviceInfo SetupDiCreateDeviceInfoA
  4081. #endif
  4082. //
  4083. // Flags for SetupDiOpenDeviceInfo
  4084. //
  4085. #define DIOD_INHERIT_CLASSDRVS 0x00000002
  4086. #define DIOD_CANCEL_REMOVE 0x00000004
  4087. WINSETUPAPI
  4088. BOOL
  4089. WINAPI
  4090. SetupDiOpenDeviceInfoA(
  4091. IN HDEVINFO DeviceInfoSet,
  4092. IN PCSTR DeviceInstanceId,
  4093. IN HWND hwndParent, OPTIONAL
  4094. IN DWORD OpenFlags,
  4095. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4096. );
  4097. WINSETUPAPI
  4098. BOOL
  4099. WINAPI
  4100. SetupDiOpenDeviceInfoW(
  4101. IN HDEVINFO DeviceInfoSet,
  4102. IN PCWSTR DeviceInstanceId,
  4103. IN HWND hwndParent, OPTIONAL
  4104. IN DWORD OpenFlags,
  4105. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4106. );
  4107. #ifdef UNICODE
  4108. #define SetupDiOpenDeviceInfo SetupDiOpenDeviceInfoW
  4109. #else
  4110. #define SetupDiOpenDeviceInfo SetupDiOpenDeviceInfoA
  4111. #endif
  4112. WINSETUPAPI
  4113. BOOL
  4114. WINAPI
  4115. SetupDiGetDeviceInstanceIdA(
  4116. IN HDEVINFO DeviceInfoSet,
  4117. IN PSP_DEVINFO_DATA DeviceInfoData,
  4118. OUT PSTR DeviceInstanceId,
  4119. IN DWORD DeviceInstanceIdSize,
  4120. OUT PDWORD RequiredSize OPTIONAL
  4121. );
  4122. WINSETUPAPI
  4123. BOOL
  4124. WINAPI
  4125. SetupDiGetDeviceInstanceIdW(
  4126. IN HDEVINFO DeviceInfoSet,
  4127. IN PSP_DEVINFO_DATA DeviceInfoData,
  4128. OUT PWSTR DeviceInstanceId,
  4129. IN DWORD DeviceInstanceIdSize,
  4130. OUT PDWORD RequiredSize OPTIONAL
  4131. );
  4132. #ifdef UNICODE
  4133. #define SetupDiGetDeviceInstanceId SetupDiGetDeviceInstanceIdW
  4134. #else
  4135. #define SetupDiGetDeviceInstanceId SetupDiGetDeviceInstanceIdA
  4136. #endif
  4137. WINSETUPAPI
  4138. BOOL
  4139. WINAPI
  4140. SetupDiDeleteDeviceInfo(
  4141. IN HDEVINFO DeviceInfoSet,
  4142. IN PSP_DEVINFO_DATA DeviceInfoData
  4143. );
  4144. WINSETUPAPI
  4145. BOOL
  4146. WINAPI
  4147. SetupDiEnumDeviceInfo(
  4148. IN HDEVINFO DeviceInfoSet,
  4149. IN DWORD MemberIndex,
  4150. OUT PSP_DEVINFO_DATA DeviceInfoData
  4151. );
  4152. WINSETUPAPI
  4153. BOOL
  4154. WINAPI
  4155. SetupDiDestroyDeviceInfoList(
  4156. IN HDEVINFO DeviceInfoSet
  4157. );
  4158. WINSETUPAPI
  4159. BOOL
  4160. WINAPI
  4161. SetupDiEnumDeviceInterfaces(
  4162. IN HDEVINFO DeviceInfoSet,
  4163. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4164. IN CONST GUID *InterfaceClassGuid,
  4165. IN DWORD MemberIndex,
  4166. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
  4167. );
  4168. //
  4169. // Backward compatibility--do not use
  4170. //
  4171. #define SetupDiEnumInterfaceDevice SetupDiEnumDeviceInterfaces
  4172. WINSETUPAPI
  4173. BOOL
  4174. WINAPI
  4175. SetupDiCreateDeviceInterfaceA(
  4176. IN HDEVINFO DeviceInfoSet,
  4177. IN PSP_DEVINFO_DATA DeviceInfoData,
  4178. IN CONST GUID *InterfaceClassGuid,
  4179. IN PCSTR ReferenceString, OPTIONAL
  4180. IN DWORD CreationFlags,
  4181. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL
  4182. );
  4183. WINSETUPAPI
  4184. BOOL
  4185. WINAPI
  4186. SetupDiCreateDeviceInterfaceW(
  4187. IN HDEVINFO DeviceInfoSet,
  4188. IN PSP_DEVINFO_DATA DeviceInfoData,
  4189. IN CONST GUID *InterfaceClassGuid,
  4190. IN PCWSTR ReferenceString, OPTIONAL
  4191. IN DWORD CreationFlags,
  4192. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL
  4193. );
  4194. #ifdef UNICODE
  4195. #define SetupDiCreateDeviceInterface SetupDiCreateDeviceInterfaceW
  4196. #else
  4197. #define SetupDiCreateDeviceInterface SetupDiCreateDeviceInterfaceA
  4198. #endif
  4199. //
  4200. // Backward compatibility--do not use.
  4201. //
  4202. #define SetupDiCreateInterfaceDeviceW SetupDiCreateDeviceInterfaceW
  4203. #define SetupDiCreateInterfaceDeviceA SetupDiCreateDeviceInterfaceA
  4204. #ifdef UNICODE
  4205. #define SetupDiCreateInterfaceDevice SetupDiCreateDeviceInterfaceW
  4206. #else
  4207. #define SetupDiCreateInterfaceDevice SetupDiCreateDeviceInterfaceA
  4208. #endif
  4209. //
  4210. // Flags for SetupDiOpenDeviceInterface
  4211. //
  4212. #define DIODI_NO_ADD 0x00000001
  4213. WINSETUPAPI
  4214. BOOL
  4215. WINAPI
  4216. SetupDiOpenDeviceInterfaceA(
  4217. IN HDEVINFO DeviceInfoSet,
  4218. IN PCSTR DevicePath,
  4219. IN DWORD OpenFlags,
  4220. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL
  4221. );
  4222. WINSETUPAPI
  4223. BOOL
  4224. WINAPI
  4225. SetupDiOpenDeviceInterfaceW(
  4226. IN HDEVINFO DeviceInfoSet,
  4227. IN PCWSTR DevicePath,
  4228. IN DWORD OpenFlags,
  4229. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData OPTIONAL
  4230. );
  4231. #ifdef UNICODE
  4232. #define SetupDiOpenDeviceInterface SetupDiOpenDeviceInterfaceW
  4233. #else
  4234. #define SetupDiOpenDeviceInterface SetupDiOpenDeviceInterfaceA
  4235. #endif
  4236. //
  4237. // Backward compatibility--do not use
  4238. //
  4239. #define SetupDiOpenInterfaceDeviceW SetupDiOpenDeviceInterfaceW
  4240. #define SetupDiOpenInterfaceDeviceA SetupDiOpenDeviceInterfaceA
  4241. #ifdef UNICODE
  4242. #define SetupDiOpenInterfaceDevice SetupDiOpenDeviceInterfaceW
  4243. #else
  4244. #define SetupDiOpenInterfaceDevice SetupDiOpenDeviceInterfaceA
  4245. #endif
  4246. WINSETUPAPI
  4247. BOOL
  4248. WINAPI
  4249. SetupDiGetDeviceInterfaceAlias(
  4250. IN HDEVINFO DeviceInfoSet,
  4251. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4252. IN CONST GUID *AliasInterfaceClassGuid,
  4253. OUT PSP_DEVICE_INTERFACE_DATA AliasDeviceInterfaceData
  4254. );
  4255. //
  4256. // Backward compatibility--do not use.
  4257. //
  4258. #define SetupDiGetInterfaceDeviceAlias SetupDiGetDeviceInterfaceAlias
  4259. WINSETUPAPI
  4260. BOOL
  4261. WINAPI
  4262. SetupDiDeleteDeviceInterfaceData(
  4263. IN HDEVINFO DeviceInfoSet,
  4264. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
  4265. );
  4266. //
  4267. // Backward compatibility--do not use.
  4268. //
  4269. #define SetupDiDeleteInterfaceDeviceData SetupDiDeleteDeviceInterfaceData
  4270. WINSETUPAPI
  4271. BOOL
  4272. WINAPI
  4273. SetupDiRemoveDeviceInterface(
  4274. IN HDEVINFO DeviceInfoSet,
  4275. IN OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
  4276. );
  4277. //
  4278. // Backward compatibility--do not use.
  4279. //
  4280. #define SetupDiRemoveInterfaceDevice SetupDiRemoveDeviceInterface
  4281. WINSETUPAPI
  4282. BOOL
  4283. WINAPI
  4284. SetupDiGetDeviceInterfaceDetailA(
  4285. IN HDEVINFO DeviceInfoSet,
  4286. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4287. OUT PSP_DEVICE_INTERFACE_DETAIL_DATA_A DeviceInterfaceDetailData, OPTIONAL
  4288. IN DWORD DeviceInterfaceDetailDataSize,
  4289. OUT PDWORD RequiredSize, OPTIONAL
  4290. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4291. );
  4292. WINSETUPAPI
  4293. BOOL
  4294. WINAPI
  4295. SetupDiGetDeviceInterfaceDetailW(
  4296. IN HDEVINFO DeviceInfoSet,
  4297. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4298. OUT PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData, OPTIONAL
  4299. IN DWORD DeviceInterfaceDetailDataSize,
  4300. OUT PDWORD RequiredSize, OPTIONAL
  4301. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4302. );
  4303. #ifdef UNICODE
  4304. #define SetupDiGetDeviceInterfaceDetail SetupDiGetDeviceInterfaceDetailW
  4305. #else
  4306. #define SetupDiGetDeviceInterfaceDetail SetupDiGetDeviceInterfaceDetailA
  4307. #endif
  4308. //
  4309. // Backward compatibility--do not use.
  4310. //
  4311. #define SetupDiGetInterfaceDeviceDetailW SetupDiGetDeviceInterfaceDetailW
  4312. #define SetupDiGetInterfaceDeviceDetailA SetupDiGetDeviceInterfaceDetailA
  4313. #ifdef UNICODE
  4314. #define SetupDiGetInterfaceDeviceDetail SetupDiGetDeviceInterfaceDetailW
  4315. #else
  4316. #define SetupDiGetInterfaceDeviceDetail SetupDiGetDeviceInterfaceDetailA
  4317. #endif
  4318. //
  4319. // Default install handler for DIF_INSTALLINTERFACES.
  4320. //
  4321. WINSETUPAPI
  4322. BOOL
  4323. WINAPI
  4324. SetupDiInstallDeviceInterfaces(
  4325. IN HDEVINFO DeviceInfoSet,
  4326. IN PSP_DEVINFO_DATA DeviceInfoData
  4327. );
  4328. //
  4329. // Backward compatibility--do not use.
  4330. //
  4331. #define SetupDiInstallInterfaceDevices SetupDiInstallDeviceInterfaces
  4332. #if _SETUPAPI_VER >= 0x0501
  4333. WINSETUPAPI
  4334. BOOL
  4335. WINAPI
  4336. SetupDiSetDeviceInterfaceDefault(
  4337. IN HDEVINFO DeviceInfoSet,
  4338. IN OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4339. IN DWORD Flags,
  4340. IN PVOID Reserved
  4341. );
  4342. #endif // _SETUPAPI_VER >= 0x0501
  4343. //
  4344. // Default install handler for DIF_REGISTERDEVICE
  4345. //
  4346. //
  4347. // Flags for SetupDiRegisterDeviceInfo
  4348. //
  4349. #define SPRDI_FIND_DUPS 0x00000001
  4350. WINSETUPAPI
  4351. BOOL
  4352. WINAPI
  4353. SetupDiRegisterDeviceInfo(
  4354. IN HDEVINFO DeviceInfoSet,
  4355. IN OUT PSP_DEVINFO_DATA DeviceInfoData,
  4356. IN DWORD Flags,
  4357. IN PSP_DETSIG_CMPPROC CompareProc, OPTIONAL
  4358. IN PVOID CompareContext, OPTIONAL
  4359. OUT PSP_DEVINFO_DATA DupDeviceInfoData OPTIONAL
  4360. );
  4361. //
  4362. // Ordinal values distinguishing between class drivers and
  4363. // device drivers.
  4364. // (Passed in 'DriverType' parameter of driver information list APIs)
  4365. //
  4366. #define SPDIT_NODRIVER 0x00000000
  4367. #define SPDIT_CLASSDRIVER 0x00000001
  4368. #define SPDIT_COMPATDRIVER 0x00000002
  4369. WINSETUPAPI
  4370. BOOL
  4371. WINAPI
  4372. SetupDiBuildDriverInfoList(
  4373. IN HDEVINFO DeviceInfoSet,
  4374. IN OUT PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4375. IN DWORD DriverType
  4376. );
  4377. WINSETUPAPI
  4378. BOOL
  4379. WINAPI
  4380. SetupDiCancelDriverInfoSearch(
  4381. IN HDEVINFO DeviceInfoSet
  4382. );
  4383. WINSETUPAPI
  4384. BOOL
  4385. WINAPI
  4386. SetupDiEnumDriverInfoA(
  4387. IN HDEVINFO DeviceInfoSet,
  4388. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4389. IN DWORD DriverType,
  4390. IN DWORD MemberIndex,
  4391. OUT PSP_DRVINFO_DATA_A DriverInfoData
  4392. );
  4393. WINSETUPAPI
  4394. BOOL
  4395. WINAPI
  4396. SetupDiEnumDriverInfoW(
  4397. IN HDEVINFO DeviceInfoSet,
  4398. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4399. IN DWORD DriverType,
  4400. IN DWORD MemberIndex,
  4401. OUT PSP_DRVINFO_DATA_W DriverInfoData
  4402. );
  4403. #ifdef UNICODE
  4404. #define SetupDiEnumDriverInfo SetupDiEnumDriverInfoW
  4405. #else
  4406. #define SetupDiEnumDriverInfo SetupDiEnumDriverInfoA
  4407. #endif
  4408. WINSETUPAPI
  4409. BOOL
  4410. WINAPI
  4411. SetupDiGetSelectedDriverA(
  4412. IN HDEVINFO DeviceInfoSet,
  4413. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4414. OUT PSP_DRVINFO_DATA_A DriverInfoData
  4415. );
  4416. WINSETUPAPI
  4417. BOOL
  4418. WINAPI
  4419. SetupDiGetSelectedDriverW(
  4420. IN HDEVINFO DeviceInfoSet,
  4421. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4422. OUT PSP_DRVINFO_DATA_W DriverInfoData
  4423. );
  4424. #ifdef UNICODE
  4425. #define SetupDiGetSelectedDriver SetupDiGetSelectedDriverW
  4426. #else
  4427. #define SetupDiGetSelectedDriver SetupDiGetSelectedDriverA
  4428. #endif
  4429. WINSETUPAPI
  4430. BOOL
  4431. WINAPI
  4432. SetupDiSetSelectedDriverA(
  4433. IN HDEVINFO DeviceInfoSet,
  4434. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4435. IN OUT PSP_DRVINFO_DATA_A DriverInfoData OPTIONAL
  4436. );
  4437. WINSETUPAPI
  4438. BOOL
  4439. WINAPI
  4440. SetupDiSetSelectedDriverW(
  4441. IN HDEVINFO DeviceInfoSet,
  4442. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4443. IN OUT PSP_DRVINFO_DATA_W DriverInfoData OPTIONAL
  4444. );
  4445. #ifdef UNICODE
  4446. #define SetupDiSetSelectedDriver SetupDiSetSelectedDriverW
  4447. #else
  4448. #define SetupDiSetSelectedDriver SetupDiSetSelectedDriverA
  4449. #endif
  4450. WINSETUPAPI
  4451. BOOL
  4452. WINAPI
  4453. SetupDiGetDriverInfoDetailA(
  4454. IN HDEVINFO DeviceInfoSet,
  4455. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4456. IN PSP_DRVINFO_DATA_A DriverInfoData,
  4457. OUT PSP_DRVINFO_DETAIL_DATA_A DriverInfoDetailData, OPTIONAL
  4458. IN DWORD DriverInfoDetailDataSize,
  4459. OUT PDWORD RequiredSize OPTIONAL
  4460. );
  4461. WINSETUPAPI
  4462. BOOL
  4463. WINAPI
  4464. SetupDiGetDriverInfoDetailW(
  4465. IN HDEVINFO DeviceInfoSet,
  4466. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4467. IN PSP_DRVINFO_DATA_W DriverInfoData,
  4468. OUT PSP_DRVINFO_DETAIL_DATA_W DriverInfoDetailData, OPTIONAL
  4469. IN DWORD DriverInfoDetailDataSize,
  4470. OUT PDWORD RequiredSize OPTIONAL
  4471. );
  4472. #ifdef UNICODE
  4473. #define SetupDiGetDriverInfoDetail SetupDiGetDriverInfoDetailW
  4474. #else
  4475. #define SetupDiGetDriverInfoDetail SetupDiGetDriverInfoDetailA
  4476. #endif
  4477. WINSETUPAPI
  4478. BOOL
  4479. WINAPI
  4480. SetupDiDestroyDriverInfoList(
  4481. IN HDEVINFO DeviceInfoSet,
  4482. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  4483. IN DWORD DriverType
  4484. );
  4485. //
  4486. // Flags controlling what is included in the device information set built
  4487. // by SetupDiGetClassDevs
  4488. //
  4489. #define DIGCF_DEFAULT 0x00000001 // only valid with DIGCF_DEVICEINTERFACE
  4490. #define DIGCF_PRESENT 0x00000002
  4491. #define DIGCF_ALLCLASSES 0x00000004
  4492. #define DIGCF_PROFILE 0x00000008
  4493. #define DIGCF_DEVICEINTERFACE 0x00000010
  4494. //
  4495. // Backward compatibility--do not use.
  4496. //
  4497. #define DIGCF_INTERFACEDEVICE DIGCF_DEVICEINTERFACE
  4498. WINSETUPAPI
  4499. HDEVINFO
  4500. WINAPI
  4501. SetupDiGetClassDevsA(
  4502. IN CONST GUID *ClassGuid, OPTIONAL
  4503. IN PCSTR Enumerator, OPTIONAL
  4504. IN HWND hwndParent, OPTIONAL
  4505. IN DWORD Flags
  4506. );
  4507. WINSETUPAPI
  4508. HDEVINFO
  4509. WINAPI
  4510. SetupDiGetClassDevsW(
  4511. IN CONST GUID *ClassGuid, OPTIONAL
  4512. IN PCWSTR Enumerator, OPTIONAL
  4513. IN HWND hwndParent, OPTIONAL
  4514. IN DWORD Flags
  4515. );
  4516. #ifdef UNICODE
  4517. #define SetupDiGetClassDevs SetupDiGetClassDevsW
  4518. #else
  4519. #define SetupDiGetClassDevs SetupDiGetClassDevsA
  4520. #endif
  4521. WINSETUPAPI
  4522. HDEVINFO
  4523. WINAPI
  4524. SetupDiGetClassDevsExA(
  4525. IN CONST GUID *ClassGuid, OPTIONAL
  4526. IN PCSTR Enumerator, OPTIONAL
  4527. IN HWND hwndParent, OPTIONAL
  4528. IN DWORD Flags,
  4529. IN HDEVINFO DeviceInfoSet, OPTIONAL
  4530. IN PCSTR MachineName, OPTIONAL
  4531. IN PVOID Reserved
  4532. );
  4533. WINSETUPAPI
  4534. HDEVINFO
  4535. WINAPI
  4536. SetupDiGetClassDevsExW(
  4537. IN CONST GUID *ClassGuid, OPTIONAL
  4538. IN PCWSTR Enumerator, OPTIONAL
  4539. IN HWND hwndParent, OPTIONAL
  4540. IN DWORD Flags,
  4541. IN HDEVINFO DeviceInfoSet, OPTIONAL
  4542. IN PCWSTR MachineName, OPTIONAL
  4543. IN PVOID Reserved
  4544. );
  4545. #ifdef UNICODE
  4546. #define SetupDiGetClassDevsEx SetupDiGetClassDevsExW
  4547. #else
  4548. #define SetupDiGetClassDevsEx SetupDiGetClassDevsExA
  4549. #endif
  4550. WINSETUPAPI
  4551. BOOL
  4552. WINAPI
  4553. SetupDiGetINFClassA(
  4554. IN PCSTR InfName,
  4555. OUT LPGUID ClassGuid,
  4556. OUT PSTR ClassName,
  4557. IN DWORD ClassNameSize,
  4558. OUT PDWORD RequiredSize OPTIONAL
  4559. );
  4560. WINSETUPAPI
  4561. BOOL
  4562. WINAPI
  4563. SetupDiGetINFClassW(
  4564. IN PCWSTR InfName,
  4565. OUT LPGUID ClassGuid,
  4566. OUT PWSTR ClassName,
  4567. IN DWORD ClassNameSize,
  4568. OUT PDWORD RequiredSize OPTIONAL
  4569. );
  4570. #ifdef UNICODE
  4571. #define SetupDiGetINFClass SetupDiGetINFClassW
  4572. #else
  4573. #define SetupDiGetINFClass SetupDiGetINFClassA
  4574. #endif
  4575. //
  4576. // Flags controlling exclusion from the class information list built
  4577. // by SetupDiBuildClassInfoList(Ex)
  4578. //
  4579. #define DIBCI_NOINSTALLCLASS 0x00000001
  4580. #define DIBCI_NODISPLAYCLASS 0x00000002
  4581. WINSETUPAPI
  4582. BOOL
  4583. WINAPI
  4584. SetupDiBuildClassInfoList(
  4585. IN DWORD Flags,
  4586. OUT LPGUID ClassGuidList,
  4587. IN DWORD ClassGuidListSize,
  4588. OUT PDWORD RequiredSize
  4589. );
  4590. WINSETUPAPI
  4591. BOOL
  4592. WINAPI
  4593. SetupDiBuildClassInfoListExA(
  4594. IN DWORD Flags,
  4595. OUT LPGUID ClassGuidList,
  4596. IN DWORD ClassGuidListSize,
  4597. OUT PDWORD RequiredSize,
  4598. IN PCSTR MachineName, OPTIONAL
  4599. IN PVOID Reserved
  4600. );
  4601. WINSETUPAPI
  4602. BOOL
  4603. WINAPI
  4604. SetupDiBuildClassInfoListExW(
  4605. IN DWORD Flags,
  4606. OUT LPGUID ClassGuidList,
  4607. IN DWORD ClassGuidListSize,
  4608. OUT PDWORD RequiredSize,
  4609. IN PCWSTR MachineName, OPTIONAL
  4610. IN PVOID Reserved
  4611. );
  4612. #ifdef UNICODE
  4613. #define SetupDiBuildClassInfoListEx SetupDiBuildClassInfoListExW
  4614. #else
  4615. #define SetupDiBuildClassInfoListEx SetupDiBuildClassInfoListExA
  4616. #endif
  4617. WINSETUPAPI
  4618. BOOL
  4619. WINAPI
  4620. SetupDiGetClassDescriptionA(
  4621. IN CONST GUID *ClassGuid,
  4622. OUT PSTR ClassDescription,
  4623. IN DWORD ClassDescriptionSize,
  4624. OUT PDWORD RequiredSize OPTIONAL
  4625. );
  4626. WINSETUPAPI
  4627. BOOL
  4628. WINAPI
  4629. SetupDiGetClassDescriptionW(
  4630. IN CONST GUID *ClassGuid,
  4631. OUT PWSTR ClassDescription,
  4632. IN DWORD ClassDescriptionSize,
  4633. OUT PDWORD RequiredSize OPTIONAL
  4634. );
  4635. #ifdef UNICODE
  4636. #define SetupDiGetClassDescription SetupDiGetClassDescriptionW
  4637. #else
  4638. #define SetupDiGetClassDescription SetupDiGetClassDescriptionA
  4639. #endif
  4640. WINSETUPAPI
  4641. BOOL
  4642. WINAPI
  4643. SetupDiGetClassDescriptionExA(
  4644. IN CONST GUID *ClassGuid,
  4645. OUT PSTR ClassDescription,
  4646. IN DWORD ClassDescriptionSize,
  4647. OUT PDWORD RequiredSize, OPTIONAL
  4648. IN PCSTR MachineName, OPTIONAL
  4649. IN PVOID Reserved
  4650. );
  4651. WINSETUPAPI
  4652. BOOL
  4653. WINAPI
  4654. SetupDiGetClassDescriptionExW(
  4655. IN CONST GUID *ClassGuid,
  4656. OUT PWSTR ClassDescription,
  4657. IN DWORD ClassDescriptionSize,
  4658. OUT PDWORD RequiredSize, OPTIONAL
  4659. IN PCWSTR MachineName, OPTIONAL
  4660. IN PVOID Reserved
  4661. );
  4662. #ifdef UNICODE
  4663. #define SetupDiGetClassDescriptionEx SetupDiGetClassDescriptionExW
  4664. #else
  4665. #define SetupDiGetClassDescriptionEx SetupDiGetClassDescriptionExA
  4666. #endif
  4667. WINSETUPAPI
  4668. BOOL
  4669. WINAPI
  4670. SetupDiCallClassInstaller(
  4671. IN DI_FUNCTION InstallFunction,
  4672. IN HDEVINFO DeviceInfoSet,
  4673. IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4674. );
  4675. //
  4676. // Default install handler for DIF_SELECTDEVICE
  4677. //
  4678. WINSETUPAPI
  4679. BOOL
  4680. WINAPI
  4681. SetupDiSelectDevice(
  4682. IN HDEVINFO DeviceInfoSet,
  4683. IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4684. );
  4685. //
  4686. // Default install handler for DIF_SELECTBESTCOMPATDRV
  4687. //
  4688. WINSETUPAPI
  4689. BOOL
  4690. WINAPI
  4691. SetupDiSelectBestCompatDrv(
  4692. IN HDEVINFO DeviceInfoSet,
  4693. IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  4694. );
  4695. //
  4696. // Default install handler for DIF_INSTALLDEVICE
  4697. //
  4698. WINSETUPAPI
  4699. BOOL
  4700. WINAPI
  4701. SetupDiInstallDevice(
  4702. IN HDEVINFO DeviceInfoSet,
  4703. IN OUT PSP_DEVINFO_DATA DeviceInfoData
  4704. );
  4705. //
  4706. // Default install handler for DIF_INSTALLDEVICEFILES
  4707. //
  4708. WINSETUPAPI
  4709. BOOL
  4710. WINAPI
  4711. SetupDiInstallDriverFiles(
  4712. IN HDEVINFO DeviceInfoSet,
  4713. IN PSP_DEVINFO_DATA DeviceInfoData
  4714. );
  4715. //
  4716. // Default install handler for DIF_REGISTER_COINSTALLERS
  4717. //
  4718. WINSETUPAPI
  4719. BOOL
  4720. WINAPI
  4721. SetupDiRegisterCoDeviceInstallers(
  4722. IN HDEVINFO DeviceInfoSet,
  4723. IN PSP_DEVINFO_DATA DeviceInfoData
  4724. );
  4725. //
  4726. // Default install handler for DIF_REMOVE
  4727. //
  4728. WINSETUPAPI
  4729. BOOL
  4730. WINAPI
  4731. SetupDiRemoveDevice(
  4732. IN HDEVINFO DeviceInfoSet,
  4733. IN OUT PSP_DEVINFO_DATA DeviceInfoData
  4734. );
  4735. //
  4736. // Default install handler for DIF_UNREMOVE
  4737. //
  4738. WINSETUPAPI
  4739. BOOL
  4740. WINAPI
  4741. SetupDiUnremoveDevice(
  4742. IN HDEVINFO DeviceInfoSet,
  4743. IN OUT PSP_DEVINFO_DATA DeviceInfoData
  4744. );
  4745. //
  4746. // Default install handler for DIF_PROPERTYCHANGE
  4747. //
  4748. WINSETUPAPI
  4749. BOOL
  4750. WINAPI
  4751. SetupDiChangeState(
  4752. IN HDEVINFO DeviceInfoSet,
  4753. IN OUT PSP_DEVINFO_DATA DeviceInfoData
  4754. );
  4755. WINSETUPAPI
  4756. BOOL
  4757. WINAPI
  4758. SetupDiInstallClassA(
  4759. IN HWND hwndParent, OPTIONAL
  4760. IN PCSTR InfFileName,
  4761. IN DWORD Flags,
  4762. IN HSPFILEQ FileQueue OPTIONAL
  4763. );
  4764. WINSETUPAPI
  4765. BOOL
  4766. WINAPI
  4767. SetupDiInstallClassW(
  4768. IN HWND hwndParent, OPTIONAL
  4769. IN PCWSTR InfFileName,
  4770. IN DWORD Flags,
  4771. IN HSPFILEQ FileQueue OPTIONAL
  4772. );
  4773. #ifdef UNICODE
  4774. #define SetupDiInstallClass SetupDiInstallClassW
  4775. #else
  4776. #define SetupDiInstallClass SetupDiInstallClassA
  4777. #endif
  4778. WINSETUPAPI
  4779. BOOL
  4780. WINAPI
  4781. SetupDiInstallClassExA(
  4782. IN HWND hwndParent, OPTIONAL
  4783. IN PCSTR InfFileName, OPTIONAL
  4784. IN DWORD Flags,
  4785. IN HSPFILEQ FileQueue, OPTIONAL
  4786. IN CONST GUID *InterfaceClassGuid, OPTIONAL
  4787. IN PVOID Reserved1,
  4788. IN PVOID Reserved2
  4789. );
  4790. WINSETUPAPI
  4791. BOOL
  4792. WINAPI
  4793. SetupDiInstallClassExW(
  4794. IN HWND hwndParent, OPTIONAL
  4795. IN PCWSTR InfFileName, OPTIONAL
  4796. IN DWORD Flags,
  4797. IN HSPFILEQ FileQueue, OPTIONAL
  4798. IN CONST GUID *InterfaceClassGuid, OPTIONAL
  4799. IN PVOID Reserved1,
  4800. IN PVOID Reserved2
  4801. );
  4802. #ifdef UNICODE
  4803. #define SetupDiInstallClassEx SetupDiInstallClassExW
  4804. #else
  4805. #define SetupDiInstallClassEx SetupDiInstallClassExA
  4806. #endif
  4807. WINSETUPAPI
  4808. HKEY
  4809. WINAPI
  4810. SetupDiOpenClassRegKey(
  4811. IN CONST GUID *ClassGuid, OPTIONAL
  4812. IN REGSAM samDesired
  4813. );
  4814. //
  4815. // Flags for SetupDiOpenClassRegKeyEx
  4816. //
  4817. #define DIOCR_INSTALLER 0x00000001 // class installer registry branch
  4818. #define DIOCR_INTERFACE 0x00000002 // interface class registry branch
  4819. WINSETUPAPI
  4820. HKEY
  4821. WINAPI
  4822. SetupDiOpenClassRegKeyExA(
  4823. IN CONST GUID *ClassGuid, OPTIONAL
  4824. IN REGSAM samDesired,
  4825. IN DWORD Flags,
  4826. IN PCSTR MachineName, OPTIONAL
  4827. IN PVOID Reserved
  4828. );
  4829. WINSETUPAPI
  4830. HKEY
  4831. WINAPI
  4832. SetupDiOpenClassRegKeyExW(
  4833. IN CONST GUID *ClassGuid, OPTIONAL
  4834. IN REGSAM samDesired,
  4835. IN DWORD Flags,
  4836. IN PCWSTR MachineName, OPTIONAL
  4837. IN PVOID Reserved
  4838. );
  4839. #ifdef UNICODE
  4840. #define SetupDiOpenClassRegKeyEx SetupDiOpenClassRegKeyExW
  4841. #else
  4842. #define SetupDiOpenClassRegKeyEx SetupDiOpenClassRegKeyExA
  4843. #endif
  4844. WINSETUPAPI
  4845. HKEY
  4846. WINAPI
  4847. SetupDiCreateDeviceInterfaceRegKeyA(
  4848. IN HDEVINFO DeviceInfoSet,
  4849. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4850. IN DWORD Reserved,
  4851. IN REGSAM samDesired,
  4852. IN HINF InfHandle, OPTIONAL
  4853. IN PCSTR InfSectionName OPTIONAL
  4854. );
  4855. WINSETUPAPI
  4856. HKEY
  4857. WINAPI
  4858. SetupDiCreateDeviceInterfaceRegKeyW(
  4859. IN HDEVINFO DeviceInfoSet,
  4860. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4861. IN DWORD Reserved,
  4862. IN REGSAM samDesired,
  4863. IN HINF InfHandle, OPTIONAL
  4864. IN PCWSTR InfSectionName OPTIONAL
  4865. );
  4866. #ifdef UNICODE
  4867. #define SetupDiCreateDeviceInterfaceRegKey SetupDiCreateDeviceInterfaceRegKeyW
  4868. #else
  4869. #define SetupDiCreateDeviceInterfaceRegKey SetupDiCreateDeviceInterfaceRegKeyA
  4870. #endif
  4871. //
  4872. // Backward compatibility--do not use.
  4873. //
  4874. #define SetupDiCreateInterfaceDeviceRegKeyW SetupDiCreateDeviceInterfaceRegKeyW
  4875. #define SetupDiCreateInterfaceDeviceRegKeyA SetupDiCreateDeviceInterfaceRegKeyA
  4876. #ifdef UNICODE
  4877. #define SetupDiCreateInterfaceDeviceRegKey SetupDiCreateDeviceInterfaceRegKeyW
  4878. #else
  4879. #define SetupDiCreateInterfaceDeviceRegKey SetupDiCreateDeviceInterfaceRegKeyA
  4880. #endif
  4881. WINSETUPAPI
  4882. HKEY
  4883. WINAPI
  4884. SetupDiOpenDeviceInterfaceRegKey(
  4885. IN HDEVINFO DeviceInfoSet,
  4886. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4887. IN DWORD Reserved,
  4888. IN REGSAM samDesired
  4889. );
  4890. //
  4891. // Backward compatibility--do not use.
  4892. //
  4893. #define SetupDiOpenInterfaceDeviceRegKey SetupDiOpenDeviceInterfaceRegKey
  4894. WINSETUPAPI
  4895. BOOL
  4896. WINAPI
  4897. SetupDiDeleteDeviceInterfaceRegKey(
  4898. IN HDEVINFO DeviceInfoSet,
  4899. IN PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  4900. IN DWORD Reserved
  4901. );
  4902. //
  4903. // Backward compatibility--do not use.
  4904. //
  4905. #define SetupDiDeleteInterfaceDeviceRegKey SetupDiDeleteDeviceInterfaceRegKey
  4906. //
  4907. // KeyType values for SetupDiCreateDevRegKey, SetupDiOpenDevRegKey, and
  4908. // SetupDiDeleteDevRegKey.
  4909. //
  4910. #define DIREG_DEV 0x00000001 // Open/Create/Delete device key
  4911. #define DIREG_DRV 0x00000002 // Open/Create/Delete driver key
  4912. #define DIREG_BOTH 0x00000004 // Delete both driver and Device key
  4913. WINSETUPAPI
  4914. HKEY
  4915. WINAPI
  4916. SetupDiCreateDevRegKeyA(
  4917. IN HDEVINFO DeviceInfoSet,
  4918. IN PSP_DEVINFO_DATA DeviceInfoData,
  4919. IN DWORD Scope,
  4920. IN DWORD HwProfile,
  4921. IN DWORD KeyType,
  4922. IN HINF InfHandle, OPTIONAL
  4923. IN PCSTR InfSectionName OPTIONAL
  4924. );
  4925. WINSETUPAPI
  4926. HKEY
  4927. WINAPI
  4928. SetupDiCreateDevRegKeyW(
  4929. IN HDEVINFO DeviceInfoSet,
  4930. IN PSP_DEVINFO_DATA DeviceInfoData,
  4931. IN DWORD Scope,
  4932. IN DWORD HwProfile,
  4933. IN DWORD KeyType,
  4934. IN HINF InfHandle, OPTIONAL
  4935. IN PCWSTR InfSectionName OPTIONAL
  4936. );
  4937. #ifdef UNICODE
  4938. #define SetupDiCreateDevRegKey SetupDiCreateDevRegKeyW
  4939. #else
  4940. #define SetupDiCreateDevRegKey SetupDiCreateDevRegKeyA
  4941. #endif
  4942. WINSETUPAPI
  4943. HKEY
  4944. WINAPI
  4945. SetupDiOpenDevRegKey(
  4946. IN HDEVINFO DeviceInfoSet,
  4947. IN PSP_DEVINFO_DATA DeviceInfoData,
  4948. IN DWORD Scope,
  4949. IN DWORD HwProfile,
  4950. IN DWORD KeyType,
  4951. IN REGSAM samDesired
  4952. );
  4953. WINSETUPAPI
  4954. BOOL
  4955. WINAPI
  4956. SetupDiDeleteDevRegKey(
  4957. IN HDEVINFO DeviceInfoSet,
  4958. IN PSP_DEVINFO_DATA DeviceInfoData,
  4959. IN DWORD Scope,
  4960. IN DWORD HwProfile,
  4961. IN DWORD KeyType
  4962. );
  4963. WINSETUPAPI
  4964. BOOL
  4965. WINAPI
  4966. SetupDiGetHwProfileList(
  4967. OUT PDWORD HwProfileList,
  4968. IN DWORD HwProfileListSize,
  4969. OUT PDWORD RequiredSize,
  4970. OUT PDWORD CurrentlyActiveIndex OPTIONAL
  4971. );
  4972. WINSETUPAPI
  4973. BOOL
  4974. WINAPI
  4975. SetupDiGetHwProfileListExA(
  4976. OUT PDWORD HwProfileList,
  4977. IN DWORD HwProfileListSize,
  4978. OUT PDWORD RequiredSize,
  4979. OUT PDWORD CurrentlyActiveIndex, OPTIONAL
  4980. IN PCSTR MachineName, OPTIONAL
  4981. IN PVOID Reserved
  4982. );
  4983. WINSETUPAPI
  4984. BOOL
  4985. WINAPI
  4986. SetupDiGetHwProfileListExW(
  4987. OUT PDWORD HwProfileList,
  4988. IN DWORD HwProfileListSize,
  4989. OUT PDWORD RequiredSize,
  4990. OUT PDWORD CurrentlyActiveIndex, OPTIONAL
  4991. IN PCWSTR MachineName, OPTIONAL
  4992. IN PVOID Reserved
  4993. );
  4994. #ifdef UNICODE
  4995. #define SetupDiGetHwProfileListEx SetupDiGetHwProfileListExW
  4996. #else
  4997. #define SetupDiGetHwProfileListEx SetupDiGetHwProfileListExA
  4998. #endif
  4999. //
  5000. // Device registry property codes
  5001. // (Codes marked as read-only (R) may only be used for
  5002. // SetupDiGetDeviceRegistryProperty)
  5003. //
  5004. // These values should cover the same set of registry properties
  5005. // as defined by the CM_DRP codes in cfgmgr32.h.
  5006. //
  5007. // Note that SPDRP codes are zero based while CM_DRP codes are one based!
  5008. //
  5009. #define SPDRP_DEVICEDESC (0x00000000) // DeviceDesc (R/W)
  5010. #define SPDRP_HARDWAREID (0x00000001) // HardwareID (R/W)
  5011. #define SPDRP_COMPATIBLEIDS (0x00000002) // CompatibleIDs (R/W)
  5012. #define SPDRP_UNUSED0 (0x00000003) // unused
  5013. #define SPDRP_SERVICE (0x00000004) // Service (R/W)
  5014. #define SPDRP_UNUSED1 (0x00000005) // unused
  5015. #define SPDRP_UNUSED2 (0x00000006) // unused
  5016. #define SPDRP_CLASS (0x00000007) // Class (R--tied to ClassGUID)
  5017. #define SPDRP_CLASSGUID (0x00000008) // ClassGUID (R/W)
  5018. #define SPDRP_DRIVER (0x00000009) // Driver (R/W)
  5019. #define SPDRP_CONFIGFLAGS (0x0000000A) // ConfigFlags (R/W)
  5020. #define SPDRP_MFG (0x0000000B) // Mfg (R/W)
  5021. #define SPDRP_FRIENDLYNAME (0x0000000C) // FriendlyName (R/W)
  5022. #define SPDRP_LOCATION_INFORMATION (0x0000000D) // LocationInformation (R/W)
  5023. #define SPDRP_PHYSICAL_DEVICE_OBJECT_NAME (0x0000000E) // PhysicalDeviceObjectName (R)
  5024. #define SPDRP_CAPABILITIES (0x0000000F) // Capabilities (R)
  5025. #define SPDRP_UI_NUMBER (0x00000010) // UiNumber (R)
  5026. #define SPDRP_UPPERFILTERS (0x00000011) // UpperFilters (R/W)
  5027. #define SPDRP_LOWERFILTERS (0x00000012) // LowerFilters (R/W)
  5028. #define SPDRP_BUSTYPEGUID (0x00000013) // BusTypeGUID (R)
  5029. #define SPDRP_LEGACYBUSTYPE (0x00000014) // LegacyBusType (R)
  5030. #define SPDRP_BUSNUMBER (0x00000015) // BusNumber (R)
  5031. #define SPDRP_ENUMERATOR_NAME (0x00000016) // Enumerator Name (R)
  5032. #define SPDRP_SECURITY (0x00000017) // Security (R/W, binary form)
  5033. #define SPDRP_SECURITY_SDS (0x00000018) // Security (W, SDS form)
  5034. #define SPDRP_DEVTYPE (0x00000019) // Device Type (R/W)
  5035. #define SPDRP_EXCLUSIVE (0x0000001A) // Device is exclusive-access (R/W)
  5036. #define SPDRP_CHARACTERISTICS (0x0000001B) // Device Characteristics (R/W)
  5037. #define SPDRP_ADDRESS (0x0000001C) // Device Address (R)
  5038. #define SPDRP_UI_NUMBER_DESC_FORMAT (0X0000001D) // UiNumberDescFormat (R/W)
  5039. #define SPDRP_DEVICE_POWER_DATA (0x0000001E) // Device Power Data (R)
  5040. #define SPDRP_REMOVAL_POLICY (0x0000001F) // Removal Policy (R)
  5041. #define SPDRP_REMOVAL_POLICY_HW_DEFAULT (0x00000020) // Hardware Removal Policy (R)
  5042. #define SPDRP_REMOVAL_POLICY_OVERRIDE (0x00000021) // Removal Policy Override (RW)
  5043. #define SPDRP_INSTALL_STATE (0x00000022) // Device Install State (R)
  5044. #define SPDRP_LOCATION_PATHS (0x00000023) // Device Location Paths (R)
  5045. #define SPDRP_MAXIMUM_PROPERTY (0x00000024) // Upper bound on ordinals
  5046. //
  5047. // Class registry property codes
  5048. // (Codes marked as read-only (R) may only be used for
  5049. // SetupDiGetClassRegistryProperty)
  5050. //
  5051. // These values should cover the same set of registry properties
  5052. // as defined by the CM_CRP codes in cfgmgr32.h.
  5053. // they should also have a 1:1 correspondence with Device registers, where applicable
  5054. // but no overlap otherwise
  5055. //
  5056. #define SPCRP_SECURITY (0x00000017) // Security (R/W, binary form)
  5057. #define SPCRP_SECURITY_SDS (0x00000018) // Security (W, SDS form)
  5058. #define SPCRP_DEVTYPE (0x00000019) // Device Type (R/W)
  5059. #define SPCRP_EXCLUSIVE (0x0000001A) // Device is exclusive-access (R/W)
  5060. #define SPCRP_CHARACTERISTICS (0x0000001B) // Device Characteristics (R/W)
  5061. #define SPCRP_MAXIMUM_PROPERTY (0x0000001C) // Upper bound on ordinals
  5062. WINSETUPAPI
  5063. BOOL
  5064. WINAPI
  5065. SetupDiGetDeviceRegistryPropertyA(
  5066. IN HDEVINFO DeviceInfoSet,
  5067. IN PSP_DEVINFO_DATA DeviceInfoData,
  5068. IN DWORD Property,
  5069. OUT PDWORD PropertyRegDataType, OPTIONAL
  5070. OUT PBYTE PropertyBuffer,
  5071. IN DWORD PropertyBufferSize,
  5072. OUT PDWORD RequiredSize OPTIONAL
  5073. );
  5074. WINSETUPAPI
  5075. BOOL
  5076. WINAPI
  5077. SetupDiGetDeviceRegistryPropertyW(
  5078. IN HDEVINFO DeviceInfoSet,
  5079. IN PSP_DEVINFO_DATA DeviceInfoData,
  5080. IN DWORD Property,
  5081. OUT PDWORD PropertyRegDataType, OPTIONAL
  5082. OUT PBYTE PropertyBuffer,
  5083. IN DWORD PropertyBufferSize,
  5084. OUT PDWORD RequiredSize OPTIONAL
  5085. );
  5086. #ifdef UNICODE
  5087. #define SetupDiGetDeviceRegistryProperty SetupDiGetDeviceRegistryPropertyW
  5088. #else
  5089. #define SetupDiGetDeviceRegistryProperty SetupDiGetDeviceRegistryPropertyA
  5090. #endif
  5091. WINSETUPAPI
  5092. BOOL
  5093. WINAPI
  5094. SetupDiGetClassRegistryPropertyA(
  5095. IN CONST GUID *ClassGuid,
  5096. IN DWORD Property,
  5097. OUT PDWORD PropertyRegDataType, OPTIONAL
  5098. OUT PBYTE PropertyBuffer,
  5099. IN DWORD PropertyBufferSize,
  5100. OUT PDWORD RequiredSize, OPTIONAL
  5101. IN PCSTR MachineName, OPTIONAL
  5102. IN PVOID Reserved
  5103. );
  5104. WINSETUPAPI
  5105. BOOL
  5106. WINAPI
  5107. SetupDiGetClassRegistryPropertyW(
  5108. IN CONST GUID *ClassGuid,
  5109. IN DWORD Property,
  5110. OUT PDWORD PropertyRegDataType, OPTIONAL
  5111. OUT PBYTE PropertyBuffer,
  5112. IN DWORD PropertyBufferSize,
  5113. OUT PDWORD RequiredSize, OPTIONAL
  5114. IN PCWSTR MachineName, OPTIONAL
  5115. IN PVOID Reserved
  5116. );
  5117. #ifdef UNICODE
  5118. #define SetupDiGetClassRegistryProperty SetupDiGetClassRegistryPropertyW
  5119. #else
  5120. #define SetupDiGetClassRegistryProperty SetupDiGetClassRegistryPropertyA
  5121. #endif
  5122. WINSETUPAPI
  5123. BOOL
  5124. WINAPI
  5125. SetupDiSetDeviceRegistryPropertyA(
  5126. IN HDEVINFO DeviceInfoSet,
  5127. IN OUT PSP_DEVINFO_DATA DeviceInfoData,
  5128. IN DWORD Property,
  5129. IN CONST BYTE* PropertyBuffer, OPTIONAL
  5130. IN DWORD PropertyBufferSize
  5131. );
  5132. WINSETUPAPI
  5133. BOOL
  5134. WINAPI
  5135. SetupDiSetDeviceRegistryPropertyW(
  5136. IN HDEVINFO DeviceInfoSet,
  5137. IN OUT PSP_DEVINFO_DATA DeviceInfoData,
  5138. IN DWORD Property,
  5139. IN CONST BYTE* PropertyBuffer, OPTIONAL
  5140. IN DWORD PropertyBufferSize
  5141. );
  5142. #ifdef UNICODE
  5143. #define SetupDiSetDeviceRegistryProperty SetupDiSetDeviceRegistryPropertyW
  5144. #else
  5145. #define SetupDiSetDeviceRegistryProperty SetupDiSetDeviceRegistryPropertyA
  5146. #endif
  5147. WINSETUPAPI
  5148. BOOL
  5149. WINAPI
  5150. SetupDiSetClassRegistryPropertyA(
  5151. IN CONST GUID *ClassGuid,
  5152. IN DWORD Property,
  5153. IN CONST BYTE* PropertyBuffer, OPTIONAL
  5154. IN DWORD PropertyBufferSize,
  5155. IN PCSTR MachineName, OPTIONAL
  5156. IN PVOID Reserved
  5157. );
  5158. WINSETUPAPI
  5159. BOOL
  5160. WINAPI
  5161. SetupDiSetClassRegistryPropertyW(
  5162. IN CONST GUID *ClassGuid,
  5163. IN DWORD Property,
  5164. IN CONST BYTE* PropertyBuffer, OPTIONAL
  5165. IN DWORD PropertyBufferSize,
  5166. IN PCWSTR MachineName, OPTIONAL
  5167. IN PVOID Reserved
  5168. );
  5169. #ifdef UNICODE
  5170. #define SetupDiSetClassRegistryProperty SetupDiSetClassRegistryPropertyW
  5171. #else
  5172. #define SetupDiSetClassRegistryProperty SetupDiSetClassRegistryPropertyA
  5173. #endif
  5174. WINSETUPAPI
  5175. BOOL
  5176. WINAPI
  5177. SetupDiGetDeviceInstallParamsA(
  5178. IN HDEVINFO DeviceInfoSet,
  5179. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5180. OUT PSP_DEVINSTALL_PARAMS_A DeviceInstallParams
  5181. );
  5182. WINSETUPAPI
  5183. BOOL
  5184. WINAPI
  5185. SetupDiGetDeviceInstallParamsW(
  5186. IN HDEVINFO DeviceInfoSet,
  5187. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5188. OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams
  5189. );
  5190. #ifdef UNICODE
  5191. #define SetupDiGetDeviceInstallParams SetupDiGetDeviceInstallParamsW
  5192. #else
  5193. #define SetupDiGetDeviceInstallParams SetupDiGetDeviceInstallParamsA
  5194. #endif
  5195. WINSETUPAPI
  5196. BOOL
  5197. WINAPI
  5198. SetupDiGetClassInstallParamsA(
  5199. IN HDEVINFO DeviceInfoSet,
  5200. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5201. OUT PSP_CLASSINSTALL_HEADER ClassInstallParams, OPTIONAL
  5202. IN DWORD ClassInstallParamsSize,
  5203. OUT PDWORD RequiredSize OPTIONAL
  5204. );
  5205. WINSETUPAPI
  5206. BOOL
  5207. WINAPI
  5208. SetupDiGetClassInstallParamsW(
  5209. IN HDEVINFO DeviceInfoSet,
  5210. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5211. OUT PSP_CLASSINSTALL_HEADER ClassInstallParams, OPTIONAL
  5212. IN DWORD ClassInstallParamsSize,
  5213. OUT PDWORD RequiredSize OPTIONAL
  5214. );
  5215. #ifdef UNICODE
  5216. #define SetupDiGetClassInstallParams SetupDiGetClassInstallParamsW
  5217. #else
  5218. #define SetupDiGetClassInstallParams SetupDiGetClassInstallParamsA
  5219. #endif
  5220. WINSETUPAPI
  5221. BOOL
  5222. WINAPI
  5223. SetupDiSetDeviceInstallParamsA(
  5224. IN HDEVINFO DeviceInfoSet,
  5225. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5226. IN PSP_DEVINSTALL_PARAMS_A DeviceInstallParams
  5227. );
  5228. WINSETUPAPI
  5229. BOOL
  5230. WINAPI
  5231. SetupDiSetDeviceInstallParamsW(
  5232. IN HDEVINFO DeviceInfoSet,
  5233. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5234. IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams
  5235. );
  5236. #ifdef UNICODE
  5237. #define SetupDiSetDeviceInstallParams SetupDiSetDeviceInstallParamsW
  5238. #else
  5239. #define SetupDiSetDeviceInstallParams SetupDiSetDeviceInstallParamsA
  5240. #endif
  5241. WINSETUPAPI
  5242. BOOL
  5243. WINAPI
  5244. SetupDiSetClassInstallParamsA(
  5245. IN HDEVINFO DeviceInfoSet,
  5246. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5247. IN PSP_CLASSINSTALL_HEADER ClassInstallParams, OPTIONAL
  5248. IN DWORD ClassInstallParamsSize
  5249. );
  5250. WINSETUPAPI
  5251. BOOL
  5252. WINAPI
  5253. SetupDiSetClassInstallParamsW(
  5254. IN HDEVINFO DeviceInfoSet,
  5255. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5256. IN PSP_CLASSINSTALL_HEADER ClassInstallParams, OPTIONAL
  5257. IN DWORD ClassInstallParamsSize
  5258. );
  5259. #ifdef UNICODE
  5260. #define SetupDiSetClassInstallParams SetupDiSetClassInstallParamsW
  5261. #else
  5262. #define SetupDiSetClassInstallParams SetupDiSetClassInstallParamsA
  5263. #endif
  5264. WINSETUPAPI
  5265. BOOL
  5266. WINAPI
  5267. SetupDiGetDriverInstallParamsA(
  5268. IN HDEVINFO DeviceInfoSet,
  5269. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5270. IN PSP_DRVINFO_DATA_A DriverInfoData,
  5271. OUT PSP_DRVINSTALL_PARAMS DriverInstallParams
  5272. );
  5273. WINSETUPAPI
  5274. BOOL
  5275. WINAPI
  5276. SetupDiGetDriverInstallParamsW(
  5277. IN HDEVINFO DeviceInfoSet,
  5278. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5279. IN PSP_DRVINFO_DATA_W DriverInfoData,
  5280. OUT PSP_DRVINSTALL_PARAMS DriverInstallParams
  5281. );
  5282. #ifdef UNICODE
  5283. #define SetupDiGetDriverInstallParams SetupDiGetDriverInstallParamsW
  5284. #else
  5285. #define SetupDiGetDriverInstallParams SetupDiGetDriverInstallParamsA
  5286. #endif
  5287. WINSETUPAPI
  5288. BOOL
  5289. WINAPI
  5290. SetupDiSetDriverInstallParamsA(
  5291. IN HDEVINFO DeviceInfoSet,
  5292. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5293. IN PSP_DRVINFO_DATA_A DriverInfoData,
  5294. IN PSP_DRVINSTALL_PARAMS DriverInstallParams
  5295. );
  5296. WINSETUPAPI
  5297. BOOL
  5298. WINAPI
  5299. SetupDiSetDriverInstallParamsW(
  5300. IN HDEVINFO DeviceInfoSet,
  5301. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5302. IN PSP_DRVINFO_DATA_W DriverInfoData,
  5303. IN PSP_DRVINSTALL_PARAMS DriverInstallParams
  5304. );
  5305. #ifdef UNICODE
  5306. #define SetupDiSetDriverInstallParams SetupDiSetDriverInstallParamsW
  5307. #else
  5308. #define SetupDiSetDriverInstallParams SetupDiSetDriverInstallParamsA
  5309. #endif
  5310. WINSETUPAPI
  5311. BOOL
  5312. WINAPI
  5313. SetupDiLoadClassIcon(
  5314. IN CONST GUID *ClassGuid,
  5315. OUT HICON *LargeIcon, OPTIONAL
  5316. OUT PINT MiniIconIndex OPTIONAL
  5317. );
  5318. //
  5319. // Flags controlling the drawing of mini-icons
  5320. //
  5321. #define DMI_MASK 0x00000001
  5322. #define DMI_BKCOLOR 0x00000002
  5323. #define DMI_USERECT 0x00000004
  5324. WINSETUPAPI
  5325. INT
  5326. WINAPI
  5327. SetupDiDrawMiniIcon(
  5328. IN HDC hdc,
  5329. IN RECT rc,
  5330. IN INT MiniIconIndex,
  5331. IN DWORD Flags
  5332. );
  5333. WINSETUPAPI
  5334. BOOL
  5335. WINAPI
  5336. SetupDiGetClassBitmapIndex(
  5337. IN CONST GUID *ClassGuid, OPTIONAL
  5338. OUT PINT MiniIconIndex
  5339. );
  5340. WINSETUPAPI
  5341. BOOL
  5342. WINAPI
  5343. SetupDiGetClassImageList(
  5344. OUT PSP_CLASSIMAGELIST_DATA ClassImageListData
  5345. );
  5346. WINSETUPAPI
  5347. BOOL
  5348. WINAPI
  5349. SetupDiGetClassImageListExA(
  5350. OUT PSP_CLASSIMAGELIST_DATA ClassImageListData,
  5351. IN PCSTR MachineName, OPTIONAL
  5352. IN PVOID Reserved
  5353. );
  5354. WINSETUPAPI
  5355. BOOL
  5356. WINAPI
  5357. SetupDiGetClassImageListExW(
  5358. OUT PSP_CLASSIMAGELIST_DATA ClassImageListData,
  5359. IN PCWSTR MachineName, OPTIONAL
  5360. IN PVOID Reserved
  5361. );
  5362. #ifdef UNICODE
  5363. #define SetupDiGetClassImageListEx SetupDiGetClassImageListExW
  5364. #else
  5365. #define SetupDiGetClassImageListEx SetupDiGetClassImageListExA
  5366. #endif
  5367. WINSETUPAPI
  5368. BOOL
  5369. WINAPI
  5370. SetupDiGetClassImageIndex(
  5371. IN PSP_CLASSIMAGELIST_DATA ClassImageListData,
  5372. IN CONST GUID *ClassGuid,
  5373. OUT PINT ImageIndex
  5374. );
  5375. WINSETUPAPI
  5376. BOOL
  5377. WINAPI
  5378. SetupDiDestroyClassImageList(
  5379. IN PSP_CLASSIMAGELIST_DATA ClassImageListData
  5380. );
  5381. //
  5382. // PropertySheetType values for the SetupDiGetClassDevPropertySheets API
  5383. //
  5384. #define DIGCDP_FLAG_BASIC 0x00000001
  5385. #define DIGCDP_FLAG_ADVANCED 0x00000002
  5386. #if _SETUPAPI_VER >= 0x0501
  5387. #define DIGCDP_FLAG_REMOTE_BASIC 0x00000003 // not presently implemented
  5388. #define DIGCDP_FLAG_REMOTE_ADVANCED 0x00000004
  5389. #endif // _SETUPAPI_VER >= 0x0501
  5390. WINSETUPAPI
  5391. BOOL
  5392. WINAPI
  5393. SetupDiGetClassDevPropertySheetsA(
  5394. IN HDEVINFO DeviceInfoSet,
  5395. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5396. IN LPPROPSHEETHEADERA PropertySheetHeader,
  5397. IN DWORD PropertySheetHeaderPageListSize,
  5398. OUT PDWORD RequiredSize, OPTIONAL
  5399. IN DWORD PropertySheetType
  5400. );
  5401. WINSETUPAPI
  5402. BOOL
  5403. WINAPI
  5404. SetupDiGetClassDevPropertySheetsW(
  5405. IN HDEVINFO DeviceInfoSet,
  5406. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5407. IN LPPROPSHEETHEADERW PropertySheetHeader,
  5408. IN DWORD PropertySheetHeaderPageListSize,
  5409. OUT PDWORD RequiredSize, OPTIONAL
  5410. IN DWORD PropertySheetType
  5411. );
  5412. #ifdef UNICODE
  5413. #define SetupDiGetClassDevPropertySheets SetupDiGetClassDevPropertySheetsW
  5414. #else
  5415. #define SetupDiGetClassDevPropertySheets SetupDiGetClassDevPropertySheetsA
  5416. #endif
  5417. //
  5418. // Define ICON IDs publicly exposed from setupapi.
  5419. //
  5420. #define IDI_RESOURCEFIRST 159
  5421. #define IDI_RESOURCE 159
  5422. #define IDI_RESOURCELAST 161
  5423. #define IDI_RESOURCEOVERLAYFIRST 161
  5424. #define IDI_RESOURCEOVERLAYLAST 161
  5425. #define IDI_CONFLICT 161
  5426. #define IDI_CLASSICON_OVERLAYFIRST 500
  5427. #define IDI_CLASSICON_OVERLAYLAST 502
  5428. #define IDI_PROBLEM_OVL 500
  5429. #define IDI_DISABLED_OVL 501
  5430. #define IDI_FORCED_OVL 502
  5431. WINSETUPAPI
  5432. BOOL
  5433. WINAPI
  5434. SetupDiAskForOEMDisk(
  5435. IN HDEVINFO DeviceInfoSet,
  5436. IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  5437. );
  5438. WINSETUPAPI
  5439. BOOL
  5440. WINAPI
  5441. SetupDiSelectOEMDrv(
  5442. IN HWND hwndParent, OPTIONAL
  5443. IN HDEVINFO DeviceInfoSet,
  5444. IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  5445. );
  5446. WINSETUPAPI
  5447. BOOL
  5448. WINAPI
  5449. SetupDiClassNameFromGuidA(
  5450. IN CONST GUID *ClassGuid,
  5451. OUT PSTR ClassName,
  5452. IN DWORD ClassNameSize,
  5453. OUT PDWORD RequiredSize OPTIONAL
  5454. );
  5455. WINSETUPAPI
  5456. BOOL
  5457. WINAPI
  5458. SetupDiClassNameFromGuidW(
  5459. IN CONST GUID *ClassGuid,
  5460. OUT PWSTR ClassName,
  5461. IN DWORD ClassNameSize,
  5462. OUT PDWORD RequiredSize OPTIONAL
  5463. );
  5464. #ifdef UNICODE
  5465. #define SetupDiClassNameFromGuid SetupDiClassNameFromGuidW
  5466. #else
  5467. #define SetupDiClassNameFromGuid SetupDiClassNameFromGuidA
  5468. #endif
  5469. WINSETUPAPI
  5470. BOOL
  5471. WINAPI
  5472. SetupDiClassNameFromGuidExA(
  5473. IN CONST GUID *ClassGuid,
  5474. OUT PSTR ClassName,
  5475. IN DWORD ClassNameSize,
  5476. OUT PDWORD RequiredSize, OPTIONAL
  5477. IN PCSTR MachineName, OPTIONAL
  5478. IN PVOID Reserved
  5479. );
  5480. WINSETUPAPI
  5481. BOOL
  5482. WINAPI
  5483. SetupDiClassNameFromGuidExW(
  5484. IN CONST GUID *ClassGuid,
  5485. OUT PWSTR ClassName,
  5486. IN DWORD ClassNameSize,
  5487. OUT PDWORD RequiredSize, OPTIONAL
  5488. IN PCWSTR MachineName, OPTIONAL
  5489. IN PVOID Reserved
  5490. );
  5491. #ifdef UNICODE
  5492. #define SetupDiClassNameFromGuidEx SetupDiClassNameFromGuidExW
  5493. #else
  5494. #define SetupDiClassNameFromGuidEx SetupDiClassNameFromGuidExA
  5495. #endif
  5496. WINSETUPAPI
  5497. BOOL
  5498. WINAPI
  5499. SetupDiClassGuidsFromNameA(
  5500. IN PCSTR ClassName,
  5501. OUT LPGUID ClassGuidList,
  5502. IN DWORD ClassGuidListSize,
  5503. OUT PDWORD RequiredSize
  5504. );
  5505. WINSETUPAPI
  5506. BOOL
  5507. WINAPI
  5508. SetupDiClassGuidsFromNameW(
  5509. IN PCWSTR ClassName,
  5510. OUT LPGUID ClassGuidList,
  5511. IN DWORD ClassGuidListSize,
  5512. OUT PDWORD RequiredSize
  5513. );
  5514. #ifdef UNICODE
  5515. #define SetupDiClassGuidsFromName SetupDiClassGuidsFromNameW
  5516. #else
  5517. #define SetupDiClassGuidsFromName SetupDiClassGuidsFromNameA
  5518. #endif
  5519. WINSETUPAPI
  5520. BOOL
  5521. WINAPI
  5522. SetupDiClassGuidsFromNameExA(
  5523. IN PCSTR ClassName,
  5524. OUT LPGUID ClassGuidList,
  5525. IN DWORD ClassGuidListSize,
  5526. OUT PDWORD RequiredSize,
  5527. IN PCSTR MachineName, OPTIONAL
  5528. IN PVOID Reserved
  5529. );
  5530. WINSETUPAPI
  5531. BOOL
  5532. WINAPI
  5533. SetupDiClassGuidsFromNameExW(
  5534. IN PCWSTR ClassName,
  5535. OUT LPGUID ClassGuidList,
  5536. IN DWORD ClassGuidListSize,
  5537. OUT PDWORD RequiredSize,
  5538. IN PCWSTR MachineName, OPTIONAL
  5539. IN PVOID Reserved
  5540. );
  5541. #ifdef UNICODE
  5542. #define SetupDiClassGuidsFromNameEx SetupDiClassGuidsFromNameExW
  5543. #else
  5544. #define SetupDiClassGuidsFromNameEx SetupDiClassGuidsFromNameExA
  5545. #endif
  5546. WINSETUPAPI
  5547. BOOL
  5548. WINAPI
  5549. SetupDiGetHwProfileFriendlyNameA(
  5550. IN DWORD HwProfile,
  5551. OUT PSTR FriendlyName,
  5552. IN DWORD FriendlyNameSize,
  5553. OUT PDWORD RequiredSize OPTIONAL
  5554. );
  5555. WINSETUPAPI
  5556. BOOL
  5557. WINAPI
  5558. SetupDiGetHwProfileFriendlyNameW(
  5559. IN DWORD HwProfile,
  5560. OUT PWSTR FriendlyName,
  5561. IN DWORD FriendlyNameSize,
  5562. OUT PDWORD RequiredSize OPTIONAL
  5563. );
  5564. #ifdef UNICODE
  5565. #define SetupDiGetHwProfileFriendlyName SetupDiGetHwProfileFriendlyNameW
  5566. #else
  5567. #define SetupDiGetHwProfileFriendlyName SetupDiGetHwProfileFriendlyNameA
  5568. #endif
  5569. WINSETUPAPI
  5570. BOOL
  5571. WINAPI
  5572. SetupDiGetHwProfileFriendlyNameExA(
  5573. IN DWORD HwProfile,
  5574. OUT PSTR FriendlyName,
  5575. IN DWORD FriendlyNameSize,
  5576. OUT PDWORD RequiredSize, OPTIONAL
  5577. IN PCSTR MachineName, OPTIONAL
  5578. IN PVOID Reserved
  5579. );
  5580. WINSETUPAPI
  5581. BOOL
  5582. WINAPI
  5583. SetupDiGetHwProfileFriendlyNameExW(
  5584. IN DWORD HwProfile,
  5585. OUT PWSTR FriendlyName,
  5586. IN DWORD FriendlyNameSize,
  5587. OUT PDWORD RequiredSize, OPTIONAL
  5588. IN PCWSTR MachineName, OPTIONAL
  5589. IN PVOID Reserved
  5590. );
  5591. #ifdef UNICODE
  5592. #define SetupDiGetHwProfileFriendlyNameEx SetupDiGetHwProfileFriendlyNameExW
  5593. #else
  5594. #define SetupDiGetHwProfileFriendlyNameEx SetupDiGetHwProfileFriendlyNameExA
  5595. #endif
  5596. //
  5597. // PageType values for SetupDiGetWizardPage API
  5598. //
  5599. #define SPWPT_SELECTDEVICE 0x00000001
  5600. //
  5601. // Flags for SetupDiGetWizardPage API
  5602. //
  5603. #define SPWP_USE_DEVINFO_DATA 0x00000001
  5604. WINSETUPAPI
  5605. HPROPSHEETPAGE
  5606. WINAPI
  5607. SetupDiGetWizardPage(
  5608. IN HDEVINFO DeviceInfoSet,
  5609. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  5610. IN PSP_INSTALLWIZARD_DATA InstallWizardData,
  5611. IN DWORD PageType,
  5612. IN DWORD Flags
  5613. );
  5614. WINSETUPAPI
  5615. BOOL
  5616. WINAPI
  5617. SetupDiGetSelectedDevice(
  5618. IN HDEVINFO DeviceInfoSet,
  5619. OUT PSP_DEVINFO_DATA DeviceInfoData
  5620. );
  5621. WINSETUPAPI
  5622. BOOL
  5623. WINAPI
  5624. SetupDiSetSelectedDevice(
  5625. IN HDEVINFO DeviceInfoSet,
  5626. IN PSP_DEVINFO_DATA DeviceInfoData
  5627. );
  5628. WINSETUPAPI
  5629. BOOL
  5630. WINAPI
  5631. SetupDiGetActualSectionToInstallA(
  5632. IN HINF InfHandle,
  5633. IN PCSTR InfSectionName,
  5634. OUT PSTR InfSectionWithExt, OPTIONAL
  5635. IN DWORD InfSectionWithExtSize,
  5636. OUT PDWORD RequiredSize, OPTIONAL
  5637. OUT PSTR *Extension OPTIONAL
  5638. );
  5639. WINSETUPAPI
  5640. BOOL
  5641. WINAPI
  5642. SetupDiGetActualSectionToInstallW(
  5643. IN HINF InfHandle,
  5644. IN PCWSTR InfSectionName,
  5645. OUT PWSTR InfSectionWithExt, OPTIONAL
  5646. IN DWORD InfSectionWithExtSize,
  5647. OUT PDWORD RequiredSize, OPTIONAL
  5648. OUT PWSTR *Extension OPTIONAL
  5649. );
  5650. #ifdef UNICODE
  5651. #define SetupDiGetActualSectionToInstall SetupDiGetActualSectionToInstallW
  5652. #else
  5653. #define SetupDiGetActualSectionToInstall SetupDiGetActualSectionToInstallA
  5654. #endif
  5655. #if _SETUPAPI_VER >= 0x0501
  5656. WINSETUPAPI
  5657. BOOL
  5658. WINAPI
  5659. SetupDiGetActualSectionToInstallExA(
  5660. IN HINF InfHandle,
  5661. IN PCSTR InfSectionName,
  5662. IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo, OPTIONAL
  5663. OUT PSTR InfSectionWithExt, OPTIONAL
  5664. IN DWORD InfSectionWithExtSize,
  5665. OUT PDWORD RequiredSize, OPTIONAL
  5666. OUT PSTR *Extension, OPTIONAL
  5667. IN PVOID Reserved
  5668. );
  5669. WINSETUPAPI
  5670. BOOL
  5671. WINAPI
  5672. SetupDiGetActualSectionToInstallExW(
  5673. IN HINF InfHandle,
  5674. IN PCWSTR InfSectionName,
  5675. IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo, OPTIONAL
  5676. OUT PWSTR InfSectionWithExt, OPTIONAL
  5677. IN DWORD InfSectionWithExtSize,
  5678. OUT PDWORD RequiredSize, OPTIONAL
  5679. OUT PWSTR *Extension, OPTIONAL
  5680. IN PVOID Reserved
  5681. );
  5682. #ifdef UNICODE
  5683. #define SetupDiGetActualSectionToInstallEx SetupDiGetActualSectionToInstallExW
  5684. #else
  5685. #define SetupDiGetActualSectionToInstallEx SetupDiGetActualSectionToInstallExA
  5686. #endif
  5687. #endif // _SETUPAPI_VER >= 0x0501
  5688. #if _SETUPAPI_VER >= 0x0501
  5689. //
  5690. // SetupEnumInfSections is for low-level parsing of an INF
  5691. //
  5692. WINSETUPAPI
  5693. BOOL
  5694. WINAPI
  5695. SetupEnumInfSectionsA (
  5696. IN HINF InfHandle,
  5697. IN UINT Index,
  5698. OUT PSTR Buffer, OPTIONAL
  5699. IN UINT Size, OPTIONAL
  5700. OUT UINT *SizeNeeded OPTIONAL
  5701. );
  5702. WINSETUPAPI
  5703. BOOL
  5704. WINAPI
  5705. SetupEnumInfSectionsW (
  5706. IN HINF InfHandle,
  5707. IN UINT Index,
  5708. OUT PWSTR Buffer, OPTIONAL
  5709. IN UINT Size, OPTIONAL
  5710. OUT UINT *SizeNeeded OPTIONAL
  5711. );
  5712. #ifdef UNICODE
  5713. #define SetupEnumInfSections SetupEnumInfSectionsW
  5714. #else
  5715. #define SetupEnumInfSections SetupEnumInfSectionsA
  5716. #endif
  5717. #endif // _SETUPAPI_VER >= 0x0501
  5718. #if _SETUPAPI_VER >= 0x0501
  5719. typedef struct _SP_INF_SIGNER_INFO_A {
  5720. DWORD cbSize;
  5721. CHAR CatalogFile[MAX_PATH];
  5722. CHAR DigitalSigner[MAX_PATH];
  5723. CHAR DigitalSignerVersion[MAX_PATH];
  5724. } SP_INF_SIGNER_INFO_A, *PSP_INF_SIGNER_INFO_A;
  5725. typedef struct _SP_INF_SIGNER_INFO_W {
  5726. DWORD cbSize;
  5727. WCHAR CatalogFile[MAX_PATH];
  5728. WCHAR DigitalSigner[MAX_PATH];
  5729. WCHAR DigitalSignerVersion[MAX_PATH];
  5730. } SP_INF_SIGNER_INFO_W, *PSP_INF_SIGNER_INFO_W;
  5731. #ifdef UNICODE
  5732. typedef SP_INF_SIGNER_INFO_W SP_INF_SIGNER_INFO;
  5733. typedef PSP_INF_SIGNER_INFO_W PSP_INF_SIGNER_INFO;
  5734. #else
  5735. typedef SP_INF_SIGNER_INFO_A SP_INF_SIGNER_INFO;
  5736. typedef PSP_INF_SIGNER_INFO_A PSP_INF_SIGNER_INFO;
  5737. #endif
  5738. WINSETUPAPI
  5739. BOOL
  5740. WINAPI
  5741. SetupVerifyInfFileA(
  5742. IN PCSTR InfName,
  5743. IN PSP_ALTPLATFORM_INFO AltPlatformInfo, OPTIONAL
  5744. OUT PSP_INF_SIGNER_INFO_A InfSignerInfo
  5745. );
  5746. WINSETUPAPI
  5747. BOOL
  5748. WINAPI
  5749. SetupVerifyInfFileW(
  5750. IN PCWSTR InfName,
  5751. IN PSP_ALTPLATFORM_INFO AltPlatformInfo, OPTIONAL
  5752. OUT PSP_INF_SIGNER_INFO_W InfSignerInfo
  5753. );
  5754. #ifdef UNICODE
  5755. #define SetupVerifyInfFile SetupVerifyInfFileW
  5756. #else
  5757. #define SetupVerifyInfFile SetupVerifyInfFileA
  5758. #endif
  5759. #endif // _SETUPAPI_VER >= 0x0501
  5760. #if _SETUPAPI_VER >= 0x0501
  5761. //
  5762. // Flags for use by SetupDiGetCustomDeviceProperty
  5763. //
  5764. #define DICUSTOMDEVPROP_MERGE_MULTISZ 0x00000001
  5765. WINSETUPAPI
  5766. BOOL
  5767. WINAPI
  5768. SetupDiGetCustomDevicePropertyA(
  5769. IN HDEVINFO DeviceInfoSet,
  5770. IN PSP_DEVINFO_DATA DeviceInfoData,
  5771. IN PCSTR CustomPropertyName,
  5772. IN DWORD Flags,
  5773. OUT PDWORD PropertyRegDataType, OPTIONAL
  5774. OUT PBYTE PropertyBuffer,
  5775. IN DWORD PropertyBufferSize,
  5776. OUT PDWORD RequiredSize OPTIONAL
  5777. );
  5778. WINSETUPAPI
  5779. BOOL
  5780. WINAPI
  5781. SetupDiGetCustomDevicePropertyW(
  5782. IN HDEVINFO DeviceInfoSet,
  5783. IN PSP_DEVINFO_DATA DeviceInfoData,
  5784. IN PCWSTR CustomPropertyName,
  5785. IN DWORD Flags,
  5786. OUT PDWORD PropertyRegDataType, OPTIONAL
  5787. OUT PBYTE PropertyBuffer,
  5788. IN DWORD PropertyBufferSize,
  5789. OUT PDWORD RequiredSize OPTIONAL
  5790. );
  5791. #ifdef UNICODE
  5792. #define SetupDiGetCustomDeviceProperty SetupDiGetCustomDevicePropertyW
  5793. #else
  5794. #define SetupDiGetCustomDeviceProperty SetupDiGetCustomDevicePropertyA
  5795. #endif
  5796. #endif // _SETUPAPI_VER >= 0x0501
  5797. #if _SETUPAPI_VER >= 0x0502
  5798. //
  5799. // To configure WMI security for downlevel platforms where the [DDInstall.WMI]
  5800. // section isn't natively supported by setupapi, a redistributable co-installer
  5801. // is supplied in the DDK for use on those platforms.
  5802. //
  5803. //
  5804. // Flags for use by SetupConfigureWmiFromInfSection
  5805. //
  5806. #define SCWMI_CLOBBER_SECURITY 0x00000001
  5807. WINSETUPAPI
  5808. BOOL
  5809. WINAPI
  5810. SetupConfigureWmiFromInfSectionA(
  5811. IN HINF InfHandle,
  5812. IN PCSTR SectionName,
  5813. IN DWORD Flags
  5814. );
  5815. WINSETUPAPI
  5816. BOOL
  5817. WINAPI
  5818. SetupConfigureWmiFromInfSectionW(
  5819. IN HINF InfHandle,
  5820. IN PCWSTR SectionName,
  5821. IN DWORD Flags
  5822. );
  5823. #ifdef UNICODE
  5824. #define SetupConfigureWmiFromInfSection SetupConfigureWmiFromInfSectionW
  5825. #else
  5826. #define SetupConfigureWmiFromInfSection SetupConfigureWmiFromInfSectionA
  5827. #endif
  5828. #endif // _SETUPAPI_VER >= 0x0502
  5829. #ifdef __cplusplus
  5830. }
  5831. #endif
  5832. #include <poppack.h>
  5833. #endif // _INC_SETUPAPI