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.

297 lines
7.6 KiB

  1. //
  2. // Copyright (c) Microsoft Corporation 1993-1996
  3. //
  4. // rovdi.h
  5. //
  6. // History:
  7. // 11-13-95 ScottH Separated from NT modem class installer
  8. //
  9. #ifndef __ROVDI_H__
  10. #define __ROVDI_H__
  11. #ifdef WINNT
  12. #define REENUMERATE_PORT
  13. #include <setupapi.h>
  14. #include <bustype.h>
  15. //------------------------------------------------------------------------
  16. //------------------------------------------------------------------------
  17. //
  18. // Enumerate ports
  19. //
  20. DECLARE_HANDLE32(HPORTDATA);
  21. typedef BOOL (WINAPI FAR * ENUMPORTPROC)(HPORTDATA hportdata, LPARAM lParam);
  22. DWORD
  23. APIENTRY
  24. EnumeratePorts(
  25. IN ENUMPORTPROC pfnDevice,
  26. IN LPARAM lParam); OPTIONAL
  27. typedef struct tagPORTDATA_A
  28. {
  29. DWORD cbSize;
  30. DWORD nSubclass;
  31. CHAR szPort[MAX_BUF];
  32. CHAR szFriendly[MAX_BUF];
  33. } PORTDATA_A, FAR * LPPORTDATA_A;
  34. typedef struct tagPORTDATA_W
  35. {
  36. DWORD cbSize;
  37. DWORD nSubclass;
  38. WCHAR szPort[MAX_BUF];
  39. WCHAR szFriendly[MAX_BUF];
  40. } PORTDATA_W, FAR * LPPORTDATA_W;
  41. #ifdef UNICODE
  42. #define PORTDATA PORTDATA_W
  43. #define LPPORTDATA LPPORTDATA_W
  44. #else
  45. #define PORTDATA PORTDATA_A
  46. #define LPPORTDATA LPPORTDATA_A
  47. #endif
  48. // Port subclass values
  49. #define PORT_SUBCLASS_PARALLEL 0
  50. #define PORT_SUBCLASS_SERIAL 1
  51. BOOL
  52. APIENTRY
  53. PortData_GetPropertiesW(
  54. IN HPORTDATA hportdata,
  55. OUT LPPORTDATA_W pdataBuf);
  56. BOOL
  57. APIENTRY
  58. PortData_GetPropertiesA(
  59. IN HPORTDATA hportdata,
  60. OUT LPPORTDATA_A pdataBuf);
  61. #ifdef UNICODE
  62. #define PortData_GetProperties PortData_GetPropertiesW
  63. #else
  64. #define PortData_GetProperties PortData_GetPropertiesA
  65. #endif
  66. //
  67. // These set of routines map friendly names of ports to
  68. // (non-friendly) port names, and vice-versa.
  69. //
  70. DECLARE_HANDLE32(HPORTMAP);
  71. BOOL
  72. APIENTRY
  73. PortMap_Create(
  74. OUT HPORTMAP FAR * phportmap);
  75. DWORD
  76. APIENTRY
  77. PortMap_GetCount(
  78. IN HPORTMAP hportmap);
  79. BOOL
  80. APIENTRY
  81. PortMap_GetFriendlyW(
  82. IN HPORTMAP hportmap,
  83. IN LPCWSTR pwszPortName,
  84. OUT LPWSTR pwszBuf,
  85. IN DWORD cchBuf);
  86. BOOL
  87. APIENTRY
  88. PortMap_GetFriendlyA(
  89. IN HPORTMAP hportmap,
  90. IN LPCSTR pszPortName,
  91. OUT LPSTR pszBuf,
  92. IN DWORD cchBuf);
  93. #ifdef UNICODE
  94. #define PortMap_GetFriendly PortMap_GetFriendlyW
  95. #else
  96. #define PortMap_GetFriendly PortMap_GetFriendlyA
  97. #endif
  98. BOOL
  99. APIENTRY
  100. PortMap_GetPortNameW(
  101. IN HPORTMAP hportmap,
  102. IN LPCWSTR pwszFriendly,
  103. OUT LPWSTR pwszBuf,
  104. IN DWORD cchBuf);
  105. BOOL
  106. APIENTRY
  107. PortMap_GetPortNameA(
  108. IN HPORTMAP hportmap,
  109. IN LPCSTR pszFriendly,
  110. OUT LPSTR pszBuf,
  111. IN DWORD cchBuf);
  112. #ifdef UNICODE
  113. #define PortMap_GetPortName PortMap_GetPortNameW
  114. #else
  115. #define PortMap_GetPortName PortMap_GetPortNameA
  116. #endif
  117. #ifdef REENUMERATE_PORT
  118. BOOL
  119. APIENTRY
  120. PortMap_GetDevNodeW(
  121. IN HPORTMAP hportmap,
  122. IN LPCWSTR pszPortName,
  123. OUT LPDWORD pdwDevNode);
  124. BOOL
  125. APIENTRY
  126. PortMap_GetDevNodeA(
  127. IN HPORTMAP hportmap,
  128. IN LPCSTR pszPortName,
  129. OUT LPDWORD pdwDevNode);
  130. #ifdef UNICODE
  131. #define PortMap_GetDevNode PortMap_GetDevNodeW
  132. #else
  133. #define PortMap_GetDevNode PortMap_GetDevNodeW
  134. #endif
  135. #endif //REENUMERATE_PORT
  136. BOOL
  137. APIENTRY
  138. PortMap_Free(
  139. IN HPORTMAP hportmap);
  140. //-----------------------------------------------------------------------------------
  141. // Wrappers to insulate us a little bit if we need it. We need it.
  142. //-----------------------------------------------------------------------------------
  143. #define CplDiCreateDeviceInfoList SetupDiCreateDeviceInfoList
  144. #define CplDiGetDeviceInfoListClass SetupDiGetDeviceInfoListClass
  145. #define CplDiCreateDeviceInfo SetupDiCreateDeviceInfo
  146. #define CplDiOpenDeviceInfo SetupDiOpenDeviceInfo
  147. #define CplDiGetDeviceInstanceId SetupDiGetDeviceInstanceId
  148. #define CplDiDeleteDeviceInfo SetupDiDeleteDeviceInfo
  149. #define CplDiEnumDeviceInfo SetupDiEnumDeviceInfo
  150. #define CplDiDestroyDeviceInfoList SetupDiDestroyDeviceInfoList
  151. #define CplDiRegisterDeviceInfo SetupDiRegisterDeviceInfo
  152. #define CplDiBuildDriverInfoList SetupDiBuildDriverInfoList
  153. #define CplDiEnumDriverInfo SetupDiEnumDriverInfo
  154. #define CplDiGetSelectedDriver SetupDiGetSelectedDriver
  155. #define CplDiSetSelectedDriver SetupDiSetSelectedDriver
  156. #define CplDiGetDriverInfoDetail SetupDiGetDriverInfoDetail
  157. #define CplDiDestroyDriverInfoList SetupDiDestroyDriverInfoList
  158. #define CplDiGetClassDevs SetupDiGetClassDevs
  159. #define CplDiGetClassDescription SetupDiGetClassDescription
  160. #define CplDiOpenClassRegKey SetupDiOpenClassRegKey
  161. #define CplDiCreateDevRegKey SetupDiCreateDevRegKey
  162. #define CplDiOpenDevRegKey SetupDiOpenDevRegKey
  163. #define CplDiGetHwProfileList SetupDiGetHwProfileList
  164. #define CplDiGetDeviceRegistryProperty SetupDiGetDeviceRegistryProperty
  165. #define CplDiSetDeviceRegistryProperty SetupDiSetDeviceRegistryProperty
  166. #define CplDiGetClassInstallParams SetupDiGetClassInstallParams
  167. #define CplDiSetClassInstallParams SetupDiSetClassInstallParams
  168. /*#ifdef DEBUG
  169. BOOL
  170. CplDiSetDeviceInstallParams(
  171. IN HDEVINFO DeviceInfoSet,
  172. IN PSP_DEVINFO_DATA DeviceInfoData,
  173. IN PSP_DEVINSTALL_PARAMS DeviceInstallParams
  174. );
  175. BOOL
  176. CplDiGetDeviceInstallParams(
  177. IN HDEVINFO DeviceInfoSet,
  178. IN PSP_DEVINFO_DATA DeviceInfoData,
  179. OUT PSP_DEVINSTALL_PARAMS DeviceInstallParams
  180. );
  181. #else*/
  182. #define CplDiGetDeviceInstallParams SetupDiGetDeviceInstallParams
  183. #define CplDiSetDeviceInstallParams SetupDiSetDeviceInstallParams
  184. //#endif //DEBUG
  185. #define CplDiGetDriverInstallParams SetupDiGetDriverInstallParams
  186. #define CplDiSetDriverInstallParams SetupDiSetDriverInstallParams
  187. #define CplDiClassNameFromGuid SetupDiClassNameFromGuid
  188. #define CplDiClassGuidsFromName SetupDiClassGuidsFromName
  189. #define CplDiGetHwProfileFriendlyName SetupDiGetHwProfileFriendlyName
  190. #define CplDiGetWizardPage SetupDiGetWizardPage
  191. #define CplDiGetSelectedDevice SetupDiGetSelectedDevice
  192. #define CplDiSetSelectedDevice SetupDiSetSelectedDevice
  193. #define CplDiInstallDevice SetupDiInstallDevice
  194. #define CplDiCallClassInstaller SetupDiCallClassInstaller
  195. #define CplDiRemoveDevice SetupDiRemoveDevice
  196. #define CplDiGetActualSectionToInstall SetupDiGetActualSectionToInstall
  197. // Functions to support common device Responses key:
  198. // Common key flags for OpenCommonResponseskey() and OpenCommonDriverKey().
  199. typedef enum
  200. {
  201. CKFLAG_OPEN = 0x0001,
  202. CKFLAG_CREATE = 0x0002
  203. } CKFLAGS;
  204. BOOL
  205. PUBLIC
  206. OpenCommonDriverKey(
  207. IN HKEY hkeyDrv, OPTIONAL
  208. IN PSP_DRVINFO_DATA pdrvData, OPTIONAL
  209. IN REGSAM samAccess,
  210. OUT PHKEY phkeyComDrv);
  211. BOOL
  212. PUBLIC
  213. OpenCommonResponsesKey(
  214. IN HKEY hkeyDrv,
  215. IN CKFLAGS ckFlags,
  216. IN REGSAM samAccess,
  217. OUT PHKEY phkeyResp,
  218. OUT LPDWORD lpdwExisted);
  219. BOOL
  220. PUBLIC
  221. OpenResponsesKey(
  222. IN HKEY hkeyDrv,
  223. OUT PHKEY phkeyResp);
  224. BOOL
  225. PUBLIC
  226. FindCommonDriverKeyName(
  227. IN HKEY hkeyDrv,
  228. IN DWORD cbKeyName,
  229. OUT LPTSTR pszKeyName);
  230. BOOL
  231. PUBLIC
  232. GetCommonDriverKeyName(
  233. IN HKEY hkeyDrv, OPTIONAL
  234. IN PSP_DRVINFO_DATA pdrvData, OPTIONAL
  235. IN DWORD cbKeyName,
  236. OUT LPTSTR pszKeyName);
  237. BOOL
  238. PUBLIC
  239. DeleteCommonDriverKey(
  240. IN HKEY hkeyDrv);
  241. BOOL
  242. PUBLIC
  243. DeleteCommonDriverKeyByName(
  244. IN LPTSTR pszKeyName);
  245. #endif // WINNT
  246. #endif __ROVDI_H__