ReactOS 0.4.16-dev-125-g798ea90
block.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYRIGHT.TXT
3 * PROJECT: Ext2 File System Driver for WinNT/2K/XP
4 * FILE: block.c
5 * PROGRAMMER: Matt Wu <mattwu@163.com>
6 * HOMEPAGE: http://www.ext2fsd.com
7 * UPDATE HISTORY:
8 */
9
10/* INCLUDES *****************************************************************/
11
12#include "ext2fs.h"
13
14/* GLOBALS ***************************************************************/
15
17
18/* DEFINITIONS *************************************************************/
19
20#ifdef __REACTOS__
22#else
24#endif
27 IN PIRP Irp,
29
30#ifdef __REACTOS__
32#else
34#endif
37 IN PIRP Irp,
39
40
41#ifdef __REACTOS__
43#else
45#endif
48 IN PIRP Irp,
49 IN PVOID Contxt );
50
51#ifdef ALLOC_PRAGMA
52#pragma alloc_text(PAGE, Ext2LockUserBuffer)
53#pragma alloc_text(PAGE, Ext2ReadSync)
54#pragma alloc_text(PAGE, Ext2ReadDisk)
55#pragma alloc_text(PAGE, Ext2DiskIoControl)
56#pragma alloc_text(PAGE, Ext2MediaEjectControl)
57#pragma alloc_text(PAGE, Ext2DiskShutDown)
58#endif
59
60
61/* FUNCTIONS ***************************************************************/
62
63PMDL
68)
69{
71 PMDL Mdl = NULL;
72
73 ASSERT (Buffer != NULL);
75 if (Mdl == NULL) {
77 } else {
78 _SEH2_TRY {
81 } else {
83 }
86 IoFreeMdl (Mdl);
87 Mdl = NULL;
88 DbgBreak();
90 } _SEH2_END;
91 }
92 return Mdl;
93}
94
95
96VOID
98{
99 ASSERT (Mdl != NULL);
100 while (Mdl) {
101 PMDL Next;
102 Next = Mdl->Next;
103 Mdl->Next = NULL;
104 if (IsFlagOn(Mdl->MdlFlags, MDL_PAGES_LOCKED)) {
106 }
107 IoFreeMdl (Mdl);
108 Mdl = Next;
109 }
110}
111
116{
118 ASSERT(Irp != NULL);
119
120 if (Irp->MdlAddress != NULL) {
121 return STATUS_SUCCESS;
122 }
123
124 IoAllocateMdl(Irp->UserBuffer, Length, FALSE, FALSE, Irp);
125 if (Irp->MdlAddress == NULL) {
127 }
128
129 _SEH2_TRY {
130
131 MmProbeAndLockPages(Irp->MdlAddress, Irp->RequestorMode, Operation);
133
135
136 DbgBreak();
137 IoFreeMdl(Irp->MdlAddress);
138 Irp->MdlAddress = NULL;
140 } _SEH2_END;
141
142 return Status;
143}
144
145PVOID
147{
148 ASSERT(Irp != NULL);
149
150 if (Irp->MdlAddress) {
151
152#if (_WIN32_WINNT >= 0x0500)
154#else
155 return MmGetSystemAddressForMdl(Irp->MdlAddress);
156#endif
157 } else {
158
159 return Irp->UserBuffer;
160 }
161}
162
163#ifdef __REACTOS__
165#else
167#endif
170 IN PIRP Irp,
172{
174
175 if (Irp != pContext->MasterIrp) {
176
177 if (!NT_SUCCESS(Irp->IoStatus.Status)) {
178 pContext->MasterIrp->IoStatus = Irp->IoStatus;
179 }
180
181 IoFreeMdl(Irp->MdlAddress);
182 IoFreeIrp(Irp );
183 }
184
185 if (InterlockedDecrement(&pContext->Blocks) == 0) {
186
187 pContext->MasterIrp->IoStatus.Information = 0;
188 if (NT_SUCCESS(pContext->MasterIrp->IoStatus.Status)) {
189
190 pContext->MasterIrp->IoStatus.Information =
191 pContext->Length;
192 }
193
194 KeSetEvent(&pContext->Event, 0, FALSE);
195 }
196
198}
199
200#ifdef __REACTOS__
202#else
204#endif
207 IN PIRP Irp,
209)
210{
213
214 ASSERT(FALSE == pContext->Wait);
215
216 if (Irp != pContext->MasterIrp && !NT_SUCCESS(Irp->IoStatus.Status)) {
217 pContext->MasterIrp->IoStatus = Irp->IoStatus;
218 }
219
220 if (InterlockedDecrement(&pContext->Blocks) == 0) {
221
222 if (NT_SUCCESS(pContext->MasterIrp->IoStatus.Status)) {
223
224 /* set written bytes to status information */
225 pContext->MasterIrp->IoStatus.Information = pContext->Length;
226
227 if (pContext->FileObject != NULL && !IsFlagOn(pContext->MasterIrp->Flags, IRP_PAGING_IO)) {
228
229 /* modify FileObject flags, skip this for volume direct access */
230 SetFlag( pContext->FileObject->Flags,
233
234 /* update Current Byteoffset */
235 if (IsFlagOn(pContext->FileObject->Flags, FO_SYNCHRONOUS_IO)) {
236 iosp = IoGetCurrentIrpStackLocation(pContext->MasterIrp);
237 pContext->FileObject->CurrentByteOffset.QuadPart =
238 iosp->Parameters.Read.ByteOffset.QuadPart + pContext->Length;
239 }
240 }
241
242 } else {
243
244 pContext->MasterIrp->IoStatus.Information = 0;
245 }
246
247 /* release the locked resource acquired by the caller */
248 if (pContext->Resource) {
249 ExReleaseResourceForThread(pContext->Resource, pContext->ThreadId);
250 }
251
252 Ext2FreePool(pContext, EXT2_RWC_MAGIC);
253 DEC_MEM_COUNT(PS_RW_CONTEXT, pContext, sizeof(EXT2_RW_CONTEXT));
254 }
255
256 return STATUS_SUCCESS;
257}
258
261 IN PEXT2_IRP_CONTEXT IrpContext,
263 IN PEXT2_EXTENT Chain,
265 )
266{
267 PIRP Irp;
268 PIRP MasterIrp = IrpContext->Irp;
270 PMDL Mdl;
271 PEXT2_RW_CONTEXT pContext = NULL;
273 KEVENT Wait;
275 BOOLEAN bMasterCompleted = FALSE;
276 BOOLEAN bBugCheck = FALSE;
277
278 ASSERT(MasterIrp);
279
280 _SEH2_TRY {
281
283
284 if (!pContext) {
285 DEBUG(DL_ERR, ( "Ex2ReadWriteBlocks: failed to allocate pContext.\n"));
288 }
289
290 INC_MEM_COUNT(PS_RW_CONTEXT, pContext, sizeof(EXT2_RW_CONTEXT));
291 RtlZeroMemory(pContext, sizeof(EXT2_RW_CONTEXT));
292 pContext->Wait = Ext2CanIWait();
293 pContext->MasterIrp = MasterIrp;
294 pContext->Length = Length;
295
296 if (IrpContext->MajorFunction == IRP_MJ_WRITE) {
298 }
299
300 if (pContext->Wait) {
301
303
304 } else if (IrpContext->Fcb->Identifier.Type == EXT2FCB) {
305
306 if (IsFlagOn(MasterIrp->Flags, IRP_PAGING_IO)) {
307 pContext->Resource = &IrpContext->Fcb->PagingIoResource;
308 } else {
309 pContext->Resource = &IrpContext->Fcb->MainResource;
310 }
311
312 pContext->FileObject = IrpContext->FileObject;
314 }
315
316
317 if (NULL == Chain->Next && 0 == Chain->Offset) {
318
319 /* we get only 1 extent to dispatch, then don't bother allocating new irps */
320
321 /* setup the Stack location to do a read from the disk driver. */
322 IrpSp = IoGetNextIrpStackLocation(MasterIrp);
323 IrpSp->MajorFunction = IrpContext->MajorFunction;
324 IrpSp->Parameters.Read.Length = Chain->Length;
325 IrpSp->Parameters.Read.ByteOffset.QuadPart = Chain->Lba;
326 if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WRITE_THROUGH)) {
328 }
329 if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_VERIFY_READ)) {
331 }
332
334 MasterIrp,
335 Ext2CanIWait() ?
338 (PVOID) pContext,
339 TRUE,
340 TRUE,
341 TRUE );
342
343 /* intialize context block */
344 Chain->Irp = MasterIrp;
345 pContext->Blocks = 1;
346
347 } else {
348
349 for (Extent = Chain; Extent != NULL; Extent = Extent->Next) {
350
352 MasterIrp,
353 (CCHAR)(Vcb->TargetDeviceObject->StackSize + 1) );
354
355 if (!Irp) {
358 }
359
360 Mdl = IoAllocateMdl( (PCHAR)MasterIrp->UserBuffer +
361 Extent->Offset,
362 Extent->Length,
363 FALSE,
364 FALSE,
365 Irp );
366
367 if (!Mdl) {
370 }
371
372 IoBuildPartialMdl( MasterIrp->MdlAddress,
373 Mdl,
374 (PCHAR)MasterIrp->UserBuffer+Extent->Offset,
375 Extent->Length );
376
379
380 IrpSp->MajorFunction = IrpContext->MajorFunction;
381 IrpSp->Parameters.Read.Length = Extent->Length;
382 IrpSp->Parameters.Read.ByteOffset.QuadPart = Extent->Lba;
383
385 Irp,
386 Ext2CanIWait() ?
389 (PVOID) pContext,
390 TRUE,
391 TRUE,
392 TRUE );
393
395
396 IrpSp->MajorFunction = IrpContext->MajorFunction;
398 IrpSp->Parameters.Read.ByteOffset.QuadPart = Extent->Lba;
399
400 /* set write through flag */
401 if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WRITE_THROUGH)) {
403 }
404
405 /* set verify flag */
406 if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_VERIFY_READ)) {
408 }
409
410 Extent->Irp = Irp;
411 pContext->Blocks += 1;
412 }
413
414 MasterIrp->AssociatedIrp.IrpCount = pContext->Blocks;
415 if (Ext2CanIWait()) {
416 MasterIrp->AssociatedIrp.IrpCount += 1;
417 }
418 }
419 if (!Ext2CanIWait()) {
420 /* mark MasterIrp pending */
421 IoMarkIrpPending(pContext->MasterIrp);
422 }
423
424 bBugCheck = TRUE;
425
426 for (Extent = Chain; Extent != NULL; Extent = Extent->Next) {
427 Status = IoCallDriver ( Vcb->TargetDeviceObject,
428 Extent->Irp);
429 Extent->Irp = NULL;
430 }
431
432 if (Ext2CanIWait()) {
433 KeWaitForSingleObject( &(pContext->Event),
435 KeClearEvent( &(pContext->Event) );
436 } else {
437 bMasterCompleted = TRUE;
438 }
439
440 } _SEH2_FINALLY {
441
442 for (Extent = Chain; Extent != NULL; Extent = Extent->Next) {
443 if (Extent->Irp != NULL ) {
444 if (Extent->Irp->MdlAddress != NULL) {
445 IoFreeMdl(Extent->Irp->MdlAddress );
446 }
447 IoFreeIrp(Extent->Irp);
448 }
449 }
450
451 if (IrpContext->ExceptionInProgress) {
452
453 if (bBugCheck) {
455 }
456
457 } else {
458
459 if (Ext2CanIWait()) {
460 if (MasterIrp) {
461 Status = MasterIrp->IoStatus.Status;
462 }
463 if (pContext) {
464 Ext2FreePool(pContext, EXT2_RWC_MAGIC);
465 DEC_MEM_COUNT(PS_RW_CONTEXT, pContext, sizeof(EXT2_RW_CONTEXT));
466 }
467 } else {
468 if (bMasterCompleted) {
469 IrpContext->Irp = NULL;
471 }
472 }
473 }
474 } _SEH2_END;
475
476 return Status;
477}
478
486)
487{
489
490 PIRP Irp;
493
494
495 ASSERT(Vcb != NULL);
496 ASSERT(Vcb->TargetDeviceObject != NULL);
497 ASSERT(Buffer != NULL);
498
499 _SEH2_TRY {
500
501 Event = Ext2AllocatePool(NonPagedPool, sizeof(KEVENT), 'EK2E');
502
503 if (NULL == Event) {
504 DEBUG(DL_ERR, ( "Ex2ReadSync: failed to allocate Event.\n"));
506 }
507
509
511
514 Vcb->TargetDeviceObject,
515 Buffer,
516 Length,
518 Event,
519 &IoStatus
520 );
521
522 if (!Irp) {
525 }
526
527 if (bVerify) {
530 }
531
532 Status = IoCallDriver(Vcb->TargetDeviceObject, Irp);
533
534 if (Status == STATUS_PENDING) {
536 Event,
537 Suspended,
539 FALSE,
540 NULL
541 );
542
543 Status = IoStatus.Status;
544 }
545
546 } _SEH2_FINALLY {
547
548 if (Event) {
549 Ext2FreePool(Event, 'EK2E');
551 }
552 } _SEH2_END;
553
554 return Status;
555}
556
557
562 IN ULONG Size,
565{
567 PUCHAR Buf;
569 ULONGLONG Lba;
570
571 Lba = Offset & (~((ULONGLONG)SECTOR_SIZE - 1));
572 Length = (ULONG)(Size + Offset + SECTOR_SIZE - 1 - Lba) &
573 (~((ULONG)SECTOR_SIZE - 1));
574
576 if (!Buf) {
577 DEBUG(DL_ERR, ( "Ext2ReadDisk: failed to allocate Buffer.\n"));
579
580 goto errorout;
581 }
583
585 Lba,
586 Length,
587 Buf,
588 FALSE );
589
590 if (!NT_SUCCESS(Status)) {
591 DEBUG(DL_ERR, ("Ext2ReadDisk: disk i/o error: %xh.\n", Status));
592 goto errorout;
593 }
594
595 RtlCopyMemory(Buffer, &Buf[Offset - Lba], Size);
596
597errorout:
598
599 if (Buf) {
602 }
603
604 return Status;
605}
606
607
613 IN ULONG InputBufferSize,
615 IN OUT PULONG OutputBufferSize)
616{
619 PIRP Irp;
622
624
625 if (OutputBufferSize)
626 {
627 OutBufferSize = *OutputBufferSize;
628 }
629
631
633 IoctlCode,
636 InputBufferSize,
639 FALSE,
640 &Event,
641 &IoStatus
642 );
643
644 if (Irp == NULL) {
645 DEBUG(DL_ERR, ( "Ext2DiskIoControl: failed to build Irp!\n"));
647 }
648
650
651 if (Status == STATUS_PENDING) {
653 Status = IoStatus.Status;
654 }
655
656 if (OutputBufferSize) {
657 *OutputBufferSize = (ULONG)(IoStatus.Information);
658 }
659
660 return Status;
661}
662
663
664#ifdef __REACTOS__
666#else
668#endif
671 IN PIRP Irp,
672 IN PVOID Contxt
673)
674{
675 PKEVENT Event = (PKEVENT)Contxt;
676
677 KeSetEvent( Event, 0, FALSE );
678
680
681 return STATUS_SUCCESS;
682}
683
684VOID
686 IN PEXT2_IRP_CONTEXT IrpContext,
688 IN BOOLEAN bPrevent
689)
690{
691 PIRP Irp;
694 PREVENT_MEDIA_REMOVAL Prevent;
696
697
699 &Vcb->MainResource,
700 TRUE );
701
702 if (bPrevent != IsFlagOn(Vcb->Flags, VCB_REMOVAL_PREVENTED)) {
703 if (bPrevent) {
705 } else {
707 }
708 }
709
710 ExReleaseResourceLite(&Vcb->MainResource);
711
712 Prevent.PreventMediaRemoval = bPrevent;
713
715
717 Vcb->TargetDeviceObject,
718 &Prevent,
719 sizeof(PREVENT_MEDIA_REMOVAL),
720 NULL,
721 0,
722 FALSE,
723 NULL,
724 &IoStatus );
725
726 if (Irp != NULL) {
729 &Event,
730 TRUE,
731 TRUE,
732 TRUE );
733
734 Status = IoCallDriver(Vcb->TargetDeviceObject, Irp);
735
736 if (Status == STATUS_PENDING) {
738 Executive,
740 FALSE,
741 NULL );
742 }
743 }
744}
745
746
749{
750 PIRP Irp;
752
755
757
759 Vcb->TargetDeviceObject,
760 NULL,
761 0,
762 NULL,
763 &Event,
764 &IoStatus);
765
766 if (Irp) {
767 Status = IoCallDriver(Vcb->TargetDeviceObject, Irp);
768
769 if (Status == STATUS_PENDING) {
771 Executive,
773 FALSE,
774 NULL);
775
776 Status = IoStatus.Status;
777 }
778 } else {
779 Status = IoStatus.Status;
780 }
781
782 return Status;
783}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
unsigned char BOOLEAN
#define InterlockedDecrement
Definition: armddk.h:52
LONG NTSTATUS
Definition: precomp.h:26
#define DEBUG(args)
Definition: rdesktop.h:129
NTSTATUS Ext2ReadSync(IN PEXT2_VCB Vcb, IN ULONGLONG Offset, IN ULONG Length, OUT PVOID Buffer, BOOLEAN bVerify)
Definition: block.c:480
VOID Ext2MediaEjectControl(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN BOOLEAN bPrevent)
Definition: block.c:685
PEXT2_GLOBAL Ext2Global
Definition: init.c:16
NTSTATUS Ext2ReadWriteBlocks(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_EXTENT Chain, IN ULONG Length)
Definition: block.c:260
NTSTATUS Ext2LockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
Definition: block.c:113
PVOID Ext2GetUserBuffer(IN PIRP Irp)
Definition: block.c:146
NTSTATUS Ext2ReadWriteBlockSyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: block.c:168
NTSTATUS Ext2DiskShutDown(PEXT2_VCB Vcb)
Definition: block.c:748
NTSTATUS Ext2ReadDisk(IN PEXT2_VCB Vcb, IN ULONGLONG Offset, IN ULONG Size, IN PVOID Buffer, IN BOOLEAN bVerify)
Definition: block.c:559
NTSTATUS Ext2DiskIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG IoctlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer, IN OUT PULONG OutputBufferSize)
Definition: block.c:609
NTSTATUS Ext2MediaEjectControlCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Contxt)
Definition: block.c:669
NTSTATUS Ext2ReadWriteBlockAsyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: block.c:205
PMDL Ext2CreateMdl(IN PVOID Buffer, IN ULONG Length, IN LOCK_OPERATION op)
Definition: block.c:64
VOID Ext2DestroyMdl(IN PMDL Mdl)
Definition: block.c:97
#define SECTOR_SIZE
Definition: fs.h:22
#define IOCTL_DISK_MEDIA_REMOVAL
Definition: cdrw_usr.h:176
Definition: bufpool.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:33
UINT op
Definition: effect.c:236
#define PS_DISK_EVENT
Definition: common.h:29
#define PS_RW_CONTEXT
Definition: common.h:22
#define PS_DISK_BUFFER
Definition: common.h:30
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define PKEVENT
Definition: env_spec_w32.h:70
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
#define NonPagedPool
Definition: env_spec_w32.h:307
#define PagedPool
Definition: env_spec_w32.h:308
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
VOID Ext2FreePool(IN PVOID P, IN ULONG Tag)
Definition: debug.c:2697
#define ClearFlag(_F, _SF)
Definition: ext2fs.h:191
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define EXT2_DATA_MAGIC
Definition: ext2fs.h:296
#define EXT2_RW_CONTEXT_WRITE
Definition: ext2fs.h:3215
#define IRP_CONTEXT_FLAG_VERIFY_READ
Definition: ext2fs.h:1092
PVOID Ext2AllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
Definition: debug.c:2684
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
Definition: ext2fs.h:1088
@ EXT2FCB
Definition: ext2fs.h:463
#define EXT2_RWC_MAGIC
Definition: ext2fs.h:306
#define VCB_REMOVAL_PREVENTED
Definition: ext2fs.h:807
#define DEC_MEM_COUNT(_i, _p, _s)
Definition: ext2fs.h:608
#define EXT2_BUGCHK_BLOCK
Definition: ext2fs.h:314
#define Ext2BugCheck(A, B, C, D)
Definition: ext2fs.h:340
#define Ext2CanIWait()
Definition: ext2fs.h:1100
#define DbgBreak()
Definition: ext2fs.h:46
struct _EXT2_RW_CONTEXT * PEXT2_RW_CONTEXT
#define DL_ERR
Definition: ext2fs.h:1434
#define INC_MEM_COUNT(_i, _p, _s)
Definition: ext2fs.h:607
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define _SEH2_LEAVE
Definition: filesup.c:20
FP_OP Operation
Definition: fpcontrol.c:150
#define IoFreeMdl
Definition: fxmdl.h:89
#define IoAllocateMdl
Definition: fxmdl.h:88
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
VOID NTAPI IoBuildPartialMdl(IN PMDL SourceMdl, IN PMDL TargetMdl, IN PVOID VirtualAddress, IN ULONG Length)
Definition: iomdl.c:96
IoMarkIrpPending(Irp)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:490
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:931
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1435
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
Definition: mdlsup.c:424
BOOLEAN NTAPI MmIsNonPagedSystemAddressValid(IN PVOID VirtualAddress)
Definition: mmsup.c:204
#define ASSERT(a)
Definition: mode.c:44
@ NormalPagePriority
Definition: imports.h:54
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
#define KernelMode
Definition: asm.h:34
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ NotificationEvent
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:1069
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:881
#define IoCallDriver
Definition: irp.c:1225
VOID NTAPI IoFreeIrp(IN PIRP Irp)
Definition: irp.c:1666
PIRP NTAPI IoMakeAssociatedIrp(IN PIRP Irp, IN CCHAR StackSize)
Definition: irp.c:1925
#define STATUS_PENDING
Definition: ntstatus.h:82
#define Vcb
Definition: cdprocs.h:1415
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define STATUS_SUCCESS
Definition: shellext.h:65
uint64 Length
Definition: DriveVolume.h:48
PERESOURCE Resource
Definition: ext2fs.h:3207
KEVENT Event
Definition: ext2fs.h:3204
BOOLEAN Wait
Definition: ext2fs.h:3211
ERESOURCE_THREAD ThreadId
Definition: ext2fs.h:3208
PFILE_OBJECT FileObject
Definition: ext2fs.h:3209
struct _IO_STACK_LOCATION::@3974::@3978 Read
union _IO_STACK_LOCATION::@1575 Parameters
union _IRP::@1577 AssociatedIrp
IO_STATUS_BLOCK IoStatus
BOOLEAN PreventMediaRemoval
Definition: ntddstor.h:343
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
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
char CCHAR
Definition: typedefs.h:51
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_USER_BUFFER
Definition: udferr_usr.h:166
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static BOOL bVerify
Definition: verify.c:27
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_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_ ULONG IoctlCode
Definition: wdfiotarget.h:1043
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_In_ ULONG OutBufferSize
Definition: wdfwmi.h:87
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ExReleaseResourceForThread
Definition: exfuncs.h:350
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
Definition: iofuncs.h:2680
#define SL_OVERRIDE_VERIFY_VOLUME
Definition: iotypes.h:1823
#define IRP_PAGING_IO
#define FO_FILE_FAST_IO_READ
Definition: iotypes.h:1795
#define FO_FILE_MODIFIED
Definition: iotypes.h:1788
#define FO_SYNCHRONOUS_IO
Definition: iotypes.h:1776
#define IRP_MJ_SHUTDOWN
#define SL_WRITE_THROUGH
Definition: iotypes.h:1824
@ Suspended
Definition: ketypes.h:420
@ Executive
Definition: ketypes.h:415
enum _LOCK_OPERATION LOCK_OPERATION
#define MmGetSystemAddressForMdl(Mdl)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define MDL_PAGES_LOCKED
Definition: mmtypes.h:19