ReactOS  0.4.14-dev-608-gd495a4f
fastio.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GNU GENERAL PUBLIC LICENSE VERSION 2
3  * PROJECT: ReiserFs file system driver for Windows NT/2000/XP/Vista.
4  * FILE: fastio.c
5  * PURPOSE:
6  * PROGRAMMER: Mark Piper, Matt Wu, Bo BrantÚn.
7  * HOMEPAGE:
8  * UPDATE HISTORY:
9  */
10 
11 /* INCLUDES *****************************************************************/
12 
13 #include "rfsd.h"
14 
15 /* GLOBALS ***************************************************************/
16 
18 
19 /* DEFINITIONS *************************************************************/
20 
21 #ifdef ALLOC_PRAGMA
22 #if DBG
23 #pragma alloc_text(PAGE, RfsdFastIoRead)
24 #if !RFSD_READ_ONLY
25 #pragma alloc_text(PAGE, RfsdFastIoWrite)
26 #endif // !RFSD_READ_ONLY
27 #endif // DBG
28 #pragma alloc_text(PAGE, RfsdFastIoCheckIfPossible)
29 #pragma alloc_text(PAGE, RfsdFastIoQueryBasicInfo)
30 #pragma alloc_text(PAGE, RfsdFastIoQueryStandardInfo)
31 #pragma alloc_text(PAGE, RfsdFastIoQueryNetworkOpenInfo)
32 #pragma alloc_text(PAGE, RfsdFastIoLock)
33 #pragma alloc_text(PAGE, RfsdFastIoUnlockSingle)
34 #pragma alloc_text(PAGE, RfsdFastIoUnlockAll)
35 #pragma alloc_text(PAGE, RfsdFastIoUnlockAllByKey)
36 #endif
37 
42  IN ULONG Length,
43  IN BOOLEAN Wait,
48  )
49 {
50  BOOLEAN bPossible = FastIoIsNotPossible;
51  PRFSD_FCB Fcb;
52  LARGE_INTEGER lLength;
53 
54  PAGED_CODE();
55 
56  lLength.QuadPart = Length;
57 
58  _SEH2_TRY {
59 
60  _SEH2_TRY {
61 
63 
66  }
67 
68  Fcb = (PRFSD_FCB) FileObject->FsContext;
69 
70  ASSERT(Fcb != NULL);
71 
72  if (Fcb->Identifier.Type == RFSDVCB) {
74  }
75 
77  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
78 
79  if (IsDirectory(Fcb)) {
81  }
82 
84 
85  bPossible = FsRtlFastCheckLockForRead(
86  &Fcb->FileLockAnchor,
87  FileOffset,
88  &lLength,
89  LockKey,
90  FileObject,
92 
93  } else {
94 
95  if (IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY) ||
96  IsFlagOn(Fcb->Vcb->Flags, VCB_WRITE_PROTECTED)) {
97  bPossible = FastIoIsNotPossible;
98  } else {
99  bPossible = FsRtlFastCheckLockForWrite(
100  &Fcb->FileLockAnchor,
101  FileOffset,
102  &lLength,
103  LockKey,
104  FileObject,
106  }
107  }
108 
109  RfsdPrint((DBG_INFO, "RfsdFastIoCheckIfPossible: %s %s %s\n",
111  "FASTIO_CHECK_IF_POSSIBLE",
112  Fcb->AnsiFileName.Buffer
113  ));
114 
116  "RfsdFastIoCheckIfPossible: Offset: %I64xg Length: %xh Key: %u %s %s\n",
117  FileOffset->QuadPart,
118  Length,
119  LockKey,
120  (CheckForReadOperation ? "CheckForReadOperation:" :
121  "CheckForWriteOperation:"),
122  (bPossible ? "Succeeded" : "Failed")));
124  bPossible = FastIoIsNotPossible;
125  } _SEH2_END;
126 
127  } _SEH2_FINALLY {
128 
130  } _SEH2_END;
131 
132  return bPossible;
133 }
134 
135 #if DBG
136 
140  IN ULONG Length,
141  IN BOOLEAN Wait,
142  IN ULONG LockKey,
143  OUT PVOID Buffer,
146 {
147  BOOLEAN Status;
148  PRFSD_FCB Fcb;
149 
150  PAGED_CODE();
151 
152  Fcb = (PRFSD_FCB) FileObject->FsContext;
153 
154  ASSERT(Fcb != NULL);
155 
156  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
157  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
158 
159  RfsdPrint((DBG_INFO, "RfsdFastIoRead: %s %s %s\n",
161  "FASTIO_READ",
162  Fcb->AnsiFileName.Buffer ));
163 
164  RfsdPrint((DBG_INFO, "RfsdFastIoRead: Offset: %I64xh Length: %xh Key: %u\n",
165  FileOffset->QuadPart,
166  Length,
167  LockKey ));
168 
172 
173  return Status;
174 }
175 
176 #if !RFSD_READ_ONLY
177 
182  IN ULONG Length,
183  IN BOOLEAN Wait,
184  IN ULONG LockKey,
185  OUT PVOID Buffer,
188 {
189  BOOLEAN bRet;
190  PRFSD_FCB Fcb;
191 
192  PAGED_CODE();
193 
194  Fcb = (PRFSD_FCB) FileObject->FsContext;
195 
196  ASSERT(Fcb != NULL);
197 
198  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
199  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
200 
202  "RfsdFastIoWrite: %s %s %s\n",
204  "FASTIO_WRITE",
205  Fcb->AnsiFileName.Buffer ));
206 
208  "RfsdFastIoWrite: Offset: %I64xh Length: %xh Key: %xh\n",
209  FileOffset->QuadPart,
210  Length,
211  LockKey ));
212 
213  if (IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY)) {
214  DbgBreak();
215  return FALSE;
216  }
217 
218  bRet = FsRtlCopyWrite (
221 
222  return bRet;
223 }
224 
225 #endif // !RFSD_READ_ONLY
226 
227 #endif /* DBG */
228 
231  IN BOOLEAN Wait,
235 {
236  BOOLEAN Status = FALSE;
237  PRFSD_FCB Fcb = 0;
238  BOOLEAN FcbMainResourceAcquired = FALSE;
239 
240  PAGED_CODE();
241 
242  _SEH2_TRY {
243 
244  _SEH2_TRY {
245 
247 
250  Status = TRUE;
251  _SEH2_LEAVE;
252  }
253 
254  Fcb = (PRFSD_FCB) FileObject->FsContext;
255 
256  ASSERT(Fcb != NULL);
257 
258  if (Fcb->Identifier.Type == RFSDVCB) {
260  Status = TRUE;
261  _SEH2_LEAVE;
262  }
263 
264  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
265  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
266 
268  "RfsdFastIoQueryBasicInfo: %s %s %s\n",
270  "FASTIO_QUERY_BASIC_INFO",
271  Fcb->AnsiFileName.Buffer
272  ));
273 
275  &Fcb->MainResource,
276  Wait)) {
277  Status = FALSE;
278  _SEH2_LEAVE;
279  }
280 
281  FcbMainResourceAcquired = TRUE;
282 
284 
285  /*
286  typedef struct _FILE_BASIC_INFORMATION {
287  LARGE_INTEGER CreationTime;
288  LARGE_INTEGER LastAccessTime;
289  LARGE_INTEGER LastWriteTime;
290  LARGE_INTEGER ChangeTime;
291  ULONG FileAttributes;
292  } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
293  */
294 
295  Buffer->CreationTime = RfsdSysTime(Fcb->Inode->i_ctime);
296  Buffer->LastAccessTime = RfsdSysTime(Fcb->Inode->i_atime);
297  Buffer->LastWriteTime = RfsdSysTime(Fcb->Inode->i_mtime);
298  Buffer->ChangeTime = RfsdSysTime(Fcb->Inode->i_mtime);
299 
300 
301  Buffer->FileAttributes = Fcb->RfsdMcb->FileAttr;
302 
303  IoStatus->Information = sizeof(FILE_BASIC_INFORMATION);
304 
305  IoStatus->Status = STATUS_SUCCESS;
306 
307  Status = TRUE;
309 
310  IoStatus->Status = _SEH2_GetExceptionCode();
311  Status = TRUE;
312  } _SEH2_END;
313 
314  } _SEH2_FINALLY {
315 
316  if (FcbMainResourceAcquired)
317  {
319  &Fcb->MainResource,
321  );
322  }
323 
325  } _SEH2_END;
326 
327 
328  if (Status == FALSE) {
329 
331  "RfsdFastIoQueryBasicInfo: %s %s *** Status: FALSE ***\n",
333  "FASTIO_QUERY_BASIC_INFO"
334  ));
335  } else if (IoStatus->Status != STATUS_SUCCESS) {
336 
338  "RfsdFastIoQueryBasicInfo: %s %s *** Status: %s (%#x) ***\n",
340  "FASTIO_QUERY_BASIC_INFO",
342  IoStatus->Status
343  ));
344  }
345 
346  return Status;
347 }
348 
352  IN BOOLEAN Wait,
356  )
357 {
358  BOOLEAN Status = FALSE;
359  PRFSD_VCB Vcb;
360  PRFSD_FCB Fcb = 0;
361  BOOLEAN FcbMainResourceAcquired = FALSE;
364 
365  PAGED_CODE();
366 
367  _SEH2_TRY {
368 
369  _SEH2_TRY {
370 
372 
374 
376  Status = TRUE;
377  _SEH2_LEAVE;
378  }
379 
380  Fcb = (PRFSD_FCB) FileObject->FsContext;
381 
382  ASSERT(Fcb != NULL);
383 
384  if (Fcb->Identifier.Type == RFSDVCB) {
386  Status = TRUE;
387  _SEH2_LEAVE;
388  }
389 
390  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
391  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
392 
394  "RfsdFastIoQueryStandardInfo: %s %s %s\n",
396  "FASTIO_QUERY_STANDARD_INFO",
397  Fcb->AnsiFileName.Buffer ));
398 
399  Vcb = Fcb->Vcb;
400 
402  &Fcb->MainResource,
403  Wait )) {
404  Status = FALSE;
405  _SEH2_LEAVE;
406  }
407 
408  FcbMainResourceAcquired = TRUE;
409 
411 
412  /*
413  typedef struct _FILE_STANDARD_INFORMATION {
414  LARGE_INTEGER AllocationSize;
415  LARGE_INTEGER EndOfFile;
416  ULONG NumberOfLinks;
417  BOOLEAN DeletePending;
418  BOOLEAN Directory;
419  } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
420  */
421 
422  FileSize = (LONGLONG) Fcb->Inode->i_size;
423 
424 #if DISABLED
425  if (S_ISREG(Fcb->Inode->i_mode))
426  FileSize |= ((LONGLONG)(Fcb->Inode->i_size_high) << 32);
427 #endif
428 
429  AllocationSize = CEILING_ALIGNED(FileSize, (ULONGLONG)Vcb->BlockSize); // TODO: This is incorrect for file tails...
430 
431  Buffer->AllocationSize.QuadPart = AllocationSize;
432  Buffer->EndOfFile.QuadPart = FileSize;
433  Buffer->NumberOfLinks = Fcb->Inode->i_links_count;
434 
435  if (IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY)) {
436  Buffer->DeletePending = FALSE;
437  } else {
438  Buffer->DeletePending = IsFlagOn(Fcb->Flags, FCB_DELETE_PENDING);
439  }
440 
441  if (FlagOn(Fcb->RfsdMcb->FileAttr, FILE_ATTRIBUTE_DIRECTORY)) {
442  Buffer->Directory = TRUE;
443  } else {
444  Buffer->Directory = FALSE;
445  }
446 
447  IoStatus->Information = sizeof(FILE_STANDARD_INFORMATION);
448 
449  IoStatus->Status = STATUS_SUCCESS;
450 
451  Status = TRUE;
452 
454 
455  IoStatus->Status = _SEH2_GetExceptionCode();
456  Status = TRUE;
457  } _SEH2_END;
458 
459  } _SEH2_FINALLY {
460  if (FcbMainResourceAcquired) {
462  &Fcb->MainResource,
464  );
465  }
466 
468  } _SEH2_END;
469 
470 #if DBG
471  if (Status == FALSE) {
473  "RfsdFastIoQueryStandardInfo: %s %s *** Status: FALSE ***\n",
475  "FASTIO_QUERY_STANDARD_INFO" ));
476  } else if (IoStatus->Status != STATUS_SUCCESS) {
478  "RfsdFastIoQueryStandardInfo: %s %s *** Status: %s (%#x) ***\n",
480  "FASTIO_QUERY_STANDARD_INFO",
482  IoStatus->Status ));
483  }
484 #endif
485 
486  return Status;
487 }
488 
495  IN ULONG Key,
500  )
501 {
502  BOOLEAN Status = FALSE;
503  PRFSD_FCB Fcb;
504 
505  PAGED_CODE();
506 
507  _SEH2_TRY {
508 
509  _SEH2_TRY {
510 
512 
515  Status = TRUE;
516  _SEH2_LEAVE;
517  }
518 
519  Fcb = (PRFSD_FCB) FileObject->FsContext;
520 
521  ASSERT(Fcb != NULL);
522 
523  if (Fcb->Identifier.Type == RFSDVCB) {
524 
526  Status = TRUE;
527  _SEH2_LEAVE;
528  }
529 
530  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
531  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
532 
533  if (IsDirectory(Fcb)) {
534  DbgBreak();
536  Status = TRUE;
537  _SEH2_LEAVE;
538  }
539 
541  "RfsdFastIoLock: %s %s %s\n",
543  "FASTIO_LOCK",
544  Fcb->AnsiFileName.Buffer ));
545 
547  "RfsdFastIoLock: Offset: %I64xh Length: %I64xh Key: %u %s%s\n",
548  FileOffset->QuadPart,
549  Length->QuadPart,
550  Key,
551  (FailImmediately ? "FailImmediately " : ""),
552  (ExclusiveLock ? "ExclusiveLock " : "") ));
553 
554  if (Fcb->Header.IsFastIoPossible != FastIoIsQuestionable) {
556  "RfsdFastIoLock: %s %s %s\n",
558  "FastIoIsQuestionable",
559  Fcb->AnsiFileName.Buffer ));
560 
561  Fcb->Header.IsFastIoPossible = FastIoIsQuestionable;
562  }
563 
564 #ifdef _MSC_VER
565 #pragma prefast( suppress: 28159, "bug in prefast" )
566 #endif
568  &Fcb->FileLockAnchor,
569  FileObject,
570  FileOffset,
571  Length,
572  Process,
573  Key,
576  IoStatus,
577  NULL,
578  FALSE);
580  IoStatus->Status = _SEH2_GetExceptionCode();
581  Status = TRUE;
582  } _SEH2_END;
583 
584  } _SEH2_FINALLY {
586  } _SEH2_END;
587 
588 #if DBG
589  if (Status == FALSE) {
591  "RfsdFastIoLock: %s %s *** Status: FALSE ***\n",
593  "FASTIO_LOCK"
594  ));
595  } else if (IoStatus->Status != STATUS_SUCCESS) {
597  "RfsdFastIoLock: %s %s *** Status: %s (%#x) ***\n",
599  "FASTIO_LOCK",
601  IoStatus->Status
602  ));
603  }
604 #endif
605 
606  return Status;
607 }
608 
615  IN ULONG Key,
618  )
619 {
620  BOOLEAN Status = FALSE;
621  PRFSD_FCB Fcb;
622 
623  PAGED_CODE();
624 
625  _SEH2_TRY {
626 
627  _SEH2_TRY {
628 
630 
633  Status = TRUE;
634  _SEH2_LEAVE;
635  }
636 
637  Fcb = (PRFSD_FCB) FileObject->FsContext;
638 
639  ASSERT(Fcb != NULL);
640 
641  if (Fcb->Identifier.Type == RFSDVCB) {
642  DbgBreak();
644  Status = TRUE;
645  _SEH2_LEAVE;
646  }
647 
648  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
649  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
650 
651  if (IsDirectory(Fcb)) {
652 
653  DbgBreak();
655  Status = TRUE;
656  _SEH2_LEAVE;
657  }
658 
660  "RfsdFastIoUnlockSingle: %s %s %s\n",
662  "FASTIO_UNLOCK_SINGLE",
663  Fcb->AnsiFileName.Buffer ));
664 
666  "RfsdFastIoUnlockSingle: Offset: %I64xh Length: %I64xh Key: %u\n",
667  FileOffset->QuadPart,
668  Length->QuadPart,
669  Key ));
670 
672  &Fcb->FileLockAnchor,
673  FileObject,
674  FileOffset,
675  Length,
676  Process,
677  Key,
678  NULL,
679  FALSE);
680 
681  IoStatus->Information = 0;
682 
683  Status = TRUE;
685  IoStatus->Status = _SEH2_GetExceptionCode();
686  Status = TRUE;
687  } _SEH2_END;
688 
689  } _SEH2_FINALLY {
690 
692  } _SEH2_END;
693 
694 #if DBG
695  if (Status == FALSE) {
696 
698  "RfsdFastIoUnlockSingle: %s %s *** Status: FALSE ***\n",
700  "FASTIO_UNLOCK_SINGLE" ));
701  } else if (IoStatus->Status != STATUS_SUCCESS) {
703  "RfsdFastIoUnlockSingle: %s %s *** Status: %s (%#x) ***\n",
705  "FASTIO_UNLOCK_SINGLE",
707  IoStatus->Status ));
708  }
709 #endif
710 
711  return Status;
712 }
713 
720 {
721  BOOLEAN Status = FALSE;
722  PRFSD_FCB Fcb;
723 
724  PAGED_CODE();
725 
726  _SEH2_TRY {
727 
728  _SEH2_TRY {
729 
731 
734  Status = TRUE;
735  _SEH2_LEAVE;
736  }
737 
738  Fcb = (PRFSD_FCB) FileObject->FsContext;
739 
740  ASSERT(Fcb != NULL);
741 
742  if (Fcb->Identifier.Type == RFSDVCB) {
743  DbgBreak();
745  Status = TRUE;
746  _SEH2_LEAVE;
747  }
748 
749  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
750  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
751 
752  if (IsDirectory(Fcb)) {
753  DbgBreak();
755  Status = TRUE;
756  _SEH2_LEAVE;
757  }
758 
760  "RfsdFastIoUnlockAll: %s %s %s\n",
762  "FASTIO_UNLOCK_ALL",
763  Fcb->AnsiFileName.Buffer
764  ));
765 
766  IoStatus->Status = FsRtlFastUnlockAll(
767  &Fcb->FileLockAnchor,
768  FileObject,
769  Process,
770  NULL );
771 
772  IoStatus->Information = 0;
773 
774  Status = TRUE;
776  IoStatus->Status = _SEH2_GetExceptionCode();
777  Status = TRUE;
778  } _SEH2_END;
779 
780  } _SEH2_FINALLY {
781 
783  } _SEH2_END;
784 
785 #if DBG
786  if (Status == FALSE) {
787 
789  "RfsdFastIoUnlockAll: %s %s *** Status: FALSE ***\n",
791  "FASTIO_UNLOCK_ALL"
792  ));
793  } else if (IoStatus->Status != STATUS_SUCCESS) {
795  "RfsdFastIoUnlockAll: %s %s *** Status: %s (%#x) ***\n",
797  "FASTIO_UNLOCK_ALL",
799  IoStatus->Status
800  ));
801  }
802 #endif
803 
804  return Status;
805 }
806 
810 #ifdef __REACTOS__
811  IN PVOID Process,
812 #else
814 #endif
815  IN ULONG Key,
818  )
819 {
820  BOOLEAN Status = FALSE;
821  PRFSD_FCB Fcb;
822 
823  PAGED_CODE();
824 
825  _SEH2_TRY {
826 
827  _SEH2_TRY {
828 
830 
833  Status = TRUE;
834  _SEH2_LEAVE;
835  }
836 
837  Fcb = (PRFSD_FCB) FileObject->FsContext;
838 
839  ASSERT(Fcb != NULL);
840 
841  if (Fcb->Identifier.Type == RFSDVCB) {
842  DbgBreak();
844  Status = TRUE;
845  _SEH2_LEAVE;
846  }
847 
848  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
849  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
850 
851  if (IsDirectory(Fcb)) {
852 
853  DbgBreak();
855  Status = TRUE;
856  _SEH2_LEAVE;
857  }
858 
860  "RfsdFastIoUnlockAllByKey: %s %s %s\n",
862  "FASTIO_UNLOCK_ALL_BY_KEY",
863  Fcb->AnsiFileName.Buffer
864  ));
865 
867  "RfsdFastIoUnlockAllByKey: Key: %u\n",
868  Key
869  ));
870 
872  &Fcb->FileLockAnchor,
873  FileObject,
874  Process,
875  Key,
876  NULL
877  );
878 
879  IoStatus->Information = 0;
880 
881  Status = TRUE;
882 
884 
885  IoStatus->Status = _SEH2_GetExceptionCode();
886  Status = TRUE;
887  } _SEH2_END;
888 
889  } _SEH2_FINALLY {
891  } _SEH2_END;
892 
893 #if DBG
894  if (Status == FALSE) {
895 
897  "RfsdFastIoUnlockAllByKey: %s %s *** Status: FALSE ***\n",
899  "FASTIO_UNLOCK_ALL_BY_KEY"
900  ));
901  } else if (IoStatus->Status != STATUS_SUCCESS) {
902 
904  "RfsdFastIoUnlockAllByKey: %s %s *** Status: %s (%#x) ***\n",
906  "FASTIO_UNLOCK_ALL_BY_KEY",
908  IoStatus->Status
909  ));
910  }
911 #endif
912 
913  return Status;
914 }
915 
919  IN BOOLEAN Wait,
923  )
924 {
925  BOOLEAN bResult = FALSE;
926  PRFSD_FCB Fcb = NULL;
927  BOOLEAN FcbResourceAcquired = FALSE;
928 
929  PAGED_CODE();
930 
931  _SEH2_TRY {
932 
934 
937  _SEH2_LEAVE;
938  }
939 
940  Fcb = (PRFSD_FCB) FileObject->FsContext;
941 
942  ASSERT(Fcb != NULL);
943 
944  if (Fcb->Identifier.Type == RFSDVCB) {
945  DbgBreak();
947  _SEH2_LEAVE;
948  }
949 
950  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
951  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
952 
954  "%-16.16s %-31s %s\n",
956  "FASTIO_QUERY_NETWORK_OPEN_INFO",
957  Fcb->AnsiFileName.Buffer
958  ));
959 
960  if (FileObject->FsContext2) {
961  _SEH2_LEAVE;
962  }
963 
964  if (!FlagOn(Fcb->Flags, FCB_PAGE_FILE)) {
965 
967  &Fcb->MainResource,
968  Wait
969  )) {
970  _SEH2_LEAVE;
971  }
972 
973  FcbResourceAcquired = TRUE;
974  }
975 
976  if (IsDirectory(Fcb)) {
977  PFNOI->AllocationSize.QuadPart = 0;
978  PFNOI->EndOfFile.QuadPart = 0;
979  } else {
980  PFNOI->AllocationSize = Fcb->Header.AllocationSize;
981  PFNOI->EndOfFile = Fcb->Header.FileSize;
982  }
983 
984  PFNOI->FileAttributes = Fcb->RfsdMcb->FileAttr;
985  if (PFNOI->FileAttributes == 0) {
987  }
988 
989  PFNOI->CreationTime = RfsdSysTime(Fcb->Inode->i_ctime);
990  PFNOI->LastAccessTime = RfsdSysTime(Fcb->Inode->i_atime);
991  PFNOI->LastWriteTime = RfsdSysTime(Fcb->Inode->i_mtime);
992  PFNOI->ChangeTime = RfsdSysTime(Fcb->Inode->i_mtime);
993 
994  bResult = TRUE;
995 
996  IoStatus->Status = STATUS_SUCCESS;
997  IoStatus->Information = sizeof(FILE_NETWORK_OPEN_INFORMATION);
998 
999  } _SEH2_FINALLY {
1000 
1001  if (FcbResourceAcquired) {
1003  }
1004 
1006  } _SEH2_END;
1007 
1008  return bResult;
1009 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI RfsdFastIoRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
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:752
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define CEILING_ALIGNED(T, A, B)
Definition: ext2fs.h:111
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
ULONG FileAttributes
Definition: cdstruc.h:983
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
BOOLEAN NTAPI RfsdFastIoUnlockAllByKey(IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:808
Definition: rfsd.h:323
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
Definition: fatprocs.h:2650
#define FCB_DELETE_PENDING
Definition: ext2fs.h:879
#define PAGED_CODE()
Definition: video.h:57
struct _FILE_NETWORK_OPEN_INFORMATION FILE_NETWORK_OPEN_INFORMATION
PDEVICE_OBJECT DeviceObject
Definition: rfsd.h:407
_SEH2_TRY
Definition: create.c:4250
Definition: rfsd.h:324
PUCHAR RfsdNtStatusToString(IN NTSTATUS Status)
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
NTSTATUS NTAPI FsRtlFastUnlockAllByKey(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN ULONG Key, IN PVOID Context OPTIONAL)
Definition: filelock.c:1087
LARGE_INTEGER RfsdSysTime(IN ULONG i_time)
Definition: misc.c:47
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS NTAPI FsRtlFastUnlockSingle(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN PEPROCESS Process, IN ULONG Key, IN PVOID Context OPTIONAL, IN BOOLEAN AlreadySynchronized)
Definition: filelock.c:829
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN FailImmediately
Definition: fatprocs.h:2697
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
BOOLEAN NTAPI RfsdFastIoCheckIfPossible(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, IN BOOLEAN CheckForReadOperation, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:39
#define PsGetCurrentProcess
Definition: psfuncs.h:17
BOOLEAN NTAPI RfsdFastIoUnlockAll(IN PFILE_OBJECT FileObject, IN PEPROCESS Process, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:715
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
BOOLEAN NTAPI RfsdFastIoQueryStandardInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_STANDARD_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:350
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2650
int64_t LONGLONG
Definition: typedefs.h:66
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define RfsdGetCurrentProcessName()
Definition: rfsd.h:1095
uint64_t ULONGLONG
Definition: typedefs.h:65
#define Vcb
Definition: cdprocs.h:1425
BOOLEAN NTAPI RfsdFastIoQueryBasicInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_BASIC_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:230
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
* PFILE_OBJECT
Definition: iotypes.h:1955
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG Flags
Definition: ntfs.h:532
#define VCB_WRITE_PROTECTED
Definition: ext2fs.h:796
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
_Must_inspect_result_ _In_ PFLT_INSTANCE _Out_ PBOOLEAN IsDirectory
Definition: fltkernel.h:1139
#define RfsdPrint(arg)
Definition: rfsd.h:1069
ULONG Type
Definition: ntfs.h:95
#define FILE_STANDARD_INFORMATION
Definition: disk.h:54
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
#define DBG_ERROR
Definition: ffsdrv.h:1031
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
NTSTATUS NTAPI FsRtlFastUnlockAll(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN PVOID Context OPTIONAL)
Definition: filelock.c:1026
ERESOURCE MainResource
Definition: ntfs.h:524
#define VCB_READ_ONLY
Definition: ext2fs.h:795
BOOLEAN NTAPI RfsdFastIoLock(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN PEPROCESS Process, IN ULONG Key, IN BOOLEAN FailImmediately, IN BOOLEAN ExclusiveLock, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:490
Status
Definition: gdiplustypes.h:24
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:310
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
BOOLEAN NTAPI RfsdFastIoUnlockSingle(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN PEPROCESS Process, IN ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:610
_SEH2_END
Definition: create.c:4424
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
_SEH2_FINALLY
Definition: create.c:4395
#define FCB_PAGE_FILE
Definition: ext2fs.h:872
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN BOOLEAN ExclusiveLock
Definition: fatprocs.h:2697
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
BOOLEAN NTAPI FsRtlCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:64
BOOLEAN NTAPI FsRtlCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:264
BOOLEAN NTAPI RfsdFastIoQueryNetworkOpenInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, IN OUT PFILE_NETWORK_OPEN_INFORMATION PFNOI, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:917
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
PVCB Vcb
Definition: cdstruc.h:939
#define DbgBreak()
Definition: ext2fs.h:46
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
#define DBG_INFO
Definition: ffsdrv.h:1034
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
#define _SEH2_LEAVE
Definition: filesup.c:20
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define S_ISREG(mode)
Definition: various.h:17
#define FsRtlFastLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)
Definition: fsrtlfuncs.h:1581
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:786
ULONG Size
Definition: ntfs.h:96
LONGLONG QuadPart
Definition: typedefs.h:112
BOOLEAN NTAPI RfsdFastIoWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
IN BOOLEAN Wait
Definition: fatprocs.h:1529
#define FILE_BASIC_INFORMATION
Definition: disk.h:53