ReactOS 0.4.15-dev-7918-g2a2556c
CMiniportWaveCMI Class Reference

#include <minwave.hpp>

Inheritance diagram for CMiniportWaveCMI:
Collaboration diagram for CMiniportWaveCMI:

Public Member Functions

 DECLARE_STD_UNKNOWN ()
 
 DEFINE_STD_CONSTRUCTOR (CMiniportWaveCMI)
 
 ~CMiniportWaveCMI ()
 
 STDMETHODIMP_ (void) ServiceWaveISR(UInt32 streamIndex)
 
 STDMETHODIMP_ (void) powerUp()
 
 STDMETHODIMP_ (void) powerDown()
 

Public Attributes

 IMP_IMiniportWaveCyclic
 
- Public Attributes inherited from CUnknown
union {
   IUnknown   IUnknown
 
   INonDelegatingUnknown   INonDelegatingUnknown
 
}; 
 
LONG m_ref_count
 
PUNKNOWN m_outer_unknown
 

Private Member Functions

NTSTATUS processResources (PRESOURCELIST resourceList)
 
NTSTATUS isFormatAllowed (UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
 
NTSTATUS validateFormat (PKSDATAFORMAT format, ULONG PinID, BOOLEAN capture)
 
NTSTATUS newDMAChannel (PDMACHANNEL *dmaChannel, UInt32 bufferLength)
 
NTSTATUS loadChannelConfigFromRegistry ()
 
NTSTATUS storeChannelConfigToRegistry ()
 

Private Attributes

PCMIADAPTER CMIAdapter
 
PPORTWAVECYCLIC Port
 
PDMACHANNEL DMAChannel [3]
 
UInt32 notificationInterval
 
CMI8738Infocm
 
UInt32 requestedChannelCount
 
UInt32 requestedChannelMask
 
CMiniportWaveStreamCMIstream [3]
 
bool isStreamRunning [3]
 
KMUTEX mutex
 

Friends

class CMiniportWaveStreamCMI
 
NTSTATUS NTAPI PropertyHandler_ChannelConfig (PPCPROPERTY_REQUEST PropertyRequest)
 

Detailed Description

Definition at line 38 of file minwave.hpp.

Constructor & Destructor Documentation

◆ ~CMiniportWaveCMI()

CMiniportWaveCMI::~CMiniportWaveCMI ( void  )

Definition at line 116 of file minwave.cpp.

117{
118 PAGED_CODE();
119 DBGPRINT(("CMiniportWaveCMI[%p]::~CMiniportWaveCMI", this));
120
121 storeChannelConfigToRegistry(); //or not. during system shutdown, this doesn't seem to work.
122
123 if (CMIAdapter) {
124 CMIAdapter->Release();
126 }
127
128 for (int i=0;i<3;i++) {
129#ifndef WAVERT
130 if (DMAChannel[i]) {
131 DMAChannel[i]->Release();
132 DMAChannel[i] = NULL;
133 }
134#endif
135 if (isStreamRunning[i]) {
136 isStreamRunning[i] = false;
137 stream[i]->Release();
138 stream[i] = NULL;
139 }
140 }
141
142 if (Port) {
143 Port->Release();
144 Port = NULL;
145 }
146}
#define PAGED_CODE()
#define DBGPRINT(...)
Definition: pdo.c:21
PDMACHANNEL DMAChannel[3]
Definition: minwave.hpp:53
bool isStreamRunning[3]
Definition: minwave.hpp:62
PCMIADAPTER CMIAdapter
Definition: minwave.hpp:48
PPORTWAVECYCLIC Port
Definition: minwave.hpp:52
NTSTATUS storeChannelConfigToRegistry()
Definition: minwave.cpp:294
#define NULL
Definition: types.h:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: parse.h:23

Member Function Documentation

◆ DECLARE_STD_UNKNOWN()

CMiniportWaveCMI::DECLARE_STD_UNKNOWN ( )

◆ DEFINE_STD_CONSTRUCTOR()

CMiniportWaveCMI::DEFINE_STD_CONSTRUCTOR ( CMiniportWaveCMI  )

◆ isFormatAllowed()

NTSTATUS CMiniportWaveCMI::isFormatAllowed ( UInt32  sampleRate,
BOOLEAN  multiChan,
BOOLEAN  AC3 
)
private

Definition at line 380 of file minwave.cpp.

381{
382 PAGED_CODE();
383 ASSERT(sampleRate);
384 DBGPRINT(("CMiniportWaveCMI[%p]::isFormatAllowed(%d, %d, %d)", this, sampleRate, multiChan, AC3));
385
386 if (multiChan) {
387 switch (sampleRate) {
388 case 44100: if (cm->formatMask & FMT_441_MULTI_PCM) return STATUS_SUCCESS; break;
389 case 48000: if (cm->formatMask & FMT_480_MULTI_PCM) return STATUS_SUCCESS; break;
390 case 88200: if (cm->formatMask & FMT_882_MULTI_PCM) return STATUS_SUCCESS; break;
391 case 96000: if (cm->formatMask & FMT_960_MULTI_PCM) return STATUS_SUCCESS; break;
392 }
394 }
395 if (AC3) {
396 switch (sampleRate) {
397 case 44100: if (cm->formatMask & FMT_441_DOLBY) return STATUS_SUCCESS; break;
398 case 48000: if (cm->formatMask & FMT_480_DOLBY) return STATUS_SUCCESS; break;
399 case 88200: if (cm->formatMask & FMT_882_DOLBY) return STATUS_SUCCESS; break;
400 case 96000: if (cm->formatMask & FMT_960_DOLBY) return STATUS_SUCCESS; break;
401 }
403 }
404 switch (sampleRate) {
405 case 44100: if (cm->formatMask & FMT_441_PCM) return STATUS_SUCCESS; break;
406 case 48000: if (cm->formatMask & FMT_480_PCM) return STATUS_SUCCESS; break;
407 case 88200: if (cm->formatMask & FMT_882_PCM) return STATUS_SUCCESS; break;
408 case 96000: if (cm->formatMask & FMT_960_PCM) return STATUS_SUCCESS; break;
409 }
411}
CMI8738Info * cm
Definition: minwave.hpp:56
#define ASSERT(a)
Definition: mode.c:44
#define FMT_960_MULTI_PCM
Definition: property.h:49
#define FMT_480_PCM
Definition: property.h:43
#define FMT_441_MULTI_PCM
Definition: property.h:46
#define FMT_882_DOLBY
Definition: property.h:52
#define FMT_480_DOLBY
Definition: property.h:51
#define FMT_441_PCM
Definition: property.h:42
#define FMT_960_DOLBY
Definition: property.h:53
#define FMT_480_MULTI_PCM
Definition: property.h:47
#define FMT_882_PCM
Definition: property.h:44
#define FMT_441_DOLBY
Definition: property.h:50
#define FMT_960_PCM
Definition: property.h:45
#define FMT_882_MULTI_PCM
Definition: property.h:48
#define STATUS_SUCCESS
Definition: shellext.h:65
UInt32 formatMask
Definition: interfaces.hpp:148
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

Referenced by validateFormat().

◆ loadChannelConfigFromRegistry()

NTSTATUS CMiniportWaveCMI::loadChannelConfigFromRegistry ( )
private

Definition at line 232 of file minwave.cpp.

233{
234 PAGED_CODE();
235 PREGISTRYKEY DriverKey;
236 PREGISTRYKEY SettingsKey;
239 PVOID KeyInfo;
240
241 DBGPRINT(("CMiniportWaveCMI::loadChannelConfigFromRegistry()"));
242
243 if ((!CMIAdapter) || (!(CMIAdapter->getDeviceObject()))) {
244 return STATUS_UNSUCCESSFUL;
245 }
246
247 NTSTATUS ntStatus = PcNewRegistryKey(&DriverKey, NULL, DriverRegistryKey, KEY_ALL_ACCESS, CMIAdapter->getDeviceObject(), NULL, NULL, 0, NULL);
248
249 if(!NT_SUCCESS(ntStatus)) {
250 DBGPRINT(("PcNewRegistryKey() failed"));
251 return STATUS_UNSUCCESSFUL;
252 }
253
254 RtlInitUnicodeString(&KeyName, L"Settings");
255
256 ntStatus = DriverKey->NewSubKey(&SettingsKey, NULL, KEY_ALL_ACCESS, &KeyName, REG_OPTION_NON_VOLATILE, NULL);
257 if(!NT_SUCCESS(ntStatus)) {
258 DBGPRINT(("DriverKey->NewSubKey() failed"));
259 return STATUS_UNSUCCESSFUL;
260 }
261
262 KeyInfo = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), 'gnaa');
263 if (KeyInfo) {
264 RtlInitUnicodeString(&KeyName, L"ChannelCount");
265 ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
266 if (NT_SUCCESS (ntStatus)) {
268 if (PartialInfo->DataLength == sizeof(DWORD)) {
269 requestedChannelCount = (*(PLONG)PartialInfo->Data);
270 }
271 } else {
273 }
274
275 RtlInitUnicodeString(&KeyName, L"ChannelMask");
276 ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
277 if (NT_SUCCESS (ntStatus)) {
279 if (PartialInfo->DataLength == sizeof(DWORD)) {
280 requestedChannelMask = (*(PLONG)PartialInfo->Data);
281 }
282 } else {
284 }
285 }
286 ExFreePoolWithTag(KeyInfo,'gnaa');
287
288 SettingsKey->Release();
289 DriverKey->Release();
290
291 return STATUS_SUCCESS;
292}
LONG NTSTATUS
Definition: precomp.h:26
UInt32 requestedChannelMask
Definition: minwave.hpp:58
UInt32 requestedChannelCount
Definition: minwave.hpp:57
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI PcNewRegistryKey(OUT PREGISTRYKEY *OutRegistryKey, IN PUNKNOWN OuterUnknown OPTIONAL, IN ULONG RegistryKeyType, IN ACCESS_MASK DesiredAccess, IN PVOID DeviceObject OPTIONAL, IN PVOID SubDevice OPTIONAL, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG CreateOptions OPTIONAL, OUT PULONG Disposition OPTIONAL)
Definition: registry.cpp:264
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KSAUDIO_SPEAKER_STEREO
Definition: ksmedia.h:1454
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
@ KeyValuePartialInformation
Definition: nt_native.h:1182
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
#define L(x)
Definition: ntvdm.h:50
IRegistryKey * PREGISTRYKEY
Definition: portcls.h:1009
@ DriverRegistryKey
Definition: portcls.h:902
int32_t * PLONG
Definition: typedefs.h:58
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699

