ReactOS 0.4.15-dev-7942-gd23573b
CMiniportDMusUARTStream Class Reference
Inheritance diagram for CMiniportDMusUARTStream:
Collaboration diagram for CMiniportDMusUARTStream:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
virtual ~CMiniportDMusUARTStream ()
 
 STDMETHODIMP_ (NTSTATUS) Init(IN CMiniportDMusUART *pMiniport
 
NTSTATUS HandlePortParams (IN PPCPROPERTY_REQUEST Request)
 
 STDMETHODIMP_ (NTSTATUS) Write(IN PVOID BufferAddress
 
friend STDMETHODIMP_ (NTSTATUS) SnapTimeStamp(PINTERRUPTSYNC InterruptSync
 
- Public Member Functions inherited from CUnknownImpl< IMXF >
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 

Public Attributes

IN PUCHAR pPortBase
 
IN PUCHAR IN BOOLEAN fCapture
 
IN PUCHAR IN BOOLEAN IN PAllocatorMXF allocatorMXF
 
IN PUCHAR IN BOOLEAN IN PAllocatorMXF IN PMASTERCLOCK masterClock
 
 IMP_IMXF
 
IN ULONG BytesToWrite
 
IN ULONG OUT PULONG BytesWritten
 

Private Member Functions

 STDMETHODIMP_ (NTSTATUS) SourceEvtsToPort()
 
 STDMETHODIMP_ (NTSTATUS) ConsumeEvents()
 
 STDMETHODIMP_ (NTSTATUS) PutMessageLocked(PDMUS_KERNEL_EVENT pDMKEvt)
 

Private Attributes

CMiniportDMusUARTm_pMiniport
 
REFERENCE_TIME m_SnapshotTimeStamp
 
PUCHAR m_pPortBase
 
BOOLEAN m_fCapture
 
long m_NumFailedMPUTries
 
PAllocatorMXF m_AllocatorMXF
 
PMXF m_sinkMXF
 
PDMUS_KERNEL_EVENT m_DMKEvtQueue
 
ULONG m_NumberOfRetries
 
ULONG m_DMKEvtOffset
 
KDPC m_Dpc
 
KTIMER m_TimerEvent
 
BOOL m_TimerQueued
 
KSPIN_LOCK m_DpcSpinLock
 

Friends

PVOID pStream
 
VOID NTAPI DMusUARTTimerDPC (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
NTSTATUS NTAPI PropertyHandler_Synth (IN PPCPROPERTY_REQUEST)
 

Additional Inherited Members

- Protected Member Functions inherited from CUnknownImpl< IMXF >
 CUnknownImpl ()
 
virtual ~CUnknownImpl ()
 

Detailed Description

Definition at line 183 of file miniport_dmus.cpp.

Constructor & Destructor Documentation

◆ ~CMiniportDMusUARTStream()

CMiniportDMusUARTStream::~CMiniportDMusUARTStream ( void  )
virtual

Definition at line 1849 of file miniport_dmus.cpp.

1850{
1851 PAGED_CODE();
1852
1853 DPRINT("~CMiniportDMusUARTStream");
1854
1856
1857 if (m_DMKEvtQueue)
1858 {
1859 if (m_AllocatorMXF)
1860 {
1861 m_AllocatorMXF->PutMessage(m_DMKEvtQueue);
1862 }
1863 else
1864 {
1865 DPRINT("~CMiniportDMusUARTStream, no allocator, can't flush DMKEvts");
1866 }
1868 }
1869 if (m_AllocatorMXF)
1870 {
1871 m_AllocatorMXF->Release();
1873 }
1874
1875 if (m_pMiniport)
1876 {
1877 if (m_fCapture)
1878 {
1880 }
1881 else
1882 {
1884 }
1885
1886 m_pMiniport->Release();
1887 }
1888}
#define PAGED_CODE()
CMiniportDMusUART * m_pMiniport
PAllocatorMXF m_AllocatorMXF
PDMUS_KERNEL_EVENT m_DMKEvtQueue
#define NULL
Definition: types.h:112
#define DPRINT
Definition: sndvol32.h:71
BOOLEAN NTAPI KeCancelTimer(IN OUT PKTIMER Timer)
Definition: timerobj.c:206

Member Function Documentation

◆ HandlePortParams()

NTSTATUS CMiniportDMusUARTStream::HandlePortParams ( IN PPCPROPERTY_REQUEST  Request)

Definition at line 2335 of file miniport_dmus.cpp.

2340{
2341 PAGED_CODE();
2342
2343 NTSTATUS ntStatus;
2344
2345 if (pRequest->Verb & KSPROPERTY_TYPE_SET)
2346 {
2348 }
2349
2351 if (NT_SUCCESS(ntStatus))
2352 {
2353 RtlCopyMemory(pRequest->Value, pRequest->Instance, sizeof(SYNTH_PORTPARAMS));
2354
2356
2357 if (Params->ValidParams & ~SYNTH_PORTPARAMS_CHANNELGROUPS)
2358 {
2359 Params->ValidParams &= SYNTH_PORTPARAMS_CHANNELGROUPS;
2360 }
2361
2362 if (!(Params->ValidParams & SYNTH_PORTPARAMS_CHANNELGROUPS))
2363 {
2364 Params->ChannelGroups = 1;
2365 }
2366 else if (Params->ChannelGroups != 1)
2367 {
2368 Params->ChannelGroups = 1;
2369 }
2370
2371 pRequest->ValueSize = sizeof(SYNTH_PORTPARAMS);
2372 }
2373
2374 return ntStatus;
2375}
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SYNTH_PORTPARAMS_CHANNELGROUPS
Definition: dmusprop.h:105
struct _SYNTH_PORTPARAMS * PSYNTH_PORTPARAMS
struct _SYNTH_PORTPARAMS SYNTH_PORTPARAMS
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
FxRequest * pRequest
if(dx< 0)
Definition: linetemp.h:194
NTSTATUS ValidatePropertyRequest(IN PPCPROPERTY_REQUEST pRequest, IN ULONG ulValueSize, IN BOOLEAN fValueRequired)
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308

◆ QueryInterface()

CMiniportDMusUARTStream::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

Definition at line 1804 of file miniport_dmus.cpp.

1809{
1810 PAGED_CODE();
1811
1812 DPRINT("Stream::NonDelegatingQueryInterface");
1813 ASSERT(Object);
1814
1816 {
1817 *Object = PVOID(PUNKNOWN(this));
1818 }
1819 else
1821 {
1822 *Object = PVOID(PMXF(this));
1823 }
1824 else
1825 {
1826 *Object = NULL;
1827 }
1828
1829 if (*Object)
1830 {
1831 //
1832 // We reference the interface for the caller.
1833 //
1834 PUNKNOWN(*Object)->AddRef();
1835 return STATUS_SUCCESS;
1836 }
1837
1839}
const GUID IID_IUnknown
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define IID_IMXF
Definition: dmusicks.h:250
struct IMXF * PMXF
Definition: dmusicks.h:68
ULONG AddRef()
#define ASSERT(a)
Definition: mode.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
void * PVOID
Definition: typedefs.h:50
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235

◆ STDMETHODIMP_() [1/6]

CMiniportDMusUARTStream::STDMETHODIMP_ ( NTSTATUS  )
private

◆ STDMETHODIMP_() [2/6]

CMiniportDMusUARTStream::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [3/6]

CMiniportDMusUARTStream::STDMETHODIMP_ ( NTSTATUS  )
private

◆ STDMETHODIMP_() [4/6]

CMiniportDMusUARTStream::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [5/6]

CMiniportDMusUARTStream::STDMETHODIMP_ ( NTSTATUS  )
private

◆ STDMETHODIMP_() [6/6]

CMiniportDMusUARTStream::STDMETHODIMP_ ( NTSTATUS  )

Friends And Related Function Documentation

◆ DMusUARTTimerDPC

VOID NTAPI DMusUARTTimerDPC ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)
friend

Definition at line 2390 of file miniport_dmus.cpp.

2397{
2399
2400 CMiniportDMusUARTStream *aStream;
2402 if (aStream)
2403 {
2404 DPRINT("DMusUARTTimerDPC");
2405 if (false == aStream->m_fCapture)
2406 {
2407 (void) aStream->ConsumeEvents();
2408 }
2409 // ignores return value!
2410 }
2411}
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:687

◆ PropertyHandler_Synth

NTSTATUS NTAPI PropertyHandler_Synth ( IN PPCPROPERTY_REQUEST  PropertyRequest)
friend

Definition at line 2429 of file miniport_dmus.cpp.

2433{
2434 NTSTATUS ntStatus;
2435
2436 PAGED_CODE();
2437
2439 {
2440 ntStatus = ValidatePropertyRequest(pRequest, sizeof(ULONG), TRUE);
2441 if (NT_SUCCESS(ntStatus))
2442 {
2443 // if return buffer can hold a ULONG, return the access flags
2444 PULONG AccessFlags = PULONG(pRequest->Value);
2445
2446 *AccessFlags = KSPROPERTY_TYPE_BASICSUPPORT;
2447 switch (pRequest->PropertyItem->Id)
2448 {
2451 *AccessFlags |= KSPROPERTY_TYPE_GET;
2452 }
2453 switch (pRequest->PropertyItem->Id)
2454 {
2456 *AccessFlags |= KSPROPERTY_TYPE_SET;
2457 }
2458 ntStatus = STATUS_SUCCESS;
2459 pRequest->ValueSize = sizeof(ULONG);
2460
2461 switch (pRequest->PropertyItem->Id)
2462 {
2464 if (pRequest->MinorTarget)
2465 {
2466 *AccessFlags |= KSPROPERTY_TYPE_GET;
2467 }
2468 else
2469 {
2470 pRequest->ValueSize = 0;
2472 }
2473 }
2474 }
2475 }
2476 else
2477 {
2478 ntStatus = STATUS_SUCCESS;
2479 switch(pRequest->PropertyItem->Id)
2480 {
2482 DPRINT("PropertyHandler_Synth:KSPROPERTY_SYNTH_CAPS");
2483
2484 if (pRequest->Verb & KSPROPERTY_TYPE_SET)
2485 {
2487 }
2488
2489 if (NT_SUCCESS(ntStatus))
2490 {
2491 ntStatus = ValidatePropertyRequest(pRequest, sizeof(SYNTHCAPS), TRUE);
2492
2493 if (NT_SUCCESS(ntStatus))
2494 {
2495 SYNTHCAPS *caps = (SYNTHCAPS*)pRequest->Value;
2496 int increment;
2497 RtlZeroMemory(caps, sizeof(SYNTHCAPS));
2498 // XXX Different guids for different instances!
2499 //
2500 if (pRequest->Node == eSynthNode)
2501 {
2502 increment = sizeof(wszDescOut) - 2;
2503 RtlCopyMemory( caps->Description,wszDescOut,increment);
2504 caps->Guid = CLSID_MiniportDriverDMusUART;
2505 }
2506 else
2507 {
2508 increment = sizeof(wszDescIn) - 2;
2509 RtlCopyMemory( caps->Description,wszDescIn,increment);
2510 caps->Guid = CLSID_MiniportDriverDMusUARTCapture;
2511 }
2512
2513 caps->Flags = SYNTH_PC_EXTERNAL;
2514 caps->MemorySize = 0;
2515 caps->MaxChannelGroups = 1;
2516 caps->MaxVoices = 0xFFFFFFFF;
2517 caps->MaxAudioChannels = 0xFFFFFFFF;
2518
2519 caps->EffectFlags = 0;
2520
2521 CMiniportDMusUART *aMiniport;
2522 ASSERT(pRequest->MajorTarget);
2523 aMiniport = (CMiniportDMusUART *)(PMINIPORTDMUS)(pRequest->MajorTarget);
2524 WCHAR wszDesc2[16];
2525 int cLen;
2526 cLen = swprintf(wszDesc2,L"[%03x]\0",PtrToUlong(aMiniport->m_pPortBase));
2527
2528 cLen *= sizeof(WCHAR);
2529 RtlCopyMemory((WCHAR *)((DWORD_PTR)(caps->Description) + increment),
2530 wszDesc2,
2531 cLen);
2532
2533
2534 pRequest->ValueSize = sizeof(SYNTHCAPS);
2535 }
2536 }
2537
2538 break;
2539
2541 DPRINT("PropertyHandler_Synth:KSPROPERTY_SYNTH_PORTPARAMETERS");
2542 {
2543 CMiniportDMusUARTStream *aStream;
2544
2545 aStream = (CMiniportDMusUARTStream*)(pRequest->MinorTarget);
2546 if (aStream)
2547 {
2548 ntStatus = aStream->HandlePortParams(pRequest);
2549 }
2550 else
2551 {
2553 }
2554 }
2555 break;
2556
2558 DPRINT("PropertyHandler_Synth:KSPROPERTY_SYNTH_CHANNELGROUPS");
2559
2560 ntStatus = ValidatePropertyRequest(pRequest, sizeof(ULONG), TRUE);
2561 if (NT_SUCCESS(ntStatus))
2562 {
2563 *(PULONG)(pRequest->Value) = 1;
2564 pRequest->ValueSize = sizeof(ULONG);
2565 }
2566 break;
2567
2569 DPRINT("PropertyHandler_Synth:KSPROPERTY_SYNTH_LATENCYCLOCK");
2570
2571 if(pRequest->Verb & KSPROPERTY_TYPE_SET)
2572 {
2574 }
2575 else
2576 {
2577 ntStatus = ValidatePropertyRequest(pRequest, sizeof(ULONGLONG), TRUE);
2578 if(NT_SUCCESS(ntStatus))
2579 {
2580 REFERENCE_TIME rtLatency;
2581 CMiniportDMusUARTStream *aStream;
2582
2583 aStream = (CMiniportDMusUARTStream*)(pRequest->MinorTarget);
2584 if(aStream == NULL)
2585 {
2587 }
2588 else
2589 {
2590 aStream->m_pMiniport->m_MasterClock->GetTime(&rtLatency);
2591 *((PULONGLONG)pRequest->Value) = rtLatency;
2592 pRequest->ValueSize = sizeof(ULONGLONG);
2593 }
2594 }
2595 }
2596 break;
2597
2598 default:
2599 DPRINT("Unhandled property in PropertyHandler_Synth");
2600 break;
2601 }
2602 }
2603 return ntStatus;
2604}
NTSTATUS HandlePortParams(IN PPCPROPERTY_REQUEST Request)
PMASTERCLOCK m_MasterClock
#define swprintf
Definition: precomp.h:40
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
IMiniportDMus * PMINIPORTDMUS
Definition: dmusicks.h:211
@ KSPROPERTY_SYNTH_PORTPARAMETERS
Definition: dmusprop.h:57
@ KSPROPERTY_SYNTH_CHANNELGROUPS
Definition: dmusprop.h:58
@ KSPROPERTY_SYNTH_CAPS
Definition: dmusprop.h:56
@ KSPROPERTY_SYNTH_LATENCYCLOCK
Definition: dmusprop.h:60
#define SYNTH_PC_EXTERNAL
Definition: dmusprop.h:65
struct _SYNTHCAPS SYNTHCAPS
#define PtrToUlong(u)
Definition: config.h:107
#define KSPROPERTY_TYPE_BASICSUPPORT
Definition: dmksctrl.h:45
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
const WCHAR wszDescIn[]
@ eSynthNode
const WCHAR wszDescOut[]
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:383
#define L(x)
Definition: ntvdm.h:50
WCHAR Description[128]
Definition: dmusprop.h:89
DWORD Flags
Definition: dmusprop.h:83
DWORD MemorySize
Definition: dmusprop.h:84
DWORD MaxChannelGroups
Definition: dmusprop.h:85
DWORD MaxAudioChannels
Definition: dmusprop.h:87
GUID Guid
Definition: dmusprop.h:82
DWORD EffectFlags
Definition: dmusprop.h:88
DWORD MaxVoices
Definition: dmusprop.h:86
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ pStream

friend PVOID pStream
friend

Definition at line 245 of file miniport_dmus.cpp.

Member Data Documentation

◆ allocatorMXF

IN PUCHAR IN BOOLEAN IN PAllocatorMXF CMiniportDMusUARTStream::allocatorMXF

Definition at line 215 of file miniport_dmus.cpp.

◆ BytesToWrite

IN ULONG CMiniportDMusUARTStream::BytesToWrite

Definition at line 232 of file miniport_dmus.cpp.

◆ BytesWritten

IN ULONG OUT PULONG CMiniportDMusUARTStream::BytesWritten

Definition at line 233 of file miniport_dmus.cpp.

◆ fCapture

IN PUCHAR IN BOOLEAN CMiniportDMusUARTStream::fCapture

Definition at line 214 of file miniport_dmus.cpp.

◆ IMP_IMXF

CMiniportDMusUARTStream::IMP_IMXF

Definition at line 227 of file miniport_dmus.cpp.

◆ m_AllocatorMXF

PAllocatorMXF CMiniportDMusUARTStream::m_AllocatorMXF
private

Definition at line 191 of file miniport_dmus.cpp.

Referenced by ~CMiniportDMusUARTStream().

◆ m_DMKEvtOffset

ULONG CMiniportDMusUARTStream::m_DMKEvtOffset
private

Definition at line 195 of file miniport_dmus.cpp.

◆ m_DMKEvtQueue

PDMUS_KERNEL_EVENT CMiniportDMusUARTStream::m_DMKEvtQueue
private

Definition at line 193 of file miniport_dmus.cpp.

Referenced by ~CMiniportDMusUARTStream().

◆ m_Dpc

KDPC CMiniportDMusUARTStream::m_Dpc
private

Definition at line 196 of file miniport_dmus.cpp.

◆ m_DpcSpinLock

KSPIN_LOCK CMiniportDMusUARTStream::m_DpcSpinLock
private

Definition at line 199 of file miniport_dmus.cpp.

◆ m_fCapture

BOOLEAN CMiniportDMusUARTStream::m_fCapture
private

Definition at line 189 of file miniport_dmus.cpp.

Referenced by ~CMiniportDMusUARTStream().

◆ m_NumberOfRetries

ULONG CMiniportDMusUARTStream::m_NumberOfRetries
private

Definition at line 194 of file miniport_dmus.cpp.

◆ m_NumFailedMPUTries

long CMiniportDMusUARTStream::m_NumFailedMPUTries
private

Definition at line 190 of file miniport_dmus.cpp.

◆ m_pMiniport

CMiniportDMusUART* CMiniportDMusUARTStream::m_pMiniport
private

Definition at line 186 of file miniport_dmus.cpp.

Referenced by SnapTimeStamp(), and ~CMiniportDMusUARTStream().

◆ m_pPortBase

PUCHAR CMiniportDMusUARTStream::m_pPortBase
private

Definition at line 188 of file miniport_dmus.cpp.

◆ m_sinkMXF

PMXF CMiniportDMusUARTStream::m_sinkMXF
private

Definition at line 192 of file miniport_dmus.cpp.

◆ m_SnapshotTimeStamp

REFERENCE_TIME CMiniportDMusUARTStream::m_SnapshotTimeStamp
private

Definition at line 187 of file miniport_dmus.cpp.

Referenced by SnapTimeStamp().

◆ m_TimerEvent

KTIMER CMiniportDMusUARTStream::m_TimerEvent
private

Definition at line 197 of file miniport_dmus.cpp.

Referenced by ~CMiniportDMusUARTStream().

◆ m_TimerQueued

BOOL CMiniportDMusUARTStream::m_TimerQueued
private

Definition at line 198 of file miniport_dmus.cpp.

◆ masterClock

IN PUCHAR IN BOOLEAN IN PAllocatorMXF IN PMASTERCLOCK CMiniportDMusUARTStream::masterClock

Definition at line 216 of file miniport_dmus.cpp.

◆ pPortBase

IN PUCHAR CMiniportDMusUARTStream::pPortBase

Definition at line 213 of file miniport_dmus.cpp.


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