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.

213 lines
7.4 KiB

  1. /* DRIVERS.H
  2. **
  3. ** Copyright (C) Microsoft, 1990, All Rights Reserved.
  4. **
  5. **
  6. ** Multimedia Control Panel Drivers Applet.
  7. **
  8. ** Display a list of all installed drivers, allow user to configure
  9. ** existing or install new ones.
  10. **
  11. */
  12. #include "dlgs.h"
  13. #include "commdlg.h"
  14. #include <multimed.h>
  15. #define SECTION 512 // Maximum size of section
  16. #define DLG_BROWSE 38
  17. #define MAXSTR 256
  18. #define UNLIST_LINE 1
  19. #define NO_UNLIST_LINE 0
  20. #define WEC_RESTART 0x42
  21. #define DESC_SYS 3
  22. #define DESC_INF 2
  23. #define DESC_EXE 1
  24. #define DESC_NOFILE 0
  25. typedef struct _IDRIVER
  26. {
  27. WCHAR wszSection[MAXSTR];
  28. WCHAR wszAlias[MAXSTR];
  29. WCHAR wszFile[MAX_PATH];
  30. char szSection[MAXSTR];
  31. char szAlias[MAXSTR];
  32. char szFile[MAX_PATH];
  33. char szDesc[MAXSTR];
  34. struct _IDRIVER *related;
  35. BOOL bRelated;
  36. char szRelated[MAXSTR];
  37. char szRemove[MAXSTR];
  38. int fQueryable; // 0 -> can't, 1 -> can, -1 -> need to check
  39. BOOL bInstall; // 0 -> no, 1 -> yes
  40. BOOL KernelDriver; // If TRUE this is a kernel driver, not an
  41. // 'installable' driver so it can't be opened,
  42. // process messages etc.
  43. #ifdef INFFILE
  44. BOOL infFileProcessing;
  45. #endif // INFFILE
  46. } IDRIVER, *PIDRIVER;
  47. extern HANDLE myInstance;
  48. extern char szNULL[];
  49. extern char szDrivers[];
  50. extern char szBoot[];
  51. extern char szDriversHlp[];
  52. extern char szAppName[];
  53. extern char szUnlisted[];
  54. extern char szFullPath[];
  55. extern char szOemInf[];
  56. extern char szDirOfSrc[];
  57. extern char szUserDrivers[];
  58. extern char szControlIni[];
  59. extern char szDriversDesc[];
  60. extern char szSetupInf[];
  61. extern char szSysIni[];
  62. extern char szMCI[];
  63. extern char szRestartDrv[];
  64. extern char szRelated[];
  65. extern char szNULL[];
  66. extern char szBackslash[];
  67. extern char szOutOfRemoveSpace[];
  68. extern char szKnown[];
  69. extern char szRelatedDesc[];
  70. extern char szDrv[];
  71. extern char szRemove[];
  72. extern char szSystem[];
  73. extern char szSystemDrivers[];
  74. extern int iRestartMessage;
  75. extern UINT wHelpMessage;
  76. extern DWORD dwContext;
  77. extern BOOL bCopyVxD;
  78. extern BOOL bVxd;
  79. extern BOOL bInstallBootLine;
  80. extern BOOL bFindOEM;
  81. extern BOOL bRestart;
  82. extern BOOL bCopyingRelated;
  83. extern BOOL bRelated;
  84. extern HWND hlistbox;
  85. //------------------------------------------------------------------------
  86. //
  87. // Public routines
  88. //
  89. //------------------------------------------------------------------------
  90. extern void RemoveDriverEntry (PSTR, PSTR, PSTR, BOOL);
  91. extern int FileNameCmp (char *, char *);
  92. extern void OpenDriverError (HWND, LPSTR, LPSTR);
  93. extern void RemoveSpaces (LPSTR, LPSTR);
  94. extern BOOL RestartDlg (HWND, unsigned, UINT, LONG);
  95. extern int AddDriversDlg (HWND, unsigned, UINT, LONG);
  96. extern BOOL AddUnlistedDlg (HWND, unsigned, UINT, LONG);
  97. extern BOOL mmAddNewDriver (LPSTR, LPSTR, PIDRIVER);
  98. extern LONG PostRemove (HWND, PIDRIVER, BOOL, int);
  99. extern BOOL RemoveService (LPSTR);
  100. extern BOOL IsOnlyInstance (HWND, PIDRIVER);
  101. extern BOOL CopyToSysDir (void);
  102. extern BOOL InstallDrivers (HWND, HWND, PSTR);
  103. extern void InitDrvConfigInfo (LPDRVCONFIGINFO, PIDRIVER);
  104. extern int AddIDriver (HWND, PIDRIVER);
  105. extern BOOL IsConfigurable (PIDRIVER, HWND);
  106. extern void BrowseDlg (HWND, int);
  107. extern int LoadDesc (PIDRIVER, PSTR, PSTR);
  108. extern BOOL wsInfParseInit (void);
  109. extern void wsStartWait (void);
  110. extern void wsEndWait (void);
  111. extern UINT wsCopySingleStatus (int, DWORD, LPSTR);
  112. /* Resource IDs */
  113. #define IDOK 1
  114. #define IDCANCEL 2
  115. #define ID_IGNORE 3
  116. #define ID_CURRENT 4
  117. #define ID_RETRY 5
  118. #define ID_NEW 6
  119. #define ID_DISK 101
  120. #define ID_ADD 102
  121. #define ID_CONFIGURE 103
  122. #define ID_REMOVE 104
  123. #define ID_EDIT 105
  124. #define ID_TEXT 106
  125. #define ID_FILE 201
  126. #define ID_DIR 202
  127. #define ID_FILE_LIST 203
  128. #define ID_DIR_LIST 204
  129. #define ID_TYPE 205
  130. #define LB_AVAILABLE 301
  131. #define ID_DRV 302
  132. #define ID_LIST 303
  133. #define ID_DRVSTRING 304
  134. #define LB_INSTALLED 305
  135. #define LB_UNLISTED 306
  136. #define DLG_INSTALLED 1001
  137. #define DLG_UPDATE 1002
  138. #define DLG_KNOWN 1003
  139. #define DLG_RESTART 1004
  140. #define DLG_EXISTS 1005
  141. #define DLG_INSERTDISK 1006
  142. #define DLG_COPYERR 1007
  143. #define ID_STATUS2 1008
  144. #define IDS_NOINF 2003
  145. #define IDS_DEFDRIVE 2004
  146. #define IDS_OUTOFDISK 2005
  147. #define IDS_DISKS 2006
  148. #define IDS_INSTALLDRIVERS 2007
  149. #define IDS_INSTALLDRIVERS32 2066
  150. #define IDS_DRIVERDESC 2008
  151. #define IDS_OUT_OF_REMOVE_SPACE 2009
  152. #define IDS_AVAILABLE_DRIVERS_DEFAULT 2010
  153. #define IDS_ERROR 2011
  154. #define IDS_INSTALLING_DRIVERS 2012
  155. #define IDS_NO_DESCRIPTION 2013
  156. #define IDS_ERRORBOX 2014
  157. #define IDS_RESTARTTEXT 2015
  158. #define IDS_CONFIGURE_DRIVER 2016
  159. #define IDS_TOO_MANY_DRIVERS 2017
  160. #define IDS_CANNOT_FIND 2018
  161. #define IDS_APPNAME 2019
  162. #define IDS_DRIVERS 2020
  163. #define IDS_SETUPINF 2021
  164. #define IDS_CONTROLINI 2022
  165. #define IDS_SYSINI 2023
  166. #define IDS_MCI 2024
  167. #define IDS_CONTROL_INI 2025
  168. #define IDS_WIN 2027
  169. #define IDS_DOS 2028
  170. #define IDS_BROWSE 2029
  171. #define IDS_UPDATED 2031
  172. #define IDS_CLOSE 2032
  173. #define IDS_REMOVEORNOT 2033
  174. #define IDS_UNLISTED 2034
  175. #define IDS_KNOWN 2035
  176. #define IDS_REMOVE 2036
  177. #define IDS_REMOVEORNOTSTRICT 2037
  178. #define IDS_USERINSTALLDRIVERS 2038
  179. #define IDS_OEMSETUP 2044
  180. #define IDS_SYSTEM 2045
  181. #define IDS_FILE_ERROR 2046
  182. #define IDS_VALID_DRIVER_TYPES 2047
  183. #define IDS_UNABLE_TOINSTALL 2049
  184. #define IDS_BOOT 2050
  185. #define IDS_RESTART_ADD 2051
  186. #define IDS_RESTART_REM 2052
  187. #define IDS_FILEINUSEADD 2053
  188. #define IDS_OEMDISKS 2054
  189. #define IDS_FILEINUSEREM 2055
  190. #define IDS_LASTQUERY 2056
  191. #define IDS_RELATEDDESC 2057
  192. #define IDS_DRIVER_EXISTS 2058
  193. #define IDS_SYSTEM_DRIVERS 2060
  194. #define IDS_INSUFFICIENT_PRIVILEGE 2061
  195. #define IDS_CANNOT_RESTART_PRIVILEGE 2062
  196. #define IDS_CANNOT_RESTART_UNKNOWN 2063
  197. #define IDS_DRIVER_CONFIG_ERROR 2064
  198. #define IDS_CANTADD 2065
  199. #define DRIVERS_ICON ID_ICON