Source code of Windows XP (NT5)
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.

2705 lines
116 KiB

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