◆ newDMAChannel()

NTSTATUS CMiniportWaveCMI::newDMAChannel ( PDMACHANNEL dmaChannel,
UInt32  bufferLength 
)
private

Definition at line 61 of file minwave.cpp.

62{
63 PAGED_CODE();
64 ASSERT(dmaChannel);
65 DBGPRINT(("CMiniportWaveCMI[%p]::newDMAChannel(%p)", this, dmaChannel));
66
67 NTSTATUS ntStatus;
68
69 ntStatus = Port->NewMasterDmaChannel(dmaChannel, NULL, NULL, bufferLength, TRUE, FALSE, (DMA_WIDTH)(-1), (DMA_SPEED)(-1));
70 if (NT_SUCCESS(ntStatus)) {
71 ULONG lDMABufferLength = bufferLength;
72 do {
73 ntStatus = (*dmaChannel)->AllocateBuffer(lDMABufferLength, NULL);
74 lDMABufferLength >>= 1;
75 } while (!NT_SUCCESS(ntStatus) && (lDMABufferLength > (PAGE_SIZE / 2)));
76 }
77 return ntStatus;
78}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define PAGE_SIZE
Definition: env_spec_w32.h:49
enum _DMA_SPEED DMA_SPEED
enum _DMA_WIDTH DMA_WIDTH
uint32_t ULONG
Definition: typedefs.h:59
_In_opt_ PVOID _In_ ULONG bufferLength
Definition: wdfdriver.h:109

