ReactOS  0.4.15-dev-4916-gd519b11
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 CUnknownImpl<IPortPinWaveRT>
18 {
19 public:
21 
23  CPortPinWaveRT(IUnknown *OuterUnknown){}
24  virtual ~CPortPinWaveRT(){}
25 
26 protected:
27 
28  IPortWaveRT * m_Port;
29  IPortFilterWaveRT * m_Filter;
30  KSPIN_DESCRIPTOR * m_KsPinDescriptor;
37 
41 
42  IIrpQueue * m_IrpQueue;
43 
45 
49 
51 
54 
60 
61 };
62 
63 
64 typedef struct
65 {
68  KSSTATE State;
70 
71 
72 //==================================================================================================================================
74 NTAPI
76  IN REFIID refiid,
77  OUT PVOID* Output)
78 {
79  DPRINT("IServiceSink_fnQueryInterface entered\n");
80 
81  if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
83  {
84  *Output = PVOID(PUNKNOWN((IIrpTarget*)this));
85  PUNKNOWN(*Output)->AddRef();
86  return STATUS_SUCCESS;
87  }
88  return STATUS_UNSUCCESSFUL;
89 }
90 
91 //==================================================================================================================================
92 
94 NTAPI
95 CPortPinWaveRT::NewIrpTarget(
96  OUT struct IIrpTarget **OutTarget,
97  IN PCWSTR Name,
101  IN PIRP Irp,
102  IN KSOBJECT_CREATE *CreateObject)
103 {
105  return STATUS_UNSUCCESSFUL;
106 }
107 
108 NTSTATUS
109 NTAPI
111  IN PIRP Irp)
112 {
116  PIO_STACK_LOCATION IoStack;
117 
119 
120  DPRINT("IPortPinWave_HandleKsProperty entered\n");
121 
122  if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY))
123  {
124  Irp->IoStatus.Information = 0;
125  Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
128  }
129 
130  Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
131 
133  {
135  {
136  PKSSTATE State = (PKSSTATE)Irp->UserBuffer;
137 
138  if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSSTATE))
139  {
140  Irp->IoStatus.Information = sizeof(KSSTATE);
141  Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
144  }
145 
146  if (Property->Flags & KSPROPERTY_TYPE_SET)
147  {
149  Irp->IoStatus.Information = 0;
150 
151  if (m_Stream)
152  {
153  Status = m_Stream->SetState(*State);
154 
155  DPRINT("Setting state %u %x\n", *State, Status);
156  if (NT_SUCCESS(Status))
157  {
158  m_State = *State;
159  }
160  }
161  Irp->IoStatus.Status = Status;
163  return Status;
164  }
165  else if (Property->Flags & KSPROPERTY_TYPE_GET)
166  {
167  *State = m_State;
168  Irp->IoStatus.Information = sizeof(KSSTATE);
169  Irp->IoStatus.Status = STATUS_SUCCESS;
171  return STATUS_SUCCESS;
172  }
173  }
175  {
176  PKSDATAFORMAT DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
177  if (Property->Flags & KSPROPERTY_TYPE_SET)
178  {
179  PKSDATAFORMAT NewDataFormat;
180  if (!RtlCompareMemory(DataFormat, m_Format, DataFormat->FormatSize))
181  {
182  Irp->IoStatus.Information = DataFormat->FormatSize;
183  Irp->IoStatus.Status = STATUS_SUCCESS;
185  return STATUS_SUCCESS;
186  }
187 
188  NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
189  if (!NewDataFormat)
190  {
191  Irp->IoStatus.Information = 0;
192  Irp->IoStatus.Status = STATUS_NO_MEMORY;
194  return STATUS_NO_MEMORY;
195  }
196  RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
197 
198  if (m_Stream)
199  {
200 #if 0
202  ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
206 
208 #endif
209  DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
210  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
211  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
212 
213  Status = m_Stream->SetFormat(NewDataFormat);
214  if (NT_SUCCESS(Status))
215  {
216  if (m_Format)
218 
219  m_Format = NewDataFormat;
220  Irp->IoStatus.Information = DataFormat->FormatSize;
221  Irp->IoStatus.Status = STATUS_SUCCESS;
223  return STATUS_SUCCESS;
224  }
225  }
226  DPRINT("Failed to set format\n");
227  Irp->IoStatus.Information = 0;
228  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
230  return STATUS_UNSUCCESSFUL;
231  }
232  else if (Property->Flags & KSPROPERTY_TYPE_GET)
233  {
234  if (!m_Format)
235  {
236  DPRINT("No format\n");
237  Irp->IoStatus.Information = 0;
238  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
240  return STATUS_UNSUCCESSFUL;
241  }
242  if (m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
243  {
244  Irp->IoStatus.Information = m_Format->FormatSize;
245  Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
248  }
249 
251  Irp->IoStatus.Information = DataFormat->FormatSize;
252  Irp->IoStatus.Status = STATUS_SUCCESS;
254  return STATUS_SUCCESS;
255  }
256  }
257 
258  }
260  DPRINT("Unhandled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
262 
263  Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
264  Irp->IoStatus.Information = 0;
266  return STATUS_NOT_IMPLEMENTED;
267 }
268 
269 NTSTATUS
270 NTAPI
272  IN PIRP Irp)
273 {
274  DPRINT("IPortPinWaveRT_HandleKsStream entered State %u Stream %p is UNIMPLEMENTED\n", m_State, m_Stream);
275 
276  return STATUS_PENDING;
277 }
278 
279 NTSTATUS
280 NTAPI
283  IN PIRP Irp)
284 {
285  PIO_STACK_LOCATION IoStack;
286 
288 
289 
290  switch (IoStack->Parameters.DeviceIoControl.IoControlCode)
291  {
292  case IOCTL_KS_PROPERTY:
293  return HandleKsProperty(Irp);
294 
296  /* FIXME UNIMPLEMENTED */
298  break;
299 
301  /* FIXME UNIMPLEMENTED */
303  break;
304 
305  case IOCTL_KS_HANDSHAKE:
306  /* FIXME UNIMPLEMENTED */
308  break;
309 
310  case IOCTL_KS_METHOD:
311  /* FIXME UNIMPLEMENTED */
314 
316  /* FIXME UNIMPLEMENTED */
318  break;
319 
322  return HandleKsStream(Irp);
323 
324  default:
326  }
327 
328  Irp->IoStatus.Information = 0;
329  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
331 
332  return STATUS_UNSUCCESSFUL;
333 }
334 
335 NTSTATUS
336 NTAPI
339  IN PIRP Irp)
340 {
342 }
343 
344 NTSTATUS
345 NTAPI
348  IN PIRP Irp)
349 {
351 }
352 
353 NTSTATUS
354 NTAPI
357  IN PIRP Irp)
358 {
360 }
361 
362 VOID
363 NTAPI
366  IN PVOID Context)
367 {
370  ISubdevice *ISubDevice;
374 
375  This = (CPortPinWaveRT*)Ctx->Pin;
376 
377  if (This->m_Stream)
378  {
379  if (This->m_State != KSSTATE_STOP)
380  {
381  This->m_Stream->SetState(KSSTATE_STOP);
383  }
384  }
385 
386  Status = This->m_Port->QueryInterface(IID_ISubdevice, (PVOID*)&ISubDevice);
387  if (NT_SUCCESS(Status))
388  {
389  Status = ISubDevice->GetDescriptor(&Descriptor);
390  if (NT_SUCCESS(Status))
391  {
392  Descriptor->Factory.Instances[This->m_ConnectDetails->PinId].CurrentPinInstanceCount--;
393  }
394  ISubDevice->Release();
395  }
396 
397  if (This->m_Format)
398  {
399  FreeItem(This->m_Format, TAG_PORTCLASS);
400  This->m_Format = NULL;
401  }
402 
403  if (This->m_IrpQueue)
404  {
405  This->m_IrpQueue->Release();
406  }
407 
408  // complete the irp
409  Ctx->Irp->IoStatus.Information = 0;
412 
413  // free the work item
414  IoFreeWorkItem(Ctx->WorkItem);
415 
416  // free work item ctx
417  FreeItem(Ctx, TAG_PORTCLASS);
418 
419  if (This->m_Stream)
420  {
421  Stream = This->m_Stream;
422  This->m_Stream = NULL;
423  DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
424  Stream->Release();
425  }
426 }
427 
428 NTSTATUS
429 NTAPI
432  IN PIRP Irp)
433 {
435 
436  if (m_Stream)
437  {
439  if (!Ctx)
440  {
441  DPRINT("Failed to allocate stream context\n");
442  goto cleanup;
443  }
444 
446  if (!Ctx->WorkItem)
447  {
448  DPRINT("Failed to allocate work item\n");
449  goto cleanup;
450  }
451 
452  Ctx->Irp = Irp;
453  Ctx->Pin = this;
454 
456  Irp->IoStatus.Information = 0;
457  Irp->IoStatus.Status = STATUS_PENDING;
458 
459  // defer work item
461  // Return result
462  return STATUS_PENDING;
463  }
464 
465  Irp->IoStatus.Information = 0;
466  Irp->IoStatus.Status = STATUS_SUCCESS;
468 
469  return STATUS_SUCCESS;
470 
471 cleanup:
472 
473  if (Ctx)
474  FreeItem(Ctx, TAG_PORTCLASS);
475 
476  Irp->IoStatus.Information = 0;
477  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
479  return STATUS_UNSUCCESSFUL;
480 
481 }
482 
483 NTSTATUS
484 NTAPI
485 CPortPinWaveRT::QuerySecurity(
487  IN PIRP Irp)
488 {
490 }
491 
492 NTSTATUS
493 NTAPI
494 CPortPinWaveRT::SetSecurity(
496  IN PIRP Irp)
497 {
499 }
500 
501 BOOLEAN
502 NTAPI
503 CPortPinWaveRT::FastDeviceIoControl(
505  IN BOOLEAN Wait,
511  OUT PIO_STATUS_BLOCK StatusBlock,
513 {
514  return FALSE;
515 }
516 
517 BOOLEAN
518 NTAPI
519 CPortPinWaveRT::FastRead(
522  IN ULONG Length,
523  IN BOOLEAN Wait,
524  IN ULONG LockKey,
525  IN PVOID Buffer,
526  OUT PIO_STATUS_BLOCK StatusBlock,
528 {
529  return FALSE;
530 }
531 
532 BOOLEAN
533 NTAPI
534 CPortPinWaveRT::FastWrite(
537  IN ULONG Length,
538  IN BOOLEAN Wait,
539  IN ULONG LockKey,
540  IN PVOID Buffer,
541  OUT PIO_STATUS_BLOCK StatusBlock,
543 {
544  return FALSE;
545 }
546 
547 NTSTATUS
548 NTAPI
552  IN KSPIN_CONNECT * ConnectDetails,
553  IN KSPIN_DESCRIPTOR * KsPinDescriptor,
555 {
559  KSRTAUDIO_HWLATENCY Latency;
560 
561  Port->AddRef();
562  Filter->AddRef();
563 
564  m_Port = Port;
565  m_Filter = Filter;
566  m_KsPinDescriptor = KsPinDescriptor;
567  m_ConnectDetails = ConnectDetails;
569 
570  DataFormat = (PKSDATAFORMAT)(ConnectDetails + 1);
571 
572  DPRINT("CPortPinWaveRT::Init entered\n");
573 
575  if (!m_Format)
577 
579 
581  if (!NT_SUCCESS(Status))
582  {
583  goto cleanup;
584  }
585 
586  Status = m_IrpQueue->Init(ConnectDetails, KsPinDescriptor, 0, 0, FALSE);
587  if (!NT_SUCCESS(Status))
588  {
589  goto cleanup;
590  }
591 
593  if (!NT_SUCCESS(Status))
594  {
595  goto cleanup;
596  }
597 
598  if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_IN)
599  {
600  Capture = FALSE;
601  }
602  else if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_OUT)
603  {
604  Capture = TRUE;
605  }
606  else
607  {
608  DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
609  KeBugCheck(0);
610  while(TRUE);
611  }
612 
613  Status = m_Miniport->NewStream(&m_Stream, m_PortStream, ConnectDetails->PinId, Capture, m_Format);
614  DPRINT("CPortPinWaveRT::Init Status %x\n", Status);
615 
616  if (!NT_SUCCESS(Status))
617  goto cleanup;
618 
619  m_Stream->GetHWLatency(&Latency);
620  // delay of 10 millisec
621  m_Delay = Int32x32To64(10, -10000);
622 
623  Status = m_Stream->AllocateAudioBuffer(16384 * 11, &m_Mdl, &m_CommonBufferSize, &m_CommonBufferOffset, &m_CacheType);
624  if (!NT_SUCCESS(Status))
625  {
626  DPRINT("AllocateAudioBuffer failed with %x\n", Status);
627  goto cleanup;
628  }
629 
631  if (!m_CommonBuffer)
632  {
633  DPRINT("Failed to get system address %x\n", Status);
634  IoFreeMdl(m_Mdl);
635  m_Mdl = NULL;
636  goto cleanup;
637  }
638 
639  DPRINT("Setting state to acquire %x\n", m_Stream->SetState(KSSTATE_ACQUIRE));
640  DPRINT("Setting state to pause %x\n", m_Stream->SetState(KSSTATE_PAUSE));
642  return STATUS_SUCCESS;
643 
644 cleanup:
645  if (m_IrpQueue)
646  {
647  m_IrpQueue->Release();
648  m_IrpQueue = NULL;
649  }
650 
651  if (m_Format)
652  {
654  m_Format = NULL;
655  }
656 
657  if (m_Stream)
658  {
659  m_Stream->Release();
660  m_Stream = NULL;
661  }
662  else
663  {
664  if (m_PortStream)
665  {
666  m_PortStream->Release();
667  m_PortStream = NULL;
668  }
669 
670  }
671  return Status;
672 }
673 
674 
675 NTSTATUS
677  OUT IPortPinWaveRT ** OutPin)
678 {
680 
682  if (!This)
684 
685  This->AddRef();
686 
687  // store result
688  *OutPin = (PPORTPINWAVERT)This;
689 
690  return STATUS_SUCCESS;
691 }
KSDDKAPI NTSTATUS NTAPI KsDefaultDeviceIoCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1184
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
IPortWaveRTStream * PPORTWAVERTSTREAM
Definition: portcls.h:1845
static PWSTR GuidString
Definition: apphelp.c:93
CPPORT Port[4]
Definition: headless.c:35
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
_In_ BOOLEAN Read
Definition: strmini.h:479
IPortWaveRT * PPORTWAVERT
Definition: interfaces.hpp:681
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:139
#define REFIID
Definition: guiddef.h:118
IPortWaveRT * m_Port
Definition: pin_wavert.cpp:28
#define IOCTL_KS_DISABLE_EVENT
Definition: ks.h:133
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
KSPIN_DESCRIPTOR * m_KsPinDescriptor
Definition: pin_wavert.cpp:30
PKSDATAFORMAT m_Format
Definition: pin_wavert.cpp:35
#define TRUE
Definition: types.h:120
PMINIPORTWAVERT m_Miniport
Definition: pin_wavert.cpp:31
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define IOCTL_KS_READ_STREAM
Definition: ks.h:142
#define TAG_PORTCLASS
Definition: private.hpp:24
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
KSSTATE m_State
Definition: pin_wavert.cpp:34
IMiniportWaveRTStream * PMINIPORTWAVERTSTREAM
Definition: portcls.h:1863
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NewPortWaveRTStream(PPORTWAVERTSTREAM *OutStream)
_In_ ULONG _In_ ULONG State
Definition: potypes.h:516
CPortPinWaveRT(IUnknown *OuterUnknown)
Definition: pin_wavert.cpp:23
ULONG m_PreCompleted
Definition: pin_wavert.cpp:47
IO_STATUS_BLOCK IoStatus
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:318
BOOL Init(PUSERCONNECT UserCon)
Definition: dllmain.c:385
NTSTATUS NTAPI HandleKsProperty(IN PIRP Irp)
Definition: pin_wavert.cpp:110
if(dx==0 &&dy==0)
Definition: linetemp.h:174
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:346
IMiniportWaveRT * PMINIPORTWAVERT
Definition: portcls.h:1981
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define IOCTL_KS_RESET_STATE
Definition: ks.h:145
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
ULONG m_CommonBufferSize
Definition: pin_wavert.cpp:39
ULONGLONG m_Delay
Definition: pin_wavert.cpp:50
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:1031
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:318
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
return STATUS_NOT_IMPLEMENTED
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
PVOID m_CommonBuffer
Definition: pin_wavert.cpp:38
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
enum KSSTATE * PKSSTATE
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
unsigned int BOOL
Definition: ntddk_ex.h:94
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1427
MEMORY_CACHING_TYPE m_CacheType
Definition: pin_wavert.cpp:52
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
#define STDMETHODIMP
Definition: basetyps.h:43
unsigned char BOOLEAN
#define IoCompleteRequest
Definition: irp.c:1240
IPortFilterWaveRT * PPORTFILTERWAVERT
Definition: interfaces.hpp:692
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
#define IOCTL_KS_METHOD
Definition: ks.h:136
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
PPORTWAVERTSTREAM m_PortStream
Definition: pin_wavert.cpp:33
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:859
Status
Definition: gdiplustypes.h:24
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2662
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:949
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1168
ULONG m_TotalPackets
Definition: pin_wavert.cpp:46
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
INT POOL_TYPE
Definition: typedefs.h:78
uint64_t ULONGLONG
Definition: typedefs.h:67
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:364
IPortFilterWaveRT * m_Filter
Definition: pin_wavert.cpp:29
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
* PFILE_OBJECT
Definition: iotypes.h:1998
VOID NTAPI IoFreeMdl(PMDL Mdl)
Definition: iomdl.c:146
ULONG AddRef()
ULONG m_CommonBufferOffset
Definition: pin_wavert.cpp:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
CPortPinWaveRT * Pin
Definition: pin_wavert.cpp:66
VOID NTAPI CloseStreamRoutine(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
Definition: pin_wavert.cpp:364
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
Definition: arc.h:85
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:318
PIO_WORKITEM WorkItem
Definition: private.hpp:424
NTSTATUS NewPortPinWaveRT(OUT IPortPinWaveRT **OutPin)
Definition: pin_wavert.cpp:676
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:983
ULONG m_PostCompleted
Definition: pin_wavert.cpp:48
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:1550
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
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
KSSTATE
Definition: ks.h:1214
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
virtual ~CPortPinWaveRT()
Definition: pin_wavert.cpp:24
Definition: sacdrv.h:268
PMINIPORTWAVERTSTREAM m_Stream
Definition: pin_wavert.cpp:32
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
KSPIN_CONNECT * m_ConnectDetails
Definition: pin_wavert.cpp:36
PMINIPORTWAVERT GetWaveRTMiniport(IN IPortWaveRT *iface)
#define NULL
Definition: types.h:112
NTSTATUS NTAPI HandleKsStream(IN PIRP Irp)
Definition: pin_wavert.cpp:271
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
struct CLOSESTREAM_CONTEXT * PCLOSESTREAM_CONTEXT
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
IPortPinWaveRT * PPORTPINWAVERT
Definition: interfaces.hpp:722
#define UNIMPLEMENTED
Definition: debug.h:115
char * cleanup(char *str)
Definition: wpickclick.c:99
struct KSIDENTIFIER * PKSPROPERTY
NTSTATUS NTAPI NewIrpQueue(IN IIrpQueue **Queue)
Definition: irpstream.cpp:869
#define STATUS_SUCCESS
Definition: shellext.h:65
struct SETSTREAM_CONTEXT * PSETSTREAM_CONTEXT
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:110
#define DPRINT
Definition: sndvol32.h:71
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
#define UNIMPLEMENTED_ONCE
Definition: typedefs.h:30
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE
VOID NTAPI SetStreamState(IN KSSTATE State)
IoMarkIrpPending(Irp)
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
IIrpQueue * m_IrpQueue
Definition: pin_wavert.cpp:42
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:81
struct _Capture Capture
Definition: capture.h:24
#define Int32x32To64(a, b)
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
KSDATAFORMAT * PKSDATAFORMAT
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: pin_wavert.cpp:75