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.

1610 lines
65 KiB

  1. //**********************************************************************
  2. //
  3. // SETUPX.H
  4. //
  5. // Copyright (c) 1993 - Microsoft Corp.
  6. // All rights reserved.
  7. // Microsoft Confidential
  8. //
  9. // Public include file for Chicago Setup services.
  10. //
  11. // 12/1/93 DONALDM Added LPCLASS_INFO, and function protos for
  12. // exports in SETUP4.DLL
  13. // 12/4/943 DONALDM Moved SHELL.H include and Chicago specific
  14. // helper functions to SETUP4.H
  15. // 1/11/94 DONALDM Added members to DEVICE_INFO to better handle
  16. // ClassInstaller load/unload.
  17. // 1/11/94 DONALDM Added some new DIF_ messages for Net guys.
  18. // 2/25/94 DONALDM Fixed a bug with the DIREG_ flags
  19. //**********************************************************************
  20. #ifndef SETUPX_INC
  21. #define SETUPX_INC 1 // SETUPX.H signature
  22. /***************************************************************************/
  23. // setup PropertySheet support
  24. // NOTE: Always include PRST.H because it is needed later for Class Installer
  25. // stuff, and optionally define the SU prop sheet stuff.
  26. /***************************************************************************/
  27. #include <prsht.h>
  28. #ifndef NOPRSHT
  29. HPROPSHEETPAGE WINAPI SUCreatePropertySheetPage(LPCPROPSHEETPAGE lppsp);
  30. BOOL WINAPI SUDestroyPropertySheetPage(HPROPSHEETPAGE hPage);
  31. int WINAPI SUPropertySheet(LPCPROPSHEETHEADER lppsh);
  32. #endif // NOPRSHT
  33. typedef UINT RETERR; // Return Error code type.
  34. #define OK 0 // success error code
  35. #define IP_ERROR (100) // Inf parsing
  36. #define TP_ERROR (200) // Text processing module
  37. #define VCP_ERROR (300) // Virtual copy module
  38. #define GEN_ERROR (400) // Generic Installer
  39. #define DI_ERROR (500) // Device Installer
  40. // err2ids mappings
  41. enum ERR_MAPPINGS {
  42. E2I_VCPM, // Maps VCPM to strings
  43. E2I_SETUPX, // Maps setupx returns to strings
  44. E2I_SETUPX_MODULE, // Maps setupx returns to appropriate module
  45. E2I_DOS_SOLUTION, // Maps DOS Extended errors to solutions
  46. E2I_DOS_REASON, // Maps DOS extended errors to strings.
  47. E2I_DOS_MEDIA, // Maps DOS extended errors to media icon.
  48. };
  49. #ifndef NOVCP
  50. /***************************************************************************/
  51. //
  52. // Logical Disk ID definitions
  53. //
  54. /***************************************************************************/
  55. // DECLARE_HANDLE(VHSTR); /* VHSTR = VirtCopy Handle to STRing */
  56. typedef UINT VHSTR; /* VirtCopy Handle to String */
  57. VHSTR WINAPI vsmStringAdd(LPCSTR lpszName);
  58. int WINAPI vsmStringDelete(VHSTR vhstr);
  59. VHSTR WINAPI vsmStringFind(LPCSTR lpszName);
  60. int WINAPI vsmGetStringName(VHSTR vhstr, LPSTR lpszBuffer, int cbBuffer);
  61. int WINAPI vsmStringCompare(VHSTR vhstrA, VHSTR vhstrB);
  62. LPCSTR WINAPI vsmGetStringRawName(VHSTR vhstr);
  63. void WINAPI vsmStringCompact(void);
  64. typedef UINT LOGDISKID; /* ldid */
  65. // Logical Disk Descriptor: Structure which describes the physical attributes
  66. // of a logical disk. Every logical disk is assigned a logical disk
  67. // identifier (LDID), and is described by a logical disk descriptor (LDD).
  68. //
  69. // The cbSize structure member must always be set to sizeof(LOGDISKDESC_S),
  70. // but all other unused structure members should be NULL or 0. No validation
  71. // is performed on the size of string arrays; all string pointers, if
  72. // non-NULL and they are to receive a string, must point at string arrays
  73. // whose sizes are as follows:
  74. // sizeof( szPath ) = MAX_PATH_LEN
  75. // sizeof( szVolLabel) = MAX_FILENAME_LEN
  76. // sizeof( szName ) = MAX_STRING_LEN
  77. #define MAX_PATH_LEN 260 // Max. path length.
  78. #define MAX_FILENAME_LEN 20 // Max. filename length. ( > sizeof( "x:\\12345678.123" )
  79. typedef struct _LOGDISKDESC_S { /* ldd */
  80. WORD cbSize; // Size of this structure (bytes)
  81. LOGDISKID ldid; // Logical Disk ID.
  82. LPSTR pszPath; // Ptr. to associated Path string.
  83. LPSTR pszVolLabel; // Ptr. to Volume Label string.
  84. LPSTR pszDiskName; // Ptr. to Disk Name string.
  85. WORD wVolTime; // Volume label modification time.
  86. WORD wVolDate; // Volume label modification date.
  87. DWORD dwSerNum; // Disk serial number.
  88. WORD wFlags; // Flags.
  89. } LOGDISKDESC_S, FAR *LPLOGDISKDESC;
  90. // Range for pre-defined LDIDs.
  91. #define LDID_PREDEF_START 0x0001 // Start of range
  92. #define LDID_PREDEF_END 0x7FFF // End of range
  93. // Range for dynamically assigned LDIDs.
  94. #define LDID_ASSIGN_START 0x8000 // Start of range
  95. #define LDID_ASSIGN_END 0xBFFF // End of range
  96. // Pre-defined Logical Disk Identifiers (LDID).
  97. //
  98. #define LDID_NULL 0 // Null (undefined) LDID.
  99. #define LDID_ABSOLUTE ((UINT)-1) // Absolute path
  100. // source path of windows install, this is typically A:\ or a net drive
  101. #define LDID_SRCPATH 1 // source of instilation
  102. // temporary setup directory used by setup, this is only valid durring
  103. // regular install
  104. #define LDID_SETUPTEMP 2 // temporary setup dir for install
  105. // path to uninstall location, this is where we backup files that will
  106. // be overwritten
  107. #define LDID_UNINSTALL 3 // uninstall (backup) dir.
  108. // backup path for the copy engine, this should not be used
  109. #define LDID_BACKUP 4 // BUGBUG: backup dir for the copy engine, not used
  110. // windows directory, this is the destinatio of the insallation
  111. #define LDID_WIN 10 // destination Windows dir (just user files).
  112. #define LDID_SYS 11 // destination Windows System dir.
  113. #define LDID_IOS 12 // destination Windows Iosubsys dir.
  114. #define LDID_CMD 13 // destination Windows Command (DOS) dir.
  115. #define LDID_CPL 14 // destination Windows Control Panel dir.
  116. #define LDID_PRINT 15 // destination Windows Printer dir.
  117. #define LDID_MAIL 16 // destination Mail dir.
  118. #define LDID_INF 17 // destination Windows *.INF dir.
  119. #define LDID_HELP 18 // destination Windows Help dir.
  120. #define LDID_WINADMIN 19 // admin stuff.
  121. // Shared dirs for net install.
  122. #define LDID_SHARED 25 // Bulk of windows files.
  123. #define LDID_WINBOOT 26 // guarenteed boot device for windows.
  124. #define LDID_MACHINE 27 // machine specific files.
  125. #define LDID_HOST_WINBOOT 28
  126. // boot and old win and dos dirs.
  127. #define LDID_BOOT 30 // Root dir of boot drive
  128. #define LDID_BOOT_HOST 31 // Root dir of boot drive host
  129. #define LDID_OLD_WINBOOT 32 // Subdir off of Root (optional)
  130. #define LDID_OLD_WIN 33 // old windows directory (if it exists)
  131. #define LDID_OLD_DOS 34 // old dos directory (if it exists)
  132. // Convert Ascii drive letter to Integer drive number ('A'=1, 'B'=2, ...).
  133. #define DriveAtoI( chDrv ) ((int)(chDrv & 31))
  134. // Convert Integer drive number to Ascii drive letter (1='A', 2='B', ...).
  135. #define DriveItoA( iDrv ) ((char) (iDrv - 1 + 'A'))
  136. // BUGBUG: change the names of these
  137. RETERR WINAPI CtlSetLdd ( LPLOGDISKDESC );
  138. RETERR WINAPI CtlGetLdd ( LPLOGDISKDESC );
  139. RETERR WINAPI CtlFindLdd ( LPLOGDISKDESC );
  140. RETERR WINAPI CtlAddLdd ( LPLOGDISKDESC );
  141. RETERR WINAPI CtlDelLdd ( LOGDISKID );
  142. RETERR WINAPI CtlGetLddPath ( LOGDISKID, LPSTR );
  143. /***************************************************************************/
  144. //
  145. // Virtual File Copy definitions
  146. //
  147. /***************************************************************************/
  148. typedef DWORD LPEXPANDVTBL; /* BUGBUG -- clean this up */
  149. enum _ERR_VCP
  150. {
  151. ERR_VCP_IOFAIL = (VCP_ERROR + 1), // File I/O failure
  152. ERR_VCP_STRINGTOOLONG, // String length limit exceeded
  153. ERR_VCP_NOMEM, // Insufficient memory to comply
  154. ERR_VCP_NOVHSTR, // No string handles available
  155. ERR_VCP_OVERFLOW, // Reference count would overflow
  156. ERR_VCP_BADARG, // Invalid argument to function
  157. ERR_VCP_UNINIT, // String library not initialized
  158. ERR_VCP_NOTFOUND , // String not found in string table
  159. ERR_VCP_BUSY, // Can't do that now
  160. ERR_VCP_INTERRUPTED, // User interrupted operation
  161. ERR_VCP_BADDEST, // Invalid destination directory
  162. ERR_VCP_SKIPPED, // User skipped operation
  163. ERR_VCP_IO, // Hardware error encountered
  164. ERR_VCP_LOCKED, // List is locked
  165. ERR_VCP_WRONGDISK, // The wrong disk is in the drive
  166. ERR_VCP_CHANGEMODE, //
  167. ERR_VCP_LDDINVALID, // Logical Disk ID Invalid.
  168. ERR_VCP_LDDFIND, // Logical Disk ID not found.
  169. ERR_VCP_LDDUNINIT, // Logical Disk Descriptor Uninitialized.
  170. ERR_VCP_LDDPATH_INVALID,
  171. ERR_VCP_NOEXPANSION, // Failed to load expansion dll
  172. ERR_VCP_NOTOPEN, // Copy session not open
  173. };
  174. /*****************************************************************************
  175. * Structures
  176. *****************************************************************************/
  177. /*---------------------------------------------------------------------------*
  178. * VCPPROGRESS
  179. *---------------------------------------------------------------------------*/
  180. typedef struct tagVCPPROGRESS { /* prg */
  181. DWORD dwSoFar; /* Number of units copied so far */
  182. DWORD dwTotal; /* Number of units to copy */
  183. } VCPPROGRESS, FAR *LPVCPPROGRESS;
  184. /*---------------------------------------------------------------------------*
  185. * VCPDISKINFO
  186. *---------------------------------------------------------------------------*/
  187. typedef struct tagVCPDISKINFO {
  188. WORD cbSize; /* Size of this structure in bytes */
  189. LOGDISKID ldid; /* Logical disk ID */
  190. VHSTR vhstrRoot; /* Location of root directory */
  191. VHSTR vhstrVolumeLabel;/* Volume label */
  192. VHSTR vhstrDiskName; // Printed name on the disk.
  193. WORD wVolumeTime; /* Volume label modification time */
  194. WORD wVolumeDate; /* Volume label modification date */
  195. DWORD dwSerialNumber; /* Disk serial number */
  196. WORD fl; /* Flags */
  197. LPARAM lparamRef; /* Reference data for client */
  198. VCPPROGRESS prgFileRead; /* Progress info */
  199. VCPPROGRESS prgByteRead;
  200. VCPPROGRESS prgFileWrite;
  201. VCPPROGRESS prgByteWrite;
  202. } VCPDISKINFO, FAR *LPVCPDISKINFO;
  203. #define VDIFL_VALID 0x0001 /* Fields are valid from a prev. call */
  204. #define VDIFL_EXISTS 0x0002 /* Disk exists; do not format */
  205. RETERR WINAPI DiskInfoFromLdid(LOGDISKID ldid, LPVCPDISKINFO lpdi);
  206. /*---------------------------------------------------------------------------*
  207. * VCPFILESPEC
  208. *---------------------------------------------------------------------------*/
  209. typedef struct tagVCPFILESPEC { /* vfs */
  210. LOGDISKID ldid; /* Logical disk */
  211. VHSTR vhstrDir; /* Directory withing logical disk */
  212. VHSTR vhstrFileName; /* Filename within directory */
  213. } VCPFILESPEC, FAR *LPVCPFILESPEC;
  214. /*---------------------------------------------------------------------------*
  215. * VCPFATTR
  216. *---------------------------------------------------------------------------*/
  217. /*
  218. * BUGBUG -- explain diffce between llenIn and llenOut wrt compression.
  219. */
  220. typedef struct tagVCPFATTR {
  221. UINT uiMDate; /* Modification date */
  222. UINT uiMTime; /* Modification time */
  223. UINT uiADate; /* Access date */
  224. UINT uiATime; /* Access time */
  225. UINT uiAttr; /* File attribute bits */
  226. DWORD llenIn; /* Original file length */
  227. DWORD llenOut; /* Final file length */
  228. /* (after decompression) */
  229. } VCPFATTR, FAR *LPVCPFATTR;
  230. /*---------------------------------------------------------------------------*
  231. * VIRTNODEEX
  232. *---------------------------------------------------------------------------*/
  233. typedef struct tagVIRTNODEEX
  234. { /* vnex */
  235. HFILE hFileSrc;
  236. HFILE hFileDst;
  237. VCPFATTR fAttr;
  238. WORD dosError; // The first/last error encountered
  239. VHSTR vhstrFileName; // The original destination name.
  240. WPARAM vcpm; // The message that was being processed.
  241. } VIRTNODEEX, FAR *LPCVIRTNODEEX, FAR *LPVIRTNODEEX ;
  242. /*---------------------------------------------------------------------------*
  243. * VIRTNODE
  244. *---------------------------------------------------------------------------*/
  245. typedef struct tagVIRTNODE { /* vn */
  246. WORD cbSize;
  247. VCPFILESPEC vfsSrc;
  248. VCPFILESPEC vfsDst;
  249. WORD fl;
  250. LPARAM lParam;
  251. LPEXPANDVTBL lpExpandVtbl;
  252. LPVIRTNODEEX lpvnex;
  253. } VIRTNODE, FAR *LPCVIRTNODE, FAR *LPVIRTNODE ;
  254. /*---------------------------------------------------------------------------*
  255. * VCPDESTINFO
  256. *---------------------------------------------------------------------------*/
  257. typedef struct tagVCPDESTINFO { /* destinfo */
  258. WORD flDevAttr; /* Device attributes */
  259. LONG cbCapacity; /* Disk capacity */
  260. WORD cbCluster; /* Bytes per cluster */
  261. WORD cRootDir; /* Size of root directory */
  262. } VCPDESTINFO, FAR *LPVCPDESTINFO;
  263. #define DIFL_FIXED 0x0001 /* Nonremoveable media */
  264. #define DIFL_CHANGELINE 0x0002 /* Change line support */
  265. // Now also used by the virtnode as we dont have copy nodes any more.
  266. // #define CNFL_BACKUP 0x0001 /* This is a backup node */
  267. #define CNFL_DELETEONFAILURE 0x0002 /* Dest should be deleted on failure */
  268. #define CNFL_RENAMEONSUCCESS 0x0004 /* Dest needs to be renamed */
  269. #define CNFL_CONTINUATION 0x0008 /* Dest is continued onto difft disk */
  270. #define CNFL_SKIPPED 0x0010 /* User asked to skip file */
  271. #define CNFL_IGNOREERRORS 0x0020 // An error has occured on this file already
  272. #define CNFL_RETRYFILE 0x0040 // Retry the file (error ocurred)
  273. #define CNFL_COPIED 0x0080 // Node has already been copied.
  274. // BUGBUG: verify the use and usefullness of these flags
  275. // #define VNFL_UNIQUE 0x0000 /* Default */
  276. #define VNFL_MULTIPLEOK 0x0100 /* Do not search PATH for duplicates */
  277. #define VNFL_DESTROYOLD 0x0200 /* Do not back up files */
  278. // #define VNFL_NOW 0x0400 /* Use by vcp Flush */
  279. // To deternime what kind of node it is.
  280. #define VNFL_COPY 0x0000 // A simple copy node.
  281. #define VNFL_DELETE 0x0800 // A delete node
  282. #define VNFL_RENAME 0x1000 // A rename node
  283. #define VNFL_NODE_TYPE ( VNFL_RENAME|VNFL_DELETE|VNFL_COPY )
  284. /* Read-only flag bits */
  285. #define VNFL_CREATED 0x2000 /* VCPM_NODECREATE has been sent */
  286. #define VNFL_REJECTED 0x4000 /* Node has been rejected */
  287. #define VNFL_DEVICEINSTALLER 0x8000 /* Node was added by the Device Installer */
  288. /*---------------------------------------------------------------------------*
  289. * VCPSTATUS
  290. *---------------------------------------------------------------------------*/
  291. typedef struct tagVCPSTATUS { /* vstat */
  292. WORD cbSize; /* Size of this structure */
  293. VCPPROGRESS prgDiskRead;
  294. VCPPROGRESS prgFileRead;
  295. VCPPROGRESS prgByteRead;
  296. VCPPROGRESS prgDiskWrite;
  297. VCPPROGRESS prgFileWrite;
  298. VCPPROGRESS prgByteWrite;
  299. LPVCPDISKINFO lpvdiIn; /* Current input disk */
  300. LPVCPDISKINFO lpvdiOut; /* Current output disk */
  301. LPVIRTNODE lpvn; /* Current file */
  302. } VCPSTATUS, FAR *LPVCPSTATUS;
  303. /*---------------------------------------------------------------------------*
  304. * VCPVERCONFLICT
  305. *---------------------------------------------------------------------------*/
  306. typedef struct tagVCPVERCONFLICT {
  307. LPCSTR lpszOldFileName;
  308. LPCSTR lpszNewFileName;
  309. DWORD dwConflictType; /* Same values as VerInstallFiles */
  310. LPVOID lpvinfoOld; /* Version information resources */
  311. LPVOID lpvinfoNew;
  312. WORD wAttribOld; /* File attributes for original */
  313. LPARAM lparamRef; /* Reference data for callback */
  314. } VCPVERCONFLICT, FAR *LPVCPVERCONFLICT;
  315. /*****************************************************************************
  316. * Callback functions
  317. *****************************************************************************/
  318. typedef LRESULT (CALLBACK *VIFPROC)(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  319. LRESULT CALLBACK vcpDefCallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  320. // callback for default UI.
  321. // lparamRef --> a VCPUIINFO structure
  322. LRESULT CALLBACK vcpUICallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  323. /*---------------------------------------------------------------------------*
  324. * VCPUIINFO
  325. *
  326. * This structure is passed in as the lparamRef of vcpUICallbackProc.
  327. *
  328. * on using vcpUICallbackProc:
  329. * - to use, have vcpUICallbackProc as the callback for vcpOpen with
  330. * an appropriately filled in VCPUIINFO structure as the lparamRef.
  331. *
  332. * - based on flags, hwndProgress is created and maintained
  333. * - lpfnStatCallback is called with only status messages
  334. * returning VCPM_ABORT indicates that the copy should be aborted
  335. * - if hwndProgress is non-NULL, the control with idProgress will
  336. * receive progress gauge messages as appropriate
  337. *
  338. *---------------------------------------------------------------------------*/
  339. #define VCPUI_CREATEPROGRESS 0x0001 // callback should create and manage progress gauge dialog
  340. #define VCPUI_NOBROWSE 0x0002 // no browse button in InsertDisk
  341. #define VCPUI_RENAMEREQUIRED 0x0004 // as a result of a file being in use at copy, reboot required
  342. typedef struct {
  343. UINT flags;
  344. HWND hwndParent; // window of parent
  345. HWND hwndProgress; // window to get progress updates (nonzero ids)
  346. UINT idPGauge; // id for progress gauge
  347. VIFPROC lpfnStatCallback; // callback for status info (or NULL)
  348. LPARAM lUserData; // caller definable data
  349. LOGDISKID ldidCurrent; // reserved. do not touch.
  350. } VCPUIINFO, FAR *LPVCPUIINFO;
  351. /******************************************************************************
  352. * Callback notification codes
  353. *****************************************************************************/
  354. /* BUGBUG -- VCPN_ABORT should match VCPERROR_INTERRUPTED */
  355. #define VCPN_OK 0 /* All is hunky-dory */
  356. #define VCPN_PROCEED 0 /* The same as VCPN_OK */
  357. #define VCPN_ABORT (-1) /* Cancel current operation */
  358. #define VCPN_RETRY (-2) /* Retry current operation */
  359. #define VCPN_IGNORE (-3) /* Ignore error and continue */
  360. #define VCPN_SKIP (-4) /* Skip this file and continue */
  361. #define VCPN_FORCE (-5) /* Force an action */
  362. #define VCPN_DEFER (-6) /* Save the action for later */
  363. #define VCPN_FAIL (-7) /* Return failure back to caller */
  364. #define VCPN_RETRYFILE (-8) // An error ocurred during file copy, do it again.
  365. /*****************************************************************************
  366. * Callback message numbers
  367. *****************************************************************************/
  368. #define VCPM_CLASSOF(uMsg) HIBYTE(uMsg)
  369. #define VCPM_TYPEOF(uMsg) (0x00FF & (uMsg)) // LOBYTE(uMsg)
  370. /*---------------------------------------------------------------------------*
  371. * ERRORs
  372. *---------------------------------------------------------------------------*/
  373. #define VCPM_ERRORCLASSDELTA 0x80
  374. #define VCPM_ERRORDELTA 0x8000 /* Where the errors go */
  375. /*---------------------------------------------------------------------------*
  376. * Disk information callbacks
  377. *---------------------------------------------------------------------------*/
  378. #define VCPM_DISKCLASS 0x01
  379. #define VCPM_DISKFIRST 0x0100
  380. #define VCPM_DISKLAST 0x01FF
  381. enum tagVCPM_DISK {
  382. VCPM_DISKCREATEINFO = VCPM_DISKFIRST,
  383. VCPM_DISKGETINFO,
  384. VCPM_DISKDESTROYINFO,
  385. VCPM_DISKPREPINFO,
  386. VCPM_DISKENSURE,
  387. VCPM_DISKPROMPT,
  388. VCPM_DISKFORMATBEGIN,
  389. VCPM_DISKFORMATTING,
  390. VCPM_DISKFORMATEND,
  391. /* Remaining messages reserved for future use */
  392. };
  393. /*---------------------------------------------------------------------------*
  394. * File copy callbacks
  395. *---------------------------------------------------------------------------*/
  396. // BUGBUG: this needs to be merged back with other internal errors
  397. #define VCPERROR_IO (VCP_ERROR - ERR_VCP_IO) /* Hardware error encountered */
  398. #define VCPM_FILEINCLASS 0x02
  399. #define VCPM_FILEOUTCLASS 0x03
  400. #define VCPM_FILEFIRSTIN 0x0200
  401. #define VCPM_FILEFIRSTOUT 0x0300
  402. #define VCPM_FILELAST 0x03FF
  403. enum tagVCPM_FILE {
  404. VCPM_FILEOPENIN = VCPM_FILEFIRSTIN,
  405. VCPM_FILEGETFATTR,
  406. VCPM_FILECLOSEIN,
  407. VCPM_FILECOPY,
  408. VCPM_FILENEEDED,
  409. VCPM_FILEOPENOUT = VCPM_FILEFIRSTOUT,
  410. VCPM_FILESETFATTR,
  411. VCPM_FILECLOSEOUT,
  412. VCPM_FILEFINALIZE,
  413. VCPM_FILEDELETE,
  414. VCPM_FILERENAME,
  415. /* Remaining messages reserved for future use */
  416. };
  417. /*---------------------------------------------------------------------------*
  418. * VIRTNODE callbacks
  419. *---------------------------------------------------------------------------*/
  420. #define VCPM_NODECLASS 0x04
  421. #define VCPM_NODEFIRST 0x0400
  422. #define VCPM_NODELAST 0x04FF
  423. enum tagVCPM_NODE {
  424. VCPM_NODECREATE = VCPM_NODEFIRST,
  425. VCPM_NODEACCEPT,
  426. VCPM_NODEREJECT,
  427. VCPM_NODEDESTROY,
  428. VCPM_NODECHANGEDESTDIR,
  429. VCPM_NODECOMPARE,
  430. /* Remaining messages reserved for future use */
  431. };
  432. /*---------------------------------------------------------------------------*
  433. * TALLY callbacks
  434. *---------------------------------------------------------------------------*/
  435. #define VCPM_TALLYCLASS 0x05
  436. #define VCPM_TALLYFIRST 0x0500
  437. #define VCPM_TALLYLAST 0x05FF
  438. enum tagVCPM_TALLY {
  439. VCPM_TALLYSTART = VCPM_TALLYFIRST,
  440. VCPM_TALLYEND,
  441. VCPM_TALLYFILE,
  442. VCPM_TALLYDISK,
  443. /* Remaining messages reserved for future use */
  444. };
  445. /*---------------------------------------------------------------------------*
  446. * VER callbacks
  447. *---------------------------------------------------------------------------*/
  448. #define VCPM_VERCLASS 0x06
  449. #define VCPM_VERFIRST 0x0600
  450. #define VCPM_VERLAST 0x06FF
  451. enum tagVCPM_VER {
  452. VCPM_VERCHECK = VCPM_VERFIRST,
  453. VCPM_VERCHECKDONE,
  454. VCPM_VERRESOLVECONFLICT,
  455. /* Remaining messages reserved for future use */
  456. };
  457. /*---------------------------------------------------------------------------*
  458. * VSTAT callbacks
  459. *---------------------------------------------------------------------------*/
  460. #define VCPM_VSTATCLASS 0x07
  461. #define VCPM_VSTATFIRST 0x0700
  462. #define VCPM_VSTATLAST 0x07FF
  463. enum tagVCPM_VSTAT {
  464. VCPM_VSTATSTART = VCPM_VSTATFIRST,
  465. VCPM_VSTATEND,
  466. VCPM_VSTATREAD,
  467. VCPM_VSTATWRITE,
  468. VCPM_VSTATNEWDISK,
  469. VCPM_VSTATCLOSESTART, // Start of VCP close
  470. VCPM_VSTATCLOSEEND, // upon leaving VCP close
  471. VCPM_VSTATBACKUPSTART, // Backup is beginning
  472. VCPM_VSTATBACKUPEND, // Backup is finished
  473. VCPM_VSTATRENAMESTART, // Rename phase start/end
  474. VCPM_VSTATRENAMEEND,
  475. VCPM_VSTATCOPYSTART, // Acutal copy phase
  476. VCPM_VSTATCOPYEND,
  477. VCPM_VSTATDELETESTART, // Delete phase
  478. VCPM_VSTATDELETEEND,
  479. VCPM_VSTATPATHCHECKSTART, // Check for valid paths
  480. VCPM_VSTATPATHCHECKEND,
  481. VCPM_VSTATUSERABORT, // User wants to quit.
  482. /* Remaining messages reserved for future use */
  483. };
  484. /*---------------------------------------------------------------------------*
  485. * Destination info callbacks
  486. *---------------------------------------------------------------------------*/
  487. /* BUGBUG -- find a reasonable message range for this */
  488. #define VCPM_PATHCLASS 0x08
  489. #define VCPM_PATHFIRST 0x0800
  490. #define VCPM_PATHLAST 0x08FF
  491. enum tagVCPM_PATH{
  492. VCPM_BUILDPATH = VCPM_PATHFIRST,
  493. VCPM_UNIQUEPATH,
  494. VCPM_CHECKPATH,
  495. };
  496. // #define VCPM_BUILDPATH 0x83
  497. /*****************************************************************************/
  498. void WINAPI VcpAddMRUPath( LPCSTR lpszPath );
  499. #define SZ_INSTALL_LOCATIONS "InstallLocationsMRU"
  500. RETERR WINAPI VcpOpen(VIFPROC vifproc, LPARAM lparamMsgRef);
  501. RETERR WINAPI VcpClose(WORD fl, LPCSTR lpszBackupDest);
  502. RETERR WINAPI VcpFlush(WORD fl, LPCSTR lpszBackupDest);
  503. #define VCPFL_ABANDON 0x0000 /* Abandon all pending file copies */
  504. #define VCPFL_BACKUP 0x0001 /* Perform backup */
  505. #define VCPFL_COPY 0x0002 /* Copy files */
  506. #define VCPFL_BACKUPANDCOPY (VCPFL_BACKUP | VCPFL_COPY)
  507. #define VCPFL_INSPECIFIEDORDER 0x0004 /* Do not sort before copying */
  508. #define VCPFL_DELETE 0x0008
  509. #define VCPFL_RENAME 0x0010
  510. #define VCPFL_DIAMOND 0x0020
  511. typedef int (CALLBACK *VCPENUMPROC)(LPVIRTNODE lpvn, LPARAM lparamRef);
  512. int WINAPI vcpEnumFiles(VCPENUMPROC vep, LPARAM lparamRef);
  513. enum tag_VCPM_EXPLAIN{
  514. VCPEX_SRC_DISK,
  515. VCPEX_SRC_CABINET,
  516. VCPEX_SRC_LOCN,
  517. VCPEX_DST_LOCN,
  518. VCPEX_SRC_FILE,
  519. VCPEX_DST_FILE,
  520. VCPEX_DOS_ERROR,
  521. VCPEX_MESSAGE,
  522. VCPEX_DOS_SOLUTION,
  523. VCPEX_SRC_FULL,
  524. VCPEX_DST_FULL,
  525. };
  526. LPCSTR WINAPI VcpExplain( LPVIRTNODE lpVn, DWORD dwWhat );
  527. /* Flag bits that can be set via VcpQueueCopy */
  528. // Various Lparams for files
  529. #define VNLP_SYSCRITICAL 0x0001 // This file should not be skipped
  530. #define VNLP_SETUPCRITICAL 0x0002 // This file cannot be skipped
  531. // VcpEnumFiles Flags.
  532. #define VEN_OP 0x00ff /* Operation field */
  533. #define VEN_NOP 0x0000 /* Do nothing */
  534. #define VEN_DELETE 0x0001 /* Delete current item */
  535. #define VEN_SET 0x0002 /* Change value of current item */
  536. #define VEN_FL 0xff00 /* Flags field */
  537. #define VEN_STOP 0x0100 /* Stop enumeration after this item */
  538. #define VEN_ERROR 0x8000 /* Stop enumeration after this item
  539. * and ignore the OP field */
  540. // BUGBUG: add the other VCP stuff necessary to use this
  541. // BUGBUG: remove the lpsz*Dir fields, make overload the LDID with them
  542. RETERR WINAPI VcpQueueCopy(LPCSTR lpszSrcFileName, LPCSTR lpszDstFileName,
  543. LPCSTR lpszSrcDir, LPCSTR lpszDstDir,
  544. LOGDISKID ldidSrc, LOGDISKID ldidDst,
  545. LPEXPANDVTBL lpExpandVtbl, WORD fl,
  546. LPARAM lParam);
  547. RETERR WINAPI VcpQueueDelete( LPCSTR lpszDstFileName,
  548. LPCSTR lpszDstDir,
  549. LOGDISKID ldidDst,
  550. LPARAM lParamRef );
  551. RETERR WINAPI VcpQueueRename( LPCSTR lpszSrcFileName,
  552. LPCSTR lpszDstFileName,
  553. LPCSTR lpszSrcDir,
  554. LPCSTR lpszDstDir,
  555. LOGDISKID ldidSrc,
  556. LOGDISKID ldidDst,
  557. LPARAM lParam );
  558. #endif // NOVCP
  559. #ifndef NOINF
  560. /***************************************************************************/
  561. //
  562. // Inf Parser API declaration and definitions
  563. //
  564. /***************************************************************************/
  565. enum _ERR_IP
  566. {
  567. ERR_IP_INVALID_FILENAME = (IP_ERROR + 1),
  568. ERR_IP_ALLOC_ERR,
  569. ERR_IP_INVALID_SECT_NAME,
  570. ERR_IP_OUT_OF_HANDLES,
  571. ERR_IP_INF_NOT_FOUND,
  572. ERR_IP_INVALID_INFFILE,
  573. ERR_IP_INVALID_HINF,
  574. ERR_IP_INVALID_FIELD,
  575. ERR_IP_SECT_NOT_FOUND,
  576. ERR_IP_END_OF_SECTION,
  577. ERR_IP_PROFILE_NOT_FOUND,
  578. ERR_IP_LINE_NOT_FOUND,
  579. ERR_IP_FILEREAD,
  580. ERR_IP_TOOMANYINFFILES,
  581. ERR_IP_INVALID_SAVERESTORE,
  582. ERR_IP_INVALID_INFTYPE
  583. };
  584. #define INFTYPE_TEXT 0
  585. #define INFTYPE_EXECUTABLE 1
  586. #define MAX_SECT_NAME_LEN 32
  587. typedef struct _INF NEAR * HINF;
  588. typedef struct _INFLINE FAR * HINFLINE; // tolken to inf line
  589. RETERR WINAPI IpOpen(LPCSTR pszFileSpec, HINF FAR * lphInf);
  590. RETERR WINAPI IpOpenEx(LPCSTR pszFileSpec, HINF FAR * lphInf, UINT InfType);
  591. RETERR WINAPI IpOpenAppend(LPCSTR pszFileSpec, HINF hInf);
  592. RETERR WINAPI IpOpenAppendEx(LPCSTR pszFileSpec, HINF hInf, UINT InfType);
  593. RETERR WINAPI IpSaveRestorePosition(HINF hInf, BOOL bSave);
  594. RETERR WINAPI IpClose(HINF hInf);
  595. RETERR WINAPI IpGetLineCount(HINF hInf, LPCSTR lpszSection, int FAR * lpCount);
  596. RETERR WINAPI IpFindFirstLine(HINF hInf, LPCSTR lpszSect, LPCSTR lpszKey, HINFLINE FAR * lphRet);
  597. RETERR WINAPI IpFindNextLine(HINF hInf, HINFLINE FAR * lphRet);
  598. RETERR WINAPI IpFindNextMatchLine(HINF hInf, LPCSTR lpszKey, HINFLINE FAR * lphRet);
  599. RETERR WINAPI IpGetProfileString(HINF hInf, LPCSTR lpszSec, LPCSTR lpszKey, LPSTR lpszBuf, int iBufSize);
  600. RETERR WINAPI IpGetFieldCount(HINF hInf, HINFLINE hInfLine, int FAR * lpCount);
  601. RETERR WINAPI IpGetFileName(HINF hInf, LPSTR lpszBuf, int iBufSize);
  602. RETERR WINAPI IpGetIntField(HINF hInf, HINFLINE hInfLine, int iField, int FAR * lpVal);
  603. RETERR WINAPI IpGetLongField(HINF hInf, HINFLINE hInfLine, int iField, long FAR * lpVal);
  604. RETERR WINAPI IpGetStringField(HINF hInf, HINFLINE hInfLine, int iField, LPSTR lpBuf, int iBufSize, int FAR * lpuCount);
  605. RETERR WINAPI IpGetVersionString(LPSTR lpszInfFile, LPSTR lpszValue, LPSTR lpszBuf, int cbBuf, LPSTR lpszDefaultValue);
  606. #endif // NOINF
  607. #ifndef NOTEXTPROC
  608. /***************************************************************************/
  609. //
  610. // Text processing API declaration and definitions
  611. //
  612. /***************************************************************************/
  613. /* Relative/absolute positioning */
  614. #define SEC_SET 1 // Absolute positioning (relative to the start)
  615. #define SEC_END 2 // Realtive to the end
  616. #define SEC_CUR 3 // Relative to the current line.
  617. #define SEC_OPENALWAYS 1 // Always open a section, no error if it does not exist
  618. #define SEC_OPENEXISTING 2 // Open an existing section, an error given if it does not exist.
  619. #define SEC_OPENNEWALWAYS 3 // Open a section (present or not) and discard its contents.
  620. #define SEC_OPENNEWEXISTING 4 // Open an existing section (discarding its contents). Error if not existing
  621. // Flags for TP_OpenFile().
  622. //
  623. // Use autoexec/config.sys key delimiters
  624. //
  625. #define TP_WS_KEEP 1
  626. // If TP code running under SETUP, the foll. flag specifies whether
  627. // to cache this file or not! Use this, if you want to read a whole
  628. // file in when doing the TpOpenSection()!
  629. //
  630. #define TP_WS_DONTCACHE 2
  631. // The following are simple errors
  632. enum {
  633. ERR_TP_NOT_FOUND = (TP_ERROR + 1), // line, section, file etc.
  634. // not necessarily terminal
  635. ERR_TP_NO_MEM, // couldn't perform request - generally terminal
  636. ERR_TP_READ, // could not read the disc - terminal
  637. ERR_TP_WRITE, // could not write the data - terminal.
  638. ERR_TP_INVALID_REQUEST, // Multitude of sins - not necessarily terminal.
  639. ERR_TP_INVALID_LINE // Invalid line from DELETE_LINE etc.
  640. };
  641. /* Data handles */
  642. DECLARE_HANDLE(HTP);
  643. typedef HTP FAR * LPHTP;
  644. /* File handles */
  645. DECLARE_HANDLE(HFN);
  646. typedef HFN FAR * LPHFN;
  647. typedef UINT TFLAG;
  648. typedef UINT LINENUM, FAR * LPLINENUM;
  649. #define MAX_REGPATH 256 // Max Registry Path Length
  650. #define LINE_LEN 256 // BUGBUG: max line length?
  651. #define SECTION_LEN 32 // BUGBUG: max length of a section name?
  652. #define MAX_STRING_LEN 512 // BUGBUG: review this
  653. /* Function prototypes */
  654. RETERR WINAPI TpOpenFile(LPCSTR Filename, LPHFN phFile, TFLAG Flag);
  655. RETERR WINAPI TpCloseFile(HFN hFile);
  656. RETERR WINAPI TpOpenSection(HFN hfile, LPHTP phSection, LPCSTR Section, TFLAG flag);
  657. RETERR WINAPI TpCloseSection(HTP Section);
  658. RETERR WINAPI TpCommitSection(HFN hFile, HTP hSection, LPCSTR Section, TFLAG flag);
  659. LINENUM WINAPI TpGetLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, LPLINENUM lpLineNum );
  660. LINENUM WINAPI TpGetNextLine(HTP hSection, LPCSTR key, LPCSTR value, LPLINENUM lpLineNum );
  661. RETERR WINAPI TpInsertLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, TFLAG flag);
  662. RETERR WINAPI TpReplaceLine(HTP hSection, LPCSTR key, LPCSTR value, int rel, int orig, TFLAG flag);
  663. RETERR WINAPI TpDeleteLine(HTP hSection, int rel, int orig,TFLAG flag);
  664. RETERR WINAPI TpMoveLine(HTP hSection, int src_rel, int src_orig, int dest_rel, int dest_orig, TFLAG flag);
  665. RETERR WINAPI TpGetLineContents(HTP hSection, LPSTR buffer, UINT bufsize, UINT FAR * lpActualSize,int rel, int orig, TFLAG flag);
  666. // UINT WINAPI TpGetWindowsDirectory(LPSTR lpDest, UINT size);
  667. // UINT WINAPI TpGetSystemDirectory(LPSTR lpDest, UINT size);
  668. int WINAPI TpGetPrivateProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszDefault, LPSTR lpszReturn, int nSize, LPCSTR lpszFile);
  669. int WINAPI TpWritePrivateProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszString, LPCSTR lpszFile);
  670. int WINAPI TpGetProfileString(LPCSTR lpszSect, LPCSTR lpszKey, LPCSTR lpszDefault, LPSTR lpszReturn, int nSize);
  671. BOOL WINAPI TpWriteProfileString(LPCSTR lpszSect , LPCSTR lpszKey , LPCSTR lpszString);
  672. #endif // NOTEXTPROC
  673. #ifndef NOGENINSTALL
  674. /***************************************************************************/
  675. //
  676. // Generic Installer prototypes and definitions
  677. //
  678. /***************************************************************************/
  679. enum _ERR_GENERIC
  680. {
  681. ERR_GEN_LOW_MEM = GEN_ERROR+1, // Insufficient memory.
  682. ERR_GEN_INVALID_FILE, // Invalid INF file.
  683. ERR_GEN_LOGCONFIG, // Can't process LogConfig=.
  684. ERR_GEN_CFGAUTO, // Can't process CONFIG.SYS/AUTOEXEC.BAT
  685. ERR_GEN_UPDINI, // Can't process UpdateInis=.
  686. ERR_GEN_UPDINIFIELDS, // Can't process UpdateIniFields=.
  687. ERR_GEN_ADDREG, // Can't process AddReg=.
  688. ERR_GEN_DELREG, // Can't process DelReg=.
  689. ERR_GEN_INI2REG, // Can't process Ini2Reg=.
  690. ERR_GEN_FILE_COPY, // Can't process CopyFiles=.
  691. ERR_GEN_FILE_DEL, // Can't process DelFiles=.
  692. ERR_GEN_FILE_REN, // Can't process RenFiles=.
  693. ERR_GEN_REG_API, // Error returned by Reg API.
  694. ERR_GEN_DO_FILES, // can't do Copy, Del or RenFiles.
  695. };
  696. // The cbSize field will always be set to sizeof(GENCALLBACKINFO_S).
  697. // All unused fields (for the operation) will be not be initialized.
  698. // For example, when the operation is GENO_DELFILE, the Src fields will
  699. // not have any sensible values (Dst fields will be set correctly) as
  700. // VcpQueueDelete only accepts Dst parameters.
  701. //
  702. /***************************************************************************
  703. * GenCallbackINFO structure passed to GenInstall CallBack functions.
  704. ***************************************************************************/
  705. typedef struct _GENCALLBACKINFO_S { /* gen-callback struc */
  706. WORD cbSize; // Size of this structure (bytes).
  707. WORD wOperation; // Operation being performed.
  708. LOGDISKID ldidSrc; // Logical Disk ID for Source.
  709. LPCSTR pszSrcSubDir; // Source sub-dir off of the LDID.
  710. LPCSTR pszSrcFileName; // Source file name (base name).
  711. LOGDISKID ldidDst; // Logical Disk ID for Dest.
  712. LPCSTR pszDstSubDir; // Dest. sub-dir off of the LDID.
  713. LPCSTR pszDstFileName; // Dest. file name (base name).
  714. LPEXPANDVTBL lpExpandVtbl; // BUGBUG needed? NULL right now!
  715. WORD wflags; // flags for VcpQueueCopy.
  716. LPARAM lParam; // LPARAM to the Vcp API.
  717. } GENCALLBACKINFO_S, FAR *LPGENCALLBACKINFO;
  718. /***************************************************************************
  719. * GenCallback notification codes -- callback proc returns 1 of foll. values.
  720. ***************************************************************************/
  721. #define GENN_OK 0 /* All is hunky-dory. Do the VCP operation */
  722. #define GENN_PROCEED 0 /* The same as GENN_OK */
  723. #define GENN_ABORT (-1) /* Cancel current GenInstall altogether */
  724. #define GENN_SKIP (-2) /* Skip this file and continue */
  725. /***************************************************************************
  726. * VCP Operation being performed by GenInstall() -- wOperation values in
  727. * GENCALLBACKINFO structure above.
  728. ***************************************************************************/
  729. #define GENO_COPYFILE 1 /* VCP copyfile being done */
  730. #define GENO_DELFILE 2 /* VCP delfile being done */
  731. #define GENO_RENFILE 3 /* VCP renfile being done */
  732. typedef LRESULT (CALLBACK *GENCALLBACKPROC)(LPGENCALLBACKINFO lpGenInfo,
  733. LPARAM lparamRef);
  734. RETERR WINAPI GenInstall( HINF hinfFile, LPCSTR szInstallSection, WORD wFlags );
  735. RETERR WINAPI GenInstallEx( HINF hInf, LPCSTR szInstallSection, WORD wFlags,
  736. HKEY hRegKey, GENCALLBACKPROC CallbackProc,
  737. LPARAM lparam);
  738. RETERR WINAPI GenWinInitRename(LPCSTR szNew, LPSTR szOld, LOGDISKID ldid);
  739. RETERR WINAPI GenCopyLogConfig2Reg(HINF hInf, HKEY hRegKey,
  740. LPCSTR szLogConfigSection);
  741. void WINAPI GenFormStrWithoutPlaceHolders( LPSTR szDst, LPCSTR szSrc,
  742. HINF hInf ) ;
  743. // A devnode is just a DWORD and this is easier than
  744. // having to include configmg.h for everybody
  745. RETERR WINAPI GenInfLCToDevNode(ATOM atInfFileName, LPSTR lpszSectionName,
  746. BOOL bInstallSec, UINT InfType,
  747. DWORD dnDevNode);
  748. // Bit fields for GenInstall() (for wFlags parameter) -- these can be OR-ed!
  749. #define GENINSTALL_DO_FILES 1
  750. #define GENINSTALL_DO_INI 2
  751. #define GENINSTALL_DO_REG 4
  752. #define GENINSTALL_DO_INI2REG 8
  753. #define GENINSTALL_DO_CFGAUTO 16
  754. #define GENINSTALL_DO_LOGCONFIG 32
  755. #define GENINSTALL_DO_INIREG (GENINSTALL_DO_INI | \
  756. GENINSTALL_DO_REG | \
  757. GENINSTALL_DO_INI2REG)
  758. #define GENINSTALL_DO_ALL (GENINSTALL_DO_FILES | \
  759. GENINSTALL_DO_INIREG | \
  760. GENINSTALL_DO_CFGAUTO | \
  761. GENINSTALL_DO_LOGCONFIG)
  762. #endif // NOGENINSTALL
  763. #ifndef NODEVICENSTALL
  764. /***************************************************************************/
  765. //
  766. // Device Installer prototypes and definitions
  767. //
  768. /***************************************************************************/
  769. enum _ERR_DEVICE_INSTALL
  770. {
  771. ERR_DI_INVALID_DEVICE_ID = DI_ERROR, // Incorrectly formed device IDF
  772. ERR_DI_INVALID_COMPATIBLE_DEVICE_LIST, // Invalid compatible device list
  773. ERR_DI_REG_API, // Error returned by Reg API.
  774. ERR_DI_LOW_MEM, // Insufficient memory to complete
  775. ERR_DI_BAD_DEV_INFO, // Device Info struct invalid
  776. ERR_DI_INVALID_CLASS_INSTALLER, // Registry entry / DLL invalid
  777. ERR_DI_DO_DEFAULT, // Take default action
  778. ERR_DI_USER_CANCEL, // the user cancelled the operation
  779. ERR_DI_NOFILECOPY, // No need to copy files (in install)
  780. ERR_DI_BAD_CLASS_INFO, // Class Info Struct invalid
  781. ERR_DI_BAD_INF, // Bad INF file encountered
  782. ERR_DI_BAD_MOVEDEV_PARAMS, // Bad Move Device Params struct
  783. ERR_DI_NO_INF, // No INF found on OEM disk
  784. ERR_DI_BAD_PROPCHANGE_PARAMS, // Bad property change param struct
  785. ERR_DI_BAD_SELECTDEVICE_PARAMS, // Bad Select Device Parameters
  786. ERR_DI_BAD_REMOVEDEVICE_PARAMS // Bad Remove Device Parameters
  787. };
  788. typedef struct _DRIVER_NODE {
  789. struct _DRIVER_NODE FAR* lpNextDN;
  790. UINT Rank;
  791. UINT InfType;
  792. unsigned InfDate;
  793. LPSTR lpszDescription; // Compatibility: Contains the Device Desc.
  794. LPSTR lpszSectionName;
  795. ATOM atInfFileName;
  796. ATOM atMfgName;
  797. ATOM atProviderName;
  798. DWORD Flags;
  799. DWORD dwPrivateData;
  800. LPSTR lpszDrvDescription; // New contains an driver description
  801. LPSTR lpszHardwareID;
  802. LPSTR lpszCompatIDs;
  803. } DRIVER_NODE, NEAR* PDRIVER_NODE, FAR* LPDRIVER_NODE, FAR* FAR* LPLPDRIVER_NODE;
  804. #define DNF_DUPDESC 0x00000001 // Multiple providers have same desc
  805. #define DNF_OLDDRIVER 0x00000002 // Driver node specifies old/current driver
  806. // possible types of "INF" files
  807. #define INFTYPE_WIN4 1
  808. #define INFTYPE_WIN3 2
  809. #define INFTYPE_COMBIDRV 3
  810. #define INFTYPE_PPD 4
  811. #define INFTYPE_WPD 5
  812. #define INFTYPE_CLASS_SPEC1 6
  813. #define INFTYPE_CLASS_SPEC2 7
  814. #define INFTYPE_CLASS_SPEC3 8
  815. #define INFTYPE_CLASS_SPEC4 9
  816. #define MAX_CLASS_NAME_LEN 32
  817. #define MAX_DRIVER_INST_LEN 10
  818. // NOTE: Keep this in sync with confimg.h in \DDK\INC
  819. #define MAX_DEVNODE_ID_LEN 256
  820. typedef struct _DEVICE_INFO
  821. {
  822. UINT cbSize;
  823. struct _DEVICE_INFO FAR* lpNextDi;
  824. char szDescription[LINE_LEN];
  825. DWORD dnDevnode;
  826. HKEY hRegKey;
  827. char szRegSubkey[MAX_DEVNODE_ID_LEN];
  828. char szClassName[MAX_CLASS_NAME_LEN];
  829. DWORD Flags;
  830. HWND hwndParent;
  831. LPDRIVER_NODE lpCompatDrvList;
  832. LPDRIVER_NODE lpClassDrvList;
  833. LPDRIVER_NODE lpSelectedDriver;
  834. ATOM atDriverPath;
  835. ATOM atTempInfFile;
  836. HINSTANCE hinstClassInstaller; // The Class Installer module
  837. HINSTANCE hinstClassPropProvidor; // The Class Property Providor
  838. HINSTANCE hinstDevicePropProvidor; // The Device Property Providor
  839. HINSTANCE hinstBasicPropProvidor; // The Basic Property Providor hinst
  840. FARPROC fpClassInstaller; // ClassInstall entry point
  841. FARPROC fpClassEnumPropPages; // Class EnumPropPages entry point
  842. FARPROC fpDeviceEnumPropPages; // Device EnumPropPages entry point
  843. FARPROC fpEnumBasicProperties; // Basic Property Page enum entry
  844. DWORD dwSetupReserved; // Reserved for SETUP's use
  845. DWORD dwClassInstallReserved; // Reserved for Class Installer use
  846. GENCALLBACKPROC gicpGenInstallCallBack; // Set by Caller of DiInstallDevice if
  847. // they want GenInstall callbacks
  848. LPARAM gicplParam; // lParam for GenInstall Callback
  849. UINT InfType; // The type of INF file it ENUMSINGLEINF is
  850. // specified
  851. HINSTANCE hinstPrivateProblemHandler; // The Private Problem DLL for a Specific Device
  852. FARPROC fpPrivateProblemHandler; // The Private Problem Handler entry point
  853. LPARAM lpClassInstallParams; // Class Install functions specific Parameters
  854. struct _DEVICE_INFO FAR* lpdiChildList; // Pointer to children Device Info list.
  855. } DEVICE_INFO, FAR * LPDEVICE_INFO, FAR * FAR * LPLPDEVICE_INFO;
  856. #define ASSERT_DI_STRUC(lpdi) if (lpdi->cbSize != sizeof(DEVICE_INFO)) return (ERR_DI_BAD_DEV_INFO)
  857. typedef struct _CLASS_INFO
  858. {
  859. UINT cbSize;
  860. struct _CLASS_INFO FAR* lpNextCi;
  861. LPDEVICE_INFO lpdi;
  862. char szDescription[LINE_LEN];
  863. char szClassName[MAX_CLASS_NAME_LEN];
  864. } CLASS_INFO, FAR * LPCLASS_INFO, FAR * FAR * LPLPCLASS_INFO;
  865. #define ASSERT_CI_STRUC(lpci) if (lpci->cbSize != sizeof(CLASS_INFO)) return (ERR_DI_BAD_CLASS_INFO)
  866. // flags for device choosing (InFlags)
  867. #define DI_SHOWOEM 0x00000001L // support Other... button
  868. #define DI_SHOWCOMPAT 0x00000002L // show compatibility list
  869. #define DI_SHOWCLASS 0x00000004L // show class list
  870. #define DI_SHOWALL 0x00000007L
  871. #define DI_NOVCP 0x00000008L // Don't do vcpOpen/vcpClose.
  872. #define DI_DIDCOMPAT 0x00000010L // Searched for compatible devices
  873. #define DI_DIDCLASS 0x00000020L // Searched for class devices
  874. #define DI_AUTOASSIGNRES 0x00000040L // No UI for resources if possible
  875. // flags returned by DiInstallDevice to indicate need to reboot/restart
  876. #define DI_NEEDRESTART 0x00000080L // Restart required to take effect
  877. #define DI_NEEDREBOOT 0x00000100L // Reboot required to take effect
  878. // flags for device installation
  879. #define DI_NOBROWSE 0x00000200L // no Browse... in InsertDisk
  880. // Flags set by DiBuildClassDrvList
  881. #define DI_MULTMFGS 0x00000400L // Set if multiple manufacturers in
  882. // class driver list
  883. // Flag indicates that device is disabled
  884. #define DI_DISABLED 0x00000800L // Set if device disabled
  885. // Flags for Device/Class Properties
  886. #define DI_GENERALPAGE_ADDED 0x00001000L
  887. #define DI_RESOURCEPAGE_ADDED 0x00002000L
  888. // Flag to indicate the setting properties for this Device (or class) caused a change
  889. // so the Dev Mgr UI probably needs to be updatd.
  890. #define DI_PROPERTIES_CHANGE 0x00004000L
  891. // Flag to indicate that the sorting from the INF file should be used.
  892. #define DI_INF_IS_SORTED 0x00008000L
  893. #define DI_ENUMSINGLEINF 0x00010000L
  894. // The following flags can be used to install a device disabled
  895. // and to prevent CONFIGMG being called when a device is installed
  896. #define DI_DONOTCALLCONFIGMG 0x00020000L
  897. #define DI_INSTALLDISABLED 0x00040000L
  898. // This flag is set of this LPDI is really just an LPCI, ie
  899. // it only contains class info, NO DRIVER/DEVICE INFO
  900. #define DI_CLASSONLY 0x00080000L
  901. // This flag is set if the Class Install params are valid
  902. #define DI_CLASSINSTALLPARAMS 0x00100000L
  903. // This flag is set if the caller of DiCallClassInstaller does NOT
  904. // want the internal default action performed if the Class installer
  905. // return ERR_DI_DO_DEFAULT
  906. #define DI_NODI_DEFAULTACTION 0x00200000L
  907. // BUGBUG. This is a hack for M6 Net setup. Net Setup does not work correctly
  908. // if we process devnode syncronously. This WILL be removed for M7 when
  909. // Net setup is fixed to work with DiInstallDevice
  910. #define DI_NOSYNCPROCESSING 0x00400000L
  911. // flags for device installation
  912. #define DI_QUIETINSTALL 0x00800000L // don't confuse the user with
  913. // questions or excess info
  914. #define DI_NOFILECOPY 0x01000000L // No file Copy necessary
  915. #define DI_FORCECOPY 0x02000000L // Force files to be copied from install path
  916. #define DI_DRIVERPAGE_ADDED 0x04000000L // Prop providor added Driver page.
  917. #define DI_USECI_SELECTSTRINGS 0x08000000L // Use Class Installer Provided strings in the Select Device Dlg
  918. #define DI_OVERRIDE_INFFLAGS 0x10000000L // Override INF flags
  919. #define DI_PROPS_NOCHANGEUSAGE 0x20000000L // No Enable/Disable in General Props
  920. #define DI_NOSELECTICONS 0x40000000L // No small icons in select device dialogs
  921. #define DI_NOWRITE_IDS 0x80000000L // Don't write HW & Compat IDs on install
  922. // Defines for class installer functions
  923. #define DIF_SELECTDEVICE 0x0001
  924. #define DIF_INSTALLDEVICE 0x0002
  925. #define DIF_ASSIGNRESOURCES 0x0003
  926. #define DIF_PROPERTIES 0x0004
  927. #define DIF_REMOVE 0x0005
  928. #define DIF_FIRSTTIMESETUP 0x0006
  929. #define DIF_FOUNDDEVICE 0x0007
  930. #define DIF_SELECTCLASSDRIVERS 0x0008
  931. #define DIF_VALIDATECLASSDRIVERS 0x0009
  932. #define DIF_INSTALLCLASSDRIVERS 0x000A
  933. #define DIF_CALCDISKSPACE 0x000B
  934. #define DIF_DESTROYPRIVATEDATA 0x000C
  935. #define DIF_VALIDATEDRIVER 0x000D
  936. #define DIF_MOVEDEVICE 0x000E
  937. #define DIF_DETECT 0x000F
  938. #define DIF_INSTALLWIZARD 0x0010
  939. #define DIF_DESTROYWIZARDDATA 0x0011
  940. #define DIF_PROPERTYCHANGE 0x0012
  941. typedef UINT DI_FUNCTION; // Function type for device installer
  942. // DIF_MOVEDEVICE parameter struct.
  943. typedef struct _MOVEDEV_PARAMS
  944. {
  945. UINT cbSize;
  946. LPDEVICE_INFO lpdiOldDev; // References the Device Begin Moved
  947. } MOVEDEV_PARAMS, FAR * LPMOVEDEV_PARAMS;
  948. #define ASSERT_MOVEDEVPARAMS_STRUC(lpmdp) if (lpmdp->cbSize != sizeof(MOVEDEV_PARAMS)) return (ERR_DI_BAD_MOVEDEV_PARAMS)
  949. // DIF_PROPCHANGE parameter struct.
  950. typedef struct _PROPCHANGE_PARAMS
  951. {
  952. UINT cbSize;
  953. DWORD dwStateChange;
  954. DWORD dwFlags;
  955. DWORD dwConfigID;
  956. } PROPCHANGE_PARAMS, FAR * LPPROPCHANGE_PARAMS;
  957. #define ASSERT_PROPCHANGEPARAMS_STRUC(lpmdp) if (lpmdp->cbSize != sizeof(PROPCHANGE_PARAMS)) return (ERR_DI_BAD_PROPCHANGE_PARAMS)
  958. #define MAX_TITLE_LEN 30
  959. #define MAX_INSTRUCTION_LEN 256
  960. #define MAX_LABEL_LEN 30
  961. // DIF_SELECTDEVICE parameter struct.
  962. typedef struct _SELECTDEVICE_PARAMS
  963. {
  964. UINT cbSize;
  965. char szTitle[MAX_TITLE_LEN];
  966. char szInstructions[MAX_INSTRUCTION_LEN];
  967. char szListLabel[MAX_LABEL_LEN];
  968. } SELECTDEVICE_PARAMS, FAR * LPSELECTDEVICE_PARAMS;
  969. #define ASSERT_SELECTDEVICEPARAMS_STRUC(p) if (p->cbSize != sizeof(SELECTDEVICE_PARAMS)) return (ERR_DI_BAD_SELECTDEVICE_PARAMS)
  970. #define DI_REMOVEDEVICE_GLOBAL 0x00000001
  971. #define DI_REMOVEDEVICE_CONFIGSPECIFIC 0x00000002
  972. typedef struct _REMOVEDEVICE_PARAMS
  973. {
  974. UINT cbSize;
  975. DWORD dwFlags;
  976. DWORD dwConfigID;
  977. } REMOVEDEVICE_PARAMS, FAR * LPREMOVEDEVICE_PARAMS;
  978. #define ASSERT_REMOVEDPARAMS_STRUC(p) if (p->cbSize != sizeof(REMOVEDEVICE_PARAMS)) return (ERR_DI_BAD_REMOVEDEVICE_PARAMS)
  979. // DIF_INSTALLWIZARD Wizard Data
  980. #define MAX_INSTALLWIZARD_DYNAPAGES 20
  981. // Use this ID for the first page that the install wizard should dynamically jump to.
  982. #define IDD_DYNAWIZ_FIRSTPAGE 10000
  983. // Use this ID for the page that the Select Device dialog should go back to
  984. #define IDD_DYNAWIZ_SELECT_PREVPAGE 10001
  985. // Use this ID for the page that the Select Device dialog should go to next
  986. #define IDD_DYNAWIZ_SELECT_NEXTPAGE 10002
  987. // Use this ID for the page that the Analyze dialog should go back to
  988. // This will only be used in the event that there is a problem, and the user
  989. // selects Back from the analyze proc.
  990. #define IDD_DYNAWIZ_ANALYZE_PREVPAGE 10003
  991. // Use this ID for the page that the Analyze dialog should go to if it continue from
  992. // the analyze proc. the wAnalyzeResult in the INSTALLDATA struct will
  993. // contain the anaysis results.
  994. #define IDD_DYNAWIZ_ANALYZE_NEXTPAGE 10004
  995. // This dialog will be selected if the user chooses back from the
  996. // Install Detected Devices dialog.
  997. #define IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE 10006
  998. // This dialog will be selected if the user chooses Next from the
  999. // Install Detected Devices dialog.
  1000. #define IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE 10007
  1001. // This is the ID of the dialog to select if detection does not
  1002. // find any new devices
  1003. #define IDD_DYNAWIZ_INSTALLDETECTED_NODEVS 10008
  1004. // This is the ID of the Select Device Wizard page.
  1005. #define IDD_DYNAWIZ_SELECTDEV_PAGE 10009
  1006. // This is the ID of the Analyze Device Wizard page.
  1007. #define IDD_DYNAWIZ_ANALYZEDEV_PAGE 10010
  1008. // This is the ID of the Install Detected Devs Wizard page.
  1009. #define IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE 10011
  1010. // This is the ID of the Select Class Wizard page.
  1011. #define IDD_DYNAWIZ_SELECTCLASS_PAGE 10012
  1012. // This flag is set if a Class installer has added pages to the
  1013. // install wizard.
  1014. #define DYNAWIZ_FLAG_PAGESADDED 0x00000001
  1015. // The following flags will control the button states when displaying
  1016. // the InstallDetectedDevs dialog.
  1017. #define DYNAWIZ_FLAG_INSTALLDET_NEXT 0x00000002
  1018. #define DYNAWIZ_FLAG_INSTALLDET_PREV 0x00000004
  1019. // Set this flag if you jump to the analyze page, and want it to
  1020. // handle conflicts for you. NOTE. You will not get control back
  1021. // in the event of a conflict if you set this flag.
  1022. #define DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT 0x00000008
  1023. #define ANALYZE_FACTDEF_OK 1
  1024. #define ANALYZE_STDCFG_OK 2
  1025. #define ANALYZE_CONFLICT 3
  1026. #define ANALYZE_NORESOURCES 4
  1027. #define ANALYZE_ERROR 5
  1028. #define ANALYZE_PNP_DEV 6
  1029. typedef struct InstallWizardData_tag
  1030. {
  1031. UINT cbSize;
  1032. LPDEVICE_INFO lpdiOriginal;
  1033. LPDEVICE_INFO lpdiSelected;
  1034. DWORD dwFlags;
  1035. LPVOID lpConfigData;
  1036. WORD wAnalyzeResult;
  1037. // The following fields are used when a Class Installer Extends the Install Wizard
  1038. HPROPSHEETPAGE hpsDynamicPages[MAX_INSTALLWIZARD_DYNAPAGES];
  1039. WORD wNumDynaPages;
  1040. DWORD dwDynaWizFlags;
  1041. DWORD dwPrivateFlags;
  1042. LPARAM lpPrivateData;
  1043. LPSTR lpExtraRunDllParams;
  1044. } INSTALLWIZDATA, * PINSTALLWIZDATA , FAR *LPINSTALLWIZDATA;
  1045. RETERR WINAPI DiCreateDeviceInfo(
  1046. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  1047. LPCSTR lpszDescription, // If non-null then description string
  1048. DWORD hDevnode, // BUGBUG -- MAKE A DEVNODE
  1049. HKEY hkey, // Registry hkey for dev info
  1050. LPCSTR lpszRegsubkey, // If non-null then reg subkey string
  1051. LPCSTR lpszClassName, // If non-null then class name string
  1052. HWND hwndParent); // If non-null then hwnd of parent
  1053. RETERR WINAPI DiGetClassDevs(
  1054. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  1055. LPCSTR lpszClassName, // Must be name of class
  1056. HWND hwndParent, // If non-null then hwnd of parent
  1057. int iFlags); // Options
  1058. RETERR WINAPI DiGetClassDevsEx(
  1059. LPLPDEVICE_INFO lplpdi, // Ptr to ptr to dev info
  1060. LPCSTR lpszClassName, // Must be name of class
  1061. LPCSTR lpszEnumerator, // Must be name of enumerator, or NULL
  1062. HWND hwndParent, // If non-null then hwnd of parent
  1063. int iFlags); // Options
  1064. #define DIGCF_DEFAULT 0x0001 // NOT IMPLEMENTED!
  1065. #define DIGCF_PRESENT 0x0002
  1066. #define DIGCF_ALLCLASSES 0x0004
  1067. #define DIGCF_PROFILE 0x0008
  1068. // API to return the Class name of an INF File
  1069. RETERR WINAPI DiGetINFClass(LPSTR lpszMWDPath, UINT InfType, LPSTR lpszClassName, DWORD dwcbClassName);
  1070. RETERR WINAPI PASCAL DiCreateDevRegKey(
  1071. LPDEVICE_INFO lpdi,
  1072. LPHKEY lphk,
  1073. HINF hinf,
  1074. LPCSTR lpszInfSection,
  1075. int iFlags);
  1076. RETERR WINAPI PASCAL DiDeleteDevRegKey(LPDEVICE_INFO lpdi, int iFlags);
  1077. RETERR WINAPI PASCAL DiOpenDevRegKey(
  1078. LPDEVICE_INFO lpdi,
  1079. LPHKEY lphk,
  1080. int iFlags);
  1081. #define DIREG_DEV 0x0001 // Open/Create/Delete device key
  1082. #define DIREG_DRV 0x0002 // Open/Create/Delete driver key
  1083. #define DIREG_BOTH 0x0004 // Delete both driver and Device key
  1084. RETERR WINAPI DiReadRegLogConf
  1085. (
  1086. LPDEVICE_INFO lpdi,
  1087. LPSTR lpszConfigName,
  1088. LPBYTE FAR *lplpbLogConf,
  1089. LPDWORD lpdwSize
  1090. );
  1091. RETERR WINAPI DiReadRegConf
  1092. (
  1093. LPDEVICE_INFO lpdi,
  1094. LPBYTE FAR *lplpbLogConf,
  1095. LPDWORD lpdwSize,
  1096. DWORD dwFlags
  1097. );
  1098. #define DIREGLC_FORCEDCONFIG 0x00000001
  1099. #define DIREGLC_BOOTCONFIG 0x00000002
  1100. RETERR WINAPI DiCopyRegSubKeyValue
  1101. (
  1102. HKEY hkKey,
  1103. LPSTR lpszFromSubKey,
  1104. LPSTR lpszToSubKey,
  1105. LPSTR lpszValueToCopy
  1106. );
  1107. RETERR WINAPI DiDestroyClassInfoList(LPCLASS_INFO lpci);
  1108. RETERR WINAPI DiBuildClassInfoList(LPLPCLASS_INFO lplpci);
  1109. #define DIBCI_NOINSTALLCLASS 0x000000001
  1110. #define DIBCI_NODISPLAYCLASS 0x000000002
  1111. RETERR WINAPI DiBuildClassInfoListEx(LPLPCLASS_INFO lplpci, DWORD dwFlags);
  1112. RETERR WINAPI DiGetDeviceClassInfo(LPLPCLASS_INFO lplpci, LPDEVICE_INFO lpdi);
  1113. RETERR WINAPI DiDestroyDeviceInfoList(LPDEVICE_INFO lpdi);
  1114. RETERR WINAPI DiSelectDevice( LPDEVICE_INFO lpdi );
  1115. RETERR WINAPI DiSelectOEMDrv(HWND hDlg, LPDEVICE_INFO lpdi);
  1116. // Callback for diInstallDevice vcpOpen. Basically calls vcpUICallback for everthing
  1117. // except when DI_FORCECOPY is active, in which case copies get defaulted to
  1118. // VCPN_FORCE
  1119. LRESULT CALLBACK diInstallDeviceUICallbackProc(LPVOID lpvObj, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM lparamRef);
  1120. RETERR WINAPI DiInstallDevice( LPDEVICE_INFO lpdi );
  1121. RETERR WINAPI DiInstallDriverFiles(LPDEVICE_INFO lpdi);
  1122. RETERR WINAPI DiRemoveDevice( LPDEVICE_INFO lpdi );
  1123. RETERR WINAPI DiAssignResources( LPDEVICE_INFO lpdi );
  1124. RETERR WINAPI DiAskForOEMDisk(LPDEVICE_INFO lpdi);
  1125. RETERR WINAPI DiCallClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  1126. RETERR WINAPI DiBuildCompatDrvList(LPDEVICE_INFO lpdi);
  1127. RETERR WINAPI DiBuildClassDrvList(LPDEVICE_INFO lpdi);
  1128. typedef RETERR (CALLBACK *OLDINFPROC)(HINF hinf, LPCSTR lpszNewInf, LPARAM lParam);
  1129. RETERR WINAPI DiBuildClassDrvListFromOldInf(LPDEVICE_INFO lpdi, LPCSTR lpszSection, OLDINFPROC lpfnOldInfProc, LPARAM lParam);
  1130. RETERR WINAPI DiDestroyDriverNodeList(LPDRIVER_NODE lpdn);
  1131. RETERR WINAPI DiMoveDuplicateDevNode(LPDEVICE_INFO lpdiNewDev);
  1132. // The following export will load a dll and find the specified proc name
  1133. typedef RETERR (FAR PASCAL *DIINSTALLERPROPERTIES)(LPDEVICE_INFO);
  1134. RETERR WINAPI GetFctn(HKEY hk, LPSTR lpszRegVal, LPSTR lpszDefProcName,
  1135. HINSTANCE FAR * lphinst, FARPROC FAR *lplpfn);
  1136. RETERR
  1137. WINAPI
  1138. DiCreateDriverNode(
  1139. LPLPDRIVER_NODE lplpdn,
  1140. UINT Rank,
  1141. UINT InfType,
  1142. unsigned InfDate,
  1143. LPCSTR lpszDevDescription,
  1144. LPCSTR lpszDrvDescription,
  1145. LPCSTR lpszProviderName,
  1146. LPCSTR lpszMfgName,
  1147. LPCSTR lpszInfFileName,
  1148. LPCSTR lpszSectionName,
  1149. DWORD dwPrivateData);
  1150. RETERR WINAPI DiLoadClassIcon(
  1151. LPCSTR szClassName,
  1152. HICON FAR *lphiLargeIcon,
  1153. int FAR *lpiMiniIconIndex);
  1154. RETERR WINAPI DiInstallDrvSection(
  1155. LPCSTR lpszInfFileName,
  1156. LPCSTR lpszSection,
  1157. LPCSTR lpszClassName,
  1158. LPCSTR lpszDescription,
  1159. DWORD dwFlags);
  1160. RETERR WINAPI DiChangeState(LPDEVICE_INFO lpdi, DWORD dwStateChange, DWORD dwFlags, LPARAM lParam);
  1161. #define DICS_ENABLE 0x00000001
  1162. #define DICS_DISABLE 0x00000002
  1163. #define DICS_PROPCHANGE 0x00000003
  1164. #define DICS_FLAG_GLOBAL 0x00000001
  1165. #define DICS_FLAG_CONFIGSPECIFIC 0x00000002
  1166. RETERR WINAPI DiInstallClass(LPCSTR lpszInfFileName, DWORD dwFlags);
  1167. RETERR WINAPI DiOpenClassRegKey(LPHKEY lphk, LPCSTR lpszClassName);
  1168. // support routine for dealing with class mini icons
  1169. int WINAPI PASCAL DiDrawMiniIcon(HDC hdc, RECT rcLine, int iMiniIcon, UINT flags);
  1170. BOOL WINAPI DiGetClassBitmapIndex(LPCSTR lpszClass, int FAR *lpiMiniIconIndex);
  1171. // internal calls for display class
  1172. #define DISPLAY_SETMODE_SUCCESS 0x0001
  1173. #define DISPLAY_SETMODE_DRVCHANGE 0x0002
  1174. #define DISPLAY_SETMODE_FONTCHANGE 0x0004
  1175. UINT WINAPI Display_SetMode(LPDEVICE_INFO lpdi, UINT uColorRes, int iXRes, int iYRes);
  1176. RETERR WINAPI Display_ClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  1177. RETERR WINAPI Display_OpenFontSizeKey(LPHKEY lphkFontSize);
  1178. BOOL WINAPI Display_SetFontSize(LPCSTR lpszFontSize);
  1179. RETERR WINAPI DiIsThereNeedToCopy(HWND hwnd, DWORD dwFlags);
  1180. #define DINTC_NOCOPYDEFAULT 0x00000001
  1181. // API for the mouse class installer
  1182. RETERR WINAPI Mouse_ClassInstaller(DI_FUNCTION diFctn, LPDEVICE_INFO lpdi);
  1183. #endif // NODEVICEINSTALL
  1184. // API for determining if a Driver file is currently part of VMM32.VxD
  1185. BOOL WINAPI bIsFileInVMM32
  1186. (
  1187. LPSTR lpszFileName
  1188. );
  1189. /***************************************************************************/
  1190. //
  1191. // setup reg DB calls, use just like those in kernel
  1192. //
  1193. /***************************************************************************/
  1194. DWORD WINAPI SURegOpenKey(HKEY hKey, LPSTR lpszSubKey, HKEY FAR *lphkResult);
  1195. DWORD WINAPI SURegCloseKey(HKEY hKey);
  1196. DWORD WINAPI SURegCreateKey(HKEY hKey, LPSTR lpszSubKey, HKEY FAR *lphkResult);
  1197. DWORD WINAPI SURegDeleteKey(HKEY hKey, LPSTR lpszSubKey);
  1198. DWORD WINAPI SURegEnumKey(HKEY hKey, DWORD dwIdx, LPSTR lpszBuffer, DWORD dwBufSize);
  1199. DWORD WINAPI SURegQueryValue16(HKEY hKey, LPSTR lpszSubKey, LPSTR lpValueBuf, DWORD FAR *ldwBufSize);
  1200. DWORD WINAPI SURegSetValue16(HKEY hKey, LPSTR lpszSubKey, DWORD dwType, LPBYTE lpszValue, DWORD dwValSize);
  1201. DWORD WINAPI SURegDeleteValue(HKEY hKey,LPSTR lpszValue);
  1202. DWORD WINAPI SURegEnumValue(HKEY hKey,DWORD dwIdx, LPSTR lpszValue, DWORD FAR *lpcbValue, DWORD FAR *lpdwReserved, DWORD FAR *lpdwType, LPBYTE lpbData, DWORD FAR *lpcbData);
  1203. DWORD WINAPI SURegQueryValueEx(HKEY hKey,LPSTR lpszValueName, DWORD FAR *lpdwReserved,DWORD FAR *lpdwType,LPSTR lpValueBuf, DWORD FAR *ldwBufSize);
  1204. DWORD WINAPI SURegSetValueEx(HKEY hKey,LPSTR lpszValueName, DWORD dwReserved, DWORD dwType, LPBYTE lpszValue, DWORD dwValSize);
  1205. DWORD WINAPI SURegSaveKey(HKEY hKey, LPCSTR lpszFileName, LPVOID lpsa);
  1206. DWORD WINAPI SURegLoadKey(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszFileName);
  1207. DWORD WINAPI SURegUnLoadKey(HKEY hKey, LPCSTR lpszSubKey);
  1208. DWORD WINAPI SURegFlush(VOID);
  1209. DWORD WINAPI SURegInit(VOID); // should be called before any other Reg APIs
  1210. /***************************************************************************/
  1211. // setup FormatMessage support
  1212. /***************************************************************************/
  1213. #define MB_LOG (UINT)-1
  1214. UINT FAR CDECL suFormatMessage(HINSTANCE hAppInst, LPCSTR lpcFormat, LPSTR szMessage, UINT uSize,
  1215. ...);
  1216. UINT WINAPI suvFormatMessage(HINSTANCE hAppInst, LPCSTR lpcFormat, LPSTR szMessage, UINT uSize,
  1217. LPVOID FAR * lpArgs);
  1218. int WINCAPI _loadds suFormatMessageBox(HINSTANCE hAppInst, HWND hwndParent, LPCSTR lpcText, LPCSTR lpcTitle,
  1219. UINT uStyle, ...);
  1220. WORD WINAPI suErrorToIds( WORD Value, WORD Class );
  1221. /***************************************************************************/
  1222. // setup Version Conflict support
  1223. /***************************************************************************/
  1224. LPVOID WINAPI suVerConflictInit(BOOL fYesToLangMismatch);
  1225. void WINAPI suVerConflictTerm(LPVOID lpvData);
  1226. LRESULT WINAPI suVerConflict(HWND hwnd, LPVCPVERCONFLICT lpvc, LPVOID lpvData);
  1227. /***************************************************************************/
  1228. // setup Help support
  1229. /***************************************************************************/
  1230. BOOL WINAPI suHelp( HWND hwndApp, HWND hwndDlg );
  1231. //***************************************************************************/
  1232. // setup Emergency Boot Disk (EBD) creation fn.
  1233. //***************************************************************************/
  1234. RETERR WINAPI suCreateEBD( HWND hWnd, VIFPROC CopyCallbackProc, LPARAM lpuii );
  1235. //***************************************************************************
  1236. // Misc SETUPX.DLL support functions.
  1237. //***************************************************************************
  1238. RETERR WINAPI SUGetSetSetupFlags(LPDWORD lpdwFlags, BOOL bSet);
  1239. RETERR WINAPI CfgSetupMerge( int uFlags );
  1240. #ifndef LPLPSTR
  1241. typedef LPSTR (FAR *LPLPSTR);
  1242. #endif
  1243. //***************************************************************************
  1244. //
  1245. // ENUMS for accessing config.sys/autoexec.bat line objects using the
  1246. // array returned by ParseConfigLine()..
  1247. //
  1248. //***************************************************************************
  1249. enum CFGLINE_STRINGS // Config.sys/autoexec.bat objects
  1250. {
  1251. CFG_KEYLEAD, // Keyword leading whitespaces
  1252. CFG_KEYWORD, // Keyword
  1253. CFG_KEYTRAIL, // Keyword trailing delimiters
  1254. CFG_UMBINFO, // Load high info
  1255. CFG_DRVLETTER, // Drive letter for cmd path
  1256. CFG_PATH, // Command path
  1257. CFG_COMMAND, // Command base name
  1258. CFG_EXT, // Command extension including '.'
  1259. CFG_ARGS, // Command arguments
  1260. CFG_FREE, // Free area at end of buffer
  1261. CFG_END
  1262. };
  1263. // DJM This will be included soon
  1264. /*---------------------------------------------------------------------------*
  1265. * SUB String Data
  1266. *---------------------------------------------------------------------------*/
  1267. typedef struct _SUBSTR_DATA {
  1268. LPSTR lpFirstSubstr;
  1269. LPSTR lpCurSubstr;
  1270. LPSTR lpLastSubstr;
  1271. } SUBSTR_DATA;
  1272. typedef SUBSTR_DATA* PSUBSTR_DATA;
  1273. typedef SUBSTR_DATA NEAR* NPSUBSTR_DATA;
  1274. typedef SUBSTR_DATA FAR* LPSUBSTR_DATA;
  1275. BOOL WINAPI InitSubstrData(LPSUBSTR_DATA lpSubstrData, LPSTR lpStr);
  1276. BOOL WINAPI GetFirstSubstr(LPSUBSTR_DATA lpSubstrData);
  1277. BOOL WINAPI GetNextSubstr(LPSUBSTR_DATA lpSubStrData);
  1278. /*---------------------------------------------------------------------------*
  1279. * Misc. Di functions
  1280. *---------------------------------------------------------------------------*/
  1281. BOOL WINAPI DiBuildPotentialDuplicatesList
  1282. (
  1283. LPDEVICE_INFO lpdi,
  1284. LPSTR lpDuplicateList,
  1285. DWORD cbSize,
  1286. LPDWORD lpcbData,
  1287. LPSTR lpstrDupType
  1288. );
  1289. //***************************************************************************
  1290. #endif // SETUPX_INC