Source code of Windows XP (NT5)
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.

223 lines
3.4 KiB

  1. /*
  2. * OPOSCTRL.CPP
  3. *
  4. *
  5. *
  6. *
  7. *
  8. *
  9. */
  10. #include <windows.h>
  11. #define INITGUID
  12. #include <hidclass.h>
  13. #include <hidsdi.h>
  14. #include <ole2.h>
  15. #include <ole2ver.h>
  16. #include "..\inc\opos.h"
  17. #include "oposctrl.h"
  18. COPOSControl::COPOSControl()
  19. {
  20. m_refCount = 0;
  21. m_serverLockCount = 0;
  22. /*
  23. * According to the spec,
  24. * these are the only properties which require initialization.
  25. */
  26. State = OPOS_S_CLOSED;
  27. ResultCode = OPOS_E_CLOSED;
  28. ControlObjectDescription = "BUGBUG - CO description"; // Control Object dependent string.
  29. ControlObjectVersion = 1; // BUGBUG Control Object dependent number.
  30. }
  31. COPOSControl::~COPOSControl()
  32. {
  33. ASSERT(m_refCount == 0);
  34. ASSERT(m_serverLockCount == 0);
  35. }
  36. STDMETHODIMP_(LONG) COPOSControl::Open(BSTR DeviceName)
  37. {
  38. Claimed = TRUE;
  39. DeviceEnabled = TRUE;
  40. DataEventEnabled = TRUE;
  41. FreezeEvents = TRUE;
  42. // BUGBUG FINISH
  43. return 0;
  44. }
  45. STDMETHODIMP_(LONG) COPOSControl::Close()
  46. {
  47. Claimed = FALSE;
  48. DeviceEnabled = FALSE;
  49. DataEventEnabled = FALSE;
  50. FreezeEvents = FALSE;
  51. // BUGBUG FINISH
  52. return 0;
  53. }
  54. STDMETHODIMP_(LONG) COPOSControl::CheckHealth(LONG Level)
  55. {
  56. LONG result;
  57. if (DeviceEnabled){
  58. // BUGBUG FINISH
  59. result = OPOS_E_NOSERVICE;
  60. }
  61. else {
  62. result = OPOS_E_CLOSED;
  63. }
  64. return result;
  65. }
  66. STDMETHODIMP_(LONG) COPOSControl::Claim(LONG Timeout)
  67. {
  68. LONG result;
  69. if (DeviceEnabled){
  70. // BUGBUG FINISH
  71. result = OPOS_E_NOSERVICE;
  72. }
  73. else {
  74. result = OPOS_E_CLOSED;
  75. }
  76. return result;
  77. }
  78. STDMETHODIMP_(LONG) COPOSControl::ClearInput()
  79. {
  80. LONG result;
  81. if (DeviceEnabled){
  82. // BUGBUG FINISH
  83. result = OPOS_E_NOSERVICE;
  84. }
  85. else {
  86. result = OPOS_E_CLOSED;
  87. }
  88. return result;
  89. }
  90. STDMETHODIMP_(LONG) COPOSControl::ClearOutput()
  91. {
  92. LONG result;
  93. if (DeviceEnabled){
  94. // BUGBUG FINISH
  95. result = OPOS_E_NOSERVICE;
  96. }
  97. else {
  98. result = OPOS_E_CLOSED;
  99. }
  100. return result;
  101. }
  102. STDMETHODIMP_(LONG) COPOSControl::DirectIO(LONG Command, LONG* pData, BSTR* pString)
  103. {
  104. LONG result;
  105. if (DeviceEnabled){
  106. // BUGBUG FINISH
  107. result = OPOS_E_NOSERVICE;
  108. }
  109. else {
  110. result = OPOS_E_CLOSED;
  111. }
  112. return result;
  113. }
  114. #if 0
  115. // BUGBUG overrides IUnknown ?
  116. STDMETHODIMP_(LONG) COPOSControl::Release()
  117. {
  118. // BUGBUG FINISH
  119. return 0;
  120. }
  121. #endif
  122. STDMETHODIMP_(void) COPOSControl::SOData(LONG Status)
  123. {
  124. // BUGBUG FINISH
  125. }
  126. STDMETHODIMP_(void) COPOSControl::SODirectIO(LONG EventNumber, LONG* pData, BSTR* pString)
  127. {
  128. // BUGBUG FINISH
  129. }
  130. STDMETHODIMP_(void) COPOSControl::DirectIOEvent(LONG EventNumber, LONG* pData, BSTR* pString)
  131. {
  132. // BUGBUG FINISH
  133. }
  134. STDMETHODIMP_(void) COPOSControl::SOError(LONG ResultCode, LONG ResultCodeExtended, LONG ErrorLocus, LONG* pErrorResponse)
  135. {
  136. // BUGBUG FINISH
  137. }
  138. STDMETHODIMP_(void) COPOSControl::SOOutputComplete(LONG OutputID)
  139. {
  140. // BUGBUG FINISH
  141. }
  142. STDMETHODIMP_(void) COPOSControl::OutputCompleteEvent(LONG OutputID)
  143. {
  144. // BUGBUG FINISH
  145. }
  146. STDMETHODIMP_(void) COPOSControl::SOStatusUpdate(LONG Data)
  147. {
  148. // BUGBUG FINISH
  149. }
  150. STDMETHODIMP_(LONG) COPOSControl::SOProcessID()
  151. {
  152. LONG result;
  153. if (DeviceEnabled){
  154. // BUGBUG FINISH
  155. result = OPOS_E_NOSERVICE;
  156. }
  157. else {
  158. result = OPOS_E_CLOSED;
  159. }
  160. return result;
  161. }