◆ processResources()

NTSTATUS CMiniportWaveCMI::processResources ( PRESOURCELIST  resourceList)
private

Definition at line 47 of file minwave.cpp.

48{
49 PAGED_CODE();
50 ASSERT (resourceList);
51 DBGPRINT(("CMiniportWaveCMI[%p]::ProcessResources(%p)", this, resourceList));
52
53 if (resourceList->NumberOfInterrupts() < 1) {
54 DBGPRINT(("Unknown configuration for wave miniport"));
56 }
57 return STATUS_SUCCESS;
58}
#define STATUS_DEVICE_CONFIGURATION_ERROR
Definition: ntstatus.h:619

◆ STDMETHODIMP_() [1/3]

CMiniportWaveCMI::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [2/3]

CMiniportWaveCMI::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [3/3]

CMiniportWaveCMI::STDMETHODIMP_ ( void  )

◆ storeChannelConfigToRegistry()

NTSTATUS CMiniportWaveCMI::storeChannelConfigToRegistry ( )
private

Definition at line 294 of file minwave.cpp.

295{
296 PAGED_CODE();
297 PREGISTRYKEY DriverKey;
298 PREGISTRYKEY SettingsKey;
300 DWORD Value;
301 DBGPRINT(("CMiniportWaveCMI::storeChannelConfigToRegistry()"));
302
303 if ((!CMIAdapter) || (!(CMIAdapter->getDeviceObject()))) {
304 return STATUS_UNSUCCESSFUL;
305 }
306
307 NTSTATUS ntStatus = PcNewRegistryKey(&DriverKey, NULL, DriverRegistryKey, KEY_ALL_ACCESS, CMIAdapter->getDeviceObject(), NULL, NULL, 0, NULL);
308
309 if(!NT_SUCCESS(ntStatus)) {
310 DBGPRINT(("PcNewRegistryKey() failed"));
311 return STATUS_UNSUCCESSFUL;
312 }
313
314 RtlInitUnicodeString(&KeyName, L"Settings");
315
316 ntStatus = DriverKey->NewSubKey(&SettingsKey, NULL, KEY_ALL_ACCESS, &KeyName, REG_OPTION_NON_VOLATILE, NULL);
317 if(!NT_SUCCESS(ntStatus)) {
318 DBGPRINT(("DriverKey->NewSubKey() failed"));
319 return STATUS_UNSUCCESSFUL;
320 }
321
323 RtlInitUnicodeString(&KeyName, L"ChannelCount");
324 ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
325 if (!NT_SUCCESS(ntStatus)) {
326 DBGPRINT(("SetValueKey() failed"));
327 }
329 RtlInitUnicodeString(&KeyName, L"ChannelMask");
330 ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
331 if (!NT_SUCCESS(ntStatus)) {
332 DBGPRINT(("SetValueKey() failed"));
333 }
334
335 SettingsKey->Release();
336 DriverKey->Release();
337
338 return STATUS_SUCCESS;
339}
#define REG_DWORD
Definition: sdbapi.c:596
void * PVOID
Definition: typedefs.h:50
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by ~CMiniportWaveCMI().

