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.

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