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.

442 lines
9.5 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. hwcomp.h
  5. Abstract:
  6. Module's interface.
  7. Author:
  8. Ovidiu Temereanca (ovidiut) 04-Jul-2000 Initial implementation
  9. Revision History:
  10. --*/
  11. //
  12. // Interface
  13. //
  14. BOOL
  15. WINAPI
  16. HwdbInitializeA (
  17. IN PCSTR TempDir
  18. );
  19. BOOL
  20. WINAPI
  21. HwdbInitializeW (
  22. IN PCWSTR TempDir
  23. );
  24. VOID
  25. WINAPI
  26. HwdbTerminate (
  27. VOID
  28. );
  29. HANDLE
  30. WINAPI
  31. HwdbOpenA (
  32. IN PCSTR DatabaseFile
  33. );
  34. HANDLE
  35. WINAPI
  36. HwdbOpenW (
  37. IN PCWSTR DatabaseFile
  38. );
  39. VOID
  40. WINAPI
  41. HwdbClose (
  42. IN HANDLE Hwdb
  43. );
  44. typedef
  45. BOOL
  46. (*HWDBAPPENDINFSCALLBACKA) (
  47. IN PVOID Context,
  48. IN PCSTR PnpId,
  49. IN PCSTR ActualInfFilename,
  50. IN PCSTR SourceDir,
  51. IN PCSTR FullInfPath
  52. );
  53. BOOL
  54. WINAPI
  55. HwdbAppendInfsA (
  56. IN HANDLE Hwdb,
  57. IN PCSTR SourceDirectory,
  58. IN HWDBAPPENDINFSCALLBACKA Callback, OPTIONAL
  59. IN PVOID CallbackContext OPTIONAL
  60. );
  61. typedef
  62. BOOL
  63. (*HWDBAPPENDINFSCALLBACKW) (
  64. IN PVOID Context,
  65. IN PCWSTR PnpId,
  66. IN PCWSTR ActualInfFilename,
  67. IN PCWSTR SourceDir,
  68. IN PCWSTR FullInfPath
  69. );
  70. BOOL
  71. WINAPI
  72. HwdbAppendInfsW (
  73. IN HANDLE Hwdb,
  74. IN PCWSTR SourceDirectory,
  75. IN HWDBAPPENDINFSCALLBACKW Callback, OPTIONAL
  76. IN PVOID CallbackContext OPTIONAL
  77. );
  78. BOOL
  79. WINAPI
  80. HwdbAppendDatabase (
  81. IN HANDLE HwdbTarget,
  82. IN HANDLE HwdbSource
  83. );
  84. BOOL
  85. WINAPI
  86. HwdbFlushA (
  87. IN HANDLE Hwdb,
  88. IN PCSTR OutputFile
  89. );
  90. BOOL
  91. WINAPI
  92. HwdbFlushW (
  93. IN HANDLE Hwdb,
  94. IN PCWSTR OutputFile
  95. );
  96. BOOL
  97. WINAPI
  98. HwdbHasDriverA (
  99. IN HANDLE Hwdb,
  100. IN PCSTR PnpId,
  101. OUT PBOOL Unsupported
  102. );
  103. BOOL
  104. WINAPI
  105. HwdbHasDriverW (
  106. IN HANDLE Hwdb,
  107. IN PCWSTR PnpId,
  108. OUT PBOOL Unsupported
  109. );
  110. BOOL
  111. WINAPI
  112. HwdbHasAnyDriverA (
  113. IN HANDLE Hwdb,
  114. IN PCSTR PnpIds,
  115. OUT PBOOL Unsupported
  116. );
  117. BOOL
  118. WINAPI
  119. HwdbHasAnyDriverW (
  120. IN HANDLE Hwdb,
  121. IN PCWSTR PnpIds,
  122. OUT PBOOL Unsupported
  123. );
  124. typedef
  125. BOOL
  126. (WINAPI* PHWDBINITIALIZEA) (
  127. IN PCSTR TempDir
  128. );
  129. typedef
  130. BOOL
  131. (WINAPI* PHWDBINITIALIZEW) (
  132. IN PCWSTR TempDir
  133. );
  134. typedef
  135. VOID
  136. (WINAPI* PHWDBTERMINATE) (
  137. VOID
  138. );
  139. typedef
  140. HANDLE
  141. (WINAPI* PHWDBOPENA) (
  142. IN PCSTR DatabaseFile
  143. );
  144. typedef
  145. HANDLE
  146. (WINAPI* PHWDBOPENW) (
  147. IN PCWSTR DatabaseFile
  148. );
  149. typedef
  150. VOID
  151. (WINAPI* PHWDBCLOSE) (
  152. IN HANDLE Hwdb
  153. );
  154. typedef
  155. BOOL
  156. (WINAPI* PHWDBAPPENDINFSA) (
  157. IN HANDLE Hwdb,
  158. IN PCSTR SourceDirectory,
  159. IN HWDBAPPENDINFSCALLBACKA Callback, OPTIONAL
  160. IN PVOID CallbackContext OPTIONAL
  161. );
  162. typedef
  163. BOOL
  164. (WINAPI* PHWDBAPPENDINFSW) (
  165. IN HANDLE Hwdb,
  166. IN PCWSTR SourceDirectory,
  167. IN HWDBAPPENDINFSCALLBACKW Callback, OPTIONAL
  168. IN PVOID CallbackContext OPTIONAL
  169. );
  170. typedef
  171. BOOL
  172. (WINAPI* PHWDBAPPENDDATABASE) (
  173. IN HANDLE HwdbTarget,
  174. IN HANDLE HwdbSource
  175. );
  176. typedef
  177. BOOL
  178. (WINAPI* PHWDBFLUSHA) (
  179. IN HANDLE Hwdb,
  180. IN PCSTR OutputFile
  181. );
  182. typedef
  183. BOOL
  184. (WINAPI* PHWDBFLUSHW) (
  185. IN HANDLE Hwdb,
  186. IN PCWSTR OutputFile
  187. );
  188. typedef
  189. BOOL
  190. (WINAPI* PHWDBHASDRIVERA) (
  191. IN HANDLE Hwdb,
  192. IN PCSTR PnpId,
  193. OUT PBOOL Unsupported
  194. );
  195. typedef
  196. BOOL
  197. (WINAPI* PHWDBHASDRIVERW) (
  198. IN HANDLE Hwdb,
  199. IN PCWSTR PnpId,
  200. OUT PBOOL Unsupported
  201. );
  202. typedef
  203. BOOL
  204. (WINAPI* PHWDBHASANYDRIVERA) (
  205. IN HANDLE Hwdb,
  206. IN PCSTR PnpId,
  207. OUT PBOOL Unsupported
  208. );
  209. typedef
  210. BOOL
  211. (WINAPI* PHWDBHASANYDRIVERW) (
  212. IN HANDLE Hwdb,
  213. IN PCWSTR PnpId,
  214. OUT PBOOL Unsupported
  215. );
  216. #if 0
  217. typedef
  218. BOOL
  219. (WINAPI* PHWDBENUM_CALLBACKA) (
  220. IN PVOID UserContext,
  221. IN PCSTR PnpId,
  222. IN PCSTR InfFileName
  223. );
  224. typedef
  225. BOOL
  226. (WINAPI* PHWDBENUM_CALLBACKW) (
  227. IN PVOID UserContext,
  228. IN PCWSTR PnpId,
  229. IN PCWSTR InfFileName
  230. );
  231. BOOL
  232. HwdbEnumeratePnpIdA (
  233. IN HANDLE Hwdb,
  234. IN PHWDBENUM_CALLBACKA EnumCallback,
  235. IN PVOID UserContext
  236. );
  237. BOOL
  238. HwdbEnumeratePnpIdW (
  239. IN HANDLE Hwdb,
  240. IN PHWDBENUM_CALLBACKW EnumCallback,
  241. IN PVOID UserContext
  242. );
  243. typedef
  244. BOOL
  245. (WINAPI* PHWDBENUMERATEPNPIDA) (
  246. IN HANDLE Hwdb,
  247. IN PHWDBENUM_CALLBACKA EnumCallback,
  248. IN PVOID UserContext
  249. );
  250. typedef
  251. BOOL
  252. (WINAPI* PHWDBENUMERATEPNPIDW) (
  253. IN HANDLE Hwdb,
  254. IN PHWDBENUM_CALLBACKW EnumCallback,
  255. IN PVOID UserContext
  256. );
  257. #endif
  258. typedef struct {
  259. CHAR InfFile[MAX_PATH];
  260. PCSTR PnpIds;
  261. PVOID Internal;
  262. } HWDBINF_ENUMA, *PHWDBINF_ENUMA;
  263. typedef struct {
  264. PCWSTR InfFile;
  265. PCWSTR PnpIds;
  266. PVOID Internal;
  267. } HWDBINF_ENUMW, *PHWDBINF_ENUMW;
  268. BOOL
  269. HwdbEnumFirstInfA (
  270. OUT PHWDBINF_ENUMA EnumPtr,
  271. IN PCSTR DatabaseFile
  272. );
  273. BOOL
  274. HwdbEnumFirstInfW (
  275. OUT PHWDBINF_ENUMW EnumPtr,
  276. IN PCWSTR DatabaseFile
  277. );
  278. BOOL
  279. HwdbEnumNextInfA (
  280. IN OUT PHWDBINF_ENUMA EnumPtr
  281. );
  282. BOOL
  283. HwdbEnumNextInfW (
  284. IN OUT PHWDBINF_ENUMW EnumPtr
  285. );
  286. VOID
  287. HwdbAbortEnumInfA (
  288. IN OUT PHWDBINF_ENUMA EnumPtr
  289. );
  290. VOID
  291. HwdbAbortEnumInfW (
  292. IN OUT PHWDBINF_ENUMW EnumPtr
  293. );
  294. //
  295. // exported function names
  296. //
  297. #define S_HWDBAPI_HWDBINITIALIZE_A "HwdbInitializeA"
  298. #define S_HWDBAPI_HWDBINITIALIZE_W "HwdbInitializeW"
  299. #define S_HWDBAPI_HWDBTERMINATE "HwdbTerminate"
  300. #define S_HWDBAPI_HWDBOPEN_A "HwdbOpenA"
  301. #define S_HWDBAPI_HWDBOPEN_W "HwdbOpenW"
  302. #define S_HWDBAPI_HWDBCLOSE "HwdbClose"
  303. #define S_HWDBAPI_HWDBAPPENDINFS_A "HwdbAppendInfsA"
  304. #define S_HWDBAPI_HWDBAPPENDINFS_W "HwdbAppendInfsW"
  305. #define S_HWDBAPI_HWDBAPPENDDATABASE "HwdbAppendDatabase"
  306. #define S_HWDBAPI_HWDBFLUSH_A "HwdbFlushA"
  307. #define S_HWDBAPI_HWDBFLUSH_W "HwdbFlushW"
  308. #define S_HWDBAPI_HWDBHASDRIVER_A "HwdbHasDriverA"
  309. #define S_HWDBAPI_HWDBHASDRIVER_W "HwdbHasDriverW"
  310. #define S_HWDBAPI_HWDBHASANYDRIVER_A "HwdbHasAnyDriverA"
  311. #define S_HWDBAPI_HWDBHASANYDRIVER_W "HwdbHasAnyDriverW"
  312. typedef struct {
  313. PHWDBINITIALIZEA HwdbInitialize;
  314. PHWDBTERMINATE HwdbTerminate;
  315. PHWDBOPENA HwdbOpen;
  316. PHWDBCLOSE HwdbClose;
  317. PHWDBAPPENDINFSA HwdbAppendInfs;
  318. PHWDBFLUSHA HwdbFlush;
  319. PHWDBHASDRIVERA HwdbHasDriver;
  320. PHWDBHASANYDRIVERA HwdbHasAnyDriver;
  321. } HWDB_ENTRY_POINTSA, *PHWDB_ENTRY_POINTSA;
  322. typedef struct {
  323. PHWDBINITIALIZEW HwdbInitialize;
  324. PHWDBTERMINATE HwdbTerminate;
  325. PHWDBOPENW HwdbOpen;
  326. PHWDBCLOSE HwdbClose;
  327. PHWDBAPPENDINFSW HwdbAppendInfs;
  328. PHWDBFLUSHW HwdbFlush;
  329. PHWDBHASDRIVERW HwdbHasDriver;
  330. PHWDBHASANYDRIVERW HwdbHasAnyDriver;
  331. } HWDB_ENTRY_POINTSW, *PHWDB_ENTRY_POINTSW;
  332. #ifdef UNICODE
  333. #define S_HWDBAPI_HWDBINITIALIZE S_HWDBAPI_HWDBINITIALIZE_W
  334. #define PHWDBINITIALIZE PHWDBINITIALIZEW
  335. #define S_HWDBAPI_HWDBOPEN S_HWDBAPI_HWDBOPEN_W
  336. #define PHWDBOPEN PHWDBOPENW
  337. #define S_HWDBAPI_HWDBAPPENDINFS S_HWDBAPI_HWDBAPPENDINFS_W
  338. #define PHWDBAPPENDINFS PHWDBAPPENDINFSW
  339. #define S_HWDBAPI_HWDBFLUSH S_HWDBAPI_HWDBFLUSH_W
  340. #define PHWDBFLUSH PHWDBFLUSHW
  341. #define S_HWDBAPI_HWDBHASDRIVER S_HWDBAPI_HWDBHASDRIVER_W
  342. #define PHWDBHASDRIVER PHWDBHASDRIVERW
  343. #define S_HWDBAPI_HWDBHASANYDRIVER S_HWDBAPI_HWDBHASANYDRIVER_W
  344. #define PHWDBHASANYDRIVER PHWDBHASANYDRIVERW
  345. #define HWDBINF_ENUM HWDBINF_ENUMW
  346. #define PHWDBINF_ENUM PHWDBINF_ENUMW
  347. #define HwdbEnumFirstInf HwdbEnumFirstInfW
  348. #define HwdbEnumNextInf HwdbEnumNextInfW
  349. #define HwdbAbortEnumInf HwdbAbortEnumInfW
  350. #define HWDB_ENTRY_POINTS HWDB_ENTRY_POINTSW
  351. #define PHWDB_ENTRY_POINTS PHWDB_ENTRY_POINTSW
  352. #else
  353. #define S_HWDBAPI_HWDBINITIALIZE S_HWDBAPI_HWDBINITIALIZE_A
  354. #define PHWDBINITIALIZE PHWDBINITIALIZEA
  355. #define S_HWDBAPI_HWDBOPEN S_HWDBAPI_HWDBOPEN_A
  356. #define PHWDBOPEN PHWDBOPENA
  357. #define S_HWDBAPI_HWDBAPPENDINFS S_HWDBAPI_HWDBAPPENDINFS_A
  358. #define PHWDBAPPENDINFS PHWDBAPPENDINFSA
  359. #define S_HWDBAPI_HWDBFLUSH S_HWDBAPI_HWDBFLUSH_A
  360. #define PHWDBFLUSH PHWDBFLUSHA
  361. #define S_HWDBAPI_HWDBHASDRIVER S_HWDBAPI_HWDBHASDRIVER_A
  362. #define PHWDBHASDRIVER PHWDBHASDRIVERA
  363. #define S_HWDBAPI_HWDBHASANYDRIVER S_HWDBAPI_HWDBHASANYDRIVER_A
  364. #define PHWDBHASANYDRIVER PHWDBHASANYDRIVERA
  365. #define HWDBINF_ENUM HWDBINF_ENUMA
  366. #define PHWDBINF_ENUM PHWDBINF_ENUMA
  367. #define HwdbEnumFirstInf HwdbEnumFirstInfA
  368. #define HwdbEnumNextInf HwdbEnumNextInfA
  369. #define HwdbAbortEnumInf HwdbAbortEnumInfA
  370. #define HWDB_ENTRY_POINTS HWDB_ENTRY_POINTSA
  371. #define PHWDB_ENTRY_POINTS PHWDB_ENTRY_POINTSA
  372. #endif