14#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_DATASUP)
37 DataQueue->BytesInQueue = 0;
38 DataQueue->EntriesInQueue = 0;
39 DataQueue->QuotaUsed = 0;
40 DataQueue->ByteOffset = 0;
41 DataQueue->QueueState =
Empty;
42 DataQueue->Quota = Quota;
57 QuotaLeft = DataQueue->Quota - DataQueue->QuotaUsed;
60 NextEntry = DataQueue->Queue.
Flink;
61 while (NextEntry != &DataQueue->Queue)
63 if (!QuotaLeft)
break;
78 if (NewQuotaLeft > QuotaLeft) NewQuotaLeft = QuotaLeft;
80 QuotaLeft -= NewQuotaLeft;
89 Irp->IoStatus.Information = DataQueueEntry->
DataSize;
96 NextEntry = NextEntry->
Flink;
100 DataQueue->QuotaUsed = DataQueue->Quota - QuotaLeft;
113 if (DataQueue->QueueState ==
Empty)
117 ASSERT(DataQueue->EntriesInQueue == 0);
118 ASSERT(DataQueue->BytesInQueue == 0);
119 ASSERT(DataQueue->QuotaUsed == 0);
127 DataQueue->BytesInQueue -= QueueEntry->
DataSize;
128 --DataQueue->EntriesInQueue;
132 DataQueue->QuotaUsed < DataQueue->Quota ||
142 DataQueue->QueueState =
Empty;
151 Irp->Tail.Overlay.DriverContext[3] =
NULL;
168 DataQueue->ByteOffset = 0;
183 for (NextEntry = DataQueue->Queue.
Flink;
184 NextEntry != &DataQueue->Queue;
185 NextEntry = DataQueue->Queue.
Flink)
214 BOOLEAN CompleteWrites, FirstEntry;
220 DataQueue =
Irp->Tail.Overlay.DriverContext[2];
221 ClientSecurityContext =
NULL;
229 DataEntry =
Irp->Tail.Overlay.DriverContext[3];
246 CompleteWrites =
TRUE;
251 CompleteWrites =
FALSE;
313 ASSERT((DataQueue->QueueState ==
Empty) || (DataQueue->QueueState == Who));
321 Irp ?
Irp->Tail.Overlay.Thread :
351 ASSERT((DataQueue->QueueState ==
Empty) || (DataQueue->QueueState == Who));
369 if (DataQueue->Quota - DataQueue->QuotaUsed < QuotaInEntry)
371 QuotaInEntry = DataQueue->Quota - DataQueue->QuotaUsed;
400 (DataQueue->QueueState == Who));
428 (DataQueue->QueueState == Who));
438 ASSERT((DataQueue->QueueState ==
Empty) || (DataQueue->QueueState == Who));
439 if (DataQueue->QueueState ==
Empty)
441 ASSERT(DataQueue->BytesInQueue == 0);
442 ASSERT(DataQueue->EntriesInQueue == 0);
447 ASSERT(DataQueue->QueueState == Who);
449 ASSERT(DataQueue->EntriesInQueue != 0);
453 DataQueue->QueueState = Who;
454 DataQueue->BytesInQueue += DataEntry->
DataSize;
455 DataQueue->EntriesInQueue++;
462 ASSERT(DataQueue->EntriesInQueue == 1);
470 Irp->Tail.Overlay.DriverContext[2] = DataQueue;
471 Irp->Tail.Overlay.DriverContext[3] = DataEntry;
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
PIRP NTAPI NpRemoveDataQueueEntry(IN PNP_DATA_QUEUE DataQueue, IN BOOLEAN Flag, IN PLIST_ENTRY List)
NTSTATUS NTAPI NpAddDataQueueEntry(IN ULONG NamedPipeEnd, IN PNP_CCB Ccb, IN PNP_DATA_QUEUE DataQueue, IN ULONG Who, IN ULONG Type, IN ULONG DataSize, IN PIRP Irp, IN PVOID Buffer, IN ULONG ByteOffset)
NTSTATUS NTAPI NpUninitializeDataQueue(IN PNP_DATA_QUEUE DataQueue)
VOID NTAPI NpCompleteStalledWrites(IN PNP_DATA_QUEUE DataQueue, IN PLIST_ENTRY List)
PLIST_ENTRY NTAPI NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue, IN PLIST_ENTRY List)
VOID NTAPI NpCancelDataQueueIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI NpInitializeDataQueue(IN PNP_DATA_QUEUE DataQueue, IN ULONG Quota)
#define NT_SUCCESS(StatCode)
FORCEINLINE VOID NpAcquireExclusiveVcb(VOID)
FORCEINLINE VOID NpReleaseVcb(VOID)
NTSTATUS NTAPI NpGetClientSecurityContext(IN ULONG NamedPipeEnd, IN PNP_CCB Ccb, IN PETHREAD Thread, IN PSECURITY_CLIENT_CONTEXT *Context)
FORCEINLINE VOID NpCompleteDeferredIrps(IN PLIST_ENTRY DeferredList)
#define NPFS_DATA_ENTRY_TAG
VOID NTAPI NpFreeClientSecurityContext(IN PSECURITY_CLIENT_CONTEXT ClientContext)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define PsGetCurrentThread()
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define EXCEPTION_EXECUTE_HANDLER
IoSetCancelRoutine(Irp, CancelRoutine)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
#define IoCompleteRequest
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
PSECURITY_CLIENT_CONTEXT ClientSecurityContext
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFCMRESLIST List
#define ExAllocatePoolWithQuotaTag(a, b, c)
#define IO_NAMED_PIPE_INCREMENT
#define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE