ReactOS 0.4.15-dev-5667-ged97270
fatdata.c
Go to the documentation of this file.
1/*++
2
3Copyright (c) 1989-2000 Microsoft Corporation
4
5Module Name:
6
7 FatData.c
8
9Abstract:
10
11 This module declares the global data used by the Fat file system.
12
13
14--*/
15
16#include "fatprocs.h"
17
18//
19// The Bug check file id for this module
20//
21
22#define BugCheckFileId (FAT_BUG_CHECK_FATDATA)
23
24//
25// The debug trace level
26//
27
28#define Dbg (DEBUG_TRACE_CATCH_EXCEPTIONS)
29
30#ifdef ALLOC_PRAGMA
31
32#if DBG
33#ifdef _MSC_VER
34#pragma alloc_text(PAGE, FatBugCheckExceptionFilter)
35#endif
36#endif
37
38#pragma alloc_text(PAGE, FatCompleteRequest_Real)
39#pragma alloc_text(PAGE, FatFastIoCheckIfPossible)
40#pragma alloc_text(PAGE, FatFastQueryBasicInfo)
41#pragma alloc_text(PAGE, FatFastQueryNetworkOpenInfo)
42#pragma alloc_text(PAGE, FatFastQueryStdInfo)
43#pragma alloc_text(PAGE, FatIsIrpTopLevel)
44#pragma alloc_text(PAGE, FatPopUpFileCorrupt)
45#pragma alloc_text(PAGE, FatProcessException)
46#endif
47
48
49//
50// The global fsd data record, and zero large integer
51//
52
53#ifdef _MSC_VER
54#pragma prefast( suppress:22112, "only applies to user mode processes" )
55#endif
57
60
61#ifndef __REACTOS__
64#else
67#endif
68
69#ifndef __REACTOS__
70LARGE_INTEGER Fat30Milliseconds = {(ULONG)(-30 * 1000 * 10), -1};
71LARGE_INTEGER Fat100Milliseconds = {(ULONG)(-30 * 1000 * 10), -1};
72LARGE_INTEGER FatOneDay = {0x2a69c000, 0xc9};
73LARGE_INTEGER FatJanOne1980 = {0xe1d58000,0x01a8e79f};
74LARGE_INTEGER FatDecThirtyOne1979 = {0xb76bc000,0x01a8e6d6};
75#else
76LARGE_INTEGER Fat30Milliseconds = {{(ULONG)(-30 * 1000 * 10), -1}};
77LARGE_INTEGER Fat100Milliseconds = {{(ULONG)(-30 * 1000 * 10), -1}};
78LARGE_INTEGER FatOneDay = {{0x2a69c000, 0xc9}};
79LARGE_INTEGER FatJanOne1980 = {{0xe1d58000,0x01a8e79f}};
80LARGE_INTEGER FatDecThirtyOne1979 = {{0xb76bc000,0x01a8e6d6}};
81#endif
82
84
85#ifndef __REACTOS__
86LARGE_INTEGER FatMagic10000 = {0xe219652c, 0xd1b71758};
87LARGE_INTEGER FatMagic86400000 = {0xfa67b90e, 0xc6d750eb};
88#else
89LARGE_INTEGER FatMagic10000 = {{0xe219652c, 0xd1b71758}};
90LARGE_INTEGER FatMagic86400000 = {{0xfa67b90e, 0xc6d750eb}};
91#endif
92
93#ifdef _MSC_VER
94#pragma prefast( suppress:22112, "only applies to user mode processes" )
95#endif
97
98//
99// Our lookaside lists.
100//
101
105
107
108//
109// Synchronization for the close queue
110//
111
113
114//
115// Reserve MDL for paging file operations.
116//
117
118#ifndef __REACTOS__
120#else
121volatile PMDL FatReserveMdl = NULL;
122#endif
124
125//
126// Global disk accounting state, enabled or disabled
127//
128
130
131
132#ifdef FASTFATDBG
133
134LONG FatDebugTraceLevel = 0x00000009;
135LONG FatDebugTraceIndent = 0;
136
137ULONG FatFsdEntryCount = 0;
138ULONG FatFspEntryCount = 0;
139ULONG FatIoCallDriverCount = 0;
140
141LONG FatPerformanceTimerLevel = 0x00000000;
142
143ULONG FatTotalTicks[32] = { 0 };
144
145//
146// I need this because C can't support conditional compilation within
147// a macro.
148//
149
151
152#endif // FASTFATDBG
153
154#if DBG
155
156BOOLEAN FatTestRaisedStatus = FALSE;
157
158NTSTATUS FatBreakOnInterestingIoCompletion = STATUS_SUCCESS;
159NTSTATUS FatBreakOnInterestingExceptionStatus = 0;
160NTSTATUS FatBreakOnInterestingIrpCompletion = 0;
161
162#endif
163
164
165#if DBG
166ULONG
167FatBugCheckExceptionFilter (
168 IN PEXCEPTION_POINTERS ExceptionPointer
169 )
170
171/*++
172
173Routine Description:
174
175 An exception filter which acts as an assert that the exception should
176 never occur.
177
178 This is only valid on debug builds, we don't want the overhead on retail.
179
180Arguments:
181
182 ExceptionPointers - The result of GetExceptionInformation() in the context
183 of the exception.
184
185Return Value:
186
187 Bugchecks.
188
189--*/
190
191{
192 PAGED_CODE();
193
194 FatBugCheck( (ULONG_PTR)ExceptionPointer->ExceptionRecord,
195 (ULONG_PTR)ExceptionPointer->ContextRecord,
196 (ULONG_PTR)ExceptionPointer->ExceptionRecord->ExceptionAddress );
197
198// return EXCEPTION_EXECUTE_HANDLER; // unreachable code
199}
200#endif
201
202
203ULONG
205 IN PIRP_CONTEXT IrpContext,
206 IN PEXCEPTION_POINTERS ExceptionPointer
207 )
208
209/*++
210
211Routine Description:
212
213 This routine is used to decide if we should or should not handle
214 an exception status that is being raised. It inserts the status
215 into the IrpContext and either indicates that we should handle
216 the exception or bug check the system.
217
218Arguments:
219
220 ExceptionPointers - The result of GetExceptionInformation() in the context
221 of the exception.
222
223Return Value:
224
225 ULONG - returns EXCEPTION_EXECUTE_HANDLER or bugchecks
226
227--*/
228
229{
231
232 ExceptionCode = ExceptionPointer->ExceptionRecord->ExceptionCode;
233 DebugTrace(0, DEBUG_TRACE_UNWIND, "FatExceptionFilter %X\n", ExceptionCode);
234 DebugDump("FatExceptionFilter\n", Dbg, NULL );
235
236#if DBG
237
238 if( FatBreakOnInterestingExceptionStatus != 0 && ExceptionCode == FatBreakOnInterestingExceptionStatus ) {
240 }
241
242#endif
243
244 //
245 // If the exception is STATUS_IN_PAGE_ERROR, get the I/O error code
246 // from the exception record.
247 //
248
250 if (ExceptionPointer->ExceptionRecord->NumberParameters >= 3) {
251 ExceptionCode = (NTSTATUS)ExceptionPointer->ExceptionRecord->ExceptionInformation[2];
252 }
253 }
254
255 //
256 // If there is not an irp context, we must have had insufficient resources.
257 //
258
259 if ( !ARGUMENT_PRESENT( IrpContext ) ) {
260
262
263#ifdef _MSC_VER
264#pragma prefast( suppress:28159, "things are seriously wrong if we get here" )
265#endif
266 FatBugCheck( (ULONG_PTR)ExceptionPointer->ExceptionRecord,
267 (ULONG_PTR)ExceptionPointer->ContextRecord,
268 (ULONG_PTR)ExceptionPointer->ExceptionRecord->ExceptionAddress );
269 }
270
272 }
273
274 //
275 // For the purposes of processing this exception, let's mark this
276 // request as being able to wait and disable write through if we
277 // aren't posting it.
278 //
279
280 SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT);
281
284
286 }
287
288 if ( IrpContext->ExceptionStatus == 0 ) {
289
291
292 IrpContext->ExceptionStatus = ExceptionCode;
293
295
296 } else {
297
298#ifdef _MSC_VER
299#pragma prefast( suppress:28159, "things are seriously wrong if we get here" )
300#endif
301 FatBugCheck( (ULONG_PTR)ExceptionPointer->ExceptionRecord,
302 (ULONG_PTR)ExceptionPointer->ContextRecord,
303 (ULONG_PTR)ExceptionPointer->ExceptionRecord->ExceptionAddress );
304 }
305
306 } else {
307
308 //
309 // We raised this code explicitly ourselves, so it had better be
310 // expected.
311 //
312
313 NT_ASSERT( IrpContext->ExceptionStatus == ExceptionCode );
315 }
316
318}
319
320_Requires_lock_held_(_Global_critical_region_)
322FatProcessException (
323 IN PIRP_CONTEXT IrpContext,
324 IN PIRP Irp,
326 )
327
328/*++
329
330Routine Description:
331
332 This routine process an exception. It either completes the request
333 with the saved exception status or it sends it off to IoRaiseHardError()
334
335Arguments:
336
337 Irp - Supplies the Irp being processed
338
339 ExceptionCode - Supplies the normalized exception status being handled
340
341Return Value:
342
343 NTSTATUS - Returns the results of either posting the Irp or the
344 saved completion status.
345
346--*/
347
348{
349 PVCB Vcb;
351 FAT_VOLUME_STATE TransitionState = VolumeDirty;
352 ULONG SavedFlags = 0;
353
354 PAGED_CODE();
355
356 DebugTrace(0, Dbg, "FatProcessException\n", 0);
357
358 //
359 // If there is not an irp context, we must have had insufficient resources.
360 //
361
362 if ( !ARGUMENT_PRESENT( IrpContext ) ) {
363
365
366 return ExceptionCode;
367 }
368
369 //
370 // Get the real exception status from IrpContext->ExceptionStatus, and
371 // reset it.
372 //
373
374 ExceptionCode = IrpContext->ExceptionStatus;
375 FatResetExceptionState( IrpContext );
376
377 //
378 // If this is an Mdl write request, then take care of the Mdl
379 // here so that things get cleaned up properly. Cc now leaves
380 // the MDL in place so a filesystem can retry after clearing an
381 // internal condition (FAT does not).
382 //
383
384 if ((IrpContext->MajorFunction == IRP_MJ_WRITE) &&
385 (FlagOn( IrpContext->MinorFunction, IRP_MN_COMPLETE_MDL ) == IRP_MN_COMPLETE_MDL) &&
386 (Irp->MdlAddress != NULL)) {
387
389
390 CcMdlWriteAbort( LocalIrpSp->FileObject, Irp->MdlAddress );
391 Irp->MdlAddress = NULL;
392 }
393
394 //
395 // If we are going to post the request, we may have to lock down the
396 // user's buffer, so do it here in a try except so that we failed the
397 // request if the LockPages fails.
398 //
399 // Also unpin any repinned Bcbs, protected by the try {} except {} filter.
400 //
401
402 _SEH2_TRY {
403
404 SavedFlags = IrpContext->Flags;
405
406 //
407 // Make sure we don't try to write through Bcbs
408 //
409
411
412 FatUnpinRepinnedBcbs( IrpContext );
413
414 IrpContext->Flags = SavedFlags;
415
416 //
417 // If we will have to post the request, do it here. Note
418 // that the last thing FatPrePostIrp() does is mark the Irp pending,
419 // so it is critical that we actually return PENDING. Nothing
420 // from this point to return can fail, so we are OK.
421 //
422 // We cannot do a verify operations at APC level because we
423 // have to wait for Io operations to complete.
424 //
425
426 if (!FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_RECURSIVE_CALL) &&
429#else
431#endif
433
434 ExceptionCode = FatFsdPostRequest( IrpContext, Irp );
435 }
436
438
439 ExceptionCode = IrpContext->ExceptionStatus;
440 IrpContext->ExceptionStatus = 0;
441
442 IrpContext->Flags = SavedFlags;
443 } _SEH2_END;
444
445 //
446 // If we posted the request, just return here.
447 //
448
450
451 return ExceptionCode;
452 }
453
455
456
457 //
458 // If this request is not a "top-level" irp, just complete it.
459 //
460
461 if (FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_RECURSIVE_CALL)) {
462
463 //
464 // If there is a cache operation above us, commute verify
465 // to a lock conflict. This will cause retries so that
466 // we have a chance of getting through without needing
467 // to return an unaesthetic error for the operation.
468 //
469
472
474 }
475
476 FatCompleteRequest( IrpContext, Irp, ExceptionCode );
477
478 return ExceptionCode;
479 }
480
482
483 //
484 // Check for the various error conditions that can be caused by,
485 // and possibly resolved by the user.
486 //
487
489
491
492 DebugTrace(0, Dbg, "Perform Verify Operation\n", 0);
493
494 //
495 // Now we are at the top level file system entry point.
496 //
497 // Grab the device to verify from the thread local storage
498 // and stick it in the information field for transportation
499 // to the fsp. We also clear the field at this time.
500 //
501
502 Device = IoGetDeviceToVerify( Irp->Tail.Overlay.Thread );
503 IoSetDeviceToVerify( Irp->Tail.Overlay.Thread, NULL );
504
505 if ( Device == NULL ) {
506
509
510 NT_ASSERT( Device != NULL );
511 }
512
513 //
514 // It turns out some storage drivers really do set invalid non-NULL device
515 // objects to verify.
516 //
517 // To work around this, completely ignore the device to verify in the thread,
518 // and just use our real device object instead.
519 //
520
521 if (IrpContext->Vcb) {
522
523 Device = IrpContext->Vcb->Vpb->RealDevice;
524
525 } else {
526
527 //
528 // For FSCTLs, IrpContext->Vcb may not be populated, so get the IrpContext->RealDevice instead
529 //
530
531 Device = IrpContext->RealDevice;
532 }
533
534 //
535 // Let's not BugCheck just because the device to verify is somehow still NULL.
536 //
537
538 if (Device == NULL) {
539
541
542 FatCompleteRequest( IrpContext, Irp, ExceptionCode );
543
544 return ExceptionCode;
545 }
546
547 //
548 // FatPerformVerify() will do the right thing with the Irp.
549
550 return FatPerformVerify( IrpContext, Irp, Device );
551 }
552
553 //
554 // The other user induced conditions generate an error unless
555 // they have been disabled for this request.
556 //
557
558 if (FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_DISABLE_POPUPS)) {
559
560 FatCompleteRequest( IrpContext, Irp, ExceptionCode );
561
562 return ExceptionCode;
563
564 } else {
565
566 //
567 // Generate a pop-up
568 //
569
570 PDEVICE_OBJECT RealDevice = NULL;
571 PVPB Vpb;
573
575
577
578 } else {
579
580 Vpb = NULL;
581 }
582
583 //
584 // The device to verify is either in my thread local storage
585 // or that of the thread that owns the Irp.
586 //
587
588 Thread = Irp->Tail.Overlay.Thread;
589 RealDevice = IoGetDeviceToVerify( Thread );
590
591 if ( RealDevice == NULL ) {
592
594 RealDevice = IoGetDeviceToVerify( Thread );
595
596 NT_ASSERT( RealDevice != NULL );
597 }
598
599 //
600 // It turns out some storage drivers really do set invalid non-NULL device
601 // objects to verify.
602 //
603 // To work around this, completely ignore the device to verify in the thread,
604 // and just use our real device object instead.
605 //
606
607 if (IrpContext->Vcb) {
608
609 RealDevice = IrpContext->Vcb->Vpb->RealDevice;
610
611 } else {
612
613 //
614 // For FSCTLs, IrpContext->Vcb may not be populated, so get the IrpContext->RealDevice instead
615 //
616
617 RealDevice = IrpContext->RealDevice;
618 }
619
620 //
621 // Let's not BugCheck just because the device to verify is somehow still NULL.
622 //
623
624 if (RealDevice == NULL) {
625
626 FatCompleteRequest( IrpContext, Irp, ExceptionCode );
627
628 return ExceptionCode;
629 }
630
631 //
632 // This routine actually causes the pop-up. It usually
633 // does this by queuing an APC to the callers thread,
634 // but in some cases it will complete the request immediately,
635 // so it is very important to IoMarkIrpPending() first.
636 //
637
639 IoRaiseHardError( Irp, Vpb, RealDevice );
640
641 //
642 // We will be handing control back to the caller here, so
643 // reset the saved device object.
644 //
645
647
648 //
649 // The Irp will be completed by Io or resubmitted. In either
650 // case we must clean up the IrpContext here.
651 //
652
653 FatDeleteIrpContext( IrpContext );
654 return STATUS_PENDING;
655 }
656 }
657
658 //
659 // This is just a run of the mill error. If is a STATUS that we
660 // raised ourselves, and the information would be use for the
661 // user, raise an informational pop-up.
662 //
663
665 Vcb = IrpContext->Vcb;
666
667 //
668 // Now, if the Vcb is unknown to us this means that the error was raised
669 // in the process of a mount and before we even had a chance to build
670 // a full Vcb - and was really handled there.
671 //
672
673 if (Vcb != NULL) {
674
678
679 TransitionState = VolumeDirtyWithSurfaceTest;
680 }
681
682 //
683 // If this was a STATUS_FILE_CORRUPT or similar error indicating some
684 // nastiness out on the media, then mark the volume permanently dirty.
685 //
686
687 if (!FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_DISABLE_POPUPS) &&
688 ( TransitionState == VolumeDirtyWithSurfaceTest ||
695
697 NT_ASSERT( !FlagOn( IrpContext->Flags, IRP_CONTEXT_FLAG_RECURSIVE_CALL));
698
700 SetFlag( IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT);
701
702 //
703 // Do the "dirty" work, ignoring any error. We need to take the Vcb here
704 // to synchronize against the verify path tearing things down, since
705 // we dropped all synchronization when backing up due to the exception.
706 //
707
709
710 _SEH2_TRY {
711
712 if (VcbGood == Vcb->VcbCondition) {
713
714 FatMarkVolume( IrpContext, Vcb, TransitionState );
715 }
716 }
718
719 NOTHING;
720 } _SEH2_END;
721
722 FatReleaseVcb( IrpContext, Vcb);
723 }
724 }
725
726 FatCompleteRequest( IrpContext, Irp, ExceptionCode );
727
728 return ExceptionCode;
729}
730
731
732VOID
734 IN PIRP_CONTEXT IrpContext OPTIONAL,
737 )
738
739/*++
740
741Routine Description:
742
743 This routine completes a Irp
744
745Arguments:
746
747 Irp - Supplies the Irp being processed
748
749 Status - Supplies the status to complete the Irp with
750
751Return Value:
752
753 None.
754
755--*/
756
757{
758 PAGED_CODE();
759
760#if DBG
761 if ( (FatBreakOnInterestingIrpCompletion != 0) && (Status == FatBreakOnInterestingIrpCompletion) ) {
763 }
764
765#endif
766
767 //
768 // If we have an Irp Context then unpin all of the repinned bcbs
769 // we might have collected.
770 //
771
772 if (IrpContext != NULL) {
773
774 NT_ASSERT( IrpContext->Repinned.Bcb[0] == NULL );
775
776 FatUnpinRepinnedBcbs( IrpContext );
777 }
778
779 //
780 // Delete the Irp context before completing the IRP so if
781 // we run into some of the asserts, we can still backtrack
782 // through the IRP.
783 //
784
785 if (IrpContext != NULL) {
786
787 FatDeleteIrpContext( IrpContext );
788 }
789
790 //
791 // If we have an Irp then complete the irp.
792 //
793
794 if (Irp != NULL) {
795
796 //
797 // We got an error, so zero out the information field before
798 // completing the request if this was an input operation.
799 // Otherwise IopCompleteRequest will try to copy to the user's buffer.
800 //
801
802 if ( NT_ERROR(Status) &&
803 FlagOn(Irp->Flags, IRP_INPUT_OPERATION) ) {
804
805 Irp->IoStatus.Information = 0;
806 }
807
808 Irp->IoStatus.Status = Status;
809
811 }
812
813 return;
814}
815
818 IN PIRP Irp
819 )
820
821/*++
822
823Routine Description:
824
825 This routine detects if an Irp is the Top level requestor, ie. if it os OK
826 to do a verify or pop-up now. If TRUE is returned, then no file system
827 resources are held above us.
828
829Arguments:
830
831 Irp - Supplies the Irp being processed
832
833 Status - Supplies the status to complete the Irp with
834
835Return Value:
836
837 None.
838
839--*/
840
841{
842 PAGED_CODE();
843
844 if ( IoGetTopLevelIrp() == NULL ) {
845
847
848 return TRUE;
849
850 } else {
851
852 return FALSE;
853 }
854}
855
856
857_Function_class_(FAST_IO_CHECK_IF_POSSIBLE)
859NTAPI
860FatFastIoCheckIfPossible (
869 )
870
871/*++
872
873Routine Description:
874
875 This routine checks if fast i/o is possible for a read/write operation
876
877Arguments:
878
879 FileObject - Supplies the file object used in the query
880
881 FileOffset - Supplies the starting byte offset for the read/write operation
882
883 Length - Supplies the length, in bytes, of the read/write operation
884
885 Wait - Indicates if we can wait
886
887 LockKey - Supplies the lock key
888
889 CheckForReadOperation - Indicates if this is a check for a read or write
890 operation
891
892 IoStatus - Receives the status of the operation if our return value is
893 FastIoReturnError
894
895Return Value:
896
897 BOOLEAN - TRUE if fast I/O is possible and FALSE if the caller needs
898 to take the long route.
899
900--*/
901
902{
903 PVCB Vcb;
904 PFCB Fcb;
905 PCCB Ccb;
906
907 LARGE_INTEGER LargeLength;
908
909 PAGED_CODE();
910
914 //
915 // Decode the file object to get our fcb, the only one we want
916 // to deal with is a UserFileOpen
917 //
918
920
921 return FALSE;
922 }
923
924 LargeLength.QuadPart = Length;
925
926 //
927 // Based on whether this is a read or write operation we call
928 // fsrtl check for read/write
929 //
930
932
935 &LargeLength,
936 LockKey,
939
940 return TRUE;
941 }
942
943 } else {
944
945
946 //
947 // Also check for a write-protected volume here.
948 //
949
950 if (!FlagOn(Vcb->VcbState, VCB_STATE_FLAG_WRITE_PROTECTED) &&
953 &LargeLength,
954 LockKey,
957
958 return TRUE;
959 }
960 }
961
962 return FALSE;
963}
964
965
966_Function_class_(FAST_IO_QUERY_BASIC_INFO)
968NTAPI
969FatFastQueryBasicInfo (
975 )
976
977/*++
978
979Routine Description:
980
981 This routine is for the fast query call for basic file information.
982
983Arguments:
984
985 FileObject - Supplies the file object used in this operation
986
987 Wait - Indicates if we are allowed to wait for the information
988
989 Buffer - Supplies the output buffer to receive the basic information
990
991 IoStatus - Receives the final status of the operation
992
993Return Value:
994
995 BOOLEAN - TRUE if the operation succeeded and FALSE if the caller
996 needs to take the long route.
997
998--*/
999
1000{
1001 BOOLEAN Results = FALSE;
1002 IRP_CONTEXT IrpContext;
1003
1005 PVCB Vcb;
1006 PFCB Fcb;
1007 PCCB Ccb;
1008
1009 BOOLEAN FcbAcquired = FALSE;
1010
1011 PAGED_CODE();
1013
1014 //
1015 // Prepare the dummy irp context
1016 //
1017
1018 RtlZeroMemory( &IrpContext, sizeof(IRP_CONTEXT) );
1019 IrpContext.NodeTypeCode = FAT_NTC_IRP_CONTEXT;
1020 IrpContext.NodeByteSize = sizeof(IRP_CONTEXT);
1021
1022 if (Wait) {
1023
1024 SetFlag(IrpContext.Flags, IRP_CONTEXT_FLAG_WAIT);
1025
1026 } else {
1027
1028 ClearFlag(IrpContext.Flags, IRP_CONTEXT_FLAG_WAIT);
1029 }
1030
1031 //
1032 // Determine the type of open for the input file object and only accept
1033 // the user file or directory open
1034 //
1035
1037
1039
1040 return Results;
1041 }
1042
1044
1045 //
1046 // Get access to the Fcb but only if it is not the paging file
1047 //
1048
1050
1051 if (!ExAcquireResourceSharedLite( Fcb->Header.Resource, Wait )) {
1052
1054 return Results;
1055 }
1056
1057 FcbAcquired = TRUE;
1058 }
1059
1060 _SEH2_TRY {
1061
1062 //
1063 // If the Fcb is not in a good state, return FALSE.
1064 //
1065
1066 if (Fcb->FcbCondition != FcbGood) {
1067
1068 try_return( Results );
1069 }
1070
1071 Buffer->FileAttributes = 0;
1072
1073 //
1074 // If the fcb is not the root dcb then we will fill in the
1075 // buffer otherwise it is all setup for us.
1076 //
1077
1078 if (NodeType(Fcb) != FAT_NTC_ROOT_DCB) {
1079
1080 //
1081 // Extract the data and fill in the non zero fields of the output
1082 // buffer
1083 //
1084
1085 Buffer->LastWriteTime = Fcb->LastWriteTime;
1086 Buffer->CreationTime = Fcb->CreationTime;
1087 Buffer->LastAccessTime = Fcb->LastAccessTime;
1088
1089 //
1090 // Zero out the field we don't support.
1091 //
1092
1093 Buffer->ChangeTime.QuadPart = 0;
1094 Buffer->FileAttributes = Fcb->DirentFatFlags;
1095
1096 } else {
1097
1098 Buffer->LastWriteTime.QuadPart = 0;
1099 Buffer->CreationTime.QuadPart = 0;
1100 Buffer->LastAccessTime.QuadPart = 0;
1101 Buffer->ChangeTime.QuadPart = 0;
1102
1103 Buffer->FileAttributes = FILE_ATTRIBUTE_DIRECTORY;
1104 }
1105
1106
1107 //
1108 // If the temporary flag is set, then set it in the buffer.
1109 //
1110
1112
1113 SetFlag( Buffer->FileAttributes, FILE_ATTRIBUTE_TEMPORARY );
1114 }
1115
1116 //
1117 // If no attributes were set, set the normal bit.
1118 //
1119
1120 if (Buffer->FileAttributes == 0) {
1121
1122 Buffer->FileAttributes = FILE_ATTRIBUTE_NORMAL;
1123 }
1124
1125 IoStatus->Status = STATUS_SUCCESS;
1126 IoStatus->Information = sizeof(FILE_BASIC_INFORMATION);
1127
1128 Results = TRUE;
1129
1130 try_exit: NOTHING;
1131 } _SEH2_FINALLY {
1132
1133 if (FcbAcquired) { ExReleaseResourceLite( Fcb->Header.Resource ); }
1134
1136 } _SEH2_END;
1137
1138 //
1139 // And return to our caller
1140 //
1141
1142 return Results;
1143}
1144
1145
1146_Function_class_(FAST_IO_QUERY_STANDARD_INFO)
1147BOOLEAN
1148NTAPI
1149FatFastQueryStdInfo (
1151 IN BOOLEAN Wait,
1155 )
1156
1157/*++
1158
1159Routine Description:
1160
1161 This routine is for the fast query call for standard file information.
1162
1163Arguments:
1164
1165 FileObject - Supplies the file object used in this operation
1166
1167 Wait - Indicates if we are allowed to wait for the information
1168
1169 Buffer - Supplies the output buffer to receive the basic information
1170
1171 IoStatus - Receives the final status of the operation
1172
1173Return Value:
1174
1175 BOOLEAN - TRUE if the operation succeeded and FALSE if the caller
1176 needs to take the long route.
1177
1178--*/
1179
1180{
1181 BOOLEAN Results = FALSE;
1182 IRP_CONTEXT IrpContext;
1183
1185 PVCB Vcb;
1186 PFCB Fcb;
1187 PCCB Ccb;
1188
1189 BOOLEAN FcbAcquired = FALSE;
1190
1191 PAGED_CODE();
1192
1194
1195 //
1196 // Prepare the dummy irp context
1197 //
1198
1199 RtlZeroMemory( &IrpContext, sizeof(IRP_CONTEXT) );
1200 IrpContext.NodeTypeCode = FAT_NTC_IRP_CONTEXT;
1201 IrpContext.NodeByteSize = sizeof(IRP_CONTEXT);
1202
1203 if (Wait) {
1204
1205 SetFlag(IrpContext.Flags, IRP_CONTEXT_FLAG_WAIT);
1206
1207 } else {
1208
1209 ClearFlag(IrpContext.Flags, IRP_CONTEXT_FLAG_WAIT);
1210 }
1211
1212 //
1213 // Determine the type of open for the input file object and only accept
1214 // the user file or directory open
1215 //
1216
1218
1220
1221 return Results;
1222 }
1223
1224 //
1225 // Get access to the Fcb but only if it is not the paging file
1226 //
1227
1229
1231
1232 if (!ExAcquireResourceSharedLite( Fcb->Header.Resource, Wait )) {
1233
1235 return Results;
1236 }
1237
1238 FcbAcquired = TRUE;
1239 }
1240
1241 _SEH2_TRY {
1242
1243 //
1244 // If the Fcb is not in a good state, return FALSE.
1245 //
1246
1247 if (Fcb->FcbCondition != FcbGood) {
1248
1249 try_return( Results );
1250 }
1251
1252 Buffer->NumberOfLinks = 1;
1254
1255 //
1256 // Case on whether this is a file or a directory, and extract
1257 // the information and fill in the fcb/dcb specific parts
1258 // of the output buffer.
1259 //
1260
1261 if (NodeType(Fcb) == FAT_NTC_FCB) {
1262
1263 //
1264 // If we don't alread know the allocation size, we cannot look
1265 // it up in the fast path.
1266 //
1267
1268 if (Fcb->Header.AllocationSize.QuadPart == FCB_LOOKUP_ALLOCATIONSIZE_HINT) {
1269
1270 try_return( Results );
1271 }
1272
1273 Buffer->AllocationSize = Fcb->Header.AllocationSize;
1274 Buffer->EndOfFile = Fcb->Header.FileSize;
1275
1276 Buffer->Directory = FALSE;
1277
1278 } else {
1279
1280 Buffer->AllocationSize = FatLargeZero;
1281 Buffer->EndOfFile = FatLargeZero;
1282
1283 Buffer->Directory = TRUE;
1284 }
1285
1286 IoStatus->Status = STATUS_SUCCESS;
1287 IoStatus->Information = sizeof(FILE_STANDARD_INFORMATION);
1288
1289 Results = TRUE;
1290
1291 try_exit: NOTHING;
1292 } _SEH2_FINALLY {
1293
1294 if (FcbAcquired) { ExReleaseResourceLite( Fcb->Header.Resource ); }
1295
1297 } _SEH2_END;
1298
1299 //
1300 // And return to our caller
1301 //
1302
1303 return Results;
1304}
1305
1306
1307_Function_class_(FAST_IO_QUERY_NETWORK_OPEN_INFO)
1308BOOLEAN
1309NTAPI
1310FatFastQueryNetworkOpenInfo (
1312 IN BOOLEAN Wait,
1316 )
1317
1318/*++
1319
1320Routine Description:
1321
1322 This routine is for the fast query call for network open information.
1323
1324Arguments:
1325
1326 FileObject - Supplies the file object used in this operation
1327
1328 Wait - Indicates if we are allowed to wait for the information
1329
1330 Buffer - Supplies the output buffer to receive the information
1331
1332 IoStatus - Receives the final status of the operation
1333
1334Return Value:
1335
1336 BOOLEAN - TRUE if the operation succeeded and FALSE if the caller
1337 needs to take the long route.
1338
1339--*/
1340
1341{
1342 BOOLEAN Results = FALSE;
1343 IRP_CONTEXT IrpContext;
1344
1346 PVCB Vcb;
1347 PFCB Fcb;
1348 PCCB Ccb;
1349
1350 BOOLEAN FcbAcquired = FALSE;
1351
1352 PAGED_CODE();
1353
1355
1356 //
1357 // Prepare the dummy irp context
1358 //
1359
1360 RtlZeroMemory( &IrpContext, sizeof(IRP_CONTEXT) );
1361 IrpContext.NodeTypeCode = FAT_NTC_IRP_CONTEXT;
1362 IrpContext.NodeByteSize = sizeof(IRP_CONTEXT);
1363
1364 if (Wait) {
1365
1366 SetFlag(IrpContext.Flags, IRP_CONTEXT_FLAG_WAIT);
1367
1368 } else {
1369
1370 ClearFlag(IrpContext.Flags, IRP_CONTEXT_FLAG_WAIT);
1371 }
1372
1373 //
1374 // Determine the type of open for the input file object and only accept
1375 // the user file or directory open
1376 //
1377
1379
1381
1382 return Results;
1383 }
1384
1386
1387 //
1388 // Get access to the Fcb but only if it is not the paging file
1389 //
1390
1392
1393 if (!ExAcquireResourceSharedLite( Fcb->Header.Resource, Wait )) {
1394
1396 return Results;
1397 }
1398
1399 FcbAcquired = TRUE;
1400 }
1401
1402 _SEH2_TRY {
1403
1404 //
1405 // If the Fcb is not in a good state, return FALSE.
1406 //
1407
1408 if (Fcb->FcbCondition != FcbGood) {
1409
1410 try_return( Results );
1411 }
1412
1413 //
1414 // Extract the data and fill in the non zero fields of the output
1415 // buffer
1416 //
1417
1418 //
1419 // Default the field we don't support to a reasonable value.
1420 //
1421
1423 &Buffer->ChangeTime );
1424
1425 Buffer->FileAttributes = Fcb->DirentFatFlags;
1426
1427 if (Fcb->Header.NodeTypeCode == FAT_NTC_ROOT_DCB) {
1428
1429 //
1430 // Reuse the default for the root dir.
1431 //
1432
1433 Buffer->CreationTime =
1434 Buffer->LastAccessTime =
1435 Buffer->LastWriteTime = Buffer->ChangeTime;
1436
1437 } else {
1438
1439 Buffer->LastWriteTime = Fcb->LastWriteTime;
1440 Buffer->CreationTime = Fcb->CreationTime;
1441 Buffer->LastAccessTime = Fcb->LastAccessTime;
1442
1443 }
1444
1445 //
1446 // If the temporary flag is set, then set it in the buffer.
1447 //
1448
1450
1451 SetFlag( Buffer->FileAttributes, FILE_ATTRIBUTE_TEMPORARY );
1452 }
1453
1454
1455
1456 //
1457 // If no attributes were set, set the normal bit.
1458 //
1459
1460 if (Buffer->FileAttributes == 0) {
1461
1462 Buffer->FileAttributes = FILE_ATTRIBUTE_NORMAL;
1463 }
1464
1465 if (NodeType(Fcb) == FAT_NTC_FCB) {
1466
1467 //
1468 // If we don't already know the allocation size, we cannot
1469 // lock it up in the fast path.
1470 //
1471
1472 if (Fcb->Header.AllocationSize.QuadPart == FCB_LOOKUP_ALLOCATIONSIZE_HINT) {
1473
1474 try_return( Results );
1475 }
1476
1477 Buffer->AllocationSize = Fcb->Header.AllocationSize;
1478 Buffer->EndOfFile = Fcb->Header.FileSize;
1479
1480 } else {
1481
1482 Buffer->AllocationSize = FatLargeZero;
1483 Buffer->EndOfFile = FatLargeZero;
1484 }
1485
1486 IoStatus->Status = STATUS_SUCCESS;
1487 IoStatus->Information = sizeof(FILE_NETWORK_OPEN_INFORMATION);
1488
1489 Results = TRUE;
1490
1491 try_exit: NOTHING;
1492 } _SEH2_FINALLY {
1493
1494 if (FcbAcquired) { ExReleaseResourceLite( Fcb->Header.Resource ); }
1495
1497 } _SEH2_END;
1498
1499 //
1500 // And return to our caller
1501 //
1502
1503 return Results;
1504}
1505
1506_Requires_lock_held_(_Global_critical_region_)
1507VOID
1508FatPopUpFileCorrupt (
1509 IN PIRP_CONTEXT IrpContext,
1510 IN PFCB Fcb
1511 )
1512
1513/*++
1514
1515Routine Description:
1516
1517 The Following routine makes an informational popup that the file
1518 is corrupt.
1519
1520Arguments:
1521
1522 Fcb - The file that is corrupt.
1523
1524Return Value:
1525
1526 None.
1527
1528--*/
1529
1530{
1532
1533 PAGED_CODE();
1534
1535 //
1536 // Disable the popup on the root directory. It is important not
1537 // to generate them on objects which are part of the mount process.
1538 //
1539
1540 if (NodeType(Fcb) == FAT_NTC_ROOT_DCB) {
1541
1542 return;
1543 }
1544
1545 //
1546 // Got to grab the full filename now.
1547 //
1548
1549 if (Fcb->FullFileName.Buffer == NULL) {
1550
1551 FatSetFullFileNameInFcb( IrpContext, Fcb );
1552 }
1553
1554 //
1555 // We never want to block a system thread waiting for the user to
1556 // press OK.
1557 //
1558
1559 if (IoIsSystemThread(IrpContext->OriginatingIrp->Tail.Overlay.Thread)) {
1560
1561 Thread = NULL;
1562
1563 } else {
1564
1565#ifndef __REACTOS__
1566 Thread = IrpContext->OriginatingIrp->Tail.Overlay.Thread;
1567#else
1568 Thread = (PKTHREAD)IrpContext->OriginatingIrp->Tail.Overlay.Thread;
1569#endif
1570 }
1571
1573 &Fcb->FullFileName,
1574 Thread);
1575}
1576
#define PAGED_CODE()
#define STATUS_EA_LIST_INCONSISTENT
Definition: IoEaTest.cpp:21
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI CcMdlWriteAbort(IN PFILE_OBJECT FileObject, IN PMDL MdlChain)
Definition: mdlsup.c:120
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
Definition: cdprocs.h:1774
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN TypeOfOpen
Definition: cdprocs.h:589
@ UserDirectoryOpen
Definition: cdprocs.h:576
@ UserFileOpen
Definition: cdprocs.h:577
_In_ PFCB Fcb
Definition: cdprocs.h:159
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:592
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define try_return(S)
Definition: cdprocs.h:2179
#define IRP_CONTEXT_FLAG_WAIT
Definition: cdstruc.h:1215
#define IRP_CONTEXT_FLAG_DISABLE_POPUPS
Definition: cdstruc.h:1222
@ FcbGood
Definition: cdstruc.h:779
Definition: bufpool.h:45
#define _Requires_lock_held_(lock)
_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
#define NTSTATUS
Definition: precomp.h:20
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define NodeType(P)
Definition: nodetype.h:51
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define FAT_NTC_ROOT_DCB
Definition: nodetype.h:31
#define FAT_NTC_FCB
Definition: nodetype.h:29
#define FAT_NTC_VCB
Definition: nodetype.h:28
#define FatBugCheck(A, B, C)
Definition: nodetype.h:104
#define FAT_NTC_IRP_CONTEXT
Definition: nodetype.h:33
#define ExLocalTimeToSystemTime(LocTime, SysTime)
Definition: env_spec_w32.h:738
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define ExAcquireResourceSharedLite(res, wait)
Definition: env_spec_w32.h:621
#define ClearFlag(_F, _SF)
Definition: ext2fs.h:191
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
VOID FatUnpinRepinnedBcbs(IN PIRP_CONTEXT IrpContext)
Definition: cachesup.c:1407
NPAGED_LOOKASIDE_LIST FatNonPagedFcbLookasideList
Definition: fatdata.c:103
FAST_MUTEX FatCloseQueueMutex
Definition: fatdata.c:112
PDEVICE_OBJECT FatDiskFileSystemDeviceObject
Definition: fatdata.c:58
LARGE_INTEGER FatJanOne1980
Definition: fatdata.c:73
LARGE_INTEGER FatDecThirtyOne1979
Definition: fatdata.c:74
KEVENT FatReserveEvent
Definition: fatdata.c:123
LARGE_INTEGER Fat30Milliseconds
Definition: fatdata.c:70
FAT_TIME_STAMP FatTimeJanOne1980
Definition: fatdata.c:83
SLIST_HEADER FatCloseContextSList
Definition: fatdata.c:106
LOGICAL FatDiskAccountingEnabled
Definition: fatdata.c:129
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
Definition: fatdata.c:204
LARGE_INTEGER FatMaxLarge
Definition: fatdata.c:63
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
Definition: fatdata.c:817
LARGE_INTEGER FatLargeZero
Definition: fatdata.c:62
NPAGED_LOOKASIDE_LIST FatIrpContextLookasideList
Definition: fatdata.c:102
LARGE_INTEGER FatMagic10000
Definition: fatdata.c:86
NPAGED_LOOKASIDE_LIST FatEResourceLookasideList
Definition: fatdata.c:104
FAST_IO_DISPATCH FatFastIoDispatch
Definition: fatdata.c:96
FAT_DATA FatData
Definition: fatdata.c:56
LARGE_INTEGER FatMagic86400000
Definition: fatdata.c:87
LARGE_INTEGER FatOneDay
Definition: fatdata.c:72
#define Dbg
Definition: fatdata.c:28
VOID FatCompleteRequest_Real(IN PIRP_CONTEXT IrpContext OPTIONAL, IN PIRP Irp OPTIONAL, IN NTSTATUS Status)
Definition: fatdata.c:733
LARGE_INTEGER Fat100Milliseconds
Definition: fatdata.c:71
PMDL FatReserveMdl
Definition: fatdata.c:119
PDEVICE_OBJECT FatCdromFileSystemDeviceObject
Definition: fatdata.c:59
#define FatNull
Definition: fatdata.h:321
#define DebugDump(STR, LEVEL, PTR)
Definition: fatdata.h:314
#define DebugTrace(INDENT, LEVEL, X, Y)
Definition: fatdata.h:313
@ VolumeDirty
Definition: fatprocs.h:1955
@ VolumeDirtyWithSurfaceTest
Definition: fatprocs.h:1956
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2665
#define FatDeleteIrpContext(IRPCONTEXT)
Definition: fatprocs.h:1762
NTSTATUS FatFsdPostRequest(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
Definition: workque.c:229
TYPE_OF_OPEN FatDecodeFileObject(_In_ PFILE_OBJECT FileObject, _Outptr_ PVCB *Vcb, _Outptr_ PFCB *FcbOrDcb, _Outptr_ PCCB *Ccb)
Definition: filobsup.c:176
#define FatCompleteRequest(IRPCONTEXT, IRP, STATUS)
Definition: fatprocs.h:2633
#define FatDeviceIsFatFsdo(D)
Definition: fatprocs.h:3095
#define FatResetExceptionState(IRPCONTEXT)
Definition: fatprocs.h:2983
#define FatAcquireExclusiveVcbNoOpCheck(IC, V)
Definition: fatprocs.h:1461
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1675
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
Definition: fatprocs.h:2666
enum _FAT_VOLUME_STATE FAT_VOLUME_STATE
#define FatReleaseVcb(IRPCONTEXT, Vcb)
Definition: fatprocs.h:1640
#define IRP_CONTEXT_FLAG_RECURSIVE_CALL
Definition: fatstruc.h:1566
#define VCB_STATE_FLAG_MOUNTED_DIRTY
Definition: fatstruc.h:562
#define FCB_STATE_TEMPORARY
Definition: fatstruc.h:1198
#define VCB_STATE_FLAG_WRITE_PROTECTED
Definition: fatstruc.h:570
#define FCB_STATE_DELETE_ON_CLOSE
Definition: fatstruc.h:1193
#define FCB_LOOKUP_ALLOCATIONSIZE_HINT
Definition: fatstruc.h:1241
#define FCB_STATE_PAGING_FILE
Definition: fatstruc.h:1195
@ VcbGood
Definition: fatstruc.h:223
#define IRP_CONTEXT_FLAG_DISABLE_WRITE_THROUGH
Definition: fatstruc.h:1565
BOOLEAN NTAPI FsRtlFastCheckLockForWrite(IN PFILE_LOCK FileLock, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN ULONG Key, IN PFILE_OBJECT FileObject, IN PVOID Process)
Definition: filelock.c:782
BOOLEAN NTAPI FsRtlFastCheckLockForRead(IN PFILE_LOCK FileLock, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN ULONG Key, IN PFILE_OBJECT FileObject, IN PVOID Process)
Definition: filelock.c:748
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
struct _FILE_NETWORK_OPEN_INFORMATION FILE_NETWORK_OPEN_INFORMATION
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define NOTHING
Definition: input_list.c:10
IoMarkIrpPending(Irp)
#define NTDDI_VERSION
Definition: k32.h:33
if(dx< 0)
Definition: linetemp.h:194
#define FILE_STANDARD_INFORMATION
Definition: disk.h:54
#define FILE_BASIC_INFORMATION
Definition: disk.h:53
#define _Function_class_(x)
Definition: ms_sal.h:2946
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
struct _KTHREAD * PKTHREAD
Definition: nt_native.h:28
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define FILE_ATTRIBUTE_TEMPORARY
Definition: nt_native.h:708
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define ARGUMENT_PRESENT(ArgumentPointer)
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
BOOLEAN NTAPI FsRtlIsTotalDeviceFailure(IN NTSTATUS NtStatus)
Definition: filter.c:37
BOOLEAN NTAPI FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
Definition: filter.c:61
VOID NTAPI IoRaiseHardError(IN PIRP Irp, IN PVPB Vpb, IN PDEVICE_OBJECT RealDeviceObject)
Definition: error.c:664
BOOLEAN NTAPI IoRaiseInformationalHardError(IN NTSTATUS ErrorStatus, IN PUNICODE_STRING String, IN PKTHREAD Thread)
Definition: error.c:710
#define IoCompleteRequest
Definition: irp.c:1240
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
VOID NTAPI IoSetDeviceToVerify(IN PETHREAD Thread, IN PDEVICE_OBJECT DeviceObject)
Definition: util.c:304
BOOLEAN NTAPI IoIsSystemThread(IN PETHREAD Thread)
Definition: util.c:115
PDEVICE_OBJECT NTAPI IoGetDeviceToVerify(IN PETHREAD Thread)
Definition: util.c:336
BOOLEAN NTAPI KeAreAllApcsDisabled(VOID)
Definition: apc.c:985
#define STATUS_CANT_WAIT
Definition: ntstatus.h:452
#define STATUS_FILE_LOCK_CONFLICT
Definition: ntstatus.h:320
#define STATUS_INVALID_EA_NAME
Definition: ntstatus.h:199
#define STATUS_EA_CORRUPT_ERROR
Definition: ntstatus.h:319
#define STATUS_NO_EAS_ON_FILE
Definition: ntstatus.h:318
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_IN_PAGE_ERROR
Definition: ntstatus.h:243
long LONG
Definition: pedump.c:60
#define Vcb
Definition: cdprocs.h:1415
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:158
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define NTDDI_VISTA
Definition: sdkddkver.h:103
#define STATUS_SUCCESS
Definition: shellext.h:65
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: cdstruc.h:1067
Definition: cdstruc.h:902
LONGLONG CreationTime
Definition: cdstruc.h:1030
UNICODE_STRING FullFileName
Definition: fatstruc.h:1122
union _FCB::@706 Specific
FCB_CONDITION FcbCondition
Definition: fatstruc.h:850
LARGE_INTEGER LastWriteTime
Definition: fatstruc.h:922
struct _FCB::@706::@709 Fcb
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:925
ULONG FcbState
Definition: cdstruc.h:971
LARGE_INTEGER LastAccessTime
Definition: fatstruc.h:921
UCHAR DirentFatFlags
Definition: fatstruc.h:1133
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:3223
IO_STATUS_BLOCK IoStatus
Definition: cdstruc.h:498
Definition: iotypes.h:189
#define MAXULONG
Definition: typedefs.h:251
#define NTAPI
Definition: typedefs.h:36
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_DRIVER_INTERNAL_ERROR
Definition: udferr_usr.h:177
#define STATUS_DISK_CORRUPT_ERROR
Definition: udferr_usr.h:147
#define STATUS_VERIFY_REQUIRED
Definition: udferr_usr.h:130
#define STATUS_FILE_CORRUPT_ERROR
Definition: udferr_usr.h:168
#define MAXLONG
Definition: umtypes.h:116
#define NT_ERROR(Status)
Definition: umtypes.h:106
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
FAST_MUTEX
Definition: extypes.h:17
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
#define IoIsErrorUserInduced(Status)
Definition: iofuncs.h:2817
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define IRP_INPUT_OPERATION
* PFILE_OBJECT
Definition: iotypes.h:1998
#define IO_DISK_INCREMENT
Definition: iotypes.h:600
#define IRP_MN_COMPLETE_MDL
Definition: iotypes.h:4424
#define PsGetCurrentProcess
Definition: psfuncs.h:17
#define NT_ASSERT
Definition: rtlfuncs.h:3310