◆ validateFormat()

NTSTATUS CMiniportWaveCMI::validateFormat ( PKSDATAFORMAT  format,
ULONG  PinID,
BOOLEAN  capture 
)
private

Definition at line 413 of file minwave.cpp.

414{
415 PAGED_CODE();
416 ASSERT(format);
417 DBGPRINT(("CMiniportWaveCMI[%p]::validateFormat(%p, %d, %d)", this, format, PinID, capture));
418
419 PWAVEFORMATEX waveFormat = PWAVEFORMATEX(format + 1);
420 DBGPRINT(("---channels: %d, resolution: %d, sample rate: %d, pin: %d, formatMask: %x", waveFormat->nChannels, waveFormat->wBitsPerSample, waveFormat->nSamplesPerSec, PinID, cm->formatMask));
421
422//WaveFormatEx
423 if ( ( format->FormatSize >= sizeof(KSDATAFORMAT_WAVEFORMATEX))
426 switch (EXTRACT_WAVEFORMATEX_ID(&format->SubFormat)) {
427 case WAVE_FORMAT_PCM:
428 if ((PinID != PIN_WAVE_RENDER_SINK) && (PinID != PIN_WAVE_CAPTURE_SOURCE) && (PinID != ((ULONG)-1))) {
429 if ((PinID == PIN_WAVE_AC3_RENDER_SINK) && !IoIsWdmVersionAvailable(6,0)) {
431 }
432 }
433
434 if ( ((waveFormat->wBitsPerSample == 16) || (waveFormat->wBitsPerSample == 32))
435 && ((waveFormat->nSamplesPerSec == 44100) || (waveFormat->nSamplesPerSec == 48000) || (waveFormat->nSamplesPerSec == 88200) || (waveFormat->nSamplesPerSec == 96000))
436 && (waveFormat->nChannels == 2) ) {
437 if ((capture) && (waveFormat->nSamplesPerSec > 48000) ) {
439 }
440 return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, FALSE);
441 }
442 if ( (waveFormat->wBitsPerSample == 16)
443 && ((waveFormat->nChannels >= 4) && (waveFormat->nChannels <= cm->maxChannels))
444 && ((waveFormat->nSamplesPerSec == 44100) || (waveFormat->nSamplesPerSec == 48000)) ) {
445#if OUT_CHANNEL == 1
446 if ((PinID == PIN_WAVE_RENDER_SINK) || (PinID == ((ULONG)-1))) {
447 return isFormatAllowed(waveFormat->nSamplesPerSec, TRUE, FALSE);
448 }
449#else
451#endif
452 }
453 break;
455 if ((PinID != PIN_WAVE_AC3_RENDER_SINK) && (PinID != ((ULONG)-1))) {
457 }
458 if ( ((waveFormat->wBitsPerSample >= MIN_BITS_PER_SAMPLE_AC3) && (waveFormat->wBitsPerSample <= MAX_BITS_PER_SAMPLE_AC3))
459 && ((waveFormat->nSamplesPerSec >= MIN_SAMPLE_RATE_AC3) && (waveFormat->nSamplesPerSec <= MAX_SAMPLE_RATE_AC3))
460 && (waveFormat->nChannels == MAX_CHANNELS_AC3) ) {
461 return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, TRUE);
462 }
463 break;
465 if ((PinID != PIN_WAVE_AC3_RENDER_SINK) && (PinID != ((ULONG)-1))) {
467 }
468 if ( ((waveFormat->wBitsPerSample >= MIN_BITS_PER_SAMPLE_WMA) && (waveFormat->wBitsPerSample <= MAX_BITS_PER_SAMPLE_WMA))
469 && ((waveFormat->nSamplesPerSec >= MIN_SAMPLE_RATE_WMA) && (waveFormat->nSamplesPerSec <= MAX_SAMPLE_RATE_WMA))
470 && (waveFormat->nChannels == MAX_CHANNELS_WMA) ) {
471 return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, TRUE);
472 }
473 break;
474 }
475 }
476
478}
#define WAVE_FORMAT_PCM
Definition: constants.h:425
NTSTATUS isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
Definition: minwave.cpp:380
#define MAX_CHANNELS_WMA
Definition: interfaces.hpp:56
@ PIN_WAVE_CAPTURE_SOURCE
Definition: interfaces.hpp:445
@ PIN_WAVE_RENDER_SINK
Definition: interfaces.hpp:446
@ PIN_WAVE_AC3_RENDER_SINK
Definition: interfaces.hpp:448
#define MAX_BITS_PER_SAMPLE_WMA
Definition: interfaces.hpp:58
#define MIN_SAMPLE_RATE_WMA
Definition: interfaces.hpp:59
#define MAX_CHANNELS_AC3
Definition: interfaces.hpp:49
#define MIN_BITS_PER_SAMPLE_AC3
Definition: interfaces.hpp:50
#define MIN_BITS_PER_SAMPLE_WMA
Definition: interfaces.hpp:57
#define MAX_SAMPLE_RATE_AC3
Definition: interfaces.hpp:53
#define MAX_SAMPLE_RATE_WMA
Definition: interfaces.hpp:60
#define MAX_BITS_PER_SAMPLE_AC3
Definition: interfaces.hpp:51
#define MIN_SAMPLE_RATE_AC3
Definition: interfaces.hpp:52
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:983
#define EXTRACT_WAVEFORMATEX_ID(Guid)
Definition: ksmedia.h:127
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:1031
#define WAVE_FORMAT_WMA_SPDIF
struct _WAVEFORMATEX * PWAVEFORMATEX
#define WAVE_FORMAT_DOLBY_AC3_SPDIF
Definition: mmreg.h:129
BOOLEAN NTAPI IoIsWdmVersionAvailable(IN UCHAR MajorVersion, IN UCHAR MinorVersion)
Definition: util.c:126
UInt32 maxChannels
Definition: interfaces.hpp:136
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nChannels
Definition: mmreg.h:79
WORD wBitsPerSample
Definition: mmreg.h:83
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235

