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

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