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.

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