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.

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