Friends And Related Function Documentation

◆ CMiniportWaveStreamCMI

Definition at line 89 of file minwave.hpp.

◆ PropertyHandler_ChannelConfig

NTSTATUS NTAPI PropertyHandler_ChannelConfig ( PPCPROPERTY_REQUEST  PropertyRequest)
friend

Definition at line 847 of file minwave.cpp.

848{
849 PAGED_CODE();
850 ASSERT(PropertyRequest);
851 DBGPRINT(("[PropertyHandler_ChannelConfig]"));
852
853#ifdef WAVERT
854 CMiniportWaveCMI *that = (CMiniportWaveCMI *) ((PMINIPORTWAVERT)PropertyRequest->MajorTarget);
855#else
857#endif
858
859 if (PropertyRequest->Node == KSNODE_WAVE_DAC) {
860
861 if (PropertyRequest->ValueSize == 0) {
862 PropertyRequest->ValueSize = sizeof(LONG);
864 } else if (PropertyRequest->ValueSize < sizeof (LONG)) {
865 PropertyRequest->ValueSize = 0;
867 }
868
869 if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {
870 *(PLONG)PropertyRequest->Value = that->requestedChannelMask;
871 PropertyRequest->ValueSize = sizeof(ULONG);
872 return STATUS_SUCCESS;
873 } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET) {
874 if (*(PLONG)PropertyRequest->Value == KSAUDIO_SPEAKER_7POINT1) {
875 that->requestedChannelMask = *(PLONG)PropertyRequest->Value;
876 that->requestedChannelCount = 8;
877 return STATUS_SUCCESS;
878 }
879 if (*(PLONG)PropertyRequest->Value == KSAUDIO_SPEAKER_5POINT1) {
880 that->requestedChannelMask = *(PLONG)PropertyRequest->Value;
881 that->requestedChannelCount = 6;
882 return STATUS_SUCCESS;
883 }
884 if ((*(PLONG)PropertyRequest->Value == KSAUDIO_SPEAKER_QUAD) || (*(PLONG)PropertyRequest->Value == KSAUDIO_SPEAKER_SURROUND)) {
885 that->requestedChannelMask = *(PLONG)PropertyRequest->Value;
886 that->requestedChannelCount = 4;
887 return STATUS_SUCCESS;
888 }
889 if (*(PLONG)PropertyRequest->Value == KSAUDIO_SPEAKER_STEREO) {
890 that->requestedChannelMask = *(PLONG)PropertyRequest->Value;
891 that->requestedChannelCount = 2;
892 return STATUS_SUCCESS;
893 }
894 } else if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT) {
895 PULONG AccessFlags = PULONG(PropertyRequest->Value);
897 PropertyRequest->ValueSize = sizeof(ULONG);
898 return STATUS_SUCCESS;
899 }
900 }
902}
@ KSNODE_WAVE_DAC
Definition: interfaces.hpp:464
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_BASICSUPPORT
Definition: dmksctrl.h:45
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define KSAUDIO_SPEAKER_SURROUND
Definition: ksmedia.h:1457
#define KSAUDIO_SPEAKER_5POINT1
Definition: ksmedia.h:1459
#define KSAUDIO_SPEAKER_QUAD
Definition: ksmedia.h:1455
#define KSAUDIO_SPEAKER_7POINT1
Definition: ksmedia.h:1462
long LONG
Definition: pedump.c:60
IMiniportWaveCyclic * PMINIPORTWAVECYCLIC
Definition: portcls.h:1543
IMiniportWaveRT * PMINIPORTWAVERT
Definition: portcls.h:1983
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
PUNKNOWN MajorTarget
Definition: portcls.h:258
uint32_t * PULONG
Definition: typedefs.h:59
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Member Data Documentation

