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

2706 lines
118 KiB

  1. //**********************************************************************
  2. //
  3. // SETUPX.H
  4. //
  5. // Copyright (c) 1993 - Microsoft Corp.
  6. // All rights reserved.
  7. // Microsoft Confidential
  8. //
  9. // Public include file for Chicago Setup services.
  10. //
  11. // 12/1/93 DONALDM Added LPCLASS_INFO, and function protos for ;Internal
  12. // exports in SETUP4.DLL ;Internal
  13. // 12/4/943 DONALDM Moved SHELL.H include and Chicago specific ;Internal
  14. // helper functions to SETUP4.H ;Internal
  15. // 1/11/94 DONALDM Added members to DEVICE_INFO to better handle ;Internal
  16. // ClassInstaller load/unload. ;Internal
  17. // 1/11/94 DONALDM Added some new DIF_ messages for Net guys. ;Internal
  18. // 2/25/94 DONALDM Fixed a bug with the DIREG_ flags ;Internal
  19. //**********************************************************************
  20. #ifndef SETUPX_INC
  21. #define SETUPX_INC 1 // SETUPX.H signature
  22. /***************************************************************************/
  23. // setup PropertySheet support
  24. // NOTE: Always include PRST.H because it is needed later for Class Installer
  25. // stuff, and optionally define the SU prop sheet stuff.
  26. /***************************************************************************/
  27. #include <prsht.h>
  28. #ifndef NOPRSHT
  29. HPROPSHEETPAGE WINAPI SUCreatePropertySheetPage(LPCPROPSHEETPAGE lppsp);
  30. BOOL WINAPI SUDestroyPropertySheetPage(HPROPSHEETPAGE hPage);
  31. int WINAPI SUPropertySheet(LPCPROPSHEETHEADER lppsh);
  32. #endif // NOPRSHT
  33. typedef UINT RETERR; // Return Error code type.
  34. #define OK 0 // success error code
  35. #define IP_ERROR (100) // Inf parsing
  36. #define TP_ERROR (200) // Text processing module
  37. #define VCP_ERROR (300) // Virtual copy module
  38. #define GEN_ERROR (400) // Generic Installer
  39. #define DI_ERROR (500) // Device Installer
  40. // err2ids mappings
  41. enum ERR_MAPPINGS {
  42. E2I_VCPM, // Maps VCPM to strings
  43. E2I_SETUPX, // Maps setupx returns to strings
  44. E2I_SETUPX_MODULE, // Maps setupx returns to appropriate module
  45. E2I_DOS_SOLUTION, // Maps DOS Extended errors to solutions
  46. E2I_DOS_REASON, // Maps DOS extended errors to strings.
  47. E2I_DOS_MEDIA, // Maps DOS extended errors to media icon.
  48. };
  49. #ifndef NOVCP
  50. /***************************************************************************/
  51. //
  52. // Logical Disk ID definitions
  53. //
  54. /***************************************************************************/
  55. // DECLARE_HANDLE(VHSTR); /* VHSTR = VirtCopy Handle to STRing */
  56. typedef UINT VHSTR; /* VirtCopy Handle to String */
  57. VHSTR WINAPI vsmStringAdd(LPCSTR lpszName);
  58. int WINAPI vsmStringDelete(VHSTR vhstr);
  59. VHSTR WINAPI vsmStringFind(LPCSTR lpszName);
  60. int WINAPI vsmGetStringName(VHSTR vhstr, LPSTR lpszBuffer, int cbBuffer);
  61. int WINAPI vsmStringCompare(VHSTR vhstrA, VHSTR vhstrB);
  62. LPCSTR WINAPI vsmGetStringRawName(VHSTR vhstr);
  63. void WINAPI vsmStringCompact(void);
  64. typedef UINT LOGDISKID; /* ldid */
  65. // Logical Disk Descriptor: Structure which describes the physical attributes
  66. // of a logical disk. Every logical disk is assigned a logical disk
  67. // identifier (LDID), and is described by a logical disk descriptor (LDD).
  68. //
  69. // The cbSize structure member must always be set to sizeof(LOGDISKDESC_S),
  70. // but all other unused structure members should be NULL or 0. No validation
  71. // is performed on the size of string arrays; all string pointers, if
  72. // non-NULL and they are to receive a string, must point at string arrays
  73. // whose sizes are as follows:
  74. // sizeof( szPath ) = MAX_PATH_LEN
  75. // sizeof( szVolLabel) = MAX_FILENAME_LEN
  76. // sizeof( szName ) = MAX_STRING_LEN
  77. #define MAX_PATH_LEN 260 // Max. path length.
  78. #define MAX_FILENAME_LEN 20 // Max. filename length. ( > sizeof( "x:\\12345678.123" )
  79. typedef struct _LOGDISKDESC_S { /* ldd */
  80. WORD cbSize; // Size of this structure (bytes)
  81. LOGDISKID ldid; // Logical Disk ID.
  82. LPSTR pszPath; // Ptr. to associated Path string.
  83. LPSTR pszVolLabel; // Ptr. to Volume Label string.
  84. LPSTR pszDiskName; // Ptr. to Disk Name string.
  85. WORD wVolTime; // Volume label modification time.
  86. WORD wVolDate; // Volume label modification date.
  87. DWORD dwSerNum; // Disk serial number.
  88. WORD wFlags; // Flags.
  89. } LOGDISKDESC_S, FAR *LPLOGDISKDESC;
  90. // Range for pre-defined LDIDs.
  91. #define LDID_PREDEF_START 0x0001 // Start of range
  92. #define LDID_PREDEF_END 0x7FFF // End of range
  93. // Range for registry-assigned LDIDs
  94. #define LDID_VAR_START 0x7000
  95. #define LDID_VAR_END 0x7FFF
  96. // Range for dynamically-assigned LDIDs.
  97. #define LDID_ASSIGN_START 0x8000 // Start of range
  98. #define LDID_ASSIGN_END 0xBFFF // End of range
  99. // Pre-defined Logical Disk Identifiers (LDID).
  100. //
  101. #define LDID_NULL 0 // Null (undefined) LDID.
  102. #define LDID_ABSOLUTE ((UINT)-1) // Absolute path
  103. // source path of windows install, this is typically A:\ or a net drive
  104. #define LDID_SRCPATH 1 // source of instilation
  105. // temporary setup directory used by setup, this is only valid durring
  106. // regular install and contains the INF and other binary files. May be
  107. // read-only location.
  108. #define LDID_SETUPTEMP 2 // temporary setup dir for install
  109. // path to uninstall location, this is where we backup files that will
  110. // be overwritten
  111. #define LDID_UNINSTALL 3 // uninstall (backup) dir.
  112. // backup path for the copy engine, this should not be used
  113. #define LDID_BACKUP 4 // ISSUE-2002/01/16-roelfc: backup dir for the copy engine, not used
  114. // temporary setup directory used by setup, this is only valid durring
  115. // regular install and is guarenteed to be a read/write location for
  116. // scratch space.
  117. #define LDID_SETUPSCRATCH 5 // temporary setup dir for scratch space.
  118. // windows directory, this is the destinatio of the insallation
  119. #define LDID_WIN 10 // destination Windows dir (just user files).
  120. #define LDID_SYS 11 // destination Windows System dir.
  121. #define LDID_IOS 12 // destination Windows Iosubsys dir.
  122. #define LDID_CMD 13 // destination Windows Command (DOS) dir.
  123. #define LDID_CPL 14 // destination Windows Control Panel dir.
  124. #define LDID_PRINT 15 // destination Windows Printer dir.
  125. #define LDID_MAIL 16 // destination Mail dir.
  126. #define LDID_INF 17 // destination Windows *.INF dir.
  127. #define LDID_HELP 18 // destination Windows Help dir.
  128. #define LDID_WINADMIN 19 // admin stuff.
  129. #define LDID_FONTS 20 // destination Windows Font dir.
  130. #define LDID_VIEWERS 21 // destination Windows Viewers dir.
  131. #define LDID_VMM32 22 // destination Windows VMM32 dir.
  132. #define LDID_COLOR 23 // destination Windows Color dir.
  133. #define LDID_APPS 24 // Applications folder location.
  134. // Shared dirs for net install.
  135. #define LDID_SHARED 25 // Bulk of windows files.
  136. #define LDID_WINBOOT 26 // guarenteed boot device for windows.
  137. #define LDID_MACHINE 27 // machine specific files.
  138. #define LDID_HOST_WINBOOT 28
  139. // boot and old win and dos dirs.
  140. #define LDID_BOOT 30 // Root dir of boot drive
  141. #define LDID_BOOT_HOST 31 // Root dir of boot drive host
  142. #define LDID_OLD_WINBOOT 32 // Subdir off of Root (optional)
  143. #define LDID_OLD_WIN 33 // old windows directory (if it exists)
  144. #define LDID_OLD_DOS 34 // old dos directory (if it exists)
  145. #define LDID_OLD_NET 35 // old network root directory, only valid during
  146. // network GenUpgrade
  147. #define LDID_MOUSE 36 // path to MOUSE env. variable if set or same as LDID_WIN
  148. // only valid after mouse class installer.
  149. #define LDID_PATCH 37 // path to Patch related files
  150. #define LDID_WIN3XIE 38 // install path of Internet Explorer on Windows 3.1
  151. // Only defined during system install
  152. #define LDID_UPDATEDFILES 40 //only defined during maint. mode
  153. // Convert Ascii drive letter to Integer drive number ('A'=1, 'B'=2, ...).
  154. #define DriveAtoI( chDrv ) ((int)(chDrv & 31))
  155. // Convert Integer drive number to Ascii drive letter (1='A', 2='B', ...).
  156. #define DriveItoA( iDrv ) ((char) (iDrv - 1 + 'A'))
  157. // ISSUE-2002/01/16-roelfc: change the names of these
  158. RETERR WINAPI CtlSetLdd ( LPLOGDISKDESC );
  159. RETERR WINAPI CtlGetLdd ( LPLOGDISKDESC );
  160. RETERR WINAPI CtlFindLdd ( LPLOGDISKDESC );
  161. RETERR WINAPI CtlAddLdd ( LPLOGDISKDESC );
  162. RETERR WINAPI CtlDelLdd ( LOGDISKID );
  163. RETERR WINAPI CtlGetLddPath ( LOGDISKID, LPSTR );
  164. RETERR WINAPI CtlSetLddPath ( LOGDISKID, LPSTR );
  165. // Constants that determine ranking of device compatibility
  166. #define FIRST_CID_RANK_FROM_INF 1000
  167. #define FIRST_CID_RANK_FROM_DEVICE 2000
  168. #define BAD_DRIVER_RANK 4000
  169. /***************************************************************************/
  170. //
  171. // Virtual File Copy definitions
  172. //
  173. /***************************************************************************/
  174. typedef DWORD LPEXPANDVTBL; /* ISSUE-2002/01/16-roelfc -- clean this up */
  175. enum _ERR_VCP
  176. {
  177. ERR_VCP_IOFAIL = (VCP_ERROR + 1), // File I/O failure
  178. ERR_VCP_STRINGTOOLONG, // String length limit exceeded
  179. ERR_VCP_NOMEM, // Insufficient memory to comply
  180. ERR_VCP_QUEUEFULL, // Trying to add a node to a maxed-out queue
  181. ERR_VCP_NOVHSTR, // No string handles available
  182. ERR_VCP_OVERFLOW, // Reference count would overflow
  183. ERR_VCP_BADARG, // Invalid argument to function
  184. ERR_VCP_UNINIT, // String library not initialized
  185. ERR_VCP_NOTFOUND , // String not found in string table
  186. ERR_VCP_BUSY, // Can't do that now
  187. ERR_VCP_INTERRUPTED, // User interrupted operation
  188. ERR_VCP_BADDEST, // Invalid destination directory
  189. ERR_VCP_SKIPPED, // User skipped operation
  190. ERR_VCP_IO, // Hardware error encountered
  191. ERR_VCP_LOCKED, // List is locked
  192. ERR_VCP_WRONGDISK, // The wrong disk is in the drive
  193. ERR_VCP_CHANGEMODE, //
  194. ERR_VCP_LDDINVALID, // Logical Disk ID Invalid.
  195. ERR_VCP_LDDFIND, // Logical Disk ID not found.
  196. ERR_VCP_LDDUNINIT, // Logical Disk Descriptor Uninitialized.
  197. ERR_VCP_LDDPATH_INVALID,
  198. ERR_VCP_NOEXPANSION, // Failed to load expansion dll
  199. ERR_VCP_NOTOPEN, // Copy session not open
  200. ERR_VCP_NO_DIGITAL_SIGNATURE_CATALOG, // Catalog is not digitally signed
  201. ERR_VCP_NO_DIGITAL_SIGNATURE_FILE, // A file is not digitally signed
  202. ERR_VCP_FAILED_PRESERVE_ENUM, // Error occured in enumerating the file queue for files to preserve
  203. };
  204. /*****************************************************************************
  205. * Structures
  206. *****************************************************************************/
  207. /*---------------------------------------------------------------------------*
  208. * VCPPROGRESS
  209. *---------------------------------------------------------------------------*/
  210. typedef struct tagVCPPROGRESS { /* prg */
  211. DWORD dwSoFar; /* Number of units copied so far */
  212. DWORD dwTotal; /* Number of units to copy */
  213. } VCPPROGRESS, FAR *LPVCPPROGRESS;
  214. /*---------------------------------------------------------------------------*
  215. * VCPDISKINFO
  216. *---------------------------------------------------------------------------*/
  217. /* ISSUE-2002/01/16-roelfc: ;Internal
  218. * I currently don't use wVolumeTime, wVolumeDate or ;Internal
  219. * dwSerialNumber. We may not want to use dwSerialNumber because ;Internal
  220. * it means that any disk other than the factory originals will be;Internal
  221. * suspected of being tampered with, since the serial number ;Internal
  222. * won't match. Similar with the time/date stamp on the ;Internal
  223. * volume label. Or maybe that's what we want to do. ;Internal
  224. */ /* ;Internal */
  225. /* ;Internal */
  226. typedef struct tagVCPDISKINFO {
  227. WORD cbSize; /* Size of this structure in bytes */
  228. LOGDISKID ldid; /* Logical disk ID */
  229. VHSTR vhstrRoot; /* Location of root directory */
  230. VHSTR vhstrVolumeLabel;/* Volume label */
  231. VHSTR vhstrDiskName; // Printed name on the disk.
  232. WORD wVolumeTime; /* Volume label modification time */
  233. WORD wVolumeDate; /* Volume label modification date */
  234. DWORD dwSerialNumber; /* Disk serial number */
  235. WORD fl; /* Flags */
  236. LPARAM lparamRef; /* Reference data for client */
  237. VCPPROGRESS prgFileRead; /* Progress info */
  238. VCPPROGRESS prgByteRead;
  239. VCPPROGRESS prgFileWrite;
  240. VCPPROGRESS prgByteWrite;
  241. } VCPDISKINFO, FAR *LPVCPDISKINFO;
  242. #define VDIFL_VALID 0x0001 /* Fields are valid from a prev. call */
  243. #define VDIFL_EXISTS 0x0002 /* Disk exists; do not format */
  244. RETERR WINAPI DiskInfoFromLdid(LOGDISKID ldid, LPVCPDISKINFO lpdi);
  245. /*---------------------------------------------------------------------------*
  246. * VCPFILESPEC
  247. *---------------------------------------------------------------------------*/
  248. typedef struct tagVCPFILESPEC { /* vfs */
  249. LOGDISKID ldid; /* Logical disk */
  250. VHSTR vhstrDir; /* Directory withing logical disk */
  251. VHSTR vhstrFileName; /* Filename within directory */
  252. } VCPFILESPEC, FAR *LPVCPFILESPEC;
  253. /*---------------------------------------------------------------------------*
  254. * VCPFATTR
  255. *---------------------------------------------------------------------------*/
  256. /*
  257. * ISSUE-2002/01/16-roelfc -- explain diffce between llenIn and llenOut wrt compression.
  258. */
  259. typedef struct tagVCPFATTR {
  260. UINT uiMDate; /* Modification date */
  261. UINT uiMTime; /* Modification time */
  262. UINT uiADate; /* Access date */
  263. UINT uiATime; /* Access time */
  264. UINT uiAttr; /* File attribute bits */
  265. DWORD llenIn; /* Original file length */
  266. DWORD llenOut; /* Final file length */
  267. /* (after decompression) */
  268. } VCPFATTR, FAR *LPVCPFATTR;
  269. typedef struct tagVCPFILESTAT
  270. {
  271. UINT uDate;
  272. UINT uTime;
  273. DWORD dwSize;
  274. } VCPFILESTAT, FAR *LPVCPFILESTAT;
  275. /*---------------------------------------------------------------------------*
  276. * VIRTNODEEX
  277. *---------------------------------------------------------------------------*/
  278. typedef struct tagVIRTNODEEX
  279. { /* vnex */
  280. HFILE hFileSrc;
  281. HFILE hFileDst;
  282. VCPFATTR fAttr;
  283. WORD dosError; // The first/last error encountered
  284. VHSTR vhstrFileName; // The original destination name.
  285. WPARAM vcpm; // The message that was being processed.
  286. } VIRTNODEEX, FAR *LPCVIRTNODEEX, FAR *LPVIRTNODEEX ;
  287. /*---------------------------------------------------------------------------*
  288. * VIRTNODE
  289. *---------------------------------------------------------------------------*/
  290. /* WARNING! ;Internal
  291. * All fields through but not including ;Internal
  292. * fl are memcmp'd to determine if we have a duplicate copy ;Internal
  293. * request. ;Internal
  294. * ;Internal
  295. * Do not insert fields before fl unless you want them to be ;Internal
  296. * compared; conversely, if you add a new field that needs to ;Internal
  297. * be compared, make sure it goes before fl. ;Internal
  298. * ;Internal
  299. * And don't change any of the fields once Windows 4.0 ships. ;Internal
  300. * ;Internal
  301. * The vFileStat and vhstrCatalogFile fields were added at the ;Internal
  302. * end of the structure after Windows 95 shipped to support driver;Internal
  303. * cetification. Offsets of pre-Win95 fields remain the same. ;Internal
  304. * vFileStat duplicates information in lpvnex, but lpvnex was left;Internal
  305. * alone for backcompatibility's sake. ;Internal
  306. * ;Internal
  307. */ /* ;Internal */
  308. /* ;Internal */
  309. typedef struct tagVIRTNODE { /* vn */
  310. WORD cbSize;
  311. VCPFILESPEC vfsSrc;
  312. VCPFILESPEC vfsDst;
  313. WORD fl;
  314. LPARAM lParam;
  315. LPEXPANDVTBL lpExpandVtbl;
  316. LPVIRTNODEEX lpvnex;
  317. VHSTR vhstrDstFinalName;
  318. VCPFILESTAT vFileStat;
  319. } VIRTNODE, FAR *LPCVIRTNODE, FAR *LPVIRTNODE ;
  320. /*---------------------------------------------------------------------------*
  321. * VCPDESTINFO
  322. *---------------------------------------------------------------------------*/
  323. typedef struct tagVCPDESTINFO { /* destinfo */
  324. WORD flDevAttr; /* Device attributes */
  325. LONG cbCapacity; /* Disk capacity */
  326. WORD cbCluster; /* Bytes per cluster */
  327. WORD cRootDir; /* Size of root directory */
  328. } VCPDESTINFO, FAR *LPVCPDESTINFO;
  329. #define DIFL_FIXED 0x0001 /* Nonremoveable media */
  330. #define DIFL_CHANGELINE 0x0002 /* Change line support */
  331. // Now also used by the virtnode as we dont have copy nodes any more.
  332. // #define CNFL_BACKUP 0x0001 /* This is a backup node */
  333. #define CNFL_DELETEONFAILURE 0x0002 /* Dest should be deleted on failure */
  334. #define CNFL_RENAMEONSUCCESS 0x0004 /* Dest needs to be renamed */
  335. #define CNFL_CONTINUATION 0x0008 /* Dest is continued onto difft disk */
  336. #define CNFL_SKIPPED 0x0010 /* User asked to skip file */
  337. #define CNFL_IGNOREERRORS 0x0020 // An error has occured on this file already
  338. #define CNFL_RETRYFILE 0x0040 // Retry the file (error ocurred)
  339. #define CNFL_COPIED 0x0080 // Node has already been copied.
  340. // ISSUE-2002/01/16-roelfc: verify the use and usefullness of these flags
  341. // #define VNFL_UNIQUE 0x0000 /* Default */
  342. #define VNFL_MULTIPLEOK 0x0100 /* Do not search PATH for duplicates */
  343. #define VNFL_DESTROYOLD 0x0200 /* Do not back up files */
  344. // #define VNFL_NOW 0x0400 /* Use by vcp Flush */
  345. // To deternime what kind of node it is.
  346. #define VNFL_COPY 0x0000 // A simple copy node.
  347. #define VNFL_DELETE 0x0800 // A delete node
  348. #define VNFL_RENAME 0x1000 // A rename node
  349. #define VNFL_NODE_TYPE ( VNFL_RENAME|VNFL_DELETE|VNFL_COPY )
  350. /* Read-only flag bits */
  351. #define VNFL_CREATED 0x2000 /* VCPM_NODECREATE has been sent */
  352. #define VNFL_REJECTED 0x4000 /* Node has been rejected */
  353. #define VNFL_DEVICEINSTALLER 0x8000 /* Node was added by the Device Installer */
  354. #define VNFL_VALIDVQCFLAGS 0xff00 /* ;Internal */
  355. /*---------------------------------------------------------------------------*
  356. * VCPSTATUS
  357. *---------------------------------------------------------------------------*/
  358. typedef struct tagVCPSTATUS { /* vstat */
  359. WORD cbSize; /* Size of this structure */
  360. VCPPROGRESS prgDiskRead;
  361. VCPPROGRESS prgFileRead;
  362. VCPPROGRESS prgByteRead;
  363. VCPPROGRESS prgDiskWrite;
  364. VCPPROGRESS prgFileWrite;
  365. VCPPROGRESS prgByteWrite;
  366. LPVCPDISKINFO lpvdiIn; /* Current input disk */
  367. LPVCPDISKINFO lpvdiOut; /* Current output disk */
  368. LPVIRTNODE lpvn; /* Current file */
  369. } VCPSTATUS, FAR *LPVCPSTATUS;
  370. /*---------------------------------------------------------------------------*
  371. * VCPVERCONFLICT
  372. *---------------------------------------------------------------------------*/
  373. typedef struct tagVCPVERCONFLICT {
  374. LPCSTR lpszOldFileName;
  375. LPCSTR lpszNewFileName;
  376. DWORD dwConflictType; /* Same values as VerInstallFiles */
  377. LPVOID lpvinfoOld; /* Version information resources */
  378. LPVOID lpvinfoNew;
  379. WORD wAttribOld; /* File attributes for original */
  380. LPARAM lparamRef; /* Reference data for callback */
  381. } VCPVERCONFLICT, FAR *LPVCPVERCONFLICT;
  382. /*****************************************************************************
  383. * Callback functions
  384. *****************************************************************************/
  385. typedef LRESULT (CALLBACK *VIFPROC)(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  386. LRESULT CALLBACK vcpDefCallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  387. // callback for default UI.
  388. // lparamRef --> a VCPUIINFO structure
  389. LRESULT CALLBACK vcpUICallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  390. /*---------------------------------------------------------------------------*
  391. * VCPUIINFO
  392. *
  393. * This structure is passed in as the lparamRef of vcpUICallbackProc.
  394. *
  395. * on using vcpUICallbackProc:
  396. * - to use, have vcpUICallbackProc as the callback for vcpOpen with
  397. * an appropriately filled in VCPUIINFO structure as the lparamRef.
  398. *
  399. * - based on flags, hwndProgress is created and maintained
  400. * - lpfnStatCallback is called with only status messages
  401. * returning VCPM_ABORT indicates that the copy should be aborted
  402. * - if hwndProgress is non-NULL, the control with idProgress will
  403. * receive progress gauge messages as appropriate
  404. *
  405. *---------------------------------------------------------------------------*/
  406. #define VCPUI_CREATEPROGRESS 0x0001 // callback should create and manage progress gauge dialog
  407. #define VCPUI_NOBROWSE 0x0002 // no browse button in InsertDisk
  408. #define VCPUI_RENAMEREQUIRED 0x0004 // as a result of a file being in use at copy, reboot required
  409. #define VCPUI_BACKUPVER 0x0008 // backup version conflicts instead of displaying UI
  410. typedef struct {
  411. UINT flags;
  412. HWND hwndParent; // window of parent
  413. HWND hwndProgress; // window to get progress updates (nonzero ids)
  414. UINT idPGauge; // id for progress gauge
  415. VIFPROC lpfnStatCallback; // callback for status info (or NULL)
  416. LPARAM lUserData; // caller definable data
  417. LOGDISKID ldidCurrent; // reserved. do not touch.
  418. } VCPUIINFO, FAR *LPVCPUIINFO;
  419. /******************************************************************************
  420. * Callback notification codes
  421. *****************************************************************************/
  422. /* ISSUE-2002/01/16-roelfc -- VCPN_ABORT should match VCPERROR_INTERRUPTED */
  423. #define VCPN_OK 0 /* All is hunky-dory */
  424. #define VCPN_PROCEED 0 /* The same as VCPN_OK */
  425. #define VCPN_ABORT (-1) /* Cancel current operation */
  426. #define VCPN_RETRY (-2) /* Retry current operation */
  427. #define VCPN_IGNORE (-3) /* Ignore error and continue */
  428. #define VCPN_SKIP (-4) /* Skip this file and continue */
  429. #define VCPN_FORCE (-5) /* Force an action */
  430. #define VCPN_DEFER (-6) /* Save the action for later */
  431. #define VCPN_FAIL (-7) /* Return failure back to caller */
  432. #define VCPN_RETRYFILE (-8) // An error ocurred during file copy, do it again.
  433. /*****************************************************************************
  434. * Callback message numbers
  435. *****************************************************************************/
  436. #define VCPM_CLASSOF(uMsg) HIBYTE(uMsg)
  437. #define VCPM_TYPEOF(uMsg) (0x00FF & (uMsg)) // LOBYTE(uMsg)
  438. /*---------------------------------------------------------------------------*
  439. * ERRORs
  440. *---------------------------------------------------------------------------*/
  441. #define VCPM_ERRORCLASSDELTA 0x80
  442. #define VCPM_ERRORDELTA 0x8000 /* Where the errors go */
  443. /*---------------------------------------------------------------------------*
  444. * Disk information callbacks
  445. *---------------------------------------------------------------------------*/
  446. #define VCPM_DISKCLASS 0x01
  447. #define VCPM_DISKFIRST 0x0100
  448. #define VCPM_DISKLAST 0x01FF
  449. enum tagVCPM_DISK {
  450. VCPM_DISKCREATEINFO = VCPM_DISKFIRST,
  451. VCPM_DISKGETINFO,
  452. VCPM_DISKDESTROYINFO,
  453. VCPM_DISKPREPINFO,
  454. VCPM_DISKENSURE,
  455. VCPM_DISKPROMPT,
  456. VCPM_DISKFORMATBEGIN,
  457. VCPM_DISKFORMATTING,
  458. VCPM_DISKFORMATEND,
  459. /* Remaining messages reserved for future use */
  460. };
  461. /*---------------------------------------------------------------------------*
  462. * File copy callbacks
  463. *---------------------------------------------------------------------------*/
  464. // ISSUE-2002/01/16-roelfc: this needs to be merged back with other internal errors
  465. #define VCPERROR_IO (VCP_ERROR - ERR_VCP_IO) /* Hardware error encountered */
  466. #define VCPM_FILEINCLASS 0x02
  467. #define VCPM_FILEOUTCLASS 0x03
  468. #define VCPM_FILEFIRSTIN 0x0200
  469. #define VCPM_FILEFIRSTOUT 0x0300
  470. #define VCPM_FILELAST 0x03FF
  471. enum tagVCPM_FILE {
  472. VCPM_FILEOPENIN = VCPM_FILEFIRSTIN,
  473. VCPM_FILEGETFATTR,
  474. VCPM_FILECLOSEIN,
  475. VCPM_FILECOPY,
  476. VCPM_FILENEEDED,
  477. VCPM_FILEOPENOUT = VCPM_FILEFIRSTOUT,
  478. VCPM_FILESETFATTR,
  479. VCPM_FILECLOSEOUT,
  480. VCPM_FILEFINALIZE,
  481. VCPM_FILEDELETE,
  482. VCPM_FILERENAME,
  483. /* Remaining messages reserved for future use */
  484. };
  485. /*---------------------------------------------------------------------------*
  486. * VIRTNODE callbacks
  487. *---------------------------------------------------------------------------*/
  488. #define VCPM_NODECLASS 0x04
  489. #define VCPM_NODEFIRST 0x0400
  490. #define VCPM_NODELAST 0x04FF
  491. enum tagVCPM_NODE {
  492. VCPM_NODECREATE = VCPM_NODEFIRST,
  493. VCPM_NODEACCEPT,
  494. VCPM_NODEREJECT,
  495. VCPM_NODEDESTROY,
  496. VCPM_NODECHANGEDESTDIR,
  497. VCPM_NODECOMPARE,
  498. /* Remaining messages reserved for future use */
  499. };
  500. /*---------------------------------------------------------------------------*
  501. * TALLY callbacks
  502. *---------------------------------------------------------------------------*/
  503. #define VCPM_TALLYCLASS 0x05
  504. #define VCPM_TALLYFIRST 0x0500
  505. #define VCPM_TALLYLAST 0x05FF
  506. enum tagVCPM_TALLY {
  507. VCPM_TALLYSTART = VCPM_TALLYFIRST,
  508. VCPM_TALLYEND,
  509. VCPM_TALLYFILE,
  510. VCPM_TALLYDISK,
  511. /* Remaining messages reserved for future use */
  512. };
  513. /*---------------------------------------------------------------------------*
  514. * VER callbacks
  515. *---------------------------------------------------------------------------*/
  516. #define VCPM_VERCLASS 0x06
  517. #define VCPM_VERFIRST 0x0600
  518. #define VCPM_VERLAST 0x06FF
  519. enum tagVCPM_VER {
  520. VCPM_VERCHECK = VCPM_VERFIRST,
  521. VCPM_VERCHECKDONE,
  522. VCPM_VERRESOLVECONFLICT,
  523. /* Remaining messages reserved for future use */
  524. };
  525. /*---------------------------------------------------------------------------*
  526. * VSTAT callbacks
  527. *---------------------------------------------------------------------------*/
  528. #define VCPM_VSTATCLASS 0x07
  529. #define VCPM_VSTATFIRST 0x0700
  530. #define VCPM_VSTATLAST 0x07FF
  531. enum tagVCPM_VSTAT {
  532. VCPM_VSTATSTART = VCPM_VSTATFIRST,
  533. VCPM_VSTATEND,
  534. VCPM_VSTATREAD,
  535. VCPM_VSTATWRITE,
  536. VCPM_VSTATNEWDISK,
  537. VCPM_VSTATCLOSESTART, // Start of VCP close
  538. VCPM_VSTATCLOSEEND, // upon leaving VCP close
  539. VCPM_VSTATBACKUPSTART, // Backup is beginning
  540. VCPM_VSTATBACKUPEND, // Backup is finished
  541. VCPM_VSTATRENAMESTART, // Rename phase start/end
  542. VCPM_VSTATRENAMEEND,
  543. VCPM_VSTATCOPYSTART, // Acutal copy phase
  544. VCPM_VSTATCOPYEND,
  545. VCPM_VSTATDELETESTART, // Delete phase
  546. VCPM_VSTATDELETEEND,
  547. VCPM_VSTATPATHCHECKSTART, // Check for valid paths
  548. VCPM_VSTATPATHCHECKEND,
  549. VCPM_VSTATCERTIFYSTART, // Certify phase
  550. VCPM_VSTATCERTIFYEND,
  551. VCPM_VSTATUSERABORT, // User wants to quit.
  552. VCPM_VSTATYIELD, // Do a yield.
  553. /* Remaining messages reserved for future use */
  554. };
  555. /*---------------------------------------------------------------------------*
  556. * Destination info callbacks
  557. *---------------------------------------------------------------------------*/
  558. /* ISSUE-2002/01/16-roelfc -- find a reasonable message range for this */
  559. #define VCPM_PATHCLASS 0x08
  560. #define VCPM_PATHFIRST 0x0800
  561. #define VCPM_PATHLAST 0x08FF
  562. enum tagVCPM_PATH{
  563. VCPM_BUILDPATH = VCPM_PATHFIRST,
  564. VCPM_UNIQUEPATH,
  565. VCPM_CHECKPATH,
  566. };
  567. // #define VCPM_BUILDPATH 0x83
  568. /*--------------------------------------------------------------------------*
  569. * Patch processing callbacks
  570. *---------------------------------------------------------------------------*/
  571. /* ISSUE-2002/01/16-roelfc -- find a reasonable message range for this */
  572. #define VCPM_PATCHCLASS 0x09
  573. #define VCPM_PATCHFIRST 0x0900
  574. #define VCPM_PATCHLAST 0x09FF
  575. // filepatchbefore -- try to patch before the copy action
  576. // filepatchafter -- try to patch after the copy action
  577. enum tagVCPM_PATCH{
  578. VCPM_FILEPATCHBEFORECPY = VCPM_PATCHFIRST,
  579. VCPM_FILEPATCHAFTERCPY,
  580. VCPM_FILEPATCHINFOPEN,
  581. VCPM_FILEPATCHINFCLOSE,
  582. };
  583. /*--------------------------------------------------------------------------*
  584. * Certificate processing callbacks
  585. *---------------------------------------------------------------------------*/
  586. /* ISSUE-2002/01/16-roelfc -- find a reasonable message range for this */
  587. #define VCPM_CERTCLASS 0x0A
  588. #define VCPM_CERTFIRST 0x0A00
  589. #define VCPM_CERTLAST 0x0AFF
  590. // filepatchbefore -- try to patch before the copy action
  591. // filepatchafter -- try to patch after the copy action
  592. enum tagVCPM_CERT{
  593. VCPM_FILECERTIFY = VCPM_CERTFIRST,
  594. VCPM_FILECERTIFYWARN,
  595. };
  596. /*****************************************************************************/
  597. void WINAPI VcpAddMRUPath( LPCSTR lpszPath );
  598. #define SZ_INSTALL_LOCATIONS "InstallLocationsMRU"
  599. RETERR WINAPI VcpOpen(VIFPROC vifproc, LPARAM lparamMsgRef);
  600. RETERR WINAPI VcpClose(WORD fl, LPCSTR lpszBackupDest);
  601. RETERR WINAPI VcpFlush(WORD fl, LPCSTR lpszBackupDest);
  602. #define VCPFL_ABANDON 0x0000 /* Abandon all pending file copies */
  603. #define VCPFL_BACKUP 0x0001 /* Perform backup */
  604. #define VCPFL_COPY 0x0002 /* Copy files */
  605. #define VCPFL_BACKUPANDCOPY (VCPFL_BACKUP | VCPFL_COPY)
  606. #define VCPFL_INSPECIFIEDORDER 0x0004 /* Do not sort before copying */
  607. #define VCPFL_DELETE 0x0008
  608. #define VCPFL_RENAME 0x0010
  609. #define VCPFL_ALL (VCPFL_COPY | VCPFL_DELETE | VCPFL_RENAME )
  610. typedef int (CALLBACK *VCPENUMPROC)(LPVIRTNODE lpvn, LPARAM lparamRef);
  611. int WINAPI vcpEnumFiles(VCPENUMPROC vep, LPARAM lparamRef);
  612. enum tag_VCPM_EXPLAIN{
  613. VCPEX_SRC_DISK,
  614. VCPEX_SRC_CABINET,
  615. VCPEX_SRC_LOCN,
  616. VCPEX_DST_LOCN,
  617. VCPEX_SRC_FILE,
  618. VCPEX_DST_FILE,
  619. VCPEX_DST_FILE_FINAL,
  620. VCPEX_DOS_ERROR,
  621. VCPEX_MESSAGE,
  622. VCPEX_DOS_SOLUTION,
  623. VCPEX_SRC_FULL,
  624. VCPEX_DST_FULL,
  625. VCPEX_DST_FULL_FINAL
  626. };
  627. LPCSTR WINAPI VcpExplain( LPVIRTNODE lpVn, DWORD dwWhat );
  628. /* Flag bits that can be set via VcpQueueCopy */
  629. // Various Lparams for files
  630. #define VNLP_SYSCRITICAL 0x0001 // This file should not be skipped
  631. #define VNLP_SETUPCRITICAL 0x0002 // This file cannot be skipped
  632. #define VNLP_NOVERCHECK 0x0004 // This file must not be VerResolved.
  633. #define VNLP_FORCETEMP 0x0008 // This file must left as a temp name
  634. #define VNLP_IFEXISTS 0x0010 // File skipped if already on machine
  635. #define VNLP_KEEPNEWER 0x0020 // If the dest file is newer - keep it (frosting)
  636. #define VNLP_PATCHIFEXIST 0x0040 // patch only the file exists, if file not there,
  637. #define VNLP_NOPATCH 0x0080 // per file base turn on/off patch option (default patch on)
  638. #define VNLP_CATALOGCERT 0x0100 // This file is a catalog certificate.
  639. #define VNLP_NEEDCERTIFY 0x0200 // This file need to be certified.
  640. #define VNLP_COPYIFEXISTS 0x0400 // if dest file exists, copy it.
  641. // VcpEnumFiles Flags.
  642. #define VEN_OP 0x00ff /* Operation field */
  643. #define VEN_NOP 0x0000 /* Do nothing */
  644. #define VEN_DELETE 0x0001 /* Delete current item */
  645. #define VEN_SET 0x0002 /* Change value of current item */
  646. #define VEN_ADVANCE 0x0003 /* Move to head of list */ /* ;Internal */
  647. #define VEN_FL 0xff00 /* Flags field */
  648. #define VEN_STOP 0x0100 /* Stop enumeration after this item */
  649. #define VEN_ERROR 0x8000 /* Stop enumeration after this item
  650. * and ignore the OP field */
  651. // ISSUE-2002/01/16-roelfc: add the other VCP stuff necessary to use this
  652. // ISSUE-2002/01/16-roelfc: remove the lpsz*Dir fields, make overload the LDID with them
  653. RETERR WINAPI VcpQueueCopy(LPCSTR lpszSrcFileName, LPCSTR lpszDstFileName,
  654. LPCSTR lpszSrcDir, LPCSTR lpszDstDir,
  655. LOGDISKID ldidSrc, LOGDISKID ldidDst,
  656. LPEXPANDVTBL lpExpandVtbl, WORD fl,
  657. LPARAM lParam);
  658. RETERR WINAPI VcpQueueDelete( LPCSTR lpszDstFileName,
  659. LPCSTR lpszDstDir,
  660. LOGDISKID ldidDst,
  661. LPARAM lParamRef );
  662. RETERR WINAPI VcpQueueRename( LPCSTR lpszSrcFileName,
  663. LPCSTR lpszDstFileName,
  664. LPCSTR lpszSrcDir,
  665. LPCSTR lpszDstDir,
  666. LOGDISKID ldidSrc,
  667. LOGDISKID ldidDst,
  668. LPARAM lParam );
  669. RETERR WINAPI vcpRegisterSourcePath( LPCSTR lpszKey, LPARAM lpExtra,
  670. LPCSTR lpszPath );
  671. RETERR WINAPI vcpGetSourcePath( LPCSTR lpszKey, LPARAM lpExtra,
  672. LPSTR lpszBuf, UINT uBufSize );
  673. #endif // NOVCP
  674. #ifndef NOINF
  675. /***************************************************************************/
  676. //
  677. // Inf Parser API declaration and definitions
  678. //
  679. /***************************************************************************/
  680. enum _ERR_IP
  681. {
  682. ERR_IP_INVALID_FILENAME = (IP_ERROR + 1),
  683. ERR_IP_ALLOC_ERR,
  684. ERR_IP_INVALID_SECT_NAME,
  685. ERR_IP_OUT_OF_HANDLES,
  686. ERR_IP_INF_NOT_FOUND,
  687. ERR_IP_INVALID_INFFILE,
  688. ERR_IP_INVALID_HINF,
  689. ERR_IP_INVALID_FIELD,
  690. ERR_IP_SECT_NOT_FOUND,
  691. ERR_IP_END_OF_SECTION,
  692. ERR_IP_PROFILE_NOT_FOUND,
  693. ERR_IP_LINE_NOT_FOUND,
  694. ERR_IP_FILEREAD,
  695. ERR_IP_TOOMANYINFFILES,
  696. ERR_IP_INVALID_SAVERESTORE,
  697. ERR_IP_INVALID_INFTYPE
  698. };
  699. #define INFTYPE_TEXT 0
  700. #define INFTYPE_EXECUTABLE 1
  701. #define MAX_SECT_NAME_LEN 64
  702. typedef struct _INF NEAR * HINF;
  703. typedef struct _INFLINE FAR * HINFLINE; // tolken to inf line
  704. RETERR WINAPI IpOpen(LPCSTR pszFileSpec, HINF FAR * lphInf);
  705. RETERR WINAPI IpOpenEx(LPCSTR pszFileSpec, HINF FAR * lphInf, UINT InfType);
  706. RETERR WINAPI IpOpenAppend(LPCSTR pszFileSpec, HINF hInf);
  707. RETERR WINAPI IpOpenAppendEx(LPCSTR pszFileSpec, HINF hInf, UINT InfType);
  708. RETERR WINAPI IpSaveRestorePosition(HINF hInf, BOOL bSave);
  709. RETERR WINAPI IpClose(HINF hInf);
  710. RETERR WINAPI IpGetLineCount(HINF hInf, LPCSTR lpszSection, int FAR * lpCount);
  711. RETERR WINAPI IpFindFirstLine(HINF hInf, LPCSTR lpszSect, LPCSTR lpszKey, HINFLINE FAR * lphRet);
  712. RETERR WINAPI IpFindNextLine(HINF hInf, HINFLINE FAR * lphRet);
  713. RETERR WINAPI IpFindNextMatchLine(HINF hInf, LPCSTR lpszKey, HINFLINE FAR * lphRet);
  714. RETERR WINAPI IpGetProfileString(HINF hInf, LPCSTR lpszSec, LPCSTR lpszKey, LPSTR lpszBuf, int iBufSize);
  715. RETERR WINAPI IpGetFieldCount(HINF hInf, HINFLINE hInfLine, int FAR * lpCount);
  716. RETERR WINAPI IpGetFileName(HINF hInf, LPSTR lpszBuf, int iBufSize);
  717. RETERR WINAPI IpGetIntField(HINF hInf, HINFLINE hInfLine, int iField, int FAR * lpVal);
  718. RETERR WINAPI IpGetLongField(HINF hInf, HINFLINE hInfLine, int iField, long FAR * lpVal);
  719. RETERR WINAPI IpGetStringField(HINF hInf, HINFLINE hInfLine, int iField, LPSTR lpBuf, int iBufSize, int FAR * lpuCount);
  720. RETERR WINAPI IpGetVersionString(LPSTR lpszInfFile, LPSTR lpszValue, LPSTR lpszBuf, int cbBuf, LPSTR lpszDefaultValue);
  721. RETERR WINAPI IpOpenValidate( LPCSTR lpszInfFile, HINF FAR * lphInf,
  722. DWORD dwVer, DWORD dwFlags) ;
  723. RETERR WINAPI IpGetDriverDate
  724. (
  725. LPSTR lpszInfName,
  726. UINT infType,
  727. LPSTR lpszSectionName,
  728. LPWORD lpwDate
  729. );
  730. RETERR WINAPI IpGetDriverVersion
  731. (
  732. LPSTR lpszInfName,
  733. UINT infType,
  734. LPSTR lpszSectionName,
  735. LPSTR lpszVersion,
  736. WORD cbVersion
  737. );
  738. RETERR WINAPI IpGetDriverClass
  739. (
  740. LPSTR lpszInfName,
  741. LPSTR lpszClassName,
  742. WORD cbClass
  743. );
  744. #endif // NOINF
  745. #ifndef NOTEXTPROC
  746. /***************************************************************************/
  747. //
  748. // Text processing API declaration and definitions
  749. //
  750. /***************************************************************************/
  751. /* Relative/absolute positioning */
  752. #define SEC_SET 1 // Absolute positioning (relative to the start)
  753. #define SEC_END 2 // Realtive to the end
  754. #define SEC_CUR 3 // Relative to the current line.
  755. #define SEC_OPENALWAYS 1 // Always open a section, no error if it does not exist
  756. #define SEC_OPENEXISTING 2 // Open an existing section, an error given if it does not exist.
  757. #define SEC_OPENNEWALWAYS 3 // Open a section (present or not) and discard its contents.
  758. #define SEC_OPENNEWEXISTING 4 // Open an existing section (discarding its contents). Error if not existing
  759. // Flags for TP_OpenFile().
  760. //
  761. // Use autoexec/config.sys key delimiters
  762. //
  763. #define TP_WS_KEEP 1
  764. // If TP code running under SETUP, the foll. flag specifies whether
  765. // to cache this file or not! Use this, if you want to read a whole
  766. // file in when doing the TpOpenSection()!
  767. //
  768. #define TP_WS_DONTCACHE 2
  769. // The following are simple errors
  770. enum {
  771. ERR_TP_NOT_FOUND = (TP_ERROR + 1), // line, section, file etc.
  772. // not necessarily terminal
  773. ERR_TP_NO_MEM, // couldn't perform request - generally terminal
  774. ERR_TP_READ, // could not read the disc - terminal
  775. ERR_TP_WRITE, // could not write the data - terminal.
  776. ERR_TP_INVALID_REQUEST, // Multitude of sins - not necessarily terminal.
  777. ERR_TP_INVALID_LINE // Invalid line from DELETE_LINE etc.
  778. };
  779. /* Data handles */
  780. DECLARE_HANDLE(HTP);
  781. typedef HTP FAR * LPHTP;
  782. /* File handles */
  783. DECLARE_HANDLE(HFN);
  784. typedef HFN FAR * LPHFN;
  785. typedef UINT TFLAG;
  786. typedef UINT LINENUM, FAR * LPLINENUM;
  787. #define MAX_REGPATH 256 // Max Registry Path Length
  788. #define LINE_LEN 256 // ISSUE-2002/01/16-roelfc: max line length?
  789. #define SECTION_LEN 64 // ISSUE-2002/01/16-roelfc: max length of a section name?
  790. #define MAX_STRING_LEN 512 // ISSUE-2002/01/16-roelfc: review this
  791. /* Function prototypes */
  792. RETERR WINAPI TpOpenFile(LPCSTR Filename, LPHFN phFile, TFLAG Flag);
  793. RETERR WINAPI TpCloseFile(HFN hFile);
  794. RETERR WINAPI TpOpenSection(HFN hfile, LPHTP phSection, LPCSTR Section, TFLAG flag);
  795. RETERR WINAPI TpCloseSection(HTP Section);
  796. RETERR WINAPI TpCommitSection(HFN hFile, HTP hSection, LPCSTR Section, TFLAG flag);
  797. LINENUM WINAPI TpGetLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, LPLINENUM lpLineNum );
  798. LINENUM WINAPI TpGetNextLine(HTP hSection, LPCSTR key, LPCSTR value, LPLINENUM lpLineNum );
  799. RETERR WINAPI TpInsertLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, TFLAG flag);
  800. RETERR WINAPI TpReplaceLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, TFLAG flag);
  801. RETERR WINAPI TpDeleteLine(HTP hSection, int rel, int orig,TFLAG flag);
  802. RETERR WINAPI TpMoveLine(HTP hSection, int src_rel, int src_orig, int dest_rel, int dest_orig, TFLAG flag);
  803. RETERR WINAPI TpGetLineContents(HTP hSection, LPSTR buffer, UINT bufsize, UINT FAR * lpActualSize,int rel, int orig, TFLAG flag);
  804. // UINT WINAPI TpGetWindowsDirectory(LPSTR lpDest, UINT size);
  805. // UINT WINAPI TpGetSystemDirectory(LPSTR lpDest, UINT size);
  806. int WINAPI TpGetPrivateProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszDefault, LPSTR lpszReturn, int nSize, LPCSTR lpszFile);
  807. int WINAPI TpWritePrivateProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszString, LPCSTR lpszFile);
  808. int WINAPI TpGetProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszDefault, LPSTR lpszReturn, int nSize);
  809. BOOL WINAPI TpWriteProfileString(LPCSTR lpszSect , LPCSTR lpszKey , LPCSTR lpszString);
  810. #endif // NOTEXTPROC
  811. #ifndef NOGENINSTALL
  812. /***************************************************************************/
  813. //
  814. // Generic Installer prototypes and definitions
  815. //
  816. /***************************************************************************/
  817. enum _ERR_GENERIC
  818. {
  819. ERR_GEN_LOW_MEM = GEN_ERROR+1, // Insufficient memory.
  820. ERR_GEN_INVALID_FILE, // Invalid INF file.
  821. ERR_GEN_LOGCONFIG, // Can't process LogConfig=.
  822. ERR_GEN_CFGAUTO, // Can't process CONFIG.SYS/AUTOEXEC.BAT
  823. ERR_GEN_UPDINI, // Can't process UpdateInis=.
  824. ERR_GEN_UPDINIFIELDS, // Can't process UpdateIniFields=.
  825. ERR_GEN_ADDREG, // Can't process AddReg=.
  826. ERR_GEN_DELREG, // Can't process DelReg=.
  827. ERR_GEN_INI2REG, // Can't process Ini2Reg=.
  828. ERR_GEN_FILE_COPY, // Can't process CopyFiles=.
  829. ERR_GEN_FILE_DEL, // Can't process DelFiles=.
  830. ERR_GEN_FILE_REN, // Can't process RenFiles=.
  831. ERR_GEN_REG_API, // Error returned by Reg API.
  832. ERR_GEN_DO_FILES, // can't do Copy, Del or RenFiles.
  833. ERR_GEN_ADDIME, // Can't process AddIme=.
  834. ERR_GEN_DELIME, // Can't process DelIme=.
  835. ERR_GEN_PERUSER, // Can't process PerUserInstall=.
  836. ERR_GEN_BITREG, // Can't process BitReg=.
  837. };
  838. // The cbSize field will always be set to sizeof(GENCALLBACKINFO_S).
  839. // All unused fields (for the operation) will be not be initialized.
  840. // For example, when the operation is GENO_DELFILE, the Src fields will
  841. // not have any sensible values (Dst fields will be set correctly) as
  842. // VcpQueueDelete only accepts Dst parameters.
  843. //
  844. /***************************************************************************
  845. * GenCallbackINFO structure passed to GenInstall CallBack functions.
  846. ***************************************************************************/
  847. typedef struct _GENCALLBACKINFO_S { /* gen-callback struc */
  848. WORD cbSize; // Size of this structure (bytes).
  849. WORD wOperation; // Operation being performed.
  850. LOGDISKID ldidSrc; // Logical Disk ID for Source.
  851. LPCSTR pszSrcSubDir; // Source sub-dir off of the LDID.
  852. LPCSTR pszSrcFileName; // Source file name (base name).
  853. LOGDISKID ldidDst; // Logical Disk ID for Dest.
  854. LPCSTR pszDstSubDir; // Dest. sub-dir off of the LDID.
  855. LPCSTR pszDstFileName; // Dest. file name (base name).
  856. LPEXPANDVTBL lpExpandVtbl; // ISSUE-2002/01/16-roelfc: Needed? NULL right now!
  857. WORD wflags; // flags for VcpQueueCopy.
  858. LPARAM lParam; // LPARAM to the Vcp API.
  859. } GENCALLBACKINFO_S, FAR *LPGENCALLBACKINFO;
  860. /***************************************************************************
  861. * GenCallback notification codes -- callback proc returns 1 of foll. values.
  862. ***************************************************************************/
  863. #define GENN_OK 0 /* All is hunky-dory. Do the VCP operation */
  864. #define GENN_PROCEED 0 /* The same as GENN_OK */
  865. #define GENN_ABORT (-1) /* Cancel current GenInstall altogether */
  866. #define GENN_SKIP (-2) /* Skip this file and continue */
  867. /***************************************************************************
  868. * VCP Operation being performed by GenInstall() -- wOperation values in
  869. * GENCALLBACKINFO structure above.
  870. ***************************************************************************/
  871. #define GENO_COPYFILE 1 /* VCP copyfile being done */
  872. #define GENO_DELFILE 2 /* VCP delfile being done */
  873. #define GENO_RENFILE 3 /* VCP renfile being done */
  874. #define GENO_WININITRENAME 4 /* VCP wininit rename being added */
  875. typedef LRESULT (CALLBACK *GENCALLBACKPROC)(LPGENCALLBACKINFO lpGenInfo,
  876. LPARAM lparamRef);
  877. RETERR WINAPI GenInstall( HINF hinfFile, LPCSTR szInstallSection, WORD wFlags );
  878. RETERR WINAPI GenInstallEx( HINF hInf, LPCSTR szInstallSection, WORD wFlags,
  879. HKEY hRegKey, GENCALLBACKPROC CallbackProc,
  880. LPARAM lparam);
  881. RETERR WINAPI GenWinInitRename(LPCSTR szNew, LPSTR szOld, LOGDISKID ldid);
  882. RETERR WINAPI GenCopyLogConfig2Reg(HINF hInf, HKEY hRegKey,
  883. LPCSTR szLogConfigSection);
  884. void WINAPI GenFormStrWithoutPlaceHolders( LPSTR szDst, LPCSTR szSrc,
  885. HINF hInf ) ;
  886. RETERR WINAPI GenInitSrcPathsInReg(HINF hInf);
  887. // Flags for GenAddReg() from INf /GenSURegSetValueEx()
  888. //
  889. // (updated from setupapi.h, with unsupported features commented out)
  890. //
  891. #define FLG_ADDREG_BINVALUETYPE ( 0x00000001 )
  892. #define FLG_ADDREG_NOCLOBBER ( 0x00000002 )
  893. #define FLG_ADDREG_DELVAL ( 0x00000004 )
  894. //#define FLG_ADDREG_APPEND ( 0x00000008 ) // Currently supported only
  895. // // for REG_MULTI_SZ values.
  896. #define FLG_ADDREG_KEYONLY ( 0x00000010 ) // Just create the key, ignore value
  897. #define FLG_ADDREG_OVERWRITEONLY ( 0x00000020 ) // Set only if value already exists
  898. #define FLG_ADDREG_TYPE_REPLACEIFEXISTS ( 0x00000040 )
  899. #define FLG_ADDREG_TYPE_MASK ( 0xFFFF0000 | FLG_ADDREG_BINVALUETYPE )
  900. #define FLG_ADDREG_TYPE_SZ ( 0x00000000 )
  901. //#define FLG_ADDREG_TYPE_MULTI_SZ ( 0x00010000 )
  902. //#define FLG_ADDREG_TYPE_EXPAND_SZ ( 0x00020000 )
  903. #define FLG_ADDREG_TYPE_BINARY ( 0x00000000 | FLG_ADDREG_BINVALUETYPE )
  904. #define FLG_ADDREG_TYPE_DWORD ( 0x00010000 | FLG_ADDREG_BINVALUETYPE )
  905. //#define FLG_ADDREG_TYPE_NONE ( 0x00020000 | FLG_ADDREG_BINVALUETYPE )
  906. // Flags for GenBitReg()
  907. //
  908. #define FLG_BITREG_CLEAR ( 0x00000000 )
  909. #define FLG_BITREG_SET ( 0x00000001 )
  910. #define FLG_BITREG_TYPE_BINARY ( 0x00000000 )
  911. #define FLG_BITREG_TYPE_DWORD ( 0x00000002 )
  912. RETERR WINAPI GenSURegSetValueEx(HKEY hkeyRoot, LPCSTR szSubKey,
  913. LPCSTR lpszValueName, DWORD dwValType,
  914. LPBYTE lpszValue, DWORD dwValSize, UINT uFlags );
  915. // A devnode is just a DWORD and this is easier than
  916. // having to include configmg.h for everybody
  917. RETERR WINAPI GenInfLCToDevNode(ATOM atInfFileName, LPSTR lpszSectionName,
  918. BOOL bInstallSec, UINT InfType,
  919. DWORD dnDevNode);
  920. // Bit fields for GenInstall() (for wFlags parameter) -- these can be OR-ed!
  921. #define GENINSTALL_DO_REGSRCPATH 64
  922. // Remove temporarily because of incompatibilities with INET16.DLL #define GENINSTALL_DO_FILES (1 | GENINSTALL_DO_REGSRCPATH)
  923. #define GENINSTALL_DO_FILES 1
  924. #define GENINSTALL_DO_INI 2
  925. #define GENINSTALL_DO_REG 4
  926. #define GENINSTALL_DO_INI2REG 8
  927. #define GENINSTALL_DO_CFGAUTO 16
  928. #define GENINSTALL_DO_LOGCONFIG 32
  929. //
  930. // careful: 64 is already used above
  931. //
  932. #define GENINSTALL_DO_IME 128
  933. #define GENINSTALL_DO_PERUSER 256
  934. #define GENINSTALL_DO_UNDO 512
  935. #define GENINSTALL_DO_INIREG (GENINSTALL_DO_INI | \
  936. GENINSTALL_DO_REG | \
  937. GENINSTALL_DO_INI2REG)
  938. #define GENINSTALL_DO_ALL (GENINSTALL_DO_FILES | \
  939. GENINSTALL_DO_INIREG | \
  940. GENINSTALL_DO_CFGAUTO | \
  941. GENINSTALL_DO_LOGCONFIG | \
  942. GENINSTALL_DO_REGSRCPATH | \
  943. GENINSTALL_DO_IME | \
  944. GENINSTALL_DO_PERUSER)
  945. #endif // NOGENINSTALL
  946. #ifndef NODEVICENSTALL
  947. /***************************************************************************/
  948. //
  949. // Device Installer prototypes and definitions
  950. //
  951. /***************************************************************************/
  952. /*******************************************************************************
  953. * AUTODOC
  954. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  955. *
  956. * @typee _ERR_DEVICE_INSTALL | Error return codes for Device Installation
  957. * APIs.
  958. *
  959. * @emem ERR_DI_INVALID_DEVICE_ID | Incorrectly formed device ID.
  960. *
  961. * @emem ERR_DI_INVALID_COMPATIBLE_DEVICE_LIST | Invalid compatible device list.
  962. *
  963. * @emem ERR_DI_REG_API | Error returned by one of the registry API.
  964. *
  965. * @emem ERR_DI_LOW_MEM | Insufficient memory to complete.
  966. *
  967. * @emem ERR_DI_BAD_DEV_INFO | A passed in DEVICE_INFO struct is invalid.
  968. *
  969. * @emem ERR_DI_INVALID_CLASS_INSTALLER | The class installer is listed incorrecrly
  970. * in the registry, or points to an invalid class installer.
  971. *
  972. * @emem ERR_DI_DO_DEFAULT | Do the default action for the requested operation.
  973. *
  974. * @emem ERR_DI_USER_CANCEL | The user cancelled the operation.
  975. *
  976. * @emem ERR_DI_NOFILECOPY | No need to copy files (in install).
  977. *
  978. * @emem ERR_DI_BAD_CLASS_INFO | A passed in CLASS_INFO struct is invalid.
  979. *
  980. * @emem ERR_DI_BAD_INF | An invalid INF file was encountered.
  981. *
  982. * @emem ERR_DI_BAD_MOVEDEV_PARAMS | A passed in MOVEDEVICE_PARAMS struct was
  983. * invalid.
  984. *
  985. * @emem ERR_DI_NO_INF | No INF found on supplied OEM path.
  986. *
  987. * @emem ERR_DI_BAD_PROPCHANGE_PARAMS | A passed in PROPCHANGE_PARMS struct was
  988. * invalid.
  989. *
  990. * @emem ERR_DI_BAD_SELECTDEVICE_PARAMS | A passed in SELECTEDEVICE_PARAMS struct
  991. * was invalid.
  992. *
  993. * @emem ERR_DI_BAD_REMOVEDEVICE_PARAMS | A passed in REMOVEDEVICE_PARAMS struct
  994. * was invalid.
  995. *
  996. * @emem ERR_DI_BAD_UNREMOVEDEVICE_PARAMS | A passed in UNREMOVEDEVICE_PARAMS struct
  997. * was invalid.
  998. *
  999. * @emem ERR_DI_BAD_ENABLECLASS_PARAMS | A passed in ENABLECLASS_PARAMS struct
  1000. * was invalid.
  1001. *
  1002. * @emem ERR_DI_FAIL_QUERY | The queried action should not take place.
  1003. *
  1004. * @emem ERR_DI_API_ERROR | One of the Device installation APIs was called
  1005. * incorrectly or with invalid parameters.
  1006. *
  1007. * @emem ERR_DI_BAD_PATH | An OEM path was specified incorrectly.
  1008. *
  1009. * @emem ERR_DI_NOUPDATE | No Drivers Were updated
  1010. *
  1011. * @emem ERR_DI_NODATE | A driver's date/time stamp in the INF could not be found
  1012. *
  1013. * @emem ERR_DI_NOVERSION | A driver's version the INF could not be found
  1014. *
  1015. *
  1016. *******************************************************************************/
  1017. enum _ERR_DEVICE_INSTALL
  1018. {
  1019. ERR_DI_INVALID_DEVICE_ID = DI_ERROR, // Incorrectly formed device IDF
  1020. ERR_DI_INVALID_COMPATIBLE_DEVICE_LIST, // Invalid compatible device list
  1021. ERR_DI_REG_API, // Error returned by Reg API.
  1022. ERR_DI_LOW_MEM, // Insufficient memory to complete
  1023. ERR_DI_BAD_DEV_INFO, // Device Info struct invalid
  1024. ERR_DI_INVALID_CLASS_INSTALLER, // Registry entry / DLL invalid
  1025. ERR_DI_DO_DEFAULT, // Take default action
  1026. ERR_DI_USER_CANCEL, // the user cancelled the operation
  1027. ERR_DI_NOFILECOPY, // No need to copy files (in install)
  1028. ERR_DI_BAD_CLASS_INFO, // Class Info Struct invalid
  1029. ERR_DI_BAD_INF, // Bad INF file encountered
  1030. ERR_DI_BAD_MOVEDEV_PARAMS, // Bad Move Device Params struct
  1031. ERR_DI_NO_INF, // No INF found on OEM disk
  1032. ERR_DI_BAD_PROPCHANGE_PARAMS, // Bad property change param struct
  1033. ERR_DI_BAD_SELECTDEVICE_PARAMS, // Bad Select Device Parameters
  1034. ERR_DI_BAD_REMOVEDEVICE_PARAMS, // Bad Remove Device Parameters
  1035. ERR_DI_BAD_ENABLECLASS_PARAMS, // Bad Enable Class Parameters
  1036. ERR_DI_FAIL_QUERY, // Fail the Enable Class query
  1037. ERR_DI_API_ERROR, // DI API called incorrectly
  1038. ERR_DI_BAD_PATH, // An OEM path was specified incorrectly
  1039. ERR_DI_BAD_UNREMOVEDEVICE_PARAMS, // Bad Unremove Device Parameters
  1040. ERR_DI_NOUPDATE, // No Drivers Were updated
  1041. ERR_DI_NODATE, // The driver does not have a Date stamp in the INF
  1042. ERR_DI_NOVERSION, // There is not version string in the INF
  1043. ERR_DI_DONT_INSTALL, // Don't upgrade the current driver
  1044. ERR_DI_NO_DIGITAL_SIGNATURE_CATALOG, // Catalog is not digitally signed
  1045. ERR_DI_NO_DIGITAL_SIGNATURE_INF, // Inf is not digitally signed
  1046. ERR_DI_NO_DIGITAL_SIGNATURE_FILE, // A file is not digitally signed
  1047. };
  1048. /*******************************************************************************
  1049. * AUTODOC
  1050. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1051. *
  1052. * @types DRIVER_INFO | This structure contains the information necessary
  1053. * to present the user with a select device dialog.
  1054. *
  1055. * @field WORD | cbSize | Size of this structure in bytes.
  1056. *
  1057. * @field struct _DRIVER_INFO FAR | *lpNextInfo | Pointer to the next DRIVER_INFO
  1058. * struct in a linked list.
  1059. *
  1060. * @field LPSTR | lpszDescription | Pointer to the description of the device being
  1061. * supported by this driver.
  1062. *
  1063. * @field LPSTR | lpszMfgName | Pointer to the name of the manufacture of this
  1064. * driver.
  1065. *
  1066. * @field LPSTR | lpszProviderName | Pointer to provider of this driver if the
  1067. * lpdi->Flags has the DI_MULTMFGS flag set.
  1068. *
  1069. * @field WORD | Rank | The Rank match of this driver. Ranks go from 0 to n, where 0
  1070. * is the most compatible.
  1071. *
  1072. * @field DWORD | dwFlags | Flags that control the use of this driver node. These
  1073. * are the same as the flags defined for a DRIVER_NODE.
  1074. * @flag DNF_DUPDESC | This driver has the same device description
  1075. * from by more than one provider.
  1076. * @flag DNF_OLDDRIVER | Driver node specifies old/current driver
  1077. * @flag DNF_EXCLUDEFROMLIST | If set, this driver node will not be displayed
  1078. * in any driver select dialogs.
  1079. * @flag DNF_NODRIVER | Set if we want to install no driver e.g no mouse drv
  1080. * @flag DNF_CLASS_DRIVER | Set if this driver is in the class driver list
  1081. * @flag DNF_COMPATIBLE_DRIVER | Set if this driver is in the compatible driver list
  1082. * @flag DNF_INET_DRIVER | Set if this driver is being installed from the Internet
  1083. * @flag DNF_CURRENT_DRIVER | Set if this driver is the one currently being used.
  1084. * @flag DNF_CLASS_DRIVER | Set if this driver is in the class driver list
  1085. * @flag DNF_COMPATIBLE_DRIVER | Set if this driver is in the compatible driver list
  1086. * @flag DNF_INET_DRIVER | Set if this driver is being installed from the Internet
  1087. * @flag DNF_CURRENT_DRIVER | Set if this driver is the one currently being used.
  1088. *
  1089. * @field LPARAM | lpReserved | Reserved for use by the Device Installer.
  1090. *
  1091. * @field DWORD | dwPrivateData | Reserved for use by the Device Installer.
  1092. *
  1093. *******************************************************************************/
  1094. typedef struct _DRIVER_INFO
  1095. {
  1096. WORD cbSize; // Size of this structure in bytes
  1097. struct _DRIVER_INFO FAR* lpNextInfo;
  1098. LPSTR lpszDescription;
  1099. LPSTR lpszMfgName;
  1100. LPSTR lpszProviderName; // ONLY valid if DI_MULTMFGS is set in the LPDI
  1101. WORD Rank;
  1102. DWORD dwFlags;
  1103. LPARAM lpReserved;
  1104. DWORD dwPrivateData;
  1105. WORD wDate; // Driver Date
  1106. LPSTR lpszVersion;
  1107. } DRIVER_INFO, *PDRIVER_INFO, FAR *LPDRIVER_INFO;
  1108. /*******************************************************************************
  1109. * AUTODOC
  1110. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1111. *
  1112. * @types DRIVER_NODE | This strucure represents a driver which can be
  1113. * installed for a specific device.
  1114. *
  1115. * @field struct _DRIVER_NODE FAR* | lpNextDN | Pointer to the next driver node
  1116. * in a list.
  1117. *
  1118. * @field UINT | Rank | The Rank match of this driver. Ranks go from 0 to n, where 0
  1119. * is the most compatible.
  1120. *
  1121. * @field UINT | InfType | Type of INF this driver cam from. This will
  1122. * be either INFTYPE_TEXT or INFTYPE_EXECUTABLE
  1123. *
  1124. * @field unsigned | InfDate | DOS date stamp of the INF file.
  1125. *
  1126. * @field LPSTR | lpszDescription | Pointer to a the descriptrion of the device being
  1127. * supported by this driver.
  1128. *
  1129. * @field LPSTR | lpszSectionName | Pointer to the name of INF install section for
  1130. * this driver.
  1131. *
  1132. * @field ATOM | atInfFileName | Global ATOM containing the name of the INF file.
  1133. *
  1134. * @field ATOM | atMfgName | Global ATOM containing the name of this driver's
  1135. * manufacture.
  1136. *
  1137. * @field ATOM | atProviderName | Global ATOM containing the name of this driver's
  1138. * provider.
  1139. *
  1140. * @field DWORD | Flags | Flags that control functions using this DRIVER_NODE
  1141. * @flag DNF_DUPDESC | This driver has the same device description
  1142. * from by more than one provider.
  1143. * @flag DNF_OLDDRIVER | Driver node specifies old/current driver
  1144. * @flag DNF_EXCLUDEFROMLIST | If set, this driver node will not be displayed
  1145. * in any driver select dialogs.
  1146. * @flag DNF_NODRIVER | Set if we want to install no driver e.g no mouse drv
  1147. * @flag DNF_CONVERTEDLPINFO | Set if this Driver Node was converted from an Info Node.
  1148. * Setting this flag will cause the cleanup functions to explicitly delete it.
  1149. *
  1150. * @field DWORD | dwPrivateData | Reserved
  1151. *
  1152. * @field LPSTR | lpszDrvDescription | Pointer to a driver description.
  1153. *
  1154. * @field LPSTR | lpszHardwareID | Pointer to a list of Plug-and-Play hardware IDs for
  1155. * this driver.
  1156. *
  1157. * @field LPSTR | lpszCompatIDs | Pointer to a list of Plug-and-Play compatible IDs for
  1158. * this driver.
  1159. *
  1160. *******************************************************************************/
  1161. typedef struct _DRIVER_NODE {
  1162. struct _DRIVER_NODE FAR* lpNextDN;
  1163. UINT Rank;
  1164. UINT InfType;
  1165. unsigned InfDate;
  1166. LPSTR lpszDescription; // Compatibility: Contains the Device Desc.
  1167. LPSTR lpszSectionName;
  1168. ATOM atInfFileName;
  1169. ATOM atMfgName;
  1170. ATOM atProviderName;
  1171. DWORD Flags;
  1172. DWORD dwPrivateData;
  1173. LPSTR lpszDrvDescription; // New contains an driver description
  1174. LPSTR lpszHardwareID;
  1175. LPSTR lpszCompatIDs;
  1176. unsigned DriverDate;
  1177. LPSTR lpszInfPath;
  1178. LPARAM lpReserved;
  1179. } DRIVER_NODE, NEAR* PDRIVER_NODE, FAR* LPDRIVER_NODE, FAR* FAR* LPLPDRIVER_NODE;
  1180. #define DNF_DUPDESC 0x00000001 // Multiple providers have same desc
  1181. #define DNF_OLDDRIVER 0x00000002 // Driver node specifies old/current driver
  1182. #define DNF_EXCLUDEFROMLIST 0x00000004
  1183. #define DNF_NODRIVER 0x00000008 // if we want to install no driver e.g no mouse drv
  1184. #define DNF_CONVERTEDLPINFO 0x00000010 // Set if the Driver Node is a Converted Info Node
  1185. #define DNF_CLASS_DRIVER 0x00000020 // Driver node represents a class driver
  1186. #define DNF_COMPATIBLE_DRIVER 0x00000040 // Driver node represents a compatible driver
  1187. #define DNF_INET_DRIVER 0x00000080 // Driver comes from an Inetnet source
  1188. #define DNF_CURRENT_DRIVER 0x00000100 // Driver is the current one for a device
  1189. #define DNF_INDEXED_DRIVER 0x00000200 // Driver is specified in the Windows Driver Index file
  1190. #define DNF_DRIVER_VERIFIED 0x00000400 // Driver has been verified
  1191. #define DNF_DRIVER_SIGNED 0x00000800 // Driver is digitally signed
  1192. #define DNF_WIN2K_SECTION 0x00001000 // Driver install section is Win2000 INF section
  1193. // possible types of "INF" files
  1194. #define INFTYPE_WIN4 1
  1195. #define INFTYPE_WIN3 2
  1196. #define INFTYPE_COMBIDRV 3
  1197. #define INFTYPE_PPD 4
  1198. #define INFTYPE_WPD 5
  1199. #define INFTYPE_CLASS_SPEC1 6
  1200. #define INFTYPE_CLASS_SPEC2 7
  1201. #define INFTYPE_CLASS_SPEC3 8
  1202. #define INFTYPE_CLASS_SPEC4 9
  1203. #define MAX_CLASS_NAME_LEN 32
  1204. #define MAX_DRIVER_INST_LEN 10
  1205. #define MAX_GUID_STR 50 // Big enough to hold a GUID string
  1206. // NOTE: Keep this in sync with confimg.h in \DDK\INC
  1207. #define MAX_DEVNODE_ID_LEN 256
  1208. /*******************************************************************************
  1209. * AUTODOC
  1210. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1211. *
  1212. * @types DEVICE_INFO | This is the basic data structure for most Device
  1213. * installation APIs. A DEVICE_INFO represents a device that is being installed
  1214. * on the system, or an installed device that is being modified in some way.
  1215. *
  1216. * @field UINT | cbSize | Size of the DEVICE_INFO struct.
  1217. *
  1218. * @field struct _DEVICE_INFO FAR | *lpNextDi | Pointer to the next DEVICE_INFO struct
  1219. * in a linked list.
  1220. *
  1221. * @field char | szDescription[LINE_LEN] | Buffer containing the description of the
  1222. * device.
  1223. *
  1224. * @field DWORD | dnDevnode | If set, this contains the address of the DevNode associated
  1225. * with the device.
  1226. *
  1227. * @field HKEY | hRegKey | An opened registry key that contains the device's registry
  1228. * subkey. This is usually HKEY_LOCAL_MACHINE.
  1229. *
  1230. * @field char | szRegSubkey[MAX_DEVNODE_ID_LEN] | Buffer containing the device's
  1231. * hardware registry subkey. This is key is rooted in hRegKey, and is ususally some
  1232. * place in the \\ENUM branch.
  1233. *
  1234. * @field char | szClassName[MAX_CLASS_NAME_LEN] | Buffer containing the device's
  1235. * class name. (Can be a GUID str)
  1236. *
  1237. * @field DWORD | Flags | Flags for controlling installation and U/I functions. Some
  1238. * flags can be set prior to calling device installer APIs, and other are set
  1239. * automatically during the processing of some APIs.
  1240. * @flag DI_SHOWOEM | Set if OEM disk support should be allowed
  1241. * @flag DI_SHOWCOMPAT | Will be set if only a compatible driver list
  1242. * is being displayed by DiSelectDevice.
  1243. * @flag DI_SHOWCLASS | Will be set if only a Class driver list is
  1244. * is being displayed by DiSelectDevice.
  1245. * @flag DI_SHOWALL | Will be set if both a compatible driver list
  1246. * and a class driver list are being shown by DiSelectDevice.
  1247. * @flag DI_NOVCP | Set if no VCP (Virtual Copy Procedure) is
  1248. * desired during DiInstallDevice.
  1249. * @flag DI_DIDCOMPAT | Will be set if DiBuildCompatDrvList has been
  1250. * done, and lpCompatDrvList points to this device's compatible driver list.
  1251. * @flag DI_DIDCLASS | Will be set if DiBuildClassDrvList has been
  1252. * done, and lpClassDrvList points to this device's class driver list.
  1253. * @flag DI_AUTOASSIGNRES | Unused.
  1254. * @flag DI_NEEDRESTART | Will be set if the device requires a restart
  1255. * of Windows after installation or a state change.
  1256. * @flag DI_NEEDREBOOT | Will be set if the device requires a reboot
  1257. * of the machine after installation or a state change.
  1258. * @flag DI_NOBROWSE | Set to diable browsing when selecting an OEM
  1259. * disk path.
  1260. * @flag DI_MULTMFGS | Will be set if a class driver list, or class
  1261. * info list contains multiple manufactures.
  1262. * @flag DI_DISABLED | Unused.
  1263. * @flag DI_GENERALPAGE_ADDED | Set by a property page provider if a general
  1264. * properties page has been added to the device's property sheet.
  1265. * @flag DI_RESOURCEPAGE_ADDED | Set by a property page provider if a resource
  1266. * properties page has been added to the device's property sheet.
  1267. * @flag DI_PROPERTIES_CHANGE | Set if a device's properties have been changed
  1268. * and require an update of the Device Manager's U/I.
  1269. * @flag DI_INF_IS_SORTED | Set if the INF containing drivers for this
  1270. * device is in sorted order.
  1271. * @flag DI_ENUMSINGLEINF | Set if DiBuildCompatDrvList and
  1272. * DiBuildlassDrvList should only search the INF file specificed by atDriverPath.
  1273. * @flag DI_DONOTCALLCONFIGMG | Set if the configuration manager should not
  1274. * be called during DiInstallDevice.
  1275. * @flag DI_INSTALLDISABLED | Set if the device should be installed in a
  1276. * disabled state by default.
  1277. * @flag DI_CLASSONLY | Set if this DEVICE_INFO struct contains only
  1278. * a class name.
  1279. * @flag DI_CLASSINSTALLPARAMS | Set if the lpClassIntallParams field points to
  1280. * a class install parameter block.
  1281. * @flag DI_NODI_DEFAULTACTION | Set if DiCallClassInstaller should not
  1282. * perform any default action if the class installer return ERR_DI_DO_DEFAULT, or
  1283. * there is not class installer.
  1284. * @flag DI_QUIETINSTALL | Set if device install API should be as
  1285. * silent as possible using default choices whereever possible.
  1286. * @flag DI_NOFILECOPY | Set if DiInstallDevice should skip file
  1287. * copying.
  1288. * @flag DI_FORCECOPY | Set if DiInstallDevice should always
  1289. * copy file, even if they are present on the system.
  1290. * @flag DI_DRIVERPAGE_ADDED | Set by a property page provider if a driver
  1291. * properties page has been added to the device's property sheet.
  1292. * @flag DI_USECI_SELECTSTRINGS | Set if class installer provided strings
  1293. * should be used during DiSelectDevice.
  1294. * @flag DI_OVERRIDE_INFFLAGS | Unused.
  1295. * @flag DI_PROPS_NOCHANGEUSAGE | Set if there should be no Enable/Disable
  1296. * capability on the device's general property page.
  1297. * @flag DI_NOSELECTICONS | Set if no small icons should be used during
  1298. * DiSelectDevice.
  1299. * @flag DI_NOWRITE_IDS | Set if DiInstallDevice should not write
  1300. * the device's hardware and compatible IDs to the registry.
  1301. *
  1302. * @field HWND | hwndParent | Window handle that will own U/I dialogs related to this
  1303. * device.
  1304. *
  1305. * @field LPDRIVER_NODE | lpCompatDrvList | Pointer to a linked list of DRIVER_NODES
  1306. * representing the compatible drivers for this device.
  1307. *
  1308. * @field LPDRIVER_NODE | lpClassDrvList | Pointer to a linked list of DRIVER_NODES
  1309. * representing all drivers of this device's class.
  1310. *
  1311. * @field LPDRIVER_NODE | lpSelectedDriver | Pointer to a single DRIVER_NODE that
  1312. * has been selected as the driver for this device.
  1313. *
  1314. * @field ATOM | atDriverPath | Global ATOM containing the path to this device's INF
  1315. * file. This is set only of the driver came from an OEM INF file. This will be
  1316. * 0 if the INF is a standard Windows INF file.
  1317. *
  1318. * @field ATOM | atTempInfFile | Global ATOM containing the name of a temporary INF
  1319. * file for this device's drivers. This is set if the drivers came from an old style
  1320. * INF file and have been converted.
  1321. *
  1322. * @field HINSTANCE | hinstClassInstaller | Class installer module instance.
  1323. *
  1324. * @field HINSTANCE | hinstClassPropProvidor | Class Property Providor module instance.
  1325. *
  1326. * @field HINSTANCE | hinstDevicePropProvidor | Device Property Providor module instance.
  1327. *
  1328. * @field HINSTANCE | hinstBasicPropProvidor | Basic Property Providor module instance.
  1329. *
  1330. * @field FARPROC | fpClassInstaller | Procedure address of class install function.
  1331. *
  1332. * @field FARPROC | fpClassEnumPropPages | Procedure address of the Class property
  1333. * provider page enumeration function.
  1334. *
  1335. * @field FARPROC | fpDeviceEnumPropPages | Procedure address of the Device property
  1336. * provider page enumeration function.
  1337. *
  1338. * @field FARPROC | fpEnumBasicProperties | Procedure address of the Basic device
  1339. * property provider page enumeration function.
  1340. *
  1341. * @field DWORD | dwSetupReserved | Reserved for use by Setup.
  1342. *
  1343. * @field DWORD | dwClassInstallReserved | Reserved for use by Class Installers.
  1344. *
  1345. * @field GENCALLBACKPROC | gicpGenInstallCallBack | Procedure address of a GenInstall
  1346. * call back function. This would be set if the class installer wanted to handle
  1347. * GenInstall callbacks during DiInstallDevice.
  1348. *
  1349. * @field LPARAM | gicplParam | lParam for the GenInstall Callback.
  1350. *
  1351. * @field UINT | InfType | The type of INF file being used. This will be INFTYPE_TEXT
  1352. * or INFTYPE_EXECUTABLE.
  1353. *
  1354. * @field HINSTANCE | hinstPrivateProblemHandler | Module handle for the device's
  1355. * private problem procedure.
  1356. *
  1357. * @field FARPROC | fpPrivateProblemHandler | Procedure address of the device's
  1358. * private problem handler.
  1359. *
  1360. * @field LPARAM | lpClassInstallParams | Pointer to a class install parameter block.
  1361. * Class installer parameters are specific to the class install functions.
  1362. *
  1363. * @field struct _DEVICE_INFO FAR | *lpdiChildList | Pointer to a linked list of
  1364. * DRIVER_INFO structs representing children of this device.
  1365. *
  1366. * @field DWORD | dwFlagsEx | Additional control flags.
  1367. * @flag DI_FLAGSEX_USEOLDINFSEARCH | Set if INF Search functions should not use
  1368. * indexed searching.
  1369. * @flag DI_FLAGSEX_AUTOSELECTRANK0 | Set if DiSelectDevice should automatically
  1370. * select rank 0 match drivers.
  1371. * @flag DI_FLAGSEX_CI_FAILED | Will be set internally if there was a
  1372. * failure to load or call a class installer.
  1373. * @flag DI_FLAGSEX_DIDINFOLIST | Will be set if DiBuildCompatDrvInfoList has
  1374. * been called, and this device's compatible driver Info list has been built.
  1375. * @flag DI_FLAGSEX_DIDCOMPATINFO | Will be set if DiBuildClassDrvInfoList has
  1376. * been called, and this device's class driver Info list has been built.
  1377. * @flag DI_FLAGSEX_FILTERCLASSES | If set, DiBuildClassDrvList, and
  1378. * DiBuildClassDrvInfoList will check for Class inclusion filters. This means
  1379. * devices will not be included in the list, if their class is marked as a
  1380. * NoInstallClass class.
  1381. * @flag DI_FLAGSEX_SETFAILEDINSTALL | If set, then if DiInstallDevice installs
  1382. * a NULL driver, it will also set the FAILEDINSTALL config flag
  1383. * @flag DI_FLAGSEX_DEVICECHANGE | If set, the device manager will rebuild it
  1384. * tree of devices after the device property sheet is closed.
  1385. * @flag DI_FLAGSEX_ALWAYSWRITEIDS | If set, and the flag, DI_NOWRITE_ID is clear
  1386. * (ie that flag takes higher precedance) then always write Hardare and Compat
  1387. * ids, even if they allready exist
  1388. * @flag DI_FLAGSEX_ALLOWEXCLUDEDDRVS | If set, DiSelectDevice will display drivers
  1389. * that have the Exlude From Select state
  1390. * @flag DI_FLAGSEX_NOUIONQUERYREMOVE | If setup, DiInstallDevice will prevent
  1391. * U/I warnings during a query removal. Any U/I wanings that would have been
  1392. * displayed will be silently failed.
  1393. * @field LPDRIVER_INFO | lpCompatDrvInfoList | Pointer to a linked list of
  1394. * DRIVER_INFO structs that are compatible with this device.
  1395. *
  1396. * @field LPDRIVER_INFO | lpClassDrvInfoList | Pointer to a linked list of
  1397. * DRIVER_INFO structs representing all drivers for this device's class.
  1398. *
  1399. *******************************************************************************/
  1400. typedef struct _DEVICE_INFO
  1401. {
  1402. UINT cbSize;
  1403. struct _DEVICE_INFO FAR *lpNextDi;
  1404. char szDescription[LINE_LEN];
  1405. DWORD dnDevnode;
  1406. HKEY hRegKey;
  1407. char szRegSubkey[MAX_DEVNODE_ID_LEN];
  1408. char szClassName[MAX_CLASS_NAME_LEN];
  1409. DWORD Flags;
  1410. HWND hwndParent;
  1411. LPDRIVER_NODE lpCompatDrvList;
  1412. LPDRIVER_NODE lpClassDrvList;
  1413. LPDRIVER_NODE lpSelectedDriver;
  1414. ATOM atDriverPath;
  1415. ATOM atTempInfFile;
  1416. HINSTANCE hinstClassInstaller;
  1417. HINSTANCE hinstClassPropProvidor;
  1418. HINSTANCE hinstDevicePropProvidor;
  1419. HINSTANCE hinstBasicPropProvidor;
  1420. FARPROC fpClassInstaller;
  1421. FARPROC fpClassEnumPropPages;
  1422. FARPROC fpDeviceEnumPropPages;
  1423. FARPROC fpEnumBasicProperties;
  1424. DWORD dwSetupReserved;
  1425. DWORD dwClassInstallReserved;
  1426. GENCALLBACKPROC gicpGenInstallCallBack;
  1427. LPARAM gicplParam;
  1428. UINT InfType;
  1429. HINSTANCE hinstPrivateProblemHandler;
  1430. FARPROC fpPrivateProblemHandler;
  1431. LPARAM lpClassInstallParams;
  1432. struct _DEVICE_INFO FAR *lpdiChildList;
  1433. DWORD dwFlagsEx;
  1434. LPDRIVER_INFO lpCompatDrvInfoList;
  1435. LPDRIVER_INFO lpClassDrvInfoList;
  1436. char szClassGUID[MAX_GUID_STR];
  1437. } DEVICE_INFO, FAR * LPDEVICE_INFO, FAR * FAR * LPLPDEVICE_INFO;
  1438. #define ASSERT_DI_STRUC(lpdi) if (lpdi->cbSize != sizeof(DEVICE_INFO)) return (ERR_DI_BAD_DEV_INFO)
  1439. typedef struct _CLASS_INFO
  1440. {
  1441. UINT cbSize;
  1442. struct _CLASS_INFO FAR* lpNextCi;
  1443. LPDEVICE_INFO lpdi;
  1444. char szDescription[LINE_LEN];
  1445. char szClassName[MAX_CLASS_NAME_LEN];
  1446. } CLASS_INFO, FAR * LPCLASS_INFO, FAR * FAR * LPLPCLASS_INFO;
  1447. #define ASSERT_CI_STRUC(lpci) if (lpci->cbSize != sizeof(CLASS_INFO)) return (ERR_DI_BAD_CLASS_INFO)
  1448. // flags for device choosing (InFlags)
  1449. #define DI_SHOWOEM 0x00000001L // support Other... button
  1450. #define DI_SHOWCOMPAT 0x00000002L // show compatibility list
  1451. #define DI_SHOWCLASS 0x00000004L // show class list
  1452. #define DI_SHOWALL 0x00000007L
  1453. #define DI_NOVCP 0x00000008L // Don't do vcpOpen/vcpClose.
  1454. #define DI_DIDCOMPAT 0x00000010L // Searched for compatible devices
  1455. #define DI_DIDCLASS 0x00000020L // Searched for class devices
  1456. #define DI_AUTOASSIGNRES 0x00000040L // No UI for resources if possible
  1457. // flags returned by DiInstallDevice to indicate need to reboot/restart
  1458. #define DI_NEEDRESTART 0x00000080L // Restart required to take effect
  1459. #define DI_NEEDREBOOT 0x00000100L // Reboot required to take effect
  1460. // flags for device installation
  1461. #define DI_NOBROWSE 0x00000200L // no Browse... in InsertDisk
  1462. // Flags set by DiBuildClassDrvList
  1463. #define DI_MULTMFGS 0x00000400L // Set if multiple manufacturers in
  1464. // class driver list
  1465. // Flag indicates that device is disabled
  1466. #define DI_DISABLED 0x00000800L // Set if device disabled
  1467. // Flags for Device/Class Properties
  1468. #define DI_GENERALPAGE_ADDED 0x00001000L
  1469. #define DI_RESOURCEPAGE_ADDED 0x00002000L
  1470. // Flag to indicate the setting properties for this Device (or class) caused a change
  1471. // so the Dev Mgr UI probably needs to be updatd.
  1472. #define DI_PROPERTIES_CHANGE 0x00004000L
  1473. // Flag to indicate that the sorting from the INF file should be used.
  1474. #define DI_INF_IS_SORTED 0x00008000L
  1475. #define DI_ENUMSINGLEINF 0x00010000L
  1476. // The following flags can be used to install a device disabled
  1477. // and to prevent CONFIGMG being called when a device is installed
  1478. #define DI_DONOTCALLCONFIGMG 0x00020000L
  1479. #define DI_INSTALLDISABLED 0x00040000L
  1480. // This flag is set of this LPDI is really just an LPCI, ie
  1481. // it only contains class info, NO DRIVER/DEVICE INFO
  1482. #define DI_CLASSONLY 0x00080000L
  1483. // This flag is set if the Class Install params are valid
  1484. #define DI_CLASSINSTALLPARAMS 0x00100000L
  1485. // This flag is set if the caller of DiCallClassInstaller does NOT
  1486. // want the internal default action performed if the Class installer
  1487. // return ERR_DI_DO_DEFAULT
  1488. #define DI_NODI_DEFAULTACTION 0x00200000L
  1489. // ISSUE-2002/01/16-roelfc. This is a hack for M6 Net setup. Net Setup does not work correctly
  1490. // if we process devnode syncronously. This WILL be removed for M7 when
  1491. // Net setup is fixed to work with DiInstallDevice
  1492. #define DI_NOSYNCPROCESSING 0x00400000L
  1493. // flags for device installation
  1494. #define DI_QUIETINSTALL 0x00800000L // don't confuse the user with
  1495. // questions or excess info
  1496. #define DI_NOFILECOPY 0x01000000L // No file Copy necessary
  1497. #define DI_FORCECOPY 0x02000000L // Force files to be copied from install path
  1498. #define DI_DRIVERPAGE_ADDED 0x04000000L // Prop providor added Driver page.
  1499. #define DI_USECI_SELECTSTRINGS 0x08000000L // Use Class Installer Provided strings in the Select Device Dlg
  1500. #define DI_OVERRIDE_INFFLAGS 0x10000000L // Override INF flags
  1501. #define DI_PROPS_NOCHANGEUSAGE 0x20000000L // No Enable/Disable in General Props
  1502. #define DI_NOSELECTICONS 0x40000000L // No small icons in select device dialogs
  1503. #define DI_NOWRITE_IDS 0x80000000L // Don't write HW & Compat IDs on install
  1504. #define DI_FLAGSEX_USEOLDINFSEARCH 0x00000001L // Inf Search functions should not use Index Search
  1505. #define DI_FLAGSEX_AUTOSELECTRANK0 0x00000002L // DiSelectDevice doesn't propmt user if rank 0 match
  1506. #define DI_FLAGSEX_CI_FAILED 0x00000004L // Failed to Load/Call class installer
  1507. #define DI_FLAGSEX_DIDINFOLIST 0x00000010L // Did the Class Info List
  1508. #define DI_FLAGSEX_DIDCOMPATINFO 0x00000020L // Did the Compat Info List
  1509. #define DI_FLAGSEX_FILTERCLASSES 0x00000040L
  1510. #define DI_FLAGSEX_SETFAILEDINSTALL 0x00000080L
  1511. #define DI_FLAGSEX_DEVICECHANGE 0x00000100L
  1512. #define DI_FLAGSEX_ALWAYSWRITEIDS 0x00000200L
  1513. #define DI_FLAGSEX_ALLOWEXCLUDEDDRVS 0x00000800L
  1514. #define DI_FLAGSEX_NOUIONQUERYREMOVE 0x00001000L
  1515. #define DI_FLAGSEX_RESERVED1 0x00002000L // Reserved for setupapi
  1516. #define DI_FLAGSEX_RESERVED2 0x00004000L // Reserved for setupapi
  1517. #define DI_FLAGSEX_RESERVED3 0x00008000L // Reserved for setupapi
  1518. #define DI_FLAGSEX_RESERVED4 0x00010000L // Reserved for setupapi
  1519. #define DI_FLAGSEX_INET_DRIVER 0x00020000L
  1520. #define DI_FLAGSEX_RESERVED5 0x00040000L // Reserved for setupapi
  1521. // Defines for class installer functions
  1522. #define DIF_SELECTDEVICE 0x0001
  1523. #define DIF_INSTALLDEVICE 0x0002
  1524. #define DIF_ASSIGNRESOURCES 0x0003
  1525. #define DIF_PROPERTIES 0x0004
  1526. #define DIF_REMOVE 0x0005
  1527. #define DIF_FIRSTTIMESETUP 0x0006
  1528. #define DIF_FOUNDDEVICE 0x0007
  1529. #define DIF_SELECTCLASSDRIVERS 0x0008
  1530. #define DIF_VALIDATECLASSDRIVERS 0x0009
  1531. #define DIF_INSTALLCLASSDRIVERS 0x000A
  1532. #define DIF_CALCDISKSPACE 0x000B
  1533. #define DIF_DESTROYPRIVATEDATA 0x000C
  1534. #define DIF_VALIDATEDRIVER 0x000D
  1535. #define DIF_MOVEDEVICE 0x000E
  1536. #define DIF_DETECT 0x000F
  1537. #define DIF_INSTALLWIZARD 0x0010
  1538. #define DIF_DESTROYWIZARDDATA 0x0011
  1539. #define DIF_PROPERTYCHANGE 0x0012
  1540. #define DIF_ENABLECLASS 0x0013
  1541. #define DIF_DETECTVERIFY 0x0014
  1542. #define DIF_INSTALLDEVICEFILES 0x0015
  1543. #define DIF_UNREMOVE 0x0016
  1544. #define DIF_SELECTBESTCOMPATDRV 0x0017
  1545. #define DIF_ALLOW_INSTALL 0x0018
  1546. typedef UINT DI_FUNCTION; // Function type for device installer
  1547. /*******************************************************************************
  1548. * AUTODOC
  1549. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1550. *
  1551. * @types ENABLECLASS_PARAMS | DIF_ENABLECLASS class install parameters
  1552. *
  1553. * @field UINT | cbSize | Size of the ENABLECLASS_PARAMS struct.
  1554. *
  1555. * @field LPSTR | szClass | The class that is being enabled.
  1556. *
  1557. * @field WORD | wEnableMsg | Specifies the stage of enabling.
  1558. * Can be one of:
  1559. *
  1560. * @const ENABLECLASS_QUERY | The class is about to be enabled. Return
  1561. * ERR_DI_DO_DEFAULT to allow the class to be enabled, or ERR_DI_FAIL_QUERY
  1562. * to prevent the class from being enabled.
  1563. *
  1564. * @const ENABLECLASS_SUCCESS | The enabling of the class has succeeded,
  1565. * return ERR_DI_DO_DEFAULT.
  1566. *
  1567. * @const ENABLECLASS_FAILURE | The enabling of the class has failed,
  1568. * return ERR_DI_DO_DEFAULT.
  1569. *
  1570. *******************************************************************************/
  1571. // DIF_ENABLECLASS parameter struct.
  1572. typedef struct _ENABLECLASS_PARAMS
  1573. {
  1574. UINT cbSize;
  1575. LPSTR szClass;
  1576. WORD wEnableMsg;
  1577. } ENABLECLASS_PARAMS, FAR * LPENABLECLASS_PARAMS;
  1578. #define ASSERT_ENABLECLASSPARAMS_STRUC(lpecp) if (lpecp->cbSize != sizeof(ENABLECLASS_PARAMS)) return (ERR_DI_BAD_ENABLECLASS_PARAMS)
  1579. #define ENABLECLASS_QUERY 0
  1580. #define ENABLECLASS_SUCCESS 1
  1581. #define ENABLECLASS_FAILURE 2
  1582. /*******************************************************************************
  1583. * AUTODOC
  1584. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1585. *
  1586. * @types MOVEDEV_PARAMS | DIF_MOVEDEVICE class install parameters
  1587. *
  1588. * @field UINT | cbSize | Size of the MOVDEV_PARAMS struct.
  1589. *
  1590. * @field LPDEVICE_INFO | lpdiOldDev | Pointer to the device that is being
  1591. * moved.
  1592. *
  1593. *******************************************************************************/
  1594. typedef struct _MOVEDEV_PARAMS
  1595. {
  1596. UINT cbSize;
  1597. LPDEVICE_INFO lpdiOldDev; // References the Device Begin Moved
  1598. } MOVEDEV_PARAMS, FAR * LPMOVEDEV_PARAMS;
  1599. #define ASSERT_MOVEDEVPARAMS_STRUC(lpmdp) if (lpmdp->cbSize != sizeof(MOVEDEV_PARAMS)) return (ERR_DI_BAD_MOVEDEV_PARAMS)
  1600. /*******************************************************************************
  1601. * AUTODOC
  1602. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1603. *
  1604. * @types PROPCHANGE_PARAMS | DIF_PROPCHANGE class install parameters
  1605. *
  1606. * @field UINT | cbSize | Size of the PROPCHANGE_PARAMS struct.
  1607. *
  1608. * @field DWORD | dwStateChange | State change action. See DiChangeState for details.
  1609. *
  1610. * @field DWORD | dwFlags | Flags specific to the type of state change.
  1611. *
  1612. * @field DWORD | dwConfigID | Configuration ID for config specific changes.
  1613. *
  1614. * @xref DiChangeState.
  1615. *
  1616. *******************************************************************************/
  1617. typedef struct _PROPCHANGE_PARAMS
  1618. {
  1619. UINT cbSize;
  1620. DWORD dwStateChange;
  1621. DWORD dwFlags;
  1622. DWORD dwConfigID;
  1623. } PROPCHANGE_PARAMS, FAR * LPPROPCHANGE_PARAMS;
  1624. #define ASSERT_PROPCHANGEPARAMS_STRUC(lpmdp) if (lpmdp->cbSize != sizeof(PROPCHANGE_PARAMS)) return (ERR_DI_BAD_PROPCHANGE_PARAMS)
  1625. #define MAX_TITLE_LEN 60
  1626. #define MAX_INSTRUCTION_LEN 256
  1627. #define MAX_LABEL_LEN 30
  1628. /*******************************************************************************
  1629. * AUTODOC
  1630. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1631. *
  1632. * @types SELECTDEVICE_PARAMS | DIF_SELECTDEVICE class install parameters
  1633. *
  1634. * @field UINT | cbSize | Size of the SELECTDEVICE_PARAMS struct.
  1635. *
  1636. * @field char | szTitle[MAX_TITLE_LEN] | Buffer containing a class installer
  1637. * provided title for the Select Device dialogs.
  1638. *
  1639. * @field char | szInstructions[MAX_INSTRUCTION_LEN] | Buffer containing
  1640. * class installer provided Select Device instructions.
  1641. *
  1642. * @field char | szListLabel[MAX_LABEL_LEN] | Buffer containing a lable
  1643. * of the Select Device list of drivers.
  1644. *
  1645. *******************************************************************************/
  1646. typedef struct _SELECTDEVICE_PARAMS
  1647. {
  1648. UINT cbSize;
  1649. char szTitle[MAX_TITLE_LEN];
  1650. char szInstructions[MAX_INSTRUCTION_LEN];
  1651. char szListLabel[MAX_LABEL_LEN];
  1652. } SELECTDEVICE_PARAMS, FAR * LPSELECTDEVICE_PARAMS;
  1653. #define ASSERT_SELECTDEVICEPARAMS_STRUC(p) if (p->cbSize != sizeof(SELECTDEVICE_PARAMS)) return (ERR_DI_BAD_SELECTDEVICE_PARAMS)
  1654. #define DI_REMOVEDEVICE_GLOBAL 0x00000001
  1655. #define DI_REMOVEDEVICE_CONFIGSPECIFIC 0x00000002
  1656. /*******************************************************************************
  1657. * AUTODOC
  1658. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1659. *
  1660. * @types REMOVEDEVICE_PARAMS | DIF_REMOVE class install parameters
  1661. *
  1662. * @field UINT | cbSize | Size of the REMOVEDEVICE_PARAMS struct.
  1663. *
  1664. * @field DWORD | dwFlags | Flags indicating the type of removal to perform.
  1665. * @flag DI_REMOVEDEVICE_GLOBAL | The device will be removed globally.
  1666. * @flag DI_REMOVEDEVICE_CONFIGSPECIFIC | The device will be removed from only
  1667. * the specified configuration.
  1668. *
  1669. * @field DWORD | dwConfigID | If DI_REMOVEDEVICE_CONFIGSPECIFIC is set, then
  1670. * this is the configuration the device will be removed from. 0 means the current
  1671. * config.
  1672. *
  1673. *******************************************************************************/
  1674. typedef struct _REMOVEDEVICE_PARAMS
  1675. {
  1676. UINT cbSize;
  1677. DWORD dwFlags;
  1678. DWORD dwConfigID;
  1679. } REMOVEDEVICE_PARAMS, FAR * LPREMOVEDEVICE_PARAMS;
  1680. #define ASSERT_REMOVEDPARAMS_STRUC(p) if (p->cbSize != sizeof(REMOVEDEVICE_PARAMS)) return (ERR_DI_BAD_REMOVEDEVICE_PARAMS)
  1681. #define DI_UNREMOVEDEVICE_CONFIGSPECIFIC 0x00000002
  1682. /*******************************************************************************
  1683. * AUTODOC
  1684. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1685. *
  1686. * @types UNREMOVEDEVICE_PARAMS | DIF_UNREMOVE class install parameters
  1687. *
  1688. * @field UINT | cbSize | Size of the UNREMOVEDEVICE_PARAMS struct.
  1689. *
  1690. * @field DWORD | dwFlags | Flags indicating the type of removal to perform.
  1691. * @flag DI_UNREMOVEDEVICE_CONFIGSPECIFIC | The device will be unremoved from only
  1692. * the specified configuration.
  1693. *
  1694. * @field DWORD | dwConfigID | If DI_UNREMOVEDEVICE_CONFIGSPECIFIC is set, then
  1695. * this is the configuration the device will be removed from. 0 means the current
  1696. * config.
  1697. *
  1698. *******************************************************************************/
  1699. typedef struct _UNREMOVEDEVICE_PARAMS
  1700. {
  1701. UINT cbSize;
  1702. DWORD dwFlags;
  1703. DWORD dwConfigID;
  1704. } UNREMOVEDEVICE_PARAMS, FAR * LPUNREMOVEDEVICE_PARAMS;
  1705. #define ASSERT_UNREMOVEDPARAMS_STRUC(p) if (p->cbSize != sizeof(UNREMOVEDEVICE_PARAMS)) return (ERR_DI_BAD_UNREMOVEDEVICE_PARAMS)
  1706. /*******************************************************************************
  1707. * AUTODOC
  1708. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1709. *
  1710. * @type NONE | Dynamic Hardware Install Wizard Constants | Constants that are
  1711. * used when adding custom pages to the hardware install wizard.
  1712. *
  1713. * @const MAX_INSTALLWIZARD_DYNAPAGES | The maximum number of dynamic hardware
  1714. * installation wizard pages that can be added by a class installer.
  1715. *
  1716. * @const IDD_DYNAWIZ_FIRSTPAGE | Resource ID for the first page that the install
  1717. * wizard will go to after adding the class installer pages.
  1718. *
  1719. * @const IDD_DYNAWIZ_SELECT_PREVPAGE | Resource ID for the page that the Select
  1720. * Device page will go back to.
  1721. *
  1722. * @const IDD_DYNAWIZ_SELECT_NEXTPAGE | Resource ID for the page that the Select
  1723. * Device page will go forward to.
  1724. *
  1725. * @const IDD_DYNAWIZ_ANALYZE_PREVPAGE | Resource ID for the page that the Analyze
  1726. * page will go back to. This will only be used in the event that there is a
  1727. * problem (i.e a conflict), and the user selects Back from the analyze page.
  1728. *
  1729. * @const IDD_DYNAWIZ_ANALYZE_NEXTPAGE | Resource ID for the page that the Analyze
  1730. * page will go to if it continues forward. The wAnalyzeResult in the
  1731. * INSTALLWIZARDDATA struct will contain the anaysis results.
  1732. *
  1733. * @const IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE | Resource ID for that page that the
  1734. * Install detected devices page will go back to.
  1735. *
  1736. * @const IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE | Resource ID for the page that the
  1737. * Install detected devices page will go forward to.
  1738. *
  1739. * @const IDD_DYNAWIZ_INSTALLDETECTED_NODEVS | Resource ID for the page that the
  1740. * Install detected devices page will go to in the event that no devices are
  1741. * detected.
  1742. *
  1743. * @const IDD_DYNAWIZ_SELECTDEV_PAGE | Resource ID of the hardware install wizard's
  1744. * select device page. This ID can be used to go directly to the hardware install
  1745. * wizard's select device page.
  1746. *
  1747. * @const IDD_DYNAWIZ_ANALYZEDEV_PAGE | Resource ID of the hardware install wizard's
  1748. * device analysis page. This ID can be use to go directly to the hardware install
  1749. * wizard's analysis page.
  1750. *
  1751. * @const IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE | Resource ID of the hardware install
  1752. * wizard's install detected devices page. This ID can be use to go directly to
  1753. * the hardware install wizard's install detected devices page.
  1754. *
  1755. * @const IDD_DYNAWIZ_SELECTCLASS_PAGE | Resource ID of the hardware install wizard's
  1756. * select class page. This ID can be use to go directly to the hardware install
  1757. * wizard's select class page.
  1758. *
  1759. *******************************************************************************/
  1760. // DIF_INSTALLWIZARD Wizard Data
  1761. #define MAX_INSTALLWIZARD_DYNAPAGES 20
  1762. // Use this ID for the first page that the install wizard should dynamically jump to.
  1763. #define IDD_DYNAWIZ_FIRSTPAGE 10000
  1764. // Use this ID for the page that the Select Device dialog should go back to
  1765. #define IDD_DYNAWIZ_SELECT_PREVPAGE 10001
  1766. // Use this ID for the page that the Select Device dialog should go to next
  1767. #define IDD_DYNAWIZ_SELECT_NEXTPAGE 10002
  1768. // Use this ID for the page that the Analyze dialog should go back to
  1769. // This will only be used in the event that there is a problem, and the user
  1770. // selects Back from the analyze proc.
  1771. #define IDD_DYNAWIZ_ANALYZE_PREVPAGE 10003
  1772. // Use this ID for the page that the Analyze dialog should go to if it continue from
  1773. // the analyze proc. the wAnalyzeResult in the INSTALLDATA struct will
  1774. // contain the anaysis results.
  1775. #define IDD_DYNAWIZ_ANALYZE_NEXTPAGE 10004
  1776. // This dialog will be selected if the user chooses back from the
  1777. // Install Detected Devices dialog.
  1778. #define IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE 10006
  1779. // This dialog will be selected if the user chooses Next from the
  1780. // Install Detected Devices dialog.
  1781. #define IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE 10007
  1782. // This is the ID of the dialog to select if detection does not
  1783. // find any new devices
  1784. #define IDD_DYNAWIZ_INSTALLDETECTED_NODEVS 10008
  1785. // This is the ID of the Select Device Wizard page.
  1786. #define IDD_DYNAWIZ_SELECTDEV_PAGE 10009
  1787. // This is the ID of the Analyze Device Wizard page.
  1788. #define IDD_DYNAWIZ_ANALYZEDEV_PAGE 10010
  1789. // This is the ID of the Install Detected Devs Wizard page.
  1790. #define IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE 10011
  1791. // This is the ID of the Select Class Wizard page.
  1792. #define IDD_DYNAWIZ_SELECTCLASS_PAGE 10012
  1793. // This flag is set if a Class installer has added pages to the
  1794. // install wizard.
  1795. #define DYNAWIZ_FLAG_PAGESADDED 0x00000001
  1796. // The following flags will control the button states when displaying
  1797. // the InstallDetectedDevs dialog.
  1798. #define DYNAWIZ_FLAG_INSTALLDET_NEXT 0x00000002
  1799. #define DYNAWIZ_FLAG_INSTALLDET_PREV 0x00000004
  1800. // Set this flag if you jump to the analyze page, and want it to
  1801. // handle conflicts for you. NOTE. You will not get control back
  1802. // in the event of a conflict if you set this flag.
  1803. #define DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT 0x00000008
  1804. #define ANALYZE_FACTDEF_OK 1
  1805. #define ANALYZE_STDCFG_OK 2
  1806. #define ANALYZE_CONFLICT 3
  1807. #define ANALYZE_NORESOURCES 4
  1808. #define ANALYZE_ERROR 5
  1809. #define ANALYZE_PNP_DEV 6
  1810. #define ANALYZE_PCMCIA_DEV 7
  1811. /*******************************************************************************
  1812. * AUTODOC
  1813. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  1814. *
  1815. * @types INSTALLWIZARDDATA | DIF_INSTALLWIZARD class install parameters. This
  1816. * struct is used by class installers to extend the operation of the hardware
  1817. * installation wizard by adding custom pages.
  1818. *
  1819. * @field UINT | cbSize | Size of the INSTALLWIZARDDATA struct.
  1820. *
  1821. * @field LPDEVICE_INFO | lpdiOriginal | Pointer to the Original DEVICE_INFO
  1822. * struct at the start of the manual installation.
  1823. *
  1824. * @field LPDEVICE_INFO | lpdiSelected | Pointer to the current DEVICE_INFO struct
  1825. * that is being manually selected.
  1826. *
  1827. * @field DWORD | dwFlags | Flags that control the operation of the hardware
  1828. * installation wizard. There are currently none defined.
  1829. *
  1830. * @field LPVOID | lpConfigData | Pointer to configuration data for analysis to
  1831. * determine if the selected device can be installed with no conflicts.
  1832. *
  1833. * @field WORD | wAnalyzeResult | Results of analysis to determine if the device
  1834. * can be installed with no problems. The following values are defined:
  1835. * @flag ANALYZE_FACTDEF_OK | The device can be installed using its factory
  1836. * default settings.
  1837. * @flag ANALYZE_STDCFG_OK | The device can be installed using a configuration
  1838. * specified in one if its basic logical configurations. The user will probably
  1839. * have to set jumpers or switches on the hardware to match the settings determined
  1840. * by the install wizard.
  1841. * @flag ANALYZE_CONFLICT | The device cannot be installed without causing a
  1842. * conflict with another device.
  1843. * @flag ANALYZE_NORESOURCES | The device does not require any resources, so it
  1844. * can be installed witth no conflicts.
  1845. * @flag ANALYZE_ERROR | There was an error during analysis.
  1846. * @flag ANALYZE_PNP_DEV | The device has a least one softsettable logical
  1847. * configurations, allowing it to be automatically configured. Additionally the
  1848. * device will be enumerated by one of the standard bus enumerators, so it does
  1849. * not require manual installation, except to pre-copy driver files.
  1850. *
  1851. * @field HPROPSHEETPAGE | hpsDynamicPages[MAX_INSTALLWIZARD_DYNAPAGES] | An
  1852. * array of property sheet page handles. The class installer would use this array
  1853. * to create custom wizard pages, and insert their handles into this array.
  1854. *
  1855. * @field WORD | wNumDynaPages | The number of pages inserted into the hpsDynamicPages
  1856. * array.
  1857. *
  1858. * @field DWORD | dwDynaWizFlags | Flags that control the behavior of the
  1859. * installation wizard whtn dynamic pages have been added.
  1860. * @flag DYNAWIZ_FLAG_PAGESADDED | Will be set by the install wizard if the
  1861. * class installer adds custom pages.
  1862. * @flag DYNAWIZ_FLAG_INSTALLDET_NEXT | If set, the install wizard will allow
  1863. * going forward from the detected devices page, otherwise finish will
  1864. * be the default option for the detected devices page.
  1865. * @flag DYNAWIZ_FLAG_INSTALLDET_PREV | If set, the install wizard will allow
  1866. * going back from the detected devices page.
  1867. * @flag DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT | If set, the class installer will
  1868. * handle the case where the selected device cannot be installed because of
  1869. * a conflict.
  1870. *
  1871. * @field DWORD | dwPrivateFlags | Flags that may be defined and used by the class
  1872. * installer.
  1873. *
  1874. * @field LPARAM | lpPrivateData | Pointer to private reference data defined and
  1875. * set by the class installer.
  1876. *
  1877. * @field LPSTR | lpExtraRunDllParams | Pointer to a string containing extra
  1878. * parameters passed to the hardware install rundll function.
  1879. *
  1880. * @field HWND | hwndWizardDlg | Window handle of the install wizard top level
  1881. * window.
  1882. *
  1883. *******************************************************************************/
  1884. typedef struct InstallWizardData_tag
  1885. {
  1886. UINT cbSize;
  1887. LPDEVICE_INFO lpdiOriginal;
  1888. LPDEVICE_INFO lpdiSelected;
  1889. DWORD dwFlags;
  1890. LPVOID lpConfigData;
  1891. WORD wAnalyzeResult;
  1892. // The following fields are used when a Class Installer Extends the Install Wizard
  1893. HPROPSHEETPAGE hpsDynamicPages[MAX_INSTALLWIZARD_DYNAPAGES];
  1894. WORD wNumDynaPages;
  1895. DWORD dwDynaWizFlags;
  1896. DWORD dwPrivateFlags;
  1897. LPARAM lpPrivateData;
  1898. LPSTR lpExtraRunDllParams;
  1899. HWND hwndWizardDlg;
  1900. } INSTALLWIZDATA, * PINSTALLWIZDATA , FAR *LPINSTALLWIZDATA;
  1901. RETERR WINAPI DiCreateDeviceInfo(
  1902. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  1903. LPCSTR lpszDescription, // If non-null then description string
  1904. DWORD hDevnode, // ISSUE-2002/01/16-roelfc -- MAKE A DEVNODE
  1905. HKEY hkey, // Registry hkey for dev info
  1906. LPCSTR lpszRegsubkey, // If non-null then reg subkey string
  1907. LPCSTR lpszClassName, // If non-null then class name string
  1908. HWND hwndParent); // If non-null then hwnd of parent
  1909. RETERR WINAPI DiGetClassDevs(
  1910. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  1911. LPCSTR lpszClassName, // Must be name of class
  1912. HWND hwndParent, // If non-null then hwnd of parent
  1913. int iFlags); // Options
  1914. RETERR WINAPI DiGetClassDevsEx(
  1915. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  1916. LPCSTR lpszClassName, // Must be name of class
  1917. LPCSTR lpszEnumerator, // Must be name of enumerator, or NULL
  1918. HWND hwndParent, // If non-null then hwnd of parent
  1919. int iFlags); // Options
  1920. DWORD WINAPI DiGetDriverSigningMode
  1921. (
  1922. LPDRIVER_NODE lpdn
  1923. );
  1924. #define DIGCF_DEFAULT 0x0001 // NOT IMPLEMENTED!
  1925. #define DIGCF_PRESENT 0x0002
  1926. #define DIGCF_ALLCLASSES 0x0004
  1927. #define DIGCF_PROFILE 0x0008
  1928. // API to return the Class name of an INF File
  1929. RETERR WINAPI DiGetINFClass(LPSTR lpszMWDPath, UINT InfType, LPSTR lpszClassName, DWORD dwcbClassName);
  1930. RETERR WINAPI PASCAL DiCreateDevRegKey(
  1931. LPDEVICE_INFO lpdi,
  1932. LPHKEY lphk,
  1933. HINF hinf,
  1934. LPCSTR lpszInfSection,
  1935. int iFlags);
  1936. RETERR WINAPI PASCAL DiDeleteDevRegKey(LPDEVICE_INFO lpdi, int iFlags);
  1937. RETERR WINAPI PASCAL DiOpenDevRegKey(
  1938. LPDEVICE_INFO lpdi,
  1939. LPHKEY lphk,
  1940. int iFlags);
  1941. #define DIREG_DEV 0x0001 // Open/Create/Delete device key
  1942. #define DIREG_DRV 0x0002 // Open/Create/Delete driver key
  1943. #define DIREG_BOTH 0x0004 // Delete both driver and Device key
  1944. RETERR WINAPI DiReadRegLogConf
  1945. (
  1946. LPDEVICE_INFO lpdi,
  1947. LPSTR lpszConfigName,
  1948. LPBYTE FAR *lplpbLogConf,
  1949. LPDWORD lpdwSize
  1950. );
  1951. RETERR WINAPI DiReadRegConf
  1952. (
  1953. LPDEVICE_INFO lpdi,
  1954. LPBYTE FAR *lplpbLogConf,
  1955. LPDWORD lpdwSize,
  1956. DWORD dwFlags
  1957. );
  1958. #define DIREGLC_FORCEDCONFIG 0x00000001
  1959. #define DIREGLC_BOOTCONFIG 0x00000002
  1960. RETERR WINAPI DiCopyRegSubKeyValue
  1961. (
  1962. HKEY hkKey,
  1963. LPSTR lpszFromSubKey,
  1964. LPSTR lpszToSubKey,
  1965. LPSTR lpszValueToCopy
  1966. );
  1967. RETERR WINAPI DiDestroyClassInfoList(LPCLASS_INFO lpci);
  1968. RETERR WINAPI DiBuildClassInfoList(LPLPCLASS_INFO lplpci);
  1969. #define DIBCI_NOINSTALLCLASS 0x000000001
  1970. #define DIBCI_NODISPLAYCLASS 0x000000002
  1971. RETERR WINAPI DiBuildClassInfoListEx(LPLPCLASS_INFO lplpci, DWORD dwFlags);
  1972. RETERR WINAPI DiGetDeviceClassInfo(LPLPCLASS_INFO lplpci, LPDEVICE_INFO lpdi);
  1973. RETERR WINAPI DiDestroyDeviceInfoList(LPDEVICE_INFO lpdi);
  1974. RETERR WINAPI DiSelectDevice( LPDEVICE_INFO lpdi );
  1975. RETERR WINAPI DiSelectOEMDrv(HWND hDlg, LPDEVICE_INFO lpdi);
  1976. // Callback for diInstallDevice vcpOpen. Basically calls vcpUICallback for everthing
  1977. // except when DI_FORCECOPY is active, in which case copies get defaulted to
  1978. // VCPN_FORCE
  1979. LRESULT CALLBACK diInstallDeviceUICallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  1980. RETERR WINAPI DiInstallDevice( LPDEVICE_INFO lpdi );
  1981. RETERR WINAPI DiInstallDriverFiles(LPDEVICE_INFO lpdi);
  1982. RETERR WINAPI DiRemoveDevice( LPDEVICE_INFO lpdi );
  1983. RETERR WINAPI DiUnremoveDevice( LPDEVICE_INFO lpdi );
  1984. RETERR WINAPI DiAskForOEMDisk(LPDEVICE_INFO lpdi);
  1985. RETERR WINAPI DiCallClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  1986. BOOL WINAPI DiBuildDriverIndex(BOOL bUI);
  1987. BOOL WINAPI DiAddSingleInfToDrvIdx(LPSTR lpszInfName, WORD InfType, BOOL bCreate);
  1988. BOOL WINAPI DiDeleteSingleInfFromDrvIdx(LPSTR lpszInfPath);
  1989. RETERR WINAPI DiBuildCompatDrvList(LPDEVICE_INFO lpdi);
  1990. LPDRIVER_NODE WINAPI DiSelectBestCompatDrv(LPDEVICE_INFO lpdi, LPDRIVER_NODE lpdnCurrent);
  1991. // Given list of drivers returns the newest, may be used by class installers when
  1992. // called by DiSelectBestCompatDrv.
  1993. LPDRIVER_NODE WINAPI DiPickBestDriver(LPDRIVER_NODE lpdnList);
  1994. RETERR WINAPI DiBuildClassDrvList(LPDEVICE_INFO lpdi);
  1995. RETERR WINAPI DiBuildCompatDrvInfoList(LPDEVICE_INFO lpdi);
  1996. RETERR WINAPI DiBuildClassDrvInfoList(LPDEVICE_INFO lpdi);
  1997. RETERR WINAPI DiDestroyDrvInfoList(LPDRIVER_INFO lpInfo);
  1998. LPDRIVER_NODE WINAPI DiConvertDriverInfoToDriverNode(LPDEVICE_INFO lpdi, LPDRIVER_INFO lpInfo);
  1999. typedef RETERR (CALLBACK *OLDINFPROC)(HINF hinf, LPCSTR lpszNewInf, LPARAM lParam);
  2000. RETERR WINAPI DiBuildClassDrvListFromOldInf(LPDEVICE_INFO lpdi, LPCSTR lpszSection, OLDINFPROC lpfnOldInfProc, LPARAM lParam);
  2001. RETERR WINAPI DiDestroyDriverNodeList(LPDRIVER_NODE lpdn);
  2002. RETERR WINAPI DiMoveDuplicateDevNode(LPDEVICE_INFO lpdiNewDev);
  2003. // The following export will load a dll and find the specified proc name
  2004. typedef RETERR (FAR PASCAL *DIINSTALLERPROPERTIES)(LPDEVICE_INFO);
  2005. RETERR WINAPI GetFctn(HKEY hk, LPSTR lpszRegVal, LPSTR lpszDefProcName,
  2006. HINSTANCE FAR * lphinst, FARPROC FAR *lplpfn);
  2007. RETERR
  2008. WINAPI
  2009. DiCreateDriverNode(
  2010. LPLPDRIVER_NODE lplpdn,
  2011. UINT Rank,
  2012. UINT InfType,
  2013. unsigned InfDate,
  2014. LPCSTR lpszDevDescription,
  2015. LPCSTR lpszDrvDescription,
  2016. LPCSTR lpszProviderName,
  2017. LPCSTR lpszMfgName,
  2018. LPCSTR lpszInfFileName,
  2019. LPCSTR lpszSectionName,
  2020. DWORD dwPrivateData);
  2021. RETERR WINAPI DiLoadClassIcon(
  2022. LPCSTR szClassName,
  2023. HICON FAR *lphiLargeIcon,
  2024. int FAR *lpiMiniIconIndex);
  2025. RETERR WINAPI DiInstallDrvSection(
  2026. LPCSTR lpszInfFileName,
  2027. LPCSTR lpszSection,
  2028. LPCSTR lpszClassName,
  2029. LPCSTR lpszDescription,
  2030. DWORD dwFlags);
  2031. RETERR WINAPI DiChangeState(LPDEVICE_INFO lpdi, DWORD dwStateChange, DWORD dwFlags, LPARAM lParam);
  2032. #define DICS_ENABLE 0x00000001
  2033. #define DICS_DISABLE 0x00000002
  2034. #define DICS_PROPCHANGE 0x00000003
  2035. #define DICS_START 0x00000004
  2036. #define DICS_STOP 0x00000005
  2037. #define DICS_FLAG_GLOBAL 0x00000001
  2038. #define DICS_FLAG_CONFIGSPECIFIC 0x00000002
  2039. #define DICS_FLAG_CONFIGGENERAL 0x00000004
  2040. RETERR WINAPI DiInstallClass(LPCSTR lpszInfFileName, DWORD dwFlags);
  2041. RETERR WINAPI DiOpenClassRegKey(LPHKEY lphk, LPCSTR lpszClassName);
  2042. // support routine for dealing with class mini icons
  2043. #define DMI_MASK 0x0001
  2044. #define DMI_BKCOLOR 0x0002
  2045. #define DMI_USERECT 0x0004
  2046. int WINAPI PASCAL DiDrawMiniIcon(HDC hdc, RECT rcLine, int iMiniIcon, DWORD flags);
  2047. BOOL WINAPI DiGetClassBitmapIndex(LPCSTR lpszClass, int FAR *lpiMiniIconIndex);
  2048. // internal calls for display class
  2049. #define DISPLAY_SETMODE_SUCCESS 0x0001
  2050. #define DISPLAY_SETMODE_DRVCHANGE 0x0002
  2051. #define DISPLAY_SETMODE_FONTCHANGE 0x0004
  2052. UINT WINAPI Display_SetMode(LPDEVICE_INFO lpdi, UINT uColorRes, int iXRes, int iYRes);
  2053. RETERR WINAPI Display_ClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  2054. RETERR WINAPI Display_OpenFontSizeKey(LPHKEY lphkFontSize);
  2055. BOOL WINAPI Display_SetFontSize(LPCSTR lpszFontSize);
  2056. RETERR WINAPI DiIsThereNeedToCopy(HWND hwnd, DWORD dwFlags);
  2057. #define DINTC_NOCOPYDEFAULT 0x00000001
  2058. // API for the mouse class installer
  2059. RETERR WINAPI Mouse_ClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  2060. #endif // NODEVICEINSTALL
  2061. // API for determining if a Driver file is currently part of VMM32.VxD
  2062. BOOL WINAPI bIsFileInVMM32
  2063. (
  2064. LPSTR lpszFileName
  2065. );
  2066. // API for determining if a display is a primary or secondary
  2067. BOOL WINAPI Display_IsSecondDisplay(
  2068. LPDEVICE_INFO lpdi
  2069. );
  2070. // Japanese Keyboard Support
  2071. LONG _export WINAPI GetJapaneseKeyboardType();
  2072. #define JP_101KBD 0
  2073. #define JP_AXKBD 1
  2074. #define JP_106KBD 2
  2075. #define JP_003KBD 3
  2076. #define JP_001KBD 4
  2077. #define JP_TB_DESKTOP 5
  2078. #define JP_TB_LAPTOP 6
  2079. #define JP_TB_NOTEBOOK 7
  2080. #ifndef NOUSERINTERFACE
  2081. /***************************************************************************/
  2082. //
  2083. // User Interface prototypes and definitions
  2084. //
  2085. /***************************************************************************/
  2086. BOOL WINAPI UiMakeDlgNonBold(HWND hDlg);
  2087. VOID WINAPI UiDeleteNonBoldFont(HWND hDlg);
  2088. #endif
  2089. /***************************************************************************/
  2090. //
  2091. // setup reg DB calls, use just like those in kernel
  2092. //
  2093. /***************************************************************************/
  2094. DWORD WINAPI SURegOpenKey(HKEY hKey, LPCSTR lpszSubKey, HKEY FAR *lphkResult);
  2095. DWORD WINAPI SURegCloseKey(HKEY hKey);
  2096. DWORD WINAPI SURegCreateKey(HKEY hKey, LPCSTR lpszSubKey, HKEY FAR *lphkResult);
  2097. DWORD WINAPI SURegDeleteKey(HKEY hKey, LPCSTR lpszSubKey);
  2098. DWORD WINAPI SURegEnumKey(HKEY hKey, DWORD dwIdx, LPSTR lpszBuffer, DWORD dwBufSize);
  2099. DWORD WINAPI SURegQueryValue16(HKEY hKey, LPCSTR lpszSubKey, LPSTR lpValueBuf, DWORD FAR *ldwBufSize);
  2100. DWORD WINAPI SURegSetValue16(HKEY hKey, LPCSTR lpszSubKey, DWORD dwType, LPCBYTE lpszValue, DWORD dwValSize);
  2101. DWORD WINAPI SURegDeleteValue(HKEY hKey,LPCSTR lpszValue);
  2102. DWORD WINAPI SURegEnumValue(HKEY hKey,DWORD dwIdx, LPCSTR lpszValue, DWORD FAR *lpcbValue, DWORD FAR *lpdwReserved, DWORD FAR *lpdwType, LPBYTE lpbData, DWORD FAR *lpcbData);
  2103. DWORD WINAPI SURegQueryValueEx(HKEY hKey,LPCSTR lpszValueName, DWORD FAR *lpdwReserved,DWORD FAR *lpdwType,LPSTR lpValueBuf, DWORD FAR *ldwBufSize);
  2104. DWORD WINAPI SURegSetValueEx(HKEY hKey,LPCSTR lpszValueName, DWORD dwReserved, DWORD dwType, LPBYTE lpszValue, DWORD dwValSize);
  2105. DWORD WINAPI SURegSaveKey(HKEY hKey, LPCSTR lpszFileName, LPVOID lpsa);
  2106. DWORD WINAPI SURegLoadKey(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszFileName);
  2107. DWORD WINAPI SURegUnLoadKey(HKEY hKey, LPCSTR lpszSubKey);
  2108. DWORD WINAPI SURegFlush(VOID);
  2109. DWORD WINAPI SURegInit(VOID); // should be called before any other Reg APIs
  2110. /***************************************************************************/
  2111. // setup FormatMessage support
  2112. /***************************************************************************/
  2113. #define MB_LOG (UINT)-1
  2114. #define MB_DBG (UINT)-2
  2115. UINT FAR CDECL suFormatMessage(HINSTANCE hAppInst, LPCSTR lpcFormat, LPSTR szMessage, UINT uSize,
  2116. ...);
  2117. UINT WINAPI suvFormatMessage(HINSTANCE hAppInst, LPCSTR lpcFormat, LPSTR szMessage, UINT uSize,
  2118. LPVOID FAR * lpArgs);
  2119. int WINCAPI _loadds suFormatMessageBox(HINSTANCE hAppInst, HWND hwndParent, LPCSTR lpcText, LPCSTR lpcTitle,
  2120. UINT uStyle, ...);
  2121. WORD WINAPI suErrorToIds( WORD Value, WORD Class );
  2122. /***************************************************************************/
  2123. // setup Version Conflict support
  2124. /***************************************************************************/
  2125. LPVOID WINAPI suVerConflictInit(BOOL fYesToLangMismatch);
  2126. void WINAPI suVerConflictTerm(LPVOID lpvData);
  2127. LRESULT WINAPI suVerConflict(HWND hwnd, LPVCPVERCONFLICT lpvc, BOOL bBackup, LPVOID lpvData);
  2128. int WINAPI sxCompareDosAppVer( LPCSTR lpszOldFileSpec, LPCSTR lpszNewFileSpec);
  2129. /***************************************************************************/
  2130. // setup Help support
  2131. /***************************************************************************/
  2132. BOOL WINAPI suHelp( HWND hwndApp, HWND hwndDlg );
  2133. //***************************************************************************/
  2134. // setup Emergency Boot Disk (EBD) creation fn.
  2135. //***************************************************************************/
  2136. RETERR WINAPI suCreateEBD( HWND hWnd, VIFPROC CopyCallbackProc, LPARAM lpuii, int nCreateEBD );
  2137. //***************************************************************************
  2138. // Misc SETUPX.DLL support functions.
  2139. //***************************************************************************
  2140. enum SU_ACTIONS // Actions msgs for Setupx() /* ;Internal */
  2141. { /* ;Internal */
  2142. SUX_REGINIT, // Intialize registry /* ;Internal */
  2143. SUX_DBGLEVEL, // Set debug level /* ;Internal */
  2144. SUX_SETUPFLG, // Set fIsSetup flag /* ;Internal */
  2145. SUX_FASTSETUP, // Setupx => checking less mode /* ;Internal */
  2146. SUX_FORCEREGFLUSH, // Call kRegFlush /* ;Internal */
  2147. SUX_TPSFLUSH, // Call TPS_Flush() fns. /* ;Internal */
  2148. SUX_DBGHFILE, // File to write messages to /* ;Internal */
  2149. SUX_LOADSTORELDIDS, // Load/store setup's LDID's /* ;Internal */
  2150. SUX_ENABLEREGFLUSH, // Enable/Disable SURegFlush() if fIsSetup /* ;Internal */
  2151. SUX_SETUNCPATHFUNC, // NOW UNUSED!! /* ;Internal */
  2152. SUX_SETTRUEDISKFREEFUNC, // Set TRUE disk free func /* ;Internal */
  2153. SUX_ISFLOPPYBOOT, // Set TRUE if floppy boot disk /* ;Internal */
  2154. SUX_BISVER4, // returns bIsVer4(CHICAGO) flag/* ;Internal */
  2155. SUX_SETCTLCALLBACKFUNC, // Set ctlCopyCallBackProc Func /* ;Internal */
  2156. SUX_GETCTLCALLBACKFUNC, // Get ctlCopyCallBackProc Func /* ;Internal */
  2157. SUX_BISMULTICFG, // returns SETUPX's gfMultiCfg /* ;Internal */
  2158. SUX_DUMPDSINFO, // Dumps diskspace info /* ;Internal */
  2159. SUX_INFCACHEOFF, // Turns INF file caching on/off/* ;Internal */
  2160. SUX_SETFCDROMDRIVEEXISTS, // Set CDRomDriveExists func /* ;Internal */
  2161. SUX_ALLOCRMBUFFERS, // Allocate real mode buffers /* ;Internal */
  2162. SUX_FREERMBUFFERS, // Free real mode buffers /* ;Internal */
  2163. SUX_DODOSEBDWORK, // Do DOS EBD Work /* ;Internal */
  2164. SUX_SETNETDITIP // Set Help Text during Setup /* ;Internal */
  2165. }; /* ;Internal */
  2166. RETERR WINAPI Setupx( UINT uMsg, WPARAM wParam, LPARAM lParam ); /* ;Internal */
  2167. RETERR WINAPI SUStoreLdidPath( LOGDISKID ldid, LPSTR lpszPath ); /* ;Internal */
  2168. BOOL WINAPI sxIsSBSServerFile( LPVIRTNODE lpVn ); /* ;Internal */
  2169. BOOL WINAPI sxMakeUNCPath( LPSTR lpszPath ); /* ;Internal */
  2170. typedef RETERR (CALLBACK* FBFPROC)(LPCSTR lpszFileName, LPVOID lpVoid); /* ;Internal */
  2171. RETERR WINAPI sxFindBatchFiles(HTP,int,FBFPROC,LPVOID); /* ;Internal */
  2172. RETERR WINAPI SUGetSetSetupFlags(LPDWORD lpdwFlags, BOOL bSet);
  2173. RETERR WINAPI CfgSetupMerge( int uFlags );
  2174. BOOL WINAPI sxIsMSDOS7Running();
  2175. BOOL WINAPI IsPanEuropean();
  2176. // structure for the LPARAM argument to Setupx() for SUX_REGINIT action. ;Internal
  2177. typedef struct _REGINIT_S { /* setupx - reg_init */ /* ;Internal */
  2178. LPSTR lpszSystemFile; // reg's base SYSTEM filename /* ;Internal */
  2179. LOGDISKID ldidSystemFile; // ldid for SYSTEM filename /* ;Internal */
  2180. LPSTR lpszUserFile; // reg's base USER filename /* ;Internal */
  2181. LOGDISKID ldidUserFile; // ldid for USER filename /* ;Internal */
  2182. LPSTR lpszClassesFile; // reg's base CLASSES filename /* ;Internal */
  2183. LOGDISKID ldidClassesFile; // ldid for CLASSES filename /* ;Internal */
  2184. } REGINIT_S, FAR *LPREGINIT; /* ;Internal */
  2185. #ifndef LPLPSTR
  2186. typedef LPSTR (FAR *LPLPSTR);
  2187. #endif
  2188. #define CFG_PARSE_BUFLEN 1024 // Buf sized passed line obj funcs /* ;Internal */
  2189. LPLPSTR WINAPI CfgParseLine( LPCSTR szLine, LPSTR Buf ); /* ;Internal */
  2190. BOOL WINAPI CfgSetAutoProcess( int TrueFalse ); /* ;Internal */
  2191. void WINAPI CfgObjToStr( LPLPSTR apszObj, LPSTR szLine ); /* ;Internal */
  2192. LPLPSTR WINAPI CfgLnToObj( HTP hSection, int Offset, int Origin, LPSTR Buf ); /* ;Internal */
  2193. LPLPSTR WINAPI CfgObjFindKeyCmd( HTP hSec, LPCSTR szKey, LPCSTR szCmd, /* ;Internal */
  2194. int Offset, int Origin, LPSTR Buf ); /* ;Internal */
  2195. LPCSTR WINAPI WildCardStrCmpi( LPCSTR szKey, LPCSTR szLine, LPCSTR szDelims ); /* ;Internal */
  2196. RETERR WINAPI GenMapRootRegStr2Key( LPCSTR szRegRoot, HKEY hRegRelKey, /* ;Internal */
  2197. HKEY FAR *lphkeyRoot ); /* ;Internal */
  2198. //***************************************************************************
  2199. //
  2200. // ENUMS for accessing config.sys/autoexec.bat line objects using the
  2201. // array returned by ParseConfigLine()..
  2202. //
  2203. //***************************************************************************
  2204. enum CFGLINE_STRINGS // Config.sys/autoexec.bat objects
  2205. {
  2206. CFG_KEYLEAD, // Keyword leading whitespaces
  2207. CFG_KEYWORD, // Keyword
  2208. CFG_KEYTRAIL, // Keyword trailing delimiters
  2209. CFG_UMBINFO, // Load high info
  2210. CFG_DRVLETTER, // Drive letter for cmd path
  2211. CFG_PATH, // Command path
  2212. CFG_COMMAND, // Command base name
  2213. CFG_EXT, // Command extension including '.'
  2214. CFG_ARGS, // Command arguments
  2215. CFG_FREE, // Free area at end of buffer
  2216. CFG_END
  2217. };
  2218. /*---------------------------------------------------------------------------*
  2219. * SUB String Data
  2220. *---------------------------------------------------------------------------*/
  2221. /*******************************************************************************
  2222. * AUTODOC
  2223. * @doc EXTERNAL SETUPX DEVICE_INSTALLER
  2224. *
  2225. * @types SUBSTR_DATA | Data structure used to manage substrings.
  2226. * struct is used by class installers to extend the operation of the hardware
  2227. * installation wizard by adding custom pages.
  2228. *
  2229. * @field LPSTR | lpFirstSubstr | Pointer to the first substring in the list.
  2230. *
  2231. * @field LPSTR | lpCurSubstr | Pointer to the current substring in the list.
  2232. *
  2233. * @field LPSTR | lpLastSubstr | Pointer to the last substring in the list.
  2234. *
  2235. * @xref InitSubstrData
  2236. * @xref GetFirstSubstr
  2237. * @xref GetNextSubstr
  2238. *
  2239. *******************************************************************************/
  2240. typedef struct _SUBSTR_DATA {
  2241. LPSTR lpFirstSubstr;
  2242. LPSTR lpCurSubstr;
  2243. LPSTR lpLastSubstr;
  2244. } SUBSTR_DATA;
  2245. typedef SUBSTR_DATA* PSUBSTR_DATA;
  2246. typedef SUBSTR_DATA NEAR* NPSUBSTR_DATA;
  2247. typedef SUBSTR_DATA FAR* LPSUBSTR_DATA;
  2248. BOOL WINAPI InitSubstrData(LPSUBSTR_DATA lpSubstrData, LPSTR lpStr);
  2249. BOOL WINAPI GetFirstSubstr(LPSUBSTR_DATA lpSubstrData);
  2250. BOOL WINAPI GetNextSubstr(LPSUBSTR_DATA lpSubStrData);
  2251. BOOL WINAPI InitSubstrDataEx(LPSUBSTR_DATA lpssd, LPSTR lpString, char chDelim); /* ;Internal */
  2252. BOOL WINAPI FirstBootMoveToDOSSTART(LPSTR lpszCmd, BOOL fRemark);
  2253. BOOL WINAPI DOSOptEnableCurCfg(LPCSTR lpszOptKey);
  2254. /*---------------------------------------------------------------------------*
  2255. * Misc. Di functions
  2256. *---------------------------------------------------------------------------*/
  2257. BOOL WINAPI DiBuildPotentialDuplicatesList
  2258. (
  2259. LPDEVICE_INFO lpdi,
  2260. LPSTR lpDuplicateList,
  2261. DWORD cbSize,
  2262. LPDWORD lpcbData,
  2263. LPSTR lpstrDupType
  2264. );
  2265. BOOL _loadds WINAPI WalkSubtree(DWORD dnRoot, LPSTR szDrvLet);
  2266. // PID
  2267. BOOL _loadds WINAPI PidConstruct( LPSTR lpszProductType, LPSTR lpszPID, LPSTR lpszUPI, int iAction);
  2268. BOOL _loadds WINAPI PidValidate( LPSTR lpszProductType, LPSTR lpszPID);
  2269. int _loadds WINAPI WriteDMFBootData(int iDrive, LPSTR pData, int cb);
  2270. // FirstRunScreens
  2271. RETERR WINAPI DoFirstRunScreens();
  2272. BOOL WINAPI GetSetupInfo(LPSTR lpszName, DWORD cbName, LPSTR lpszOrg, DWORD cbOrg, LPSTR lpszOemId, DWORD cbOemId, BOOL * lpbIntlSet);
  2273. BOOL WINAPI SetSetupInfo(LPCSTR lpcszName, LPCSTR lpcszOrg, LPCSTR lpcszProdType, LPCSTR lpcszPid2, LPCSTR lpcszPid3, LPBYTE lpPid3);
  2274. BOOL WINAPI StampUser(LPCSTR lpcszName, LPCSTR lpcszOrg, LPCSTR lpcszPid2);
  2275. BOOL WINAPI GetProductType(LPSTR lpszProduct, LPDWORD lpdwSkuFlags);
  2276. // Audit mode flags.
  2277. //
  2278. #define SX_AUDIT_NONE 0x00000000
  2279. #define SX_AUDIT_NONRESTORE 0x00000001
  2280. #define SX_AUDIT_RESTORE 0x00000002
  2281. #define SX_AUDIT_ENDUSER 0x00000003
  2282. #define SX_AUDIT_AUTO 0x00000100
  2283. #define SX_AUDIT_RESTORATIVE 0x00000200
  2284. #define SX_AUDIT_ALLOWMANUAL 0x00000400
  2285. #define SX_AUDIT_ALLOWENDUSER 0x00000800
  2286. #define SX_AUDIT_MODES 0x000000FF
  2287. #define SX_AUDIT_FLAGS 0x0000FF00
  2288. #define SX_AUDIT_INVALID 0xFFFFFFFF
  2289. // These four audt mode defines need to go away.
  2290. //
  2291. #define NO_AUDIT 0
  2292. #define NONE_RESTORE_AUDIT 1
  2293. #define RESTORE_AUDIT 2
  2294. #define SIMULATE_ENDUSER 3
  2295. DWORD WINAPI GetAuditMode();
  2296. BOOL WINAPI SetAuditMode(DWORD dwAuditFlags);
  2297. // Wizard97 Fonts
  2298. VOID WINAPI InitWiz97Font(HWND hwndCtrl, BOOL bBig);
  2299. // Migration DLLs
  2300. #define SU_MIGRATE_PREINFLOAD 0x00000001 // before the setup INFs are loaded
  2301. #define SU_MIGRATE_POSTINFLOAD 0x00000002 // after the setup INFs are loaded
  2302. #define SU_MIGRATE_DISKSPACE 0x00000010 // request for the amount of additional diskspace needed
  2303. #define SU_MIGRATE_PREQUEUE 0x00000100 // before the INFs are processed and files are queued
  2304. #define SU_MIGRATE_POSTQUEUE 0x00000200 // after INFs are processed
  2305. #define SU_MIGRATE_REBOOT 0x00000400 // just before we are going to reboot for the 1st time
  2306. #define SU_MIGRATE_PRERUNONCE 0x00010000 // before any runonce items are processed
  2307. #define SU_MIGRATE_POSTRUNONCE 0x00020000 // after all runonce items are processed
  2308. DWORD WINAPI sxCallMigrationDLLs( DWORD dwStage, LPARAM lParam );
  2309. void WINAPI _loadds sxCallMigrationDLLs_RunDll(HWND, HINSTANCE, LPSTR, int);
  2310. //Count Down Dlg
  2311. int WINAPI SxShowRebootDlg(UINT, HWND);
  2312. void WINAPI _loadds SxShowRebootDlg_RunDll(HWND, HINSTANCE, LPSTR, int);
  2313. BOOL WINAPI CopyInfFile( LPSTR, LPSTR, UINT );
  2314. BOOL WINAPI IsWindowsFile( LPSTR lpszFile );
  2315. RETERR WINAPI VerifySelectedDriver(LPDEVICE_INFO lpdi, BOOL FAR *pbYesToAll);
  2316. //Dialog positioning function and defn's(wPosFlags)
  2317. #define DLG_CENTERV 0x01
  2318. #define DLG_CENTERH 0x02
  2319. #define DLG_CENTER DLG_CENTERV | DLG_CENTERH
  2320. #define DLG_TOP 0x04
  2321. #define DLG_BOTTOM 0x08
  2322. #define DLG_RIGHT 0x10
  2323. #define DLG_LEFT 0x20
  2324. BOOL WINAPI uiPositionDialog( HWND hwndDlg, WORD wPosFlags );
  2325. //***************************************************************************
  2326. #endif // SETUPX_INC