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.

327 lines
8.7 KiB

  1. /****************************************************************************
  2. *
  3. * File : PROFILE.H
  4. *
  5. * Description : GDP Profile definition file.
  6. *
  7. * Author : Jeffrey A. Davis. et. al.
  8. *
  9. * Creation Date : You name it.
  10. *
  11. * (c) 1986-1997 Microsoft Corporation. All rights reserved.
  12. *
  13. ****************************************************************************/
  14. #ifndef _PROFILE_H
  15. #define _PROFILE_H
  16. #pragma pack(push, default_alignment)
  17. #pragma pack(1)
  18. #ifndef DWORD
  19. #define DWORD unsigned long
  20. #endif
  21. #ifndef WORD
  22. #define WORD unsigned short
  23. #endif
  24. #ifndef UINT
  25. #define UINT unsigned int
  26. #endif
  27. #ifndef MAX_PATH
  28. #define MAX_PATH (260)
  29. #endif
  30. #define ATLAS_DATAFORMAT_MAJ_VERSION 148
  31. #define ATLAS_DATAFORMAT_MIN_VERSION 4
  32. #define DATAFORMAT_MAJ_VERSION 3
  33. #define DATAFORMAT_MIN_VERSION 0
  34. #define DATAFORMAT_SIGNATURE ("SideWinder")
  35. #define DATAFORMAT_SIGNATURE_LENGTH 10
  36. #define GDP_REGSTR "SOFTWARE\\Microsoft\\Gaming Input Devices\\Game Device Profiler"
  37. #define PROPPAGE_REGSTR "SOFTWARE\\Microsoft\\Gaming Input Devices\\Game Device Profiler\\Devices\\"
  38. #define PROFILES_REGSTR "SOFTWARE\\Microsoft\\Gaming Input Devices\\Game Device Profiler\\Profiles"
  39. #define DEVICES_REGSTR PROPPAGE_REGSTR
  40. // Device IDs
  41. #define GDP_DEVNUM_JOLT 1
  42. #define GDP_DEVNUM_FLASH 2
  43. #define GDP_DEVNUM_JUNO 3
  44. #define GDP_DEVNUM_MIDAS 4
  45. #define GDP_DEVNUM_SHAZAM 5
  46. #define GDP_DEVNUM_CLEO 6
  47. // GCKERNEL.VXD IOCTLs
  48. #define IOCTL_SET_PROFILE_ACTIVE 1
  49. #define IOCTL_SET_PROFILE_INACTIVE 2
  50. #define IOCTL_SUSPEND_PROFILE 3
  51. #define IOCTL_RESUME_PROFILE 4
  52. #define IOCTL_GETRAWPACKET 10 // debug only test hook
  53. #define IOCTL_SET_SENSE_CURVES 11 // debug only test hook
  54. // OLD GDP 1.0 devive id definitions
  55. #define SWGAMEPAD_PROFILER_BASE_ID 1
  56. #define SW3DPRO_PROFILER_BASE_ID 5
  57. typedef enum {NO_DEVICE=-1, GAMEPAD=0, JOYSTICK, MOUSE, KEYBOARD} DEVICETYPE;
  58. #define MAX_PROPERTY_PAGES 04
  59. #define MAX_PROFILE_NAME MAX_PATH
  60. #define MAX_DEVICE_NAME 64
  61. #define MAX_MACRO_NAME 64
  62. #define MAX_MACRO_EVENTS 32
  63. #define MAX_BUTTON_MACROS 20
  64. #define MAX_POV_MACROS 8
  65. #define MAX_DPAD_MACROS 8
  66. #define MAX_MACROS (MAX_BUTTON_MACROS + MAX_POV_MACROS + MAX_DPAD_MACROS)
  67. #define MAX_SCANCODES 03
  68. #define MAX_ATLAS_MACROS 20
  69. // Atlas SETTINGS Individual Flags
  70. #define ATLAS_SETTINGS_EMULATE_CHPRO 0x01
  71. #define ATLAS_SETTINGS_EMULATE_THRUSTMASTER 0x02
  72. #define ATLAS_SETTINGS_SENSE_HIGH 0x04
  73. #define ATLAS_SETTINGS_SENSE_MEDIUM 0x08
  74. #define ATLAS_SETTINGS_SENSE_LOW 0x10
  75. #define ATLAS_SETTINGS_AXISSWAP_TWIST 0x20
  76. #define ATLAS_SETTINGS_AXISSWAP_LEFTRIGHT 0x40
  77. // SETTINGS Group Flags
  78. #define ATLAS_SETTINGS_EMULATE_GROUP (ATLAS_SETTINGS_EMULATE_CHPRO|ATLAS_SETTINGS_EMULATE_THRUSTMASTER)
  79. #define ATLAS_SETTINGS_SENSE_GROUP (ATLAS_SETTINGS_SENSE_HIGH|ATLAS_SETTINGS_SENSE_MEDIUM|ATLAS_SETTINGS_SENSE_LOW)
  80. #define ATLAS_SETTINGS_AXISSWAP_GROUP (ATLAS_SETTINGS_AXISSWAP_TWIST|ATLAS_SETTINGS_AXISSWAP_LEFTRIGHT)
  81. // Xena SETTINGS flags
  82. #define SETTINGS_EMULATION_GROUP 0x00000003
  83. #define SETTINGS_EMULATION_CHPRO 0x00000001
  84. #define SETTINGS_EMULATION_THRUSTMASTER 0x00000002
  85. #define SETTINGS_AXIS_SWAP_GROUP 0x0000000C
  86. #define SETTINGS_AXIS_SWAP_TWIST 0x00000004
  87. #define SETTINGS_AXIS_SWAP_LEFT_RIGHT 0x00000008
  88. #define SETTINGS_PEDAL_GROUP 0x00000030
  89. #define SETTINGS_PEDAL_COMBINED 0x00000010
  90. #define SETTINGS_PEDAL_SEPARATE 0x00000020
  91. #define SETTINGS_X_DEAD_ZONE 0x00000040
  92. #define SETTINGS_X_RANGE_OF_MOTION 0x00000080
  93. #define SETTINGS_Y_DEAD_ZONE 0x00000100
  94. #define SETTINGS_Y_RANGE_OF_MOTION 0x00000200
  95. #define SETTINGS_Z_DEAD_ZONE 0x00000400
  96. #define SETTINGS_Z_RANGE_OF_MOTION 0x00000800
  97. #define SETTINGS_R_DEAD_ZONE 0x00001000
  98. #define SETTINGS_R_RANGE_OF_MOTION 0x00002000
  99. #define SETTINGS_U_DEAD_ZONE 0x00004000
  100. #define SETTINGS_U_RANGE_OF_MOTION 0x00008000
  101. #define SETTINGS_V_DEAD_ZONE 0x00010000
  102. #define SETTINGS_V_RANGE_OF_MOTION 0x00020000
  103. // MACRO types
  104. #define BUTTON_MACRO 0
  105. #define POV_MACRO 1
  106. #define DPAD_MACRO 2
  107. // MACROEVENT Flags
  108. #define MACROFLAG_KEYSONLY 0x00000001
  109. #define MACROFLAG_HASDPADDATA 0x00000002
  110. // PROFILE FLAGS
  111. #define PROFILEFLAG_HAS_SETTINGS 0x00000001
  112. #define PROFILEFLAG_HAS_POVMACROS 0x00000002
  113. #define PROFILEFLAG_HAS_DPADMACROS 0x00000004
  114. typedef struct tagPROFENTRY
  115. {
  116. char szName[MAX_PROFILE_NAME]; // full path name.
  117. GUID DevCLSID; // device clsid.
  118. int iActive; // Bit field Active state
  119. // where: LSB = Device inst. 1
  120. // MSB = Device inst. 32
  121. }PROFENTRY;
  122. typedef struct tagATLASPROFENTRY
  123. {
  124. char szName[MAX_PROFILE_NAME]; // full path name.
  125. int iDevNumber; // device number (GDP_DEVNUM_XXXX)
  126. int iActive; // Bit field Active state
  127. // where: LSB = Device inst. 1
  128. // MSB = Device inst. 32
  129. }ATLASPROFENTRY;
  130. typedef struct tagSETTING
  131. {
  132. DWORD dwSettingsFlag;
  133. DWORD dwXDeadZone; // 0 to 1023
  134. DWORD dwXRangeOfMotion; // 0 to 1023
  135. DWORD dwYDeadZone; // 0 to 1023
  136. DWORD dwYRangeOfMotion; // 0 to 1023
  137. DWORD dwZDeadZone; // 0 to 1023
  138. DWORD dwZRangeOfMotion; // 0 to 1023
  139. DWORD dwRDeadZone; // 0 to 1023
  140. DWORD dwRRangeOfMotion; // 0 to 1023
  141. DWORD dwUDeadZone; // 0 to 1023
  142. DWORD dwURangeOfMotion; // 0 to 1023
  143. DWORD dwVDeadZone; // 0 to 1023
  144. DWORD dwVRangeOfMotion; // 0 to 1023
  145. } SETTING, *PSETTING;
  146. typedef struct tagATLAS_SETTING
  147. {
  148. DWORD dwSettingsFlag;
  149. } ATLAS_SETTING, *PATLAS_SETTING;
  150. typedef struct tagDEVICE_DATA
  151. {
  152. WORD wX;
  153. WORD wY;
  154. WORD wButtons;
  155. WORD wPOV;
  156. } DEVICE_DATA,*PDEVICE_DATA;
  157. typedef struct tagMACROEVENT
  158. {
  159. DWORD dwDuration;
  160. char nKeyCodes;
  161. WORD scanCode[MAX_SCANCODES];
  162. DEVICE_DATA deviceData;
  163. } MACROEVENT, *PMACROEVENT;
  164. typedef struct tagATLAS_DEVICE_DATA
  165. {
  166. WORD wX;
  167. WORD wY;
  168. WORD wButtons;
  169. } ATLAS_DEVICE_DATA,*PATLAS_DEVICE_DATA;
  170. typedef struct tagATLAS_MACROEVENT
  171. {
  172. DWORD dwDuration;
  173. char nKeyCodes;
  174. WORD scanCode[MAX_SCANCODES];
  175. ATLAS_DEVICE_DATA deviceData;
  176. } ATLAS_MACROEVENT, *PATLAS_MACROEVENT;
  177. typedef struct tagMACRO
  178. {
  179. char name[MAX_MACRO_NAME];
  180. DWORD macroTrigger;
  181. int nEvents;
  182. DWORD flags;
  183. MACROEVENT event[MAX_MACRO_EVENTS];
  184. } MACRO, *PMACRO;
  185. typedef struct tagATLAS_MACRO
  186. {
  187. char name[MAX_MACRO_NAME];
  188. DWORD macroTrigger;
  189. int nEvents;
  190. DWORD flags;
  191. ATLAS_MACROEVENT event[MAX_MACRO_EVENTS];
  192. } ATLAS_MACRO, *PATLAS_MACRO;
  193. typedef struct tagPROFILEVERINFO
  194. {
  195. DWORD dwMajorVersion; // Data format major version.
  196. DWORD dwMinorVersion; // Data format minor version.
  197. char szSignature[10]; // "SideWinder"
  198. } PROFILEVERINFO;
  199. typedef struct tagPROFILE_HEADER
  200. {
  201. int iSize; // size of PROFILE
  202. PROFILEVERINFO vi;
  203. GUID clsid;
  204. } PROFILE_HEADER;
  205. typedef struct _VERSIONINFO
  206. {
  207. DWORD dwOSVersionInfoSize;
  208. DWORD dwMajorVersion;
  209. DWORD dwMinorVersion;
  210. DWORD dwBuildNumber;
  211. DWORD dwPlatformId;
  212. char szCSDVersion[128];
  213. } VERSIONINFO;
  214. typedef struct tagATLAS_PROFILE_HEADER
  215. {
  216. int iSize; // size of PROFILE
  217. VERSIONINFO vi;
  218. GUID clsid;
  219. } ATLAS_PROFILE_HEADER;
  220. //#ifdef _XENA
  221. typedef struct tagPROFILE
  222. {
  223. PROFILE_HEADER header;
  224. DWORD dwFlags;
  225. SETTING Settings;
  226. DWORD dwReserved1;
  227. DWORD dwReserved2;
  228. UINT nMacros;
  229. UINT nButtonMacros;
  230. DWORD dwButtonUsageArray;
  231. // union tagBtn
  232. // {
  233. UINT iButtonMacros;
  234. // MACRO* aButtonMacro;
  235. // };
  236. UINT nPOVMacros;
  237. DWORD dwPOVUsageArray;
  238. // union tagPOV
  239. // {
  240. UINT iPOVMacros;
  241. // MACRO* aPOVMacro;
  242. // };
  243. UINT nDPadMacros;
  244. DWORD dwDPadUsageArray;
  245. // union tagDpad
  246. // {
  247. UINT iDPadMacros;
  248. // MACRO* aDPadMacro;
  249. // };
  250. MACRO macro[1];
  251. } PROFILE, *PPROFILE;
  252. typedef struct tagACTIVE_PROFILE
  253. {
  254. int nUnitId;
  255. PROFILE Profile;
  256. MACRO btnMacros[MAX_BUTTON_MACROS-1];
  257. MACRO povMacros[MAX_POV_MACROS];
  258. MACRO dpadMacros[MAX_DPAD_MACROS];
  259. } ACTIVE_PROFILE, *PACTIVE_PROFILE;
  260. typedef struct tagATLAS_PROFILE
  261. {
  262. UINT uDeviceNumber; // see GDP_DEVNUM
  263. DWORD dwFlags; // see PROFILE FLags
  264. int nMacros; // number of MACROs
  265. DWORD dwMacroUsageArray; // Macro Usage Bit Array.
  266. ATLAS_MACRO Macros[MAX_ATLAS_MACROS]; // List of MACROs
  267. ATLAS_SETTING Settings; // SETTINGS
  268. DWORD dwReserved1; // future expansion
  269. DWORD dwReserved2;
  270. } ATLAS_PROFILE, *PATLAS_PROFILE;
  271. typedef struct tagACTIVE_ATLAS_PROFILE
  272. {
  273. int nUnitId; // instance of device
  274. ATLAS_PROFILE Profile; // profile for instance
  275. } ACTIVE_ATLAS_PROFILE, *PACTIVE_ATLAS_PROFILE;
  276. //#endif // _XENA
  277. #pragma pack(pop, default_alignment)
  278. #endif // _PROFILE_H