Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1255 lines
50 KiB

  1. //**********************************************************************
  2. //
  3. // SETUPX.H
  4. //
  5. // Copyright (c) 1993 - Microsoft Corp.
  6. // All rights reserved.
  7. // Microsoft Confidential
  8. //
  9. // Putlic include file for Chicago Setup services.
  10. //
  11. // 12/1/93 DONALDM Added LPCLASS_INFO, and function protos for
  12. // exports in SETUP4.DLL
  13. // 12/4/94 DONALDM Moved SHELL.H include and Chicago specific
  14. // helper functions to SETUP4.H
  15. //**********************************************************************
  16. #ifndef SETUPX_INC
  17. #define SETUPX_INC 1 // SETUPX.H signature
  18. typedef UINT RETERR; // Return Error code type.
  19. #define OK 0 // success error code
  20. #define IP_ERROR (100) // Inf parsing
  21. #define TP_ERROR (200) // Text processing module
  22. #define VCP_ERROR (300) // Virtual copy module
  23. #define GEN_ERROR (400) // Generic Installer
  24. #define DI_ERROR (500) // Device Installer
  25. // err2ids mappings
  26. enum ERR_MAPPINGS {
  27. E2I_VCPM, // Maps VCPM to strings
  28. E2I_SETUPX, // Maps setupx returns to strings
  29. E2I_SETUPX_MODULE, // Maps setupx returns to appropriate module
  30. E2I_DOS_SOLUTION, // Maps DOS Extended errors to solutions
  31. E2I_DOS_REASON, // Maps DOS extended errors to strings.
  32. E2I_DOS_MEDIA, // Maps DOS extended errors to media icon.
  33. };
  34. #ifndef NOVCP
  35. /***************************************************************************/
  36. //
  37. // Logical Disk ID definitions
  38. //
  39. /***************************************************************************/
  40. // DECLARE_HANDLE(VHSTR); /* VHSTR = VirtCopy Handle to STRing */
  41. typedef UINT VHSTR; /* VirtCopy Handle to String */
  42. VHSTR WINAPI vsmStringAdd(LPCSTR lpszName);
  43. int WINAPI vsmStringDelete(VHSTR vhstr);
  44. VHSTR WINAPI vsmStringFind(LPCSTR lpszName);
  45. int WINAPI vsmGetStringName(VHSTR vhstr, LPSTR lpszBuffer, int cbBuffer);
  46. int WINAPI vsmStringCompare(VHSTR vhstrA, VHSTR vhstrB);
  47. LPCSTR WINAPI vsmGetStringRawName(VHSTR vhstr);
  48. void WINAPI vsmStringCompact(void);
  49. typedef UINT LOGDISKID; /* ldid */
  50. // Logical Disk Descriptor: Structure which describes the physical attributes
  51. // of a logical disk. Every logical disk is assigned a logical disk
  52. // identifier (LDID), and is described by a logical disk descriptor (LDD).
  53. //
  54. // The cbSize structure member must always be set to sizeof(LOGDISKDESC_S),
  55. // but all other unused structure members should be NULL or 0. No validation
  56. // is performed on the size of string arrays; all string pointers, if
  57. // non-NULL and they are to receive a string, must point at string arrays
  58. // whose sizes are as follows:
  59. // sizeof( szPath ) = MAX_PATH_LEN
  60. // sizeof( szVolLabel) = MAX_FILENAME_LEN
  61. // sizeof( szName ) = MAX_STRING_LEN
  62. #define MAX_PATH_LEN 260 // Max. path length.
  63. #define MAX_FILENAME_LEN 20 // Max. filename length. ( > sizeof( "x:\\12345678.123" )
  64. typedef struct _LOGDISKDESC_S { /* ldd */
  65. WORD cbSize; // Size of this structure (bytes)
  66. LOGDISKID ldid; // Logical Disk ID.
  67. LPSTR pszPath; // Ptr. to associated Path string.
  68. LPSTR pszVolLabel; // Ptr. to Volume Label string.
  69. LPSTR pszDiskName; // Ptr. to Disk Name string.
  70. WORD wVolTime; // Volume label modification time.
  71. WORD wVolDate; // Volume label modification date.
  72. DWORD dwSerNum; // Disk serial number.
  73. WORD wFlags; // Flags.
  74. } LOGDISKDESC_S, FAR *LPLOGDISKDESC;
  75. // Range for pre-defined LDIDs.
  76. #define LDID_PREDEF_START 0x0001 // Start of range
  77. #define LDID_PREDEF_END 0x7FFF // End of range
  78. // Range for dynamically assigned LDIDs.
  79. #define LDID_ASSIGN_START 0x8000 // Start of range
  80. #define LDID_ASSIGN_END 0xBFFF // End of range
  81. // Pre-defined Logical Disk Identifiers (LDID).
  82. //
  83. #define LDID_NULL 0 // Null (undefined) LDID.
  84. #define LDID_ABSOLUTE ((UINT)-1) // Absolute path
  85. // source path of windows install, this is typically A:\ or a net drive
  86. #define LDID_SRCPATH 1 // source of instilation
  87. // temporary setup directory used by setup, this is only valid durring
  88. // regular install
  89. #define LDID_SETUPTEMP 2 // temporary setup dir for install
  90. // path to uninstall location, this is where we backup files that will
  91. // be overwritten
  92. #define LDID_UNINSTALL 3 // uninstall (backup) dir.
  93. // backup path for the copy engine, this should not be used
  94. #define LDID_BACKUP 4 // BUGBUG: backup dir for the copy engine, not used
  95. // windows directory, this is the destinatio of the insallation
  96. #define LDID_WIN 10 // destination Windows dir.
  97. #define LDID_SYS 11 // destination Windows System dir.
  98. #define LDID_IOS 12 // destination Windows Iosubsys dir.
  99. #define LDID_CMD 13 // destination Windows Command (DOS) dir.
  100. #define LDID_CPL 14 // destination Windows Control Panel dir.
  101. #define LDID_PRINT 15 // destination Windows Printer dir.
  102. #define LDID_MAIL 16 // destination Mail dir.
  103. #define LDID_INF 17 // destination Windows *.INF dir.
  104. // BUGBUG: do we need the shared dir for net install?
  105. #define LDID_BOOT 30 // Root dir of boot drive
  106. #define LDID_BOOT_HOST 31 // Root dir of boot drive host
  107. #define LDID_OLD_WIN 33 // old windows directory (if it exists)
  108. #define LDID_OLD_DOS 34 // old dos directory (if it exists)
  109. // Convert Ascii drive letter to Integer drive number ('A'=1, 'B'=2, ...).
  110. #define DriveAtoI( chDrv ) ((int)(chDrv & 31))
  111. // Convert Integer drive number to Ascii drive letter (1='A', 2='B', ...).
  112. #define DriveItoA( iDrv ) ((char) (iDrv - 1 + 'A'))
  113. // BUGBUG: change the names of these
  114. RETERR WINAPI CtlSetLdd ( LPLOGDISKDESC );
  115. RETERR WINAPI CtlGetLdd ( LPLOGDISKDESC );
  116. RETERR WINAPI CtlFindLdd ( LPLOGDISKDESC );
  117. RETERR WINAPI CtlAddLdd ( LPLOGDISKDESC );
  118. RETERR WINAPI CtlDelLdd ( LOGDISKID );
  119. RETERR WINAPI CtlGetLddPath ( LOGDISKID, LPSTR );
  120. /***************************************************************************/
  121. //
  122. // Virtual File Copy definitions
  123. //
  124. /***************************************************************************/
  125. typedef DWORD LPEXPANDVTBL; /* BUGBUG -- clean this up */
  126. enum _ERR_VCP
  127. {
  128. ERR_VCP_IOFAIL = (VCP_ERROR + 1), // File I/O failure
  129. ERR_VCP_STRINGTOOLONG, // String length limit exceeded
  130. ERR_VCP_NOMEM, // Insufficient memory to comply
  131. ERR_VCP_NOVHSTR, // No string handles available
  132. ERR_VCP_OVERFLOW, // Reference count would overflow
  133. ERR_VCP_BADARG, // Invalid argument to function
  134. ERR_VCP_UNINIT, // String library not initialized
  135. ERR_VCP_NOTFOUND , // String not found in string table
  136. ERR_VCP_BUSY, // Can't do that now
  137. ERR_VCP_INTERRUPTED, // User interrupted operation
  138. ERR_VCP_BADDEST, // Invalid destination directory
  139. ERR_VCP_SKIPPED, // User skipped operation
  140. ERR_VCP_IO, // Hardware error encountered
  141. ERR_VCP_LOCKED, // List is locked
  142. ERR_VCP_WRONGDISK, // The wrong disk is in the drive
  143. ERR_VCP_CHANGEMODE, //
  144. ERR_VCP_LDDINVALID, // Logical Disk ID Invalid.
  145. ERR_VCP_LDDFIND, // Logical Disk ID not found.
  146. ERR_VCP_LDDUNINIT, // Logical Disk Descriptor Uninitialized.
  147. ERR_VCP_LDDPATH_INVALID,
  148. ERR_VCP_NOEXPANSION, // Failed to load expansion dll
  149. ERR_VCP_NOTOPEN, // Copy session not open
  150. };
  151. /*****************************************************************************
  152. * Structures
  153. *****************************************************************************/
  154. /*---------------------------------------------------------------------------*
  155. * VCPPROGRESS
  156. *---------------------------------------------------------------------------*/
  157. typedef struct tagVCPPROGRESS { /* prg */
  158. DWORD dwSoFar; /* Number of units copied so far */
  159. DWORD dwTotal; /* Number of units to copy */
  160. } VCPPROGRESS, FAR *LPVCPPROGRESS;
  161. /*---------------------------------------------------------------------------*
  162. * VCPDISKINFO
  163. *---------------------------------------------------------------------------*/
  164. /* BUGBUG -- I currently don't use wVolumeTime, wVolumeDate or ;Internal
  165. * dwSerialNumber. We may not want to use dwSerialNumber because ;Internal
  166. * it means that any disk other than the factory originals will be;Internal
  167. * suspected of being tampered with, since the serial number ;Internal
  168. * won't match. Similar with the time/date stamp on the ;Internal
  169. * volume label. Or maybe that's what we want to do. ;Internal
  170. */ /* ;Internal */
  171. /* ;Internal */
  172. typedef struct tagVCPDISKINFO {
  173. WORD cbSize; /* Size of this structure in bytes */
  174. LOGDISKID ldid; /* Logical disk ID */
  175. VHSTR vhstrRoot; /* Location of root directory */
  176. VHSTR vhstrVolumeLabel;/* Volume label */
  177. VHSTR vhstrDiskName; // Printed name on the disk.
  178. WORD wVolumeTime; /* Volume label modification time */
  179. WORD wVolumeDate; /* Volume label modification date */
  180. DWORD dwSerialNumber; /* Disk serial number */
  181. WORD fl; /* Flags */
  182. LPARAM lparamRef; /* Reference data for client */
  183. VCPPROGRESS prgFileRead; /* Progress info */
  184. VCPPROGRESS prgByteRead;
  185. VCPPROGRESS prgFileWrite;
  186. VCPPROGRESS prgByteWrite;
  187. } VCPDISKINFO, FAR *LPVCPDISKINFO;
  188. #define VDIFL_VALID 0x0001 /* Fields are valid from a prev. call */
  189. #define VDIFL_EXISTS 0x0002 /* Disk exists; do not format */
  190. RETERR WINAPI DiskInfoFromLdid(LOGDISKID ldid, LPVCPDISKINFO lpdi);
  191. /*---------------------------------------------------------------------------*
  192. * VCPFILESPEC
  193. *---------------------------------------------------------------------------*/
  194. typedef struct tagVCPFILESPEC { /* vfs */
  195. LOGDISKID ldid; /* Logical disk */
  196. VHSTR vhstrDir; /* Directory withing logical disk */
  197. VHSTR vhstrFileName; /* Filename within directory */
  198. } VCPFILESPEC, FAR *LPVCPFILESPEC;
  199. /*---------------------------------------------------------------------------*
  200. * VCPFATTR
  201. *---------------------------------------------------------------------------*/
  202. /*
  203. * BUGBUG -- explain diffce between llenIn and llenOut wrt compression.
  204. */
  205. typedef struct tagVCPFATTR {
  206. UINT uiMDate; /* Modification date */
  207. UINT uiMTime; /* Modification time */
  208. UINT uiADate; /* Access date */
  209. UINT uiATime; /* Access time */
  210. UINT uiAttr; /* File attribute bits */
  211. DWORD llenIn; /* Original file length */
  212. DWORD llenOut; /* Final file length */
  213. /* (after decompression) */
  214. } VCPFATTR, FAR *LPVCPFATTR;
  215. /*---------------------------------------------------------------------------*
  216. * VIRTNODEEX
  217. *---------------------------------------------------------------------------*/
  218. typedef struct tagVIRTNODEEX
  219. { /* vnex */
  220. HFILE hFileSrc;
  221. HFILE hFileDst;
  222. VCPFATTR fAttr;
  223. WORD dosError; // The first/last error encountered
  224. VHSTR vhstrFileName; // The original destination name.
  225. WPARAM vcpm; // The message that was being processed.
  226. } VIRTNODEEX, FAR *LPCVIRTNODEEX, FAR *LPVIRTNODEEX ;
  227. /*---------------------------------------------------------------------------*
  228. * VIRTNODE
  229. *---------------------------------------------------------------------------*/
  230. /* WARNING! ;Internal
  231. * All fields through but not including ;Internal
  232. * fl are memcmp'd to determine if we have a duplicate copy ;Internal
  233. * request. ;Internal
  234. * ;Internal
  235. * Do not insert fields before fl unless you want them to be ;Internal
  236. * compared; conversely, if you add a new field that needs to ;Internal
  237. * be compared, make sure it goes before fl. ;Internal
  238. * ;Internal
  239. * And don't change any of the fields once Windows 4.0 ships. ;Internal
  240. */ /* ;Internal */
  241. /* ;Internal */
  242. typedef struct tagVIRTNODE { /* vn */
  243. WORD cbSize;
  244. VCPFILESPEC vfsSrc;
  245. VCPFILESPEC vfsDst;
  246. WORD fl;
  247. LPARAM lParam;
  248. LPEXPANDVTBL lpExpandVtbl;
  249. LPVIRTNODEEX lpvnex;
  250. } VIRTNODE, FAR *LPCVIRTNODE, FAR *LPVIRTNODE ;
  251. /*---------------------------------------------------------------------------*
  252. * VCPDESTINFO
  253. *---------------------------------------------------------------------------*/
  254. typedef struct tagVCPDESTINFO { /* destinfo */
  255. WORD flDevAttr; /* Device attributes */
  256. LONG cbCapacity; /* Disk capacity */
  257. WORD cbCluster; /* Bytes per cluster */
  258. WORD cRootDir; /* Size of root directory */
  259. } VCPDESTINFO, FAR *LPVCPDESTINFO;
  260. #define DIFL_FIXED 0x0001 /* Nonremoveable media */
  261. #define DIFL_CHANGELINE 0x0002 /* Change line support */
  262. // Now also used by the virtnode as we dont have copy nodes any more.
  263. // #define CNFL_BACKUP 0x0001 /* This is a backup node */
  264. #define CNFL_DELETEONFAILURE 0x0002 /* Dest should be deleted on failure */
  265. #define CNFL_RENAMEONSUCCESS 0x0004 /* Dest needs to be renamed */
  266. #define CNFL_CONTINUATION 0x0008 /* Dest is continued onto difft disk */
  267. #define CNFL_SKIPPED 0x0010 /* User asked to skip file */
  268. #define CNFL_IGNOREERRORS 0x0020 // An error has occured on this file already
  269. #define CNFL_RETRYFILE 0x0040 // Retry the file (error ocurred)
  270. // BUGBUG: verify the use and usefullness of these flags
  271. // #define VNFL_UNIQUE 0x0000 /* Default */
  272. #define VNFL_MULTIPLEOK 0x0100 /* Do not search PATH for duplicates */
  273. #define VNFL_DESTROYOLD 0x0200 /* Do not back up files */
  274. #define VNFL_NOW 0x0400 /* Use by vcp Flush */
  275. #define VNFL_DELETE 0x0800 // A delete node
  276. #define VNFL_RENAME 0x1000 // A rename node
  277. /* Read-only flag bits */
  278. #define VNFL_CREATED 0x2000 /* VCPM_NODECREATE has been sent */
  279. #define VNFL_REJECTED 0x4000 /* Node has been rejected */
  280. #define VNFL_VALIDVQCFLAGS 0xff00 /* ;Internal */
  281. /*---------------------------------------------------------------------------*
  282. * VCPSTATUS
  283. *---------------------------------------------------------------------------*/
  284. typedef struct tagVCPSTATUS { /* vstat */
  285. WORD cbSize; /* Size of this structure */
  286. VCPPROGRESS prgDiskRead;
  287. VCPPROGRESS prgFileRead;
  288. VCPPROGRESS prgByteRead;
  289. VCPPROGRESS prgDiskWrite;
  290. VCPPROGRESS prgFileWrite;
  291. VCPPROGRESS prgByteWrite;
  292. LPVCPDISKINFO lpvdiIn; /* Current input disk */
  293. LPVCPDISKINFO lpvdiOut; /* Current output disk */
  294. LPVIRTNODE lpvn; /* Current file */
  295. } VCPSTATUS, FAR *LPVCPSTATUS;
  296. /*---------------------------------------------------------------------------*
  297. * VCPVERCONFLICT
  298. *---------------------------------------------------------------------------*/
  299. typedef struct tagVCPVERCONFLICT {
  300. LPCSTR lpszOldFileName;
  301. LPCSTR lpszNewFileName;
  302. DWORD dwConflictType; /* Same values as VerInstallFiles */
  303. LPVOID lpvinfoOld; /* Version information resources */
  304. LPVOID lpvinfoNew;
  305. WORD wAttribOld; /* File attributes for original */
  306. LPARAM lparamRef; /* Reference data for callback */
  307. } VCPVERCONFLICT, FAR *LPVCPVERCONFLICT;
  308. /*****************************************************************************
  309. * Callback functions
  310. *****************************************************************************/
  311. typedef LRESULT (CALLBACK *VIFPROC)(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  312. LRESULT CALLBACK vcpDefCallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  313. // callback for default UI.
  314. // lparamRef --> a VCPUIINFO structure
  315. LRESULT CALLBACK vcpUICallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  316. /*---------------------------------------------------------------------------*
  317. * VCPUIINFO
  318. *
  319. * This structure is passed in as the lparamRef of vcpUICallbackProc.
  320. *
  321. * on using vcpUICallbackProc:
  322. * - to use, have vcpUICallbackProc as the callback for vcpOpen with
  323. * an appropriately filled in VCPUIINFO structure as the lparamRef.
  324. *
  325. * - based on flags, hwndProgress is created and maintained
  326. * - lpfnStatCallback is called with only status messages
  327. * returning VCPM_ABORT indicates that the copy should be aborted
  328. * - if hwndProgress is non-NULL, the control with idProgress will
  329. * receive progress gauge messages as appropriate
  330. *
  331. *---------------------------------------------------------------------------*/
  332. #define VCPUI_CREATEPROGRESS 0x0001 // callback should create and manage progress gauge dialog
  333. #define VCPUI_NOBROWSE 0x0002 // no browse button in InsertDisk
  334. #define VCPUI_RENAMEREQUIRED 0x0004 // as a result of a file being in use at copy, reboot required
  335. typedef struct {
  336. UINT flags;
  337. HWND hwndParent; // window of parent
  338. HWND hwndProgress; // window to get progress updates (nonzero ids)
  339. UINT idPGauge; // id for progress gauge
  340. VIFPROC lpfnStatCallback; // callback for status info (or NULL)
  341. LPARAM lUserData; // caller definable data
  342. LOGDISKID ldidCurrent; // reserved. do not touch.
  343. } VCPUIINFO, FAR *LPVCPUIINFO;
  344. /******************************************************************************
  345. * Callback notification codes
  346. *****************************************************************************/
  347. /* BUGBUG -- VCPN_ABORT should match VCPERROR_INTERRUPTED */
  348. #define VCPN_OK 0 /* All is hunky-dory */
  349. #define VCPN_PROCEED 0 /* The same as VCPN_OK */
  350. #define VCPN_ABORT (-1) /* Cancel current operation */
  351. #define VCPN_RETRY (-2) /* Retry current operation */
  352. #define VCPN_IGNORE (-3) /* Ignore error and continue */
  353. #define VCPN_SKIP (-4) /* Skip this file and continue */
  354. #define VCPN_FORCE (-5) /* Force an action */
  355. #define VCPN_DEFER (-6) /* Save the action for later */
  356. #define VCPN_FAIL (-7) /* Return failure back to caller */
  357. #define VCPN_RETRYFILE (-8) // An error ocurred during file copy, do it again.
  358. /*****************************************************************************
  359. * Callback message numbers
  360. *****************************************************************************/
  361. #define VCPM_CLASSOF(uMsg) HIBYTE(uMsg)
  362. #define VCPM_TYPEOF(uMsg) (0x00FF & (uMsg)) // LOBYTE(uMsg)
  363. /*---------------------------------------------------------------------------*
  364. * ERRORs
  365. *---------------------------------------------------------------------------*/
  366. #define VCPM_ERRORCLASSDELTA 0x80
  367. #define VCPM_ERRORDELTA 0x8000 /* Where the errors go */
  368. /*---------------------------------------------------------------------------*
  369. * Disk information callbacks
  370. *---------------------------------------------------------------------------*/
  371. #define VCPM_DISKCLASS 0x01
  372. #define VCPM_DISKFIRST 0x0100
  373. #define VCPM_DISKLAST 0x01FF
  374. enum tagVCPM_DISK {
  375. VCPM_DISKCREATEINFO = VCPM_DISKFIRST,
  376. VCPM_DISKGETINFO,
  377. VCPM_DISKDESTROYINFO,
  378. VCPM_DISKPREPINFO,
  379. VCPM_DISKENSURE,
  380. VCPM_DISKPROMPT,
  381. VCPM_DISKFORMATBEGIN,
  382. VCPM_DISKFORMATTING,
  383. VCPM_DISKFORMATEND,
  384. /* Remaining messages reserved for future use */
  385. };
  386. /*---------------------------------------------------------------------------*
  387. * File copy callbacks
  388. *---------------------------------------------------------------------------*/
  389. // BUGBUG: this needs to be merged back with other internal errors
  390. #define VCPERROR_IO (VCP_ERROR - ERR_VCP_IO) /* Hardware error encountered */
  391. #define VCPM_FILEINCLASS 0x02
  392. #define VCPM_FILEOUTCLASS 0x03
  393. #define VCPM_FILEFIRSTIN 0x0200
  394. #define VCPM_FILEFIRSTOUT 0x0300
  395. #define VCPM_FILELAST 0x03FF
  396. enum tagVCPM_FILE {
  397. VCPM_FILEOPENIN = VCPM_FILEFIRSTIN,
  398. VCPM_FILEGETFATTR,
  399. VCPM_FILECLOSEIN,
  400. VCPM_FILECOPY,
  401. VCPM_FILEOPENOUT = VCPM_FILEFIRSTOUT,
  402. VCPM_FILESETFATTR,
  403. VCPM_FILECLOSEOUT,
  404. VCPM_FILEFINALIZE,
  405. VCPM_FILEDELETE,
  406. VCPM_FILERENAME,
  407. /* Remaining messages reserved for future use */
  408. };
  409. /*---------------------------------------------------------------------------*
  410. * VIRTNODE callbacks
  411. *---------------------------------------------------------------------------*/
  412. #define VCPM_NODECLASS 0x04
  413. #define VCPM_NODEFIRST 0x0400
  414. #define VCPM_NODELAST 0x04FF
  415. enum tagVCPM_NODE {
  416. VCPM_NODECREATE = VCPM_NODEFIRST,
  417. VCPM_NODEACCEPT,
  418. VCPM_NODEREJECT,
  419. VCPM_NODEDESTROY,
  420. VCPM_NODECHANGEDESTDIR,
  421. VCPM_NODECOMPARE,
  422. /* Remaining messages reserved for future use */
  423. };
  424. /*---------------------------------------------------------------------------*
  425. * TALLY callbacks
  426. *---------------------------------------------------------------------------*/
  427. #define VCPM_TALLYCLASS 0x05
  428. #define VCPM_TALLYFIRST 0x0500
  429. #define VCPM_TALLYLAST 0x05FF
  430. enum tagVCPM_TALLY {
  431. VCPM_TALLYSTART = VCPM_TALLYFIRST,
  432. VCPM_TALLYEND,
  433. VCPM_TALLYFILE,
  434. VCPM_TALLYDISK,
  435. /* Remaining messages reserved for future use */
  436. };
  437. /*---------------------------------------------------------------------------*
  438. * VER callbacks
  439. *---------------------------------------------------------------------------*/
  440. #define VCPM_VERCLASS 0x06
  441. #define VCPM_VERFIRST 0x0600
  442. #define VCPM_VERLAST 0x06FF
  443. enum tagVCPM_VER {
  444. VCPM_VERCHECK = VCPM_VERFIRST,
  445. VCPM_VERCHECKDONE,
  446. VCPM_VERRESOLVECONFLICT,
  447. /* Remaining messages reserved for future use */
  448. };
  449. /*---------------------------------------------------------------------------*
  450. * VSTAT callbacks
  451. *---------------------------------------------------------------------------*/
  452. #define VCPM_VSTATCLASS 0x07
  453. #define VCPM_VSTATFIRST 0x0700
  454. #define VCPM_VSTATLAST 0x07FF
  455. enum tagVCPM_VSTAT {
  456. VCPM_VSTATSTART = VCPM_VSTATFIRST,
  457. VCPM_VSTATEND,
  458. VCPM_VSTATREAD,
  459. VCPM_VSTATWRITE,
  460. VCPM_VSTATNEWDISK,
  461. VCPM_VSTATCLOSESTART, // Start of VCP close
  462. VCPM_VSTATCLOSEEND, // upon leaving VCP close
  463. VCPM_VSTATBACKUPSTART, // Backup is beginning
  464. VCPM_VSTATBACKUPEND, // Backup is finished
  465. VCPM_VSTATRENAMESTART, // Rename phase start/end
  466. VCPM_VSTATRENAMEEND,
  467. VCPM_VSTATCOPYSTART, // Acutal copy phase
  468. VCPM_VSTATCOPYEND,
  469. VCPM_VSTATDELETESTART, // Delete phase
  470. VCPM_VSTATDELETEEND,
  471. VCPM_VSTATPATHCHECKSTART, // Check for valid paths
  472. VCPM_VSTATPATHCHECKEND,
  473. /* Remaining messages reserved for future use */
  474. };
  475. /*---------------------------------------------------------------------------*
  476. * Destination info callbacks
  477. *---------------------------------------------------------------------------*/
  478. /* BUGBUG -- find a reasonable message range for this */
  479. #define VCPM_PATHCLASS 0x08
  480. #define VCPM_PATHFIRST 0x0800
  481. #define VCPM_PATHLAST 0x08FF
  482. enum tagVCPM_PATH{
  483. VCPM_BUILDPATH = VCPM_PATHFIRST,
  484. VCPM_UNIQUEPATH,
  485. VCPM_CHECKPATH,
  486. };
  487. // #define VCPM_BUILDPATH 0x83
  488. /*****************************************************************************/
  489. RETERR WINAPI VcpOpen(VIFPROC vifproc, LPARAM lparamMsgRef);
  490. RETERR WINAPI VcpClose(WORD fl, LPCSTR lpszBackupDest);
  491. RETERR WINAPI VcpFlush(WORD fl, LPCSTR lpszBackupDest);
  492. #define VCPFL_ABANDON 0x0000 /* Abandon all pending file copies */
  493. #define VCPFL_BACKUP 0x0001 /* Perform backup */
  494. #define VCPFL_COPY 0x0002 /* Copy files */
  495. #define VCPFL_BACKUPANDCOPY (VCPFL_BACKUP | VCPFL_COPY)
  496. #define VCPFL_INSPECIFIEDORDER 0x0004 /* Do not sort before copying */
  497. #define VCPFL_DELETE 0x0008
  498. #define VCPFL_RENAME 0x0010
  499. typedef int (CALLBACK *VCPENUMPROC)(LPVIRTNODE lpvn, LPARAM lparamRef);
  500. int WINAPI vcpEnumFiles(VCPENUMPROC vep, LPARAM lparamRef);
  501. /* Flag bits that can be set via VcpQueueCopy */
  502. // Various Lparams for files
  503. #define VNLP_SYSCRITICAL 0x0001 // This file cannot be skipped
  504. // VcpEnumFiles Flags.
  505. #define VEN_OP 0x00ff /* Operation field */
  506. #define VEN_NOP 0x0000 /* Do nothing */
  507. #define VEN_DELETE 0x0001 /* Delete current item */
  508. #define VEN_SET 0x0002 /* Change value of current item */
  509. #define VEN_ADVANCE 0x0003 /* Move to head of list */ /* ;Internal */
  510. #define VEN_FL 0xff00 /* Flags field */
  511. #define VEN_STOP 0x0100 /* Stop enumeration after this item */
  512. #define VEN_ERROR 0x8000 /* Stop enumeration after this item
  513. * and ignore the OP field */
  514. // BUGBUG: add the other VCP stuff necessary to use this
  515. // BUGBUG: remove the lpsz*Dir fields, make overload the LDID with them
  516. RETERR WINAPI VcpQueueCopy(LPCSTR lpszSrcFileName, LPCSTR lpszDstFileName,
  517. LPCSTR lpszSrcDir, LPCSTR lpszDstDir,
  518. LOGDISKID ldidSrc, LOGDISKID ldidDst,
  519. LPEXPANDVTBL lpExpandVtbl, WORD fl,
  520. LPARAM lParam);
  521. RETERR WINAPI VcpQueueDelete( LPCSTR lpszDstFileName,
  522. LPCSTR lpszDstDir,
  523. LOGDISKID ldidDst,
  524. LPARAM lParamRef );
  525. RETERR WINAPI VcpQueueRename( LPCSTR lpszSrcFileName,
  526. LPCSTR lpszDstFileName,
  527. LPCSTR lpszSrcDir,
  528. LPCSTR lpszDstDir,
  529. LOGDISKID ldidSrc,
  530. LOGDISKID ldidDst,
  531. LPARAM lParam );
  532. #endif // NOVCP
  533. #ifndef NOINF
  534. /***************************************************************************/
  535. //
  536. // Inf Parser API declaration and definitions
  537. //
  538. /***************************************************************************/
  539. enum _ERR_IP
  540. {
  541. ERR_IP_INVALID_FILENAME = (IP_ERROR + 1),
  542. ERR_IP_ALLOC_ERR,
  543. ERR_IP_INVALID_SECT_NAME,
  544. ERR_IP_OUT_OF_HANDLES,
  545. ERR_IP_INF_NOT_FOUND,
  546. ERR_IP_INVALID_INFFILE,
  547. ERR_IP_INVALID_HINF,
  548. ERR_IP_INVALID_FIELD,
  549. ERR_IP_SECT_NOT_FOUND,
  550. ERR_IP_END_OF_SECTION,
  551. ERR_IP_PROFILE_NOT_FOUND,
  552. ERR_IP_LINE_NOT_FOUND,
  553. ERR_IP_FILEREAD,
  554. ERR_IP_TOOMANYINFFILES,
  555. ERR_IP_INVALID_SAVERESTORE,
  556. ERR_IP_INVALID_INFTYPE
  557. };
  558. #define INFTYPE_TEXT 0
  559. #define INFTYPE_EXECUTABLE 1
  560. #define MAX_SECT_NAME_LEN 32
  561. typedef struct _INF NEAR * HINF;
  562. typedef struct _INFLINE FAR * HINFLINE; // tolken to inf line
  563. RETERR WINAPI IpOpen(LPCSTR pszFileSpec, HINF FAR * lphInf);
  564. RETERR WINAPI IpOpenEx(LPCSTR pszFileSpec, HINF FAR * lphInf, UINT InfType);
  565. RETERR WINAPI IpOpenAppend(LPCSTR pszFileSpec, HINF hInf);
  566. RETERR WINAPI IpOpenAppendEx(LPCSTR pszFileSpec, HINF hInf, UINT InfType);
  567. RETERR WINAPI IpSaveRestorePosition(HINF hInf, BOOL bSave);
  568. RETERR WINAPI IpClose(HINF hInf);
  569. RETERR WINAPI IpGetLineCount(HINF hInf, LPCSTR lpszSection, int FAR * lpCount);
  570. RETERR WINAPI IpFindFirstLine(HINF hInf, LPCSTR lpszSect, LPCSTR lpszKey, HINFLINE FAR * lphRet);
  571. RETERR WINAPI IpFindNextLine(HINF hInf, HINFLINE FAR * lphRet);
  572. RETERR WINAPI IpFindNextMatchLine(HINF hInf, LPCSTR lpszKey, HINFLINE FAR * lphRet);
  573. RETERR WINAPI IpGetProfileString(HINF hInf, LPCSTR lpszSec, LPCSTR lpszKey, LPSTR lpszBuf, int iBufSize);
  574. RETERR WINAPI IpGetFieldCount(HINF hInf, HINFLINE hInfLine, int FAR * lpCount);
  575. RETERR WINAPI IpGetFileName(HINF hInf, LPSTR lpszBuf, int iBufSize);
  576. RETERR WINAPI IpGetIntField(HINF hInf, HINFLINE hInfLine, int iField, int FAR * lpVal);
  577. RETERR WINAPI IpGetLongField(HINF hInf, HINFLINE hInfLine, int iField, long FAR * lpVal);
  578. RETERR WINAPI IpGetStringField(HINF hInf, HINFLINE hInfLine, int iField, LPSTR lpBuf, int iBufSize, int FAR * lpuCount);
  579. #endif // NOINF
  580. #ifndef NOTEXTPROC
  581. /***************************************************************************/
  582. //
  583. // Text processing API declaration and definitions
  584. //
  585. /***************************************************************************/
  586. /* Relative/absolute positioning */
  587. #define SEC_SET 1 // Absolute positioning (relative to the start)
  588. #define SEC_END 2 // Realtive to the end
  589. #define SEC_CUR 3 // Relative to the current line.
  590. #define SEC_OPENALWAYS 1 // Always open a section, no error if it does not exist
  591. #define SEC_OPENEXISTING 2 // Open an existing section, an error given if it does not exist.
  592. #define SEC_OPENNEWALWAYS 3 // Open a section (present or not) and discard its contents.
  593. #define SEC_OPENNEWEXISTING 4 // Open an existing section (discarding its contents). Error if not existing
  594. // Flags for TP_OpenFile() to specify how to handle various differences in file types
  595. #define TP_WS_IGNORE 0 // Use only "=" as key delimiter (.INI)
  596. #define TP_WS_KEEP 1 // Use autoexec/config.sys key delimiters
  597. // The following are simple errors
  598. enum {
  599. ERR_TP_NOT_FOUND = (TP_ERROR + 1), // line, section, file etc.
  600. // not necessarily terminal
  601. ERR_TP_NO_MEM, // couldn't perform request - generally terminal
  602. ERR_TP_READ, // could not read the disc - terminal
  603. ERR_TP_WRITE, // could not write the data - terminal.
  604. ERR_TP_INVALID_REQUEST, // Multitude of sins - not necessarily terminal.
  605. ERR_TP_INVALID_LINE // Invalid line from DELETE_LINE etc.
  606. };
  607. /* Data handles */
  608. DECLARE_HANDLE(HTP);
  609. typedef HTP FAR * LPHTP;
  610. /* File handles */
  611. DECLARE_HANDLE(HFN);
  612. typedef HFN FAR * LPHFN;
  613. typedef UINT TFLAG;
  614. typedef UINT LINENUM, FAR * LPLINENUM;
  615. #define LINE_LEN 256 // BUGBUG: max line length?
  616. #define SECTION_LEN 32 // BUGBUG: max length of a section name?
  617. #define MAX_STRING_LEN 512 // BUGBUG: review this
  618. /* Function prototypes */
  619. RETERR WINAPI TpOpenFile(LPCSTR Filename, LPHFN phFile, TFLAG Flag);
  620. RETERR WINAPI TpCloseFile(HFN hFile);
  621. RETERR WINAPI TpOpenSection(HFN hfile, LPHTP phSection, LPCSTR Section, TFLAG flag);
  622. RETERR WINAPI TpCloseSection(HTP Section);
  623. RETERR WINAPI TpCommitSection(HFN hFile, HTP hSection, LPCSTR Section, TFLAG flag);
  624. LINENUM WINAPI TpGetLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, LPLINENUM lpLineNum );
  625. LINENUM WINAPI TpGetNextLine(HTP hSection, LPCSTR key, LPCSTR value, LPLINENUM lpLineNum );
  626. RETERR WINAPI TpInsertLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, TFLAG flag);
  627. RETERR WINAPI TpReplaceLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, TFLAG flag);
  628. RETERR WINAPI TpDeleteLine(HTP hSection, int rel, int orig,TFLAG flag);
  629. RETERR WINAPI TpMoveLine(HTP hSection, int src_rel, int src_orig, int dest_rel, int dest_orig, TFLAG flag);
  630. RETERR WINAPI TpGetLineContents(HTP hSection, LPSTR buffer, UINT bufsize, UINT FAR * lpActualSize,int rel, int orig, TFLAG flag);
  631. RETERR WINAPI TpEnumerateSectionNames(LPCSTR Filename, LPCSTR Section, LPSTR buffer, UINT bufsize, UINT FAR * lpActualSize, TFLAG flag);
  632. RETERR WINAPI TpGetRawSection(LPSTR Filename, LPSTR Section, LPSTR buffer, UINT bufsize, UINT FAR * lpActualSize, TFLAG flag);
  633. RETERR WINAPI TpWriteRawSection(LPSTR Filename, LPSTR Section, LPCSTR buffer, TFLAG flag);
  634. // UINT WINAPI TpGetWindowsDirectory(LPSTR lpDest, UINT size);
  635. // UINT WINAPI TpGetSystemDirectory(LPSTR lpDest, UINT size);
  636. int WINAPI TpGetPrivateProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszDefault, LPSTR lpszReturn, int nSize, LPCSTR lpszFile);
  637. int WINAPI TpWritePrivateProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszString, LPCSTR lpszFile);
  638. int WINAPI TpGetProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszDefault, LPSTR lpszReturn, int nSize);
  639. BOOL WINAPI TpWriteProfileString(LPCSTR lpszSect , LPCSTR lpszKey , LPCSTR lpszString);
  640. #endif // NOTEXTPROC
  641. #ifndef NOGENINSTALL
  642. /***************************************************************************/
  643. //
  644. // Generic Installer prototypes and definitions
  645. //
  646. /***************************************************************************/
  647. enum _ERR_GENERIC
  648. {
  649. ERR_GEN_ERROR_EXIT= GEN_ERROR, // Exit due to error.
  650. ERR_GEN_LOW_MEM, // Insufficient Memory.
  651. ERR_GEN_MEM_OTHER, // Unable to lock memory, etc.
  652. ERR_GEN_FILE_OPEN, // File not found.
  653. ERR_GEN_FILE_COPY, // Cannot copy file.
  654. ERR_GEN_FILE_DEL, // Cannot delete file.
  655. ERR_GEN_FILE_REN, // Cannot delete file.
  656. ERR_GEN_INVALID_FILE, // Invalid file.
  657. ERR_GEN_REG_API, // Error returned by Reg API.
  658. };
  659. // The cbSize field will always be set to sizeof(GENCALLBACKINFO_S).
  660. // All unused fields (for the operation) will be not be initialized.
  661. // For example, when the operation is GENO_DELFILE, the Src fields will
  662. // not have any sensible values (Dst fields will be set correctly) as
  663. // VcpQueueDelete only accepts Dst parameters.
  664. //
  665. /***************************************************************************
  666. * GenCallbackINFO structure passed to GenInstall CallBack functions.
  667. ***************************************************************************/
  668. typedef struct _GENCALLBACKINFO_S { /* gen-callback struc */
  669. WORD cbSize; // Size of this structure (bytes).
  670. WORD wOperation; // Operation being performed.
  671. LOGDISKID ldidSrc; // Logical Disk ID for Source.
  672. LPCSTR pszSrcSubDir; // Source sub-dir off of the LDID.
  673. LPCSTR pszSrcFileName; // Source file name (base name).
  674. LOGDISKID ldidDst; // Logical Disk ID for Dest.
  675. LPCSTR pszDstSubDir; // Dest. sub-dir off of the LDID.
  676. LPCSTR pszDstFileName; // Dest. file name (base name).
  677. LPEXPANDVTBL lpExpandVtbl; // BUGBUG needed? NULL right now!
  678. WORD wflags; // flags for VcpQueueCopy.
  679. LPARAM lParam; // LPARAM to the Vcp API.
  680. } GENCALLBACKINFO_S, FAR *LPGENCALLBACKINFO;
  681. /***************************************************************************
  682. * GenCallback notification codes -- callback proc returns 1 of foll. values.
  683. ***************************************************************************/
  684. #define GENN_OK 0 /* All is hunky-dory. Do the VCP operation */
  685. #define GENN_PROCEED 0 /* The same as GENN_OK */
  686. #define GENN_ABORT (-1) /* Cancel current GenInstall altogether */
  687. #define GENN_SKIP (-2) /* Skip this file and continue */
  688. /***************************************************************************
  689. * VCP Operation being performed by GenInstall() -- wOperation values in
  690. * GENCALLBACKINFO structure above.
  691. ***************************************************************************/
  692. #define GENO_COPYFILE 1 /* VCP copyfile being done */
  693. #define GENO_DELFILE 2 /* VCP delfile being done */
  694. #define GENO_RENFILE 3 /* VCP renfile being done */
  695. typedef LRESULT (CALLBACK *GENCALLBACKPROC)(LPGENCALLBACKINFO lpGenInfo,
  696. LPARAM lparamRef);
  697. RETERR WINAPI GenInstall( HINF hinfFile, LPCSTR szInstallSection, WORD wFlags );
  698. RETERR WINAPI GenInstallEx( HINF hInf, LPCSTR szInstallSection, WORD wFlags,
  699. HKEY hRegKey, GENCALLBACKPROC CallbackProc,
  700. LPARAM lparam);
  701. RETERR WINAPI GenWinInitRename(LPCSTR szNew, LPSTR szOld, LOGDISKID ldid);
  702. RETERR WINAPI GenCopyLogConfig2Reg(HINF hInf, HKEY hRegKey,
  703. LPCSTR szLogConfigSection);
  704. void WINAPI GenFormStrWithoutPlaceHolders( LPSTR szDst, LPCSTR szSrc,
  705. HINF hInf ) ;
  706. // Bit fields for GenInstall() (for wFlags parameter) -- these can be OR-ed!
  707. #define GENINSTALL_DO_FILES 1
  708. #define GENINSTALL_DO_INI 2
  709. #define GENINSTALL_DO_REG 4
  710. #define GENINSTALL_DO_CFGAUTO 8
  711. #define GENINSTALL_DO_LOGCONFIG 16
  712. #define GENINSTALL_DO_INIREG (GENINSTALL_DO_INI | GENINSTALL_DO_REG)
  713. #define GENINSTALL_DO_ALL (GENINSTALL_DO_FILES | \
  714. GENINSTALL_DO_INIREG | \
  715. GENINSTALL_DO_CFGAUTO | \
  716. GENINSTALL_DO_LOGCONFIG)
  717. #endif // NOGENINSTALL
  718. #ifndef NODEVICENSTALL
  719. /***************************************************************************/
  720. //
  721. // Device Installer prototypes and definitions
  722. //
  723. /***************************************************************************/
  724. enum _ERR_DEVICE_INSTALL
  725. {
  726. ERR_DI_INVALID_DEVICE_ID = DI_ERROR, // Incorrectly formed device IDF
  727. ERR_DI_INVALID_COMPATIBLE_DEVICE_LIST, // Invalid compatible device list
  728. ERR_DI_REG_API, // Error returned by Reg API.
  729. ERR_DI_LOW_MEM, // Insufficient memory to complete
  730. ERR_DI_BAD_DEV_INFO, // Device Info struct invalid
  731. ERR_DI_INVALID_CLASS_INSTALLER, // Registry entry / DLL invalid
  732. ERR_DI_DO_DEFAULT, // Take default action
  733. ERR_DI_USER_CANCEL, // the user cancelled the operation
  734. ERR_DI_NOFILECOPY, // No need to copy files (in install)
  735. ERR_DI_BAD_CLASS_INFO, // Class Info Struct invalid
  736. };
  737. typedef struct _DRIVER_NODE {
  738. struct _DRIVER_NODE FAR* lpNextDN;
  739. UINT Rank;
  740. UINT InfType;
  741. unsigned InfDate;
  742. LPSTR lpszDescription;
  743. LPSTR lpszSectionName;
  744. ATOM atInfFileName;
  745. ATOM atMfgName;
  746. ATOM atProviderName;
  747. DWORD Flags;
  748. DWORD dwPrivateData;
  749. } DRIVER_NODE, NEAR* PDRIVER_NODE, FAR* LPDRIVER_NODE, FAR* FAR* LPLPDRIVER_NODE;
  750. #define DNF_DUPDESC 0x00000001 // Multiple providers have same desc
  751. // possible types of "INF" files
  752. #define INFTYPE_WIN4 1
  753. #define INFTYPE_WIN3 2
  754. #define INFTYPE_COMBIDRV 3
  755. #define INFTYPE_PPD 4
  756. #define INFTYPE_WPD 5
  757. #define INFTYPE_CLASS_SPEC1 6
  758. #define INFTYPE_CLASS_SPEC2 7
  759. #define INFTYPE_CLASS_SPEC3 8
  760. #define INFTYPE_CLASS_SPEC4 9
  761. #define MAX_CLASS_NAME_LEN 32
  762. typedef struct _DEVICE_INFO
  763. {
  764. UINT cbSize;
  765. struct _DEVICE_INFO FAR* lpNextDi;
  766. char szDescription[LINE_LEN];
  767. DWORD dnDevnode;
  768. HKEY hRegKey;
  769. char szRegSubkey[100]; //~~~~
  770. char szClassName[MAX_CLASS_NAME_LEN];
  771. DWORD Flags;
  772. HWND hwndParent;
  773. LPDRIVER_NODE lpCompatDrvList;
  774. LPDRIVER_NODE lpClassDrvList;
  775. LPDRIVER_NODE lpSelectedDriver;
  776. UINT cbDriverPathLen;
  777. LPSTR lpszDriverPath;
  778. } DEVICE_INFO, FAR * LPDEVICE_INFO, FAR * FAR * LPLPDEVICE_INFO;
  779. #define ASSERT_DI_STRUC(lpdi) if (lpdi->cbSize != sizeof(DEVICE_INFO)) return (ERR_DI_BAD_DEV_INFO)
  780. typedef struct _CLASS_INFO
  781. {
  782. UINT cbSize;
  783. struct _CLASS_INFO FAR* lpNextCi;
  784. LPDEVICE_INFO lpdi;
  785. char szDescription[LINE_LEN];
  786. char szClassName[MAX_CLASS_NAME_LEN];
  787. } CLASS_INFO, FAR * LPCLASS_INFO, FAR * FAR * LPLPCLASS_INFO;
  788. #define ASSERT_CI_STRUC(lpci) if (lpci->cbSize != sizeof(CLASS_INFO)) return (ERR_DI_BAD_CLASS_INFO)
  789. // flags for device choosing (InFlags)
  790. #define DI_SHOWOEM 0x0001 // support Other... button
  791. #define DI_SHOWCOMPAT 0x0002 // show compatibility list
  792. #define DI_SHOWCLASS 0x0004 // show class list
  793. #define DI_SHOWALL 0x0007
  794. #define DI_NOVCP 0x0008 // Don't do vcpOpen/vcpClose.
  795. #define DI_DIDCOMPAT 0x0010 // Searched for compatible devices
  796. #define DI_DIDCLASS 0x0020 // Searched for class devices
  797. #define DI_AUTOASSIGNRES 0x0040 // No UI for resources if possible
  798. // flags returned by DiInstallDevice to indicate need to reboot/restart
  799. #define DI_NEEDRESTART 0x0080 // Restart required to take effect
  800. #define DI_NEEDREBOOT 0x0100 // Reboot required to take effect
  801. // flags for device installation
  802. #define DI_NOBROWSE 0x0200 // no Browse... in InsertDisk
  803. // Flags set by DiBuildClassDrvList
  804. #define DI_MULTMFGS 0x0400 // Set if multiple manufacturers in
  805. // class driver list
  806. // Flag indicates that device is disabled
  807. #define DI_DISABLED 0x0800 // Set if device disabled
  808. // Flags for Device/Class Properties
  809. #define DI_GENERALPAGE_ADDED 0x1000
  810. #define DI_RESOURCEPAGE_ADDED 0x2000
  811. // Defines for class installer functions
  812. #define DIF_SELECTDEVICE 0x0001
  813. #define DIF_INSTALLDEVICE 0x0002
  814. #define DIF_ASSIGNRESOURCES 0x0003
  815. #define DIF_PROPERTIES 0x0004
  816. #define DIF_REMOVE 0x0005
  817. #define DIF_FIRSTTIMESETUP 0x0006
  818. #define DIF_FOUNDDEVICE 0x0007
  819. typedef UINT DI_FUNCTION; // Function type for device installer
  820. RETERR WINAPI DiCreateDeviceInfo(
  821. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  822. LPCSTR lpszDescription, // If non-null then description string
  823. DWORD hDevnode, // BUGBUG -- MAKE A DEVNODE
  824. HKEY hkey, // Registry hkey for dev info
  825. LPCSTR lpszRegsubkey, // If non-null then reg subkey string
  826. LPCSTR lpszClassName, // If non-null then class name string
  827. HWND hwndParent); // If non-null then hwnd of parent
  828. RETERR WINAPI DiGetClassDevs(
  829. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  830. LPCSTR lpszClassName, // Must be name of class
  831. HWND hwndParent, // If non-null then hwnd of parent
  832. int iFlags); // Options
  833. #define DIGCF_DEFAULT 0x0001 // NOT IMPLEMENTED!
  834. #define DIGCF_PRESENT 0x0002
  835. #define DIGCF_ALLCLASSES 0x0004
  836. RETERR WINAPI PASCAL DiCreateDevRegKey(
  837. LPDEVICE_INFO lpdi,
  838. LPHKEY lphk,
  839. HINF hinf,
  840. LPCSTR lpszInfSection,
  841. int iFlags);
  842. RETERR WINAPI PASCAL DiDeleteDevRegKey(LPDEVICE_INFO lpdi, int iFlags);
  843. RETERR WINAPI PASCAL DiOpenDevRegKey(
  844. LPDEVICE_INFO lpdi,
  845. LPHKEY lphk,
  846. int iFlags);
  847. #define DIREG_DEV 0x0001 // Open/Create device key
  848. #define DIREG_DRV 0x0002 // Open/Create driver key
  849. RETERR WINAPI DiDestroyClassInfoList(LPCLASS_INFO lpci);
  850. RETERR WINAPI DiBuildClassInfoList(LPLPCLASS_INFO lplpci);
  851. RETERR WINAPI DiGetDeviceClassInfo(LPLPCLASS_INFO lplpci, LPDEVICE_INFO lpdi);
  852. RETERR WINAPI DiDestroyDeviceInfoList(LPDEVICE_INFO lpdi);
  853. RETERR WINAPI DiSelectDevice( LPDEVICE_INFO lpdi );
  854. RETERR WINAPI DiInstallDevice( LPDEVICE_INFO lpdi );
  855. RETERR WINAPI DiRemoveDevice( LPDEVICE_INFO lpdi );
  856. RETERR WINAPI DiAssignResources( LPDEVICE_INFO lpdi );
  857. RETERR WINAPI DiAskForOEMDisk(LPDEVICE_INFO lpdi);
  858. RETERR WINAPI DiCallClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  859. RETERR WINAPI DiBuildCompatDrvList(LPDEVICE_INFO lpdi);
  860. RETERR WINAPI DiBuildClassDrvList(LPDEVICE_INFO lpdi);
  861. RETERR WINAPI DiDestroyDriverNodeList(LPDRIVER_NODE lpdn);
  862. // The following export will load a dll and find the specified proc name
  863. typedef RETERR (FAR PASCAL *DIINSTALLERPROPERTIES)(LPDEVICE_INFO);
  864. RETERR WINAPI DiGetInstallerFcn(HKEY hk, LPSTR lpszRegVal, LPSTR lpszDefProcName,
  865. HINSTANCE FAR * lphinst, FARPROC FAR * lplpfn);
  866. RETERR
  867. WINAPI
  868. DiCreateDriverNode(
  869. LPLPDRIVER_NODE lplpdn,
  870. UINT Rank,
  871. UINT InfType,
  872. unsigned InfDate,
  873. LPCSTR lpszDescription,
  874. LPCSTR lpszProviderName,
  875. LPCSTR lpszMfgName,
  876. LPCSTR lpszInfFileName,
  877. LPCSTR lpszSectionName,
  878. DWORD dwPrivateData);
  879. RETERR WINAPI DiLoadClassIcon(
  880. LPCSTR szClassName,
  881. HICON FAR *lphiLargeIcon,
  882. int FAR *lpiMiniIconIndex);
  883. RETERR WINAPI DiInstallDrvSection(
  884. LPCSTR lpszInfFileName,
  885. LPCSTR lpszSection,
  886. LPCSTR lpszClassName,
  887. LPCSTR lpszDescription,
  888. DWORD dwFlags);
  889. RETERR WINAPI DiChangeState(LPDEVICE_INFO lpdi, DWORD dwStateChange);
  890. #define DISC_ENABLE 0x00000001
  891. #define DISC_DISABLE 0x00000002
  892. #define DISC_PROPCHANGE 0x00000003
  893. RETERR WINAPI DiInstallClass(LPCSTR lpszInfFileName, DWORD dwFlags);
  894. RETERR WINAPI DiOpenClassRegKey(LPHKEY lphk, LPCSTR lpszClassName);
  895. // support routine for dealing with class mini icons
  896. int WINAPI PASCAL DiDrawMiniIcon(HDC hdc, RECT rcLine, int iMiniIcon, UINT flags);
  897. // internal calls for display class
  898. #define DISPLAY_SETMODE_SUCCESS 0x0001
  899. #define DISPLAY_SETMODE_DRVCHANGE 0x0002
  900. #define DISPLAY_SETMODE_FONTCHANGE 0x0004
  901. UINT WINAPI Display_SetMode(LPDEVICE_INFO lpdi, UINT uColorRes, int iXRes, int iYRes);
  902. RETERR WINAPI Display_ClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  903. RETERR WINAPI Display_OpenFontSizeKey(LPHKEY lphkFontSize);
  904. BOOL WINAPI Display_SetFontSize(LPCSTR lpszFontSize);
  905. #endif // NODEVICEINSTALL
  906. /***************************************************************************/
  907. //
  908. // setup reg DB calls, use just like those in kernel
  909. //
  910. /***************************************************************************/
  911. DWORD WINAPI SURegOpenKey(HKEY hKey, LPSTR lpszSubKey, HKEY FAR *lphkResult);
  912. DWORD WINAPI SURegCloseKey(HKEY hKey);
  913. DWORD WINAPI SURegCreateKey(HKEY hKey, LPSTR lpszSubKey, HKEY FAR *lphkResult);
  914. DWORD WINAPI SURegDeleteKey(HKEY hKey, LPSTR lpszSubKey);
  915. DWORD WINAPI SURegEnumKey(HKEY hKey, DWORD dwIdx, LPSTR lpszBuffer, DWORD dwBufSize);
  916. DWORD WINAPI SURegQueryValue16(HKEY hKey, LPSTR lpszSubKey, LPSTR lpValueBuf, DWORD FAR *ldwBufSize);
  917. DWORD WINAPI SURegSetValue16(HKEY hKey, LPSTR lpszSubKey, DWORD dwType, LPBYTE lpszValue, DWORD dwValSize);
  918. DWORD WINAPI SURegDeleteValue(HKEY hKey,LPSTR lpszValue);
  919. DWORD WINAPI SURegEnumValue(HKEY hKey,DWORD dwIdx, LPSTR lpszValue, DWORD FAR *lpcbValue, DWORD FAR *lpdwReserved, DWORD FAR *lpdwType, LPBYTE lpbData, DWORD FAR *lpcbData);
  920. DWORD WINAPI SURegQueryValueEx(HKEY hKey,LPSTR lpszValueName, DWORD FAR *lpdwReserved,DWORD FAR *lpdwType,LPSTR lpValueBuf, DWORD FAR *ldwBufSize);
  921. DWORD WINAPI SURegSetValueEx(HKEY hKey,LPSTR lpszValueName, DWORD dwReserved, DWORD dwType, LPBYTE lpszValue, DWORD dwValSize);
  922. DWORD WINAPI SURegFlush(VOID);
  923. DWORD WINAPI SURegInit(VOID); // should be called before any other Reg APIs
  924. /***************************************************************************/
  925. // setup FormatMessage support
  926. /***************************************************************************/
  927. UINT FAR CDECL suFormatMessage(HINSTANCE hAppInst, LPCSTR lpcFormat, LPSTR szMessage, UINT uSize,
  928. ...);
  929. UINT WINAPI suvFormatMessage(HINSTANCE hAppInst, LPCSTR lpcFormat, LPSTR szMessage, UINT uSize,
  930. LPVOID FAR * lpArgs);
  931. int WINCAPI _loadds suFormatMessageBox(HINSTANCE hAppInst, HWND hwndParent, LPCSTR lpcText, LPCSTR lpcTitle,
  932. UINT uStyle, ...);
  933. WORD WINAPI suErrorToIds( WORD Value, WORD Class );
  934. /***************************************************************************/
  935. // setup Version Conflict support
  936. /***************************************************************************/
  937. LPVOID WINAPI suVerConflictInit(void);
  938. void WINAPI suVerConflictTerm(LPVOID lpvData);
  939. LRESULT WINAPI suVerConflict(HWND hwnd, LPVCPVERCONFLICT lpvc, LPVOID lpvData);
  940. //***************************************************************************
  941. // Misc SETUPX.DLL support functions.
  942. //***************************************************************************
  943. enum SU_ACTIONS // Actions msgs for Setupx() /* ;Internal */
  944. { /* ;Internal */
  945. SUX_REGINIT, // Intialize registry /* ;Internal */
  946. SUX_DBGLEVEL, // Set debug level /* ;Internal */
  947. SUX_SETUPFLG, // Set fIsSetup flag /* ;INternal */
  948. SUX_FASTSETUP, // Puts setupx into a checking less mode.
  949. SUX_FORCEREGFLUSH, // Call kRegFlush /* ;INternal */
  950. SUX_DBGHFILE, // File to write messages to
  951. }; /* ;Internal */
  952. RETERR WINAPI Setupx( UINT uMsg, WPARAM wParam, LPARAM lParam ); /* ;Internal */
  953. RETERR WINAPI SUGetSetSetupFlags(LPDWORD lpdwFlags, BOOL bSet);
  954. // Flags returned by SUGetSetSetupFlags
  955. #define SUF_FIRSTTIME 0x00000001L
  956. #define SUF_EXPRESS 0x00000002L
  957. RETERR WINAPI CfgSetupMerge( int uFlags );
  958. // structure for the LPARAM argument to Setupx() for SUX_REGINIT action. ;Internal
  959. typedef struct _REGINIT_S { /* setupx - reg_init */ /* ;Internal */
  960. LPSTR lpszSystemFile; // reg's base SYSTEM filename /* ;Internal */
  961. LOGDISKID ldidSystemFile; // ldid for SYSTEM filename /* ;Internal */
  962. LPSTR lpszUserFile; // reg's base USER filename /* ;Internal */
  963. LOGDISKID ldidUserFile; // ldid for USER filename /* ;Internal */
  964. } REGINIT_S, FAR *LPREGINIT; /* ;Internal */
  965. #ifndef LPLPSTR
  966. typedef LPSTR (FAR *LPLPSTR);
  967. #endif
  968. #define CFG_PARSE_BUFLEN 512 // Buf sized passed line obj funcs /* ;Internal */
  969. LPLPSTR WINAPI CfgParseLine( LPCSTR szLine, LPSTR Buf ); /* ;Internal */
  970. BOOL WINAPI CfgSetAutoProcess( int TrueFalse ); /* ;Internal */
  971. void WINAPI CfgObjToStr( LPLPSTR apszObj, LPSTR szLine ); /* ;Internal */
  972. LPLPSTR WINAPI CfgLnToObj( HTP hSection, int Offset, int Origin, LPSTR Buf ); /* ;Internal */
  973. LPLPSTR WINAPI CfgObjFindKeyCmd( HTP hSec, LPCSTR szKey, LPCSTR szCmd, /* ;Internal */
  974. int Offset, int Origin, LPSTR Buf ); /* ;Internal */
  975. //***************************************************************************
  976. //
  977. // ENUMS for accessing config.sys/autoexec.bat line objects using the
  978. // array returned by ParseConfigLine()..
  979. //
  980. //***************************************************************************
  981. enum CFGLINE_STRINGS // Config.sys/autoexec.bat objects
  982. {
  983. CFG_KEYLEAD, // Keyword leading whitespaces
  984. CFG_KEYWORD, // Keyword
  985. CFG_KEYTRAIL, // Keyword trailing delimiters
  986. CFG_UMBINFO, // Load high info
  987. CFG_DRVLETTER, // Drive letter for cmd path
  988. CFG_PATH, // Command path
  989. CFG_COMMAND, // Command base name
  990. CFG_EXT, // Command extension including '.'
  991. CFG_ARGS, // Command arguments
  992. CFG_FREE, // Free area at end of buffer
  993. CFG_END
  994. };
  995. //***************************************************************************
  996. #endif // SETUPX_INC