ReactOS 0.4.15-dev-6055-g36cdd34
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#ifndef YDEBUG
12#define NDEBUG
13#endif
14
15#include <debug.h>
16
17static
18PIRP
20 IN OUT PLIST_ENTRY QueueHead)
21{
22 PIRP Irp;
23 PLIST_ENTRY CurEntry;
24
25 for (CurEntry = QueueHead->Flink; CurEntry != QueueHead; CurEntry = CurEntry->Flink)
26 {
27 /* Get the IRP offset */
28 Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
29
30 /* Remove the cancel routine */
32 {
33 /* Remove the IRP from the list and return it */
34 RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
35 return Irp;
36 }
37 }
38
39 /* no non canceled irp has been found */
40 return NULL;
41}
42class CIrpQueue : public CUnknownImpl<IIrpQueue>
43{
44public:
46
48 CIrpQueue(IUnknown *OuterUnknown){}
49 virtual ~CIrpQueue(){}
50
51protected:
52
54 PKSPIN_DESCRIPTOR m_Descriptor;
55
59
63
67
70};
71
72typedef struct
73{
77
78typedef struct
79{
82
86
87#define STREAM_DATA_OFFSET (0)
88
89
93 IN REFIID refiid,
95{
97 {
98 *Output = PVOID(PUNKNOWN(this));
99 PUNKNOWN(*Output)->AddRef();
100 return STATUS_SUCCESS;
101 }
102
103 return STATUS_UNSUCCESSFUL;
104}
105
107NTAPI
108CIrpQueue::Init(
109 IN PKSPIN_CONNECT ConnectDetails,
110 IN PKSPIN_DESCRIPTOR Descriptor,
111 IN ULONG FrameSize,
113 IN ULONG TagSupportEnabled)
114{
115 m_ConnectDetails = ConnectDetails;
117 m_MaxFrameSize = FrameSize;
119 m_TagSupportEnabled = TagSupportEnabled;
120
124
125 return STATUS_SUCCESS;
126}
127
129NTAPI
130CIrpQueue::AddMapping(
131 IN PIRP Irp,
133{
136 PIO_STACK_LOCATION IoStack;
138 PMDL Mdl;
140 LONG TotalStreamData;
141 LONG StreamPageCount;
142 LONG HeaderLength;
143
145
146 // allocate stream data
148 if (!StreamData)
149 {
150 // not enough memory
152 }
153
154 // get current irp stack location
156
157 // lets probe the irp
158 if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM)
159 {
160 // probe IOCTL_KS_WRITE_STREAM
161 Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, 0);
162 }
163 else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_READ_STREAM)
164 {
165 // probe IOCTL_KS_READ_STREAM
166 Status = KsProbeStreamIrp(Irp, KSSTREAM_READ | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_SYSTEMADDRESS, 0);
167 }
168
169 // check for success
170 if (!NT_SUCCESS(Status))
171 {
172 // irp probing failed
174 return Status;
175 }
176
177 // get first stream header
178 Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
179
180 // sanity check
182
183 // first calculate the numbers of stream headers
184 Length = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
185 Mdl = Irp->MdlAddress;
186
187 TotalStreamData = 0;
188 StreamPageCount = 0;
189
190 do
191 {
192 /* subtract size */
193 Length -= Header->Size;
194
195 /* increment header count */
196 StreamData->StreamHeaderCount++;
197
198 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_IN)
199 {
200 // irp sink
201 HeaderLength = Header->DataUsed;
202 }
203 else
204 {
205 // irp source
206 HeaderLength = Header->FrameExtent;
207 }
208
209 // increment available data
210 TotalStreamData += HeaderLength;
211
212 // append page count
213 StreamPageCount += ADDRESS_AND_SIZE_TO_SPAN_PAGES(
214 MmGetMdlByteOffset(Mdl), HeaderLength);
215
216 // move to next header / mdl
217 Mdl = Mdl->Next;
219
220 }while(Length);
221
222 // sanity check
223 ASSERT(StreamData->StreamHeaderCount);
224
225 // allocate array for storing the pointers of the data */
226 StreamData->Data = (PVOID*)AllocateItem(NonPagedPool, sizeof(PVOID) * StreamData->StreamHeaderCount, TAG_PORTCLASS);
227 if (!StreamData->Data)
228 {
229 // out of memory
231
232 // done
234 }
235
237 {
238 // allocate array for storing the pointers of the data */
239 StreamData->Tags = (PKSSTREAM_TAG)AllocateItem(NonPagedPool, sizeof(KSSTREAM_TAG) * StreamPageCount, TAG_PORTCLASS);
240 if (!StreamData->Data)
241 {
242 // out of memory
245
246 // done
248 }
249 }
250
251
252 // now get a system address for the user buffers
253 Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
254 Mdl = Irp->MdlAddress;
255
256 for(Index = 0; Index < StreamData->StreamHeaderCount; Index++)
257 {
258 /* get system address */
260
261 /* check for success */
262 if (!StreamData->Data[Index])
263 {
264 // out of resources
266
268 {
269 // free tag array
271 }
272
274 // done
276 }
277
278 // move to next header / mdl
279 Mdl = Mdl->Next;
281
282 }
283
284 // store stream data
285 Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET] = (PVOID)StreamData;
286
287 *Data = TotalStreamData;
288
289 // mark irp as pending
291
292 // add irp to cancelable queue
294
295 // done
296 return STATUS_SUCCESS;
297}
298
300NTAPI
301CIrpQueue::GetMapping(
302 OUT PUCHAR * Buffer,
304{
305 PIRP Irp;
308
309 // check if there is an irp in the partially processed
310 if (m_Irp)
311 {
312 // use last irp
313 if (m_Irp->Cancel == FALSE)
314 {
315 Irp = m_Irp;
317 }
318 else
319 {
320 // irp has been cancelled
323 m_Irp = Irp = NULL;
324 m_CurrentOffset = 0;
325 }
326 }
327 else
328 {
329 // get a fresh new irp from the queue
332
333 if (m_Irp)
334 {
335 // reset stream header index
337
338 // reset stream header
339 m_CurStreamHeader = (PKSSTREAM_HEADER)m_Irp->AssociatedIrp.SystemBuffer;
340 }
341 }
342
343 if (!Irp)
344 {
345 // no irp buffer available
346 return STATUS_UNSUCCESSFUL;
347 }
348
349 // get stream data
350 StreamData = (PKSSTREAM_DATA)Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
351
352 // sanity check
354
355 // get buffer size
356 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_IN)
357 {
358 // sink pin
360 }
361 else
362 {
363 // source pin
365 }
366
367 // sanity check
369
370 // store buffer
372
373 return STATUS_SUCCESS;
374}
375
376VOID
377NTAPI
378CIrpQueue::UpdateMapping(
380{
382 ULONG Size;
383 PIO_STACK_LOCATION IoStack;
384 ULONG Index;
385 PMDL Mdl;
386
387 // sanity check
388 ASSERT(m_Irp);
389
390 // get stream data
391 StreamData = (PKSSTREAM_DATA)m_Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
392
393 // sanity check
395
396 // add to current offset
398
399 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
400 {
401 // store written bytes (source pin)
403 }
404
405 // get audio buffer size
406 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
408 else
410
411 // sanity check
413
414 if (m_CurrentOffset >= Size)
415 {
416 // sanity check
418
419 if (m_StreamHeaderIndex + 1 < StreamData->StreamHeaderCount)
420 {
421 // move to next stream header
423
424 // increment stream header index
426
427 // reset offset
428 m_CurrentOffset = 0;
429
430 // done
431 return;
432 }
433
434 //
435 // all stream buffers have been played
436 // check if this is a looped buffer
437 //
439 {
440 // looped streaming repeat the buffers untill
441 // the caller decides to stop the streams
442
443 // re-insert irp
445
446 // clear current irp
447 m_Irp = NULL;
448
449 // reset offset
450 m_CurrentOffset = 0;
451
452 // done
453 return;
454 }
455
456 Mdl = m_Irp->MdlAddress;
457 for(Index = 0; Index < StreamData->StreamHeaderCount; Index++)
458 {
460 Mdl = Mdl->Next;
461 }
462
463 // free stream data array
465
467 {
468 // free tag array
470 }
471
472 // free stream data
474
475 // get io stack
477
478 // store operation status
480
481 // store operation length
482 m_Irp->IoStatus.Information = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
483
484 // complete the request
486
487 // remove irp as it is complete
488 m_Irp = NULL;
489
490 // reset offset
491 m_CurrentOffset = 0;
492 }
493}
494
495ULONG
496NTAPI
497CIrpQueue::NumData()
498{
499 KIRQL OldLevel;
500 ULONG NumDataAvailable;
501 PLIST_ENTRY CurEntry;
502 PIRP Irp;
503 ULONG CurrentOffset;
504 ULONG StreamHeaderIndex;
505 PKSSTREAM_HEADER CurStreamHeader;
507 ULONG Size;
508
509 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
510
511 NumDataAvailable = 0;
512 CurEntry = &m_IrpList;
513
514 // current IRP state
515 Irp = m_Irp;
516 CurrentOffset = m_CurrentOffset;
517 StreamHeaderIndex = m_StreamHeaderIndex;
518 CurStreamHeader = m_CurStreamHeader;
519
520 while (TRUE)
521 {
522 if (Irp != NULL)
523 {
524 // get stream data
525 StreamData = (PKSSTREAM_DATA)Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
526
527 // loop over stream headers
528 for (; StreamHeaderIndex < StreamData->StreamHeaderCount; StreamHeaderIndex++)
529 {
530 // get audio buffer size
531 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
532 Size = CurStreamHeader->FrameExtent;
533 else
534 Size = CurStreamHeader->DataUsed;
535
536 // increment available data
537 NumDataAvailable += Size - CurrentOffset;
538 CurrentOffset = 0;
539
540 // move to next stream header
541 CurStreamHeader = (PKSSTREAM_HEADER)((ULONG_PTR)CurStreamHeader + CurStreamHeader->Size);
542 }
543 }
544
545 /* iterate to next entry */
546 CurEntry = CurEntry->Flink;
547
548 /* is the end of list reached */
549 if (CurEntry == &m_IrpList)
550 break;
551
552 /* get irp offset */
553 Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
554
555 // next IRP state
556 CurrentOffset = 0;
557 StreamHeaderIndex = 0;
558 CurStreamHeader = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;
559 }
560
562 return NumDataAvailable;
563}
564
565BOOL
566NTAPI
567CIrpQueue::CancelBuffers()
568{
569 //TODO: own cancel routine
570
571 // is there an active irp
572 if (m_Irp)
573 {
574 // re-insert it to cancelable queue
576 //set it to zero
577 m_Irp = NULL;
578 }
579
580 // cancel all irps
582
583 // done
584 return TRUE;
585}
586
588NTAPI
589CIrpQueue::GetMappingWithTag(
590 IN PVOID Tag,
595{
597 KIRQL OldLevel;
598 ULONG Size;
599 LPBYTE Data;
600
601 /* sanity checks */
606
607 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
608
609 if (!m_Irp)
610 {
611 // get an irp from the queue
613
614 // check if there is an irp
615 if (!m_Irp)
616 {
617 // no irp available
619
620 DPRINT("GetMappingWithTag no mapping available\n");
621 return STATUS_NOT_FOUND;
622 }
623
624 // reset offset
625 m_CurrentOffset = 0;
626
627 // reset tag index
628 m_TagIndex = 0;
629
630 // reset stream header index
632
633 // reset stream header
634 m_CurStreamHeader = (PKSSTREAM_HEADER)m_Irp->AssociatedIrp.SystemBuffer;
635 }
636
637 // get stream data
638 StreamData = (PKSSTREAM_DATA)m_Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
639
640 // sanity check
641 PC_ASSERT(m_StreamHeaderIndex < StreamData->StreamHeaderCount);
642
643 // store tag in irp
644 StreamData->Tags[m_TagIndex].Tag = Tag;
645 StreamData->Tags[m_TagIndex].Used = TRUE;
646 m_TagIndex++;
647
648 // get audio buffer size
649 if (m_Descriptor->DataFlow == KSPIN_DATAFLOW_OUT)
651 else
653
654 // sanity check
656
657 // setup mapping
660
661 // get byte count
663 if (*ByteCount > (Size - m_CurrentOffset))
666
667 if (m_CurrentOffset >= Size)
668 {
669 // sanity check
671
672 // increment header index
674
675 if (m_StreamHeaderIndex == StreamData->StreamHeaderCount)
676 {
677 // last mapping
678 *Flags = 1;
679
680 //
681 StreamData->nTags = m_TagIndex;
682
683 // insert mapping into free list
684 InsertTailList(&m_FreeIrpList, &m_Irp->Tail.Overlay.ListEntry);
685
686 // clear irp
687 m_Irp = NULL;
688
689 }
690 else
691 {
692 // one more mapping in the irp
693 *Flags = 0;
694
695 // move to next header
697 }
698 }
699
700 // get physical address
702
704
705 DPRINT("GetMappingWithTag Tag %p Buffer %p Flags %lu ByteCount %lx\n", Tag, VirtualAddress, *Flags, *ByteCount);
706 // done
707 return STATUS_SUCCESS;
708}
709
711NTAPI
712CIrpQueue::ReleaseMappingWithTag(
713 IN PVOID Tag)
714{
715 PIRP Irp;
716 PLIST_ENTRY CurEntry;
718 PIO_STACK_LOCATION IoStack;
719 ULONG Index;
720 KIRQL OldLevel;
721
722 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
723
724 // check if used list empty
726 {
727 // get current irp
728 if (!m_Irp)
729 {
731
732 // this should not happen
733 DPRINT("ReleaseMappingWithTag Tag %p not found\n", Tag);
734 return STATUS_NOT_FOUND;
735 }
736
737 Irp = m_Irp;
738 }
739 else
740 {
741 // remove irp from used list
742 CurEntry = RemoveHeadList(&m_FreeIrpList);
743
744 // get irp from list entry
745 Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
746 }
747
748 // get stream data
749 StreamData = (PKSSTREAM_DATA)Irp->Tail.Overlay.DriverContext[STREAM_DATA_OFFSET];
750
751 // release oldest in use mapping
752 for (Index = 0; Index < StreamData->nTags; Index++)
753 {
754 if (StreamData->Tags[Index].Used != FALSE)
755 {
756 StreamData->Tags[Index].Used = FALSE;
757
758 // Warn if wrong mapping released
759 if (StreamData->Tags[Index].Tag != Tag)
760 {
761 DPRINT1("Mapping released out of order\n");
762 }
763
764 break;
765 }
766 }
767
768 // If this is the current IRP, do not complete
769 if (Irp == m_Irp)
770 {
772 return STATUS_SUCCESS;
773 }
774
775 // check if this is the last one released mapping
776 if (Index + 1 == StreamData->nTags)
777 {
778 // last mapping released
779 // now check if this is a looped buffer
781 {
782 // looped buffers are not completed when they have been played
783 // they are completed when the stream is set to stop
784
786
787 // re-insert irp
789
790 // done
791 return STATUS_SUCCESS;
792 }
793
794 //
795 // time to complete non looped buffer
796 //
797
799
800 // free stream data array
802
803 // free stream tags array
805
806 // free stream data
808
809 // get io stack
811
812 // store operation status
813 Irp->IoStatus.Status = STATUS_SUCCESS;
814
815 // store operation length
816 Irp->IoStatus.Information = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
817
818 // complete the request
820 }
821 else
822 {
823 // there are still some headers not consumed
824 InsertHeadList(&m_FreeIrpList, &Irp->Tail.Overlay.ListEntry);
825
827 }
828
829 return STATUS_SUCCESS;
830}
831
832ULONG
833NTAPI
834CIrpQueue::GetCurrentIrpOffset()
835{
836
837 return m_CurrentOffset;
838}
839
841NTAPI
842CIrpQueue::GetAcquiredTagRange(
843 IN PVOID * FirstTag,
844 IN PVOID * LastTag)
845{
846 KIRQL OldLevel;
847 BOOLEAN Ret = FALSE;
848 //PIRP Irp;
849 //PLIST_ENTRY CurEntry;
850 //PKSSTREAM_DATA StreamData;
851
852 // lock list
853 KeAcquireSpinLock(&m_IrpListLock, &OldLevel);
854
855 // initialize to zero
856 *FirstTag = NULL;
857 *LastTag = NULL;
858
860
861 // release lock
863 // done
864 return Ret;
865}
866
868NTAPI
870 IN IIrpQueue **Queue)
871{
873 if (!This)
875
876 This->AddRef();
877
878 *Queue = (IIrpQueue*)This;
879 return STATUS_SUCCESS;
880}
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:92
ULONG m_MaxFrameSize
Definition: irpstream.cpp:60
PKSPIN_DESCRIPTOR m_Descriptor
Definition: irpstream.cpp:54
LIST_ENTRY m_IrpList
Definition: irpstream.cpp:57
ULONG m_TagIndex
Definition: irpstream.cpp:65
CIrpQueue(IUnknown *OuterUnknown)
Definition: irpstream.cpp:48
LIST_ENTRY m_FreeIrpList
Definition: irpstream.cpp:58
ULONG m_CurrentOffset
Definition: irpstream.cpp:68
KSPIN_LOCK m_IrpListLock
Definition: irpstream.cpp:56
PKSSTREAM_HEADER m_CurStreamHeader
Definition: irpstream.cpp:66
PIRP m_Irp
Definition: irpstream.cpp:69
ULONG m_Alignment
Definition: irpstream.cpp:61
PKSPIN_CONNECT m_ConnectDetails
Definition: irpstream.cpp:53
ULONG m_StreamHeaderIndex
Definition: irpstream.cpp:64
ULONG m_TagSupportEnabled
Definition: irpstream.cpp:62
virtual ~CIrpQueue()
Definition: irpstream.cpp:49
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:1270
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:1645
KSDDKAPI NTSTATUS NTAPI KsProbeStreamIrp(IN PIRP Irp, IN ULONG ProbeFlags, IN ULONG HeaderSize)
Definition: irp.c:659
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:1387
#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:869
#define STREAM_DATA_OFFSET
Definition: irpstream.cpp:87
static PIRP RemoveHeadList_IRP(IN OUT PLIST_ENTRY QueueHead)
Definition: irpstream.cpp:19
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:30
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
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:80
PKSSTREAM_TAG Tags
Definition: irpstream.cpp:84
PVOID * Data
Definition: irpstream.cpp:83
ULONG FrameExtent
Definition: ks.h:2740
ULONG Size
Definition: ks.h:2736
ULONG DataUsed
Definition: ks.h:2741
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
IO_STATUS_BLOCK IoStatus
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
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
_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