ReactOS 0.4.15-dev-8116-gf69e256
pin_wavepci.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_wavepci.cpp
5 * PURPOSE: WavePci IRP Audio Pin
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "private.hpp"
10
11#define NDEBUG
12#include <debug.h>
13
14class CPortPinWavePci : public CUnknownImpl<IPortPinWavePci, IServiceSink, IPortWavePciStream>
15{
16public:
18
22 CPortPinWavePci(IUnknown *OuterUnknown) {}
23 virtual ~CPortPinWavePci(){}
24protected:
25
30
31 IPortWavePci * m_Port;
32 IPortFilterWavePci * m_Filter;
33 KSPIN_DESCRIPTOR * m_KsPinDescriptor;
41
44 IIrpQueue * m_IrpQueue;
45
49
53
55
58};
59
60typedef struct
61{
66
71
74
75KSPROPERTY_SET PinWavePciPropertySet[] =
76{
77 {
79 sizeof(PinWavePciConnectionSet) / sizeof(KSPROPERTY_ITEM),
80 (const KSPROPERTY_ITEM*)&PinWavePciConnectionSet,
81 0,
82 NULL
83 },
84 {
86 sizeof(PinWavePciAudioSet) / sizeof(KSPROPERTY_ITEM),
87 (const KSPROPERTY_ITEM*)&PinWavePciAudioSet,
88 0,
89 NULL
90 }
91};
92
96 IN PIRP Irp,
99{
102
103 // get sub device descriptor
104 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
105
106 // sanity check
108 PC_ASSERT(Descriptor->PortPin);
110
111 // cast to pin impl
112 Pin = (CPortPinWavePci*)Descriptor->PortPin;
113
115 {
116 // copy pin framing
117 RtlMoveMemory(Data, &Pin->m_AllocatorFraming, sizeof(KSALLOCATOR_FRAMING));
118
119 Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
120 return STATUS_SUCCESS;
121 }
122
123 // not supported
125}
126
128NTAPI
130 IN PIRP Irp,
133{
136
137 // get sub device descriptor
138 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
139
140 // sanity check
142 PC_ASSERT(Descriptor->PortPin);
144
145 // cast to pin impl
146 Pin = (CPortPinWavePci*)Descriptor->PortPin;
147
148 //sanity check
149 PC_ASSERT(Pin->m_Stream);
150
151 if (Request->Flags & KSPROPERTY_TYPE_GET)
152 {
153 // FIXME non multithreading-safe
154 // copy audio position
155 RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
156
157 DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
158 Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
159 return STATUS_SUCCESS;
160 }
161
162 // not supported
164}
165
167NTAPI
169 IN PIRP Irp,
172{
176 PVOID FirstTag, LastTag;
177 ULONG MappingsRevoked;
179
180 // get sub device descriptor
181 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
182
183 // sanity check
185 PC_ASSERT(Descriptor->PortPin);
187
188 // cast to pin impl
189 Pin = (CPortPinWavePci*)Descriptor->PortPin;
190
191 //sanity check
192 PC_ASSERT(Pin->m_Stream);
193
194 if (Request->Flags & KSPROPERTY_TYPE_SET)
195 {
196 // try set stream
197 Status = Pin->m_Stream->SetState(*State);
198
199 DPRINT("Setting state %u %x\n", *State, Status);
200 if (NT_SUCCESS(Status))
201 {
202 // store new state
203 Pin->m_State = *State;
204 if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && Pin->m_State == KSSTATE_STOP)
205 {
206 // FIXME
207 // complete with successful state
208 Pin->m_IrpQueue->CancelBuffers();
209 while(Pin->m_IrpQueue->GetAcquiredTagRange(&FirstTag, &LastTag))
210 {
211 Status = Pin->m_Stream->RevokeMappings(FirstTag, LastTag, &MappingsRevoked);
212 DPRINT("RevokeMappings Status %lx MappingsRevoked: %lu\n", Status, MappingsRevoked);
214 }
215 Pin->m_Position.PlayOffset = 0;
216 Pin->m_Position.WriteOffset = 0;
217 }
218 else if (Pin->m_State == KSSTATE_STOP)
219 {
220 Pin->m_IrpQueue->CancelBuffers();
221 while(Pin->m_IrpQueue->GetAcquiredTagRange(&FirstTag, &LastTag))
222 {
223 Status = Pin->m_Stream->RevokeMappings(FirstTag, LastTag, &MappingsRevoked);
224 DPRINT("RevokeMappings Status %lx MappingsRevoked: %lu\n", Status, MappingsRevoked);
226 }
227 Pin->m_Position.PlayOffset = 0;
228 Pin->m_Position.WriteOffset = 0;
229 }
230 // store result
231 Irp->IoStatus.Information = sizeof(KSSTATE);
232
233 }
234 // store result
235 Irp->IoStatus.Information = sizeof(KSSTATE);
236 return Status;
237 }
238 else if (Request->Flags & KSPROPERTY_TYPE_GET)
239 {
240 // get current stream state
241 *State = Pin->m_State;
242 // store result
243 Irp->IoStatus.Information = sizeof(KSSTATE);
244
245 return STATUS_SUCCESS;
246 }
247
248 // unsupported request
250}
251
253NTAPI
255 IN PIRP Irp,
258{
262 PIO_STACK_LOCATION IoStack;
263
264 // get current irp stack location
266
267 // get sub device descriptor
268 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
269
270 // sanity check
272 PC_ASSERT(Descriptor->PortPin);
273
274 // cast to pin impl
275 Pin = (CPortPinWavePci*)Descriptor->PortPin;
276
277 //sanity check
278 PC_ASSERT(Pin->m_Stream);
279 PC_ASSERT(Pin->m_Format);
280
281 if (Request->Flags & KSPROPERTY_TYPE_SET)
282 {
283 // try to change data format
284 PKSDATAFORMAT NewDataFormat, DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
285 ULONG Size = min(Pin->m_Format->FormatSize, DataFormat->FormatSize);
286
287 if (RtlCompareMemory(DataFormat, Pin->m_Format, Size) == Size)
288 {
289 // format is identical
290 Irp->IoStatus.Information = DataFormat->FormatSize;
291 return STATUS_SUCCESS;
292 }
293
294 // new change request
295 PC_ASSERT(Pin->m_State == KSSTATE_STOP);
296 // FIXME queue a work item when Irql != PASSIVE_LEVEL
298
299 // allocate new data format
300 NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
301 if (!NewDataFormat)
302 {
303 // not enough memory
304 return STATUS_NO_MEMORY;
305 }
306
307 // copy new data format
308 RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
309
310 // set new format
311 Status = Pin->m_Stream->SetFormat(NewDataFormat);
312 if (NT_SUCCESS(Status))
313 {
314 // free old format
315 FreeItem(Pin->m_Format, TAG_PORTCLASS);
316
317 // store new format
318 Pin->m_Format = NewDataFormat;
319 Irp->IoStatus.Information = NewDataFormat->FormatSize;
320
321#if 0
322 PC_ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
326
327 DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
328 ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
329 ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
330#endif
331
332 }
333 else
334 {
335 // failed to set format
336 FreeItem(NewDataFormat, TAG_PORTCLASS);
337 }
338
339 // done
340 return Status;
341 }
342 else if (Request->Flags & KSPROPERTY_TYPE_GET)
343 {
344 // get current data format
345 PC_ASSERT(Pin->m_Format);
346
347 if (Pin->m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
348 {
349 // buffer too small
350 Irp->IoStatus.Information = Pin->m_Format->FormatSize;
351 return STATUS_MORE_ENTRIES;
352 }
353 // copy data format
354 RtlMoveMemory(Data, Pin->m_Format, Pin->m_Format->FormatSize);
355 // store result size
356 Irp->IoStatus.Information = Pin->m_Format->FormatSize;
357
358 // done
359 return STATUS_SUCCESS;
360 }
361
362 // unsupported request
364}
365
366//==================================================================================================================================
367
369NTAPI
371 IN REFIID refiid,
373{
374 //DPRINT("CPortPinWavePci::QueryInterface entered\n");
375
376 if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
378 {
379 *Output = PVOID(PUNKNOWN((IIrpTarget*)this));
380 PUNKNOWN(*Output)->AddRef();
381 return STATUS_SUCCESS;
382 }
383
384 if (IsEqualGUIDAligned(refiid, IID_IServiceSink))
385 {
386 *Output = PVOID(PSERVICESINK(this));
387 PUNKNOWN(*Output)->AddRef();
388 return STATUS_SUCCESS;
389 }
390
391 if (IsEqualGUIDAligned(refiid, IID_IPortWavePciStream))
392 {
394 PUNKNOWN(*Output)->AddRef();
395 return STATUS_SUCCESS;
396 }
397
398 return STATUS_UNSUCCESSFUL;
399}
400
402NTAPI
403CPortPinWavePci::GetMapping(
404 IN PVOID Tag,
409{
410
412 return m_IrpQueue->GetMappingWithTag(Tag, PhysicalAddress, VirtualAddress, ByteCount, Flags);
413}
414
416NTAPI
417CPortPinWavePci::ReleaseMapping(
418 IN PVOID Tag)
419{
420
422 return m_IrpQueue->ReleaseMappingWithTag(Tag);
423}
424
426NTAPI
427CPortPinWavePci::TerminatePacket()
428{
431 return STATUS_SUCCESS;
432}
433
434VOID
435NTAPI
436CPortPinWavePci::RequestService()
437{
439
440 if (m_State == KSSTATE_RUN)
441 {
442 m_Stream->Service();
443 //TODO
444 //generate events
445 }
446}
447
448//==================================================================================================================================
449
451NTAPI
452CPortPinWavePci::NewIrpTarget(
453 OUT struct IIrpTarget **OutTarget,
454 IN PCWSTR Name,
458 IN PIRP Irp,
459 IN KSOBJECT_CREATE *CreateObject)
460{
462
463 Irp->IoStatus.Information = 0;
464 Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
466
467 return STATUS_UNSUCCESSFUL;
468}
469
471NTAPI
473 IN PIRP Irp)
474{
475 //PKSPROPERTY Property;
477 //UNICODE_STRING GuidString;
478 PIO_STACK_LOCATION IoStack;
479
480 //DPRINT("IPortPinWave_HandleKsProperty entered\n");
481
483
484 if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
485 {
486 //DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
487
488 Irp->IoStatus.Status = STATUS_SUCCESS;
489
491 return STATUS_SUCCESS;
492 }
493
495
497 {
498 //Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
499#if 0
501 //DPRINT("Unhandled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
503#endif
504 }
505
506 if (Status != STATUS_PENDING)
507 {
508 Irp->IoStatus.Status = Status;
510 }
511
512 return Status;
513}
514
516NTAPI
518 IN PIRP Irp)
519{
521 ULONG Data = 0;
523
524 DPRINT("IPortPinWaveCyclic_HandleKsStream entered Total %u State %x MinData %u\n", m_TotalPackets, m_State, m_IrpQueue->NumData());
525
526 Status = m_IrpQueue->AddMapping(Irp, &Data);
527
528 if (NT_SUCCESS(Status))
529 {
530 if (m_Capture)
532 else
534
535 if (m_State == KSSTATE_RUN)
536 {
537 // notify stream of new mapping
538 m_Stream->MappingAvailable();
539 }
540
541 return STATUS_PENDING;
542 }
543
544 return Status;
545}
546
548NTAPI
549CPortPinWavePci::DeviceIoControl(
551 IN PIRP Irp)
552{
553 PIO_STACK_LOCATION IoStack;
554
556
557 if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY)
558 {
559 return HandleKsProperty(Irp);
560 }
561 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM || IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
562 {
563 return HandleKsStream(Irp);
564 }
565
567
568 Irp->IoStatus.Information = 0;
569 Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
571
572 return STATUS_UNSUCCESSFUL;
573}
574
576NTAPI
577CPortPinWavePci::Read(
579 IN PIRP Irp)
580{
582}
583
585NTAPI
586CPortPinWavePci::Write(
588 IN PIRP Irp)
589{
591}
592
594NTAPI
595CPortPinWavePci::Flush(
597 IN PIRP Irp)
598{
600}
601
603NTAPI
604CPortPinWavePci::Close(
606 IN PIRP Irp)
607{
609
610 if (m_Format)
611 {
612 // free format
614
615 // format is freed
616 m_Format = NULL;
617 }
618
619 if (m_IrpQueue)
620 {
621 // cancel remaining irps
622 m_IrpQueue->CancelBuffers();
623
624 // release irp queue
625 m_IrpQueue->Release();
626
627 // queue is freed
629 }
630
631 if (m_ServiceGroup)
632 {
633 // remove member from service group
634 m_ServiceGroup->RemoveMember(PSERVICESINK(this));
635
636 // do not release service group, it is released by the miniport object
638 }
639
640 if (m_Stream)
641 {
642 if (m_State != KSSTATE_STOP)
643 {
644 // stop stream
645 Status = m_Stream->SetState(KSSTATE_STOP);
646 if (!NT_SUCCESS(Status))
647 {
648 DPRINT("Warning: failed to stop stream with %x\n", Status);
649 PC_ASSERT(0);
650 }
651 }
652 // set state to stop
654
655 DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
656
657 // release stream
658 m_Stream->Release();
659
660 // stream is now freed
661 m_Stream = NULL;
662 }
663
664 if (m_Filter)
665 {
666 // disconnect pin from filter
667 m_Filter->FreePin((PPORTPINWAVEPCI)this);
668
669 // release filter reference
670 m_Filter->Release();
671
672 // pin is done with filter
673 m_Filter = NULL;
674 }
675
676 if (m_Port)
677 {
678 // release reference to port driver
679 m_Port->Release();
680
681 // work is done for port
682 m_Port = NULL;
683 }
684
685 // successfully complete irp
686 Irp->IoStatus.Status = STATUS_SUCCESS;
687 Irp->IoStatus.Information = 0;
689
690 return STATUS_SUCCESS;
691}
692
694NTAPI
695CPortPinWavePci::QuerySecurity(
697 IN PIRP Irp)
698{
700}
701
703NTAPI
704CPortPinWavePci::SetSecurity(
706 IN PIRP Irp)
707{
709}
710
712NTAPI
713CPortPinWavePci::FastDeviceIoControl(
721 OUT PIO_STATUS_BLOCK StatusBlock,
723{
724 return FALSE;
725}
726
728NTAPI
729CPortPinWavePci::FastRead(
736 OUT PIO_STATUS_BLOCK StatusBlock,
738{
739 return FALSE;
740}
741
743NTAPI
744CPortPinWavePci::FastWrite(
751 OUT PIO_STATUS_BLOCK StatusBlock,
753{
754 return FALSE;
755}
756
758NTAPI
759CPortPinWavePci::Init(
762 IN KSPIN_CONNECT * ConnectDetails,
763 IN KSPIN_DESCRIPTOR * KsPinDescriptor,
765{
769 ISubdevice * Subdevice = NULL;
770 PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor = NULL;
771
772 // check if it is a source / sink pin
773 if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_IN)
774 {
775 // sink pin
776 Capture = FALSE;
777 }
778 else if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_OUT)
779 {
780 // source pin
781 Capture = TRUE;
782 }
783 else
784 {
785 DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
787 while(TRUE);
788 }
789
790 // add port / filter reference
791 Port->AddRef();
792 Filter->AddRef();
793
794 // initialize pin
795 m_Port = Port;
797 m_KsPinDescriptor = KsPinDescriptor;
798 m_ConnectDetails = ConnectDetails;
803
804 DPRINT("IPortPinWavePci_fnInit entered\n");
805
806 // get dataformat
807 DataFormat = (PKSDATAFORMAT)(ConnectDetails + 1);
808
809 // allocate data format
811 if (!m_Format)
812 {
813 // release references
814 m_Port->Release();
815 m_Filter->Release();
816
817 // no dangling pointers
818 Port = NULL;
819 Filter = NULL;
820
821 // failed to allocate data format
823 }
824
825 // copy data format
827
828 // allocate new stream
829 Status = m_Miniport->NewStream(&m_Stream,
830 NULL,
832 PPORTWAVEPCISTREAM(this),
833 ConnectDetails->PinId,
834 Capture,
835 m_Format,
838
839 DPRINT("IPortPinWavePci_fnInit Status %x\n", Status);
840
841 if (!NT_SUCCESS(Status))
842 {
843 // free references
844 Port->Release();
845 Filter->Release();
846
847 // free data format
849
850 // no dangling pointers
851 m_Port = NULL;
852 m_Filter = NULL;
853 m_Format = NULL;
854
855 // failed to allocate stream
856 return Status;
857 }
858
859 // get allocator requirements for pin
860 Status = m_Stream->GetAllocatorFraming(&m_AllocatorFraming);
861 if (NT_SUCCESS(Status))
862 {
863 DPRINT("OptionFlags %x RequirementsFlag %x PoolType %x Frames %lu FrameSize %lu FileAlignment %lu\n",
865 }
866
867 // allocate new irp queue
869 if (!NT_SUCCESS(Status))
870 {
871 // free references
872 Port->Release();
873 Filter->Release();
874 m_Stream->Release();
875
876 // free data format
878
879 // no dangling pointers
880 m_Port = NULL;
881 m_Filter = NULL;
882 m_Format = NULL;
883 m_Stream = NULL;
884
885 // failed to allocate irp queue
886 return Status;
887 }
888
889 // initialize irp queue
890 Status = m_IrpQueue->Init(ConnectDetails, KsPinDescriptor, m_AllocatorFraming.FrameSize, m_AllocatorFraming.FileAlignment, TRUE);
891 if (!NT_SUCCESS(Status))
892 {
893 // this should never happen
894 ASSERT(0);
895 }
896
897 // get subdevice interface
898 Status = Port->QueryInterface(IID_ISubdevice, (PVOID*)&Subdevice);
899
900 if (!NT_SUCCESS(Status))
901 {
902 // this function should never fail
903 ASSERT(0);
904 }
905
906 // get subdevice descriptor
907 Status = Subdevice->GetDescriptor(&SubDeviceDescriptor);
908 if (!NT_SUCCESS(Status))
909 {
910 // this function should never fail
911 ASSERT(0);
912 }
913
914 // release subdevice
915 Subdevice->Release();
916
917 /* set up subdevice descriptor */
920 m_Descriptor.FilterPropertySetCount = sizeof(PinWavePciPropertySet) / sizeof(KSPROPERTY_SET);
922 m_Descriptor.DeviceDescriptor = SubDeviceDescriptor->DeviceDescriptor;
923 m_Descriptor.UnknownMiniport = SubDeviceDescriptor->UnknownMiniport;
924 m_Descriptor.PortPin = (PVOID)this;
925
926 if (m_ServiceGroup)
927 {
928 Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
929 if (!NT_SUCCESS(Status))
930 {
931 // free references
932 m_Stream->Release();
933 Port->Release();
934 Filter->Release();
935
936 // free data format
938
939 // no dangling pointers
940 m_Stream = NULL;
941 m_Port = NULL;
942 m_Filter = NULL;
943 m_Format = NULL;
944
945 // failed to add to service group
946 return Status;
947 }
948 }
949
950 return STATUS_SUCCESS;
951}
952
953PVOID
954NTAPI
955CPortPinWavePci::GetIrpStream()
956{
957 return (PVOID)m_IrpQueue;
958}
959
961NTAPI
962CPortPinWavePci::GetMiniport()
963{
964 return (PMINIPORT)m_Miniport;
965}
966
969 OUT IPortPinWavePci ** OutPin)
970{
972
974 if (!This)
976
977 This->AddRef();
978
979 // store result
980 *OutPin = (IPortPinWavePci*)This;
981
982 return STATUS_SUCCESS;
983}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
unsigned char BOOLEAN
#define InterlockedIncrement
Definition: armddk.h:53
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
IPortPinWavePci * PPORTPINWAVEPCI
Definition: interfaces.hpp:667
IPortFilterWavePci * PPORTFILTERWAVEPCI
Definition: interfaces.hpp:618
LONG NTSTATUS
Definition: precomp.h:26
#define STDMETHODIMP
Definition: basetyps.h:43
const GUID IID_IUnknown
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:81
#define UNIMPLEMENTED
Definition: debug.h:118
struct _Capture Capture
Definition: capture.h:24
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
Definition: bufpool.h:45
KSPIN_DESCRIPTOR * m_KsPinDescriptor
Definition: pin_wavepci.cpp:33
ULONG m_PrefetchOffset
Definition: pin_wavepci.cpp:51
IPortFilterWavePci * m_Filter
Definition: pin_wavepci.cpp:32
CPortPinWavePci(IUnknown *OuterUnknown)
Definition: pin_wavepci.cpp:22
friend NTSTATUS NTAPI PinWavePciAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
Definition: pin_wavepci.cpp:95
KSPIN_CONNECT * m_ConnectDetails
Definition: pin_wavepci.cpp:40
friend NTSTATUS NTAPI PinWavePciState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
KSAUDIO_POSITION m_Position
Definition: pin_wavepci.cpp:47
NTSTATUS NTAPI HandleKsStream(IN PIRP Irp)
PDMACHANNEL m_DmaChannel
Definition: pin_wavepci.cpp:36
PSERVICEGROUP m_ServiceGroup
Definition: pin_wavepci.cpp:35
PMINIPORTWAVEPCISTREAM m_Stream
Definition: pin_wavepci.cpp:37
friend NTSTATUS NTAPI PinWavePciDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
virtual ~CPortPinWavePci()
Definition: pin_wavepci.cpp:23
SUBDEVICE_DESCRIPTOR m_Descriptor
Definition: pin_wavepci.cpp:52
NTSTATUS NTAPI HandleKsProperty(IN PIRP Irp)
friend NTSTATUS NTAPI PinWavePciAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
IIrpQueue * m_IrpQueue
Definition: pin_wavepci.cpp:44
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
PMINIPORTWAVEPCI m_Miniport
Definition: pin_wavepci.cpp:34
PDEVICE_OBJECT m_DeviceObject
Definition: pin_wavepci.cpp:43
KSALLOCATOR_FRAMING m_AllocatorFraming
Definition: pin_wavepci.cpp:54
PKSDATAFORMAT m_Format
Definition: pin_wavepci.cpp:39
IPortWavePci * m_Port
Definition: pin_wavepci.cpp:31
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
_In_ PIRP Irp
Definition: csq.h:116
KSDATAFORMAT * PKSDATAFORMAT
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1189
#define DEFINE_KSPROPERTY_CONNECTIONSET(PinSet, PropStateHandler, PropDataFormatHandler, PropAllocatorFraming)
Definition: precomp.h:42
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define NonPagedPool
Definition: env_spec_w32.h:307
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2665
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
unsigned int BOOL
Definition: ntddk_ex.h:94
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
Status
Definition: gdiplustypes.h:25
CPPORT Port[4]
Definition: headless.c:35
@ Unknown
Definition: i8042prt.h:114
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
ULONG AddRef()
nsrefcnt Release()
NTSTATUS NTAPI NewIrpQueue(IN IIrpQueue **Queue)
Definition: irpstream.cpp:864
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
enum KSSTATE * PKSSTATE
KSSTATE
Definition: ks.h:1214
@ KSSTATE_RUN
Definition: ks.h:1218
@ KSSTATE_STOP
Definition: ks.h:1215
@ KSPIN_DATAFLOW_IN
Definition: ks.h:1249
@ KSPIN_DATAFLOW_OUT
Definition: ks.h:1250
#define KSPROPSETID_Connection
Definition: ks.h:346
@ KSPIN_COMMUNICATION_SINK
Definition: ks.h:1255
#define IOCTL_KS_READ_STREAM
Definition: ks.h:142
@ KSINTERFACE_STANDARD_LOOPED_STREAMING
Definition: ks.h:284
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:139
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:29
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:983
#define KSPROPSETID_Audio
Definition: ksmedia.h:1051
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:1031
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
static PWSTR GuidString
Definition: apphelp.c:93
#define min(a, b)
Definition: monoChain.cc:55
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
NTSTATUS NewPortPinWavePci(OUT IPortPinWavePci **OutPin)
NTSTATUS NTAPI PinWavePciAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
Definition: pin_wavepci.cpp:95
NTSTATUS NTAPI PinWavePciState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
NTSTATUS NTAPI PinWavePciDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
struct SETSTREAM_CONTEXT * PSETSTREAM_CONTEXT
NTSTATUS NTAPI PinWavePciAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
KSPROPERTY_SET PinWavePciPropertySet[]
Definition: pin_wavepci.cpp:75
PMINIPORTWAVEPCI GetWavePciMiniport(PPORTWAVEPCI iface)
IDmaChannel * PDMACHANNEL
Definition: portcls.h:784
IServiceSink * PSERVICESINK
Definition: portcls.h:569
IMiniportWavePciStream * PMINIPORTWAVEPCISTREAM
Definition: portcls.h:1643
IPortWavePciStream * PPORTWAVEPCISTREAM
Definition: portcls.h:1590
IMiniportWavePci * PMINIPORTWAVEPCI
Definition: portcls.h:1697
IServiceGroup * PSERVICEGROUP
Definition: portcls.h:614
IPortWavePci * PPORTWAVEPCI
Definition: portcls.h:1248
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30
#define TAG_PORTCLASS
Definition: private.hpp:24
#define PC_ASSERT(exp)
Definition: private.hpp:26
#define DEFINE_KSPROPERTY_AUDIOSET(PinSet, PropPositionHandler)
Definition: private.hpp:357
NTSTATUS NTAPI PcHandlePropertyWithTable(IN PIRP Irp, IN ULONG PropertySetCount, IN PKSPROPERTY_SET PropertySet, IN PSUBDEVICE_DESCRIPTOR Descriptor)
Definition: undoc.cpp:78
#define REFIID
Definition: guiddef.h:118
@ Output
Definition: arc.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define DPRINT
Definition: sndvol32.h:73
ULONG PoolType
Definition: ks.h:1668
ULONG RequirementsFlags
Definition: ks.h:1663
ULONG OptionsFlags
Definition: ks.h:1662
ULONG Frames
Definition: ks.h:1670
ULONG FileAlignment
Definition: ks.h:1672
ULONG FrameSize
Definition: ks.h:1671
DWORDLONG WriteOffset
Definition: ksmedia.h:1251
DWORDLONG PlayOffset
Definition: ksmedia.h:1250
CPortPinWavePci * Pin
Definition: pin_wavepci.cpp:62
PPCFILTER_DESCRIPTOR DeviceDescriptor
Definition: interfaces.hpp:217
PKSPROPERTY_SET FilterPropertySet
Definition: interfaces.hpp:210
struct _IO_STACK_LOCATION::@1568::@1569 DeviceIoControl
union _IO_STACK_LOCATION::@1568 Parameters
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
INT POOL_TYPE
Definition: typedefs.h:78
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:115
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
#define IO_NO_INCREMENT
Definition: iotypes.h:598
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
Definition: iotypes.h:1099
* PFILE_OBJECT
Definition: iotypes.h:1998