ReactOS 0.4.15-dev-7918-g2a2556c
wavepcistream.cpp File Reference
#include "wavepciminiport.h"
#include "wavepcistream.h"
Include dependency graph for wavepcistream.cpp:

Go to the source code of this file.

Macros

#define STR_MODULENAME   "AC97 Stream: "
 

Functions

 IMP_CMiniportStream_SetFormat (CMiniportWaveICHStream)
 
 IMP_CMiniportStream_QueryInterface (CMiniportWaveICHStream, IMiniportWavePciStream)
 
NTSTATUS CreateMiniportWaveICHStream (OUT CMiniportWaveICHStream **MiniportPCIStream, IN PUNKNOWN pUnknownOuter, _When_((PoolType &NonPagedPoolMustSucceed) !=0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) IN POOL_TYPE PoolType)
 
 STDMETHODIMP_ (NTSTATUS) CMiniportWaveICHStream
 
 STDMETHODIMP_ (void) CMiniportWaveICHStream
 

Macro Definition Documentation

◆ STR_MODULENAME

#define STR_MODULENAME   "AC97 Stream: "

Definition at line 11 of file wavepcistream.cpp.

Function Documentation

◆ CreateMiniportWaveICHStream()

NTSTATUS CreateMiniportWaveICHStream ( OUT CMiniportWaveICHStream **  MiniportPCIStream,
IN PUNKNOWN  pUnknownOuter,
_When_((PoolType &NonPagedPoolMustSucceed) !=0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) IN POOL_TYPE  PoolType 
)

Definition at line 38 of file wavepcistream.cpp.

47{
48 PAGED_CODE ();
49
50 DOUT (DBG_PRINT, ("[CreateMiniportWaveICHStream]"));
51
52 //
53 // This is basically like the macro at stdunk with the change that we
54 // don't cast to interface unknown but to interface MiniportIchStream.
55 //
56 *MiniportPCIStream = new (PoolType, PoolTag)
57 CMiniportWaveICHStream (pUnknownOuter);
58 if (*MiniportPCIStream)
59 {
60 (*MiniportPCIStream)->AddRef ();
61 return STATUS_SUCCESS;
62 }
63
65}
#define PAGED_CODE()
#define DOUT(lvl, strings)
Definition: debug.h:82
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164
#define DBG_PRINT(ppi, ch, level)
Definition: win32kdebug.h:168

◆ IMP_CMiniportStream_QueryInterface()

IMP_CMiniportStream_QueryInterface ( CMiniportWaveICHStream  ,
IMiniportWavePciStream   
)

◆ IMP_CMiniportStream_SetFormat()

IMP_CMiniportStream_SetFormat ( CMiniportWaveICHStream  )

◆ STDMETHODIMP_() [1/2]

STDMETHODIMP_ ( NTSTATUS  )

Definition at line 148 of file wavepcistream.cpp.

152{
153 PAGED_CODE ();
154
155 ULONG SampleSize;
156
157 DOUT (DBG_PRINT, ("[CMiniportWaveICHStream::GetAllocatorFraming]"));
158
159 //
160 // Determine sample size in bytes. Always number of
161 // channels * 2 (because 16-bit).
162 //
163 SampleSize = DataFormat->WaveFormatEx.nChannels * 2;
164
165 //
166 // Report the suggested requirements.
167 //
172
173 //
174 // Currently, arbitrarily selecting 10ms as the frame target size.
175 //
176 // This value needs to be sample block aligned for AC97 to work correctly.
177 // Assumes 100Hz minimum sample rate (otherwise FrameSize is 0 bytes)
178 //
179 AllocatorFraming->FrameSize = SampleSize * (DataFormat->WaveFormatEx.nSamplesPerSec / 100);
182
183 return STATUS_SUCCESS;
184}
#define NonPagedPool
Definition: env_spec_w32.h:307
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
Definition: ks.h:4518
#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY
Definition: ks.h:1685
#define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY
Definition: ks.h:1688
#define FILE_LONG_ALIGNMENT
Definition: nt_native.h:788
ULONG PoolType
Definition: ks.h:1668
ULONG RequirementsFlags
Definition: ks.h:1663
ULONG Frames
Definition: ks.h:1670
ULONG FileAlignment
Definition: ks.h:1672
ULONG FrameSize
Definition: ks.h:1671
uint32_t ULONG
Definition: typedefs.h:59

◆ STDMETHODIMP_() [2/2]

STDMETHODIMP_ ( void  )

Definition at line 331 of file wavepcistream.cpp.

332{
333
334 DOUT (DBG_PRINT, ("Service"));
335
336 // release all mappings
337 ReleaseUsedMappings ();
338
339 // get new mappings
340 GetNewMappings ();
341}