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.

72 lines
2.3 KiB

  1. //@doc
  2. /******************************************************
  3. **
  4. ** @module FFDEVICE.H | Definition file for FFDevice class
  5. **
  6. ** Description:
  7. ** This is the generic FF device. Independant of
  8. ** Firmawate and how data reaches the device
  9. ** This first implementation uses the old CJoltMidi to
  10. ** minimize new code.
  11. **
  12. ** History:
  13. ** Created 11/17/97 Matthew L. Coill (mlc)
  14. **
  15. ** (c) 1986-1997 Microsoft Corporation. All Rights Reserved.
  16. ******************************************************/
  17. #ifndef __FFDEVICE_H__
  18. #define __FFDEVICE_H__
  19. #ifdef DIRECTINPUT_VERSION
  20. #undef DIRECTINPUT_VERSION
  21. #endif
  22. #define DIRECTINPUT_VERSION 0x050a
  23. #include <dinput.h>
  24. // Currently there is some extra stuff in here, that should be part of other objects
  25. //
  26. // @class ForceFeedbackDevice class
  27. //
  28. class ForceFeedbackDevice
  29. {
  30. //@access Constructor/Destructor
  31. public:
  32. //@cmember constructor
  33. ForceFeedbackDevice();
  34. //@cmember destructor
  35. ~ForceFeedbackDevice() {};
  36. BOOL DetectHardware();
  37. DWORD GetPlatform() const { return m_OSVersion.dwPlatformId; }
  38. DWORD GetPlatformMajorVersion() const { return m_OSVersion.dwMajorVersion; }
  39. DWORD GetPlatformMinorVersion() const { return m_OSVersion.dwMinorVersion; }
  40. DWORD GetOSBuildNumber() const { return m_OSVersion.dwBuildNumber; }
  41. BOOL IsOSNT5() const { return ((m_OSVersion.dwPlatformId == VER_PLATFORM_WIN32_NT) && (m_OSVersion.dwMajorVersion == 5)); }
  42. void SetFirmwareVersion(DWORD dwDeviceID, DWORD major, DWORD minor);
  43. DWORD GetFirmwareVersionMajor() const { return m_FirmwareVersionMajor; }
  44. DWORD GetFirmwareVersionMinor() const { return m_FirmwareVersionMinor; }
  45. USHORT GetAckNackMethod(USHORT methodIndex) const { return USHORT((m_FirmwareAckNackValues >> methodIndex) & 0x00000003); }
  46. DWORD GetDriverVersionMajor() const { return m_DriverVersionMajor; }
  47. DWORD GetDriverVersionMinor() const { return m_DriverVersionMinor; }
  48. void SetDriverVersion(DWORD major, DWORD minor);
  49. //@access private data members
  50. private:
  51. OSVERSIONINFO m_OSVersion;
  52. DWORD m_FirmwareVersionMajor;
  53. DWORD m_FirmwareVersionMinor;
  54. DWORD m_FirmwareAckNackValues;
  55. DWORD m_DriverVersionMajor;
  56. DWORD m_DriverVersionMinor;
  57. };
  58. extern ForceFeedbackDevice g_ForceFeedbackDevice;
  59. #endif __FFDEVICE_H__