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.

207 lines
8.6 KiB

  1. /******************************************************************************
  2. *
  3. * dimap.h
  4. *
  5. * Copyright (c) 1999, 2000 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * Abstract:
  8. *
  9. * Contents:
  10. *
  11. *****************************************************************************/
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #ifndef _DIMAP_H
  16. #define _DIMAP_H
  17. #include "dinput.h"
  18. //temporary error codes
  19. //If codes are changed or more are added,
  20. //change exception handling dump as well.
  21. #define E_SYNTAX_ERROR \
  22. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000600L)
  23. #define E_DEFINITION_NOT_FOUND \
  24. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000601L)
  25. #define E_LINE_TO_LONG \
  26. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000602L)
  27. #define E_ACTION_NOT_DEFINED \
  28. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000603L)
  29. #define E_DEVICE_NOT_DEFINED \
  30. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000604L)
  31. #define E_VENDORID_NOT_FOUND \
  32. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000605L)
  33. #define E_PRODUCTID_NOT_FOUND \
  34. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000606L)
  35. #define E_USAGE_NOT_FOUND \
  36. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000607L)
  37. #define E_USAGEPAGE_NOT_FOUND \
  38. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000608L)
  39. #define E_DEVICE_NOT_FOUND \
  40. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000609L)
  41. #define E_BAD_VERSION \
  42. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0000060aL)
  43. #define E_DEVICE_MISSING_CONTROL \
  44. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0000060bL)
  45. #define E_DEV_OBJ_NOT_FOUND \
  46. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0000060cL)
  47. #define E_CTRL_W_OFFSET_NOTFOUND \
  48. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0000060dL)
  49. #define E_FILENAME_TO_LONG \
  50. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0000060eL)
  51. #define E_WRONG_ALIGN_DATA \
  52. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0000060fL)
  53. #define E_CORRUPT_IMAGE_DATA \
  54. MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x00000610L)
  55. #define S_NOMAP ((HRESULT)0x00000002L)
  56. #undef INTERFACE
  57. #define INTERFACE IDirectInputMapperW
  58. DECLARE_INTERFACE_(IDirectInputMapperW, IUnknown)
  59. {
  60. /*** IUnknown methods ***/
  61. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  62. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  63. STDMETHOD_(ULONG,Release)(THIS) PURE;
  64. /*** IDirectInputMapperW methods ***/
  65. // STDMETHOD(Unacquire)(THIS) PURE;
  66. // STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  67. STDMETHOD(Initialize)(THIS_ LPCGUID,LPCWSTR,DWORD) PURE;
  68. STDMETHOD(GetActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,LPFILETIME,DWORD) PURE;
  69. STDMETHOD(SaveActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE;
  70. STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW) PURE;
  71. };
  72. typedef struct IDirectInputMapperW *LPDIRECTINPUTMAPPERW;
  73. #undef INTERFACE
  74. #define INTERFACE IDirectInputMapperA
  75. DECLARE_INTERFACE_(IDirectInputMapperA, IUnknown)
  76. {
  77. /*** IUnknown methods ***/
  78. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  79. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  80. STDMETHOD_(ULONG,Release)(THIS) PURE;
  81. /*** IDirectInputMapperA methods ***/
  82. // STDMETHOD(Unacquire)(THIS) PURE;
  83. // STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE;
  84. STDMETHOD(Initialize)(THIS_ LPCGUID,LPCSTR,DWORD) PURE;
  85. STDMETHOD(GetActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,LPFILETIME,DWORD) PURE;
  86. STDMETHOD(SaveActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE;
  87. STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA) PURE;
  88. };
  89. typedef struct IDirectInputMapperA *LPDIRECTINPUTMAPPERA;
  90. #undef INTERFACE
  91. #define INTERFACE IDirectInputMapperVendorW
  92. DECLARE_INTERFACE_(IDirectInputMapperVendorW, IUnknown)
  93. {
  94. /*** IUnknown methods ***/
  95. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  96. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  97. STDMETHOD_(ULONG,Release)(THIS) PURE;
  98. /*** IDirectInputMapperVendorW methods ***/
  99. STDMETHOD(Initialize)(THIS_ LPCGUID,LPCWSTR,DWORD) PURE;
  100. STDMETHOD(WriteVendorFile)(THIS_ LPDIACTIONFORMATW,LPDIDEVICEIMAGEINFOHEADERW,DWORD) PURE;
  101. };
  102. typedef struct IDirectInputMapperVendorW *LPDIRECTINPUTMAPPERVENDORW;
  103. #undef INTERFACE
  104. #define INTERFACE IDirectInputMapperVendorA
  105. DECLARE_INTERFACE_(IDirectInputMapperVendorA, IUnknown)
  106. {
  107. /*** IUnknown methods ***/
  108. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  109. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  110. STDMETHOD_(ULONG,Release)(THIS) PURE;
  111. /*** IDirectInputMapperVendorA methods ***/
  112. STDMETHOD(Initialize)(THIS_ LPCGUID,LPCSTR,DWORD) PURE;
  113. STDMETHOD(WriteVendorFile)(THIS_ LPDIACTIONFORMATA,LPDIDEVICEIMAGEINFOHEADERA,DWORD) PURE;
  114. };
  115. typedef struct IDirectInputMapperVendorA *LPDIRECTINPUTMAPPERVENDORA;
  116. #ifdef UNICODE
  117. #define IID_IDirectInputMapI IID_IDirectInputMapIW
  118. #define IDirectInputMapper IDirectInputMapperW
  119. #define IDirectInputMapperVtbl IDirectInputMapperWVtbl
  120. #define IID_IDirectInputMapperVendor IID_IDirectInputMapperVendorW
  121. #define IDirectInputMapperVendor IDirectInputMapperVendorW
  122. #define IDirectInputMapperVendorVtbl IDirectInputMapperVendorWVtbl
  123. #else
  124. #define IID_IDirectInputMapI IID_IDirectInputMapIA
  125. #define IDirectInputMapper IDirectInputMapperA
  126. #define IDirectInputMapperVtbl IDirectInputMapperAVtbl
  127. #define IID_IDirectInputMapperVendor IID_IDirectInputMapperVendorA
  128. #define IDirectInputMapperVendor IDirectInputMapperVendorA
  129. #define IDirectInputMapperVendorVtbl IDirectInputMapperVendorAVtbl
  130. #endif
  131. typedef struct IDirectInputMapper *LPDIRECTINPUTMAPPER;
  132. typedef struct IDirectInputMapperVendor *LPDIRECTINPUTMAPPERVENDOR;
  133. #if !defined(__cplusplus) || defined(CINTERFACE)
  134. #define IDirectInputMapper_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  135. #define IDirectInputMapper_AddRef(p) (p)->lpVtbl->AddRef(p)
  136. #define IDirectInputMapper_Release(p) (p)->lpVtbl->Release(p)
  137. //#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p)
  138. //#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b)
  139. #define IDirectInputMapper_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  140. #define IDirectInputMapper_GetActionMap(p,a,b,c,d) (p)->lpVtbl->GetActionMap(p,a,b,c,d)
  141. #define IDirectInputMapper_SaveActionMap(p,a,b,c) (p)->lpVtbl->SaveActionMap(p,a,b,c)
  142. #define IDirectInputMapper_GetImageInfo(p,a) (p)->lpVtbl->GetImageInfo(p,a)
  143. #define IDirectInputMapperVendor_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  144. #define IDirectInputMapperVendor_AddRef(p) (p)->lpVtbl->AddRef(p)
  145. #define IDirectInputMapperVendor_Release(p) (p)->lpVtbl->Release(p)
  146. #define IDirectInputMapperVendor_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
  147. #define IDirectInputMapperVendor_WriteVendorFile(p,a,b,c) (p)->lpVtbl->WriteVendorFile(p,a,b,c)
  148. #else
  149. #define IDirectInputMapper_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  150. #define IDirectInputMapper_AddRef(p) (p)->AddRef()
  151. #define IDirectInputMapper_Release(p) (p)->Release()
  152. //#define IDirectInputDevice_Unacquire(p) (p)->Unacquire()
  153. //#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b)
  154. #define IDirectInputMapper_Initialize(p,a,b,c) (p)->Initialize(p,a,b,c)
  155. #define IDirectInputMapper_GetActionMap(p,a,b,c,d) (p)->GetActionMap(p,a,b,c,d)
  156. #define IDirectInputMapper_SaveActionMap(p,a,b,c) (p)->SaveActionMap(p,a,b,c)
  157. #define IDirectInputMapper_GetImageInfo(p,a) (p)->GetImageInfo(p,a)
  158. #define IDirectInputMapperVendor_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
  159. #define IDirectInputMapperVendor_AddRef(p) (p)->AddRef(p)
  160. #define IDirectInputMapperVendor_Release(p) (p)->Release(p)
  161. #define IDirectInputMapperVendor_Initialize(p,a,b,c) (p)->Initialize(p,a,b,c)
  162. #define IDirectInputMapperVendor_WriteVendorFile(p,a,b,c) (p)->WriteVendorFile(p,a,b,c)
  163. #endif
  164. //{E364F0AE-60F7-4550-ABF1-BABBE085D68E}
  165. DEFINE_GUID(IID_IDirectInputMapIA,0xe364f0ae,0x60f7,0x4550,0xab,0xf1,0xba,0xbb,0xe0,0x85,0xd6,0x8e);
  166. //{01E8A5B8-7A8E-4565-9FF0-36FCD8E33B79}
  167. DEFINE_GUID(IID_IDirectInputMapIW,0x01e8a5b8,0x7a8e,0x4565,0x9f,0xf0,0x36,0xfc,0xd8,0xe3,0x3b,0x79);
  168. //{EE3DBC5D-9EFE-4c09-B044-7D9BBB32FC4E}
  169. DEFINE_GUID(IID_IDirectInputMapClsFact,0xee3dbc5d,0x9efe,0x4c09,0xb0,0x44,0x7d,0x9b,0xbb,0x32,0xfc,0x4e);
  170. // {44C5D19C-49F3-4fba-92A7-00E3A69CD595}
  171. DEFINE_GUID(IID_IDirectInputMapVendorIA,0x44c5d19c,0x49f3,0x4fba,0x92,0xa7,0x00,0xe3,0xa6,0x9c,0xd5,0x95);
  172. // {9FB90FFB-F9A2-4e9b-949E-1617F08EB549}
  173. DEFINE_GUID(IID_IDirectInputMapVendorIW,0x9fb90ffb,0xf9a2,0x4e9b,0x94,0x9e,0x16,0x17,0xf0,0x8e,0xb5,0x49);
  174. #endif
  175. #ifdef __cplusplus
  176. } /* ... extern "C" */
  177. #endif