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.

87 lines
1.9 KiB

  1. #ifndef __ForceFeatures_h__
  2. #define __ForceFeatures_h__
  3. #define MSGAME_FEATURE_GETID 2
  4. #define MSGAME_FEATURE_GETSTATUS 3
  5. #define MSGAME_FEATURE_GETACKNAK 4
  6. #define MSGAME_FEATURE_GETNAKACK 5
  7. #define MSGAME_FEATURE_GETSYNC 6
  8. #define MSGAME_FEATURE_DORESET 7
  9. /*
  10. #define MSGAME_INPUT_JOYINFOEX 0x01
  11. #define MSGAME_FEATURE_GETID 0x02
  12. #define MSGAME_FEATURE_GETSTATUS 0x03
  13. #define MSGAME_FEATURE_GETACKNAK 0x04
  14. #define MSGAME_FEATURE_GETNAKACK 0x05
  15. #define MSGAME_FEATURE_GETSYNC 0x06
  16. #define MSGAME_FEATURE_RESET 0x07
  17. #define MSGAME_FEATURE_GETVERSION 0x08
  18. */
  19. typedef struct
  20. {
  21. ULONG cBytes;
  22. ULONG dwProductID;
  23. ULONG dwFWVersion;
  24. } PRODUCT_ID;
  25. typedef struct
  26. {
  27. ULONG cBytes;
  28. LONG dwXVel;
  29. LONG dwYVel;
  30. LONG dwXAccel;
  31. LONG dwYAccel;
  32. ULONG dwEffect;
  33. ULONG dwDeviceStatus;
  34. } JOYCHANNELSTATUS;
  35. //
  36. // HID prepends exactly, one byte so we need to
  37. // be careful about packing
  38. //
  39. #pragma pack(push, OLD_CONTEXT_1)
  40. #pragma pack(1)
  41. typedef struct
  42. {
  43. BYTE bReportId;
  44. PRODUCT_ID ProductId;
  45. } PRODUCT_ID_REPORT;
  46. typedef struct
  47. {
  48. BYTE bReportId;
  49. JOYCHANNELSTATUS JoyChannelStatus;
  50. } JOYCHANNELSTATUS_REPORT;
  51. typedef struct
  52. {
  53. BYTE bReportId;
  54. ULONG uLong;
  55. } ULONG_REPORT;
  56. #pragma pack(pop, OLD_CONTEXT_1)
  57. //
  58. // End packing of 1
  59. //
  60. class CForceFeatures
  61. {
  62. public:
  63. CForceFeatures();
  64. ~CForceFeatures();
  65. HRESULT Initialize(UINT uJoystickId, HINSTANCE hinstModule);
  66. ULONG GetVersion(){ return (4 << 16 | 0 ); } //returns version 4.0
  67. HRESULT GetId(PRODUCT_ID_REPORT& rProductId);
  68. HRESULT GetStatus(JOYCHANNELSTATUS_REPORT& rJoyChannelStatus);
  69. HRESULT GetAckNak(ULONG_REPORT& rulAckNak);
  70. HRESULT GetNakAck(ULONG_REPORT& rulNakAck);
  71. HRESULT GetSync(ULONG_REPORT& rulGameport);
  72. HRESULT DoReset();
  73. private:
  74. HANDLE m_hDevice;
  75. UINT m_uiMaxFeatureLength;
  76. };
  77. #endif // __ForceFeatures_h__