ReactOS 0.4.15-dev-7924-g5949c20
irpstream.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/irpstream.cpp
5 * PURPOSE: IRP Stream handling
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "private.hpp"
10
11#define NDEBUG
12#include <debug.h>
13
14static
15PIRP
17 IN OUT PLIST_ENTRY QueueHead)
18{
19 PIRP Irp;
20 PLIST_ENTRY CurEntry;
21
22 for (CurEntry = QueueHead->Flink; CurEntry != QueueHead; CurEntry = CurEntry->Flink)
23 {
24 /* Get the IRP offset */
25 Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
26
27 /* Remove the cancel routine */
29 {
30 /* Remove the IRP from the list and return it */
31 RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
32 return Irp;
33 }
34 }
35
36 /* no non canceled irp has been found */
37 return NULL;
38}
39class CIrpQueue : public CUnknownImpl<IIrpQueue>
40{
41public:
43
45 CIrpQueue(IUnknown *OuterUnknown){}
46 virtual ~CIrpQueue(){}
47
48protected:
49
51 PKSPIN_DESCRIPTOR m_Descriptor;
52
56
60
64
67};
68
69typedef struct
70{
74
75typedef struct
76{
79
83
84#define STREAM_DATA_OFFSET (0)
85
89 IN REFIID refiid,
91{
93 {
94 *Output = PVOID(PUNKNOWN(this));
95 PUNKNOWN(*Output)->AddRef();
96 return STATUS_SUCCESS;
97 }
98
100}
101
103NTAPI
104CIrpQueue::Init(
105 IN PKSPIN_CONNECT ConnectDetails,
106 IN PKSPIN_DESCRIPTOR Descriptor,
107 IN ULONG FrameSize,
109 IN ULONG TagSupportEnabled)
110{
111 m_ConnectDetails = ConnectDetails;
113 m_MaxFrameSize = FrameSize;
115 m_TagSupportEnabled = TagSupportEnabled;
116
120
121 return STATUS_SUCCESS;
122}
123
125NTAPI
126CIrpQueue::AddMapping(
127 IN PIRP Irp,
129{
132 PIO_STACK_LOCATION IoStack;
134 PMDL Mdl;
136 LONG TotalStreamData;
137 LONG StreamPageCount;
138 LONG HeaderLength;
139
141
142 // allocate stream data
144 if (!StreamData)
145 {
146 // not enough memory
148 }
149
150 // get current irp stack location
152
153 // lets probe the irp
154 if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM)
155 {
156 // probe IOCTL_KS_WRITE_STREAM
157 Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, 0);
158 }
159 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
160 {
161 // probe IOCTL_KS_READ_STREAM
162 Status = KsProbeStreamIrp(Irp, KSSTREAM_READ | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, 0);
163 }
164
165 // check for success
166 if (!NT_SUCCESS(Status))
167 {
168 // irp probing failed
170 return Status;
171 }
172
173 // get first stream header
174 Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
175
176 // sanity check
178
179 // first calculate the numbers of stream headers
180 Length = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
181 Mdl = Irp->MdlAddress;
182
183 TotalStreamData = 0;
184 StreamPageCount = 0;
185
186 do
187 {
188 /* subtract size */
189 Length -= Header->Size;
190
191 /* increment header count */
192 StreamData->StreamHeaderCount++;
193
194 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_IN)
195 {
196 // irp sink
197 HeaderLength = Header->DataUsed;
198 }
199 else
200 {
201 // irp source
202 HeaderLength = Header->FrameExtent;
203 }
204
205 // increment available data
206 TotalStreamData += HeaderLength;
207
208 // append page count
209 StreamPageCount += ADDRESS_AND_SIZE_TO_SPAN_PAGES(
210 MmGetMdlByteOffset(Mdl), HeaderLength);
211
212 // move to next header / mdl
213 Mdl = Mdl->Next;
215
216 }while(Length);
217
218 // sanity check
219 ASSERT(StreamData->StreamHeaderCount);
220
221 // allocate array for storing the pointers of the data */
222 StreamData->Data = (PVOID*)AllocateItem(NonPagedPool, sizeof(PVOID) * StreamData->StreamHeaderCount, TAG_PORTCLASS);
223 if (!StreamData->Data)
224 {
225 // out of memory
227
228 // done
230 }
231
233 {
234 // allocate array for storing the pointers of the data */
235 StreamData->Tags = (PKSSTREAM_TAG)AllocateItem(NonPagedPool, sizeof(KSSTREAM_TAG) * StreamPageCount, TAG_PORTCLASS);
236 if (!StreamData->Data)
237 {
238 // out of memory
241
242 // done
244 }
245 }
246
247 // now get a system address for the user buffers
248 Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
249 Mdl = Irp->MdlAddress;
250
251 for(Index = 0; Index < StreamData->StreamHeaderCount; Index++)
252 {
253 /* get system address */
255
256 /* check for success */
257 if (!StreamData->Data[Index])
258 {
259 // out of resources
261
263 {
264 // free tag array
266 }
267
269 // done
271 }
272
273 // move to next header / mdl
274 Mdl = Mdl->Next;
276
277 }
278
279 // store stream data
280 Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET] = (PVOID)StreamData;
281
282 *Data = TotalStreamData;
283
284 // mark irp as pending
286
287 // add irp to cancelable queue
289
290 // done
291 return STATUS_SUCCESS;
292}
293
295NTAPI
296CIrpQueue::GetMapping(
297 OUT PUCHAR * Buffer,
299{
300 PIRP Irp;
303
304 // check if there is an irp in the partially processed
305 if (m_Irp)
306 {
307 // use last irp
308 if (m_Irp->Cancel == FALSE)
309 {
310 Irp = m_Irp;
312 }
313 else
314 {
315 // irp has been cancelled
318 m_Irp = Irp = NULL;
319 m_CurrentOffset = 0;
320 }
321 }
322 else
323 {
324 // get a fresh new irp from the queue
327
328 if (m_Irp)
329 {
330 // reset stream header index
332
333 // reset stream header
335 }
336 }
337
338 if (!Irp)
339 {
340 // no irp buffer available
341 return STATUS_UNSUCCESSFUL;
342 }
343
344 // get stream data
345 StreamData = (PKSSTREAM_DATA)Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
346
347 // sanity check
349
350 // get buffer size
351 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_IN)
352 {
353 // sink pin
355 }
356 else
357 {
358 // source pin
360 }
361
362 // sanity check
364
365 // store buffer
367
368 return STATUS_SUCCESS;
369}
370
371VOID
372NTAPI
373CIrpQueue::UpdateMapping(
375{
377 ULONG Size;
378 PIO_STACK_LOCATION IoStack;
379 ULONG Index;
380 PMDL Mdl;
381
382 // sanity check
383 ASSERT(m_Irp);
384
385 // get stream data
386 StreamData = (PKSSTREAM_DATA)m_Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
387
388 // sanity check
390
391 // add to current offset
393
394 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
395 {
396 // store written bytes (source pin)
398 }
399
400 // get audio buffer size
401 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
403 else
405
406 // sanity check
408
409 if (m_CurrentOffset >= Size)
410 {
411 // sanity check
413
414 if (m_StreamHeaderIndex + 1 < StreamData->StreamHeaderCount)
415 {
416 // move to next stream header
418
419 // increment stream header index
421
422 // reset offset
423 m_CurrentOffset = 0;
424
425 // done
426 return;
427 }
428
429 //
430 // all stream buffers have been played
431 // check if this is a looped buffer
432 //
434 {
435 // looped streaming repeat the buffers untill
436 // the caller decides to stop the streams
437
438 // re-insert irp
440
441 // clear current irp
442 m_Irp = NULL;
443
444 // reset offset
445 m_CurrentOffset = 0;
446
447 // done
448 return;
449 }
450
451 Mdl = m_Irp->MdlAddress;
452 for(Index = 0; Index < StreamData->StreamHeaderCount; Index++)
453 {
455 Mdl = Mdl->Next;
456 }
457
458 // free stream data array
460
462 {
463 // free tag array
465 }
466
467 // free stream data
469
470 // get io stack
472
473 // store operation status
475
476 // store operation length
477 m_Irp->IoStatus.Information = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
478
479 // complete the request
481
482 // remove irp as it is complete
483 m_Irp = NULL;
484
485 // reset offset
486 m_CurrentOffset = 0;
487 }
488}
489
490ULONG
491NTAPI
492CIrpQueue::NumData()
493{
494 KIRQL OldLevel;
495 ULONG NumDataAvailable;
496 PLIST_ENTRY CurEntry;
497 PIRP Irp;
498 ULONG CurrentOffset;
499 ULONG StreamHeaderIndex;
500 PKSSTREAM_HEADER CurStreamHeader;
502 ULONG Size;
503
504 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
505
506 NumDataAvailable = 0;
507 CurEntry = &m_IrpList;
508
509 // current IRP state
510 Irp = m_Irp;
511 CurrentOffset = m_CurrentOffset;
512 StreamHeaderIndex = m_StreamHeaderIndex;
513 CurStreamHeader = m_CurStreamHeader;
514
515 while (TRUE)
516 {
517 if (Irp != NULL)
518 {
519 // get stream data
520 StreamData = (PKSSTREAM_DATA)Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
521
522 // loop over stream headers
523 for (; StreamHeaderIndex < StreamData->StreamHeaderCount; StreamHeaderIndex++)
524 {
525 // get audio buffer size
526 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
527 Size = CurStreamHeader->FrameExtent;
528 else
529 Size = CurStreamHeader->DataUsed;
530
531 // increment available data
532 NumDataAvailable += Size - CurrentOffset;
533 CurrentOffset = 0;
534
535 // move to next stream header
536 CurStreamHeader = (PKSSTREAM_HEADER)((ULONG_PTR)CurStreamHeader + CurStreamHeader->Size);
537 }
538 }
539
540 /* iterate to next entry */
541 CurEntry = CurEntry->Flink;
542
543 /* is the end of list reached */
544 if (CurEntry == &m_IrpList)
545 break;
546
547 /* get irp offset */
548 Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
549
550 // next IRP state
551 CurrentOffset = 0;
552 StreamHeaderIndex = 0;
553 CurStreamHeader = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
554 }
555
557 return NumDataAvailable;
558}
559
560BOOL
561NTAPI
562CIrpQueue::CancelBuffers()
563{
564 //TODO: own cancel routine
565
566 // is there an active irp
567 if (m_Irp)
568 {
569 // re-insert it to cancelable queue
571 //set it to zero
572 m_Irp = NULL;
573 }
574
575 // cancel all irps
577
578 // done
579 return TRUE;
580}
581
583NTAPI
584CIrpQueue::GetMappingWithTag(
585 IN PVOID Tag,
590{
592 KIRQL OldLevel;
593 ULONG Size;
594 LPBYTE Data;
595
596 /* sanity checks */
601
602 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
603
604 if (!m_Irp)
605 {
606 // get an irp from the queue
608
609 // check if there is an irp
610 if (!m_Irp)
611 {
612 // no irp available
614
615 DPRINT("GetMappingWithTag no mapping available\n");
616 return STATUS_NOT_FOUND;
617 }
618
619 // reset offset
620 m_CurrentOffset = 0;
621
622 // reset tag index
623 m_TagIndex = 0;
624
625 // reset stream header index
627
628 // reset stream header
630 }
631
632 // get stream data
633 StreamData = (PKSSTREAM_DATA)m_Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
634
635 // sanity check
636 PC_ASSERT(m_StreamHeaderIndex < StreamData->StreamHeaderCount);
637
638 // store tag in irp
639 StreamData->Tags[m_TagIndex].Tag = Tag;
640 StreamData->Tags[m_TagIndex].Used = TRUE;
641 m_TagIndex++;
642
643 // get audio buffer size
644 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
646 else
648
649 // sanity check
651
652 // setup mapping
655
656 // get byte count
658 if (*ByteCount > (Size - m_CurrentOffset))
661
662 if (m_CurrentOffset >= Size)
663 {
664 // sanity check
666
667 // increment header index
669
670 if (m_StreamHeaderIndex == StreamData->StreamHeaderCount)
671 {
672 // last mapping
673 *Flags = 1;
674
675 //
676 StreamData->nTags = m_TagIndex;
677
678 // insert mapping into free list
679 InsertTailList(&m_FreeIrpList, &m_Irp->Tail.Overlay.ListEntry);
680
681 // clear irp
682 m_Irp = NULL;
683
684 }
685 else
686 {
687 // one more mapping in the irp
688 *Flags = 0;
689
690 // move to next header
692 }
693 }
694
695 // get physical address
697
699
700 DPRINT("GetMappingWithTag Tag %p Buffer %p Flags %lu ByteCount %lx\n", Tag, VirtualAddress, *Flags, *ByteCount);
701 // done
702 return STATUS_SUCCESS;
703}
704
706NTAPI
707CIrpQueue::ReleaseMappingWithTag(
708 IN PVOID Tag)
709{
710 PIRP Irp;
711 PLIST_ENTRY CurEntry;
713 PIO_STACK_LOCATION IoStack;
714 ULONG Index;
715 KIRQL OldLevel;
716
717 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
718
719 // check if used list empty
721 {
722 // get current irp
723 if (!m_Irp)
724 {
726
727 // this should not happen
728 DPRINT("ReleaseMappingWithTag Tag %p not found\n", Tag);
729 return STATUS_NOT_FOUND;
730 }
731
732 Irp = m_Irp;
733 }
734 else
735 {
736 // remove irp from used list
737 CurEntry = RemoveHeadList(&m_FreeIrpList);
738
739 // get irp from list entry
740 Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
741 }
742
743 // get stream data
744 StreamData = (PKSSTREAM_DATA)Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
745
746 // release oldest in use mapping
747 for (Index = 0; Index < StreamData->nTags; Index++)
748 {
749 if (StreamData->Tags[Index].Used != FALSE)
750 {
751 StreamData->Tags[Index].Used = FALSE;
752
753 // Warn if wrong mapping released
754 if (StreamData->Tags[Index].Tag != Tag)
755 {
756 DPRINT1("Mapping released out of order\n");
757 }
758
759 break;
760 }
761 }
762
763 // If this is the current IRP, do not complete
764 if (Irp == m_Irp)
765 {
767 return STATUS_SUCCESS;
768 }
769
770 // check if this is the last one released mapping
771 if (Index + 1 == StreamData->nTags)
772 {
773 // last mapping released
774 // now check if this is a looped buffer
776 {
777 // looped buffers are not completed when they have been played
778 // they are completed when the stream is set to stop
779
781
782 // re-insert irp
784
785 // done
786 return STATUS_SUCCESS;
787 }
788
789 //
790 // time to complete non looped buffer
791 //
792
794
795 // free stream data array
797
798 // free stream tags array
800
801 // free stream data
803
804 // get io stack
806
807 // store operation status
808 Irp->IoStatus.Status = STATUS_SUCCESS;
809
810 // store operation length
811 Irp->IoStatus.Information = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
812
813 // complete the request
815 }
816 else
817 {
818 // there are still some headers not consumed
819 InsertHeadList(&m_FreeIrpList, &Irp->Tail.Overlay.ListEntry);
820
822 }
823
824 return STATUS_SUCCESS;
825}
826
827ULONG
828NTAPI
829CIrpQueue::GetCurrentIrpOffset()
830{
831
832 return m_CurrentOffset;
833}
834
836NTAPI
837CIrpQueue::GetAcquiredTagRange(
838 IN PVOID * FirstTag,
839 IN PVOID * LastTag)
840{
841 KIRQL OldLevel;
842 BOOLEAN Ret = FALSE;
843 //PIRP Irp;
844 //PLIST_ENTRY CurEntry;
845 //PKSSTREAM_DATA StreamData;
846
847 // lock list
848 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
849
850 // initialize to zero
851 *FirstTag = NULL;
852 *LastTag = NULL;
853
855
856 // release lock
858 // done
859 return Ret;
860}
861
863NTAPI
865 IN IIrpQueue **Queue)
866{
868 if (!This)
870
871 This->AddRef();
872
873 *Queue = (IIrpQueue*)This;
874 return STATUS_SUCCESS;
875}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _IRP * PIRP
unsigned char BOOLEAN
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:115
Definition: bufpool.h:45
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: irpstream.cpp:88
ULONG m_MaxFrameSize
Definition: irpstream.cpp:57
PKSPIN_DESCRIPTOR m_Descriptor
Definition: irpstream.cpp:51
LIST_ENTRY m_IrpList
Definition: irpstream.cpp:54
ULONG m_TagIndex
Definition: irpstream.cpp:62
CIrpQueue(IUnknown *OuterUnknown)
Definition: irpstream.cpp:45
LIST_ENTRY m_FreeIrpList
Definition: irpstream.cpp:55
ULONG m_CurrentOffset
Definition: irpstream.cpp:65
KSPIN_LOCK m_IrpListLock
Definition: irpstream.cpp:53
PKSSTREAM_HEADER m_CurStreamHeader
Definition: irpstream.cpp:63
PIRP m_Irp
Definition: irpstream.cpp:66
ULONG m_Alignment
Definition: irpstream.cpp:58
PKSPIN_CONNECT m_ConnectDetails
Definition: irpstream.cpp:50
ULONG m_StreamHeaderIndex
Definition: irpstream.cpp:61
ULONG m_TagSupportEnabled
Definition: irpstream.cpp:59
virtual ~CIrpQueue()
Definition: irpstream.cpp:46
Definition: Header.h:9
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
_In_ PIRP Irp
Definition: csq.h:116
#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 VOID NTAPI KsCancelIo(IN OUT PLIST_ENTRY QueueHead, IN PKSPIN_LOCK SpinLock)
Definition: irp.c:1291
KSDDKAPI VOID NTAPI KsAddIrpToCancelableQueue(IN OUT PLIST_ENTRY QueueHead, IN PKSPIN_LOCK SpinLock, IN PIRP Irp, IN KSLIST_ENTRY_LOCATION ListLocation, IN PDRIVER_CANCEL DriverCancel OPTIONAL)
Definition: irp.c:1666
KSDDKAPI NTSTATUS NTAPI KsProbeStreamIrp(IN PIRP Irp, IN ULONG ProbeFlags, IN ULONG HeaderSize)
Definition: irp.c:680
KSDDKAPI PIRP NTAPI KsRemoveIrpFromCancelableQueue(IN OUT PLIST_ENTRY QueueHead, IN PKSPIN_LOCK SpinLock, IN KSLIST_ENTRY_LOCATION ListLocation, IN KSIRP_REMOVAL_OPERATION RemovalOperation)
Definition: irp.c:1408
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
UCHAR KIRQL
Definition: env_spec_w32.h:591
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
unsigned int BOOL
Definition: ntddk_ex.h:94
union Alignment_ Alignment
Status
Definition: gdiplustypes.h:25
ULONG AddRef()
IoMarkIrpPending(Irp)
IoSetCancelRoutine(Irp, CancelRoutine)
struct KSSTREAM_DATA * PKSSTREAM_DATA
NTSTATUS NTAPI NewIrpQueue(IN IIrpQueue **Queue)
Definition: irpstream.cpp:864
#define STREAM_DATA_OFFSET
Definition: irpstream.cpp:84
static PIRP RemoveHeadList_IRP(IN OUT PLIST_ENTRY QueueHead)
Definition: irpstream.cpp:16
struct KSSTREAM_TAG * PKSSTREAM_TAG
struct KSSTREAM_HEADER * PKSSTREAM_HEADER
@ KsListEntryHead
Definition: ks.h:1263
@ KsListEntryTail
Definition: ks.h:1262
@ KSPIN_DATAFLOW_IN
Definition: ks.h:1249
@ KSPIN_DATAFLOW_OUT
Definition: ks.h:1250
@ KsAcquireAndRemoveOnlySingleItem
Definition: ks.h:1276
#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
VOID NTAPI MmUnmapLockedPages(IN PVOID BaseAddress, IN PMDL Mdl)
Definition: mdlsup.c:837
#define ASSERT(a)
Definition: mode.c:44
#define for
Definition: utility.h:88
@ NormalPagePriority
Definition: imports.h:56
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IoCompleteRequest
Definition: irp.c:1240
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
Definition: stubs.c:685
long LONG
Definition: pedump.c:60
#define TAG_PORTCLASS
Definition: private.hpp:24
#define PC_ASSERT(exp)
Definition: private.hpp:26
#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:71
ULONG Id
Definition: dmksctrl.h:77
KSPIN_INTERFACE Interface
Definition: ks.h:2601
ULONG StreamHeaderCount
Definition: irpstream.cpp:77
PKSSTREAM_TAG Tags
Definition: irpstream.cpp:81
PVOID * Data
Definition: irpstream.cpp:80
ULONG FrameExtent
Definition: ks.h:2740
ULONG Size
Definition: ks.h:2736
ULONG DataUsed
Definition: ks.h:2741
struct _IO_STACK_LOCATION::@1564::@1565 DeviceIoControl
union _IO_STACK_LOCATION::@1564 Parameters
PVOID SystemBuffer
IO_STATUS_BLOCK IoStatus
union _IRP::@1566 AssociatedIrp
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * LPBYTE
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
_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
_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
#define IO_SOUND_INCREMENT
Definition: iotypes.h:608
#define MmGetMdlByteOffset(_Mdl)
#define ROUND_TO_PAGES(Size)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
unsigned char UCHAR
Definition: xmlstorage.h:181