ReactOS 0.4.15-dev-8109-gd7be748
pin_wavecyclic.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_wavecyclic.cpp
5 * PURPOSE: WaveCyclic IRP Audio Pin
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "private.hpp"
10
11#define NDEBUG
12#include <debug.h>
13
14class CPortPinWaveCyclic : public CUnknownImpl<IPortPinWaveCyclic, IServiceSink>
15{
16public:
17 inline
18 PVOID
19 operator new(
20 size_t Size,
22 ULONG Tag)
23 {
25 }
26
28
32 m_Port(nullptr),
33 m_Filter(nullptr),
34 m_KsPinDescriptor(nullptr),
35 m_Miniport(nullptr),
36 m_ServiceGroup(nullptr),
37 m_DmaChannel(nullptr),
38 m_Stream(nullptr),
40 m_Format(nullptr),
41 m_ConnectDetails(nullptr),
42 m_CommonBuffer(nullptr),
45 m_IrpQueue(nullptr),
46 m_FrameSize(0),
49 m_StopCount(0),
50 m_Position({0}),
51 m_AllocatorFraming({{0}}),
52 m_Descriptor(nullptr),
54 m_EventList({nullptr}),
56 m_Delay(0)
57 {
58 }
60
61protected:
62
63 VOID UpdateCommonBuffer(ULONG Position, ULONG MaxTransferCount);
65 VOID GeneratePositionEvents(IN ULONGLONG OldOffset, IN ULONGLONG NewOffset);
66
74
75 IPortWaveCyclic * m_Port;
76 IPortFilterWaveCyclic * m_Filter;
77 KSPIN_DESCRIPTOR * m_KsPinDescriptor;
85
89
90 IIrpQueue * m_IrpQueue;
91
94
100
103
105
107};
108
109typedef struct
110{
114
115typedef struct
116{
119
127
131
133{
135 sizeof(KSEVENTDATA),
138 0,
139 0
140};
141
143{
148 0,
149 0
150};
151
152KSPROPERTY_SET PinWaveCyclicPropertySet[] =
153{
154 {
156 sizeof(PinWaveCyclicConnectionSet) / sizeof(KSPROPERTY_ITEM),
157 (const KSPROPERTY_ITEM*)&PinWaveCyclicConnectionSet,
158 0,
159 NULL
160 },
161 {
163 sizeof(PinWaveCyclicAudioSet) / sizeof(KSPROPERTY_ITEM),
164 (const KSPROPERTY_ITEM*)&PinWaveCyclicAudioSet,
165 0,
166 NULL
167 },
168 {
170 sizeof(PinWaveCyclicDRMSet) / sizeof(KSPROPERTY_ITEM),
171 (const KSPROPERTY_ITEM*)&PinWaveCyclicDRMSet,
172 0,
173 NULL
174 }
175};
176
178{
179 {
181 sizeof(PinWaveCyclicStreamingEventSet) / sizeof(KSEVENT_ITEM),
182 (const KSEVENT_ITEM*)&PinWaveCyclicStreamingEventSet
183 },
184 {
186 sizeof(PinWaveCyclicConnectionEventSet) / sizeof(KSEVENT_ITEM),
187 (const KSEVENT_ITEM*)&PinWaveCyclicConnectionEventSet
188 }
189};
190
191//==================================================================================================================================
192
194NTAPI
196 IN REFIID refiid,
198{
199 DPRINT("IServiceSink_fnQueryInterface entered\n");
200
201 if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
203 {
204 *Output = PVOID(PUNKNOWN((IIrpTarget*)this));
205 PUNKNOWN(*Output)->AddRef();
206 return STATUS_SUCCESS;
207 }
208
209 if (IsEqualGUIDAligned(refiid, IID_IServiceSink))
210 {
212 PUNKNOWN(*Output)->AddRef();
213 return STATUS_SUCCESS;
214 }
215
216 return STATUS_UNSUCCESSFUL;
217}
218
220NTAPI
222 IN PIRP Irp,
225{
226 DPRINT1("PinWaveCyclicDRMHandler\n");
227 ASSERT(0);
229}
230
232NTAPI
234 IN PIRP Irp,
235 IN PKSEVENTDATA EventData,
236 IN PKSEVENT_ENTRY EventEntry)
237{
241
242 // get sub device descriptor
243 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
244
245 // sanity check
247 PC_ASSERT(Descriptor->PortPin);
249
250 // cast to pin impl
251 Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
252
253 // get extra size
254 Entry = (PENDOFSTREAM_EVENT_CONTEXT)(EventEntry + 1);
255
256 // not a looped event
257 Entry->bLoopedStreaming = FALSE;
258
259 // insert item
260 (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
261
262 // done
263 return STATUS_SUCCESS;
264}
265
267NTAPI
269 IN PIRP Irp,
270 IN PKSEVENTDATA EventData,
271 IN PKSEVENT_ENTRY EventEntry)
272{
277
278 // get sub device descriptor
279 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
280
281 // sanity check
283 PC_ASSERT(Descriptor->PortPin);
285
286 // cast to pin impl
287 Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
288
289 // cast to looped event
291
292 // get extra size
293 Entry = (PLOOPEDSTREAMING_EVENT_CONTEXT)(EventEntry + 1);
294
295 Entry->bLoopedStreaming = TRUE;
296 Entry->Position = Data->Position;
297
298 DPRINT1("Added event\n");
299
300 // insert item
301 (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
302
303 // done
304 return STATUS_SUCCESS;
305}
306
308NTAPI
310 IN PIRP Irp,
313{
316
317 // get sub device descriptor
318 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
319
320 // sanity check
322 PC_ASSERT(Descriptor->PortPin);
324
325 // cast to pin impl
326 Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
327
329 {
330 // copy pin framing
331 RtlMoveMemory(Data, &Pin->m_AllocatorFraming, sizeof(KSALLOCATOR_FRAMING));
332
333 Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
334 return STATUS_SUCCESS;
335 }
336
337 // not supported
339}
340
342NTAPI
344 IN PIRP Irp,
347{
351
352 // get sub device descriptor
353 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
354
355 // sanity check
357 PC_ASSERT(Descriptor->PortPin);
359
360 // cast to pin impl
361 Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
362
363 //sanity check
364 PC_ASSERT(Pin->m_Stream);
365
366 if (Request->Flags & KSPROPERTY_TYPE_GET)
367 {
368 // FIXME non multithreading-safe
369 // copy audio position
370
372
373 if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_STREAMING)
374 {
375 RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
376 DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
377 }
378 else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
379 {
380 Position->PlayOffset = Pin->m_Position.PlayOffset;
381 Position->WriteOffset = (ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset();
382 DPRINT("Play %lu Write %lu\n", Position->PlayOffset, Position->WriteOffset);
383 }
384
385 Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
386 return STATUS_SUCCESS;
387 }
388
389 // not supported
391}
392
393typedef struct
394{
399
401
402VOID
407{
408 PSETPIN_CONTEXT PinWorkContext = (PSETPIN_CONTEXT)Context;
410
411 // try set stream
412 Status = PinWorkContext->Pin->m_Stream->SetState(PinWorkContext->NewState);
413
414 DPRINT1("Setting state %u %x\n", PinWorkContext->NewState, Status);
415 if (NT_SUCCESS(Status))
416 {
417 // store new state
418 PinWorkContext->Pin->m_State = PinWorkContext->NewState;
419
420 if (PinWorkContext->Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && PinWorkContext->Pin->m_State == KSSTATE_STOP)
421 {
422 /* FIXME complete pending irps with successful state */
423 PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
424 }
425 //HACK
426 //PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
427 }
428
429 // store result
430 PinWorkContext->Irp->IoStatus.Information = sizeof(KSSTATE);
431 PinWorkContext->Irp->IoStatus.Status = Status;
432
433 // complete irp
434 IoCompleteRequest(PinWorkContext->Irp, IO_NO_INCREMENT);
435
436 // free work item
437 IoFreeWorkItem(PinWorkContext->WorkItem);
438
439 // free work context
440 FreeItem(PinWorkContext, TAG_PORTCLASS);
441
442}
443
445NTAPI
447 IN PIRP Irp,
450{
455
456 // get sub device descriptor
457 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
458
459 // sanity check
461 PC_ASSERT(Descriptor->PortPin);
463
464 // cast to pin impl
465 Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
466
467 //sanity check
468 PC_ASSERT(Pin->m_Stream);
469
470 if (Request->Flags & KSPROPERTY_TYPE_SET)
471 {
472 // try set stream
473 Status = Pin->m_Stream->SetState(*State);
474
475 DPRINT("Setting state %u %x\n", *State, Status);
476 if (NT_SUCCESS(Status))
477 {
478 // store new state
479 Pin->m_State = *State;
480
481 if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && Pin->m_State == KSSTATE_STOP)
482 {
483 // FIXME
484 // complete with successful state
485 Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
486 Pin->m_IrpQueue->CancelBuffers();
487 Pin->m_Position.PlayOffset = 0;
488 Pin->m_Position.WriteOffset = 0;
489 }
490 else if (Pin->m_State == KSSTATE_STOP)
491 {
492 Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
493 Pin->m_IrpQueue->CancelBuffers();
494 Pin->m_Position.PlayOffset = 0;
495 Pin->m_Position.WriteOffset = 0;
496 }
497 // store result
498 Irp->IoStatus.Information = sizeof(KSSTATE);
499 }
500 return Status;
501 }
502 else if (Request->Flags & KSPROPERTY_TYPE_GET)
503 {
504 // get current stream state
505 *State = Pin->m_State;
506 // store result
507 Irp->IoStatus.Information = sizeof(KSSTATE);
508
509 return STATUS_SUCCESS;
510 }
511
512 // unsupported request
514}
515
517NTAPI
519 IN PIRP Irp,
522{
526 PIO_STACK_LOCATION IoStack;
527
528 // get current irp stack location
530
531 // get sub device descriptor
532 Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
533
534 // sanity check
536 PC_ASSERT(Descriptor->PortPin);
537
538 // cast to pin impl
539 Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
540
541 //sanity check
542 PC_ASSERT(Pin->m_Stream);
543 PC_ASSERT(Pin->m_Format);
544
545 if (Request->Flags & KSPROPERTY_TYPE_SET)
546 {
547 // try to change data format
548 PKSDATAFORMAT NewDataFormat, DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
549 ULONG Size = min(Pin->m_Format->FormatSize, DataFormat->FormatSize);
550
551 if (RtlCompareMemory(DataFormat, Pin->m_Format, Size) == Size)
552 {
553 // format is identical
554 Irp->IoStatus.Information = DataFormat->FormatSize;
555 return STATUS_SUCCESS;
556 }
557
558 // new change request
559 PC_ASSERT(Pin->m_State != KSSTATE_RUN);
560 // FIXME queue a work item when Irql != PASSIVE_LEVEL
562
563 // allocate new data format
564 NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
565 if (!NewDataFormat)
566 {
567 // not enough memory
568 return STATUS_NO_MEMORY;
569 }
570
571 // copy new data format
572 RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
573
574 // set new format
575 Status = Pin->m_Stream->SetFormat(NewDataFormat);
576 if (NT_SUCCESS(Status))
577 {
578 // free old format
579 FreeItem(Pin->m_Format, TAG_PORTCLASS);
580
581 // store new format
582 Pin->m_Format = NewDataFormat;
583 Irp->IoStatus.Information = NewDataFormat->FormatSize;
584
585#if 0
586 PC_ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
590
591 DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
592 ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
593 ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
594#endif
595
596 }
597 else
598 {
599 // failed to set format
600 FreeItem(NewDataFormat, TAG_PORTCLASS);
601 }
602
603 // done
604 return Status;
605 }
606 else if (Request->Flags & KSPROPERTY_TYPE_GET)
607 {
608 // get current data format
609 PC_ASSERT(Pin->m_Format);
610
611 if (Pin->m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
612 {
613 // buffer too small
614 Irp->IoStatus.Information = Pin->m_Format->FormatSize;
615 return STATUS_MORE_ENTRIES;
616 }
617 // copy data format
618 RtlMoveMemory(Data, Pin->m_Format, Pin->m_Format->FormatSize);
619 // store result size
620 Irp->IoStatus.Information = Pin->m_Format->FormatSize;
621
622 // done
623 return STATUS_SUCCESS;
624 }
625
626 // unsupported request
628}
629
630VOID
632 IN ULONGLONG OldOffset,
633 IN ULONGLONG NewOffset)
634{
636 PKSEVENT_ENTRY EventEntry;
638
639 // acquire event lock
641
642 // point to first entry
644
645 while(Entry != &m_EventList)
646 {
647 // get event entry
648 EventEntry = (PKSEVENT_ENTRY)CONTAINING_RECORD(Entry, KSEVENT_ENTRY, ListEntry);
649
650 // get event entry context
651 Context = (PLOOPEDSTREAMING_EVENT_CONTEXT)(EventEntry + 1);
652
653 if (Context->bLoopedStreaming != FALSE)
654 {
655 if (NewOffset > OldOffset)
656 {
657 /* buffer progress no overlap */
658 if (OldOffset < Context->Position && Context->Position <= NewOffset)
659 {
660 /* when someone eventually fixes sprintf... */
661 DPRINT("Generating event at OldOffset %I64u\n", OldOffset);
662 DPRINT("Context->Position %I64u\n", Context->Position);
663 DPRINT("NewOffset %I64u\n", NewOffset);
664 /* generate event */
665 KsGenerateEvent(EventEntry);
666 }
667 }
668 else
669 {
670 /* buffer wrap-arround */
671 if (OldOffset < Context->Position || NewOffset > Context->Position)
672 {
673 /* when someone eventually fixes sprintf... */
674 DPRINT("Generating event at OldOffset %I64u\n", OldOffset);
675 DPRINT("Context->Position %I64u\n", Context->Position);
676 DPRINT("NewOffset %I64u\n", NewOffset);
677 /* generate event */
678 KsGenerateEvent(EventEntry);
679 }
680 }
681 }
682
683 // move to next entry
684 Entry = Entry->Flink;
685 }
686
687 // release lock
689}
690
691VOID
694 ULONG MaxTransferCount)
695{
699 ULONG Gap;
702
704 BufferLength = min(BufferLength, MaxTransferCount);
705
706 while(BufferLength)
707 {
708 Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
709 if (!NT_SUCCESS(Status))
710 {
712 if (Gap > BufferLength)
713 {
714 // insert silence samples
715 DPRINT("Inserting Silence Buffer Offset %lu GapLength %lu\n", m_CommonBufferOffset, BufferLength);
717
719 }
720 break;
721 }
722
724
725 if (m_Capture)
726 {
728 }
729 else
730 {
732 }
733
734 m_IrpQueue->UpdateMapping(BytesToCopy);
736
739
741 {
743 {
744 // normalize position
746 }
747 }
748 }
749}
750
751VOID
754 ULONG MaxTransferCount)
755{
761
763 BufferLength = Length = min(BufferLength, MaxTransferCount);
764 while(BufferLength)
765 {
766 Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
767 if (!NT_SUCCESS(Status))
768 {
770 if (Gap > BufferLength)
771 {
772 // insert silence samples
773 DPRINT("Overlap Inserting Silence Buffer Size %lu Offset %lu Gap %lu Position %lu\n", m_CommonBufferSize, m_CommonBufferOffset, Gap, Position);
775
777 }
778 break;
779 }
780
782
783 if (m_Capture)
784 {
785 m_DmaChannel->CopyFrom(Buffer,
788 }
789 else
790 {
792 Buffer,
794 }
795
796 m_IrpQueue->UpdateMapping(BytesToCopy);
799
801
803 {
805 {
806 // normalize position
808 }
809 }
810 }
811
812 if (Gap == Length)
813 {
815
816 MaxTransferCount -= Length;
817
818 if (MaxTransferCount)
819 {
820 UpdateCommonBuffer(Position, MaxTransferCount);
821 }
822 }
823}
824
825VOID
826NTAPI
827CPortPinWaveCyclic::RequestService()
828{
830 ULONGLONG OldOffset, NewOffset;
831
833
835 {
836 m_Stream->GetPosition(&Position);
837
838 OldOffset = m_Position.PlayOffset;
839
841 {
843 }
844 else if (Position >= m_CommonBufferOffset)
845 {
847 }
848
849 NewOffset = m_Position.PlayOffset;
850
851 GeneratePositionEvents(OldOffset, NewOffset);
852 }
853}
854
856NTAPI
857CPortPinWaveCyclic::NewIrpTarget(
858 OUT struct IIrpTarget **OutTarget,
859 IN PCWSTR Name,
863 IN PIRP Irp,
864 IN KSOBJECT_CREATE *CreateObject)
865{
867 return STATUS_UNSUCCESSFUL;
868}
869
871NTAPI
872CPortPinWaveCyclic::DeviceIoControl(
874 IN PIRP Irp)
875{
876 PIO_STACK_LOCATION IoStack;
880 ULONG Data = 0;
881 KSRESET ResetValue;
882
883 /* get current irp stack location */
885
886 if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_PROPERTY)
887 {
888 /* handle property with subdevice descriptor */
890
892 {
893 Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
894
896 DPRINT("Unhandled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
898 }
899 }
900 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_ENABLE_EVENT)
901 {
903 }
904 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_DISABLE_EVENT)
905 {
907 }
908 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_RESET_STATE)
909 {
910 Status = KsAcquireResetValue(Irp, &ResetValue);
911 DPRINT("Status %x Value %u\n", Status, ResetValue);
912 /* check for success */
913 if (NT_SUCCESS(Status))
914 {
915 //determine state of reset request
916 if (ResetValue == KSRESET_BEGIN)
917 {
918 // start reset process
919 // incoming read/write requests will be rejected
921
922 // cancel existing buffers
923 m_IrpQueue->CancelBuffers();
924 }
925 else if (ResetValue == KSRESET_END)
926 {
927 // end of reset process
929 }
930 }
931 }
932 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM || IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
933 {
934 /* increment total number of packets */
936
937 DPRINT("New Packet Total %u State %x MinData %u\n", m_TotalPackets, m_State, m_IrpQueue->NumData());
938
939 /* is the device not currently reset */
941 {
942 /* add the mapping */
943 Status = m_IrpQueue->AddMapping(Irp, &Data);
944
945 /* check for success */
946 if (NT_SUCCESS(Status))
947 {
950 }
951 }
952 else
953 {
954 /* reset request is currently in progress */
956 DPRINT1("NotReady\n");
957 }
958 }
959 else
960 {
962 }
963
964 if (Status != STATUS_PENDING)
965 {
966 Irp->IoStatus.Status = Status;
968 }
969
970 return Status;
971}
972
974NTAPI
975CPortPinWaveCyclic::Read(
977 IN PIRP Irp)
978{
980}
981
983NTAPI
984CPortPinWaveCyclic::Write(
986 IN PIRP Irp)
987{
989}
990
992NTAPI
993CPortPinWaveCyclic::Flush(
995 IN PIRP Irp)
996{
998}
999
1001NTAPI
1002CPortPinWaveCyclic::Close(
1004 IN PIRP Irp)
1005{
1006 DPRINT("CPortPinWaveCyclic::Close entered\n");
1007
1009
1010 if (m_Format)
1011 {
1012 // free format
1014
1015 // format is freed
1016 m_Format = NULL;
1017 }
1018
1019 if (m_IrpQueue)
1020 {
1021 // cancel remaining irps
1022 m_IrpQueue->CancelBuffers();
1023
1024 // release irp queue
1025 m_IrpQueue->Release();
1026
1027 // queue is freed
1028 m_IrpQueue = NULL;
1029 }
1030
1031 if (m_ServiceGroup)
1032 {
1033 // remove member from service group
1034 m_ServiceGroup->RemoveMember(PSERVICESINK(this));
1035
1036 // do not release service group, it is released by the miniport object
1038 }
1039
1040 if (m_Stream)
1041 {
1042 if (m_State != KSSTATE_STOP)
1043 {
1044 // stop stream
1045 NTSTATUS Status = m_Stream->SetState(KSSTATE_STOP);
1046 if (!NT_SUCCESS(Status))
1047 {
1048 DPRINT("Warning: failed to stop stream with %x\n", Status);
1049 PC_ASSERT(0);
1050 }
1051 }
1052 // set state to stop
1054
1055 DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql());
1056
1057 // release stream
1058 m_Stream->Release();
1059
1060 // stream is now freed
1061 m_Stream = NULL;
1062 }
1063
1064 if (m_Filter)
1065 {
1066 // disconnect pin from filter
1067 m_Filter->FreePin((PPORTPINWAVECYCLIC)this);
1068
1069 // release filter reference
1070 m_Filter->Release();
1071
1072 // pin is done with filter
1073 m_Filter = NULL;
1074 }
1075
1076 if (m_Port)
1077 {
1078 // release reference to port driver
1079 m_Port->Release();
1080
1081 // work is done for port
1082 m_Port = NULL;
1083 }
1084
1085 Irp->IoStatus.Information = 0;
1086 Irp->IoStatus.Status = STATUS_SUCCESS;
1088
1089 delete this;
1090
1091 return STATUS_SUCCESS;
1092}
1093
1095NTAPI
1096CPortPinWaveCyclic::QuerySecurity(
1098 IN PIRP Irp)
1099{
1101}
1102
1104NTAPI
1105CPortPinWaveCyclic::SetSecurity(
1107 IN PIRP Irp)
1108{
1110}
1111
1112BOOLEAN
1113NTAPI
1114CPortPinWaveCyclic::FastDeviceIoControl(
1116 IN BOOLEAN Wait,
1122 OUT PIO_STATUS_BLOCK StatusBlock,
1124{
1126}
1127
1128BOOLEAN
1129NTAPI
1130CPortPinWaveCyclic::FastRead(
1133 IN ULONG Length,
1134 IN BOOLEAN Wait,
1136 IN PVOID Buffer,
1137 OUT PIO_STATUS_BLOCK StatusBlock,
1139{
1141}
1142
1143BOOLEAN
1144NTAPI
1145CPortPinWaveCyclic::FastWrite(
1148 IN ULONG Length,
1149 IN BOOLEAN Wait,
1151 IN PVOID Buffer,
1152 OUT PIO_STATUS_BLOCK StatusBlock,
1154{
1156}
1157
1159NTAPI
1160CPortPinWaveCyclic::Init(
1163 IN KSPIN_CONNECT * ConnectDetails,
1164 IN KSPIN_DESCRIPTOR * KsPinDescriptor)
1165{
1168 //PDEVICE_OBJECT DeviceObject;
1170 PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor = NULL;
1171 //IDrmAudioStream * DrmAudio = NULL;
1172
1173 m_KsPinDescriptor = KsPinDescriptor;
1174 m_ConnectDetails = ConnectDetails;
1176
1177 //DeviceObject = GetDeviceObject(Port);
1178
1179 DataFormat = (PKSDATAFORMAT)(ConnectDetails + 1);
1180
1181 DPRINT("CPortPinWaveCyclic::Init entered Size %u\n", DataFormat->FormatSize);
1182
1184 if (!NT_SUCCESS(Status))
1185 return Status;
1186
1187 if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_IN)
1188 {
1189 Capture = FALSE;
1190 }
1191 else if (KsPinDescriptor->Communication == KSPIN_COMMUNICATION_SINK && KsPinDescriptor->DataFlow == KSPIN_DATAFLOW_OUT)
1192 {
1193 Capture = TRUE;
1194 }
1195 else
1196 {
1197 DPRINT("Unexpected Communication %u DataFlow %u\n", KsPinDescriptor->Communication, KsPinDescriptor->DataFlow);
1198 DbgBreakPoint();
1199 while(TRUE);
1200 }
1201
1202 Status = m_Miniport->NewStream(&m_Stream,
1203 NULL,
1205 ConnectDetails->PinId,
1206 Capture,
1207 DataFormat,
1208 &m_DmaChannel,
1210#if 0
1211 Status = m_Stream->QueryInterface(IID_IDrmAudioStream, (PVOID*)&DrmAudio);
1212 if (NT_SUCCESS(Status))
1213 {
1215 DPRINT("Got IID_IDrmAudioStream interface %p\n", DrmAudio);
1216
1218 DrmRights.Reserved = 0;
1220
1221 Status = DrmAudio->SetContentId(1, &DrmRights);
1222 DPRINT("Status %x\n", Status);
1223 }
1224#endif
1225
1226 DPRINT1("CPortPinWaveCyclic::Init Status %x PinId %u Capture %u\n", Status, ConnectDetails->PinId, Capture);
1227
1228 if (!NT_SUCCESS(Status))
1229 return Status;
1230
1231 ISubdevice * Subdevice = NULL;
1232 // get subdevice interface
1233 Status = Port->QueryInterface(IID_ISubdevice, (PVOID*)&Subdevice);
1234
1235 if (!NT_SUCCESS(Status))
1236 return Status;
1237
1238 Status = Subdevice->GetDescriptor(&SubDeviceDescriptor);
1239 if (!NT_SUCCESS(Status))
1240 {
1241 // failed to get descriptor
1242 Subdevice->Release();
1243 return Status;
1244 }
1245
1246 /* initialize event management */
1249
1251 SubDeviceDescriptor->InterfaceCount,
1252 SubDeviceDescriptor->Interfaces,
1253 0, /* FIXME KSINTERFACE_STANDARD with KSINTERFACE_STANDARD_STREAMING / KSINTERFACE_STANDARD_LOOPED_STREAMING */
1254 NULL,
1255 sizeof(PinWaveCyclicPropertySet) / sizeof(KSPROPERTY_SET),
1257 0,
1258 0,
1259 0,
1260 NULL,
1261 sizeof(PinWaveCyclicEventSet) / sizeof(KSEVENT_SET),
1263 SubDeviceDescriptor->DeviceDescriptor);
1264
1266 m_Descriptor->UnknownMiniport = SubDeviceDescriptor->UnknownMiniport;
1267 m_Descriptor->PortPin = (PVOID)this;
1270
1271 // initialize reset state
1273
1274 // release subdevice descriptor
1275 Subdevice->Release();
1276
1277 // add ourselves to service group
1278 Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
1279 if (!NT_SUCCESS(Status))
1280 {
1281 DPRINT("Failed to add pin to service group\n");
1282 return Status;
1283 }
1284
1285 m_Stream->SetState(KSSTATE_STOP);
1288 m_CommonBufferSize = m_DmaChannel->BufferSize();
1289 m_CommonBuffer = m_DmaChannel->SystemAddress();
1291 // delay of 10 millisec
1292 m_Delay = Int32x32To64(10, -10000);
1293
1294 // sanity checks
1297
1298 Status = m_Stream->SetNotificationFreq(10, &m_FrameSize);
1301
1302 DPRINT1("Bits %u Samples %u Channels %u Tag %u FrameSize %u CommonBufferSize %lu, CommonBuffer %p\n", ((PKSDATAFORMAT_WAVEFORMATEX)(DataFormat))->WaveFormatEx.wBitsPerSample, ((PKSDATAFORMAT_WAVEFORMATEX)(DataFormat))->WaveFormatEx.nSamplesPerSec, ((PKSDATAFORMAT_WAVEFORMATEX)(DataFormat))->WaveFormatEx.nChannels, ((PKSDATAFORMAT_WAVEFORMATEX)(DataFormat))->WaveFormatEx.wFormatTag, m_FrameSize, m_CommonBufferSize, m_DmaChannel->SystemAddress());
1303
1304 /* set up allocator framing */
1311
1313
1314 Status = m_IrpQueue->Init(ConnectDetails, KsPinDescriptor, m_FrameSize, 0, FALSE);
1315 if (!NT_SUCCESS(Status))
1316 {
1317 m_IrpQueue->Release();
1318 return Status;
1319 }
1320
1322 if (!m_Format)
1324
1326
1327 Port->AddRef();
1328 Filter->AddRef();
1329
1330 m_Port = Port;
1331 m_Filter = Filter;
1332
1333 return STATUS_SUCCESS;
1334}
1335
1336ULONG
1337NTAPI
1338CPortPinWaveCyclic::GetCompletedPosition()
1339{
1341 return 0;
1342}
1343
1344ULONG
1345NTAPI
1346CPortPinWaveCyclic::GetCycleCount()
1347{
1349 return 0;
1350}
1351
1352ULONG
1353NTAPI
1354CPortPinWaveCyclic::GetDeviceBufferSize()
1355{
1356 return m_CommonBufferSize;
1357}
1358
1359PVOID
1360NTAPI
1361CPortPinWaveCyclic::GetIrpStream()
1362{
1363 return (PVOID)m_IrpQueue;
1364}
1365
1367NTAPI
1368CPortPinWaveCyclic::GetMiniport()
1369{
1370 return (PMINIPORT)m_Miniport;
1371}
1372
1375 OUT IPortPinWaveCyclic ** OutPin)
1376{
1378
1380 if (!This)
1382
1383 This->AddRef();
1384
1385 // store result
1386 *OutPin = (IPortPinWaveCyclic*)This;
1387
1388 return STATUS_SUCCESS;
1389}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
unsigned char BOOLEAN
#define InterlockedIncrement
Definition: armddk.h:53
IPortFilterWaveCyclic * PPORTFILTERWAVECYCLIC
Definition: interfaces.hpp:761
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
IPortPinWaveCyclic * PPORTPINWAVECYCLIC
Definition: interfaces.hpp:798
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define STDMETHODIMP
Definition: basetyps.h:43
const GUID IID_IUnknown
#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
friend NTSTATUS NTAPI PinWaveCyclicAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
VOID GeneratePositionEvents(IN ULONGLONG OldOffset, IN ULONGLONG NewOffset)
KSPIN_LOCK m_EventListLock
PMINIPORTWAVECYCLICSTREAM m_Stream
friend NTSTATUS NTAPI PinWaveCyclicAddLoopedStreamEvent(IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
PSUBDEVICE_DESCRIPTOR m_Descriptor
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
PSERVICEGROUP m_ServiceGroup
friend NTSTATUS NTAPI PinWaveCyclicState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
friend NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent(IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
friend VOID CALLBACK PinSetStateWorkerRoutine(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
PKSDATAFORMAT m_Format
IPortWaveCyclic * m_Port
virtual ~CPortPinWaveCyclic()
PDMACHANNEL m_DmaChannel
VOID UpdateCommonBuffer(ULONG Position, ULONG MaxTransferCount)
PKSPIN_CONNECT m_ConnectDetails
VOID UpdateCommonBufferOverlap(ULONG Position, ULONG MaxTransferCount)
PMINIPORTWAVECYCLIC m_Miniport
IIrpQueue * m_IrpQueue
KSPIN_DESCRIPTOR * m_KsPinDescriptor
KSAUDIO_POSITION m_Position
KSALLOCATOR_FRAMING m_AllocatorFraming
IPortFilterWaveCyclic * m_Filter
CPortPinWaveCyclic(IUnknown *OuterUnknown)
friend NTSTATUS NTAPI PinWaveCyclicAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
friend NTSTATUS NTAPI PinWaveCyclicDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
_In_ PIRP Irp
Definition: csq.h:116
#define BufferSize
Definition: mmc.h:75
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
#define CALLBACK
Definition: compat.h:35
KSDDKAPI NTSTATUS NTAPI KsAcquireResetValue(IN PIRP Irp, OUT KSRESET *ResetValue)
Definition: api.c:23
KSDDKAPI NTSTATUS NTAPI KsGenerateEvent(IN PKSEVENT_ENTRY EntryEvent)
Definition: event.c:608
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1189
KSDDKAPI BOOLEAN NTAPI KsDispatchFastReadFailure(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: irp.c:1271
KSDDKAPI NTSTATUS NTAPI KsDefaultDeviceIoCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1205
KSDDKAPI BOOLEAN NTAPI KsDispatchFastIoDeviceControlFailure(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength, IN ULONG IoControlCode, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: irp.c:1251
#define DEFINE_KSPROPERTY_CONNECTIONSET(PinSet, PropStateHandler, PropDataFormatHandler, PropAllocatorFraming)
Definition: precomp.h:42
_Out_ PDRMRIGHTS DrmRights
Definition: drmk.h:84
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct KSIDENTIFIER * PKSPROPERTY
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#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 InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
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()
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
NTSTATUS NTAPI NewIrpQueue(IN IIrpQueue **Queue)
Definition: irpstream.cpp:864
KSRESET
Definition: ks.h:1226
@ KSRESET_BEGIN
Definition: ks.h:1227
@ KSRESET_END
Definition: ks.h:1228
#define IOCTL_KS_RESET_STATE
Definition: ks.h:145
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY
Definition: ks.h:1685
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
@ KSEVENT_CONNECTION_ENDOFSTREAM
Definition: ks.h:433
struct _KSEVENT_ENTRY * PKSEVENT_ENTRY
Definition: ks.h:2101
#define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY
Definition: ks.h:1688
struct _KSEVENT_ENTRY KSEVENT_ENTRY
Definition: ks.h:2101
#define IOCTL_KS_READ_STREAM
Definition: ks.h:142
@ KSINTERFACE_STANDARD_STREAMING
Definition: ks.h:283
@ KSINTERFACE_STANDARD_LOOPED_STREAMING
Definition: ks.h:284
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:139
#define IOCTL_KS_DISABLE_EVENT
Definition: ks.h:133
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:29
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
#define KSEVENTSETID_Connection
Definition: ksmedia.h:1136
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
#define KSEVENTSETID_LoopedStreaming
Definition: ksmedia.h:1127
struct KSAUDIO_POSITION * PKSAUDIO_POSITION
#define KSPROPSETID_DrmAudioStream
Definition: ksmedia.h:1151
@ KSEVENT_LOOPEDSTREAMING_POSITION
Definition: ksmedia.h:1130
#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
_In_ UINT _In_ UINT BytesToCopy
Definition: ndis.h:3168
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define FILE_64_BYTE_ALIGNMENT
Definition: nt_native.h:792
#define Int32x32To64(a, b)
_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 NTAPI PinWaveCyclicAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
KSEVENT_ITEM PinWaveCyclicStreamingEventSet
KSPROPERTY_SET PinWaveCyclicPropertySet[]
NTSTATUS NTAPI PinWaveCyclicAddLoopedStreamEvent(IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
NTSTATUS NTAPI PinWaveCyclicDRMHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
NTSTATUS NTAPI PinWaveCyclicState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
KSEVENT_ITEM PinWaveCyclicConnectionEventSet
NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent(IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
VOID CALLBACK PinSetStateWorkerRoutine(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
struct SETPIN_CONTEXT * PSETPIN_CONTEXT
struct LOOPEDSTREAMING_EVENT_CONTEXT * PLOOPEDSTREAMING_EVENT_CONTEXT
KSEVENT_SET PinWaveCyclicEventSet[]
struct ENDOFSTREAM_EVENT_CONTEXT * PENDOFSTREAM_EVENT_CONTEXT
NTSTATUS NewPortPinWaveCyclic(OUT IPortPinWaveCyclic **OutPin)
NTSTATUS NTAPI PinWaveCyclicAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
NTSTATUS NTAPI PinWaveCyclicDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
PMINIPORTWAVECYCLIC GetWaveCyclicMiniport(IN IPortWaveCyclic *iface)
IMiniportWaveCyclic * PMINIPORTWAVECYCLIC
Definition: portcls.h:1543
IDmaChannel * PDMACHANNEL
Definition: portcls.h:784
IServiceSink * PSERVICESINK
Definition: portcls.h:569
IMiniportWaveCyclicStream * PMINIPORTWAVECYCLICSTREAM
Definition: portcls.h:1487
IPortWaveCyclic * PPORTWAVECYCLIC
Definition: portcls.h:1184
IServiceGroup * PSERVICEGROUP
Definition: portcls.h:614
NTSTATUS NTAPI PcCreateSubdeviceDescriptor(OUT SUBDEVICE_DESCRIPTOR **OutSubdeviceDescriptor, IN ULONG InterfaceCount, IN GUID *InterfaceGuids, IN ULONG IdentifierCount, IN KSIDENTIFIER *Identifier, IN ULONG FilterPropertiesCount, IN KSPROPERTY_SET *FilterProperties, IN ULONG Unknown1, IN ULONG Unknown2, IN ULONG PinPropertiesCount, IN KSPROPERTY_SET *PinProperties, IN ULONG EventSetCount, IN KSEVENT_SET *EventSet, IN PPCFILTER_DESCRIPTOR FilterDescription)
Definition: undoc.cpp:717
NTSTATUS NTAPI PcHandleDisableEventWithTable(IN PIRP Irp, IN PSUBDEVICE_DESCRIPTOR Descriptor)
Definition: undoc.cpp:64
#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_DRMSET(PinSet, PropPositionHandler)
Definition: private.hpp:373
#define DEFINE_KSPROPERTY_AUDIOSET(PinSet, PropPositionHandler)
Definition: private.hpp:357
NTSTATUS NTAPI PcHandleEnableEventWithTable(IN PIRP Irp, IN PSUBDEVICE_DESCRIPTOR Descriptor)
Definition: undoc.cpp:51
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 KeAcquireSpinLockAtDpcLevel(SpinLock)
Definition: ke.h:125
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
Definition: ke.h:135
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define DPRINT
Definition: sndvol32.h:73
Definition: drmk.h:18
BOOL CopyProtect
Definition: drmk.h:19
ULONG Reserved
Definition: drmk.h:20
BOOL DigitalOutputDisable
Definition: drmk.h:21
base of all file and directory entries
Definition: entries.h:83
ULONG PoolType
Definition: ks.h:1668
ULONG RequirementsFlags
Definition: ks.h:1663
ULONG Reserved
Definition: ks.h:1673
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
ULONG Id
Definition: dmksctrl.h:77
KSPIN_INTERFACE Interface
Definition: ks.h:2601
CPortPinWaveCyclic * Pin
PIO_WORKITEM WorkItem
PPCFILTER_DESCRIPTOR DeviceDescriptor
Definition: interfaces.hpp:217
PLIST_ENTRY EventList
Definition: interfaces.hpp:214
PKSPROPERTY_SET FilterPropertySet
Definition: interfaces.hpp:210
PKSPIN_LOCK EventListLock
Definition: interfaces.hpp:215
struct _IO_STACK_LOCATION::@1568::@1569 DeviceIoControl
union _IO_STACK_LOCATION::@1568 Parameters
IO_STATUS_BLOCK IoStatus
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
static COORD Position
Definition: mouse.c:34
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 IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#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
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_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
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
#define IO_NO_INCREMENT
Definition: iotypes.h:598
* PFILE_OBJECT
Definition: iotypes.h:1998