ReactOS  0.4.12-dev-685-gf36cbf7
pin_wavert.cpp
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Kernel Streaming
4  * FILE: drivers/wdm/audio/backpln/portcls/pin_wavert.cpp
5  * PURPOSE: WaveRT IRP Audio Pin
6  * PROGRAMMER: Johannes Anderwald
7  */
8 
9 #include "private.hpp"
10 
11 #ifndef YDEBUG
12 #define NDEBUG
13 #endif
14 
15 #include <debug.h>
16 
17 class CPortPinWaveRT : public IPortPinWaveRT
18 {
19 public:
21 
23  {
25  return m_Ref;
26  }
28  {
30 
31  if (!m_Ref)
32  {
33  delete this;
34  return 0;
35  }
36  return m_Ref;
37  }
39  CPortPinWaveRT(IUnknown *OuterUnknown){}
40  virtual ~CPortPinWaveRT(){}
41 
42 protected:
43 
44  IPortWaveRT * m_Port;
45  IPortFilterWaveRT * m_Filter;
46  KSPIN_DESCRIPTOR * m_KsPinDescriptor;
53 
57 
58  IIrpQueue * m_IrpQueue;
59 
61 
65 
67 
70 
72 
78 
79 };
80 
81 
82 typedef struct
83 {
85  PIO_WORKITEM WorkItem;
86  KSSTATE State;
88 
89 
90 //==================================================================================================================================
92 NTAPI
94  IN REFIID refiid,
95  OUT PVOID* Output)
96 {
97  DPRINT("IServiceSink_fnQueryInterface entered\n");
98 
99  if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
101  {
102  *Output = PVOID(PUNKNOWN((IIrpTarget*)this));
103  PUNKNOWN(*Output)->AddRef();
104  return STATUS_SUCCESS;
105  }
106  return STATUS_UNSUCCESSFUL;
107 }
108 
109 //==================================================================================================================================
110 
111 NTSTATUS
112 NTAPI
113 CPortPinWaveRT::NewIrpTarget(
114  OUT struct IIrpTarget **OutTarget,
115  IN PCWSTR Name,
119  IN PIRP Irp,
120  IN KSOBJECT_CREATE *CreateObject)
121 {
123  return STATUS_UNSUCCESSFUL;
124 }
125 
126 NTSTATUS
127 NTAPI
129  IN PIRP Irp)
130 {
134  PIO_STACK_LOCATION IoStack;
135 
137 
138  DPRINT("IPortPinWave_HandleKsProperty entered\n");
139 
140  if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY))
141  {
142  Irp->IoStatus.Information = 0;
143  Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
146  }
147 
148  Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
149 
151  {
153  {
154  PKSSTATE State = (PKSSTATE)Irp->UserBuffer;
155 
156  if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSSTATE))
157  {
158  Irp->IoStatus.Information = sizeof(KSSTATE);
159  Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
162  }
163 
164  if (Property->Flags & KSPROPERTY_TYPE_SET)
165  {
167  Irp->IoStatus.Information = 0;
168 
169  if (m_Stream)
170  {
171  Status = m_Stream->SetState(*State);
172 
173  DPRINT("Setting state %u %x\n", *State, Status);
174  if (NT_SUCCESS(Status))
175  {
176  m_State = *State;
177  }
178  }
179  Irp->IoStatus.Status = Status;
181  return Status;
182  }
183  else if (Property->Flags & KSPROPERTY_TYPE_GET)
184  {
185  *State = m_State;
186  Irp->IoStatus.Information = sizeof(KSSTATE);
187  Irp->IoStatus.Status = STATUS_SUCCESS;
189  return STATUS_SUCCESS;
190  }
191  }
193  {
194  PKSDATAFORMAT DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
195  if (Property->Flags & KSPROPERTY_TYPE_SET)
196  {
197  PKSDATAFORMAT NewDataFormat;
198  if (!RtlCompareMemory(DataFormat, m_Format, DataFormat->FormatSize))
199  {
200  Irp->IoStatus.Information = DataFormat->FormatSize;
201  Irp->IoStatus.Status = STATUS_SUCCESS;
203  return STATUS_SUCCESS;
204  }
205 
206  NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
207  if (!NewDataFormat)
208  {
209  Irp->IoStatus.Information = 0;
210  Irp->IoStatus.Status = STATUS_NO_MEMORY;
212  return STATUS_NO_MEMORY;
213  }
214  RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
215 
216  if (m_Stream)
217  {
218 #if 0
220  ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
224 
226 #endif
227  DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
228  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
229  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
230 
231  Status = m_Stream->SetFormat(NewDataFormat);
232  if (NT_SUCCESS(Status))
233  {
234  if (m_Format)
236 
237  m_Format = NewDataFormat;
238  Irp->IoStatus.Information = DataFormat->FormatSize;
239  Irp->IoStatus.Status = STATUS_SUCCESS;
241  return STATUS_SUCCESS;
242  }
243  }
244  DPRINT("Failed to set format\n");
245  Irp->IoStatus.Information = 0;
246  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
248  return STATUS_UNSUCCESSFUL;
249  }
250  else if (Property->Flags & KSPROPERTY_TYPE_GET)
251  {
252  if (!m_Format)
253  {
254  DPRINT("No format\n");
255  Irp->IoStatus.Information = 0;
256  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
258  return STATUS_UNSUCCESSFUL;
259  }
260  if (m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
261  {
262  Irp->IoStatus.Information = m_Format->FormatSize;
263  Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
266  }
267 
269  Irp->IoStatus.Information = DataFormat->FormatSize;
270  Irp->IoStatus.Status = STATUS_SUCCESS;
272  return STATUS_SUCCESS;
273  }
274  }
275 
276  }
278  DPRINT("Unhandled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
280 
281  Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
282  Irp->IoStatus.Information = 0;
284  return STATUS_NOT_IMPLEMENTED;
285 }
286 
287 NTSTATUS
288 NTAPI
290  IN PIRP Irp)
291 {
292  DPRINT("IPortPinWaveRT_HandleKsStream entered State %u Stream %p is UNIMPLEMENTED\n", m_State, m_Stream);
293 
294  return STATUS_PENDING;
295 }
296 
297 NTSTATUS
298 NTAPI
301  IN PIRP Irp)
302 {
303  PIO_STACK_LOCATION IoStack;
304 
306 
307 
308  if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY)
309  {
310  return HandleKsProperty(Irp);
311  }
312  else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT)
313  {
316  }
317  else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_DISABLE_EVENT)
318  {
321  }
322  else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_RESET_STATE)
323  {
326  }
327  else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM || IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
328  {
329  return HandleKsStream(Irp);
330  }
331  else
332  {
334  }
335 
337 
338  Irp->IoStatus.Information = 0;
339  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
341 
342  return STATUS_UNSUCCESSFUL;
343 }
344 
345 NTSTATUS
346 NTAPI
349  IN PIRP Irp)
350 {
352 }
353 
354 NTSTATUS
355 NTAPI
358  IN PIRP Irp)
359 {
361 }
362 
363 NTSTATUS
364 NTAPI
367  IN PIRP Irp)
368 {
370 }
371 
372 VOID
373 NTAPI
376  IN PVOID Context)
377 {
380  ISubdevice *ISubDevice;
384 
385  This = (CPortPinWaveRT*)Ctx->Pin;
386 
387  if (This->m_Stream)
388  {
389  if (This->m_State != KSSTATE_STOP)
390  {
391  This->m_Stream->SetState(KSSTATE_STOP);
393  }
394  }
395 
396  Status = This->m_Port->QueryInterface(IID_ISubdevice, (PVOID*)&ISubDevice);
397  if (NT_SUCCESS(Status))
398  {
399  Status = ISubDevice->GetDescriptor(&Descriptor);
400  if (NT_SUCCESS(Status))
401  {
402  Descriptor->Factory.Instances[This->m_ConnectDetails->PinId].CurrentPinInstanceCount--;
403  }
404  ISubDevice->Release();
405  }
406 
407  if (This->m_Format)
408  {
409  FreeItem(This->m_Format, TAG_PORTCLASS);
410  This->m_Format = NULL;
411  }
412 
413  if (This->m_IrpQueue)
414  {
415  This->m_IrpQueue->Release();
416  }
417 
418  // complete the irp
419  Ctx->Irp->IoStatus.Information = 0;
420  Ctx->Irp->IoStatus.Status = STATUS_SUCCESS;
422 
423  // free the work item
424  IoFreeWorkItem(Ctx->WorkItem);
425 
426  // free work item ctx
427  FreeItem(Ctx, TAG_PORTCLASS);
428 
429  if (This->m_Stream)
430  {
431  Stream = This->m_Stream;
432  This->m_Stream = NULL;
433  DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
434  Stream->Release();
435  }
436 }
437 
438 NTSTATUS
439 NTAPI
442  IN PIRP Irp)
443 {
445 
446  if (m_Stream)
447  {
449  if (!Ctx)
450  {
451  DPRINT("Failed to allocate stream context\n");
452  goto cleanup;
453  }
454 
456  if (!Ctx->WorkItem)
457  {
458  DPRINT("Failed to allocate work item\n");
459  goto cleanup;
460  }
461 
462  Ctx->Irp = Irp;
463  Ctx->Pin = this;
464 
466  Irp->IoStatus.Information = 0;
467  Irp->IoStatus.Status = STATUS_PENDING;
468 
469  // defer work item
471  // Return result
472  return STATUS_PENDING;
473  }
474 
475  Irp->IoStatus.Information = 0;
476  Irp->IoStatus.Status = STATUS_SUCCESS;
478 
479  return STATUS_SUCCESS;
480 
481 cleanup:
482 
483  if (Ctx)
484  FreeItem(Ctx, TAG_PORTCLASS);
485 
486  Irp->IoStatus.Information = 0;
487  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
489  return STATUS_UNSUCCESSFUL;
490 
491 }
492 
493 NTSTATUS
494 NTAPI
495 CPortPinWaveRT::QuerySecurity(
497  IN PIRP Irp)
498 {
500 }
501 
502 NTSTATUS
503 NTAPI
504 CPortPinWaveRT::SetSecurity(
506  IN PIRP Irp)
507 {
509 }
510 
511 BOOLEAN
512 NTAPI
513 CPortPinWaveRT::FastDeviceIoControl(
515  IN BOOLEAN Wait,
521  OUT PIO_STATUS_BLOCK StatusBlock,
523 {
524  return FALSE;
525 }
526 
527 BOOLEAN
528 NTAPI
529 CPortPinWaveRT::FastRead(
532  IN ULONG Length,
533  IN BOOLEAN Wait,
534  IN ULONG LockKey,
535  IN PVOID Buffer,
536  OUT PIO_STATUS_BLOCK StatusBlock,
538 {
539  return FALSE;
540 }
541 
542 BOOLEAN
543 NTAPI
544 CPortPinWaveRT::FastWrite(
547  IN ULONG Length,
548  IN BOOLEAN Wait,
549  IN ULONG LockKey,
550  IN PVOID Buffer,
551  OUT PIO_STATUS_BLOCK StatusBlock,
553 {
554  return FALSE;
555 }
556 
557 NTSTATUS
558 NTAPI
562  IN KSPIN_CONNECT * ConnectDetails,
563  IN KSPIN_DESCRIPTOR * KsPinDescriptor,
565 {
568  BOOLEAN Capture;
569  KSRTAUDIO_HWLATENCY Latency;
570 
571  Port->AddRef();
572  Filter->AddRef();
573 
574  m_Port = Port;
575  m_Filter = Filter;
576  m_KsPinDescriptor = KsPinDescriptor;
577  m_ConnectDetails = ConnectDetails;
579 
580  DataFormat = (PKSDATAFORMAT)(ConnectDetails + 1);
581 
582  DPRINT("CPortPinWaveRT::Init entered\n");
583 
585  if (!m_Format)
587 
589 
591  if (!NT_SUCCESS(Status))
592  {
593  goto cleanup;
594  }
595 
596  Status = m_IrpQueue->Init(ConnectDetails, KsPinDescriptor, 0, 0, FALSE);
597  if (!NT_SUCCESS(Status))
598  {
599  goto cleanup;
600  }
601 
603  if (!NT_SUCCESS(Status))
604  {
605  goto cleanup;
606  }
607 
608  if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_IN)
609  {
610  Capture = FALSE;
611  }
612  else if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_OUT)
613  {
614  Capture = TRUE;
615  }
616  else
617  {
618  DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
619  KeBugCheck(0);
620  while(TRUE);
621  }
622 
623  Status = m_Miniport->NewStream(&m_Stream, m_PortStream, ConnectDetails->PinId, Capture, m_Format);
624  DPRINT("CPortPinWaveRT::Init Status %x\n", Status);
625 
626  if (!NT_SUCCESS(Status))
627  goto cleanup;
628 
629  m_Stream->GetHWLatency(&Latency);
630  // delay of 10 millisec
631  m_Delay = Int32x32To64(10, -10000);
632 
633  Status = m_Stream->AllocateAudioBuffer(16384 * 11, &m_Mdl, &m_CommonBufferSize, &m_CommonBufferOffset, &m_CacheType);
634  if (!NT_SUCCESS(Status))
635  {
636  DPRINT("AllocateAudioBuffer failed with %x\n", Status);
637  goto cleanup;
638  }
639 
641  if (!m_CommonBuffer)
642  {
643  DPRINT("Failed to get system address %x\n", Status);
644  IoFreeMdl(m_Mdl);
645  m_Mdl = NULL;
646  goto cleanup;
647  }
648 
649  DPRINT("Setting state to acquire %x\n", m_Stream->SetState(KSSTATE_ACQUIRE));
650  DPRINT("Setting state to pause %x\n", m_Stream->SetState(KSSTATE_PAUSE));
652  return STATUS_SUCCESS;
653 
654 cleanup:
655  if (m_IrpQueue)
656  {
657  m_IrpQueue->Release();
658  m_IrpQueue = NULL;
659  }
660 
661  if (m_Format)
662  {
664  m_Format = NULL;
665  }
666 
667  if (m_Stream)
668  {
669  m_Stream->Release();
670  m_Stream = NULL;
671  }
672  else
673  {
674  if (m_PortStream)
675  {
676  m_PortStream->Release();
677  m_PortStream = NULL;
678  }
679 
680  }
681  return Status;
682 }
683 
684 
685 NTSTATUS
687  OUT IPortPinWaveRT ** OutPin)
688 {
690 
692  if (!This)
694 
695  This->AddRef();
696 
697  // store result
698  *OutPin = (PPORTPINWAVERT)This;
699 
700  return STATUS_SUCCESS;
701 }
KSDDKAPI NTSTATUS NTAPI KsDefaultDeviceIoCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1172
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
IPortWaveRTStream * PPORTWAVERTSTREAM
Definition: portcls.h:1791
static PWSTR GuidString
Definition: apphelp.c:91
CPPORT Port[4]
Definition: headless.c:34
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
_In_ BOOLEAN Read
Definition: strmini.h:479
IPortWaveRT * PPORTWAVERT
Definition: interfaces.hpp:682
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:157
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
IPortWaveRT * m_Port
Definition: pin_wavert.cpp:44
#define IOCTL_KS_DISABLE_EVENT
Definition: ks.h:127
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:921
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
KSPIN_DESCRIPTOR * m_KsPinDescriptor
Definition: pin_wavert.cpp:46
PKSDATAFORMAT m_Format
Definition: pin_wavert.cpp:51
_In_ PIRP Irp
Definition: csq.h:116
PMINIPORTWAVERT m_Miniport
Definition: pin_wavert.cpp:47
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define IOCTL_KS_READ_STREAM
Definition: ks.h:164
#define TAG_PORTCLASS
Definition: private.hpp:24
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
KSSTATE m_State
Definition: pin_wavert.cpp:50
IMiniportWaveRTStream * PMINIPORTWAVERTSTREAM
Definition: portcls.h:1809
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NewPortWaveRTStream(PPORTWAVERTSTREAM *OutStream)
CPortPinWaveRT(IUnknown *OuterUnknown)
Definition: pin_wavert.cpp:39
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
ULONG m_PreCompleted
Definition: pin_wavert.cpp:63
BOOL Init(PUSERCONNECT UserCon)
Definition: dllmain.c:367
NTSTATUS NTAPI HandleKsProperty(IN PIRP Irp)
Definition: pin_wavert.cpp:128
static BOOL Write(PBYTE Address, PBYTE Data, SIZE_T Size)
Definition: vmhorizon.c:15
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define KSPROPSETID_Connection
Definition: ks.h:376
IMiniportWaveRT * PMINIPORTWAVERT
Definition: portcls.h:1927
CHAR InputBuffer[80]
Definition: conmgr.c:33
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IOCTL_KS_RESET_STATE
Definition: ks.h:171
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
ULONG m_CommonBufferSize
Definition: pin_wavert.cpp:55
ULONGLONG m_Delay
Definition: pin_wavert.cpp:66
STDMETHODIMP_(ULONG) Release()
Definition: pin_wavert.cpp:27
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:931
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
PVOID m_CommonBuffer
Definition: pin_wavert.cpp:54
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
enum KSSTATE * PKSSTATE
long LONG
Definition: pedump.c:60
MEMORY_CACHING_TYPE m_CacheType
Definition: pin_wavert.cpp:68
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
#define STDMETHODIMP
Definition: basetyps.h:43
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
IPortFilterWaveRT * PPORTFILTERWAVERT
Definition: interfaces.hpp:693
VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1469
Definition: bufpool.h:45
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
void * PVOID
Definition: retypes.h:9
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
PPORTWAVERTSTREAM m_PortStream
Definition: pin_wavert.cpp:49
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1156
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG m_TotalPackets
Definition: pin_wavert.cpp:62
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define STATUS_PENDING
Definition: ntstatus.h:82
INT POOL_TYPE
Definition: typedefs.h:76
uint64_t ULONGLONG
Definition: typedefs.h:65
const GUID IID_IUnknown
friend VOID NTAPI SetStreamWorkerRoutine(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
nsrefcnt Release()
friend VOID NTAPI CloseStreamRoutine(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
Definition: pin_wavert.cpp:374
IPortFilterWaveRT * m_Filter
Definition: pin_wavert.cpp:45
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
* PFILE_OBJECT
Definition: iotypes.h:1954
VOID NTAPI IoFreeMdl(PMDL Mdl)
Definition: iomdl.c:146
ULONG AddRef()
ULONG m_CommonBufferOffset
Definition: pin_wavert.cpp:56
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
CPortPinWaveRT * Pin
Definition: pin_wavert.cpp:84
VOID NTAPI CloseStreamRoutine(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
Definition: pin_wavert.cpp:374
#define InterlockedDecrement
Definition: armddk.h:52
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:134
Definition: arc.h:85
PIO_WORKITEM WorkItem
Definition: private.hpp:417
NTSTATUS NewPortPinWaveRT(OUT IPortPinWaveRT **OutPin)
Definition: pin_wavert.cpp:686
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:883
ULONG m_PostCompleted
Definition: pin_wavert.cpp:64
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
Status
Definition: gdiplustypes.h:24
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
_In_ DWORD Property
Definition: setupapi.h:1545
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
enum State_ State
Definition: pofuncs.h:54
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define InterlockedIncrement
Definition: armddk.h:53
KSSTATE
Definition: ks.h:1244
virtual ~CPortPinWaveRT()
Definition: pin_wavert.cpp:40
Definition: sacdrv.h:268
PMINIPORTWAVERTSTREAM m_Stream
Definition: pin_wavert.cpp:48
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
KSPIN_CONNECT * m_ConnectDetails
Definition: pin_wavert.cpp:52
PMINIPORTWAVERT GetWaveRTMiniport(IN IPortWaveRT *iface)
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
NTSTATUS NTAPI HandleKsStream(IN PIRP Irp)
Definition: pin_wavert.cpp:289
#define OUT
Definition: typedefs.h:39
struct CLOSESTREAM_CONTEXT * PCLOSESTREAM_CONTEXT
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:565
IPortPinWaveRT * PPORTPINWAVERT
Definition: interfaces.hpp:723
#define UNIMPLEMENTED
Definition: debug.h:114
char * cleanup(char *str)
Definition: wpickclick.c:99
struct KSIDENTIFIER * PKSPROPERTY
NTSTATUS NTAPI NewIrpQueue(IN IIrpQueue **Queue)
Definition: irpstream.cpp:808
struct SETSTREAM_CONTEXT * PSETSTREAM_CONTEXT
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE
return STATUS_SUCCESS
Definition: btrfs.c:2725
VOID NTAPI SetStreamState(IN KSSTATE State)
IoMarkIrpPending(Irp)
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
IIrpQueue * m_IrpQueue
Definition: pin_wavert.cpp:58
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99
#define Int32x32To64(a, b)
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
KSDATAFORMAT * PKSDATAFORMAT
STDMETHODIMP_(ULONG) AddRef()
Definition: pin_wavert.cpp:22
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: pin_wavert.cpp:93
IN BOOLEAN Wait
Definition: fatprocs.h:1529
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966