SETUPAPI.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:137k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name:
  4.     setupapi.h
  5. Abstract:
  6.     Public header file for Windows NT Setup services Dll.
  7. Revision History:
  8. --*/
  9. #ifndef _INC_SETUPAPI
  10. #define _INC_SETUPAPI
  11. //
  12. // Define API decoration for direct importing of DLL references.
  13. //
  14. #if !defined(_SETUPAPI_)
  15. #define WINSETUPAPI DECLSPEC_IMPORT
  16. #else
  17. #define WINSETUPAPI
  18. #endif
  19. #include <pshpack1.h>   // Assume byte packing throughout
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #ifndef __LPGUID_DEFINED__
  24. #define __LPGUID_DEFINED__
  25. typedef GUID *LPGUID;
  26. #endif
  27. //
  28. // Include commctrl.h for our use of HIMAGELIST and wizard support.
  29. //
  30. #include <commctrl.h>
  31. //
  32. // Define maximum string length constants as specified by
  33. // Windows 95.
  34. //
  35. #define LINE_LEN                    256 // Win95-compatible maximum for displayable
  36.                                         // strings coming from a device INF.
  37. #define MAX_INF_STRING_LENGTH      4096 // Actual maximum size of an INF string (including
  38.                                         // string substitutions).
  39. #define MAX_TITLE_LEN                60
  40. #define MAX_INSTRUCTION_LEN         256
  41. #define MAX_LABEL_LEN                30
  42. #define MAX_SERVICE_NAME_LEN        256
  43. //
  44. // Define maximum length of a machine name in the format expected by ConfigMgr32
  45. // CM_Connect_Machine (i.e., "\\MachineName").
  46. //
  47. #define SP_MAX_MACHINENAME_LENGTH   (MAX_COMPUTERNAME_LENGTH + 3)
  48. //
  49. // Define type for reference to loaded inf file
  50. //
  51. typedef PVOID HINF;
  52. //
  53. // Inf context structure. Applications must not interpret or
  54. // overwrite values in these structures.
  55. //
  56. typedef struct _INFCONTEXT {
  57.     PVOID Inf;
  58.     PVOID CurrentInf;
  59.     UINT Section;
  60.     UINT Line;
  61. } INFCONTEXT, *PINFCONTEXT;
  62. //
  63. // Inf file information structure.
  64. //
  65. typedef struct _SP_INF_INFORMATION {
  66.     DWORD InfStyle;
  67.     DWORD InfCount;
  68.     BYTE VersionData[ANYSIZE_ARRAY];
  69. } SP_INF_INFORMATION, *PSP_INF_INFORMATION;
  70. //
  71. // SP_INF_INFORMATION.InfStyle values
  72. //
  73. #define INF_STYLE_NONE  0       // unrecognized or non-existent
  74. #define INF_STYLE_OLDNT 1       // winnt 3.x
  75. #define INF_STYLE_WIN4  2       // Win95
  76. //
  77. // Target directory specs.
  78. //
  79. #define DIRID_ABSOLUTE          -1              // real 32-bit -1
  80. #define DIRID_ABSOLUTE_16BIT     0xffff         // 16-bit -1 for compat w/setupx
  81. #define DIRID_NULL               0
  82. #define DIRID_SRCPATH            1
  83. #define DIRID_WINDOWS           10
  84. #define DIRID_SYSTEM            11              // system32
  85. #define DIRID_DRIVERS           12
  86. #define DIRID_IOSUBSYS          DIRID_DRIVERS
  87. #define DIRID_INF               17
  88. #define DIRID_HELP              18
  89. #define DIRID_FONTS             20
  90. #define DIRID_VIEWERS           21
  91. #define DIRID_COLOR             23
  92. #define DIRID_APPS              24
  93. #define DIRID_SHARED            25
  94. #define DIRID_BOOT              30
  95. #define DIRID_SYSTEM16          50
  96. #define DIRID_SPOOL             51
  97. #define DIRID_SPOOLDRIVERS      52
  98. #define DIRID_USERPROFILE       53
  99. #define DIRID_LOADER            54
  100. #define DIRID_PRINTPROCESSOR    55
  101. #define DIRID_DEFAULT           DIRID_SYSTEM
  102. //
  103. // First user-definable dirid. See SetupSetDirectoryId().
  104. //
  105. #define DIRID_USER              0x8000
  106. //
  107. // Setup callback notification routine type
  108. //
  109. typedef UINT (CALLBACK* PSP_FILE_CALLBACK_A)(
  110.     IN PVOID Context,
  111.     IN UINT Notification,
  112.     IN UINT Param1,
  113.     IN UINT Param2
  114.     );
  115. typedef UINT (CALLBACK* PSP_FILE_CALLBACK_W)(
  116.     IN PVOID Context,
  117.     IN UINT Notification,
  118.     IN UINT Param1,
  119.     IN UINT Param2
  120.     );
  121. #ifdef UNICODE
  122. #define PSP_FILE_CALLBACK PSP_FILE_CALLBACK_W
  123. #else
  124. #define PSP_FILE_CALLBACK PSP_FILE_CALLBACK_A
  125. #endif
  126. //
  127. // Operation/queue start/end notification. These are ordinal values.
  128. //
  129. #define SPFILENOTIFY_STARTQUEUE         0x00000001
  130. #define SPFILENOTIFY_ENDQUEUE           0x00000002
  131. #define SPFILENOTIFY_STARTSUBQUEUE      0x00000003
  132. #define SPFILENOTIFY_ENDSUBQUEUE        0x00000004
  133. #define SPFILENOTIFY_STARTDELETE        0x00000005
  134. #define SPFILENOTIFY_ENDDELETE          0x00000006
  135. #define SPFILENOTIFY_DELETEERROR        0x00000007
  136. #define SPFILENOTIFY_STARTRENAME        0x00000008
  137. #define SPFILENOTIFY_ENDRENAME          0x00000009
  138. #define SPFILENOTIFY_RENAMEERROR        0x0000000a
  139. #define SPFILENOTIFY_STARTCOPY          0x0000000b
  140. #define SPFILENOTIFY_ENDCOPY            0x0000000c
  141. #define SPFILENOTIFY_COPYERROR          0x0000000d
  142. #define SPFILENOTIFY_NEEDMEDIA          0x0000000e
  143. #define SPFILENOTIFY_QUEUESCAN          0x0000000f
  144. //
  145. // These are used with SetupIterateCabinet().
  146. //
  147. #define SPFILENOTIFY_CABINETINFO        0x00000010
  148. #define SPFILENOTIFY_FILEINCABINET      0x00000011
  149. #define SPFILENOTIFY_NEEDNEWCABINET     0x00000012
  150. #define SPFILENOTIFY_FILEEXTRACTED      0x00000013
  151. #define SPFILENOTIFY_FILEOPDELAYED      0x00000014
  152. //
  153. // Copy notification. These are bit flags that may be combined.
  154. //
  155. #define SPFILENOTIFY_LANGMISMATCH       0x00010000
  156. #define SPFILENOTIFY_TARGETEXISTS       0x00020000
  157. #define SPFILENOTIFY_TARGETNEWER        0x00040000
  158. //
  159. // File operation codes and callback outcomes.
  160. //
  161. #define FILEOP_COPY                     0
  162. #define FILEOP_RENAME                   1
  163. #define FILEOP_DELETE                   2
  164. #define FILEOP_ABORT                    0
  165. #define FILEOP_DOIT                     1
  166. #define FILEOP_SKIP                     2
  167. #define FILEOP_RETRY                    FILEOP_DOIT
  168. #define FILEOP_NEWPATH                  4
  169. //
  170. // Flags in inf copy sections
  171. //
  172. #define COPYFLG_WARN_IF_SKIP            0x00000001      // warn if user tries to skip file
  173. #define COPYFLG_NOSKIP                  0x00000002      // disallow skipping this file
  174. #define COPYFLG_NOVERSIONCHECK          0x00000004      // ignore versions and overwrite target
  175. #define COPYFLG_FORCE_FILE_IN_USE       0x00000008      // force file-in-use behavior
  176. #define COPYFLG_NO_OVERWRITE            0x00000010      // do not copy if file exists on target
  177. #define COPYFLG_NO_VERSION_DIALOG       0x00000020      // do not copy if target is newer
  178. #define COPYFLG_OVERWRITE_OLDER_ONLY    0x00000040      // leave target alone if version same as source
  179. #define COPYFLG_REPLACEONLY             0x00000400      // copy only if file exists on target
  180. //
  181. // Flags in inf delete sections
  182. // New flags go in high word
  183. //
  184. #define DELFLG_IN_USE                   0x00000001      // queue in-use file for delete
  185. #define DELFLG_IN_USE1                  0x00010000      // high-word version of DELFLG_IN_USE
  186. //
  187. // Source and file paths. Used when notifying queue callback
  188. // of SPFILENOTIFY_STARTxxx, SPFILENOTIFY_ENDxxx, and SPFILENOTIFY_xxxERROR.
  189. //
  190. typedef struct _FILEPATHS_A {
  191.     PCSTR  Target;
  192.     PCSTR  Source;  // not used for delete operations
  193.     UINT   Win32Error;
  194.     DWORD  Flags;   // such as SP_COPY_NOSKIP for copy errors
  195. } FILEPATHS_A, *PFILEPATHS_A;
  196. typedef struct _FILEPATHS_W {
  197.     PCWSTR Target;
  198.     PCWSTR Source;  // not used for delete operations
  199.     UINT   Win32Error;
  200.     DWORD  Flags;   // such as SP_COPY_NOSKIP for copy errors
  201. } FILEPATHS_W, *PFILEPATHS_W;
  202. #ifdef UNICODE
  203. typedef FILEPATHS_W FILEPATHS;
  204. typedef PFILEPATHS_W PFILEPATHS;
  205. #else
  206. typedef FILEPATHS_A FILEPATHS;
  207. typedef PFILEPATHS_A PFILEPATHS;
  208. #endif
  209. //
  210. // Structure used with SPFILENOTIFY_NEEDMEDIA
  211. //
  212. typedef struct _SOURCE_MEDIA_A {
  213.     PCSTR Reserved;
  214.     PCSTR Tagfile;          // may be NULL
  215.     PCSTR Description;
  216.     //
  217.     // Pathname part and filename part of source file
  218.     // that caused us to need the media.
  219.     //
  220.     PCSTR SourcePath;
  221.     PCSTR SourceFile;
  222.     DWORD Flags;            // subset of SP_COPY_xxx
  223. } SOURCE_MEDIA_A, *PSOURCE_MEDIA_A;
  224. typedef struct _SOURCE_MEDIA_W {
  225.     PCWSTR Reserved;
  226.     PCWSTR Tagfile;         // may be NULL
  227.     PCWSTR Description;
  228.     //
  229.     // Pathname part and filename part of source file
  230.     // that caused us to need the media.
  231.     //
  232.     PCWSTR SourcePath;
  233.     PCWSTR SourceFile;
  234.     DWORD  Flags;           // subset of SP_COPY_xxx
  235. } SOURCE_MEDIA_W, *PSOURCE_MEDIA_W;
  236. #ifdef UNICODE
  237. typedef SOURCE_MEDIA_W SOURCE_MEDIA;
  238. typedef PSOURCE_MEDIA_W PSOURCE_MEDIA;
  239. #else
  240. typedef SOURCE_MEDIA_A SOURCE_MEDIA;
  241. typedef PSOURCE_MEDIA_A PSOURCE_MEDIA;
  242. #endif
  243. //
  244. // Structure used with SPFILENOTIFY_CABINETINFO and
  245. // SPFILENOTIFY_NEEDNEWCABINET
  246. //
  247. typedef struct _CABINET_INFO_A {
  248.     PCSTR CabinetPath;
  249.     PCSTR CabinetFile;
  250.     PCSTR DiskName;
  251.     USHORT SetId;
  252.     USHORT CabinetNumber;
  253. } CABINET_INFO_A, *PCABINET_INFO_A;
  254. typedef struct _CABINET_INFO_W {
  255.     PCWSTR CabinetPath;
  256.     PCWSTR CabinetFile;
  257.     PCWSTR DiskName;
  258.     USHORT SetId;
  259.     USHORT CabinetNumber;
  260. } CABINET_INFO_W, *PCABINET_INFO_W;
  261. #ifdef UNICODE
  262. typedef CABINET_INFO_W CABINET_INFO;
  263. typedef PCABINET_INFO_W PCABINET_INFO;
  264. #else
  265. typedef CABINET_INFO_A CABINET_INFO;
  266. typedef PCABINET_INFO_A PCABINET_INFO;
  267. #endif
  268. //
  269. // Structure used with SPFILENOTIFY_FILEINCABINET
  270. //
  271. typedef struct _FILE_IN_CABINET_INFO_A {
  272.     PCSTR NameInCabinet;
  273.     DWORD FileSize;
  274.     DWORD Win32Error;
  275.     WORD  DosDate;
  276.     WORD  DosTime;
  277.     WORD  DosAttribs;
  278.     CHAR  FullTargetName[MAX_PATH];
  279. } FILE_IN_CABINET_INFO_A, *PFILE_IN_CABINET_INFO_A;
  280. typedef struct _FILE_IN_CABINET_INFO_W {
  281.     PCWSTR NameInCabinet;
  282.     DWORD  FileSize;
  283.     DWORD  Win32Error;
  284.     WORD   DosDate;
  285.     WORD   DosTime;
  286.     WORD   DosAttribs;
  287.     WCHAR  FullTargetName[MAX_PATH];
  288. } FILE_IN_CABINET_INFO_W, *PFILE_IN_CABINET_INFO_W;
  289. #ifdef UNICODE
  290. typedef FILE_IN_CABINET_INFO_W FILE_IN_CABINET_INFO;
  291. typedef PFILE_IN_CABINET_INFO_W PFILE_IN_CABINET_INFO;
  292. #else
  293. typedef FILE_IN_CABINET_INFO_A FILE_IN_CABINET_INFO;
  294. typedef PFILE_IN_CABINET_INFO_A PFILE_IN_CABINET_INFO;
  295. #endif
  296. //
  297. // Define type for setup file queue
  298. //
  299. typedef PVOID HSPFILEQ;
  300. //
  301. // Define type for setup disk space list
  302. //
  303. typedef PVOID HDSKSPC;
  304. //
  305. // Define type for reference to device information set
  306. //
  307. typedef PVOID HDEVINFO;
  308. //
  309. // Device information structure (references a device instance
  310. // that is a member of a device information set)
  311. //
  312. typedef struct _SP_DEVINFO_DATA {
  313.     DWORD cbSize;
  314.     GUID  ClassGuid;
  315.     DWORD DevInst;    // DEVINST handle
  316.     DWORD Reserved;
  317. } SP_DEVINFO_DATA, *PSP_DEVINFO_DATA;
  318. //
  319. // Device interface information structure (references a device
  320. // interface that is associated with the device information
  321. // element that owns it).
  322. //
  323. typedef struct _SP_DEVICE_INTERFACE_DATA {
  324.     DWORD cbSize;
  325.     GUID  InterfaceClassGuid;
  326.     DWORD Flags;
  327.     DWORD Reserved;
  328. } SP_DEVICE_INTERFACE_DATA, *PSP_DEVICE_INTERFACE_DATA;
  329. //
  330. // Flags for SP_DEVICE_INTERFACE_DATA.Flags field.
  331. //
  332. #define SPINT_ACTIVE  0x00000001
  333. #define SPINT_DEFAULT 0x00000002
  334. #define SPINT_REMOVED 0x00000004
  335. //
  336. // Backward compatibility--do not use.
  337. //
  338. typedef SP_DEVICE_INTERFACE_DATA  SP_INTERFACE_DEVICE_DATA;
  339. typedef PSP_DEVICE_INTERFACE_DATA PSP_INTERFACE_DEVICE_DATA;
  340. #define SPID_ACTIVE               SPINT_ACTIVE
  341. #define SPID_DEFAULT              SPINT_DEFAULT
  342. #define SPID_REMOVED              SPINT_REMOVED
  343. typedef struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A {
  344.     DWORD  cbSize;
  345.     CHAR   DevicePath[ANYSIZE_ARRAY];
  346. } SP_DEVICE_INTERFACE_DETAIL_DATA_A, *PSP_DEVICE_INTERFACE_DETAIL_DATA_A;
  347. typedef struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W {
  348.     DWORD  cbSize;
  349.     WCHAR  DevicePath[ANYSIZE_ARRAY];
  350. } SP_DEVICE_INTERFACE_DETAIL_DATA_W, *PSP_DEVICE_INTERFACE_DETAIL_DATA_W;
  351. #ifdef UNICODE
  352. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA;
  353. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_W PSP_DEVICE_INTERFACE_DETAIL_DATA;
  354. #else
  355. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_DEVICE_INTERFACE_DETAIL_DATA;
  356. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_A PSP_DEVICE_INTERFACE_DETAIL_DATA;
  357. #endif
  358. //
  359. // Backward compatibility--do not use.
  360. //
  361. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_INTERFACE_DEVICE_DETAIL_DATA_W;
  362. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_W PSP_INTERFACE_DEVICE_DETAIL_DATA_W;
  363. typedef SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_INTERFACE_DEVICE_DETAIL_DATA_A;
  364. typedef PSP_DEVICE_INTERFACE_DETAIL_DATA_A PSP_INTERFACE_DEVICE_DETAIL_DATA_A;
  365. #ifdef UNICODE
  366. typedef SP_INTERFACE_DEVICE_DETAIL_DATA_W SP_INTERFACE_DEVICE_DETAIL_DATA;
  367. typedef PSP_INTERFACE_DEVICE_DETAIL_DATA_W PSP_INTERFACE_DEVICE_DETAIL_DATA;
  368. #else
  369. typedef SP_INTERFACE_DEVICE_DETAIL_DATA_A SP_INTERFACE_DEVICE_DETAIL_DATA;
  370. typedef PSP_INTERFACE_DEVICE_DETAIL_DATA_A PSP_INTERFACE_DEVICE_DETAIL_DATA;
  371. #endif
  372. //
  373. // Structure for detailed information on a device information set (used for
  374. // SetupDiGetDeviceInfoListDetail which supercedes the functionality of
  375. // SetupDiGetDeviceInfoListClass).
  376. //
  377. typedef struct _SP_DEVINFO_LIST_DETAIL_DATA_A {
  378.     DWORD  cbSize;
  379.     GUID   ClassGuid;
  380.     HANDLE RemoteMachineHandle;
  381.     CHAR   RemoteMachineName[SP_MAX_MACHINENAME_LENGTH];
  382. } SP_DEVINFO_LIST_DETAIL_DATA_A, *PSP_DEVINFO_LIST_DETAIL_DATA_A;
  383. typedef struct _SP_DEVINFO_LIST_DETAIL_DATA_W {
  384.     DWORD  cbSize;
  385.     GUID   ClassGuid;
  386.     HANDLE RemoteMachineHandle;
  387.     WCHAR  RemoteMachineName[SP_MAX_MACHINENAME_LENGTH];
  388. } SP_DEVINFO_LIST_DETAIL_DATA_W, *PSP_DEVINFO_LIST_DETAIL_DATA_W;
  389. #ifdef UNICODE
  390. typedef SP_DEVINFO_LIST_DETAIL_DATA_W SP_DEVINFO_LIST_DETAIL_DATA;
  391. typedef PSP_DEVINFO_LIST_DETAIL_DATA_W PSP_DEVINFO_LIST_DETAIL_DATA;
  392. #else
  393. typedef SP_DEVINFO_LIST_DETAIL_DATA_A SP_DEVINFO_LIST_DETAIL_DATA;
  394. typedef PSP_DEVINFO_LIST_DETAIL_DATA_A PSP_DEVINFO_LIST_DETAIL_DATA;
  395. #endif
  396. //
  397. // Class installer function codes
  398. //
  399. #define DIF_SELECTDEVICE            0x00000001
  400. #define DIF_INSTALLDEVICE           0x00000002
  401. #define DIF_ASSIGNRESOURCES         0x00000003
  402. #define DIF_PROPERTIES              0x00000004
  403. #define DIF_REMOVE                  0x00000005
  404. #define DIF_FIRSTTIMESETUP          0x00000006
  405. #define DIF_FOUNDDEVICE             0x00000007
  406. #define DIF_SELECTCLASSDRIVERS      0x00000008
  407. #define DIF_VALIDATECLASSDRIVERS    0x00000009
  408. #define DIF_INSTALLCLASSDRIVERS     0x0000000A
  409. #define DIF_CALCDISKSPACE           0x0000000B
  410. #define DIF_DESTROYPRIVATEDATA      0x0000000C
  411. #define DIF_VALIDATEDRIVER          0x0000000D
  412. #define DIF_MOVEDEVICE              0x0000000E
  413. #define DIF_DETECT                  0x0000000F
  414. #define DIF_INSTALLWIZARD           0x00000010
  415. #define DIF_DESTROYWIZARDDATA       0x00000011
  416. #define DIF_PROPERTYCHANGE          0x00000012
  417. #define DIF_ENABLECLASS             0x00000013
  418. #define DIF_DETECTVERIFY            0x00000014
  419. #define DIF_INSTALLDEVICEFILES      0x00000015
  420. #define DIF_UNREMOVE                0x00000016
  421. #define DIF_SELECTBESTCOMPATDRV     0x00000017
  422. #define DIF_ALLOW_INSTALL           0x00000018
  423. #define DIF_REGISTERDEVICE          0x00000019
  424. #define DIF_INSTALLINTERFACES       0x00000020
  425. #define DIF_DETECTCANCEL            0x00000021
  426. #define DIF_REGISTER_COINSTALLERS   0x00000022
  427. typedef UINT        DI_FUNCTION;    // Function type for device installer
  428. //
  429. // Device installation parameters structure (associated with a
  430. // particular device information element, or globally with a device
  431. // information set)
  432. //
  433. typedef struct _SP_DEVINSTALL_PARAMS_A {
  434.     DWORD             cbSize;
  435.     DWORD             Flags;
  436.     DWORD             FlagsEx;
  437.     HWND              hwndParent;
  438.     PSP_FILE_CALLBACK InstallMsgHandler;
  439.     PVOID             InstallMsgHandlerContext;
  440.     HSPFILEQ          FileQueue;
  441.     DWORD             ClassInstallReserved;
  442.     DWORD             Reserved;
  443.     CHAR              DriverPath[MAX_PATH];
  444. } SP_DEVINSTALL_PARAMS_A, *PSP_DEVINSTALL_PARAMS_A;
  445. typedef struct _SP_DEVINSTALL_PARAMS_W {
  446.     DWORD             cbSize;
  447.     DWORD             Flags;
  448.     DWORD             FlagsEx;
  449.     HWND              hwndParent;
  450.     PSP_FILE_CALLBACK InstallMsgHandler;
  451.     PVOID             InstallMsgHandlerContext;
  452.     HSPFILEQ          FileQueue;
  453.     DWORD             ClassInstallReserved;
  454.     DWORD             Reserved;
  455.     WCHAR             DriverPath[MAX_PATH];
  456. } SP_DEVINSTALL_PARAMS_W, *PSP_DEVINSTALL_PARAMS_W;
  457. #ifdef UNICODE
  458. typedef SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS;
  459. typedef PSP_DEVINSTALL_PARAMS_W PSP_DEVINSTALL_PARAMS;
  460. #else
  461. typedef SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS;
  462. typedef PSP_DEVINSTALL_PARAMS_A PSP_DEVINSTALL_PARAMS;
  463. #endif
  464. //
  465. // SP_DEVINSTALL_PARAMS.Flags values
  466. //
  467. // Flags for choosing a device
  468. //
  469. #define DI_SHOWOEM                  0x00000001L     // support Other... button
  470. #define DI_SHOWCOMPAT               0x00000002L     // show compatibility list
  471. #define DI_SHOWCLASS                0x00000004L     // show class list
  472. #define DI_SHOWALL                  0x00000007L     // both class & compat list shown
  473. #define DI_NOVCP                    0x00000008L     // don't create a new copy queue--use
  474.                                                     // caller-supplied FileQueue
  475. #define DI_DIDCOMPAT                0x00000010L     // Searched for compatible devices
  476. #define DI_DIDCLASS                 0x00000020L     // Searched for class devices
  477. #define DI_AUTOASSIGNRES            0x00000040L     // No UI for resources if possible
  478. // flags returned by DiInstallDevice to indicate need to reboot/restart
  479. #define DI_NEEDRESTART              0x00000080L     // Reboot required to take effect
  480. #define DI_NEEDREBOOT               0x00000100L     // ""
  481. // flags for device installation
  482. #define DI_NOBROWSE                 0x00000200L     // no Browse... in InsertDisk
  483. // Flags set by DiBuildDriverInfoList
  484. #define DI_MULTMFGS                 0x00000400L     // Set if multiple manufacturers in
  485.                                                     // class driver list
  486. // Flag indicates that device is disabled
  487. #define DI_DISABLED                 0x00000800L     // Set if device disabled
  488. // Flags for Device/Class Properties
  489. #define DI_GENERALPAGE_ADDED        0x00001000L
  490. #define DI_RESOURCEPAGE_ADDED       0x00002000L
  491. // Flag to indicate the setting properties for this Device (or class) caused a change
  492. // so the Dev Mgr UI probably needs to be updatd.
  493. #define DI_PROPERTIES_CHANGE        0x00004000L
  494. // Flag to indicate that the sorting from the INF file should be used.
  495. #define DI_INF_IS_SORTED            0x00008000L
  496. // Flag to indicate that only the the INF specified by SP_DEVINSTALL_PARAMS.DriverPath
  497. // should be searched.
  498. #define DI_ENUMSINGLEINF            0x00010000L
  499. // Flag that prevents ConfigMgr from removing/re-enumerating devices during device
  500. // registration, installation, and deletion.
  501. #define DI_DONOTCALLCONFIGMG        0x00020000L
  502. // The following flag can be used to install a device disabled
  503. #define DI_INSTALLDISABLED          0x00040000L
  504. // Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver
  505. // list from its existing class driver list, instead of the normal INF search.
  506. #define DI_COMPAT_FROM_CLASS        0x00080000L
  507. // This flag is set if the Class Install params should be used.
  508. #define DI_CLASSINSTALLPARAMS       0x00100000L
  509. // This flag is set if the caller of DiCallClassInstaller does NOT
  510. // want the internal default action performed if the Class installer
  511. // returns ERROR_DI_DO_DEFAULT.
  512. #define DI_NODI_DEFAULTACTION       0x00200000L
  513. // The setupx flag, DI_NOSYNCPROCESSING (0x00400000L) is not support in the Setup APIs.
  514. // flags for device installation
  515. #define DI_QUIETINSTALL             0x00800000L     // don't confuse the user with
  516.                                                     // questions or excess info
  517. #define DI_NOFILECOPY               0x01000000L     // No file Copy necessary
  518. #define DI_FORCECOPY                0x02000000L     // Force files to be copied from install path
  519. #define DI_DRIVERPAGE_ADDED         0x04000000L     // Prop provider added Driver page.
  520. #define DI_USECI_SELECTSTRINGS      0x08000000L     // Use Class Installer Provided strings in the Select Device Dlg
  521. #define DI_OVERRIDE_INFFLAGS        0x10000000L     // Override INF flags
  522. #define DI_PROPS_NOCHANGEUSAGE      0x20000000L     // No Enable/Disable in General Props
  523. #define DI_NOSELECTICONS            0x40000000L     // No small icons in select device dialogs
  524. #define DI_NOWRITE_IDS              0x80000000L     // Don't write HW & Compat IDs on install
  525. //
  526. // SP_DEVINSTALL_PARAMS.FlagsEx values
  527. //
  528. #define DI_FLAGSEX_USEOLDINFSEARCH      0x00000001L  // Inf Search functions should not use Index Search
  529. #define DI_FLAGSEX_AUTOSELECTRANK0      0x00000002L  // SetupDiSelectDevice doesn't prompt user if rank 0 match
  530. #define DI_FLAGSEX_CI_FAILED            0x00000004L  // Failed to Load/Call class installer
  531. #define DI_FLAGSEX_DIDINFOLIST          0x00000010L  // Did the Class Info List
  532. #define DI_FLAGSEX_DIDCOMPATINFO        0x00000020L  // Did the Compat Info List
  533. #define DI_FLAGSEX_FILTERCLASSES        0x00000040L
  534. #define DI_FLAGSEX_SETFAILEDINSTALL     0x00000080L
  535. #define DI_FLAGSEX_DEVICECHANGE         0x00000100L
  536. #define DI_FLAGSEX_ALWAYSWRITEIDS       0x00000200L
  537. #define DI_FLAGSEX_ALLOWEXCLUDEDDRVS    0x00000800L
  538. #define DI_FLAGSEX_NOUIONQUERYREMOVE    0x00001000L
  539. #define DI_FLAGSEX_USECLASSFORCOMPAT    0x00002000L  // Use the device's class when building compat drv list.
  540.                                                      // (Ignored if DI_COMPAT_FROM_CLASS flag is specified.)
  541. #define DI_FLAGSEX_OLDINF_IN_CLASSLIST  0x00004000L  // Search legacy INFs when building class driver list.
  542. #define DI_FLAGSEX_NO_DRVREG_MODIFY     0x00008000L  // Don't run AddReg and DelReg for device's software (driver) key.
  543. #define DI_FLAGSEX_OSUPGRADE            0x00010000L  // Installation is occurring in an upgrade during GUI-mode setup.
  544. //
  545. // Class installation parameters header.  This must be the first field of any class install
  546. // parameter structure.  The InstallFunction field must be set to the function code
  547. // corresponding to the structure, and the cbSize field must be set to the size of the
  548. // header structure.  E.g.,
  549. //
  550. // SP_ENABLECLASS_PARAMS EnableClassParams;
  551. //
  552. // EnableClassParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
  553. // EnableClassParams.ClassInstallHeader.InstallFunction = DIF_ENABLECLASS;
  554. //
  555. typedef struct _SP_CLASSINSTALL_HEADER {
  556.     DWORD       cbSize;
  557.     DI_FUNCTION InstallFunction;
  558. } SP_CLASSINSTALL_HEADER, *PSP_CLASSINSTALL_HEADER;
  559. //
  560. // Structure corresponding to a DIF_ENABLECLASS install function.
  561. //
  562. typedef struct _SP_ENABLECLASS_PARAMS {
  563.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  564.     GUID                   ClassGuid;
  565.     DWORD                  EnableMessage;
  566. } SP_ENABLECLASS_PARAMS, *PSP_ENABLECLASS_PARAMS;
  567. #define ENABLECLASS_QUERY   0
  568. #define ENABLECLASS_SUCCESS 1
  569. #define ENABLECLASS_FAILURE 2
  570. //
  571. // Structure corresponding to a DIF_MOVEDEVICE install function.
  572. //
  573. typedef struct _SP_MOVEDEV_PARAMS {
  574.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  575.     SP_DEVINFO_DATA        SourceDeviceInfoData;
  576. } SP_MOVEDEV_PARAMS, *PSP_MOVEDEV_PARAMS;
  577. //
  578. // Values indicating a change in a device's state
  579. //
  580. #define DICS_ENABLE      0x00000001
  581. #define DICS_DISABLE     0x00000002
  582. #define DICS_PROPCHANGE  0x00000003
  583. #define DICS_START       0x00000004
  584. #define DICS_STOP        0x00000005
  585. //
  586. // Values specifying the scope of a device property change
  587. //
  588. #define DICS_FLAG_GLOBAL         0x00000001  // make change in all hardware profiles
  589. #define DICS_FLAG_CONFIGSPECIFIC 0x00000002  // make change in specified profile only
  590. #define DICS_FLAG_CONFIGGENERAL  0x00000004  // 1 or more hardware profile-specific
  591.                                              // changes to follow.
  592. //
  593. // Structure corresponding to a DIF_PROPERTYCHANGE install function.
  594. //
  595. typedef struct _SP_PROPCHANGE_PARAMS {
  596.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  597.     DWORD                  StateChange;
  598.     DWORD                  Scope;
  599.     DWORD                  HwProfile;
  600. } SP_PROPCHANGE_PARAMS, *PSP_PROPCHANGE_PARAMS;
  601. //
  602. // Structure corresponding to a DIF_REMOVE install function.
  603. //
  604. typedef struct _SP_REMOVEDEVICE_PARAMS {
  605.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  606.     DWORD Scope;
  607.     DWORD HwProfile;
  608. } SP_REMOVEDEVICE_PARAMS, *PSP_REMOVEDEVICE_PARAMS;
  609. #define DI_REMOVEDEVICE_GLOBAL                  0x00000001
  610. #define DI_REMOVEDEVICE_CONFIGSPECIFIC          0x00000002
  611. //
  612. // Structure corresponding to a DIF_UNREMOVE install function.
  613. //
  614. typedef struct _SP_UNREMOVEDEVICE_PARAMS {
  615.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  616.     DWORD Scope;
  617.     DWORD HwProfile;
  618. } SP_UNREMOVEDEVICE_PARAMS, *PSP_UNREMOVEDEVICE_PARAMS;
  619. #define DI_UNREMOVEDEVICE_CONFIGSPECIFIC        0x00000002
  620. //
  621. // Structure corresponding to a DIF_SELECTDEVICE install function.
  622. //
  623. typedef struct _SP_SELECTDEVICE_PARAMS_A {
  624.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  625.     CHAR                   Title[MAX_TITLE_LEN];
  626.     CHAR                   Instructions[MAX_INSTRUCTION_LEN];
  627.     CHAR                   ListLabel[MAX_LABEL_LEN];
  628.     BYTE                   Reserved[2];                  // DWORD size alignment
  629. } SP_SELECTDEVICE_PARAMS_A, *PSP_SELECTDEVICE_PARAMS_A;
  630. typedef struct _SP_SELECTDEVICE_PARAMS_W {
  631.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  632.     WCHAR                  Title[MAX_TITLE_LEN];
  633.     WCHAR                  Instructions[MAX_INSTRUCTION_LEN];
  634.     WCHAR                  ListLabel[MAX_LABEL_LEN];
  635. } SP_SELECTDEVICE_PARAMS_W, *PSP_SELECTDEVICE_PARAMS_W;
  636. #ifdef UNICODE
  637. typedef SP_SELECTDEVICE_PARAMS_W SP_SELECTDEVICE_PARAMS;
  638. typedef PSP_SELECTDEVICE_PARAMS_W PSP_SELECTDEVICE_PARAMS;
  639. #else
  640. typedef SP_SELECTDEVICE_PARAMS_A SP_SELECTDEVICE_PARAMS;
  641. typedef PSP_SELECTDEVICE_PARAMS_A PSP_SELECTDEVICE_PARAMS;
  642. #endif
  643. //
  644. // Structure corresponding to a DIF_DETECT install function.
  645. //
  646. typedef BOOL (CALLBACK* PDETECT_PROGRESS_NOTIFY)(
  647.      IN PVOID ProgressNotifyParam,
  648.      IN DWORD DetectComplete
  649.      );
  650. // where:
  651. //     ProgressNotifyParam - value supplied by caller requesting detection.
  652. //     DetectComplete - Percent completion, to be incremented by class
  653. //                      installer, as it steps thru its detection.
  654. //
  655. // Return Value - If TRUE, then detection is cancelled.  Allows caller
  656. //                requesting detection to stop detection asap.
  657. //
  658. typedef struct _SP_DETECTDEVICE_PARAMS {
  659.     SP_CLASSINSTALL_HEADER  ClassInstallHeader;
  660.     PDETECT_PROGRESS_NOTIFY DetectProgressNotify;
  661.     PVOID                   ProgressNotifyParam;
  662. } SP_DETECTDEVICE_PARAMS, *PSP_DETECTDEVICE_PARAMS;
  663. //
  664. // 'Add New Device' installation wizard structure
  665. //
  666. // Structure corresponding to a DIF_INSTALLWIZARD install function.
  667. // (NOTE: This structure is also applicable for DIF_DESTROYWIZARDDATA,
  668. // but DIF_INSTALLWIZARD is the associated function code in the class
  669. // installation parameter structure in both cases.)
  670. //
  671. // Define maximum number of dynamic wizard pages that can be added to
  672. // hardware install wizard.
  673. //
  674. #define MAX_INSTALLWIZARD_DYNAPAGES             20
  675. typedef struct _SP_INSTALLWIZARD_DATA {
  676.     SP_CLASSINSTALL_HEADER ClassInstallHeader;
  677.     DWORD                  Flags;
  678.     HPROPSHEETPAGE         DynamicPages[MAX_INSTALLWIZARD_DYNAPAGES];
  679.     DWORD                  NumDynamicPages;
  680.     DWORD                  DynamicPageFlags;
  681.     DWORD                  PrivateFlags;
  682.     LPARAM                 PrivateData;
  683.     HWND                   hwndWizardDlg;
  684. } SP_INSTALLWIZARD_DATA, *PSP_INSTALLWIZARD_DATA;
  685. //
  686. // SP_INSTALLWIZARD_DATA.Flags values
  687. //
  688. #define NDW_INSTALLFLAG_DIDFACTDEFS         0x00000001
  689. #define NDW_INSTALLFLAG_HARDWAREALLREADYIN  0x00000002
  690. #define NDW_INSTALLFLAG_NEEDRESTART         DI_NEEDRESTART
  691. #define NDW_INSTALLFLAG_NEEDREBOOT          DI_NEEDREBOOT
  692. #define NDW_INSTALLFLAG_NEEDSHUTDOWN        0x00000200
  693. #define NDW_INSTALLFLAG_EXPRESSINTRO        0x00000400
  694. #define NDW_INSTALLFLAG_SKIPISDEVINSTALLED  0x00000800
  695. #define NDW_INSTALLFLAG_NODETECTEDDEVS      0x00001000
  696. #define NDW_INSTALLFLAG_INSTALLSPECIFIC     0x00002000
  697. #define NDW_INSTALLFLAG_SKIPCLASSLIST       0x00004000
  698. #define NDW_INSTALLFLAG_CI_PICKED_OEM       0x00008000
  699. #define NDW_INSTALLFLAG_PCMCIAMODE          0x00010000
  700. #define NDW_INSTALLFLAG_PCMCIADEVICE        0x00020000
  701. #define NDW_INSTALLFLAG_USERCANCEL          0x00040000
  702. #define NDW_INSTALLFLAG_KNOWNCLASS          0x00080000
  703. //
  704. // SP_INSTALLWIZARD_DATA.DynamicPageFlags values
  705. //
  706. // This flag is set if a Class installer has added pages to the
  707. // install wizard.
  708. //
  709. #define DYNAWIZ_FLAG_PAGESADDED             0x00000001
  710. //
  711. // The following flags will control the button states when displaying
  712. // the InstallDetectedDevs dialog.
  713. //
  714. #define DYNAWIZ_FLAG_INSTALLDET_NEXT        0x00000002
  715. #define DYNAWIZ_FLAG_INSTALLDET_PREV        0x00000004
  716. // Set this flag if you jump to the analyze page, and want it to
  717. // handle conflicts for you.  NOTE.  You will not get control back
  718. // in the event of a conflict if you set this flag.
  719. //
  720. // BUGBUG (lonnym): Not currently implemented!
  721. //
  722. #define DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT 0x00000008
  723. //
  724. // Define wizard page resource IDs to be used when adding custom pages
  725. // to the hardware install wizard.
  726. //
  727. // Resource ID for the first page that the install wizard will go to after
  728. // adding the class installer pages.
  729. //
  730. #define IDD_DYNAWIZ_FIRSTPAGE                   10000
  731. //
  732. // Resource ID for the page that the Select Device page will go back to.
  733. //
  734. #define IDD_DYNAWIZ_SELECT_PREVPAGE             10001
  735. //
  736. // Resource ID for the page that the Select Device page will go forward to.
  737. //
  738. #define IDD_DYNAWIZ_SELECT_NEXTPAGE             10002
  739. //
  740. // Resource ID for the page that the Analyze dialog should go back to
  741. // This will only be used in the event that there is a problem, and the user
  742. // selects Back from the analyze proc.
  743. //
  744. #define IDD_DYNAWIZ_ANALYZE_PREVPAGE            10003
  745. //
  746. // Resource ID for the page that the Analyze dialog should go to if it
  747. // continue from the analyze proc.  the wAnalyzeResult in the INSTALLDATA
  748. // struct will contain the anaysis results.
  749. //
  750. #define IDD_DYNAWIZ_ANALYZE_NEXTPAGE            10004
  751. //
  752. // Resource ID for that page that the Install detected devices page will go
  753. // back to.
  754. //
  755. #define IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE    10006
  756. //
  757. // Resource ID for the page that the Install detected devices page will go
  758. // forward to.
  759. //
  760. #define IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE    10007
  761. //
  762. // Resource ID for the page that the Install detected devices page will go
  763. // to in the event that no devices are detected.
  764. //
  765. #define IDD_DYNAWIZ_INSTALLDETECTED_NODEVS      10008
  766. //
  767. // Resource ID of the hardware install wizard's select device page.
  768. // This ID can be used to go directly to the hardware install wizard's select
  769. // device page.
  770. //
  771. #define IDD_DYNAWIZ_SELECTDEV_PAGE              10009
  772. //
  773. // Resource ID of the hardware install wizard's device analysis page.
  774. // This ID can be use to go directly to the hardware install wizard's analysis
  775. // page.
  776. //
  777. #define IDD_DYNAWIZ_ANALYZEDEV_PAGE             10010
  778. //
  779. // Resource ID of the hardware install wizard's install detected devices page.
  780. // This ID can be use to go directly to the hardware install wizard's install
  781. // detected devices page.
  782. //
  783. #define IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE    10011
  784. //
  785. // Resource ID of the hardware install wizard's select class page.
  786. // This ID can be use to go directly to the hardware install wizard's select
  787. // class page.
  788. //
  789. #define IDD_DYNAWIZ_SELECTCLASS_PAGE            10012
  790. //
  791. // Driver information structure (member of a driver info list that may be associated
  792. // with a particular device instance, or (globally) with a device information set)
  793. //
  794. typedef struct _SP_DRVINFO_DATA_A {
  795.     DWORD cbSize;
  796.     DWORD DriverType;
  797.     DWORD Reserved;
  798.     CHAR  Description[LINE_LEN];
  799.     CHAR  MfgName[LINE_LEN];
  800.     CHAR  ProviderName[LINE_LEN];
  801. } SP_DRVINFO_DATA_A, *PSP_DRVINFO_DATA_A;
  802. typedef struct _SP_DRVINFO_DATA_W {
  803.     DWORD cbSize;
  804.     DWORD DriverType;
  805.     DWORD Reserved;
  806.     WCHAR Description[LINE_LEN];
  807.     WCHAR MfgName[LINE_LEN];
  808.     WCHAR ProviderName[LINE_LEN];
  809. } SP_DRVINFO_DATA_W, *PSP_DRVINFO_DATA_W;
  810. #ifdef UNICODE
  811. typedef SP_DRVINFO_DATA_W SP_DRVINFO_DATA;
  812. typedef PSP_DRVINFO_DATA_W PSP_DRVINFO_DATA;
  813. #else
  814. typedef SP_DRVINFO_DATA_A SP_DRVINFO_DATA;
  815. typedef PSP_DRVINFO_DATA_A PSP_DRVINFO_DATA;
  816. #endif
  817. //
  818. // Driver information details structure (provides detailed information about a
  819. // particular driver information structure)
  820. //
  821. typedef struct _SP_DRVINFO_DETAIL_DATA_A {
  822.     DWORD    cbSize;
  823.     FILETIME InfDate;
  824.     DWORD    CompatIDsOffset;
  825.     DWORD    CompatIDsLength;
  826.     DWORD    Reserved;
  827.     CHAR     SectionName[LINE_LEN];
  828.     CHAR     InfFileName[MAX_PATH];
  829.     CHAR     DrvDescription[LINE_LEN];
  830.     CHAR     HardwareID[ANYSIZE_ARRAY];
  831. } SP_DRVINFO_DETAIL_DATA_A, *PSP_DRVINFO_DETAIL_DATA_A;
  832. typedef struct _SP_DRVINFO_DETAIL_DATA_W {
  833.     DWORD    cbSize;
  834.     FILETIME InfDate;
  835.     DWORD    CompatIDsOffset;
  836.     DWORD    CompatIDsLength;
  837.     DWORD    Reserved;
  838.     WCHAR    SectionName[LINE_LEN];
  839.     WCHAR    InfFileName[MAX_PATH];
  840.     WCHAR    DrvDescription[LINE_LEN];
  841.     WCHAR    HardwareID[ANYSIZE_ARRAY];
  842. } SP_DRVINFO_DETAIL_DATA_W, *PSP_DRVINFO_DETAIL_DATA_W;
  843. #ifdef UNICODE
  844. typedef SP_DRVINFO_DETAIL_DATA_W SP_DRVINFO_DETAIL_DATA;
  845. typedef PSP_DRVINFO_DETAIL_DATA_W PSP_DRVINFO_DETAIL_DATA;
  846. #else
  847. typedef SP_DRVINFO_DETAIL_DATA_A SP_DRVINFO_DETAIL_DATA;
  848. typedef PSP_DRVINFO_DETAIL_DATA_A PSP_DRVINFO_DETAIL_DATA;
  849. #endif
  850. //
  851. // Driver installation parameters (associated with a particular driver
  852. // information element)
  853. //
  854. typedef struct _SP_DRVINSTALL_PARAMS {
  855.     DWORD cbSize;
  856.     DWORD Rank;
  857.     DWORD Flags;
  858.     DWORD PrivateData;
  859.     DWORD Reserved;
  860. } SP_DRVINSTALL_PARAMS, *PSP_DRVINSTALL_PARAMS;
  861. //
  862. // SP_DRVINSTALL_PARAMS.Flags values
  863. //
  864. #define DNF_DUPDESC         0x00000001   // Multiple providers have same desc
  865. #define DNF_OLDDRIVER       0x00000002   // Driver node specifies old/current driver
  866. #define DNF_EXCLUDEFROMLIST 0x00000004   // If set, this driver node will not be
  867.                                          // displayed in any driver select dialogs.
  868. #define DNF_NODRIVER        0x00000008   // if we want to install no driver
  869.                                          // (e.g no mouse drv)
  870. #define DNF_LEGACYINF       0x00000010   // this driver node comes from an old-style INF
  871. //
  872. // Setup callback routine for comparing detection signatures
  873. //
  874. typedef DWORD (CALLBACK* PSP_DETSIG_CMPPROC)(
  875.     IN HDEVINFO         DeviceInfoSet,
  876.     IN PSP_DEVINFO_DATA NewDeviceData,
  877.     IN PSP_DEVINFO_DATA ExistingDeviceData,
  878.     IN PVOID            CompareContext      OPTIONAL
  879.     );
  880. //
  881. // Define context structure handed to co-installers
  882. //
  883. typedef struct _COINSTALLER_CONTEXT_DATA {
  884.     BOOL  PostProcessing;
  885.     DWORD InstallResult;
  886.     PVOID PrivateData;
  887. } COINSTALLER_CONTEXT_DATA, *PCOINSTALLER_CONTEXT_DATA;
  888. //
  889. // Structure containing class image list information.
  890. //
  891. typedef struct _SP_CLASSIMAGELIST_DATA {
  892.     DWORD      cbSize;
  893.     HIMAGELIST ImageList;
  894.     DWORD      Reserved;
  895. } SP_CLASSIMAGELIST_DATA, *PSP_CLASSIMAGELIST_DATA;
  896. //
  897. // Structure to be passed as first parameter (LPVOID lpv) to ExtensionPropSheetPageProc
  898. // entry point in setupapi.dll or to "EnumPropPages32" or "BasicProperties32" entry
  899. // points provided by class/device property page providers.  Used to retrieve a handle
  900. // (or, potentially, multiple handles) to property pages for a specified property page type.
  901. //
  902. typedef struct _SP_PROPSHEETPAGE_REQUEST {
  903.     DWORD            cbSize;
  904.     DWORD            PageRequested;
  905.     HDEVINFO         DeviceInfoSet;
  906.     PSP_DEVINFO_DATA DeviceInfoData;
  907. } SP_PROPSHEETPAGE_REQUEST, *PSP_PROPSHEETPAGE_REQUEST;
  908. //
  909. // Property sheet codes used in SP_PROPSHEETPAGE_REQUEST.PageRequested
  910. //
  911. #define SPPSR_SELECT_DEVICE_RESOURCES      1    // supplied by setupapi.dll
  912. #define SPPSR_ENUM_BASIC_DEVICE_PROPERTIES 2    // supplied by device's BasicProperties32 provider
  913. #define SPPSR_ENUM_ADV_DEVICE_PROPERTIES   3    // supplied by class and/or device's EnumPropPages32 provider
  914. //
  915. // Setupapi-specific error codes
  916. //
  917. // Inf parse outcomes
  918. //
  919. #define ERROR_EXPECTED_SECTION_NAME  (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0)
  920. #define ERROR_BAD_SECTION_NAME_LINE  (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|1)
  921. #define ERROR_SECTION_NAME_TOO_LONG  (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|2)
  922. #define ERROR_GENERAL_SYNTAX         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|3)
  923. //
  924. // Inf runtime errors
  925. //
  926. #define ERROR_WRONG_INF_STYLE        (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x100)
  927. #define ERROR_SECTION_NOT_FOUND      (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x101)
  928. #define ERROR_LINE_NOT_FOUND         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x102)
  929. //
  930. // Device Installer errors
  931. //
  932. #define ERROR_NO_ASSOCIATED_CLASS         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x200)
  933. #define ERROR_CLASS_MISMATCH              (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x201)
  934. #define ERROR_DUPLICATE_FOUND             (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x202)
  935. #define ERROR_NO_DRIVER_SELECTED          (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x203)
  936. #define ERROR_KEY_DOES_NOT_EXIST          (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x204)
  937. #define ERROR_INVALID_DEVINST_NAME        (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x205)
  938. #define ERROR_INVALID_CLASS               (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x206)
  939. #define ERROR_DEVINST_ALREADY_EXISTS      (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x207)
  940. #define ERROR_DEVINFO_NOT_REGISTERED      (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x208)
  941. #define ERROR_INVALID_REG_PROPERTY        (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x209)
  942. #define ERROR_NO_INF                      (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20A)
  943. #define ERROR_NO_SUCH_DEVINST             (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20B)
  944. #define ERROR_CANT_LOAD_CLASS_ICON        (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20C)
  945. #define ERROR_INVALID_CLASS_INSTALLER     (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20D)
  946. #define ERROR_DI_DO_DEFAULT               (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20E)
  947. #define ERROR_DI_NOFILECOPY               (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x20F)
  948. #define ERROR_INVALID_HWPROFILE           (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x210)
  949. #define ERROR_NO_DEVICE_SELECTED          (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x211)
  950. #define ERROR_DEVINFO_LIST_LOCKED         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x212)
  951. #define ERROR_DEVINFO_DATA_LOCKED         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x213)
  952. #define ERROR_DI_BAD_PATH                 (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x214)
  953. #define ERROR_NO_CLASSINSTALL_PARAMS      (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x215)
  954. #define ERROR_FILEQUEUE_LOCKED            (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x216)
  955. #define ERROR_BAD_SERVICE_INSTALLSECT     (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x217)
  956. #define ERROR_NO_CLASS_DRIVER_LIST        (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x218)
  957. #define ERROR_NO_ASSOCIATED_SERVICE       (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x219)
  958. #define ERROR_NO_DEFAULT_DEVICE_INTERFACE (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21A)
  959. #define ERROR_DEVICE_INTERFACE_ACTIVE     (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21B)
  960. #define ERROR_DEVICE_INTERFACE_REMOVED    (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21C)
  961. #define ERROR_BAD_INTERFACE_INSTALLSECT   (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21D)
  962. #define ERROR_NO_SUCH_INTERFACE_CLASS     (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21E)
  963. #define ERROR_INVALID_REFERENCE_STRING    (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x21F)
  964. #define ERROR_INVALID_MACHINENAME         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x220)
  965. #define ERROR_REMOTE_COMM_FAILURE         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x221)
  966. #define ERROR_MACHINE_UNAVAILABLE         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x222)
  967. #define ERROR_NO_CONFIGMGR_SERVICES       (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x223)
  968. #define ERROR_INVALID_PROPPAGE_PROVIDER   (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x224)
  969. #define ERROR_NO_SUCH_DEVICE_INTERFACE    (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x225)
  970. #define ERROR_DI_POSTPROCESSING_REQUIRED  (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x226)
  971. #define ERROR_INVALID_COINSTALLER         (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x227)
  972. #define ERROR_NO_COMPAT_DRIVERS           (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x228)
  973. #define ERROR_NO_DEVICE_ICON              (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x229)
  974. #define ERROR_INVALID_INF_LOGCONFIG       (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22A)
  975. #define ERROR_DI_DONT_INSTALL             (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22B)
  976. #define ERROR_INVALID_FILTER_DRIVER       (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x22C)
  977. //
  978. // Backward compatibility--do not use.
  979. //
  980. #define ERROR_NO_DEFAULT_INTERFACE_DEVICE ERROR_NO_DEFAULT_DEVICE_INTERFACE
  981. #define ERROR_INTERFACE_DEVICE_ACTIVE     ERROR_DEVICE_INTERFACE_ACTIVE
  982. #define ERROR_INTERFACE_DEVICE_REMOVED    ERROR_DEVICE_INTERFACE_REMOVED
  983. #define ERROR_NO_SUCH_INTERFACE_DEVICE    ERROR_NO_SUCH_DEVICE_INTERFACE
  984. //
  985. // Win9x migration DLL error code
  986. //
  987. #define ERROR_NOT_INSTALLED               (APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x1000)
  988. WINSETUPAPI
  989. BOOL
  990. WINAPI
  991. SetupGetInfInformationA(
  992.     IN  LPCVOID             InfSpec,
  993.     IN  DWORD               SearchControl,
  994.     OUT PSP_INF_INFORMATION ReturnBuffer,     OPTIONAL
  995.     IN  DWORD               ReturnBufferSize,
  996.     OUT PDWORD              RequiredSize      OPTIONAL
  997.     );
  998. WINSETUPAPI
  999. BOOL
  1000. WINAPI
  1001. SetupGetInfInformationW(
  1002.     IN  LPCVOID             InfSpec,
  1003.     IN  DWORD               SearchControl,
  1004.     OUT PSP_INF_INFORMATION ReturnBuffer,     OPTIONAL
  1005.     IN  DWORD               ReturnBufferSize,
  1006.     OUT PDWORD              RequiredSize      OPTIONAL
  1007.     );
  1008. //
  1009. // SearchControl flags for SetupGetInfInformation
  1010. //
  1011. #define INFINFO_INF_SPEC_IS_HINF        1
  1012. #define INFINFO_INF_NAME_IS_ABSOLUTE    2
  1013. #define INFINFO_DEFAULT_SEARCH          3
  1014. #define INFINFO_REVERSE_DEFAULT_SEARCH  4
  1015. #define INFINFO_INF_PATH_LIST_SEARCH    5
  1016. #ifdef UNICODE
  1017. #define SetupGetInfInformation SetupGetInfInformationW
  1018. #else
  1019. #define SetupGetInfInformation SetupGetInfInformationA
  1020. #endif
  1021. WINSETUPAPI
  1022. BOOL
  1023. WINAPI
  1024. SetupQueryInfFileInformationA(
  1025.     IN  PSP_INF_INFORMATION InfInformation,
  1026.     IN  UINT                InfIndex,
  1027.     OUT PSTR                ReturnBuffer,     OPTIONAL
  1028.     IN  DWORD               ReturnBufferSize,
  1029.     OUT PDWORD              RequiredSize      OPTIONAL
  1030.     );
  1031. WINSETUPAPI
  1032. BOOL
  1033. WINAPI
  1034. SetupQueryInfFileInformationW(
  1035.     IN  PSP_INF_INFORMATION InfInformation,
  1036.     IN  UINT                InfIndex,
  1037.     OUT PWSTR               ReturnBuffer,     OPTIONAL
  1038.     IN  DWORD               ReturnBufferSize,
  1039.     OUT PDWORD              RequiredSize      OPTIONAL
  1040.     );
  1041. #ifdef UNICODE
  1042. #define SetupQueryInfFileInformation SetupQueryInfFileInformationW
  1043. #else
  1044. #define SetupQueryInfFileInformation SetupQueryInfFileInformationA
  1045. #endif
  1046. WINSETUPAPI
  1047. BOOL
  1048. WINAPI
  1049. SetupQueryInfVersionInformationA(
  1050.     IN  PSP_INF_INFORMATION InfInformation,
  1051.     IN  UINT                InfIndex,
  1052.     IN  PCSTR               Key,              OPTIONAL
  1053.     OUT PSTR                ReturnBuffer,     OPTIONAL
  1054.     IN  DWORD               ReturnBufferSize,
  1055.     OUT PDWORD              RequiredSize      OPTIONAL
  1056.     );
  1057. WINSETUPAPI
  1058. BOOL
  1059. WINAPI
  1060. SetupQueryInfVersionInformationW(
  1061.     IN  PSP_INF_INFORMATION InfInformation,
  1062.     IN  UINT                InfIndex,
  1063.     IN  PCWSTR              Key,              OPTIONAL
  1064.     OUT PWSTR               ReturnBuffer,     OPTIONAL
  1065.     IN  DWORD               ReturnBufferSize,
  1066.     OUT PDWORD              RequiredSize      OPTIONAL
  1067.     );
  1068. #ifdef UNICODE
  1069. #define SetupQueryInfVersionInformation SetupQueryInfVersionInformationW
  1070. #else
  1071. #define SetupQueryInfVersionInformation SetupQueryInfVersionInformationA
  1072. #endif
  1073. WINSETUPAPI
  1074. BOOL
  1075. WINAPI
  1076. SetupGetInfFileListA(
  1077.     IN  PCSTR  DirectoryPath,    OPTIONAL
  1078.     IN  DWORD  InfStyle,
  1079.     OUT PSTR   ReturnBuffer,     OPTIONAL
  1080.     IN  DWORD  ReturnBufferSize,
  1081.     OUT PDWORD RequiredSize      OPTIONAL
  1082.     );
  1083. WINSETUPAPI
  1084. BOOL
  1085. WINAPI
  1086. SetupGetInfFileListW(
  1087.     IN  PCWSTR DirectoryPath,    OPTIONAL
  1088.     IN  DWORD  InfStyle,
  1089.     OUT PWSTR  ReturnBuffer,     OPTIONAL
  1090.     IN  DWORD  ReturnBufferSize,
  1091.     OUT PDWORD RequiredSize      OPTIONAL
  1092.     );
  1093. #ifdef UNICODE
  1094. #define SetupGetInfFileList SetupGetInfFileListW
  1095. #else
  1096. #define SetupGetInfFileList SetupGetInfFileListA
  1097. #endif
  1098. WINSETUPAPI
  1099. HINF
  1100. WINAPI
  1101. SetupOpenInfFileW(
  1102.     IN  PCWSTR FileName,
  1103.     IN  PCWSTR InfClass,    OPTIONAL
  1104.     IN  DWORD  InfStyle,
  1105.     OUT PUINT  ErrorLine    OPTIONAL
  1106.     );
  1107. WINSETUPAPI
  1108. HINF
  1109. WINAPI
  1110. SetupOpenInfFileA(
  1111.     IN  PCSTR FileName,
  1112.     IN  PCSTR InfClass,     OPTIONAL
  1113.     IN  DWORD InfStyle,
  1114.     OUT PUINT ErrorLine     OPTIONAL
  1115.     );
  1116. #ifdef UNICODE
  1117. #define SetupOpenInfFile SetupOpenInfFileW
  1118. #else
  1119. #define SetupOpenInfFile SetupOpenInfFileA
  1120. #endif
  1121. WINSETUPAPI
  1122. HINF
  1123. WINAPI
  1124. SetupOpenMasterInf(
  1125.     VOID
  1126.     );
  1127. WINSETUPAPI
  1128. BOOL
  1129. WINAPI
  1130. SetupOpenAppendInfFileW(
  1131.     IN  PCWSTR FileName,    OPTIONAL
  1132.     IN  HINF   InfHandle,
  1133.     OUT PUINT  ErrorLine    OPTIONAL
  1134.     );
  1135. WINSETUPAPI
  1136. BOOL
  1137. WINAPI
  1138. SetupOpenAppendInfFileA(
  1139.     IN  PCSTR FileName,     OPTIONAL
  1140.     IN  HINF  InfHandle,
  1141.     OUT PUINT ErrorLine     OPTIONAL
  1142.     );
  1143. #ifdef UNICODE
  1144. #define SetupOpenAppendInfFile SetupOpenAppendInfFileW
  1145. #else
  1146. #define SetupOpenAppendInfFile SetupOpenAppendInfFileA
  1147. #endif
  1148. WINSETUPAPI
  1149. VOID
  1150. WINAPI
  1151. SetupCloseInfFile(
  1152.     IN HINF InfHandle
  1153.     );
  1154. WINSETUPAPI
  1155. BOOL
  1156. WINAPI
  1157. SetupFindFirstLineA(
  1158.     IN  HINF        InfHandle,
  1159.     IN  PCSTR       Section,
  1160.     IN  PCSTR       Key,          OPTIONAL
  1161.     OUT PINFCONTEXT Context
  1162.     );
  1163. WINSETUPAPI
  1164. BOOL
  1165. WINAPI
  1166. SetupFindFirstLineW(
  1167.     IN  HINF        InfHandle,
  1168.     IN  PCWSTR      Section,
  1169.     IN  PCWSTR      Key,          OPTIONAL
  1170.     OUT PINFCONTEXT Context
  1171.     );
  1172. #ifdef UNICODE
  1173. #define SetupFindFirstLine SetupFindFirstLineW
  1174. #else
  1175. #define SetupFindFirstLine SetupFindFirstLineA
  1176. #endif
  1177. WINSETUPAPI
  1178. BOOL
  1179. WINAPI
  1180. SetupFindNextLine(
  1181.     IN  PINFCONTEXT ContextIn,
  1182.     OUT PINFCONTEXT ContextOut
  1183.     );
  1184. WINSETUPAPI
  1185. BOOL
  1186. WINAPI
  1187. SetupFindNextMatchLineA(
  1188.     IN  PINFCONTEXT ContextIn,
  1189.     IN  PCSTR       Key,        OPTIONAL
  1190.     OUT PINFCONTEXT ContextOut
  1191.     );
  1192. WINSETUPAPI
  1193. BOOL
  1194. WINAPI
  1195. SetupFindNextMatchLineW(
  1196.     IN  PINFCONTEXT ContextIn,
  1197.     IN  PCWSTR      Key,        OPTIONAL
  1198.     OUT PINFCONTEXT ContextOut
  1199.     );
  1200. #ifdef UNICODE
  1201. #define SetupFindNextMatchLine SetupFindNextMatchLineW
  1202. #else
  1203. #define SetupFindNextMatchLine SetupFindNextMatchLineA
  1204. #endif
  1205. WINSETUPAPI
  1206. BOOL
  1207. WINAPI
  1208. SetupGetLineByIndexA(
  1209.     IN  HINF        InfHandle,
  1210.     IN  PCSTR       Section,
  1211.     IN  DWORD       Index,
  1212.     OUT PINFCONTEXT Context
  1213.     );
  1214. WINSETUPAPI
  1215. BOOL
  1216. WINAPI
  1217. SetupGetLineByIndexW(
  1218.     IN  HINF        InfHandle,
  1219.     IN  PCWSTR      Section,
  1220.     IN  DWORD       Index,
  1221.     OUT PINFCONTEXT Context
  1222.     );
  1223. #ifdef UNICODE
  1224. #define SetupGetLineByIndex SetupGetLineByIndexW
  1225. #else
  1226. #define SetupGetLineByIndex SetupGetLineByIndexA
  1227. #endif
  1228. WINSETUPAPI
  1229. LONG
  1230. WINAPI
  1231. SetupGetLineCountA(
  1232.     IN HINF  InfHandle,
  1233.     IN PCSTR Section
  1234.     );
  1235. WINSETUPAPI
  1236. LONG
  1237. WINAPI
  1238. SetupGetLineCountW(
  1239.     IN HINF   InfHandle,
  1240.     IN PCWSTR Section
  1241.     );
  1242. #ifdef UNICODE
  1243. #define SetupGetLineCount SetupGetLineCountW
  1244. #else
  1245. #define SetupGetLineCount SetupGetLineCountA
  1246. #endif
  1247. WINSETUPAPI
  1248. BOOL
  1249. WINAPI
  1250. SetupGetLineTextA(
  1251.     IN  PINFCONTEXT Context,          OPTIONAL
  1252.     IN  HINF        InfHandle,        OPTIONAL
  1253.     IN  PCSTR       Section,          OPTIONAL
  1254.     IN  PCSTR       Key,              OPTIONAL
  1255.     OUT PSTR        ReturnBuffer,     OPTIONAL
  1256.     IN  DWORD       ReturnBufferSize,
  1257.     OUT PDWORD      RequiredSize      OPTIONAL
  1258.     );
  1259. WINSETUPAPI
  1260. BOOL
  1261. WINAPI
  1262. SetupGetLineTextW(
  1263.     IN  PINFCONTEXT Context,          OPTIONAL
  1264.     IN  HINF        InfHandle,        OPTIONAL
  1265.     IN  PCWSTR      Section,          OPTIONAL
  1266.     IN  PCWSTR      Key,              OPTIONAL
  1267.     OUT PWSTR       ReturnBuffer,     OPTIONAL
  1268.     IN  DWORD       ReturnBufferSize,
  1269.     OUT PDWORD      RequiredSize      OPTIONAL
  1270.     );
  1271. #ifdef UNICODE
  1272. #define SetupGetLineText SetupGetLineTextW
  1273. #else
  1274. #define SetupGetLineText SetupGetLineTextA
  1275. #endif
  1276. WINSETUPAPI
  1277. DWORD
  1278. WINAPI
  1279. SetupGetFieldCount(
  1280.     IN PINFCONTEXT Context
  1281.     );
  1282. WINSETUPAPI
  1283. BOOL
  1284. WINAPI
  1285. SetupGetStringFieldA(
  1286.     IN  PINFCONTEXT Context,
  1287.     IN  DWORD       FieldIndex,
  1288.     OUT PSTR        ReturnBuffer,     OPTIONAL
  1289.     IN  DWORD       ReturnBufferSize,
  1290.     OUT PDWORD      RequiredSize      OPTIONAL
  1291.     );
  1292. WINSETUPAPI
  1293. BOOL
  1294. WINAPI
  1295. SetupGetStringFieldW(
  1296.     IN  PINFCONTEXT Context,
  1297.     IN  DWORD       FieldIndex,
  1298.     OUT PWSTR       ReturnBuffer,     OPTIONAL
  1299.     IN  DWORD       ReturnBufferSize,
  1300.     OUT PDWORD      RequiredSize      OPTIONAL
  1301.     );
  1302. #ifdef UNICODE
  1303. #define SetupGetStringField SetupGetStringFieldW
  1304. #else
  1305. #define SetupGetStringField SetupGetStringFieldA
  1306. #endif
  1307. WINSETUPAPI
  1308. BOOL
  1309. WINAPI
  1310. SetupGetIntField(
  1311.     IN  PINFCONTEXT Context,
  1312.     IN  DWORD       FieldIndex,
  1313.     OUT PINT        IntegerValue
  1314.     );
  1315. WINSETUPAPI
  1316. BOOL
  1317. WINAPI
  1318. SetupGetMultiSzFieldA(
  1319.     IN  PINFCONTEXT Context,
  1320.     IN  DWORD       FieldIndex,
  1321.     OUT PSTR        ReturnBuffer,     OPTIONAL
  1322.     IN  DWORD       ReturnBufferSize,
  1323.     OUT LPDWORD     RequiredSize      OPTIONAL
  1324.     );
  1325. WINSETUPAPI
  1326. BOOL
  1327. WINAPI
  1328. SetupGetMultiSzFieldW(
  1329.     IN  PINFCONTEXT Context,
  1330.     IN  DWORD       FieldIndex,
  1331.     OUT PWSTR       ReturnBuffer,     OPTIONAL
  1332.     IN  DWORD       ReturnBufferSize,
  1333.     OUT LPDWORD     RequiredSize      OPTIONAL
  1334.     );
  1335. #ifdef UNICODE
  1336. #define SetupGetMultiSzField SetupGetMultiSzFieldW
  1337. #else
  1338. #define SetupGetMultiSzField SetupGetMultiSzFieldA
  1339. #endif
  1340. WINSETUPAPI
  1341. BOOL
  1342. WINAPI
  1343. SetupGetBinaryField(
  1344.     IN  PINFCONTEXT Context,
  1345.     IN  DWORD       FieldIndex,
  1346.     OUT PBYTE       ReturnBuffer,     OPTIONAL
  1347.     IN  DWORD       ReturnBufferSize,
  1348.     OUT LPDWORD     RequiredSize      OPTIONAL
  1349.     );
  1350. WINSETUPAPI
  1351. DWORD
  1352. WINAPI
  1353. SetupGetFileCompressionInfoA(
  1354.     IN  PCSTR   SourceFileName,
  1355.     OUT PSTR   *ActualSourceFileName,
  1356.     OUT PDWORD  SourceFileSize,
  1357.     OUT PDWORD  TargetFileSize,
  1358.     OUT PUINT   CompressionType
  1359.     );
  1360. WINSETUPAPI
  1361. DWORD
  1362. WINAPI
  1363. SetupGetFileCompressionInfoW(
  1364.     IN  PCWSTR  SourceFileName,
  1365.     OUT PWSTR  *ActualSourceFileName,
  1366.     OUT PDWORD  SourceFileSize,
  1367.     OUT PDWORD  TargetFileSize,
  1368.     OUT PUINT   CompressionType
  1369.     );
  1370. #ifdef UNICODE
  1371. #define SetupGetFileCompressionInfo SetupGetFileCompressionInfoW
  1372. #else
  1373. #define SetupGetFileCompressionInfo SetupGetFileCompressionInfoA
  1374. #endif
  1375. //
  1376. // Compression types
  1377. //
  1378. #define FILE_COMPRESSION_NONE       0
  1379. #define FILE_COMPRESSION_WINLZA     1
  1380. #define FILE_COMPRESSION_MSZIP      2
  1381. WINSETUPAPI
  1382. DWORD
  1383. WINAPI
  1384. SetupDecompressOrCopyFileA(
  1385.     IN PCSTR SourceFileName,
  1386.     IN PCSTR TargetFileName,
  1387.     IN PUINT CompressionType OPTIONAL
  1388.     );
  1389. WINSETUPAPI
  1390. DWORD
  1391. WINAPI
  1392. SetupDecompressOrCopyFileW(
  1393.     IN PCWSTR SourceFileName,
  1394.     IN PCWSTR TargetFileName,
  1395.     IN PUINT  CompressionType OPTIONAL
  1396.     );
  1397. #ifdef UNICODE
  1398. #define SetupDecompressOrCopyFile SetupDecompressOrCopyFileW
  1399. #else
  1400. #define SetupDecompressOrCopyFile SetupDecompressOrCopyFileA
  1401. #endif
  1402. WINSETUPAPI
  1403. BOOL
  1404. WINAPI
  1405. SetupGetSourceFileLocationA(
  1406.     IN  HINF        InfHandle,
  1407.     IN  PINFCONTEXT InfContext,       OPTIONAL
  1408.     IN  PCSTR       FileName,         OPTIONAL
  1409.     OUT PUINT       SourceId,
  1410.     OUT PSTR        ReturnBuffer,     OPTIONAL
  1411.     IN  DWORD       ReturnBufferSize,
  1412.     OUT PDWORD      RequiredSize      OPTIONAL
  1413.     );
  1414. WINSETUPAPI
  1415. BOOL
  1416. WINAPI
  1417. SetupGetSourceFileLocationW(
  1418.     IN  HINF        InfHandle,
  1419.     IN  PINFCONTEXT InfContext,       OPTIONAL
  1420.     IN  PCWSTR      FileName,         OPTIONAL
  1421.     OUT PUINT       SourceId,
  1422.     OUT PWSTR       ReturnBuffer,     OPTIONAL
  1423.     IN  DWORD       ReturnBufferSize,
  1424.     OUT PDWORD      RequiredSize      OPTIONAL
  1425.     );
  1426. #ifdef UNICODE
  1427. #define SetupGetSourceFileLocation SetupGetSourceFileLocationW
  1428. #else
  1429. #define SetupGetSourceFileLocation SetupGetSourceFileLocationA
  1430. #endif
  1431. WINSETUPAPI
  1432. BOOL
  1433. WINAPI
  1434. SetupGetSourceFileSizeA(
  1435.     IN  HINF        InfHandle,
  1436.     IN  PINFCONTEXT InfContext,     OPTIONAL
  1437.     IN  PCSTR       FileName,       OPTIONAL
  1438.     IN  PCSTR       Section,        OPTIONAL
  1439.     OUT PDWORD      FileSize,
  1440.     IN  UINT        RoundingFactor  OPTIONAL
  1441.     );
  1442. WINSETUPAPI
  1443. BOOL
  1444. WINAPI
  1445. SetupGetSourceFileSizeW(
  1446.     IN  HINF        InfHandle,
  1447.     IN  PINFCONTEXT InfContext,     OPTIONAL
  1448.     IN  PCWSTR      FileName,       OPTIONAL
  1449.     IN  PCWSTR      Section,        OPTIONAL
  1450.     OUT PDWORD      FileSize,
  1451.     IN  UINT        RoundingFactor  OPTIONAL
  1452.     );
  1453. #ifdef UNICODE
  1454. #define SetupGetSourceFileSize SetupGetSourceFileSizeW
  1455. #else
  1456. #define SetupGetSourceFileSize SetupGetSourceFileSizeA
  1457. #endif
  1458. WINSETUPAPI
  1459. BOOL
  1460. WINAPI
  1461. SetupGetTargetPathA(
  1462.     IN  HINF        InfHandle,
  1463.     IN  PINFCONTEXT InfContext,       OPTIONAL
  1464.     IN  PCSTR       Section,          OPTIONAL
  1465.     OUT PSTR        ReturnBuffer,     OPTIONAL
  1466.     IN  DWORD       ReturnBufferSize,
  1467.     OUT PDWORD      RequiredSize      OPTIONAL
  1468.     );
  1469. WINSETUPAPI
  1470. BOOL
  1471. WINAPI
  1472. SetupGetTargetPathW(
  1473.     IN  HINF        InfHandle,
  1474.     IN  PINFCONTEXT InfContext,       OPTIONAL
  1475.     IN  PCWSTR      Section,          OPTIONAL
  1476.     OUT PWSTR       ReturnBuffer,     OPTIONAL
  1477.     IN  DWORD       ReturnBufferSize,
  1478.     OUT PDWORD      RequiredSize      OPTIONAL
  1479.     );
  1480. #ifdef UNICODE
  1481. #define SetupGetTargetPath SetupGetTargetPathW
  1482. #else
  1483. #define SetupGetTargetPath SetupGetTargetPathA
  1484. #endif
  1485. //
  1486. // Define flags for SourceList APIs.
  1487. //
  1488. #define SRCLIST_TEMPORARY       0x00000001
  1489. #define SRCLIST_NOBROWSE        0x00000002
  1490. #define SRCLIST_SYSTEM          0x00000010
  1491. #define SRCLIST_USER            0x00000020
  1492. #define SRCLIST_SYSIFADMIN      0x00000040
  1493. #define SRCLIST_SUBDIRS         0x00000100
  1494. #define SRCLIST_APPEND          0x00000200
  1495. #define SRCLIST_NOSTRIPPLATFORM 0x00000400
  1496. WINSETUPAPI
  1497. BOOL
  1498. WINAPI
  1499. SetupSetSourceListA(
  1500.     IN DWORD  Flags,
  1501.     IN PCSTR *SourceList,
  1502.     IN UINT   SourceCount
  1503.     );
  1504. WINSETUPAPI
  1505. BOOL
  1506. WINAPI
  1507. SetupSetSourceListW(
  1508.     IN DWORD   Flags,
  1509.     IN PCWSTR *SourceList,
  1510.     IN UINT    SourceCount
  1511.     );
  1512. #ifdef UNICODE
  1513. #define SetupSetSourceList SetupSetSourceListW
  1514. #else
  1515. #define SetupSetSourceList SetupSetSourceListA
  1516. #endif
  1517. WINSETUPAPI
  1518. BOOL
  1519. WINAPI
  1520. SetupCancelTemporarySourceList(
  1521.     VOID
  1522.     );
  1523. WINSETUPAPI
  1524. BOOL
  1525. WINAPI
  1526. SetupAddToSourceListA(
  1527.     IN DWORD Flags,
  1528.     IN PCSTR Source
  1529.     );
  1530. WINSETUPAPI
  1531. BOOL
  1532. WINAPI
  1533. SetupAddToSourceListW(
  1534.     IN DWORD  Flags,
  1535.     IN PCWSTR Source
  1536.     );
  1537. #ifdef UNICODE
  1538. #define SetupAddToSourceList SetupAddToSourceListW
  1539. #else
  1540. #define SetupAddToSourceList SetupAddToSourceListA
  1541. #endif
  1542. WINSETUPAPI
  1543. BOOL
  1544. WINAPI
  1545. SetupRemoveFromSourceListA(
  1546.     IN DWORD Flags,
  1547.     IN PCSTR Source
  1548.     );
  1549. WINSETUPAPI
  1550. BOOL
  1551. WINAPI
  1552. SetupRemoveFromSourceListW(
  1553.     IN DWORD  Flags,
  1554.     IN PCWSTR Source
  1555.     );
  1556. #ifdef UNICODE
  1557. #define SetupRemoveFromSourceList SetupRemoveFromSourceListW
  1558. #else
  1559. #define SetupRemoveFromSourceList SetupRemoveFromSourceListA
  1560. #endif
  1561. WINSETUPAPI
  1562. BOOL
  1563. WINAPI
  1564. SetupQuerySourceListA(
  1565.     IN  DWORD   Flags,
  1566.     OUT PCSTR **List,
  1567.     OUT PUINT   Count
  1568.     );
  1569. WINSETUPAPI
  1570. BOOL
  1571. WINAPI
  1572. SetupQuerySourceListW(
  1573.     IN  DWORD    Flags,
  1574.     OUT PCWSTR **List,
  1575.     OUT PUINT    Count
  1576.     );
  1577. #ifdef UNICODE
  1578. #define SetupQuerySourceList SetupQuerySourceListW
  1579. #else
  1580. #define SetupQuerySourceList SetupQuerySourceListA
  1581. #endif
  1582. WINSETUPAPI
  1583. BOOL
  1584. WINAPI
  1585. SetupFreeSourceListA(
  1586.     IN OUT PCSTR **List,
  1587.     IN     UINT    Count
  1588.     );
  1589. WINSETUPAPI
  1590. BOOL
  1591. WINAPI
  1592. SetupFreeSourceListW(
  1593.     IN OUT PCWSTR **List,
  1594.     IN     UINT     Count
  1595.     );
  1596. #ifdef UNICODE
  1597. #define SetupFreeSourceList SetupFreeSourceListW
  1598. #else
  1599. #define SetupFreeSourceList SetupFreeSourceListA
  1600. #endif
  1601. WINSETUPAPI
  1602. UINT
  1603. WINAPI
  1604. SetupPromptForDiskA(
  1605.     IN  HWND   hwndParent,
  1606.     IN  PCSTR  DialogTitle,      OPTIONAL
  1607.     IN  PCSTR  DiskName,         OPTIONAL
  1608.     IN  PCSTR  PathToSource,     OPTIONAL
  1609.     IN  PCSTR  FileSought,
  1610.     IN  PCSTR  TagFile,          OPTIONAL
  1611.     IN  DWORD  DiskPromptStyle,
  1612.     OUT PSTR   PathBuffer,
  1613.     IN  DWORD  PathBufferSize,
  1614.     OUT PDWORD PathRequiredSize
  1615.     );
  1616. WINSETUPAPI
  1617. UINT
  1618. WINAPI
  1619. SetupPromptForDiskW(
  1620.     IN  HWND   hwndParent,
  1621.     IN  PCWSTR DialogTitle,      OPTIONAL
  1622.     IN  PCWSTR DiskName,         OPTIONAL
  1623.     IN  PCWSTR PathToSource,     OPTIONAL
  1624.     IN  PCWSTR FileSought,
  1625.     IN  PCWSTR TagFile,          OPTIONAL
  1626.     IN  DWORD  DiskPromptStyle,
  1627.     OUT PWSTR  PathBuffer,
  1628.     IN  DWORD  PathBufferSize,
  1629.     OUT PDWORD PathRequiredSize
  1630.     );
  1631. #ifdef UNICODE
  1632. #define SetupPromptForDisk SetupPromptForDiskW
  1633. #else
  1634. #define SetupPromptForDisk SetupPromptForDiskA
  1635. #endif
  1636. WINSETUPAPI
  1637. UINT
  1638. WINAPI
  1639. SetupCopyErrorA(
  1640.     IN  HWND   hwndParent,
  1641.     IN  PCSTR  DialogTitle,     OPTIONAL
  1642.     IN  PCSTR  DiskName,        OPTIONAL
  1643.     IN  PCSTR  PathToSource,
  1644.     IN  PCSTR  SourceFile,
  1645.     IN  PCSTR  TargetPathFile,  OPTIONAL
  1646.     IN  UINT   Win32ErrorCode,
  1647.     IN  DWORD  Style,
  1648.     OUT PSTR   PathBuffer,      OPTIONAL
  1649.     IN  DWORD  PathBufferSize,
  1650.     OUT PDWORD PathRequiredSize OPTIONAL
  1651.     );
  1652. WINSETUPAPI
  1653. UINT
  1654. WINAPI
  1655. SetupCopyErrorW(
  1656.     IN  HWND   hwndParent,
  1657.     IN  PCWSTR DialogTitle,     OPTIONAL
  1658.     IN  PCWSTR DiskName,        OPTIONAL
  1659.     IN  PCWSTR PathToSource,
  1660.     IN  PCWSTR SourceFile,
  1661.     IN  PCWSTR TargetPathFile,  OPTIONAL
  1662.     IN  UINT   Win32ErrorCode,
  1663.     IN  DWORD  Style,
  1664.     OUT PWSTR  PathBuffer,      OPTIONAL
  1665.     IN  DWORD  PathBufferSize,
  1666.     OUT PDWORD PathRequiredSize OPTIONAL
  1667.     );
  1668. #ifdef UNICODE
  1669. #define SetupCopyError SetupCopyErrorW
  1670. #else
  1671. #define SetupCopyError SetupCopyErrorA
  1672. #endif
  1673. WINSETUPAPI
  1674. UINT
  1675. WINAPI
  1676. SetupRenameErrorA(
  1677.     IN  HWND   hwndParent,
  1678.     IN  PCSTR  DialogTitle,     OPTIONAL
  1679.     IN  PCSTR  SourceFile,
  1680.     IN  PCSTR  TargetFile,
  1681.     IN  UINT   Win32ErrorCode,
  1682.     IN  DWORD  Style
  1683.     );
  1684. WINSETUPAPI
  1685. UINT
  1686. WINAPI
  1687. SetupRenameErrorW(
  1688.     IN  HWND   hwndParent,
  1689.     IN  PCWSTR DialogTitle,     OPTIONAL
  1690.     IN  PCWSTR SourceFile,
  1691.     IN  PCWSTR TargetFile,
  1692.     IN  UINT   Win32ErrorCode,
  1693.     IN  DWORD  Style
  1694.     );
  1695. #ifdef UNICODE
  1696. #define SetupRenameError SetupRenameErrorW
  1697. #else
  1698. #define SetupRenameError SetupRenameErrorA
  1699. #endif
  1700. WINSETUPAPI
  1701. UINT
  1702. WINAPI
  1703. SetupDeleteErrorA(
  1704.     IN  HWND   hwndParent,
  1705.     IN  PCSTR  DialogTitle,     OPTIONAL
  1706.     IN  PCSTR  File,
  1707.     IN  UINT   Win32ErrorCode,
  1708.     IN  DWORD  Style
  1709.     );
  1710. WINSETUPAPI
  1711. UINT
  1712. WINAPI
  1713. SetupDeleteErrorW(
  1714.     IN  HWND   hwndParent,
  1715.     IN  PCWSTR DialogTitle,     OPTIONAL
  1716.     IN  PCWSTR File,
  1717.     IN  UINT   Win32ErrorCode,
  1718.     IN  DWORD  Style
  1719.     );
  1720. #ifdef UNICODE
  1721. #define SetupDeleteError SetupDeleteErrorW
  1722. #else
  1723. #define SetupDeleteError SetupDeleteErrorA
  1724. #endif
  1725. //
  1726. // Styles for SetupPromptForDisk, SetupCopyError,
  1727. // SetupRenameError, SetupDeleteError
  1728. //
  1729. #define IDF_NOBROWSE        0x00000001
  1730. #define IDF_NOSKIP          0x00000002
  1731. #define IDF_NODETAILS       0x00000004
  1732. #define IDF_NOCOMPRESSED    0x00000008
  1733. #define IDF_CHECKFIRST      0x00000100
  1734. #define IDF_NOBEEP          0x00000200
  1735. #define IDF_NOFOREGROUND    0x00000400
  1736. #define IDF_WARNIFSKIP      0x00000800
  1737. #define IDF_OEMDISK         0x80000000
  1738. //
  1739. // Return values for SetupPromptForDisk, SetupCopyError,
  1740. // SetupRenameError, SetupDeleteError
  1741. //
  1742. #define DPROMPT_SUCCESS         0
  1743. #define DPROMPT_CANCEL          1
  1744. #define DPROMPT_SKIPFILE        2
  1745. #define DPROMPT_BUFFERTOOSMALL  3
  1746. #define DPROMPT_OUTOFMEMORY     4
  1747. WINSETUPAPI
  1748. BOOL
  1749. WINAPI
  1750. SetupSetDirectoryIdA(
  1751.     IN HINF  InfHandle,
  1752.     IN DWORD Id,            OPTIONAL
  1753.     IN PCSTR Directory      OPTIONAL
  1754.     );
  1755. WINSETUPAPI
  1756. BOOL
  1757. WINAPI
  1758. SetupSetDirectoryIdW(
  1759.     IN HINF   InfHandle,
  1760.     IN DWORD  Id,           OPTIONAL
  1761.     IN PCWSTR Directory     OPTIONAL
  1762.     );
  1763. #ifdef UNICODE
  1764. #define SetupSetDirectoryId SetupSetDirectoryIdW
  1765. #else
  1766. #define SetupSetDirectoryId SetupSetDirectoryIdA
  1767. #endif
  1768. WINSETUPAPI
  1769. BOOL
  1770. WINAPI
  1771. SetupSetDirectoryIdExA(
  1772.     IN HINF  InfHandle,
  1773.     IN DWORD Id,            OPTIONAL
  1774.     IN PCSTR Directory,     OPTIONAL
  1775.     IN DWORD Flags,
  1776.     IN DWORD Reserved1,
  1777.     IN PVOID Reserved2
  1778.     );
  1779. WINSETUPAPI
  1780. BOOL
  1781. WINAPI
  1782. SetupSetDirectoryIdExW(
  1783.     IN HINF   InfHandle,
  1784.     IN DWORD  Id,           OPTIONAL
  1785.     IN PCWSTR Directory,    OPTIONAL
  1786.     IN DWORD  Flags,
  1787.     IN DWORD  Reserved1,
  1788.     IN PVOID  Reserved2
  1789.     );
  1790. #ifdef UNICODE
  1791. #define SetupSetDirectoryIdEx SetupSetDirectoryIdExW
  1792. #else
  1793. #define SetupSetDirectoryIdEx SetupSetDirectoryIdExA
  1794. #endif
  1795. //
  1796. // Flags for SetupSetDirectoryIdEx
  1797. //
  1798. #define SETDIRID_NOT_FULL_PATH      0x00000001
  1799. WINSETUPAPI
  1800. BOOL
  1801. WINAPI
  1802. SetupGetSourceInfoA(
  1803.     IN  HINF   InfHandle,
  1804.     IN  UINT   SourceId,
  1805.     IN  UINT   InfoDesired,
  1806.     OUT PSTR   ReturnBuffer,     OPTIONAL
  1807.     IN  DWORD  ReturnBufferSize,
  1808.     OUT PDWORD RequiredSize      OPTIONAL
  1809.     );
  1810. WINSETUPAPI
  1811. BOOL
  1812. WINAPI
  1813. SetupGetSourceInfoW(
  1814.     IN  HINF   InfHandle,
  1815.     IN  UINT   SourceId,
  1816.     IN  UINT   InfoDesired,
  1817.     OUT PWSTR  ReturnBuffer,     OPTIONAL
  1818.     IN  DWORD  ReturnBufferSize,
  1819.     OUT PDWORD RequiredSize      OPTIONAL
  1820.     );
  1821. #ifdef UNICODE
  1822. #define SetupGetSourceInfo SetupGetSourceInfoW
  1823. #else
  1824. #define SetupGetSourceInfo SetupGetSourceInfoA
  1825. #endif
  1826. //
  1827. // InfoDesired values for SetupGetSourceInfo
  1828. //
  1829. #define SRCINFO_PATH            1
  1830. #define SRCINFO_TAGFILE         2
  1831. #define SRCINFO_DESCRIPTION     3
  1832. WINSETUPAPI
  1833. BOOL
  1834. WINAPI
  1835. SetupInstallFileA(
  1836.     IN HINF                InfHandle,         OPTIONAL
  1837.     IN PINFCONTEXT         InfContext,        OPTIONAL
  1838.     IN PCSTR               SourceFile,        OPTIONAL
  1839.     IN PCSTR               SourcePathRoot,    OPTIONAL
  1840.     IN PCSTR               DestinationName,   OPTIONAL
  1841.     IN DWORD               CopyStyle,
  1842.     IN PSP_FILE_CALLBACK_A CopyMsgHandler,    OPTIONAL
  1843.     IN PVOID               Context            OPTIONAL
  1844.     );
  1845. WINSETUPAPI
  1846. BOOL
  1847. WINAPI
  1848. SetupInstallFileW(
  1849.     IN HINF                InfHandle,         OPTIONAL
  1850.     IN PINFCONTEXT         InfContext,        OPTIONAL
  1851.     IN PCWSTR              SourceFile,        OPTIONAL
  1852.     IN PCWSTR              SourcePathRoot,    OPTIONAL
  1853.     IN PCWSTR              DestinationName,   OPTIONAL
  1854.     IN DWORD               CopyStyle,
  1855.     IN PSP_FILE_CALLBACK_W CopyMsgHandler,    OPTIONAL
  1856.     IN PVOID               Context            OPTIONAL
  1857.     );
  1858. #ifdef UNICODE
  1859. #define SetupInstallFile SetupInstallFileW
  1860. #else
  1861. #define SetupInstallFile SetupInstallFileA
  1862. #endif
  1863. WINSETUPAPI
  1864. BOOL
  1865. WINAPI
  1866. SetupInstallFileExA(
  1867.     IN  HINF                InfHandle,         OPTIONAL
  1868.     IN  PINFCONTEXT         InfContext,        OPTIONAL
  1869.     IN  PCSTR               SourceFile,        OPTIONAL
  1870.     IN  PCSTR               SourcePathRoot,    OPTIONAL
  1871.     IN  PCSTR               DestinationName,   OPTIONAL
  1872.     IN  DWORD               CopyStyle,
  1873.     IN  PSP_FILE_CALLBACK_A CopyMsgHandler,    OPTIONAL
  1874.     IN  PVOID               Context,           OPTIONAL
  1875.     OUT PBOOL               FileWasInUse
  1876.     );
  1877. WINSETUPAPI
  1878. BOOL
  1879. WINAPI
  1880. SetupInstallFileExW(
  1881.     IN  HINF                InfHandle,         OPTIONAL
  1882.     IN  PINFCONTEXT         InfContext,        OPTIONAL
  1883.     IN  PCWSTR              SourceFile,        OPTIONAL
  1884.     IN  PCWSTR              SourcePathRoot,    OPTIONAL
  1885.     IN  PCWSTR              DestinationName,   OPTIONAL
  1886.     IN  DWORD               CopyStyle,
  1887.     IN  PSP_FILE_CALLBACK_W CopyMsgHandler,    OPTIONAL
  1888.     IN  PVOID               Context,           OPTIONAL
  1889.     OUT PBOOL               FileWasInUse
  1890.     );
  1891. #ifdef UNICODE
  1892. #define SetupInstallFileEx SetupInstallFileExW
  1893. #else
  1894. #define SetupInstallFileEx SetupInstallFileExA
  1895. #endif
  1896. //
  1897. // CopyStyle values for copy and queue-related APIs
  1898. //
  1899. #define SP_COPY_DELETESOURCE        0x0000001   // delete source file on successful copy
  1900. #define SP_COPY_REPLACEONLY         0x0000002   // copy only if target file already present
  1901. #define SP_COPY_NEWER               0x0000004   // copy only if source newer than or same as target
  1902. #define SP_COPY_NEWER_OR_SAME       SP_COPY_NEWER
  1903. #define SP_COPY_NOOVERWRITE         0x0000008   // copy only if target doesn't exist
  1904. #define SP_COPY_NODECOMP            0x0000010   // don't decompress source file while copying
  1905. #define SP_COPY_LANGUAGEAWARE       0x0000020   // don't overwrite file of different language
  1906. #define SP_COPY_SOURCE_ABSOLUTE     0x0000040   // SourceFile is a full source path
  1907. #define SP_COPY_SOURCEPATH_ABSOLUTE 0x0000080   // SourcePathRoot is the full path
  1908. #define SP_COPY_IN_USE_NEEDS_REBOOT 0x0000100   // System needs reboot if file in use
  1909. #define SP_COPY_FORCE_IN_USE        0x0000200   // Force target-in-use behavior
  1910. #define SP_COPY_NOSKIP              0x0000400   // Skip is disallowed for this file or section
  1911. #define SP_FLAG_CABINETCONTINUATION 0x0000800   // Used with need media notification
  1912. #define SP_COPY_FORCE_NOOVERWRITE   0x0001000   // like NOOVERWRITE but no callback nofitication
  1913. #define SP_COPY_FORCE_NEWER         0x0002000   // like NEWER but no callback nofitication
  1914. #define SP_COPY_WARNIFSKIP          0x0004000   // system critical file: warn if user tries to skip
  1915. #define SP_COPY_NOBROWSE            0x0008000   // Browsing is disallowed for this file or section
  1916. #define SP_COPY_NEWER_ONLY          0x0010000   // copy only if source file newer than target
  1917. WINSETUPAPI
  1918. HSPFILEQ
  1919. WINAPI
  1920. SetupOpenFileQueue(
  1921.     VOID
  1922.     );
  1923. WINSETUPAPI
  1924. BOOL
  1925. WINAPI
  1926. SetupCloseFileQueue(
  1927.     IN HSPFILEQ QueueHandle
  1928.     );
  1929. WINSETUPAPI
  1930. BOOL
  1931. WINAPI
  1932. SetupSetPlatformPathOverrideA(
  1933.     IN PCSTR Override   OPTIONAL
  1934.     );
  1935. WINSETUPAPI
  1936. BOOL
  1937. WINAPI
  1938. SetupSetPlatformPathOverrideW(
  1939.     IN PCWSTR Override  OPTIONAL
  1940.     );
  1941. #ifdef UNICODE
  1942. #define SetupSetPlatformPathOverride SetupSetPlatformPathOverrideW
  1943. #else
  1944. #define SetupSetPlatformPathOverride SetupSetPlatformPathOverrideA
  1945. #endif
  1946. WINSETUPAPI
  1947. BOOL
  1948. WINAPI
  1949. SetupQueueCopyA(
  1950.     IN HSPFILEQ QueueHandle,
  1951.     IN PCSTR    SourceRootPath,
  1952.     IN PCSTR    SourcePath,         OPTIONAL
  1953.     IN PCSTR    SourceFilename,
  1954.     IN PCSTR    SourceDescription,  OPTIONAL
  1955.     IN PCSTR    SourceTagfile,      OPTIONAL
  1956.     IN PCSTR    TargetDirectory,
  1957.     IN PCSTR    TargetFilename,     OPTIONAL
  1958.     IN DWORD    CopyStyle
  1959.     );
  1960. WINSETUPAPI
  1961. BOOL
  1962. WINAPI
  1963. SetupQueueCopyW(
  1964.     IN HSPFILEQ QueueHandle,
  1965.     IN PCWSTR   SourceRootPath,
  1966.     IN PCWSTR   SourcePath,         OPTIONAL
  1967.     IN PCWSTR   SourceFilename,
  1968.     IN PCWSTR   SourceDescription,  OPTIONAL
  1969.     IN PCWSTR   SourceTagfile,      OPTIONAL
  1970.     IN PCWSTR   TargetDirectory,
  1971.     IN PCWSTR   TargetFilename,     OPTIONAL
  1972.     IN DWORD    CopyStyle
  1973.     );
  1974. #ifdef UNICODE
  1975. #define SetupQueueCopy SetupQueueCopyW
  1976. #else
  1977. #define SetupQueueCopy SetupQueueCopyA
  1978. #endif
  1979. WINSETUPAPI
  1980. BOOL
  1981. WINAPI
  1982. SetupQueueDefaultCopyA(
  1983.     IN HSPFILEQ QueueHandle,
  1984.     IN HINF     InfHandle,
  1985.     IN PCSTR    SourceRootPath,
  1986.     IN PCSTR    SourceFilename,
  1987.     IN PCSTR    TargetFilename,
  1988.     IN DWORD    CopyStyle
  1989.     );
  1990. WINSETUPAPI
  1991. BOOL
  1992. WINAPI
  1993. SetupQueueDefaultCopyW(
  1994.     IN HSPFILEQ QueueHandle,
  1995.     IN HINF     InfHandle,
  1996.     IN PCWSTR   SourceRootPath,
  1997.     IN PCWSTR   SourceFilename,
  1998.     IN PCWSTR   TargetFilename,
  1999.     IN DWORD    CopyStyle
  2000.     );
  2001. #ifdef UNICODE
  2002. #define SetupQueueDefaultCopy SetupQueueDefaultCopyW
  2003. #else
  2004. #define SetupQueueDefaultCopy SetupQueueDefaultCopyA
  2005. #endif
  2006. WINSETUPAPI
  2007. BOOL
  2008. WINAPI
  2009. SetupQueueCopySectionA(
  2010.     IN HSPFILEQ QueueHandle,
  2011.     IN PCSTR    SourceRootPath,
  2012.     IN HINF     InfHandle,
  2013.     IN HINF     ListInfHandle,   OPTIONAL
  2014.     IN PCSTR    Section,
  2015.     IN DWORD    CopyStyle
  2016.     );
  2017. WINSETUPAPI
  2018. BOOL
  2019. WINAPI
  2020. SetupQueueCopySectionW(
  2021.     IN HSPFILEQ QueueHandle,
  2022.     IN PCWSTR   SourceRootPath,
  2023.     IN HINF     InfHandle,
  2024.     IN HINF     ListInfHandle,   OPTIONAL
  2025.     IN PCWSTR   Section,
  2026.     IN DWORD    CopyStyle
  2027.     );
  2028. #ifdef UNICODE
  2029. #define SetupQueueCopySection SetupQueueCopySectionW
  2030. #else
  2031. #define SetupQueueCopySection SetupQueueCopySectionA
  2032. #endif
  2033. WINSETUPAPI
  2034. BOOL
  2035. WINAPI
  2036. SetupQueueDeleteA(
  2037.     IN HSPFILEQ QueueHandle,
  2038.     IN PCSTR    PathPart1,
  2039.     IN PCSTR    PathPart2       OPTIONAL
  2040.     );
  2041. WINSETUPAPI
  2042. BOOL
  2043. WINAPI
  2044. SetupQueueDeleteW(
  2045.     IN HSPFILEQ QueueHandle,
  2046.     IN PCWSTR   PathPart1,
  2047.     IN PCWSTR   PathPart2       OPTIONAL
  2048.     );
  2049. #ifdef UNICODE
  2050. #define SetupQueueDelete SetupQueueDeleteW
  2051. #else
  2052. #define SetupQueueDelete SetupQueueDeleteA
  2053. #endif
  2054. WINSETUPAPI
  2055. BOOL
  2056. WINAPI
  2057. SetupQueueDeleteSectionA(
  2058.     IN HSPFILEQ QueueHandle,
  2059.     IN HINF     InfHandle,
  2060.     IN HINF     ListInfHandle,   OPTIONAL
  2061.     IN PCSTR    Section
  2062.     );
  2063. WINSETUPAPI
  2064. BOOL
  2065. WINAPI
  2066. SetupQueueDeleteSectionW(
  2067.     IN HSPFILEQ QueueHandle,
  2068.     IN HINF     InfHandle,
  2069.     IN HINF     ListInfHandle,   OPTIONAL
  2070.     IN PCWSTR   Section
  2071.     );
  2072. #ifdef UNICODE
  2073. #define SetupQueueDeleteSection SetupQueueDeleteSectionW
  2074. #else
  2075. #define SetupQueueDeleteSection SetupQueueDeleteSectionA
  2076. #endif
  2077. WINSETUPAPI
  2078. BOOL
  2079. WINAPI
  2080. SetupQueueRenameA(
  2081.     IN HSPFILEQ QueueHandle,
  2082.     IN PCSTR    SourcePath,
  2083.     IN PCSTR    SourceFilename, OPTIONAL
  2084.     IN PCSTR    TargetPath,     OPTIONAL
  2085.     IN PCSTR    TargetFilename
  2086.     );
  2087. WINSETUPAPI
  2088. BOOL
  2089. WINAPI
  2090. SetupQueueRenameW(
  2091.     IN HSPFILEQ QueueHandle,
  2092.     IN PCWSTR   SourcePath,
  2093.     IN PCWSTR   SourceFilename, OPTIONAL
  2094.     IN PCWSTR   TargetPath,     OPTIONAL
  2095.     IN PCWSTR   TargetFilename
  2096.     );
  2097. #ifdef UNICODE
  2098. #define SetupQueueRename SetupQueueRenameW
  2099. #else
  2100. #define SetupQueueRename SetupQueueRenameA
  2101. #endif
  2102. WINSETUPAPI
  2103. BOOL
  2104. WINAPI
  2105. SetupQueueRenameSectionA(
  2106.     IN HSPFILEQ QueueHandle,
  2107.     IN HINF     InfHandle,
  2108.     IN HINF     ListInfHandle,   OPTIONAL
  2109.     IN PCSTR    Section
  2110.     );
  2111. WINSETUPAPI
  2112. BOOL
  2113. WINAPI
  2114. SetupQueueRenameSectionW(
  2115.     IN HSPFILEQ QueueHandle,
  2116.     IN HINF     InfHandle,
  2117.     IN HINF     ListInfHandle,   OPTIONAL
  2118.     IN PCWSTR   Section
  2119.     );
  2120. #ifdef UNICODE
  2121. #define SetupQueueRenameSection SetupQueueRenameSectionW
  2122. #else
  2123. #define SetupQueueRenameSection SetupQueueRenameSectionA
  2124. #endif
  2125. WINSETUPAPI
  2126. BOOL
  2127. WINAPI
  2128. SetupCommitFileQueueA(
  2129.     IN HWND                Owner,         OPTIONAL
  2130.     IN HSPFILEQ            QueueHandle,
  2131.     IN PSP_FILE_CALLBACK_A MsgHandler,
  2132.     IN PVOID               Context
  2133.     );
  2134. WINSETUPAPI
  2135. BOOL
  2136. WINAPI
  2137. SetupCommitFileQueueW(
  2138.     IN HWND                Owner,         OPTIONAL
  2139.     IN HSPFILEQ            QueueHandle,
  2140.     IN PSP_FILE_CALLBACK_W MsgHandler,
  2141.     IN PVOID               Context
  2142.     );
  2143. #ifdef UNICODE
  2144. #define SetupCommitFileQueue SetupCommitFileQueueW
  2145. #else
  2146. #define SetupCommitFileQueue SetupCommitFileQueueA
  2147. #endif
  2148. WINSETUPAPI
  2149. BOOL
  2150. WINAPI
  2151. SetupScanFileQueueA(
  2152.     IN  HSPFILEQ            FileQueue,
  2153.     IN  DWORD               Flags,
  2154.     IN  HWND                Window,            OPTIONAL
  2155.     IN  PSP_FILE_CALLBACK_A CallbackRoutine,   OPTIONAL
  2156.     IN  PVOID               CallbackContext,   OPTIONAL
  2157.     OUT PDWORD              Result
  2158.     );
  2159. WINSETUPAPI
  2160. BOOL
  2161. WINAPI
  2162. SetupScanFileQueueW(
  2163.     IN  HSPFILEQ            FileQueue,
  2164.     IN  DWORD               Flags,
  2165.     IN  HWND                Window,            OPTIONAL
  2166.     IN  PSP_FILE_CALLBACK_W CallbackRoutine,   OPTIONAL
  2167.     IN  PVOID               CallbackContext,   OPTIONAL
  2168.     OUT PDWORD              Result
  2169.     );
  2170. #ifdef UNICODE
  2171. #define SetupScanFileQueue SetupScanFileQueueW
  2172. #else
  2173. #define SetupScanFileQueue SetupScanFileQueueA
  2174. #endif
  2175. //
  2176. // Define flags for SetupScanFileQueue.
  2177. //
  2178. #define SPQ_SCAN_FILE_PRESENCE  0x00000001
  2179. #define SPQ_SCAN_FILE_VALIDITY  0x00000002
  2180. #define SPQ_SCAN_USE_CALLBACK   0x00000004
  2181. #define SPQ_SCAN_INFORM_USER    0x00000010
  2182. //
  2183. // Define flags used with Param2 for SPFILENOTIFY_QUEUESCAN
  2184. //
  2185. #define SPQ_DELAYED_COPY        0x00000001  // file was in use; registered for delayed copy
  2186. //
  2187. // Define OEM Source Type values for use in SetupCopyOEMInf.
  2188. //
  2189. #define SPOST_NONE  0
  2190. #define SPOST_PATH  1
  2191. #define SPOST_URL   2
  2192. #define SPOST_MAX   3
  2193. WINSETUPAPI
  2194. BOOL
  2195. WINAPI
  2196. SetupCopyOEMInfA(
  2197.     IN  PCSTR   SourceInfFileName,
  2198.     IN  PCSTR   OEMSourceMediaLocation,         OPTIONAL
  2199.     IN  DWORD   OEMSourceMediaType,
  2200.     IN  DWORD   CopyStyle,
  2201.     OUT PSTR    DestinationInfFileName,         OPTIONAL
  2202.     IN  DWORD   DestinationInfFileNameSize,
  2203.     OUT PDWORD  RequiredSize,                   OPTIONAL
  2204.     OUT PSTR   *DestinationInfFileNameComponent OPTIONAL
  2205.     );
  2206. WINSETUPAPI
  2207. BOOL
  2208. WINAPI
  2209. SetupCopyOEMInfW(
  2210.     IN  PCWSTR  SourceInfFileName,
  2211.     IN  PCWSTR  OEMSourceMediaLocation,         OPTIONAL
  2212.     IN  DWORD   OEMSourceMediaType,
  2213.     IN  DWORD   CopyStyle,
  2214.     OUT PWSTR   DestinationInfFileName,         OPTIONAL
  2215.     IN  DWORD   DestinationInfFileNameSize,
  2216.     OUT PDWORD  RequiredSize,                   OPTIONAL
  2217.     OUT PWSTR  *DestinationInfFileNameComponent OPTIONAL
  2218.     );
  2219. #ifdef UNICODE
  2220. #define SetupCopyOEMInf SetupCopyOEMInfW
  2221. #else
  2222. #define SetupCopyOEMInf SetupCopyOEMInfA
  2223. #endif
  2224. //
  2225. // Disk space list APIs
  2226. //
  2227. WINSETUPAPI
  2228. HDSKSPC
  2229. WINAPI
  2230. SetupCreateDiskSpaceListA(
  2231.     IN PVOID Reserved1,
  2232.     IN DWORD Reserved2,
  2233.     IN UINT  Flags
  2234.     );
  2235. WINSETUPAPI
  2236. HDSKSPC
  2237. WINAPI
  2238. SetupCreateDiskSpaceListW(
  2239.     IN PVOID Reserved1,
  2240.     IN DWORD Reserved2,
  2241.     IN UINT  Flags
  2242.     );
  2243. #ifdef UNICODE
  2244. #define SetupCreateDiskSpaceList SetupCreateDiskSpaceListW
  2245. #else
  2246. #define SetupCreateDiskSpaceList SetupCreateDiskSpaceListA
  2247. #endif
  2248. //
  2249. // Flags for SetupCreateDiskSpaceList
  2250. //
  2251. #define SPDSL_IGNORE_DISK              0x00000001  // ignore deletes and on-disk files in copies
  2252. #define SPDSL_DISALLOW_NEGATIVE_ADJUST 0x00000002
  2253. WINSETUPAPI
  2254. HDSKSPC
  2255. WINAPI
  2256. SetupDuplicateDiskSpaceListA(
  2257.     IN HDSKSPC DiskSpace,
  2258.     IN PVOID   Reserved1,
  2259.     IN DWORD   Reserved2,
  2260.     IN UINT    Flags
  2261.     );
  2262. WINSETUPAPI
  2263. HDSKSPC