SetupAPI.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:192k
源码类别:

模拟服务器

开发平台:

C/C++

  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").
  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 UsersStart Menu
  244. #define DIRID_COMMON_PROGRAMS         16407  // All UsersStart MenuPrograms
  245. #define DIRID_COMMON_STARTUP          16408  // All UsersStart MenuProgramsStartup
  246. #define DIRID_COMMON_DESKTOPDIRECTORY 16409  // All UsersDesktop
  247. #define DIRID_COMMON_FAVORITES        16415  // All UsersFavorites
  248. #define DIRID_COMMON_APPDATA          16419  // All UsersApplication 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 FilesCommon
  253. #define DIRID_PROGRAM_FILES_COMMONX86 16428  // x86 Program FilesCommon on RISC
  254. #define DIRID_COMMON_TEMPLATES        16429  // All UsersTemplates
  255. #define DIRID_COMMON_DOCUMENTS        16430  // All UsersDocuments
  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(     IN  DWORD    Flags,
  2189.     OUT PCWSTR **List,
  2190.     OUT PUINT    Count
  2191.     );
  2192. #ifdef UNICODE
  2193. #define SetupQuerySourceList SetupQuerySourceListW
  2194. #else
  2195. #define SetupQuerySourceList SetupQuerySourceListA
  2196. #endif
  2197. WINSETUPAPI
  2198. BOOL
  2199. WINAPI
  2200. SetupFreeSourceListA(
  2201.     IN OUT PCSTR **List,
  2202.     IN     UINT    Count
  2203.     );
  2204. WINSETUPAPI
  2205. BOOL
  2206. WINAPI
  2207. SetupFreeSourceListW(
  2208.     IN OUT PCWSTR **List,
  2209.     IN     UINT     Count
  2210.     );
  2211. #ifdef UNICODE
  2212. #define SetupFreeSourceList SetupFreeSourceListW
  2213. #else
  2214. #define SetupFreeSourceList SetupFreeSourceListA
  2215. #endif
  2216. WINSETUPAPI
  2217. UINT
  2218. WINAPI
  2219. SetupPromptForDiskA(
  2220.     IN  HWND   hwndParent,
  2221.     IN  PCSTR  DialogTitle,      OPTIONAL
  2222.     IN  PCSTR  DiskName,         OPTIONAL
  2223.     IN  PCSTR  PathToSource,     OPTIONAL
  2224.     IN  PCSTR  FileSought,
  2225.     IN  PCSTR  TagFile,          OPTIONAL
  2226.     IN  DWORD  DiskPromptStyle,
  2227.     OUT PSTR   PathBuffer,
  2228.     IN  DWORD  PathBufferSize,
  2229.     OUT PDWORD PathRequiredSize
  2230.     );
  2231. WINSETUPAPI
  2232. UINT
  2233. WINAPI
  2234. SetupPromptForDiskW(
  2235.     IN  HWND   hwndParent,
  2236.     IN  PCWSTR DialogTitle,      OPTIONAL
  2237.     IN  PCWSTR DiskName,         OPTIONAL
  2238.     IN  PCWSTR PathToSource,     OPTIONAL
  2239.     IN  PCWSTR FileSought,
  2240.     IN  PCWSTR TagFile,          OPTIONAL
  2241.     IN  DWORD  DiskPromptStyle,
  2242.     OUT PWSTR  PathBuffer,
  2243.     IN  DWORD  PathBufferSize,
  2244.     OUT PDWORD PathRequiredSize
  2245.     );
  2246. #ifdef UNICODE
  2247. #define SetupPromptForDisk SetupPromptForDiskW
  2248. #else
  2249. #define SetupPromptForDisk SetupPromptForDiskA
  2250. #endif
  2251. WINSETUPAPI
  2252. UINT
  2253. WINAPI
  2254. SetupCopyErrorA(
  2255.     IN  HWND   hwndParent,
  2256.     IN  PCSTR  DialogTitle,     OPTIONAL
  2257.     IN  PCSTR  DiskName,        OPTIONAL
  2258.     IN  PCSTR  PathToSource,
  2259.     IN  PCSTR  SourceFile,
  2260.     IN  PCSTR  TargetPathFile,  OPTIONAL
  2261.     IN  UINT   Win32ErrorCode,
  2262.     IN  DWORD  Style,
  2263.     OUT PSTR   PathBuffer,      OPTIONAL
  2264.     IN  DWORD  PathBufferSize,
  2265.     OUT PDWORD PathRequiredSize OPTIONAL
  2266.     );
  2267. WINSETUPAPI
  2268. UINT
  2269. WINAPI
  2270. SetupCopyErrorW(
  2271.     IN  HWND   hwndParent,
  2272.     IN  PCWSTR DialogTitle,     OPTIONAL
  2273.     IN  PCWSTR DiskName,        OPTIONAL
  2274.     IN  PCWSTR PathToSource,
  2275.     IN  PCWSTR SourceFile,
  2276.     IN  PCWSTR TargetPathFile,  OPTIONAL
  2277.     IN  UINT   Win32ErrorCode,
  2278.     IN  DWORD  Style,
  2279.     OUT PWSTR  PathBuffer,      OPTIONAL
  2280.     IN  DWORD  PathBufferSize,
  2281.     OUT PDWORD PathRequiredSize OPTIONAL
  2282.     );
  2283. #ifdef UNICODE
  2284. #define SetupCopyError SetupCopyErrorW
  2285. #else
  2286. #define SetupCopyError SetupCopyErrorA
  2287. #endif
  2288. WINSETUPAPI
  2289. UINT
  2290. WINAPI
  2291. SetupRenameErrorA(
  2292.     IN  HWND   hwndParent,
  2293.     IN  PCSTR  DialogTitle,     OPTIONAL
  2294.     IN  PCSTR  SourceFile,
  2295.     IN  PCSTR  TargetFile,
  2296.     IN  UINT   Win32ErrorCode,
  2297.     IN  DWORD  Style
  2298.     );
  2299. WINSETUPAPI
  2300. UINT
  2301. WINAPI
  2302. SetupRenameErrorW(
  2303.     IN  HWND   hwndParent,
  2304.     IN  PCWSTR DialogTitle,     OPTIONAL
  2305.     IN  PCWSTR SourceFile,
  2306.     IN  PCWSTR TargetFile,
  2307.     IN  UINT   Win32ErrorCode,
  2308.     IN  DWORD  Style
  2309.     );
  2310. #ifdef UNICODE
  2311. #define SetupRenameError SetupRenameErrorW
  2312. #else
  2313. #define SetupRenameError SetupRenameErrorA
  2314. #endif
  2315. WINSETUPAPI
  2316. UINT
  2317. WINAPI
  2318. SetupDeleteErrorA(
  2319.     IN  HWND   hwndParent,
  2320.     IN  PCSTR  DialogTitle,     OPTIONAL
  2321.     IN  PCSTR  File,
  2322.     IN  UINT   Win32ErrorCode,
  2323.     IN  DWORD  Style
  2324.     );
  2325. WINSETUPAPI
  2326. UINT
  2327. WINAPI
  2328. SetupDeleteErrorW(
  2329.     IN  HWND   hwndParent,
  2330.     IN  PCWSTR DialogTitle,     OPTIONAL
  2331.     IN  PCWSTR File,
  2332.     IN  UINT   Win32ErrorCode,
  2333.     IN  DWORD  Style
  2334.     );
  2335. #ifdef UNICODE
  2336. #define SetupDeleteError SetupDeleteErrorW
  2337. #else
  2338. #define SetupDeleteError SetupDeleteErrorA
  2339. #endif
  2340. WINSETUPAPI
  2341. UINT
  2342. WINAPI
  2343. SetupBackupErrorA(
  2344.     IN  HWND   hwndParent,
  2345.     IN  PCSTR  DialogTitle,     OPTIONAL
  2346.     IN  PCSTR  SourceFile,
  2347.     IN  PCSTR  TargetFile,      OPTIONAL
  2348.     IN  UINT   Win32ErrorCode,
  2349.     IN  DWORD  Style
  2350.     );
  2351. WINSETUPAPI
  2352. UINT
  2353. WINAPI
  2354. SetupBackupErrorW(
  2355.     IN  HWND   hwndParent,
  2356.     IN  PCWSTR DialogTitle,     OPTIONAL
  2357.     IN  PCWSTR SourceFile,
  2358.     IN  PCWSTR TargetFile,      OPTIONAL
  2359.     IN  UINT   Win32ErrorCode,     IN  DWORD  Style
  2360.     );
  2361. #ifdef UNICODE
  2362. #define SetupBackupError SetupBackupErrorW
  2363. #else
  2364. #define SetupBackupError SetupBackupErrorA
  2365. #endif
  2366. //
  2367. // Styles for SetupPromptForDisk, SetupCopyError,
  2368. // SetupRenameError, SetupDeleteError
  2369. //
  2370. #define IDF_NOBROWSE                    0x00000001
  2371. #define IDF_NOSKIP                      0x00000002
  2372. #define IDF_NODETAILS                   0x00000004
  2373. #define IDF_NOCOMPRESSED                0x00000008
  2374. #define IDF_CHECKFIRST                  0x00000100
  2375. #define IDF_NOBEEP                      0x00000200
  2376. #define IDF_NOFOREGROUND                0x00000400
  2377. #define IDF_WARNIFSKIP                  0x00000800
  2378. #if _SETUPAPI_VER >= 0x0501
  2379. #define IDF_NOREMOVABLEMEDIAPROMPT      0x00001000
  2380. #define IDF_USEDISKNAMEASPROMPT         0x00002000
  2381. #define IDF_OEMDISK                     0x80000000
  2382. #endif // _SETUPAPI_VER >= 0x0501
  2383. //
  2384. // Return values for SetupPromptForDisk, SetupCopyError,
  2385. // SetupRenameError, SetupDeleteError, SetupBackupError
  2386. //
  2387. #define DPROMPT_SUCCESS         0
  2388. #define DPROMPT_CANCEL          1
  2389. #define DPROMPT_SKIPFILE        2
  2390. #define DPROMPT_BUFFERTOOSMALL  3
  2391. #define DPROMPT_OUTOFMEMORY     4
  2392. WINSETUPAPI
  2393. BOOL
  2394. WINAPI
  2395. SetupSetDirectoryIdA(
  2396.     IN HINF  InfHandle,
  2397.     IN DWORD Id,            OPTIONAL
  2398.     IN PCSTR Directory      OPTIONAL
  2399.     );
  2400. WINSETUPAPI
  2401. BOOL
  2402. WINAPI
  2403. SetupSetDirectoryIdW(
  2404.     IN HINF   InfHandle,
  2405.     IN DWORD  Id,           OPTIONAL
  2406.     IN PCWSTR Directory     OPTIONAL
  2407.     );
  2408. #ifdef UNICODE
  2409. #define SetupSetDirectoryId SetupSetDirectoryIdW
  2410. #else
  2411. #define SetupSetDirectoryId SetupSetDirectoryIdA
  2412. #endif
  2413. WINSETUPAPI
  2414. BOOL
  2415. WINAPI
  2416. SetupSetDirectoryIdExA(
  2417.     IN HINF  InfHandle,
  2418.     IN DWORD Id,            OPTIONAL
  2419.     IN PCSTR Directory,     OPTIONAL
  2420.     IN DWORD Flags,
  2421.     IN DWORD Reserved1,
  2422.     IN PVOID Reserved2
  2423.     );
  2424. WINSETUPAPI
  2425. BOOL
  2426. WINAPI
  2427. SetupSetDirectoryIdExW(
  2428.     IN HINF   InfHandle,
  2429.     IN DWORD  Id,           OPTIONAL
  2430.     IN PCWSTR Directory,    OPTIONAL
  2431.     IN DWORD  Flags,
  2432.     IN DWORD  Reserved1,
  2433.     IN PVOID  Reserved2
  2434.     );
  2435. #ifdef UNICODE
  2436. #define SetupSetDirectoryIdEx SetupSetDirectoryIdExW
  2437. #else
  2438. #define SetupSetDirectoryIdEx SetupSetDirectoryIdExA
  2439. #endif
  2440. //
  2441. // Flags for SetupSetDirectoryIdEx
  2442. //
  2443. #define SETDIRID_NOT_FULL_PATH      0x00000001
  2444. WINSETUPAPI
  2445. BOOL
  2446. WINAPI
  2447. SetupGetSourceInfoA(
  2448.     IN  HINF   InfHandle,
  2449.     IN  UINT   SourceId,
  2450.     IN  UINT   InfoDesired,
  2451.     OUT PSTR   ReturnBuffer,     OPTIONAL
  2452.     IN  DWORD  ReturnBufferSize,
  2453.     OUT PDWORD RequiredSize      OPTIONAL
  2454.     );
  2455. WINSETUPAPI
  2456. BOOL
  2457. WINAPI
  2458. SetupGetSourceInfoW(
  2459.     IN  HINF   InfHandle,
  2460.     IN  UINT   SourceId,
  2461.     IN  UINT   InfoDesired,
  2462.     OUT PWSTR  ReturnBuffer,     OPTIONAL
  2463.     IN  DWORD  ReturnBufferSize,
  2464.     OUT PDWORD RequiredSize      OPTIONAL
  2465.     );
  2466. #ifdef UNICODE
  2467. #define SetupGetSourceInfo SetupGetSourceInfoW
  2468. #else
  2469. #define SetupGetSourceInfo SetupGetSourceInfoA
  2470. #endif
  2471. //
  2472. // InfoDesired values for SetupGetSourceInfo
  2473. //
  2474. #define SRCINFO_PATH            1
  2475. #define SRCINFO_TAGFILE         2
  2476. #define SRCINFO_DESCRIPTION     3
  2477. #define SRCINFO_FLAGS           4
  2478. #if _SETUPAPI_VER >= 0x0501
  2479. //
  2480. // SRC_FLAGS allow special treatment of source
  2481. // lower 4 bits are reserved for OS use
  2482. // the flags may determine what other parameters exist
  2483. //
  2484. #define SRCINFO_TAGFILE2        5  // alternate tagfile, when SRCINFO_TAGFILE is a cabfile
  2485. #define SRC_FLAGS_CABFILE       (0x0010) // if set, treat SRCINFO_TAGFILE as a cabfile and specify alternate tagfile
  2486. #endif // _SETUPAPI_VER >= 0x0501
  2487. WINSETUPAPI
  2488. BOOL
  2489. WINAPI
  2490. SetupInstallFileA(
  2491.     IN HINF                InfHandle,         OPTIONAL
  2492.     IN PINFCONTEXT         InfContext,        OPTIONAL
  2493.     IN PCSTR               SourceFile,        OPTIONAL
  2494.     IN PCSTR               SourcePathRoot,    OPTIONAL
  2495.     IN PCSTR               DestinationName,   OPTIONAL
  2496.     IN DWORD               CopyStyle,
  2497.     IN PSP_FILE_CALLBACK_A CopyMsgHandler,    OPTIONAL
  2498.     IN PVOID               Context            OPTIONAL
  2499.     );
  2500. WINSETUPAPI
  2501. BOOL
  2502. WINAPI
  2503. SetupInstallFileW(
  2504.     IN HINF                InfHandle,         OPTIONAL
  2505.     IN PINFCONTEXT         InfContext,        OPTIONAL
  2506.     IN PCWSTR              SourceFile,        OPTIONAL
  2507.     IN PCWSTR              SourcePathRoot,    OPTIONAL
  2508.     IN PCWSTR              DestinationName,   OPTIONAL
  2509.     IN DWORD               CopyStyle,
  2510.     IN PSP_FILE_CALLBACK_W CopyMsgHandler,    OPTIONAL
  2511.     IN PVOID               Context            OPTIONAL
  2512.     );
  2513. #ifdef UNICODE
  2514. #define SetupInstallFile SetupInstallFileW
  2515. #else
  2516. #define SetupInstallFile SetupInstallFileA
  2517. #endif
  2518. WINSETUPAPI
  2519. BOOL
  2520. WINAPI
  2521. SetupInstallFileExA(
  2522.     IN  HINF                InfHandle,         OPTIONAL
  2523.     IN  PINFCONTEXT         InfContext,        OPTIONAL
  2524.     IN  PCSTR               SourceFile,        OPTIONAL
  2525.     IN  PCSTR               SourcePathRoot,    OPTIONAL
  2526.     IN  PCSTR               DestinationName,   OPTIONAL
  2527.     IN  DWORD               CopyStyle,
  2528.     IN  PSP_FILE_CALLBACK_A CopyMsgHandler,    OPTIONAL
  2529.     IN  PVOID               Context,           OPTIONAL
  2530.     OUT PBOOL               FileWasInUse
  2531.     );
  2532. WINSETUPAPI
  2533. BOOL
  2534. WINAPI
  2535. SetupInstallFileExW(
  2536.     IN  HINF                InfHandle,         OPTIONAL
  2537.     IN  PINFCONTEXT         InfContext,        OPTIONAL
  2538.     IN  PCWSTR              SourceFile,        OPTIONAL
  2539.     IN  PCWSTR              SourcePathRoot,    OPTIONAL
  2540.     IN  PCWSTR              DestinationName,   OPTIONAL
  2541.     IN  DWORD               CopyStyle,
  2542.     IN  PSP_FILE_CALLBACK_W CopyMsgHandler,    OPTIONAL
  2543.     IN  PVOID               Context,           OPTIONAL
  2544.     OUT PBOOL               FileWasInUse
  2545.     );
  2546. #ifdef UNICODE
  2547. #define SetupInstallFileEx SetupInstallFileExW
  2548. #else
  2549. #define SetupInstallFileEx SetupInstallFileExA
  2550. #endif
  2551. //
  2552. // CopyStyle values for copy and queue-related APIs
  2553. //
  2554. #define SP_COPY_DELETESOURCE        0x0000001   // delete source file on successful copy
  2555. #define SP_COPY_REPLACEONLY         0x0000002   // copy only if target file already present
  2556. #define SP_COPY_NEWER               0x0000004   // copy only if source newer than or same as target
  2557. #define SP_COPY_NEWER_OR_SAME       SP_COPY_NEWER
  2558. #define SP_COPY_NOOVERWRITE         0x0000008   // copy only if target doesn't exist
  2559. #define SP_COPY_NODECOMP            0x0000010   // don't decompress source file while copying
  2560. #define SP_COPY_LANGUAGEAWARE       0x0000020   // don't overwrite file of different language
  2561. #define SP_COPY_SOURCE_ABSOLUTE     0x0000040   // SourceFile is a full source path
  2562. #define SP_COPY_SOURCEPATH_ABSOLUTE 0x0000080   // SourcePathRoot is the full path
  2563. #define SP_COPY_IN_USE_NEEDS_REBOOT 0x0000100   // System needs reboot if file in use
  2564. #define SP_COPY_FORCE_IN_USE        0x0000200   // Force target-in-use behavior
  2565. #define SP_COPY_NOSKIP              0x0000400   // Skip is disallowed for this file or section
  2566. #define SP_FLAG_CABINETCONTINUATION 0x0000800   // Used with need media notification
  2567. #define SP_COPY_FORCE_NOOVERWRITE   0x0001000   // like NOOVERWRITE but no callback nofitication
  2568. #define SP_COPY_FORCE_NEWER         0x0002000   // like NEWER but no callback nofitication
  2569. #define SP_COPY_WARNIFSKIP          0x0004000   // system critical file: warn if user tries to skip
  2570. #define SP_COPY_NOBROWSE            0x0008000   // Browsing is disallowed for this file or section
  2571. #define SP_COPY_NEWER_ONLY          0x0010000   // copy only if source file newer than target
  2572. #define SP_COPY_SOURCE_SIS_MASTER   0x0020000   // source is single-instance store master
  2573. #define SP_COPY_OEMINF_CATALOG_ONLY 0x0040000   // (SetupCopyOEMInf only) don't copy INF--just catalog
  2574. #define SP_COPY_REPLACE_BOOT_FILE   0x0080000   // file must be present upon reboot (i.e., it's
  2575.                                                 // needed by the loader); this flag implies a reboot
  2576. #define SP_COPY_NOPRUNE             0x0100000   // never prune this file
  2577. #if _SETUPAPI_VER >= 0x0501
  2578. #define SP_COPY_OEM_F6_INF          0x0200000   // Used when calling SetupCopyOemInf
  2579. #endif //_SETUPAPI_VER >= 0x0501
  2580. #if _SETUPAPI_VER >= 0x0501
  2581. //
  2582. // Flags passed to Backup notification
  2583. //
  2584. #define SP_BACKUP_BACKUPPASS        0x00000001  // file backed up during backup pass
  2585. #define SP_BACKUP_DEMANDPASS        0x00000002  // file backed up on demand
  2586. #define SP_BACKUP_SPECIAL           0x00000004  // if set, special type of backup
  2587. #define SP_BACKUP_BOOTFILE          0x00000008  // file marked with COPYFLG_REPLACE_BOOT_FILE
  2588. #endif //_SETUPAPI_VER >= 0x0501
  2589. WINSETUPAPI
  2590. HSPFILEQ
  2591. WINAPI
  2592. SetupOpenFileQueue(
  2593.     VOID
  2594.     );
  2595. WINSETUPAPI
  2596. BOOL
  2597. WINAPI
  2598. SetupCloseFileQueue(
  2599.     IN HSPFILEQ QueueHandle
  2600.     );
  2601. WINSETUPAPI
  2602. BOOL
  2603. WINAPI
  2604. SetupSetFileQueueAlternatePlatformA(
  2605.     IN HSPFILEQ             QueueHandle,
  2606.     IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo,      OPTIONAL
  2607.     IN PCSTR                AlternateDefaultCatalogFile OPTIONAL
  2608.     );
  2609. WINSETUPAPI
  2610. BOOL
  2611. WINAPI
  2612. SetupSetFileQueueAlternatePlatformW(
  2613.     IN HSPFILEQ             QueueHandle,
  2614.     IN PSP_ALTPLATFORM_INFO AlternatePlatformInfo,      OPTIONAL
  2615.     IN PCWSTR               AlternateDefaultCatalogFile OPTIONAL
  2616.     );
  2617. #ifdef UNICODE
  2618. #define SetupSetFileQueueAlternatePlatform SetupSetFileQueueAlternatePlatformW
  2619. #else
  2620. #define SetupSetFileQueueAlternatePlatform SetupSetFileQueueAlternatePlatformA
  2621. #endif
  2622. WINSETUPAPI
  2623. BOOL
  2624. WINAPI
  2625. SetupSetPlatformPathOverrideA(
  2626.     IN PCSTR Override   OPTIONAL
  2627.     );
  2628. WINSETUPAPI
  2629. BOOL
  2630. WINAPI
  2631. SetupSetPlatformPathOverrideW(
  2632.     IN PCWSTR Override  OPTIONAL
  2633.     );
  2634. #ifdef UNICODE
  2635. #define SetupSetPlatformPathOverride SetupSetPlatformPathOverrideW
  2636. #else
  2637. #define SetupSetPlatformPathOverride SetupSetPlatformPathOverrideA
  2638. #endif
  2639. WINSETUPAPI
  2640. BOOL
  2641. WINAPI
  2642. SetupQueueCopyA(
  2643.     IN HSPFILEQ QueueHandle,
  2644.     IN PCSTR    SourceRootPath,     OPTIONAL
  2645.     IN PCSTR    SourcePath,         OPTIONAL
  2646.     IN PCSTR    SourceFilename,
  2647.     IN PCSTR    SourceDescription,  OPTIONAL
  2648.     IN PCSTR    SourceTagfile,      OPTIONAL
  2649.     IN PCSTR    TargetDirectory,
  2650.     IN PCSTR    TargetFilename,     OPTIONAL
  2651.     IN DWORD    CopyStyle
  2652.     );
  2653. WINSETUPAPI
  2654. BOOL
  2655. WINAPI
  2656. SetupQueueCopyW(
  2657.     IN HSPFILEQ QueueHandle,
  2658.     IN PCWSTR   SourceRootPath,     OPTIONAL
  2659.     IN PCWSTR   SourcePath,         OPTIONAL
  2660.     IN PCWSTR   SourceFilename,
  2661.     IN PCWSTR   SourceDescription,  OPTIONAL
  2662.     IN PCWSTR   SourceTagfile,      OPTIONAL
  2663.     IN PCWSTR   TargetDirectory,
  2664.     IN PCWSTR   TargetFilename,     OPTIONAL
  2665.     IN DWORD    CopyStyle
  2666.     );
  2667. #ifdef UNICODE
  2668. #define SetupQueueCopy SetupQueueCopyW
  2669. #else
  2670. #define SetupQueueCopy SetupQueueCopyA
  2671. #endif
  2672. WINSETUPAPI
  2673. BOOL
  2674. WINAPI
  2675. SetupQueueCopyIndirectA(
  2676.     IN PSP_FILE_COPY_PARAMS_A CopyParams
  2677.     );
  2678. WINSETUPAPI
  2679. BOOL
  2680. WINAPI
  2681. SetupQueueCopyIndirectW(
  2682.     IN PSP_FILE_COPY_PARAMS_W CopyParams
  2683.     );
  2684. #ifdef UNICODE
  2685. #define SetupQueueCopyIndirect SetupQueueCopyIndirectW
  2686. #else
  2687. #define SetupQueueCopyIndirect SetupQueueCopyIndirectA
  2688. #endif
  2689. WINSETUPAPI
  2690. BOOL
  2691. WINAPI
  2692. SetupQueueDefaultCopyA(
  2693.     IN HSPFILEQ QueueHandle,
  2694.     IN HINF     InfHandle,
  2695.     IN PCSTR    SourceRootPath,
  2696.     IN PCSTR    SourceFilename,
  2697.     IN PCSTR    TargetFilename,
  2698.     IN DWORD    CopyStyle
  2699.     );
  2700. WINSETUPAPI
  2701. BOOL
  2702. WINAPI
  2703. SetupQueueDefaultCopyW(
  2704.     IN HSPFILEQ QueueHandle,
  2705.     IN HINF     InfHandle,
  2706.     IN PCWSTR   SourceRootPath,
  2707.     IN PCWSTR   SourceFilename,
  2708.     IN PCWSTR   TargetFilename,
  2709.     IN DWORD    CopyStyle
  2710.     );
  2711. #ifdef UNICODE
  2712. #define SetupQueueDefaultCopy SetupQueueDefaultCopyW
  2713. #else
  2714. #define SetupQueueDefaultCopy SetupQueueDefaultCopyA
  2715. #endif
  2716. WINSETUPAPI
  2717. BOOL
  2718. WINAPI
  2719. SetupQueueCopySectionA(
  2720.     IN HSPFILEQ QueueHandle,
  2721.     IN PCSTR    SourceRootPath,
  2722.     IN HINF     InfHandle,
  2723.     IN HINF     ListInfHandle,   OPTIONAL
  2724.     IN PCSTR    Section,
  2725.     IN DWORD    CopyStyle
  2726.     );
  2727. WINSETUPAPI
  2728. BOOL
  2729. WINAPI
  2730. SetupQueueCopySectionW(
  2731.     IN HSPFILEQ QueueHandle,
  2732.     IN PCWSTR   SourceRootPath,
  2733.     IN HINF     InfHandle,
  2734.     IN HINF     ListInfHandle,   OPTIONAL
  2735.     IN PCWSTR   Section,
  2736.     IN DWORD    CopyStyle
  2737.     );
  2738. #ifdef UNICODE
  2739. #define SetupQueueCopySection SetupQueueCopySectionW
  2740. #else
  2741. #define SetupQueueCopySection SetupQueueCopySectionA
  2742. #endif
  2743. WINSETUPAPI
  2744. BOOL
  2745. WINAPI
  2746. SetupQueueDeleteA(
  2747.     IN HSPFILEQ QueueHandle,
  2748.     IN PCSTR    PathPart1,
  2749.     IN PCSTR    PathPart2       OPTIONAL
  2750.     );
  2751. WINSETUPAPI
  2752. BOOL
  2753. WINAPI
  2754. SetupQueueDeleteW(
  2755.     IN HSPFILEQ QueueHandle,
  2756.     IN PCWSTR   PathPart1,
  2757.     IN PCWSTR   PathPart2       OPTIONAL
  2758.     );
  2759. #ifdef UNICODE
  2760. #define SetupQueueDelete SetupQueueDeleteW
  2761. #else
  2762. #define SetupQueueDelete SetupQueueDeleteA
  2763. #endif
  2764. WINSETUPAPI
  2765. BOOL
  2766. WINAPI
  2767. SetupQueueDeleteSectionA(
  2768.     IN HSPFILEQ QueueHandle,
  2769.     IN HINF     InfHandle,
  2770.     IN HINF     ListInfHandle,   OPTIONAL
  2771.     IN PCSTR    Section
  2772.     );
  2773. WINSETUPAPI
  2774. BOOL
  2775. WINAPI
  2776. SetupQueueDeleteSectionW(
  2777.     IN HSPFILEQ QueueHandle,
  2778.     IN HINF     InfHandle,
  2779.     IN HINF     ListInfHandle,   OPTIONAL
  2780.     IN PCWSTR   Section
  2781.     );
  2782. #ifdef UNICODE
  2783. #define SetupQueueDeleteSection SetupQueueDeleteSectionW
  2784. #else
  2785. #define SetupQueueDeleteSection SetupQueueDeleteSectionA
  2786. #endif
  2787. WINSETUPAPI
  2788. BOOL
  2789. WINAPI
  2790. SetupQueueRenameA(
  2791.     IN HSPFILEQ QueueHandle,
  2792.     IN PCSTR    SourcePath,
  2793.     IN PCSTR    SourceFilename, OPTIONAL
  2794.     IN PCSTR    TargetPath,     OPTIONAL
  2795.     IN PCSTR    TargetFilename
  2796.     );
  2797. WINSETUPAPI
  2798. BOOL
  2799. WINAPI
  2800. SetupQueueRenameW(
  2801.     IN HSPFILEQ QueueHandle,
  2802.     IN PCWSTR   SourcePath,
  2803.     IN PCWSTR   SourceFilename, OPTIONAL
  2804.     IN PCWSTR   TargetPath,     OPTIONAL
  2805.     IN PCWSTR   TargetFilename
  2806.     );
  2807. #ifdef UNICODE
  2808. #define SetupQueueRename SetupQueueRenameW
  2809. #else
  2810. #define SetupQueueRename SetupQueueRenameA
  2811. #endif
  2812. WINSETUPAPI
  2813. BOOL
  2814. WINAPI
  2815. SetupQueueRenameSectionA(
  2816.     IN HSPFILEQ QueueHandle,
  2817.     IN HINF     InfHandle,
  2818.     IN HINF     ListInfHandle,   OPTIONAL
  2819.     IN PCSTR    Section
  2820.     );
  2821. WINSETUPAPI
  2822. BOOL
  2823. WINAPI
  2824. SetupQueueRenameSectionW(
  2825.     IN HSPFILEQ QueueHandle,
  2826.     IN HINF     InfHandle,
  2827.     IN HINF     ListInfHandle,   OPTIONAL
  2828.     IN PCWSTR   Section
  2829.     );
  2830. #ifdef UNICODE
  2831. #define SetupQueueRenameSection SetupQueueRenameSectionW
  2832. #else
  2833. #define SetupQueueRenameSection SetupQueueRenameSectionA
  2834. #endif
  2835. WINSETUPAPI
  2836. BOOL
  2837. WINAPI
  2838. SetupCommitFileQueueA(
  2839.     IN HWND                Owner,         OPTIONAL
  2840.     IN HSPFILEQ            QueueHandle,
  2841.     IN PSP_FILE_CALLBACK_A MsgHandler,
  2842.     IN PVOID               Context
  2843.     );
  2844. WINSETUPAPI
  2845. BOOL
  2846. WINAPI
  2847. SetupCommitFileQueueW(
  2848.     IN HWND                Owner,         OPTIONAL
  2849.     IN HSPFILEQ            QueueHandle,
  2850.     IN PSP_FILE_CALLBACK_W MsgHandler,
  2851.     IN PVOID               Context
  2852.     );
  2853. #ifdef UNICODE
  2854. #define SetupCommitFileQueue SetupCommitFileQueueW
  2855. #else
  2856. #define SetupCommitFileQueue SetupCommitFileQueueA
  2857. #endif
  2858. WINSETUPAPI
  2859. BOOL
  2860. WINAPI
  2861. SetupScanFileQueueA(
  2862.     IN  HSPFILEQ            FileQueue,
  2863.     IN  DWORD               Flags,
  2864.     IN  HWND                Window,            OPTIONAL
  2865.     IN  PSP_FILE_CALLBACK_A CallbackRoutine,   OPTIONAL
  2866.     IN  PVOID               CallbackContext,   OPTIONAL
  2867.     OUT PDWORD              Result
  2868.     );
  2869. WINSETUPAPI
  2870. BOOL
  2871. WINAPI
  2872. SetupScanFileQueueW(
  2873.     IN  HSPFILEQ            FileQueue,
  2874.     IN  DWORD               Flags,
  2875.     IN  HWND                Window,            OPTIONAL
  2876.     IN  PSP_FILE_CALLBACK_W CallbackRoutine,   OPTIONAL
  2877.     IN  PVOID               CallbackContext,   OPTIONAL
  2878.     OUT PDWORD              Result
  2879.     );
  2880. #ifdef UNICODE
  2881. #define SetupScanFileQueue SetupScanFileQueueW
  2882. #else
  2883. #define SetupScanFileQueue SetupScanFileQueueA
  2884. #endif
  2885. //
  2886. // Define flags for SetupScanFileQueue.
  2887. //
  2888. #define SPQ_SCAN_FILE_PRESENCE                  0x00000001
  2889. #define SPQ_SCAN_FILE_VALIDITY                  0x00000002
  2890. #define SPQ_SCAN_USE_CALLBACK                   0x00000004
  2891. #define SPQ_SCAN_USE_CALLBACKEX                 0x00000008
  2892. #define SPQ_SCAN_INFORM_USER                    0x00000010
  2893. #define SPQ_SCAN_PRUNE_COPY_QUEUE               0x00000020
  2894. #if _SETUPAPI_VER >= 0x0501
  2895. #define SPQ_SCAN_USE_CALLBACK_SIGNERINFO        0x00000040
  2896. #define SPQ_SCAN_PRUNE_DELREN                   0x00000080 // remote Delete/Rename queue
  2897. #endif // _SETUPAPI_VER >= 0x0501
  2898. //
  2899. // Define flags used with Param2 for SPFILENOTIFY_QUEUESCAN
  2900. //
  2901. #define SPQ_DELAYED_COPY                        0x00000001  // file was in use; registered for delayed copy
  2902. #if _SETUPAPI_VER >= 0x0501
  2903. WINSETUPAPI
  2904. BOOL
  2905. WINAPI
  2906. SetupGetFileQueueCount(
  2907.     IN  HSPFILEQ            FileQueue,
  2908.     IN  UINT                SubQueueFileOp,
  2909.     OUT PUINT               NumOperations
  2910.     );