ReactOS 0.4.15-dev-7705-g2320c37
miniport.h
Go to the documentation of this file.
1#ifndef _MINIPORT_H_
2#define _MINIPORT_H_
3
4#ifndef PPORT_
5 #define PPORT_ PPORT
6 #define PPORTSTREAM_ PUNKNOWN
7#endif
8
9/*****************************************************************************
10 * Constants
11 *****************************************************************************
12 */
15
17 {48000, 44100, 32000, 22050, 16000, 11025, 8000};
19 {48000, 32000, 16000, 8000};
20
22const int PIN_WAVEIN_OFFSET = (PIN_WAVEIN / 2);
23const int PIN_MICIN_OFFSET = (PIN_MICIN / 2);
24
25class CMiniportStream;
26class CMiniport : public IPowerNotify
27{
28public:
30 PPORT_ Port; // Port driver object.
31 PADAPTERCOMMON AdapterCommon; // Adapter common object.
32 PINTERRUPTSYNC InterruptSync; // Interrupt Sync.
33 PDMACHANNEL DmaChannel; // Bus master support.
34 DEVICE_POWER_STATE m_PowerState; // advanced power control.
35 DWORD m_dwChannelMask; // Channel config for speaker positions.
36 WORD m_wChannels; // Number of channels.
37
38 /*************************************************************************
39 * CMiniportWaveICH methods
40 *************************************************************************
41 * These are private member functions used internally by the object. See
42 * MINWAVE.CPP for specific descriptions.
43 */
44
45 //
46 // Checks and connects the miniport to the resources.
47 //
49 (
51 );
52
53 //
54 // Tests the data format but not the sample rate.
55 //
57 (
60 );
61
63 (
66 );
67
68 // Test for standard sample rate support and fill the data range information
69 // in the structures below.
71
73
74 //
75 // IPowerNotify methods
76 //
78
79 //
80 // This static functions is the interrupt service routine which is
81 // not stream related, but services all streams at once.
82 //
84 (
86 IN PVOID StaticContext
87 );
88
89public:
90
91 ~CMiniport();
92
94 (
95 _In_ PUNKNOWN UnknownAdapter,
98 );
99
100 //
101 // This is the property handler for KSPROPERTY_AUDIO_CHANNEL_CONFIG of the
102 // DAC node.
103 //
105 (
106 IN PPCPROPERTY_REQUEST PropertyRequest
107 );
108
109
111 (
114 _In_ REFIID iMiniPort,
115 _In_ PMINIPORT miniPort
116 );
117};
118
119#define IMP_CMiniport(cType, IID) \
120STDMETHODIMP_(NTSTATUS) cType::GetDescription( \
121 _Out_ PPCFILTER_DESCRIPTOR *OutFilterDescriptor)\
122{ return CMiniport::GetDescription(OutFilterDescriptor); } \
123 \
124STDMETHODIMP_(NTSTATUS) cType::DataRangeIntersection( \
125 IN ULONG PinId, \
126 IN PKSDATARANGE DataRange, \
127 IN PKSDATARANGE MatchingDataRange, \
128 IN ULONG OutputBufferLength, \
129 OUT PVOID ResultantFormat OPTIONAL, \
130 OUT PULONG ResultantFormatLength) \
131{ return CMiniport::DataRangeIntersection(PinId, DataRange, \
132 MatchingDataRange, OutputBufferLength, ResultantFormat, \
133 ResultantFormatLength); } \
134STDMETHODIMP_(NTSTATUS) cType::NonDelegatingQueryInterface( \
135 _In_ REFIID Interface, \
136 _COM_Outptr_ PVOID *Object) \
137{ return CMiniport::NonDelegatingQueryInterface( \
138 Interface, Object, IID, (PMINIPORT)this); }
139
140
142void __fastcall obj_Release(void **ppvObject);
143
144#include "stream.h"
145#endif
LONG NTSTATUS
Definition: precomp.h:26
DWORD m_dwChannelMask
Definition: miniport.h:35
STDMETHODIMP_(NTSTATUS) Init(_In_ PUNKNOWN UnknownAdapter
NTSTATUS ProcessResources(IN PRESOURCELIST ResourceList)
Definition: miniport.cpp:1075
IMP_IPowerNotify
Definition: miniport.h:77
PINTERRUPTSYNC InterruptSync
Definition: miniport.h:32
NTSTATUS BuildDataRangeInformation(void)
Definition: miniport.cpp:401
CMiniportStream * Streams[PIN_MICIN_OFFSET+1]
Definition: miniport.h:29
DEVICE_POWER_STATE m_PowerState
Definition: miniport.h:34
NTSTATUS ValidateFormat(IN PKSDATAFORMAT DataFormat, IN WavePins Pin)
Definition: miniport.cpp:781
PADAPTERCOMMON AdapterCommon
Definition: miniport.h:31
WORD m_wChannels
Definition: miniport.h:36
NTSTATUS TestDataFormat(IN PKSDATAFORMAT Format, IN WavePins Pin)
Definition: miniport.cpp:827
PDMACHANNEL DmaChannel
Definition: miniport.h:33
static NTSTATUS NTAPI PropertyChannelConfig(IN PPCPROPERTY_REQUEST PropertyRequest)
Definition: miniport.cpp:314
static NTSTATUS NTAPI InterruptServiceRoutine(IN PINTERRUPTSYNC InterruptSync, IN PVOID StaticContext)
Definition: miniport.cpp:1315
NTSTATUS NonDelegatingQueryInterface(_In_ REFIID Interface, _COM_Outptr_ PVOID *Object, _In_ REFIID iMiniPort, _In_ PMINIPORT miniPort)
Definition: miniport.cpp:1144
_In_ PRESOURCELIST _In_ PPORT Port_
Definition: miniport.h:98
IMP_IMiniport
Definition: miniport.h:72
PPORT_ Port
Definition: miniport.h:30
#define PPORT_
Definition: miniport.h:5
void __fastcall obj_AddRef(PUNKNOWN obj, void **ppvObject)
Definition: miniport.cpp:1264
const DWORD dwMicSampleRates[MIC_SAMPLERATES_TESTED]
Definition: miniport.h:18
const int PIN_WAVEIN_OFFSET
Definition: miniport.h:22
const int MIC_SAMPLERATES_TESTED
Definition: miniport.h:14
void __fastcall obj_Release(void **ppvObject)
Definition: miniport.cpp:1273
const DWORD dwWaveSampleRates[WAVE_SAMPLERATES_TESTED]
Definition: miniport.h:16
const int WAVE_SAMPLERATES_TESTED
Definition: miniport.h:13
const int PIN_MICIN_OFFSET
Definition: miniport.h:23
const int PIN_WAVEOUT_OFFSET
Definition: miniport.h:21
WavePins
Definition: shared.h:317
@ PIN_MICIN
Definition: shared.h:322
@ PIN_WAVEOUT
Definition: shared.h:318
@ PIN_WAVEIN
Definition: shared.h:320
IAC97AdapterCommon * PADAPTERCOMMON
Definition: shared.h:488
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define __fastcall
Definition: sync.c:38
#define _COM_Outptr_
Definition: ms_sal.h:449
#define _In_
Definition: ms_sal.h:308
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
IDmaChannel * PDMACHANNEL
Definition: portcls.h:784
IInterruptSync * PINTERRUPTSYNC
Definition: portcls.h:888
IResourceList * PRESOURCELIST
Definition: portcls.h:442
IPort * PPORT
Definition: portcls.h:1105
#define REFIID
Definition: guiddef.h:118
Console I/O streams.
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082