KsProxy.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:22k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4.     ksproxy.h
  5. Abstract:
  6.     Interface definitions for WDM-CSA proxy filters.
  7. --*/
  8. #ifndef __KSPROXY__
  9. #define __KSPROXY__
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #undef KSDDKAPI
  14. #ifdef _KSDDK_
  15. #define KSDDKAPI
  16. #else // !_KSDDK_
  17. #define KSDDKAPI DECLSPEC_IMPORT
  18. #endif // _KSDDK_
  19. #define STATIC_IID_IKsObject
  20.     0x423c13a2L, 0x2070, 0x11d0, 0x9e, 0xf7, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1
  21. #define STATIC_IID_IKsPinEx
  22.     0x7bb38260L, 0xd19c, 0x11d2, 0xb3, 0x8a, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e
  23. #define STATIC_IID_IKsPin
  24.     0xb61178d1L, 0xa2d9, 0x11cf, 0x9e, 0x53, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1
  25.     
  26. #define STATIC_IID_IKsPinPipe
  27.     0xe539cd90L, 0xa8b4, 0x11d1, 0x81, 0x89, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
  28. #define STATIC_IID_IKsDataTypeHandler
  29.     0x5ffbaa02L, 0x49a3, 0x11d0, 0x9f, 0x36, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1
  30. #define STATIC_IID_IKsDataTypeCompletion
  31.     0x827D1A0EL, 0x0F73, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  32. #define STATIC_IID_IKsInterfaceHandler
  33.     0xD3ABC7E0L, 0x9A61, 0x11D0, 0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  34. #define STATIC_IID_IKsClockPropertySet
  35.     0x5C5CBD84L, 0xE755, 0x11D0, 0xAC, 0x18, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  36. #define STATIC_IID_IKsAllocator
  37.     0x8da64899L, 0xc0d9, 0x11d0, 0x84, 0x13, 0x00, 0x00, 0xf8, 0x22, 0xfe, 0x8a
  38.     
  39. #define STATIC_IID_IKsAllocatorEx
  40.     0x091bb63aL, 0x603f, 0x11d1, 0xb0, 0x67, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02
  41.     
  42. #ifndef STATIC_IID_IKsPropertySet
  43. #define STATIC_IID_IKsPropertySet
  44.     0x31EFAC30L, 0x515C, 0x11d0, 0xA9, 0xAA, 0x00, 0xAA, 0x00, 0x61, 0xBE, 0x93
  45. #endif // STATIC_IID_IKsPropertySet
  46. #define STATIC_IID_IKsTopology
  47.     0x28F54683L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  48. #ifndef STATIC_IID_IKsControl
  49. #define STATIC_IID_IKsControl
  50.     0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  51. #endif // STATIC_IID_IKsControl
  52. #define STATIC_IID_IKsAggregateControl
  53.     0x7F40EAC0L, 0x3947, 0x11D2, 0x87, 0x4E, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  54. #define STATIC_CLSID_Proxy 
  55.     0x17CCA71BL, 0xECD7, 0x11D0, 0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
  56. #ifdef _KS_
  57. #if !defined(__cplusplus) || _MSC_VER < 1100
  58. DEFINE_GUIDEX(IID_IKsObject);
  59. DEFINE_GUIDEX(IID_IKsPin);
  60. DEFINE_GUIDEX(IID_IKsPinEx);
  61. DEFINE_GUIDEX(IID_IKsPinPipe);
  62. DEFINE_GUIDEX(IID_IKsDataTypeHandler);
  63. DEFINE_GUIDEX(IID_IKsDataTypeCompletion);
  64. DEFINE_GUIDEX(IID_IKsInterfaceHandler);
  65. DEFINE_GUIDEX(IID_IKsClockPropertySet);
  66. DEFINE_GUIDEX(IID_IKsAllocator);
  67. DEFINE_GUIDEX(IID_IKsAllocatorEx);
  68. #define IID_IKsQualityForwarder KSCATEGORY_QUALITY
  69. #endif // !defined(__cplusplus) || _MSC_VER < 1100
  70. #define STATIC_IID_IKsQualityForwarder STATIC_KSCATEGORY_QUALITY
  71. typedef enum {
  72.     KsAllocatorMode_User,
  73.     KsAllocatorMode_Kernel
  74. } KSALLOCATORMODE;
  75. typedef enum {
  76.     FramingProp_Uninitialized,
  77.     FramingProp_None,
  78.     FramingProp_Old,
  79.     FramingProp_Ex
  80. } FRAMING_PROP;
  81. typedef FRAMING_PROP *PFRAMING_PROP;
  82. typedef enum {
  83.     Framing_Cache_Update,     // request to bypass cache when read/write
  84.     Framing_Cache_ReadLast,
  85.     Framing_Cache_ReadOrig,
  86.     Framing_Cache_Write
  87. } FRAMING_CACHE_OPS;
  88. typedef struct {
  89.     LONGLONG     MinTotalNominator;  
  90.     LONGLONG     MaxTotalNominator;
  91.     LONGLONG     TotalDenominator;
  92. } OPTIMAL_WEIGHT_TOTALS;
  93. // forward declaration
  94. typedef struct IPin IPin;
  95. typedef struct IKsPin IKsPin;
  96. typedef struct IKsAllocator IKsAllocator;
  97. typedef struct IKsAllocatorEx IKsAllocatorEx;
  98.                       
  99. //
  100. // allocators strategy is defined by graph manager
  101. //
  102. #define AllocatorStrategy_DontCare                      0
  103. //
  104. // what to optimize
  105. //
  106. #define AllocatorStrategy_MinimizeNumberOfFrames        0x00000001
  107. #define AllocatorStrategy_MinimizeFrameSize             0x00000002
  108. #define AllocatorStrategy_MinimizeNumberOfAllocators    0x00000004
  109. #define AllocatorStrategy_MaximizeSpeed                 0x00000008 
  110. //
  111. // factors (flags) defining the Pipes properties
  112. //
  113. #define PipeFactor_None                   0
  114. #define PipeFactor_UserModeUpstream       0x00000001
  115. #define PipeFactor_UserModeDownstream     0x00000002
  116. #define PipeFactor_MemoryTypes            0x00000004
  117. #define PipeFactor_Flags                  0x00000008
  118. #define PipeFactor_PhysicalRanges         0x00000010
  119. #define PipeFactor_OptimalRanges          0x00000020
  120. #define PipeFactor_FixedCompression       0x00000040
  121. #define PipeFactor_UnknownCompression     0x00000080
  122. #define PipeFactor_Buffers                0x00000100
  123. #define PipeFactor_Align                  0x00000200
  124. #define PipeFactor_PhysicalEnd            0x00000400
  125. #define PipeFactor_LogicalEnd             0x00000800
  126. typedef enum {
  127.     PipeState_DontCare,
  128.     PipeState_RangeNotFixed,
  129.     PipeState_RangeFixed,
  130.     PipeState_CompressionUnknown,
  131.     PipeState_Finalized
  132. } PIPE_STATE;
  133. //
  134. // pipe dimensions relative to BeginPin.
  135. //
  136. typedef struct _PIPE_DIMENSIONS {
  137.     KS_COMPRESSION    AllocatorPin;
  138.     KS_COMPRESSION    MaxExpansionPin;
  139.     KS_COMPRESSION    EndPin;
  140. } PIPE_DIMENSIONS, *PPIPE_DIMENSIONS;
  141. typedef enum {
  142.     Pipe_Allocator_None,
  143.     Pipe_Allocator_FirstPin,
  144.     Pipe_Allocator_LastPin,
  145.     Pipe_Allocator_MiddlePin
  146. } PIPE_ALLOCATOR_PLACE;
  147. typedef PIPE_ALLOCATOR_PLACE  *PPIPE_ALLOCATOR_PLACE;
  148. typedef enum {
  149.     KS_MemoryTypeDontCare = 0,
  150.     KS_MemoryTypeKernelPaged,
  151.     KS_MemoryTypeKernelNonPaged,
  152.     KS_MemoryTypeDeviceHostMapped,
  153.     KS_MemoryTypeDeviceSpecific,
  154.     KS_MemoryTypeUser,
  155.     KS_MemoryTypeAnyHost
  156. } KS_LogicalMemoryType;
  157. typedef KS_LogicalMemoryType  *PKS_LogicalMemoryType;
  158. typedef struct _PIPE_TERMINATION {
  159.     ULONG                       Flags;
  160.     ULONG                       OutsideFactors;
  161.     ULONG                       Weigth;            // outside weight
  162.     KS_FRAMING_RANGE            PhysicalRange;
  163.     KS_FRAMING_RANGE_WEIGHTED   OptimalRange;      
  164.     KS_COMPRESSION              Compression;       // relative to the connected pin on a neighboring filter.
  165. } PIPE_TERMINATION;
  166. //
  167. // extended allocator properties 
  168. //
  169. typedef struct _ALLOCATOR_PROPERTIES_EX
  170.     {
  171.     long cBuffers;
  172.     long cbBuffer;
  173.     long cbAlign;
  174.     long cbPrefix;
  175. // new part
  176.     GUID                       MemoryType;         
  177.     GUID                       BusType;            // one of the buses this pipe is using
  178.     PIPE_STATE                 State;                        
  179.     PIPE_TERMINATION           Input;                        
  180.     PIPE_TERMINATION           Output;                       
  181.     ULONG                      Strategy;
  182.     ULONG                      Flags;              
  183.     ULONG                      Weight;
  184.     KS_LogicalMemoryType       LogicalMemoryType;
  185.     PIPE_ALLOCATOR_PLACE       AllocatorPlace;
  186.     PIPE_DIMENSIONS            Dimensions;
  187.     KS_FRAMING_RANGE           PhysicalRange;      // on allocator pin
  188.     IKsAllocatorEx*            PrevSegment;        // doubly-linked list of KS allocators
  189.     ULONG                      CountNextSegments;  // possible multiple dependent pipes
  190.     IKsAllocatorEx**           NextSegments;
  191.     ULONG                      InsideFactors;      // existing factors (different from "don't care")
  192.     ULONG                      NumberPins;                   
  193. } ALLOCATOR_PROPERTIES_EX;
  194. typedef ALLOCATOR_PROPERTIES_EX *PALLOCATOR_PROPERTIES_EX;
  195. #ifdef __STREAMS__
  196. struct DECLSPEC_UUID("5C5CBD84-E755-11D0-AC18-00A0C9223196") IKsClockPropertySet;
  197. #undef INTERFACE
  198. #define INTERFACE IKsClockPropertySet
  199. DECLARE_INTERFACE_(IKsClockPropertySet, IUnknown)
  200. {
  201.     STDMETHOD(KsGetTime)(
  202.         THIS_
  203.         LONGLONG* Time
  204.     ) PURE;
  205.     STDMETHOD(KsSetTime)(
  206.         THIS_
  207.         LONGLONG Time
  208.     ) PURE;
  209.     STDMETHOD(KsGetPhysicalTime)(
  210.         THIS_
  211.         LONGLONG* Time
  212.     ) PURE;
  213.     STDMETHOD(KsSetPhysicalTime)(
  214.         THIS_
  215.         LONGLONG Time
  216.     ) PURE;
  217.     STDMETHOD(KsGetCorrelatedTime)(
  218.         THIS_
  219.         KSCORRELATED_TIME* CorrelatedTime
  220.     ) PURE;
  221.     STDMETHOD(KsSetCorrelatedTime)(
  222.         THIS_
  223.         KSCORRELATED_TIME* CorrelatedTime
  224.     ) PURE;
  225.     STDMETHOD(KsGetCorrelatedPhysicalTime)(
  226.         THIS_
  227.         KSCORRELATED_TIME* CorrelatedTime
  228.     ) PURE;
  229.     STDMETHOD(KsSetCorrelatedPhysicalTime)(
  230.         THIS_
  231.         KSCORRELATED_TIME* CorrelatedTime
  232.     ) PURE;
  233.     STDMETHOD(KsGetResolution)(
  234.         THIS_
  235.         KSRESOLUTION* Resolution
  236.     ) PURE;
  237.     STDMETHOD(KsGetState)(
  238.         THIS_
  239.         KSSTATE* State
  240.     ) PURE;
  241. };
  242. interface DECLSPEC_UUID("8da64899-c0d9-11d0-8413-0000f822fe8a") IKsAllocator;
  243. #undef INTERFACE
  244. #define INTERFACE IKsAllocator
  245. DECLARE_INTERFACE_(IKsAllocator, IUnknown)
  246. {
  247.     STDMETHOD_(HANDLE, KsGetAllocatorHandle)(
  248.         THIS
  249.     ) PURE;
  250.     STDMETHOD_(KSALLOCATORMODE, KsGetAllocatorMode)(
  251.         THIS
  252.     ) PURE;
  253.     STDMETHOD(KsGetAllocatorStatus)(
  254.         THIS_
  255.         PKSSTREAMALLOCATOR_STATUS AllocatorStatus
  256.     ) PURE;
  257.     STDMETHOD_(VOID, KsSetAllocatorMode)(
  258.         THIS_
  259.         KSALLOCATORMODE Mode
  260.     ) PURE;
  261. };
  262. interface DECLSPEC_UUID("091bb63a-603f-11d1-b067-00a0c9062802") IKsAllocatorEx;
  263. #undef INTERFACE
  264. #define INTERFACE IKsAllocatorEx
  265. DECLARE_INTERFACE_(IKsAllocatorEx, IKsAllocator)
  266. {
  267.     STDMETHOD_(PALLOCATOR_PROPERTIES_EX, KsGetProperties)(
  268.         THIS
  269.     ) PURE;
  270.     STDMETHOD_(VOID, KsSetProperties)(
  271.         THIS_
  272.         PALLOCATOR_PROPERTIES_EX 
  273.     ) PURE;
  274.     STDMETHOD_(VOID, KsSetAllocatorHandle)(
  275.         THIS_
  276.         HANDLE AllocatorHandle
  277.     ) PURE;
  278.     STDMETHOD_(HANDLE, KsCreateAllocatorAndGetHandle)(
  279.         THIS_
  280.         IKsPin*   KsPin
  281.     ) PURE;
  282. };  
  283. typedef enum {
  284.     KsPeekOperation_PeekOnly,
  285.     KsPeekOperation_AddRef
  286. } KSPEEKOPERATION;
  287. typedef struct _KSSTREAM_SEGMENT *PKSSTREAM_SEGMENT;
  288. interface DECLSPEC_UUID("b61178d1-a2d9-11cf-9e53-00aa00a216a1") IKsPin;
  289. #undef INTERFACE
  290. #define INTERFACE IKsPin
  291. DECLARE_INTERFACE_(IKsPin, IUnknown)
  292. {
  293.     STDMETHOD(KsQueryMediums)(
  294.         THIS_
  295.         PKSMULTIPLE_ITEM* MediumList
  296.     ) PURE;
  297.     STDMETHOD(KsQueryInterfaces)(
  298.         THIS_
  299.         PKSMULTIPLE_ITEM* InterfaceList
  300.     ) PURE;
  301.     STDMETHOD(KsCreateSinkPinHandle)(
  302.         THIS_
  303.         KSPIN_INTERFACE& Interface,
  304.         KSPIN_MEDIUM& Medium
  305.     ) PURE;
  306.     STDMETHOD(KsGetCurrentCommunication)(
  307.         THIS_
  308.         KSPIN_COMMUNICATION *Communication,
  309.         KSPIN_INTERFACE *Interface,
  310.         KSPIN_MEDIUM *Medium
  311.     ) PURE;
  312.     STDMETHOD(KsPropagateAcquire)(
  313.         THIS
  314.     ) PURE;
  315.     STDMETHOD(KsDeliver)(
  316.         THIS_
  317.         IMediaSample* Sample,
  318.         ULONG Flags
  319.     ) PURE;
  320.     STDMETHOD(KsMediaSamplesCompleted)(
  321.         THIS_
  322.         PKSSTREAM_SEGMENT StreamSegment
  323.     ) PURE;
  324.     STDMETHOD_(IMemAllocator *, KsPeekAllocator)(
  325.         THIS_
  326.         KSPEEKOPERATION Operation
  327.     ) PURE;
  328.     STDMETHOD(KsReceiveAllocator)(
  329.         THIS_
  330.         IMemAllocator *MemAllocator
  331.     ) PURE;
  332.     STDMETHOD(KsRenegotiateAllocator)(
  333.         THIS
  334.     ) PURE;
  335.     STDMETHOD_(LONG, KsIncrementPendingIoCount)(
  336.         THIS
  337.     ) PURE;
  338.     STDMETHOD_(LONG, KsDecrementPendingIoCount)(
  339.         THIS
  340.     ) PURE;
  341.     STDMETHOD(KsQualityNotify)(
  342.         THIS_
  343.         ULONG Proportion,
  344.         REFERENCE_TIME TimeDelta
  345.     ) PURE;
  346. };
  347. interface DECLSPEC_UUID("7bb38260-d19c-11d2-b38a-00a0c95ec22e") IKsPinEx;
  348. #undef INTERFACE
  349. #define INTERFACE IKsPinEx
  350. DECLARE_INTERFACE_(IKsPinEx, IKsPin)
  351. {
  352.     STDMETHOD_(VOID, KsNotifyError)(
  353.         THIS_
  354.         IMediaSample* Sample,
  355.         HRESULT hr
  356.     ) PURE;        
  357. };
  358.                          
  359. interface DECLSPEC_UUID("e539cd90-a8b4-11d1-8189-00a0c9062802") IKsPinPipe;
  360. #undef INTERFACE
  361. #define INTERFACE IKsPinPipe
  362. DECLARE_INTERFACE_(IKsPinPipe, IUnknown)
  363. {
  364.     STDMETHOD(KsGetPinFramingCache)(
  365.         THIS_
  366.         PKSALLOCATOR_FRAMING_EX *FramingEx,
  367.         PFRAMING_PROP FramingProp,
  368.         FRAMING_CACHE_OPS Option
  369.     ) PURE;
  370.     STDMETHOD(KsSetPinFramingCache)(
  371.         THIS_
  372.         PKSALLOCATOR_FRAMING_EX FramingEx,
  373.         PFRAMING_PROP FramingProp,
  374.         FRAMING_CACHE_OPS Option
  375.     ) PURE;
  376.     STDMETHOD_(IPin*, KsGetConnectedPin)(
  377.         THIS
  378.     ) PURE;
  379.     STDMETHOD_(IKsAllocatorEx*, KsGetPipe)(
  380.         THIS_
  381.         KSPEEKOPERATION Operation
  382.     ) PURE;
  383.     STDMETHOD(KsSetPipe)(
  384.         THIS_
  385.         IKsAllocatorEx *KsAllocator
  386.     ) PURE;
  387.     STDMETHOD_(ULONG, KsGetPipeAllocatorFlag)(
  388.         THIS
  389.     ) PURE;
  390.     STDMETHOD(KsSetPipeAllocatorFlag)(
  391.         THIS_
  392.         ULONG Flag
  393.     ) PURE;
  394.     STDMETHOD_(GUID, KsGetPinBusCache)(
  395.         THIS
  396.     ) PURE;
  397.     STDMETHOD(KsSetPinBusCache)(
  398.         THIS_
  399.         GUID Bus
  400.     ) PURE;
  401. //
  402. // very useful methods for tracing.
  403. //
  404.     STDMETHOD_(PWCHAR, KsGetPinName)(
  405.         THIS
  406.     ) PURE;
  407.     STDMETHOD_(PWCHAR, KsGetFilterName)(
  408.         THIS
  409.     ) PURE;
  410. };
  411. interface DECLSPEC_UUID("CD5EBE6B-8B6E-11D1-8AE0-00A0C9223196") IKsPinFactory;
  412. #undef INTERFACE
  413. #define INTERFACE IKsPinFactory
  414. DECLARE_INTERFACE_(IKsPinFactory, IUnknown)
  415. {
  416.     STDMETHOD(KsPinFactory)(
  417.         THIS_
  418.         ULONG* PinFactory
  419.     ) PURE;
  420. };
  421. typedef enum {
  422.     KsIoOperation_Write,
  423.     KsIoOperation_Read
  424. } KSIOOPERATION;
  425. interface DECLSPEC_UUID("5ffbaa02-49a3-11d0-9f36-00aa00a216a1") IKsDataTypeHandler;
  426. #undef INTERFACE
  427. #define INTERFACE IKsDataTypeHandler
  428. DECLARE_INTERFACE_(IKsDataTypeHandler, IUnknown)
  429. {
  430.     STDMETHOD(KsCompleteIoOperation)(
  431.         THIS_
  432.         IMediaSample *Sample,
  433.         PVOID StreamHeader,
  434.         KSIOOPERATION IoOperation,
  435.         BOOL Cancelled
  436.     ) PURE;
  437.     STDMETHOD(KsIsMediaTypeInRanges)(
  438.         THIS_
  439.         PVOID DataRanges
  440.         ) PURE;
  441.     STDMETHOD(KsPrepareIoOperation)(
  442.         THIS_
  443.         IMediaSample *Sample,
  444.         PVOID StreamHeader,
  445.         KSIOOPERATION IoOperation
  446.     ) PURE;
  447.     STDMETHOD(KsQueryExtendedSize)(
  448.         THIS_
  449.         ULONG* ExtendedSize
  450.     ) PURE;
  451.     STDMETHOD(KsSetMediaType)(
  452.         THIS_
  453.         const AM_MEDIA_TYPE* AmMediaType
  454.     ) PURE;
  455. };
  456. interface DECLSPEC_UUID("827D1A0E-0F73-11D2-B27A-00A0C9223196") IKsDataTypeCompletion;
  457. #undef INTERFACE
  458. #define INTERFACE IKsDataTypeCompletion
  459. DECLARE_INTERFACE_(IKsDataTypeCompletion, IUnknown)
  460. {
  461.     STDMETHOD(KsCompleteMediaType)(
  462.         THIS_
  463.         HANDLE FilterHandle,
  464.         ULONG PinFactoryId,
  465.         AM_MEDIA_TYPE* AmMediaType
  466.     ) PURE;
  467. };
  468. interface DECLSPEC_UUID("D3ABC7E0-9A61-11d0-A40D-00A0C9223196") IKsInterfaceHandler;
  469. #undef INTERFACE
  470. #define INTERFACE IKsInterfaceHandler
  471. DECLARE_INTERFACE_(IKsInterfaceHandler, IUnknown)
  472. {
  473.     STDMETHOD(KsSetPin)(
  474.         THIS_
  475.         IKsPin *KsPin
  476.     ) PURE;
  477.     STDMETHOD(KsProcessMediaSamples)(
  478.         THIS_
  479.         IKsDataTypeHandler *KsDataTypeHandler,
  480.         IMediaSample** SampleList,
  481.         PLONG SampleCount,
  482.         KSIOOPERATION IoOperation,
  483.         PKSSTREAM_SEGMENT *StreamSegment
  484.     ) PURE;
  485.     STDMETHOD(KsCompleteIo)(
  486.         THIS_
  487.         PKSSTREAM_SEGMENT StreamSegment
  488.     ) PURE;
  489. };
  490. //
  491. // This structure definition is the common header required by the proxy to 
  492. // dispatch the stream segment to the interface handler.  Interface handlers 
  493. // will create extended structures to include other information such as 
  494. // media samples, extended header size and so on.
  495. //
  496. typedef struct _KSSTREAM_SEGMENT {
  497.     IKsInterfaceHandler     *KsInterfaceHandler;
  498.     IKsDataTypeHandler      *KsDataTypeHandler;
  499.     KSIOOPERATION           IoOperation;
  500.     HANDLE                  CompletionEvent;
  501.     
  502. } KSSTREAM_SEGMENT;
  503. interface DECLSPEC_UUID("423c13a2-2070-11d0-9ef7-00aa00a216a1") IKsObject;
  504. #undef INTERFACE
  505. #define INTERFACE IKsObject
  506. DECLARE_INTERFACE_(IKsObject, IUnknown)
  507. {
  508.     STDMETHOD_(HANDLE, KsGetObjectHandle)(
  509.         THIS
  510.     ) PURE;
  511. };
  512. interface DECLSPEC_UUID("97ebaacb-95bd-11d0-a3ea-00a0c9223196") IKsQualityForwarder;
  513. #undef INTERFACE
  514. #define INTERFACE IKsQualityForwarder
  515. DECLARE_INTERFACE_(IKsQualityForwarder, IKsObject)
  516. {
  517.     STDMETHOD_(VOID, KsFlushClient)(
  518.         THIS_
  519.         IKsPin* Pin
  520.     ) PURE;
  521. };
  522. KSDDKAPI
  523. HRESULT
  524. WINAPI
  525. KsResolveRequiredAttributes(
  526.     PKSDATARANGE DataRange,
  527.     PKSMULTIPLE_ITEM Attributes OPTIONAL
  528.     );
  529. KSDDKAPI
  530. HRESULT
  531. WINAPI
  532. KsOpenDefaultDevice(
  533.     REFGUID Category,
  534.     ACCESS_MASK Access,
  535.     PHANDLE DeviceHandle
  536.     );
  537. KSDDKAPI
  538. HRESULT
  539. WINAPI
  540. KsSynchronousDeviceControl(
  541.     HANDLE      Handle,
  542.     ULONG       IoControl,
  543.     PVOID       InBuffer,
  544.     ULONG       InLength,
  545.     PVOID       OutBuffer,
  546.     ULONG       OutLength,
  547.     PULONG      BytesReturned
  548.     );
  549. KSDDKAPI
  550. HRESULT
  551. WINAPI
  552. KsGetMultiplePinFactoryItems(
  553.     HANDLE  FilterHandle,
  554.     ULONG   PinFactoryId,
  555.     ULONG   PropertyId,
  556.     PVOID*  Items
  557.     );
  558. KSDDKAPI
  559. HRESULT
  560. WINAPI
  561. KsGetMediaTypeCount(
  562.     HANDLE      FilterHandle,
  563.     ULONG       PinFactoryId,
  564.     ULONG*      MediaTypeCount
  565.     );
  566. KSDDKAPI
  567. HRESULT
  568. WINAPI
  569. KsGetMediaType(
  570.     int         Position,
  571.     AM_MEDIA_TYPE* AmMediaType,
  572.     HANDLE      FilterHandle,
  573.     ULONG       PinFactoryId
  574.     );
  575. #endif // __STREAMS__
  576. #ifndef _IKsPropertySet_
  577. #if !defined(__cplusplus) || _MSC_VER < 1100
  578. DEFINE_GUIDEX(IID_IKsPropertySet);
  579. #endif // !defined(__cplusplus) || _MSC_VER < 1100
  580. #endif // _IKsPropertySet_
  581. #ifndef _IKsControl_
  582. #if !defined(__cplusplus) || _MSC_VER < 1100
  583. DEFINE_GUIDEX(IID_IKsControl);
  584. #endif // !defined(__cplusplus) || _MSC_VER < 1100
  585. #endif // _IKsControl_
  586. #if !defined(__cplusplus) || _MSC_VER < 1100
  587. DEFINE_GUIDEX(IID_IKsAggregateControl);
  588. #endif // !defined(__cplusplus) || _MSC_VER < 1100
  589. #ifndef _IKsTopology_
  590. #if !defined(__cplusplus) || _MSC_VER < 1100
  591. DEFINE_GUIDEX(IID_IKsTopology);
  592. #endif // !defined(__cplusplus) || _MSC_VER < 1100
  593. #endif // _IKsTopology_
  594. DEFINE_GUIDSTRUCT("17CCA71B-ECD7-11D0-B908-00A0C9223196", CLSID_Proxy);
  595. #define CLSID_Proxy DEFINE_GUIDNAMED(CLSID_Proxy)
  596. #else // !_KS_
  597. #ifndef _IKsPropertySet_
  598. #if !defined(__cplusplus) || _MSC_VER < 1100
  599. DEFINE_GUID(IID_IKsPropertySet, STATIC_IID_IKsPropertySet);
  600. #endif // !defined(__cplusplus) || _MSC_VER < 1100
  601. #endif // _IKsPropertySet_
  602. #if !defined(__cplusplus) || _MSC_VER < 1100
  603. DEFINE_GUID(CLSID_Proxy, STATIC_CLSID_Proxy);
  604. #else  // defined(__cplusplus) && _MSC_VER >= 1100
  605. DECLSPEC_UUID("17CCA71B-ECD7-11D0-B908-00A0C9223196") CLSID_Proxy;
  606. #endif  // defined(__cplusplus) && _MSC_VER >= 1100
  607. #endif // !_KS_
  608. #ifndef _IKsPropertySet_
  609. #define _IKsPropertySet_
  610. #define KSPROPERTY_SUPPORT_GET 1
  611. #define KSPROPERTY_SUPPORT_SET 2
  612. #ifdef DECLARE_INTERFACE_
  613. interface DECLSPEC_UUID("31EFAC30-515C-11d0-A9AA-00aa0061be93") IKsPropertySet;
  614. #undef INTERFACE
  615. #define INTERFACE IKsPropertySet
  616. DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
  617. {
  618.     STDMETHOD(Set)(
  619.         THIS_
  620.         IN REFGUID PropSet,
  621.         IN ULONG Id,
  622.         IN LPVOID InstanceData,
  623.         IN ULONG InstanceLength,
  624.         IN LPVOID PropertyData,
  625.         IN ULONG DataLength
  626.     ) PURE;
  627.     STDMETHOD(Get)(
  628.         THIS_
  629.         IN REFGUID PropSet,
  630.         IN ULONG Id,
  631.         IN LPVOID InstanceData,
  632.         IN ULONG InstanceLength,
  633.         OUT LPVOID PropertyData,
  634.         IN ULONG DataLength,
  635.         OUT ULONG* BytesReturned
  636.     ) PURE;
  637.     STDMETHOD(QuerySupported)(
  638.         THIS_
  639.         IN REFGUID PropSet,
  640.         IN ULONG Id,
  641.         OUT ULONG* TypeSupport
  642.     ) PURE;
  643. };
  644. #endif // DECLARE_INTERFACE_
  645. #endif // _IKsPropertySet_
  646. #ifndef _IKsControl_
  647. #define _IKsControl_
  648. #ifdef DECLARE_INTERFACE_
  649. interface DECLSPEC_UUID("28F54685-06FD-11D2-B27A-00A0C9223196") IKsControl;
  650. #undef INTERFACE
  651. #define INTERFACE IKsControl
  652. DECLARE_INTERFACE_(IKsControl, IUnknown)
  653. {
  654.     STDMETHOD(KsProperty)(
  655.         THIS_
  656.         IN PKSPROPERTY Property,
  657.         IN ULONG PropertyLength,
  658.         IN OUT LPVOID PropertyData,
  659.         IN ULONG DataLength,
  660.         OUT ULONG* BytesReturned
  661.     ) PURE;
  662.     STDMETHOD(KsMethod)(
  663.         THIS_
  664.         IN PKSMETHOD Method,
  665.         IN ULONG MethodLength,
  666.         IN OUT LPVOID MethodData,
  667.         IN ULONG DataLength,
  668.         OUT ULONG* BytesReturned
  669.     ) PURE;
  670.     STDMETHOD(KsEvent)(
  671.         THIS_
  672.         IN PKSEVENT Event OPTIONAL,
  673.         IN ULONG EventLength,
  674.         IN OUT LPVOID EventData,
  675.         IN ULONG DataLength,
  676.         OUT ULONG* BytesReturned
  677.     ) PURE;
  678. };
  679. #endif // DECLARE_INTERFACE_
  680. #endif // _IKsControl_
  681. #ifdef DECLARE_INTERFACE_
  682. interface DECLSPEC_UUID("7F40EAC0-3947-11D2-874E-00A0C9223196") IKsAggregateControl;
  683. #undef INTERFACE
  684. #define INTERFACE IKsAggregateControl
  685. DECLARE_INTERFACE_(IKsAggregateControl, IUnknown)
  686. {
  687.     STDMETHOD(KsAddAggregate)(
  688.         THIS_
  689.         IN REFGUID AggregateClass
  690.     ) PURE;
  691.     STDMETHOD(KsRemoveAggregate)(
  692.         THIS_
  693.         IN REFGUID AggregateClass
  694.     ) PURE;
  695. };
  696. #endif // DECLARE_INTERFACE_
  697. #ifndef _IKsTopology_
  698. #define _IKsTopology_
  699. #ifdef DECLARE_INTERFACE_
  700. interface DECLSPEC_UUID("28F54683-06FD-11D2-B27A-00A0C9223196") IKsTopology;
  701. #undef INTERFACE
  702. #define INTERFACE IKsTopology
  703. DECLARE_INTERFACE_(IKsTopology, IUnknown)
  704. {
  705.     STDMETHOD(CreateNodeInstance)(
  706.         THIS_
  707.         IN ULONG NodeId,
  708.         IN ULONG Flags,
  709.         IN ACCESS_MASK DesiredAccess,
  710.         IN IUnknown* UnkOuter OPTIONAL,
  711.         IN REFGUID InterfaceId,
  712.         OUT LPVOID* Interface
  713.     ) PURE;
  714. };
  715. #endif // DECLARE_INTERFACE_
  716. #endif // _IKsTopology_
  717. #ifdef __cplusplus
  718. }
  719. #endif // __cplusplus
  720. #endif // __KSPROXY__