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.

137 lines
4.7 KiB

  1. /****************************************************************************
  2. MODULE: VXDIOCTL.HPP
  3. Tab stops 5 9
  4. Copyright 1995-1997, Microsoft Corporation, All Rights Reserved.
  5. PURPOSE: Header file for VXDIOCTL.CPP
  6. FUNCTIONS:
  7. Author(s): Name:
  8. ---------- ----------------
  9. MEA Manolito E. Adan
  10. Revision History:
  11. -----------------
  12. Version Date Author Comments
  13. ------- ------ ----- -------------------------------------------
  14. 1.0 03-Jan-97 MEA Original
  15. 1.1 14-Apr-97 MEA Added SetMidiPort IOCTL
  16. 11-Jun-97 MEA Added JoltHWReset IOCTL
  17. 21-Mar-99 waltw Nuked VxDCommunicator, this is NT5 only!
  18. 23-Mar-99 waltw Nuked GetStatusGateData (old Jolt code)
  19. ****************************************************************************/
  20. #ifndef __VXDIOCTL_HPP__
  21. #define __VXDIOCTL_HPP__
  22. #include <windows.h>
  23. #include "FFeature.h"
  24. #ifndef override
  25. #define override
  26. #endif
  27. //--------------------- Host converted AckNack,Effect Status Structure ------
  28. typedef struct _ACKNACK {
  29. DWORD cBytes;
  30. DWORD dwAckNack; //ACK, NACK
  31. DWORD dwErrorCode;
  32. DWORD dwEffectStatus; //SWDEV_STS_EFFECT_RUNNING||SWDEV_STS_EFFECT_STOPPED
  33. } ACKNACK, *PACKNACK;
  34. //--------------------- Host converted Channel ID Structure -----------------
  35. struct LOCAL_PRODUCT_ID {
  36. DWORD cBytes;
  37. DWORD dwProductID;
  38. DWORD dwFWMajVersion;
  39. DWORD dwFWMinVersion;
  40. };
  41. // Bitmasks for Response Status - 1.xx (we don't support version 1 - informational only)
  42. //#define STATUS_GATE_1XX 0x08
  43. //#define RUNNING_MASK_1XX 0x04
  44. //#define ACKNACK_MASK_1XX 0x02
  45. //#define SCLK_MASK_1XX 0x01
  46. // Bitmasks for Response Status - Version 2
  47. #define STATUS_GATE_200 0x80
  48. #define RUNNING_MASK_200 0x40
  49. #define ACKNACK_MASK_200 0x20
  50. #define SCLK_MASK_200 0x10
  51. // Bitmasks for Get Status packet dwDeviceStatus member
  52. #define ERROR_STATUS_MASK 0x07 // only bits 0-2 valid
  53. #define BANDWIDTH_OVERFLOW_200 0x0200
  54. // Error code from device (plus own)
  55. #define DEV_ERR_SUCCESS_200 0x00 // Success
  56. #define DEV_ERR_INVALID_ID_200 0x01 // Effect ID is invalid or not found
  57. #define DEV_ERR_BAD_PARAM_200 0x02 // Invalid parameter in data structure
  58. #define DEV_ERR_BAD_CHECKSUM_200 0x03 // Invalid checksum
  59. #define DEV_ERR_BAD_INDEX_200 0x04 // Invalid index sent (modify)
  60. #define DEV_ERR_UNKNOWN_CMD_200 0x05 // Unrecognized command
  61. #define DEV_ERR_PLAY_FULL_200 0x06 // Play List is full, cannot play anymore
  62. #define DEV_ERR_MEM_FULL_200 0x07 // Out of memory
  63. #define DEV_ERR_BANDWIDTH_FULL_200 0x08 // used to signal bandwidth error
  64. /************************************************************************
  65. **
  66. ** @class DriverCommunicator |
  67. ** This is the interface for driver communications
  68. **
  69. *************************************************************************/
  70. class DriverCommunicator
  71. {
  72. //@access Constructor/Destructor
  73. public:
  74. //@cmember constructor
  75. DriverCommunicator() {};
  76. //@cmember destructor
  77. virtual ~DriverCommunicator() {};
  78. virtual HRESULT ResetDevice() { return E_NOTIMPL; }
  79. virtual HRESULT GetDriverVersion(DWORD& rdwMajor, DWORD& rdwMinor) { return E_NOTIMPL; }
  80. virtual HRESULT GetPortByte(ULONG& portByte) { return E_NOTIMPL; }
  81. virtual HRESULT GetID(LOCAL_PRODUCT_ID& rProductID) { return E_NOTIMPL; }
  82. virtual HRESULT GetStatus(JOYCHANNELSTATUS& rChannelStatus) { return E_NOTIMPL; }
  83. virtual HRESULT GetAckNack(ACKNACK& rAckNack, USHORT usRegIndex) { return E_NOTIMPL; }
  84. virtual HRESULT SetBackdoorPort(ULONG ulPortAddress) { return E_NOTIMPL; }
  85. virtual HRESULT SendBackdoor(BYTE* pMidiData, DWORD dwNumBytes) { return E_NOTIMPL; }
  86. };
  87. /************************************************************************
  88. **
  89. ** @class HIDFeatureCommunicator |
  90. ** Communicates with the HID driver via HID Features (NT5)
  91. **
  92. *************************************************************************/
  93. class HIDFeatureCommunicator :
  94. public DriverCommunicator
  95. {
  96. //@access Constructor/Destructor
  97. public:
  98. //@cmember constructor
  99. HIDFeatureCommunicator();
  100. //@cmember destructor
  101. override ~HIDFeatureCommunicator();
  102. BOOL Initialize(UINT uJoystickId);
  103. override HRESULT ResetDevice();
  104. override HRESULT GetDriverVersion(DWORD& rdwMajor, DWORD& rdwMinor);
  105. override HRESULT GetID(LOCAL_PRODUCT_ID& rProductID);
  106. override HRESULT GetPortByte(ULONG& portByte);
  107. override HRESULT GetStatus(JOYCHANNELSTATUS& rChannelStatus);
  108. override HRESULT GetAckNack(ACKNACK& rAckNack, USHORT usRegIndex);
  109. //@access Private Data Members
  110. private:
  111. CForceFeatures m_ForceFeature;
  112. };
  113. extern DriverCommunicator* g_pDriverCommunicator;
  114. #endif __VXDIOCTL_HPP__