Source code of Windows XP (NT5)
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.

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