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.

224 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ksshellp.h
  5. Abstract:
  6. Internal header file for KSShell for PortCls
  7. --*/
  8. #if !defined( _KSSHELLP_ )
  9. #define _KSSHELLP_
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #include "ks.h"
  14. #undef INTERFACE
  15. #ifndef KsShellStandardConnect
  16. #define KsShellStandardConnect KspShellStandardConnect
  17. #endif // !KsShellStandardConnect
  18. #ifndef KsShellTransferKsIrp
  19. #define KsShellTransferKsIrp KspShellTransferKsIrp
  20. #endif // !KsShellTransferKsIrp
  21. typedef interface IKsShellTransport *PIKSSHELLTRANSPORT;
  22. typedef struct {
  23. LIST_ENTRY ListEntry;
  24. KSPIN_LOCK SpinLock;
  25. } INTERLOCKEDLIST_HEAD, *PINTERLOCKEDLIST_HEAD;
  26. #define InitializeInterlockedListHead(h) \
  27. InitializeListHead(&(h)->ListEntry); \
  28. KeInitializeSpinLock(&(h)->SpinLock)
  29. #define KsInitializeWorkSinkItem(WorkItem,Object)\
  30. ExInitializeWorkItem(\
  31. WorkItem,\
  32. KsWorkSinkItemWorker,\
  33. static_cast<PIKSWORKSINK>(Object));
  34. #undef INTERFACE
  35. #define INTERFACE IKsShellTransport
  36. DECLARE_INTERFACE_(IKsShellTransport,IUnknown)
  37. {
  38. DEFINE_ABSTRACT_UNKNOWN() // For IUnknown
  39. STDMETHOD_(NTSTATUS,TransferKsIrp)(THIS_
  40. IN PIRP Irp,
  41. OUT PIKSSHELLTRANSPORT* NextTransport
  42. ) PURE;
  43. STDMETHOD_(void,Connect)(THIS_
  44. IN PIKSSHELLTRANSPORT NewTransport OPTIONAL,
  45. OUT PIKSSHELLTRANSPORT *OldTransport OPTIONAL,
  46. IN KSPIN_DATAFLOW DataFlow
  47. ) PURE;
  48. STDMETHOD_(NTSTATUS,SetDeviceState)(THIS_
  49. IN KSSTATE NewState,
  50. IN KSSTATE OldState,
  51. OUT PIKSSHELLTRANSPORT* NextTransport
  52. ) PURE;
  53. STDMETHOD_(void,SetResetState)(THIS_
  54. IN KSRESET ksReset,
  55. OUT PIKSSHELLTRANSPORT* NextTransport
  56. ) PURE;
  57. #if DBG
  58. STDMETHOD_(void,DbgRollCall)(THIS_
  59. IN ULONG NameMaxSize,
  60. OUT PCHAR Name,
  61. OUT PIKSSHELLTRANSPORT* NextTransport,
  62. OUT PIKSSHELLTRANSPORT* PrevTransport
  63. ) PURE;
  64. #endif
  65. };
  66. #undef INTERFACE
  67. #if DBG
  68. #define IMP_IKsShellTransport\
  69. STDMETHODIMP_(NTSTATUS)\
  70. TransferKsIrp(\
  71. IN PIRP pIrp,\
  72. OUT PIKSSHELLTRANSPORT* NextTransport\
  73. );\
  74. STDMETHODIMP_(void)\
  75. Connect(\
  76. IN PIKSSHELLTRANSPORT NewTransport OPTIONAL,\
  77. OUT PIKSSHELLTRANSPORT *OldTransport OPTIONAL,\
  78. IN KSPIN_DATAFLOW DataFlow\
  79. );\
  80. STDMETHODIMP_(NTSTATUS)\
  81. SetDeviceState(\
  82. IN KSSTATE NewState,\
  83. IN KSSTATE OldState,\
  84. OUT PIKSSHELLTRANSPORT* NextTransport\
  85. );\
  86. STDMETHODIMP_(void)\
  87. SetResetState(\
  88. IN KSRESET ksReset,\
  89. OUT PIKSSHELLTRANSPORT* NextTransport\
  90. );\
  91. STDMETHODIMP_(void)\
  92. DbgRollCall(\
  93. IN ULONG NameMaxSize,\
  94. OUT PCHAR Name,\
  95. OUT PIKSSHELLTRANSPORT* NextTransport,\
  96. OUT PIKSSHELLTRANSPORT* PrevTransport\
  97. )
  98. #else
  99. #define IMP_IKsShellTransport\
  100. STDMETHODIMP_(NTSTATUS)\
  101. TransferKsIrp(\
  102. IN PIRP pIrp,\
  103. OUT PIKSSHELLTRANSPORT* NextTransport\
  104. );\
  105. STDMETHODIMP_(void)\
  106. Connect(\
  107. IN PIKSSHELLTRANSPORT NewTransport OPTIONAL,\
  108. OUT PIKSSHELLTRANSPORT *OldTransport OPTIONAL,\
  109. IN KSPIN_DATAFLOW DataFlow\
  110. );\
  111. STDMETHODIMP_(NTSTATUS)\
  112. SetDeviceState(\
  113. IN KSSTATE NewState,\
  114. IN KSSTATE OldState,\
  115. OUT PIKSSHELLTRANSPORT* NextTransport\
  116. );\
  117. STDMETHODIMP_(void)\
  118. SetResetState(\
  119. IN KSRESET ksReset,\
  120. OUT PIKSSHELLTRANSPORT* NextTransport\
  121. )
  122. #endif
  123. #undef INTERFACE
  124. #define INTERFACE IKsWorkSink
  125. DECLARE_INTERFACE_(IKsWorkSink,IUnknown)
  126. {
  127. DEFINE_ABSTRACT_UNKNOWN() // For IUnknown
  128. STDMETHOD_(void,Work)(THIS
  129. ) PURE;
  130. };
  131. #undef INTERFACE
  132. typedef IKsWorkSink *PIKSWORKSINK;
  133. #define IMP_IKsWorkSink\
  134. STDMETHODIMP_(void)\
  135. Work(\
  136. void\
  137. )
  138. DEFINE_GUID(IID_IKsShellTransport,
  139. 0x3ef6ee40, 0xd41, 0x11d2, 0xbe, 0xda, 0x0, 0xc0, 0x4f, 0x8e, 0xf4, 0x57);
  140. #if defined(__cplusplus) && _MSC_VER >= 1100
  141. struct __declspec(uuid("3EF6EE40-0D41-11d2-BEDA-00C04F8EF457")) IKsShellTransport;
  142. #endif
  143. DEFINE_GUID(IID_IKsWorkSink,
  144. 0x3ef6ee4f, 0xd41, 0x11d2, 0xbe, 0xda, 0x0, 0xc0, 0x4f, 0x8e, 0xf4, 0x57);
  145. #if defined(__cplusplus) && _MSC_VER >= 1100
  146. struct __declspec(uuid("3EF6EE4F-0D41-11d2-BEDA-00C04F8EF457")) IKsWorkSink;
  147. #endif
  148. #define KSPSHELL_BACKCONNECT KSPIN_DATAFLOW(0x80)
  149. #define KSPSHELL_BACKCONNECT_IN KSPIN_DATAFLOW(KSPIN_DATAFLOW_IN | KSPSHELL_BACKCONNECT)
  150. #define KSPSHELL_BACKCONNECT_OUT KSPIN_DATAFLOW(KSPIN_DATAFLOW_OUT | KSPSHELL_BACKCONNECT)
  151. NTSTATUS
  152. KspShellCreateRequestor(
  153. OUT PIKSSHELLTRANSPORT* TransportInterface,
  154. IN ULONG ProbeFlags,
  155. IN ULONG StreamHeaderSize OPTIONAL,
  156. IN ULONG FrameSize,
  157. IN ULONG FrameCount,
  158. IN PDEVICE_OBJECT NextDeviceObject,
  159. IN PFILE_OBJECT AllocatorFileObject OPTIONAL
  160. );
  161. #if DBG
  162. void
  163. DbgPrintCircuit(
  164. IN PIKSSHELLTRANSPORT Transport
  165. );
  166. #endif
  167. void
  168. KspShellStandardConnect(
  169. IN PIKSSHELLTRANSPORT NewTransport OPTIONAL,
  170. IN PIKSSHELLTRANSPORT *OldTransport OPTIONAL,
  171. IN KSPIN_DATAFLOW DataFlow,
  172. IN PIKSSHELLTRANSPORT ThisTransport,
  173. IN PIKSSHELLTRANSPORT* SourceTransport,
  174. IN PIKSSHELLTRANSPORT* SinkTransport
  175. );
  176. NTSTATUS
  177. KspShellTransferKsIrp(
  178. IN PIKSSHELLTRANSPORT NewTransport,
  179. IN PIRP Irp
  180. );
  181. void
  182. KsWorkSinkItemWorker(
  183. IN PVOID Context
  184. );
  185. #ifdef __cplusplus
  186. }
  187. #endif // __cplusplus
  188. #endif // _KSSHELLP_