◆ cm

◆ CMIAdapter

◆ DMAChannel

PDMACHANNEL CMiniportWaveCMI::DMAChannel[3]
private

Definition at line 53 of file minwave.hpp.

Referenced by ~CMiniportWaveCMI().

◆ IMP_IMiniportWaveCyclic

CMiniportWaveCMI::IMP_IMiniportWaveCyclic

Definition at line 81 of file minwave.hpp.

◆ isStreamRunning

bool CMiniportWaveCMI::isStreamRunning[3]
private

◆ mutex

◆ notificationInterval

UInt32 CMiniportWaveCMI::notificationInterval
private

Definition at line 54 of file minwave.hpp.

Referenced by STDMETHODIMP_().

◆ Port

PPORTWAVECYCLIC CMiniportWaveCMI::Port
private

Definition at line 52 of file minwave.hpp.

Referenced by newDMAChannel(), and ~CMiniportWaveCMI().

◆ requestedChannelCount

UInt32 CMiniportWaveCMI::requestedChannelCount
private

Definition at line 57 of file minwave.hpp.

Referenced by loadChannelConfigFromRegistry(), and storeChannelConfigToRegistry().

◆ requestedChannelMask

UInt32 CMiniportWaveCMI::requestedChannelMask
private

Definition at line 58 of file minwave.hpp.

Referenced by loadChannelConfigFromRegistry(), and storeChannelConfigToRegistry().

◆ stream

CMiniportWaveStreamCMI* CMiniportWaveCMI::stream[3]
private

Definition at line 61 of file minwave.hpp.

Referenced by CMiniportWaveStreamCMI::~CMiniportWaveStreamCMI().


The documentation for this class was generated from the following files: