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.

1316 lines
36 KiB

  1. /***************************************************************************
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: diextdll.h
  6. * Content: DirectInput internal include file for external DLL access
  7. *
  8. ***************************************************************************/
  9. #ifndef _DIEXTDLL_H
  10. #define _DIEXTDLL_H
  11. /*****************************************************************************
  12. *
  13. * diextdll.c - Imports from optional external DLLs
  14. *
  15. * It is very important that HidD_GetHidGuid be the very last one.
  16. *
  17. *****************************************************************************/
  18. #ifdef STATIC_DLLUSAGE
  19. #define ExtDll_Init()
  20. #else
  21. void EXTERNAL ExtDll_Init(void);
  22. #endif
  23. void EXTERNAL ExtDll_Term(void);
  24. /*****************************************************************************
  25. *
  26. * @doc INTERNAL
  27. *
  28. * @struct MANUALIMPORT |
  29. *
  30. * Records a single manual import. If it hasn't
  31. * yet been resolved, then the <e MANUALIMPORT.ptsz>
  32. * points to the procedure name. If it has been resolved
  33. * successfully, then <e MANUALIMPORT.pfn> points to
  34. * the resolved address. If it has not been resolved
  35. * successfully, then <e MANUALIMPORT.pfn> is garbage.
  36. *
  37. * @field LPCSTR | psz |
  38. *
  39. * Procdure name. Note that this is always an ANSI string.
  40. *
  41. * @field FARPROC | pfn |
  42. *
  43. * Procedure address.
  44. *
  45. *****************************************************************************/
  46. typedef struct MANUALIMPORT
  47. {
  48. FARPROC pfn; /* Procedure address */
  49. } MANUALIMPORT, *PMANUALIMPORT;
  50. #ifndef STATIC_DLLUSAGE
  51. #ifndef WINNT
  52. /*****************************************************************************
  53. *
  54. * CFGMGR32
  55. *
  56. * Note that this must match the CFGMGR32 section in diextdll.c
  57. *
  58. *****************************************************************************/
  59. typedef union CFGMGR32
  60. {
  61. MANUALIMPORT rgmi[6]; /* number of functions we import */
  62. struct
  63. {
  64. CONFIGRET ( WINAPI * _CM_Get_Child)
  65. (
  66. OUT PDEVINST pdnDevInst,
  67. IN DEVINST dnDevInst,
  68. IN ULONG ulFlags
  69. );
  70. CONFIGRET ( WINAPI * _CM_Get_Sibling)
  71. (
  72. OUT PDEVINST pdnDevInst,
  73. IN DEVINST DevInst,
  74. IN ULONG ulFlags
  75. );
  76. CONFIGRET ( WINAPI * _CM_Get_Parent)
  77. (
  78. OUT PDEVINST pdnDevInst,
  79. IN DEVINST dnDevInst,
  80. IN ULONG ulFlags
  81. );
  82. CONFIGRET ( WINAPI * _CM_Get_DevNode_Registry_Property)
  83. (
  84. IN DEVINST dnDevInst,
  85. IN ULONG ulProperty,
  86. OUT PULONG pulRegDataType, OPTIONAL
  87. OUT PVOID Buffer, OPTIONAL
  88. IN OUT PULONG pulLength,
  89. IN ULONG ulFlags
  90. );
  91. CONFIGRET ( WINAPI * _CM_Set_DevNode_Registry_Property)
  92. (
  93. IN DEVINST dnDevInst,
  94. IN ULONG ulProperty,
  95. IN PVOID Buffer, OPTIONAL
  96. IN ULONG ulLength,
  97. IN ULONG ulFlags
  98. );
  99. CONFIGRET( WINAPI * _CM_Get_Device_ID)
  100. (
  101. IN DEVINST dnDevInst,
  102. OUT PTCHAR Buffer,
  103. IN ULONG BufferLen,
  104. IN ULONG ulFlags
  105. );
  106. };
  107. } CFGMGR32, *PFGMGR32;
  108. extern CFGMGR32 g_cfgmgr32;
  109. #undef CM_Get_Child
  110. #undef CM_Get_Sibling
  111. #undef CM_Get_Parent
  112. #undef CM_Get_DevNode_Registry_Property
  113. #undef CM_Set_DevNode_Registry_Property
  114. #undef CM_Get_Device_ID
  115. #define CM_Get_Child \
  116. g_cfgmgr32._CM_Get_Child
  117. #define CM_Get_Sibling \
  118. g_cfgmgr32._CM_Get_Sibling
  119. #define CM_Get_Parent \
  120. g_cfgmgr32._CM_Get_Parent
  121. #define CM_Get_DevNode_Registry_Property \
  122. g_cfgmgr32._CM_Get_DevNode_Registry_Property
  123. #define CM_Set_DevNode_Registry_Property \
  124. g_cfgmgr32._CM_Set_DevNode_Registry_Property
  125. #define CM_Get_Device_ID \
  126. g_cfgmgr32._CM_Get_Device_ID
  127. #endif //#ifndef WINNT
  128. /*****************************************************************************
  129. *
  130. * SETUPAPI
  131. *
  132. * Note that this must match the SETUPAPI section in diextdll.c
  133. *
  134. *****************************************************************************/
  135. typedef union SETUPAPI
  136. {
  137. #ifdef WINNT
  138. MANUALIMPORT rgmi[18]; /* number of functions we import */
  139. #else
  140. MANUALIMPORT rgmi[12]; /* number of functions we import */
  141. #endif
  142. struct
  143. {
  144. HDEVINFO (WINAPI *_SetupDiGetClassDevs)
  145. (
  146. IN LPGUID ClassGuid, OPTIONAL
  147. IN LPCTSTR Enumerator, OPTIONAL
  148. IN HWND hwndParent, OPTIONAL
  149. IN DWORD Flags
  150. );
  151. BOOL (WINAPI *_SetupDiDestroyDeviceInfoList)
  152. (
  153. IN HDEVINFO DeviceInfoSet
  154. );
  155. BOOL (WINAPI *_SetupDiGetDeviceInterfaceDetail)
  156. (
  157. IN HDEVINFO DeviceInfoSet,
  158. IN PSP_DEVICE_INTERFACE_DATA pdid,
  159. OUT PSP_DEVICE_INTERFACE_DETAIL_DATA pdidd, OPTIONAL
  160. IN DWORD cbDidd,
  161. OUT PDWORD RequiredSize, OPTIONAL
  162. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  163. );
  164. BOOL (WINAPI *_SetupDiEnumDeviceInterfaces)
  165. (
  166. IN HDEVINFO DeviceInfoSet,
  167. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  168. IN LPGUID InterfaceClassGuid,
  169. IN DWORD MemberIndex,
  170. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
  171. );
  172. HKEY (WINAPI *_SetupDiCreateDeviceInterfaceRegKey)
  173. (
  174. IN HDEVINFO hdev,
  175. IN PSP_DEVICE_INTERFACE_DATA pdid,
  176. IN DWORD Reserved,
  177. IN REGSAM samDesired,
  178. IN HINF InfHandle, OPTIONAL
  179. IN PCSTR InfSectionName OPTIONAL
  180. );
  181. BOOL (WINAPI *_SetupDiCallClassInstaller)
  182. (
  183. IN DI_FUNCTION InstallFunction,
  184. IN HDEVINFO DeviceInfoSet,
  185. IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  186. );
  187. BOOL (WINAPI *_SetupDiGetDeviceRegistryProperty)
  188. (
  189. IN HDEVINFO DeviceInfoSet,
  190. IN PSP_DEVINFO_DATA DeviceInfoData,
  191. IN DWORD Property,
  192. OUT PDWORD PropertyRegDataType, OPTIONAL
  193. OUT PBYTE PropertyBuffer,
  194. IN DWORD PropertyBufferSize,
  195. OUT PDWORD RequiredSize OPTIONAL
  196. );
  197. BOOL (WINAPI *_SetupDiSetDeviceRegistryProperty)
  198. (
  199. IN HDEVINFO DeviceInfoSet,
  200. IN OUT PSP_DEVINFO_DATA DeviceInfoData,
  201. IN DWORD Property,
  202. IN CONST BYTE* PropertyBuffer,
  203. IN DWORD PropertyBufferSize
  204. );
  205. BOOL (WINAPI *_SetupDiGetDeviceInstanceId)
  206. (
  207. IN HDEVINFO DeviceInfoSet,
  208. IN PSP_DEVINFO_DATA DeviceInfoData,
  209. OUT PTSTR DeviceInstanceId,
  210. IN DWORD DeviceInstanceIdSize,
  211. OUT PDWORD RequiredSize OPTIONAL
  212. );
  213. BOOL (WINAPI *_SetupDiOpenDeviceInfo)
  214. (
  215. IN HDEVINFO DeviceInfoSet,
  216. IN LPCTSTR DeviceInstanceId,
  217. IN HWND hwndParent, OPTIONAL
  218. IN DWORD OpenFlags,
  219. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  220. );
  221. HDEVINFO (WINAPI *_SetupDiCreateDeviceInfoList)
  222. (
  223. IN LPGUID ClassGuid, OPTIONAL
  224. IN HWND hwndParent OPTIONAL
  225. );
  226. HKEY (WINAPI *_SetupDiOpenDevRegKey)
  227. (
  228. IN HDEVINFO DeviceInfoSet,
  229. IN PSP_DEVINFO_DATA DeviceInfoData,
  230. IN DWORD Scope,
  231. IN DWORD HwProfile,
  232. IN DWORD KeyType,
  233. IN REGSAM samDesired
  234. );
  235. #ifdef WINNT
  236. CONFIGRET ( WINAPI * _CM_Get_Child)
  237. (
  238. OUT PDEVINST pdnDevInst,
  239. IN DEVINST dnDevInst,
  240. IN ULONG ulFlags
  241. );
  242. CONFIGRET ( WINAPI * _CM_Get_Sibling)
  243. (
  244. OUT PDEVINST pdnDevInst,
  245. IN DEVINST DevInst,
  246. IN ULONG ulFlags
  247. );
  248. CONFIGRET ( WINAPI * _CM_Get_Parent)
  249. (
  250. OUT PDEVINST pdnDevInst,
  251. IN DEVINST dnDevInst,
  252. IN ULONG ulFlags
  253. );
  254. CONFIGRET ( WINAPI * _CM_Get_DevNode_Registry_Property)
  255. (
  256. IN DEVINST dnDevInst,
  257. IN ULONG ulProperty,
  258. OUT PULONG pulRegDataType, OPTIONAL
  259. OUT PVOID Buffer, OPTIONAL
  260. IN OUT PULONG pulLength,
  261. IN ULONG ulFlags
  262. );
  263. CONFIGRET ( WINAPI * _CM_Set_DevNode_Registry_Property)
  264. (
  265. IN DEVINST dnDevInst,
  266. IN ULONG ulProperty,
  267. IN PVOID Buffer, OPTIONAL
  268. IN ULONG ulLength,
  269. IN ULONG ulFlags
  270. );
  271. CONFIGRET( WINAPI * _CM_Get_Device_ID)
  272. (
  273. IN DEVINST dnDevInst,
  274. OUT PTCHAR Buffer,
  275. IN ULONG BufferLen,
  276. IN ULONG ulFlags
  277. );
  278. #endif
  279. };
  280. } SETUPAPI, *PSETUPAPI;
  281. extern SETUPAPI g_setupapi;
  282. #undef SetupDiGetClassDevs
  283. #undef SetupDiDestroyDeviceInfoList
  284. #undef SetupDiGetDeviceInterfaceDetail
  285. #undef SetupDiEnumDeviceInterfaces
  286. #undef SetupDiCreateDeviceInterfaceRegKey
  287. #undef SetupDiCallClassInstaller
  288. #undef SetupDiGetDeviceRegistryProperty
  289. #undef SetupDiSetDeviceRegistryProperty
  290. #undef SetupDiGetDeviceInstanceId
  291. #undef SetupDiOpenDeviceInfo
  292. #undef SetupDiCreateDeviceInfoList
  293. #undef SetupDiOpenDevRegKey
  294. #define SetupDiGetClassDevs \
  295. g_setupapi._SetupDiGetClassDevs
  296. #define SetupDiDestroyDeviceInfoList \
  297. g_setupapi._SetupDiDestroyDeviceInfoList
  298. #define SetupDiGetDeviceInterfaceDetail \
  299. g_setupapi._SetupDiGetDeviceInterfaceDetail
  300. #define SetupDiEnumDeviceInterfaces \
  301. g_setupapi._SetupDiEnumDeviceInterfaces
  302. #define SetupDiCreateDeviceInterfaceRegKey \
  303. g_setupapi._SetupDiCreateDeviceInterfaceRegKey
  304. #define SetupDiCallClassInstaller \
  305. g_setupapi._SetupDiCallClassInstaller
  306. #define SetupDiGetDeviceRegistryProperty \
  307. g_setupapi._SetupDiGetDeviceRegistryProperty
  308. #define SetupDiSetDeviceRegistryProperty \
  309. g_setupapi._SetupDiSetDeviceRegistryProperty
  310. #define SetupDiGetDeviceInstanceId \
  311. g_setupapi._SetupDiGetDeviceInstanceId
  312. #define SetupDiOpenDeviceInfo \
  313. g_setupapi._SetupDiOpenDeviceInfo
  314. #define SetupDiCreateDeviceInfoList \
  315. g_setupapi._SetupDiCreateDeviceInfoList
  316. #define SetupDiOpenDevRegKey \
  317. g_setupapi._SetupDiOpenDevRegKey
  318. #ifdef WINNT
  319. #undef CM_Get_Child
  320. #undef CM_Get_Sibling
  321. #undef CM_Get_Parent
  322. #undef CM_Get_DevNode_Registry_Property
  323. #undef CM_Set_DevNode_Registry_Property
  324. #undef CM_Get_Device_ID
  325. #define CM_Get_Child \
  326. g_setupapi._CM_Get_Child
  327. #define CM_Get_Sibling \
  328. g_setupapi._CM_Get_Sibling
  329. #define CM_Get_Parent \
  330. g_setupapi._CM_Get_Parent
  331. #define CM_Get_DevNode_Registry_Property \
  332. g_setupapi._CM_Get_DevNode_Registry_Property
  333. #define CM_Set_DevNode_Registry_Property \
  334. g_setupapi._CM_Set_DevNode_Registry_Property
  335. #define CM_Get_Device_ID \
  336. g_setupapi._CM_Get_Device_ID
  337. #endif
  338. /*****************************************************************************
  339. *
  340. * HIDDLL
  341. *
  342. * Note that this must match the HID section in diextdll.c
  343. *
  344. *****************************************************************************/
  345. typedef union HIDDLL
  346. {
  347. MANUALIMPORT rgmi[22]; /* number of functions we import */
  348. struct
  349. {
  350. void (__stdcall *_HidD_GetHidGuid)
  351. (
  352. OUT LPGUID HidGuid
  353. );
  354. BOOLEAN (__stdcall *_HidD_GetPreparsedData)
  355. (
  356. IN HANDLE HidDeviceObject,
  357. OUT PHIDP_PREPARSED_DATA * PreparsedData
  358. );
  359. BOOLEAN (__stdcall *_HidD_FreePreparsedData)
  360. (
  361. IN PHIDP_PREPARSED_DATA PreparsedData
  362. );
  363. BOOLEAN (__stdcall *_HidD_FlushQueue)
  364. (
  365. IN HANDLE HidDeviceObject
  366. );
  367. BOOLEAN (__stdcall *_HidD_GetAttributes)
  368. (
  369. IN HANDLE HidDeviceObject,
  370. OUT PHIDD_ATTRIBUTES Attributes
  371. );
  372. BOOLEAN (__stdcall *_HidD_GetFeature)
  373. (
  374. IN HANDLE HidDeviceObject,
  375. OUT PVOID ReportBuffer,
  376. IN ULONG ReportBufferLength
  377. );
  378. BOOLEAN (__stdcall *_HidD_SetFeature)
  379. (
  380. IN HANDLE HidDeviceObject,
  381. IN PVOID ReportBuffer,
  382. IN ULONG ReportBufferLength
  383. );
  384. BOOLEAN (__stdcall *_HidD_GetProductString)
  385. (
  386. IN HANDLE HidDeviceObject,
  387. OUT PVOID Buffer,
  388. IN ULONG BufferLength
  389. );
  390. BOOLEAN (__stdcall *_HidD_GetInputReport)
  391. (
  392. IN HANDLE HidDeviceObject,
  393. OUT PVOID ReportBuffer,
  394. IN ULONG ReportBufferLength
  395. );
  396. NTSTATUS (__stdcall *_HidP_GetCaps)
  397. (
  398. IN PHIDP_PREPARSED_DATA PreparsedData,
  399. OUT PHIDP_CAPS Capabilities
  400. );
  401. NTSTATUS (__stdcall *_HidP_GetButtonCaps)
  402. (
  403. IN HIDP_REPORT_TYPE ReportType,
  404. OUT PHIDP_BUTTON_CAPS ButtonCaps,
  405. IN OUT PUSHORT ButtonCapsLength,
  406. IN PHIDP_PREPARSED_DATA PreparsedData
  407. );
  408. NTSTATUS (__stdcall *_HidP_GetValueCaps)
  409. (
  410. IN HIDP_REPORT_TYPE ReportType,
  411. OUT PHIDP_VALUE_CAPS ValueCaps,
  412. IN OUT PUSHORT ValueCapsLength,
  413. IN PHIDP_PREPARSED_DATA PreparsedData
  414. );
  415. NTSTATUS (__stdcall *_HidP_GetLinkCollectionNodes)
  416. (
  417. OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
  418. IN OUT PULONG LinkCollectionNodesLength,
  419. IN PHIDP_PREPARSED_DATA PreparsedData
  420. );
  421. ULONG (__stdcall *_HidP_MaxDataListLength)
  422. (
  423. IN HIDP_REPORT_TYPE ReportType,
  424. IN PHIDP_PREPARSED_DATA PreparsedData
  425. );
  426. NTSTATUS (__stdcall *_HidP_GetUsagesEx)
  427. (
  428. IN HIDP_REPORT_TYPE ReportType,
  429. IN USHORT LinkCollection,
  430. OUT PUSAGE_AND_PAGE ButtonList,
  431. IN OUT ULONG * UsageLength,
  432. IN PHIDP_PREPARSED_DATA PreparsedData,
  433. IN PCHAR Report,
  434. IN ULONG ReportLength
  435. );
  436. NTSTATUS (__stdcall *_HidP_GetScaledUsageValue)
  437. (
  438. IN HIDP_REPORT_TYPE ReportType,
  439. IN USAGE UsagePage,
  440. IN USHORT LinkCollection,
  441. IN USAGE Usage,
  442. OUT PLONG UsageValue,
  443. IN PHIDP_PREPARSED_DATA PreparsedData,
  444. IN PCHAR Report,
  445. IN ULONG ReportLength
  446. );
  447. NTSTATUS (__stdcall *_HidP_GetData)
  448. (
  449. IN HIDP_REPORT_TYPE ReportType,
  450. OUT PHIDP_DATA DataList,
  451. IN OUT PULONG DataLength,
  452. IN PHIDP_PREPARSED_DATA PreparsedData,
  453. IN PCHAR Report,
  454. IN ULONG ReportLength
  455. );
  456. NTSTATUS (__stdcall *_HidP_SetData)
  457. (
  458. IN HIDP_REPORT_TYPE ReportType,
  459. IN PHIDP_DATA DataList,
  460. IN OUT PULONG DataLength,
  461. IN PHIDP_PREPARSED_DATA PreparsedData,
  462. IN OUT PCHAR Report,
  463. IN ULONG ReportLength
  464. );
  465. NTSTATUS (__stdcall *_HidP_GetUsageValue)
  466. (
  467. IN HIDP_REPORT_TYPE ReportType,
  468. IN USAGE UsagePage,
  469. IN USHORT LinkCollection,
  470. IN USAGE Usage,
  471. OUT PULONG UsageValue,
  472. IN PHIDP_PREPARSED_DATA PreparsedData,
  473. IN PCHAR Report,
  474. IN ULONG ReportLength
  475. );
  476. ULONG (__stdcall *_HidP_MaxUsageListLength)
  477. (
  478. IN HIDP_REPORT_TYPE ReportType,
  479. IN USAGE UsagePage,
  480. IN PHIDP_PREPARSED_DATA PreparsedData
  481. );
  482. NTSTATUS (__stdcall *_HidP_GetSpecificButtonCaps)
  483. (
  484. IN HIDP_REPORT_TYPE ReportType,
  485. IN USAGE UsagePage, // Optional (0 => ignore)
  486. IN USHORT LinkCollection, // Optional (0 => ignore)
  487. IN USAGE Usage, // Optional (0 => ignore)
  488. OUT PHIDP_BUTTON_CAPS ButtonCaps,
  489. IN OUT PUSHORT ButtonCapsLength,
  490. IN PHIDP_PREPARSED_DATA PreparsedData
  491. );
  492. NTSTATUS (__stdcall *_HidP_TranslateUsagesToI8042ScanCodes)
  493. (
  494. IN PUSAGE ChangedUsageList, // Those usages that changed
  495. IN ULONG UsageListLength,
  496. IN HIDP_KEYBOARD_DIRECTION KeyAction,
  497. IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
  498. IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
  499. IN PVOID InsertCodesContext
  500. );
  501. };
  502. } HIDDLL, *PHIDDLL;
  503. extern HIDDLL g_hiddll;
  504. #undef HidD_GetHidGuid
  505. #undef HidD_GetPreparsedData
  506. #undef HidD_FreePreparsedData
  507. #undef HidD_FlushQueue
  508. #undef HidD_GetAttributes
  509. #undef HidD_GetFeature
  510. #undef HidD_SetFeature
  511. #undef HidD_GetProductString
  512. #undef HidD_GetInputReport
  513. #undef HidP_GetCaps
  514. #undef HidP_GetButtonCaps
  515. #undef HidP_GetValueCaps
  516. #undef HidP_GetLinkCollectionNodes
  517. #undef HidP_MaxDataListLength
  518. #undef HidP_GetUsagesEx
  519. #undef HidP_GetScaledUsageValue
  520. #undef HidP_GetData
  521. #undef HidP_SetData
  522. #undef HidP_GetUsageValue
  523. #undef HidP_MaxUsageListLength
  524. #undef HidP_GetSpecificButtonCaps
  525. #undef HidP_TranslateUsagesToI8042ScanCodes
  526. #define HidD_GetHidGuid \
  527. g_hiddll._HidD_GetHidGuid
  528. #define HidD_GetPreparsedData \
  529. g_hiddll._HidD_GetPreparsedData
  530. #define HidD_FreePreparsedData \
  531. g_hiddll._HidD_FreePreparsedData
  532. #define HidD_FlushQueue \
  533. g_hiddll._HidD_FlushQueue
  534. #define HidD_GetAttributes \
  535. g_hiddll._HidD_GetAttributes \
  536. #define HidD_GetFeature \
  537. g_hiddll._HidD_GetFeature \
  538. #define HidD_SetFeature \
  539. g_hiddll._HidD_SetFeature \
  540. #define HidD_GetProductString \
  541. g_hiddll._HidD_GetProductString \
  542. #define HidD_GetInputReport \
  543. g_hiddll._HidD_GetInputReport \
  544. #define HidP_GetCaps \
  545. g_hiddll._HidP_GetCaps
  546. #define HidP_GetButtonCaps \
  547. g_hiddll._HidP_GetButtonCaps
  548. #define HidP_GetValueCaps \
  549. g_hiddll._HidP_GetValueCaps
  550. #define HidP_GetLinkCollectionNodes \
  551. g_hiddll._HidP_GetLinkCollectionNodes
  552. #define HidP_MaxDataListLength \
  553. g_hiddll._HidP_MaxDataListLength \
  554. #define HidP_GetUsagesEx \
  555. g_hiddll._HidP_GetUsagesEx \
  556. #define HidP_GetScaledUsageValue \
  557. g_hiddll._HidP_GetScaledUsageValue \
  558. #define HidP_GetData \
  559. g_hiddll._HidP_GetData \
  560. #define HidP_SetData \
  561. g_hiddll._HidP_SetData \
  562. #define HidP_GetUsageValue \
  563. g_hiddll._HidP_GetUsageValue \
  564. #define HidP_MaxUsageListLength \
  565. g_hiddll._HidP_MaxUsageListLength \
  566. #define HidP_GetSpecificButtonCaps \
  567. g_hiddll._HidP_GetSpecificButtonCaps \
  568. #define HidP_TranslateUsagesToI8042ScanCodes \
  569. g_hiddll._HidP_TranslateUsagesToI8042ScanCodes \
  570. /*****************************************************************************
  571. *
  572. * WINMMDLL
  573. *
  574. * Note that this must match the WINMM section in diextdll.c
  575. *
  576. *****************************************************************************/
  577. typedef union WINMMDLL
  578. {
  579. MANUALIMPORT rgmi[11]; /* number of functions we import */
  580. struct
  581. {
  582. MMRESULT ( WINAPI * _joyGetDevCaps)
  583. (
  584. IN UINT uJoyID,
  585. OUT LPJOYCAPS pjc,
  586. IN UINT cbjc
  587. );
  588. MMRESULT ( WINAPI * _joyGetPosEx)
  589. (
  590. IN UINT uJoyID,
  591. OUT LPJOYINFOEX pji
  592. );
  593. MMRESULT ( WINAPI * _joyGetPos)
  594. (
  595. IN UINT uJoyID,
  596. OUT LPJOYINFO pji
  597. );
  598. UINT ( WINAPI * _joyConfigChanged)
  599. (
  600. IN DWORD dwFlags
  601. );
  602. MMRESULT ( WINAPI * _mmioClose )
  603. (
  604. IN HMMIO hmmio,
  605. IN UINT fuClose
  606. );
  607. HMMIO ( WINAPI * _mmioOpenA )
  608. (
  609. IN OUT LPSTR pszFileName,
  610. IN OUT LPMMIOINFO pmmioinfo,
  611. IN DWORD fdwOpen
  612. );
  613. MMRESULT ( WINAPI * _mmioDescend )
  614. (
  615. IN HMMIO hmmio,
  616. IN OUT LPMMCKINFO pmmcki,
  617. IN const MMCKINFO FAR* pmmckiParent,
  618. IN UINT fuDescend
  619. );
  620. MMRESULT ( WINAPI * _mmioCreateChunk )
  621. (
  622. IN HMMIO hmmio,
  623. IN LPMMCKINFO pmmcki,
  624. IN UINT fuCreate
  625. );
  626. LONG ( WINAPI * _mmioRead )
  627. (
  628. IN HMMIO hmmio,
  629. OUT HPSTR pch,
  630. IN LONG cch
  631. );
  632. LONG ( WINAPI * _mmioWrite )
  633. (
  634. IN HMMIO hmmio,
  635. IN const char _huge* pch,
  636. IN LONG cch
  637. );
  638. MMRESULT ( WINAPI * _mmioAscend )
  639. (
  640. IN HMMIO hmmio,
  641. IN LPMMCKINFO pmmcki,
  642. IN UINT fuAscend
  643. );
  644. };
  645. } WINMMDLL, *PWINMMDLL;
  646. extern WINMMDLL g_winmmdll;
  647. #undef joyGetDevCaps
  648. #undef joyGetPosEx
  649. #undef joyGetPos
  650. #undef joyConfigChanged
  651. #undef mmioClose
  652. #undef mmioOpenA
  653. #undef mmioDescend
  654. #undef mmioCreateChunk
  655. #undef mmioRead
  656. #undef mmioWrite
  657. #undef mmioAscend
  658. #define joyGetDevCaps \
  659. g_winmmdll._joyGetDevCaps
  660. #define joyGetPosEx \
  661. g_winmmdll._joyGetPosEx
  662. #define joyGetPos \
  663. g_winmmdll._joyGetPos
  664. #define joyConfigChanged \
  665. g_winmmdll._joyConfigChanged
  666. #define mmioClose \
  667. g_winmmdll._mmioClose
  668. #define mmioOpenA \
  669. g_winmmdll._mmioOpenA
  670. #define mmioDescend \
  671. g_winmmdll._mmioDescend
  672. #define mmioCreateChunk \
  673. g_winmmdll._mmioCreateChunk
  674. #define mmioRead \
  675. g_winmmdll._mmioRead
  676. #define mmioWrite \
  677. g_winmmdll._mmioWrite
  678. #define mmioAscend \
  679. g_winmmdll._mmioAscend
  680. /*****************************************************************************
  681. *
  682. * USER32
  683. *
  684. * Note that this must match the USER32 section in diextdll.c
  685. *
  686. *****************************************************************************/
  687. #ifdef USE_WM_INPUT
  688. typedef union USER32
  689. {
  690. MANUALIMPORT rgmi[2]; /* number of functions we import */
  691. struct
  692. {
  693. BOOL ( WINAPI * _RegisterRawInputDevices)
  694. (
  695. PCRAWINPUTDEVICE pRawInputDevices,
  696. UINT uiNumDevices,
  697. UINT cbSize
  698. );
  699. UINT ( WINAPI * _GetRawInputData)
  700. (
  701. HRAWINPUT hRawInput,
  702. UINT uiCommand,
  703. LPVOID pData,
  704. PUINT pcbSize,
  705. UINT cbSizeHeader
  706. );
  707. };
  708. } USER32, *PUSER32;
  709. extern USER32 g_user32;
  710. #undef RegisterRawInputDevices
  711. #undef GetRawInputData
  712. #define RegisterRawInputDevices \
  713. g_user32._RegisterRawInputDevices
  714. #define GetRawInputData \
  715. g_user32._GetRawInputData
  716. #endif
  717. /*****************************************************************************
  718. *
  719. * Dummy functions
  720. *
  721. * These functions are used only when some DLLs can't be loaded.
  722. *
  723. *****************************************************************************/
  724. //cfgmgr32.dll
  725. CONFIGRET WINAPI DIDummy_CM_Get_Child
  726. (
  727. OUT PDEVINST pdnDevInst,
  728. IN DEVINST dnDevInst,
  729. IN ULONG ulFlags
  730. );
  731. CONFIGRET WINAPI DIDummy_CM_Get_Sibling
  732. (
  733. OUT PDEVINST pdnDevInst,
  734. IN DEVINST DevInst,
  735. IN ULONG ulFlags
  736. );
  737. CONFIGRET WINAPI DIDummy_CM_Get_Parent
  738. (
  739. OUT PDEVINST pdnDevInst,
  740. IN DEVINST dnDevInst,
  741. IN ULONG ulFlags
  742. );
  743. CONFIGRET WINAPI DIDummy_CM_Get_DevNode_Registry_Property
  744. (
  745. IN DEVINST dnDevInst,
  746. IN ULONG ulProperty,
  747. OUT PULONG pulRegDataType, OPTIONAL
  748. OUT PVOID Buffer, OPTIONAL
  749. IN OUT PULONG pulLength,
  750. IN ULONG ulFlags
  751. );
  752. CONFIGRET WINAPI DIDummy_CM_Set_DevNode_Registry_Property
  753. (
  754. IN DEVINST dnDevInst,
  755. IN ULONG ulProperty,
  756. IN PVOID Buffer, OPTIONAL
  757. IN ULONG ulLength,
  758. IN ULONG ulFlags
  759. );
  760. CONFIGRET WINAPI DIDummy_CM_Get_Device_ID
  761. (
  762. IN DEVINST dnDevInst,
  763. OUT PTCHAR Buffer,
  764. IN ULONG BufferLen,
  765. IN ULONG ulFlags
  766. );
  767. //Setupapi.dll
  768. HDEVINFO WINAPI DIDummy_SetupDiGetClassDevs
  769. (
  770. IN LPGUID ClassGuid, OPTIONAL
  771. IN LPCTSTR Enumerator, OPTIONAL
  772. IN HWND hwndParent, OPTIONAL
  773. IN DWORD Flags
  774. );
  775. BOOL WINAPI DIDummy_SetupDiDestroyDeviceInfoList
  776. (
  777. IN HDEVINFO DeviceInfoSet
  778. );
  779. BOOL WINAPI DIDummy_SetupDiGetDeviceInterfaceDetail
  780. (
  781. IN HDEVINFO DeviceInfoSet,
  782. IN PSP_DEVICE_INTERFACE_DATA pdid,
  783. OUT PSP_DEVICE_INTERFACE_DETAIL_DATA pdidd, OPTIONAL
  784. IN DWORD cbDidd,
  785. OUT PDWORD RequiredSize, OPTIONAL
  786. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  787. );
  788. BOOL WINAPI DIDummy_SetupDiEnumDeviceInterfaces
  789. (
  790. IN HDEVINFO DeviceInfoSet,
  791. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  792. IN LPGUID InterfaceClassGuid,
  793. IN DWORD MemberIndex,
  794. OUT PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
  795. );
  796. HKEY WINAPI DIDummy_SetupDiCreateDeviceInterfaceRegKey
  797. (
  798. IN HDEVINFO hdev,
  799. IN PSP_DEVICE_INTERFACE_DATA pdid,
  800. IN DWORD Reserved,
  801. IN REGSAM samDesired,
  802. IN HINF InfHandle, OPTIONAL
  803. IN PCSTR InfSectionName OPTIONAL
  804. );
  805. BOOL WINAPI DIDummy_SetupDiCallClassInstaller
  806. (
  807. IN DI_FUNCTION InstallFunction,
  808. IN HDEVINFO DeviceInfoSet,
  809. IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  810. );
  811. BOOL WINAPI DIDummy_SetupDiGetDeviceRegistryProperty
  812. (
  813. IN HDEVINFO DeviceInfoSet,
  814. IN PSP_DEVINFO_DATA DeviceInfoData,
  815. IN DWORD Property,
  816. OUT PDWORD PropertyRegDataType, OPTIONAL
  817. OUT PBYTE PropertyBuffer,
  818. IN DWORD PropertyBufferSize,
  819. OUT PDWORD RequiredSize OPTIONAL
  820. );
  821. BOOL WINAPI DIDummy_SetupDiSetDeviceRegistryProperty
  822. (
  823. IN HDEVINFO DeviceInfoSet,
  824. IN OUT PSP_DEVINFO_DATA DeviceInfoData,
  825. IN DWORD Property,
  826. IN CONST BYTE* PropertyBuffer,
  827. IN DWORD PropertyBufferSize
  828. );
  829. BOOL WINAPI DIDummy_SetupDiGetDeviceInstanceId
  830. (
  831. IN HDEVINFO DeviceInfoSet,
  832. IN PSP_DEVINFO_DATA DeviceInfoData,
  833. OUT PTSTR DeviceInstanceId,
  834. IN DWORD DeviceInstanceIdSize,
  835. OUT PDWORD RequiredSize OPTIONAL
  836. );
  837. BOOL WINAPI DIDummy_SetupDiOpenDeviceInfo
  838. (
  839. IN HDEVINFO DeviceInfoSet,
  840. IN LPCTSTR DeviceInstanceId,
  841. IN HWND hwndParent, OPTIONAL
  842. IN DWORD OpenFlags,
  843. OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
  844. );
  845. HDEVINFO WINAPI DIDummy_SetupDiCreateDeviceInfoList
  846. (
  847. IN LPGUID ClassGuid, OPTIONAL
  848. IN HWND hwndParent OPTIONAL
  849. );
  850. HKEY WINAPI DIDummy_SetupDiOpenDevRegKey
  851. (
  852. IN HDEVINFO DeviceInfoSet,
  853. IN PSP_DEVINFO_DATA DeviceInfoData,
  854. IN DWORD Scope,
  855. IN DWORD HwProfile,
  856. IN DWORD KeyType,
  857. IN REGSAM samDesired
  858. );
  859. // hid.dll
  860. void __stdcall DIDummy_HidD_GetHidGuid
  861. (
  862. OUT LPGUID HidGuid
  863. );
  864. BOOLEAN __stdcall DIDummy_HidD_GetPreparsedData
  865. (
  866. IN HANDLE HidDeviceObject,
  867. OUT PHIDP_PREPARSED_DATA * PreparsedData
  868. );
  869. BOOLEAN __stdcall DIDummy_HidD_FreePreparsedData
  870. (
  871. IN PHIDP_PREPARSED_DATA PreparsedData
  872. );
  873. BOOLEAN __stdcall DIDummy_HidD_FlushQueue
  874. (
  875. IN HANDLE HidDeviceObject
  876. );
  877. BOOLEAN __stdcall DIDummy_HidD_GetAttributes
  878. (
  879. IN HANDLE HidDeviceObject,
  880. OUT PHIDD_ATTRIBUTES Attributes
  881. );
  882. BOOLEAN __stdcall DIDummy_HidD_GetFeature
  883. (
  884. IN HANDLE HidDeviceObject,
  885. OUT PVOID ReportBuffer,
  886. IN ULONG ReportBufferLength
  887. );
  888. BOOLEAN __stdcall DIDummy_HidD_SetFeature
  889. (
  890. IN HANDLE HidDeviceObject,
  891. IN PVOID ReportBuffer,
  892. IN ULONG ReportBufferLength
  893. );
  894. BOOLEAN __stdcall DIDummy_HidD_GetProductString
  895. (
  896. IN HANDLE HidDeviceObject,
  897. OUT PVOID Buffer,
  898. IN ULONG BufferLength
  899. );
  900. BOOLEAN __stdcall DIDummy_HidD_GetInputReport
  901. (
  902. IN HANDLE HidDeviceObject,
  903. OUT PVOID ReportBuffer,
  904. IN ULONG ReportBufferLength
  905. );
  906. NTSTATUS __stdcall DIDummy_HidP_GetCaps
  907. (
  908. IN PHIDP_PREPARSED_DATA PreparsedData,
  909. OUT PHIDP_CAPS Capabilities
  910. );
  911. NTSTATUS __stdcall DIDummy_HidP_GetButtonCaps
  912. (
  913. IN HIDP_REPORT_TYPE ReportType,
  914. OUT PHIDP_BUTTON_CAPS ButtonCaps,
  915. IN OUT PUSHORT ButtonCapsLength,
  916. IN PHIDP_PREPARSED_DATA PreparsedData
  917. );
  918. NTSTATUS __stdcall DIDummy_HidP_GetValueCaps
  919. (
  920. IN HIDP_REPORT_TYPE ReportType,
  921. OUT PHIDP_VALUE_CAPS ValueCaps,
  922. IN OUT PUSHORT ValueCapsLength,
  923. IN PHIDP_PREPARSED_DATA PreparsedData
  924. );
  925. NTSTATUS __stdcall DIDummy_HidP_GetLinkCollectionNodes
  926. (
  927. OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
  928. IN OUT PULONG LinkCollectionNodesLength,
  929. IN PHIDP_PREPARSED_DATA PreparsedData
  930. );
  931. ULONG __stdcall DIDummy_HidP_MaxDataListLength
  932. (
  933. IN HIDP_REPORT_TYPE ReportType,
  934. IN PHIDP_PREPARSED_DATA PreparsedData
  935. );
  936. NTSTATUS __stdcall DIDummy_HidP_GetUsagesEx //unused
  937. (
  938. IN HIDP_REPORT_TYPE ReportType,
  939. IN USHORT LinkCollection,
  940. OUT PUSAGE_AND_PAGE ButtonList,
  941. IN OUT ULONG * UsageLength,
  942. IN PHIDP_PREPARSED_DATA PreparsedData,
  943. IN PCHAR Report,
  944. IN ULONG ReportLength
  945. );
  946. NTSTATUS __stdcall DIDummy_HidP_GetScaledUsageValue //unused
  947. (
  948. IN HIDP_REPORT_TYPE ReportType,
  949. IN USAGE UsagePage,
  950. IN USHORT LinkCollection,
  951. IN USAGE Usage,
  952. OUT PLONG UsageValue,
  953. IN PHIDP_PREPARSED_DATA PreparsedData,
  954. IN PCHAR Report,
  955. IN ULONG ReportLength
  956. );
  957. NTSTATUS __stdcall DIDummy_HidP_GetData
  958. (
  959. IN HIDP_REPORT_TYPE ReportType,
  960. OUT PHIDP_DATA DataList,
  961. IN OUT PULONG DataLength,
  962. IN PHIDP_PREPARSED_DATA PreparsedData,
  963. IN PCHAR Report,
  964. IN ULONG ReportLength
  965. );
  966. NTSTATUS __stdcall DIDummy_HidP_SetData
  967. (
  968. IN HIDP_REPORT_TYPE ReportType,
  969. IN PHIDP_DATA DataList,
  970. IN OUT PULONG DataLength,
  971. IN PHIDP_PREPARSED_DATA PreparsedData,
  972. IN OUT PCHAR Report,
  973. IN ULONG ReportLength
  974. );
  975. NTSTATUS __stdcall DIDummy_HidP_GetUsageValue
  976. (
  977. IN HIDP_REPORT_TYPE ReportType,
  978. IN USAGE UsagePage,
  979. IN USHORT LinkCollection,
  980. IN USAGE Usage,
  981. OUT PULONG UsageValue,
  982. IN PHIDP_PREPARSED_DATA PreparsedData,
  983. IN PCHAR Report,
  984. IN ULONG ReportLength
  985. );
  986. ULONG __stdcall DIDummy_HidP_MaxUsageListLength
  987. (
  988. IN HIDP_REPORT_TYPE ReportType,
  989. IN USAGE UsagePage,
  990. IN PHIDP_PREPARSED_DATA PreparsedData
  991. );
  992. NTSTATUS __stdcall DIDummy_HidP_GetSpecificButtonCaps
  993. (
  994. IN HIDP_REPORT_TYPE ReportType,
  995. IN USAGE UsagePage,
  996. IN USHORT LinkCollection,
  997. IN USAGE Usage,
  998. OUT PHIDP_BUTTON_CAPS ButtonCaps,
  999. IN OUT PUSHORT ButtonCapsLength,
  1000. IN PHIDP_PREPARSED_DATA PreparsedData
  1001. );
  1002. NTSTATUS __stdcall DIDummy_HidP_TranslateUsagesToI8042ScanCodes
  1003. (
  1004. IN PUSAGE ChangedUsageList, // Those usages that changed
  1005. IN ULONG UsageListLength,
  1006. IN HIDP_KEYBOARD_DIRECTION KeyAction,
  1007. IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
  1008. IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
  1009. IN PVOID InsertCodesContext
  1010. );
  1011. // winmm.dll
  1012. MMRESULT WINAPI DIDummy_joyGetDevCaps
  1013. (
  1014. IN UINT uJoyID,
  1015. OUT LPJOYCAPS pjc,
  1016. IN UINT cbjc
  1017. );
  1018. MMRESULT WINAPI DIDummy_joyGetPosEx
  1019. (
  1020. IN UINT uJoyID,
  1021. OUT LPJOYINFOEX pji
  1022. );
  1023. MMRESULT WINAPI DIDummy_joyGetPos
  1024. (
  1025. IN UINT uJoyID,
  1026. OUT LPJOYINFO pji
  1027. );
  1028. UINT WINAPI DIDummy_joyConfigChanged
  1029. (
  1030. IN DWORD dwFlags
  1031. );
  1032. MMRESULT WINAPI DIDummy_mmioClose
  1033. (
  1034. IN HMMIO hmmio,
  1035. IN UINT fuClose
  1036. );
  1037. HMMIO WINAPI DIDummy_mmioOpenA
  1038. (
  1039. IN OUT LPSTR pszFileName,
  1040. IN OUT LPMMIOINFO pmmioinfo,
  1041. IN DWORD fdwOpen
  1042. );
  1043. MMRESULT WINAPI DIDummy_mmioDescend
  1044. (
  1045. IN HMMIO hmmio,
  1046. IN OUT LPMMCKINFO pmmcki,
  1047. IN const MMCKINFO FAR* pmmckiParent,
  1048. IN UINT fuDescend
  1049. );
  1050. MMRESULT WINAPI DIDummy_mmioCreateChunk
  1051. (
  1052. IN HMMIO hmmio,
  1053. IN LPMMCKINFO pmmcki,
  1054. IN UINT fuCreate
  1055. );
  1056. LONG WINAPI DIDummy_mmioRead
  1057. (
  1058. IN HMMIO hmmio,
  1059. OUT HPSTR pch,
  1060. IN LONG cch
  1061. );
  1062. LONG WINAPI DIDummy_mmioWrite
  1063. (
  1064. IN HMMIO hmmio,
  1065. IN const char _huge* pch,
  1066. IN LONG cch
  1067. );
  1068. MMRESULT WINAPI DIDummy_mmioAscend
  1069. (
  1070. IN HMMIO hmmio,
  1071. IN LPMMCKINFO pmmcki,
  1072. IN UINT fuAscend
  1073. );
  1074. // user32.dll
  1075. #ifdef USE_WM_INPUT
  1076. BOOL WINAPI DIDummy_RegisterRawInputDevices
  1077. (
  1078. PCRAWINPUTDEVICE pRawInputDevices,
  1079. UINT uiNumDevices,
  1080. UINT cbSize
  1081. );
  1082. UINT WINAPI DIDummy_GetRawInputData
  1083. (
  1084. HRAWINPUT hRawInput,
  1085. UINT uiCommand,
  1086. LPVOID pData,
  1087. PUINT pcbSize,
  1088. UINT cbSizeHeader
  1089. );
  1090. #endif // #ifdef USE_WM_INPUT
  1091. #endif /* STATIC_DLLUSAGE */
  1092. #endif /* _DIEXTDLL_H */