ReactOS  0.4.15-dev-499-g1f31905
memory.c File Reference
#include "rfsd.h"
Include dependency graph for memory.c:

Go to the source code of this file.

Macros

#define MCB_NUM_SHIFT   0x04
 

Functions

__drv_mustHoldCriticalRegion PRFSD_IRP_CONTEXT RfsdAllocateIrpContext (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS RfsdCompleteIrpContext (IN PRFSD_IRP_CONTEXT IrpContext, IN NTSTATUS Status)
 
__drv_mustHoldCriticalRegion VOID RfsdFreeIrpContext (IN PRFSD_IRP_CONTEXT IrpContext)
 
VOID RfsdRepinBcb (IN PRFSD_IRP_CONTEXT IrpContext, IN PBCB Bcb)
 
VOID RfsdUnpinRepinnedBcbs (IN PRFSD_IRP_CONTEXT IrpContext)
 
__drv_mustHoldCriticalRegion PRFSD_FCB RfsdAllocateFcb (IN PRFSD_VCB Vcb, IN PRFSD_MCB RfsdMcb, IN PRFSD_INODE Inode)
 
__drv_mustHoldCriticalRegion VOID RfsdFreeFcb (IN PRFSD_FCB Fcb)
 
__drv_mustHoldCriticalRegion PRFSD_CCB RfsdAllocateCcb (VOID)
 
__drv_mustHoldCriticalRegion VOID RfsdFreeCcb (IN PRFSD_CCB Ccb)
 
__drv_mustHoldCriticalRegion PRFSD_MCB RfsdAllocateMcb (PRFSD_VCB Vcb, PUNICODE_STRING FileName, ULONG FileAttr)
 
__drv_mustHoldCriticalRegion VOID RfsdFreeMcb (IN PRFSD_MCB Mcb)
 
__drv_mustHoldCriticalRegion PRFSD_FCB RfsdCreateFcbFromMcb (PRFSD_VCB Vcb, PRFSD_MCB Mcb)
 
BOOLEAN RfsdGetFullFileName (PRFSD_MCB Mcb, PUNICODE_STRING FileName)
 
PRFSD_MCB RfsdSearchMcbTree (PRFSD_VCB Vcb, PRFSD_MCB RfsdMcb, PRFSD_KEY_IN_MEMORY Key)
 
PRFSD_MCB RfsdSearchMcb (PRFSD_VCB Vcb, PRFSD_MCB Parent, PUNICODE_STRING FileName)
 
VOID RfsdRefreshMcb (PRFSD_VCB Vcb, PRFSD_MCB Mcb)
 
VOID RfsdAddMcbNode (PRFSD_VCB Vcb, PRFSD_MCB Parent, PRFSD_MCB Child)
 
BOOLEAN RfsdDeleteMcbNode (PRFSD_VCB Vcb, PRFSD_MCB McbTree, PRFSD_MCB RfsdMcb)
 
__drv_mustHoldCriticalRegion VOID RfsdFreeMcbTree (PRFSD_MCB McbTree)
 
BOOLEAN RfsdCheckSetBlock (PRFSD_IRP_CONTEXT IrpContext, PRFSD_VCB Vcb, ULONG Block)
 
BOOLEAN RfsdCheckBitmapConsistency (PRFSD_IRP_CONTEXT IrpContext, PRFSD_VCB Vcb)
 
VOID RfsdInsertVcb (PRFSD_VCB Vcb)
 
VOID RfsdRemoveVcb (PRFSD_VCB Vcb)
 
__drv_mustHoldCriticalRegion NTSTATUS RfsdInitializeVcb (IN PRFSD_IRP_CONTEXT IrpContext, IN PRFSD_VCB Vcb, IN PRFSD_SUPER_BLOCK RfsdSb, IN PDEVICE_OBJECT TargetDevice, IN PDEVICE_OBJECT VolumeDevice, IN PVPB Vpb)
 
__drv_mustHoldCriticalRegion VOID RfsdFreeVcb (IN PRFSD_VCB Vcb)
 
VOID RfsdSyncUninitializeCacheMap (IN PFILE_OBJECT FileObject)
 

Variables

PRFSD_GLOBAL RfsdGlobal
 

Macro Definition Documentation

◆ MCB_NUM_SHIFT

#define MCB_NUM_SHIFT   0x04

Function Documentation

◆ RfsdAddMcbNode()

VOID RfsdAddMcbNode ( PRFSD_VCB  Vcb,
PRFSD_MCB  Parent,
PRFSD_MCB  Child 
)

Definition at line 1023 of file memory.c.

1024 {
1025  PRFSD_MCB TmpMcb = Parent->Child;
1026 
1027  PAGED_CODE();
1028 
1029  if(IsFlagOn(Child->Flags, MCB_IN_TREE)) {
1030  DbgBreak();
1031  RfsdPrint((DBG_ERROR, "RfsdAddMcbNode: Child Mcb is alreay in the tree.\n"));
1032  return;
1033  }
1034 
1035  if (TmpMcb) {
1036  ASSERT(TmpMcb->Parent == Parent);
1037 
1038  while (TmpMcb->Next) {
1039  TmpMcb = TmpMcb->Next;
1040  ASSERT(TmpMcb->Parent == Parent);
1041  }
1042 
1043  TmpMcb->Next = Child;
1044  Child->Parent = Parent;
1045  Child->Next = NULL;
1046  } else {
1047  Parent->Child = Child;
1048  Child->Parent = Parent;
1049  Child->Next = NULL;
1050  }
1051 
1052  InsertTailList(&(Vcb->McbList), &(Child->Link));
1053  SetFlag(Child->Flags, MCB_IN_TREE);
1054 }
PRFSD_MCB Parent
Definition: rfsd.h:684
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:728
#define InsertTailList(ListHead, Entry)
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
PRFSD_MCB Next
Definition: rfsd.h:686
#define Vcb
Definition: cdprocs.h:1415
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RfsdPrint(arg)
Definition: rfsd.h:1069
#define DBG_ERROR
Definition: ffsdrv.h:1031
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define MCB_IN_TREE
Definition: ffsdrv.h:679
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE Child
Definition: acpixf.h:728
#define DbgBreak()
Definition: ext2fs.h:46
#define PAGED_CODE()

Referenced by RfsdLookupFileName(), and RfsdSetRenameInfo().

◆ RfsdAllocateCcb()

Definition at line 617 of file memory.c.

618 {
619  PRFSD_CCB Ccb;
620 
621  PAGED_CODE();
622 
625  TRUE );
626 
627  Ccb = (PRFSD_CCB) (ExAllocateFromNPagedLookasideList( &(RfsdGlobal->RfsdCcbLookasideList)));
628 
632 
633  if (Ccb == NULL) {
635 
636  RtlZeroMemory(Ccb, sizeof(RFSD_CCB));
637 
639  } else {
640  RtlZeroMemory(Ccb, sizeof(RFSD_CCB));
641  }
642 
643  if (!Ccb) {
644  return NULL;
645  }
646 
648  Ccb->Identifier.Size = sizeof(RFSD_CCB);
649 
650  Ccb->CurrentByteOffset = 0;
651 
652  Ccb->DirectorySearchPattern.Length = 0;
653  Ccb->DirectorySearchPattern.MaximumLength = 0;
654  Ccb->DirectorySearchPattern.Buffer = 0;
655 
656  return Ccb;
657 }
struct _RFSD_CCB * PRFSD_CCB
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
ERESOURCE LAResource
Definition: rfsd.h:394
#define RFSD_POOL_TAG
Definition: rfsd.h:99
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
smooth NULL
Definition: ftsmooth.c:416
NPAGED_LOOKASIDE_LIST RfsdCcbLookasideList
Definition: rfsd.h:416
ULONG Flags
Definition: ntfs.h:532
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
ULONG Type
Definition: ntfs.h:95
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:588
Definition: rfsd.h:325
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define CCB_FROM_POOL
Definition: ext2fs.h:1022
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
struct _RFSD_CCB RFSD_CCB
ULONG Size
Definition: ntfs.h:96
#define PAGED_CODE()

Referenced by RfsdCreateFile(), and RfsdCreateVolume().

◆ RfsdAllocateFcb()

__drv_mustHoldCriticalRegion PRFSD_FCB RfsdAllocateFcb ( IN PRFSD_VCB  Vcb,
IN PRFSD_MCB  RfsdMcb,
IN PRFSD_INODE  Inode 
)

Definition at line 383 of file memory.c.

386 {
387  PRFSD_FCB Fcb;
388 
389  PAGED_CODE();
390 
393  TRUE );
394 
395  Fcb = (PRFSD_FCB) ExAllocateFromNPagedLookasideList(
397 
401 
402  if (Fcb == NULL) {
404 
405  RtlZeroMemory(Fcb, sizeof(RFSD_FCB));
406 
408  } else {
409  RtlZeroMemory(Fcb, sizeof(RFSD_FCB));
410  }
411 
412  if (!Fcb) {
413  return NULL;
414  }
415 
417  Fcb->Identifier.Size = sizeof(RFSD_FCB);
418 
420  &Fcb->FileLockAnchor,
421  NULL,
422  NULL );
423 
424  Fcb->OpenHandleCount = 0;
425  Fcb->ReferenceCount = 0;
426 
427  Fcb->Vcb = Vcb;
428 
429 #if DBG
430 
431  Fcb->AnsiFileName.MaximumLength = (USHORT)
432  RfsdUnicodeToOEMSize(&(RfsdMcb->ShortName)) + 1;
433 
434  Fcb->AnsiFileName.Buffer = (PUCHAR)
435  ExAllocatePoolWithTag(PagedPool, Fcb->AnsiFileName.MaximumLength, RFSD_POOL_TAG);
436 
437  if (!Fcb->AnsiFileName.Buffer) {
438  goto errorout;
439  }
440 
441  RtlZeroMemory(Fcb->AnsiFileName.Buffer, Fcb->AnsiFileName.MaximumLength);
442 
443  RfsdUnicodeToOEM( &(Fcb->AnsiFileName),
444  &(RfsdMcb->ShortName));
445 
446 #endif
447 
448  RfsdMcb->FileAttr = FILE_ATTRIBUTE_NORMAL;
449 
450  if (S_ISDIR(Inode->i_mode)) {
451  SetFlag(RfsdMcb->FileAttr, FILE_ATTRIBUTE_DIRECTORY);
452  }
453 
454  if ( IsFlagOn(Vcb->Flags, VCB_READ_ONLY) ||
455  RfsdIsReadOnly(Inode->i_mode)) {
456  SetFlag(RfsdMcb->FileAttr, FILE_ATTRIBUTE_READONLY);
457  }
458 
459  Fcb->Inode = Inode;
460 
461  Fcb->RfsdMcb = RfsdMcb;
462  RfsdMcb->RfsdFcb = Fcb;
463 
465 
466  Fcb->Header.NodeTypeCode = (USHORT) RFSDFCB;
467  Fcb->Header.NodeByteSize = sizeof(RFSD_FCB);
468  Fcb->Header.IsFastIoPossible = FastIoIsNotPossible;
469  Fcb->Header.Resource = &(Fcb->MainResource);
470  Fcb->Header.PagingIoResource = &(Fcb->PagingIoResource);
471 
472  // NOTE: In EXT2, the low part was stored in i_size (a 32-bit value); the high part would be stored in the acl field...
473  // However, on ReiserFS, the i_size is a 64-bit value.
474  Fcb->Header.FileSize.QuadPart = Fcb->Inode->i_size;
475 
476 
477  Fcb->Header.AllocationSize.QuadPart =
478  CEILING_ALIGNED(Fcb->Header.FileSize.QuadPart, (ULONGLONG)Vcb->BlockSize);
479 
480  Fcb->Header.ValidDataLength.QuadPart = (LONGLONG)(0x7fffffffffffffff);
481 
482  Fcb->SectionObject.DataSectionObject = NULL;
483  Fcb->SectionObject.SharedCacheMap = NULL;
484  Fcb->SectionObject.ImageSectionObject = NULL;
485 
488 
489  InsertTailList(&Vcb->FcbList, &Fcb->Next);
490 
491 #if DBG
492 
495  TRUE );
496 
497  RfsdGlobal->FcbAllocated++;
498 
502 #endif
503 
504  return Fcb;
505 
506 #if DBG
507 errorout:
508 #endif
509 
510  if (Fcb) {
511 
512 #if DBG
513  if (Fcb->AnsiFileName.Buffer)
514  ExFreePool(Fcb->AnsiFileName.Buffer);
515 #endif
516 
517  if (FlagOn(Fcb->Flags, FCB_FROM_POOL)) {
518 
519  ExFreePool( Fcb );
520 
521  } else {
522 
525  TRUE );
526 
527  ExFreeToNPagedLookasideList(&(RfsdGlobal->RfsdFcbLookasideList), Fcb);
528 
532  }
533 
534  }
535 
536  return NULL;
537 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define RfsdIsReadOnly(m)
Definition: rfsd.h:295
NTSTATUS RfsdUnicodeToOEM(IN OUT POEM_STRING Oem, IN PUNICODE_STRING Unicode)
Definition: misc.c:246
#define TRUE
Definition: types.h:120
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
VOID NTAPI FsRtlInitializeFileLock(IN PFILE_LOCK FileLock, IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL, IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL)
Definition: filelock.c:1261
#define CEILING_ALIGNED(T, A, B)
Definition: ext2fs.h:111
ERESOURCE LAResource
Definition: rfsd.h:394
unsigned char * PUCHAR
Definition: retypes.h:3
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
#define RFSD_POOL_TAG
Definition: rfsd.h:99
#define InsertTailList(ListHead, Entry)
Definition: rfsd.h:324
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
ERESOURCE CountResource
Definition: rfsd.h:391
struct _RFSD_FCB RFSD_FCB
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
ULONG OpenHandleCount
Definition: ntfs.h:533
int64_t LONGLONG
Definition: typedefs.h:67
uint64_t ULONGLONG
Definition: typedefs.h:66
#define S_ISDIR(mode)
Definition: various.h:18
#define Vcb
Definition: cdprocs.h:1415
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
ULONG RfsdUnicodeToOEMSize(IN PUNICODE_STRING Unicode)
Definition: misc.c:233
ULONG Flags
Definition: ntfs.h:532
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
ULONG Type
Definition: ntfs.h:95
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
ERESOURCE MainResource
Definition: ntfs.h:524
#define VCB_READ_ONLY
Definition: ext2fs.h:795
#define FCB_FROM_POOL
Definition: ext2fs.h:871
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
unsigned short USHORT
Definition: pedump.c:61
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
NPAGED_LOOKASIDE_LIST RfsdFcbLookasideList
Definition: rfsd.h:415
ERESOURCE PagingIoResource
Definition: ntfs.h:523
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
PVCB Vcb
Definition: cdstruc.h:939
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
_In_ PFCB Fcb
Definition: cdprocs.h:159
ULONG Size
Definition: ntfs.h:96
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by RfsdCreateFcbFromMcb(), and RfsdCreateFile().

◆ RfsdAllocateIrpContext()

__drv_mustHoldCriticalRegion PRFSD_IRP_CONTEXT RfsdAllocateIrpContext ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 48 of file memory.c.

50 {
51  PIO_STACK_LOCATION IoStackLocation;
52  PRFSD_IRP_CONTEXT IrpContext;
53 
54  PAGED_CODE();
55 
57  ASSERT(Irp != NULL);
58 
59  IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
60 
63  TRUE );
64 
65  IrpContext = (PRFSD_IRP_CONTEXT) (
66  ExAllocateFromNPagedLookasideList(
68 
72 
73  if (IrpContext == NULL) {
74 
76 
77  //
78  // Zero out the irp context and indicate that it is from pool and
79  // not region allocated
80  //
81 
82  RtlZeroMemory(IrpContext, sizeof(RFSD_IRP_CONTEXT));
83 
85 
86  } else {
87 
88  //
89  // Zero out the irp context and indicate that it is from zone and
90  // not pool allocated
91  //
92 
93  RtlZeroMemory(IrpContext, sizeof(RFSD_IRP_CONTEXT) );
94  }
95 
96  if (!IrpContext) {
97  return NULL;
98  }
99 
100  IrpContext->Identifier.Type = RFSDICX;
101  IrpContext->Identifier.Size = sizeof(RFSD_IRP_CONTEXT);
102 
103  IrpContext->Irp = Irp;
104 
105  IrpContext->MajorFunction = IoStackLocation->MajorFunction;
106  IrpContext->MinorFunction = IoStackLocation->MinorFunction;
107 
108  IrpContext->DeviceObject = DeviceObject;
109 
110  IrpContext->FileObject = IoStackLocation->FileObject;
111 
112  if (IrpContext->FileObject != NULL) {
113  IrpContext->RealDevice = IrpContext->FileObject->DeviceObject;
114  } else if (IrpContext->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL) {
115  if (IoStackLocation->Parameters.MountVolume.Vpb) {
116  IrpContext->RealDevice =
117  IoStackLocation->Parameters.MountVolume.Vpb->RealDevice;
118  }
119  }
120 
121  if (IrpContext->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL ||
122  IrpContext->MajorFunction == IRP_MJ_DEVICE_CONTROL ||
123  IrpContext->MajorFunction == IRP_MJ_SHUTDOWN) {
124  IrpContext->IsSynchronous = TRUE;
125  } else if (IrpContext->MajorFunction == IRP_MJ_CLEANUP ||
126  IrpContext->MajorFunction == IRP_MJ_CLOSE) {
127  IrpContext->IsSynchronous = FALSE;
128  }
129 #if (_WIN32_WINNT >= 0x0500)
130  else if (IrpContext->MajorFunction == IRP_MJ_PNP) {
132  IrpContext->IsSynchronous = TRUE;
133  } else {
135  }
136  }
137 #endif //(_WIN32_WINNT >= 0x0500)
138  else {
140  }
141 
142 #if 0
143  //
144  // Temporary workaround for a bug in close that makes it reference a
145  // fileobject when it is no longer valid.
146  //
147  if (IrpContext->MajorFunction == IRP_MJ_CLOSE) {
148  IrpContext->IsSynchronous = TRUE;
149  }
150 #endif
151 
152  IrpContext->IsTopLevel = (IoGetTopLevelIrp() == Irp);
153 
154  IrpContext->ExceptionInProgress = FALSE;
155 
156  return IrpContext;
157 }
BOOLEAN IsSynchronous
Definition: rfsd.h:780
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
BOOLEAN IsTopLevel
Definition: rfsd.h:783
#define IRP_MJ_SHUTDOWN
UCHAR MinorFunction
Definition: rfsd.h:765
_In_ PIRP Irp
Definition: csq.h:116
ERESOURCE LAResource
Definition: rfsd.h:394
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
NPAGED_LOOKASIDE_LIST RfsdIrpContextLookasideList
Definition: rfsd.h:414
#define RFSD_POOL_TAG
Definition: rfsd.h:99
#define IRP_CONTEXT_FLAG_FROM_POOL
Definition: ext2fs.h:1077
BOOLEAN NTAPI IoIsOperationSynchronous(IN PIRP Irp)
Definition: irp.c:1882
PFILE_OBJECT FileObject
Definition: rfsd.h:774
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
smooth NULL
Definition: ftsmooth.c:416
RFSD_IDENTIFIER_TYPE Type
Definition: rfsd.h:336
UCHAR MajorFunction
Definition: rfsd.h:764
Definition: rfsd.h:326
#define IRP_MJ_FILE_SYSTEM_CONTROL
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
RFSD_IDENTIFIER Identifier
Definition: rfsd.h:755
PDEVICE_OBJECT DeviceObject
Definition: rfsd.h:768
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
struct _RFSD_IRP_CONTEXT * PRFSD_IRP_CONTEXT
BOOLEAN ExceptionInProgress
Definition: rfsd.h:789
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
PFILE_OBJECT FileObject
Definition: iotypes.h:2815
ULONG Flags
Definition: rfsd.h:761
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
#define IRP_MJ_CLEANUP
PDEVICE_OBJECT RealDevice
Definition: rfsd.h:771
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
ULONG Size
Definition: rfsd.h:337
struct _RFSD_IRP_CONTEXT RFSD_IRP_CONTEXT
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2774
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define PAGED_CODE()

Referenced by RfsdBuildRequest().

◆ RfsdAllocateMcb()

__drv_mustHoldCriticalRegion PRFSD_MCB RfsdAllocateMcb ( PRFSD_VCB  Vcb,
PUNICODE_STRING  FileName,
ULONG  FileAttr 
)

Definition at line 694 of file memory.c.

695 {
696  PRFSD_MCB Mcb = NULL;
698  ULONG Extra = 0;
699 
700  PAGED_CODE();
701 
702 #define MCB_NUM_SHIFT 0x04
703 
705  Extra = RfsdGlobal->McbAllocated -
708 
710  "RfsdAllocateMcb: CurrDepth=%xh/%xh/%xh FileName=%S\n",
713  RfsdGlobal->FcbAllocated,
714  FileName->Buffer));
715 
716  List = Vcb->McbList.Flink;
717 
718  while ((List != &(Vcb->McbList)) && (Extra > 0)) {
720  List = List->Flink;
721 
722  if ((!RFSD_IS_ROOT_KEY(Mcb->Key)) && (Mcb->Child == NULL) &&
723  (Mcb->RfsdFcb == NULL) && (!IsMcbUsed(Mcb))) {
724  RfsdPrint((DBG_INFO, "RfsdAllocateMcb: Mcb %S will be freed.\n",
725  Mcb->ShortName.Buffer));
726 
727  if (RfsdDeleteMcbNode(Vcb, Vcb->McbTree, Mcb)) {
728  RfsdFreeMcb(Mcb);
729 
730  Extra--;
731  }
732  }
733  }
734 
737  TRUE );
738 
739  Mcb = (PRFSD_MCB) (ExAllocateFromPagedLookasideList(
741 
745 
746  if (Mcb == NULL) {
748 
749  RtlZeroMemory(Mcb, sizeof(RFSD_MCB));
750 
751  SetFlag(Mcb->Flags, MCB_FROM_POOL);
752  } else {
753  RtlZeroMemory(Mcb, sizeof(RFSD_MCB));
754  }
755 
756  if (!Mcb) {
757  return NULL;
758  }
759 
760  Mcb->Identifier.Type = RFSDMCB;
761  Mcb->Identifier.Size = sizeof(RFSD_MCB);
762 
763  if (FileName && FileName->Length) {
764 
765  Mcb->ShortName.Length = FileName->Length;
766  Mcb->ShortName.MaximumLength = Mcb->ShortName.Length + 2;
767 
768  Mcb->ShortName.Buffer = ExAllocatePoolWithTag(PagedPool, Mcb->ShortName.MaximumLength, RFSD_POOL_TAG);
769 
770  if (!Mcb->ShortName.Buffer)
771  goto errorout;
772 
773  RtlZeroMemory(Mcb->ShortName.Buffer, Mcb->ShortName.MaximumLength);
774  RtlCopyMemory(Mcb->ShortName.Buffer, FileName->Buffer, Mcb->ShortName.Length);
775  }
776 
777  Mcb->FileAttr = FileAttr;
778 
781  TRUE );
782 
784 
788 
789  return Mcb;
790 
791 errorout:
792 
793  if (Mcb) {
794 
795  if (Mcb->ShortName.Buffer)
796  ExFreePool(Mcb->ShortName.Buffer);
797 
798  if (FlagOn(Mcb->Flags, MCB_FROM_POOL)) {
799 
800  ExFreePool( Mcb );
801 
802  } else {
803 
806  TRUE );
807 
808  ExFreeToPagedLookasideList(&(RfsdGlobal->RfsdMcbLookasideList), Mcb);
809 
813  }
814  }
815 
816  return NULL;
817 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define MCB_FROM_POOL
Definition: ext2fs.h:943
USHORT MaxDepth
Definition: rfsd.h:413
ERESOURCE LAResource
Definition: rfsd.h:394
#define RFSD_IS_ROOT_KEY(x)
Definition: rfsd.h:52
#define RFSD_POOL_TAG
Definition: rfsd.h:99
PAGED_LOOKASIDE_LIST RfsdMcbLookasideList
Definition: rfsd.h:417
Definition: rfsd.h:327
static int Link(const char **args)
Definition: vfdcmd.c:2414
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
__drv_mustHoldCriticalRegion VOID RfsdFreeMcb(IN PRFSD_MCB Mcb)
Definition: memory.c:821
ERESOURCE CountResource
Definition: rfsd.h:391
smooth NULL
Definition: ftsmooth.c:416
USHORT McbAllocated
Definition: rfsd.h:420
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define MCB_NUM_SHIFT
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
LIST_ENTRY List
Definition: psmgr.c:57
BOOLEAN RfsdDeleteMcbNode(PRFSD_VCB Vcb, PRFSD_MCB McbTree, PRFSD_MCB RfsdMcb)
Definition: memory.c:1057
#define Vcb
Definition: cdprocs.h:1415
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define RfsdPrint(arg)
Definition: rfsd.h:1069
Definition: typedefs.h:118
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
struct _RFSD_MCB * PRFSD_MCB
Definition: rfsd.h:343
#define IsMcbUsed(Mcb)
Definition: ext2fs.h:952
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:343
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
#define DBG_INFO
Definition: ffsdrv.h:1034
struct _RFSD_MCB RFSD_MCB
Definition: rfsd.h:343
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by RfsdInitializeVcb(), and RfsdLookupFileName().

◆ RfsdCheckBitmapConsistency()

BOOLEAN RfsdCheckBitmapConsistency ( PRFSD_IRP_CONTEXT  IrpContext,
PRFSD_VCB  Vcb 
)

Definition at line 1208 of file memory.c.

1209 {
1210  ULONG i, j, InodeBlocks;
1211 
1212  PAGED_CODE();
1213 #if 0
1214  for (i = 0; i < Vcb->NumOfGroups; i++) {
1215 
1216  RfsdCheckSetBlock(IrpContext, Vcb, Vcb->GroupDesc[i].bg_block_bitmap);
1217  RfsdCheckSetBlock(IrpContext, Vcb, Vcb->GroupDesc[i].bg_inode_bitmap);
1218 
1219 
1220  if (i == Vcb->NumOfGroups - 1) {
1221  InodeBlocks = ((INODES_COUNT % INODES_PER_GROUP) *
1222  sizeof(RFSD_INODE) + Vcb->BlockSize - 1) /
1223  (Vcb->BlockSize);
1224  } else {
1225  InodeBlocks = (INODES_PER_GROUP * sizeof(RFSD_INODE) + Vcb->BlockSize - 1) / (Vcb->BlockSize);
1226  }
1227 
1228  for (j = 0; j < InodeBlocks; j++ )
1229  RfsdCheckSetBlock(IrpContext, Vcb, Vcb->GroupDesc[i].bg_inode_table + j);
1230  }
1231 #endif // 0
1232  return TRUE;
1233 }
#define TRUE
Definition: types.h:120
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define Vcb
Definition: cdprocs.h:1415
unsigned int ULONG
Definition: retypes.h:1
#define INODES_PER_GROUP
Definition: ext2fs.h:99
#define INODES_COUNT
Definition: ext2fs.h:97
BOOLEAN RfsdCheckSetBlock(PRFSD_IRP_CONTEXT IrpContext, PRFSD_VCB Vcb, ULONG Block)
Definition: memory.c:1131
struct stat_data RFSD_INODE
Definition: rfsd.h:33
#define PAGED_CODE()

Referenced by RfsdInitializeVcb().

◆ RfsdCheckSetBlock()

BOOLEAN RfsdCheckSetBlock ( PRFSD_IRP_CONTEXT  IrpContext,
PRFSD_VCB  Vcb,
ULONG  Block 
)

Definition at line 1131 of file memory.c.

1132 {
1133  ULONG Group, dwBlk, Length;
1134 
1135  RTL_BITMAP BlockBitmap;
1136  PVOID BitmapCache;
1137  PBCB BitmapBcb;
1138 
1140 
1141  BOOLEAN bModified = FALSE;
1142 
1143  PAGED_CODE();
1144 #if 0
1146 
1147  dwBlk = (Block - RFSD_FIRST_DATA_BLOCK) % BLOCKS_PER_GROUP;
1148 
1149 
1150  Offset.QuadPart = (LONGLONG) Vcb->BlockSize;
1151  Offset.QuadPart = Offset.QuadPart * Vcb->GroupDesc[Group].bg_block_bitmap;
1152 
1153  if (Group == Vcb->NumOfGroups - 1) {
1155 
1156  /* s_blocks_count is integer multiple of s_blocks_per_group */
1157  if (Length == 0)
1159  } else {
1161  }
1162 
1163  if (dwBlk >= Length)
1164  return FALSE;
1165 
1166  if (!CcPinRead( Vcb->StreamObj,
1167  &Offset,
1168  Vcb->BlockSize,
1169  PIN_WAIT,
1170  &BitmapBcb,
1171  &BitmapCache ) ) {
1172 
1173  RfsdPrint((DBG_ERROR, "RfsdDeleteBlock: PinReading error ...\n"));
1174  return FALSE;
1175  }
1176 
1177  RtlInitializeBitMap( &BlockBitmap,
1178  BitmapCache,
1179  Length );
1180 
1181  if (RtlCheckBit(&BlockBitmap, dwBlk) == 0) {
1182  DbgBreak();
1183  RtlSetBits(&BlockBitmap, dwBlk, 1);
1184  bModified = TRUE;
1185  }
1186 
1187  if (bModified) {
1188 
1189  CcSetDirtyPinnedData(BitmapBcb, NULL );
1190 
1191  RfsdRepinBcb(IrpContext, BitmapBcb);
1192 
1193  RfsdAddMcbEntry(Vcb, Offset.QuadPart, (LONGLONG)Vcb->BlockSize);
1194  }
1195 
1196  {
1197  CcUnpinData(BitmapBcb);
1198  BitmapBcb = NULL;
1199  BitmapCache = NULL;
1200 
1201  RtlZeroMemory(&BlockBitmap, sizeof(RTL_BITMAP));
1202  }
1203 #endif // 0
1204  return (!bModified);
1205 }
#define TRUE
Definition: types.h:120
VOID NTAPI CcSetDirtyPinnedData(IN PVOID BcbVoid, IN OPTIONAL PLARGE_INTEGER Lsn)
Definition: cachesub.c:121
_In_opt_ PSID Group
Definition: rtlfuncs.h:1605
VOID RfsdRepinBcb(IN PRFSD_IRP_CONTEXT IrpContext, IN PBCB Bcb)
Definition: memory.c:232
BOOLEAN RfsdAddMcbEntry(IN PRFSD_VCB Vcb, IN LONGLONG Lba, IN LONGLONG Length)
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
VOID NTAPI CcUnpinData(IN PVOID Bcb)
Definition: pinsup.c:955
#define RFSD_FIRST_DATA_BLOCK
Definition: rfsd.h:126
#define PIN_WAIT
#define RtlCheckBit(BMH, BP)
Definition: rtlfuncs.h:3154
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define TOTAL_BLOCKS
Definition: ext2fs.h:101
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
int64_t LONGLONG
Definition: typedefs.h:67
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define Vcb
Definition: cdprocs.h:1415
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
BOOLEAN NTAPI CcPinRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
Definition: pinsup.c:802
#define RfsdPrint(arg)
Definition: rfsd.h:1069
#define DBG_ERROR
Definition: ffsdrv.h:1031
NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP, ULONG, ULONG)
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define DbgBreak()
Definition: ext2fs.h:46
#define BLOCKS_PER_GROUP
Definition: ext2fs.h:100
#define PAGED_CODE()

Referenced by RfsdCheckBitmapConsistency().

◆ RfsdCompleteIrpContext()

NTSTATUS RfsdCompleteIrpContext ( IN PRFSD_IRP_CONTEXT  IrpContext,
IN NTSTATUS  Status 
)

Definition at line 160 of file memory.c.

163 {
164  PIRP Irp = NULL;
165  BOOLEAN bPrint;
166 
167  Irp = IrpContext->Irp;
168 
169  if (Irp != NULL) {
170 
171  if (NT_ERROR(Status)) {
172  Irp->IoStatus.Information = 0;
173  }
174 
175  Irp->IoStatus.Status = Status;
176  bPrint = !IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_REQUEUED);
177 
179  Irp, bPrint, (CCHAR)(NT_SUCCESS(Status)?
181 
182  IrpContext->Irp = NULL;
183  }
184 
185  RfsdFreeIrpContext(IrpContext);
186 
187  return Status;
188 }
_In_ PIRP Irp
Definition: csq.h:116
#define IO_DISK_INCREMENT
Definition: iotypes.h:570
__drv_mustHoldCriticalRegion VOID RfsdFreeIrpContext(IN PRFSD_IRP_CONTEXT IrpContext)
Definition: memory.c:192
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
char CCHAR
Definition: typedefs.h:51
#define NT_ERROR(Status)
Definition: umtypes.h:106
Status
Definition: gdiplustypes.h:24
#define IRP_CONTEXT_FLAG_REQUEUED
Definition: ext2fs.h:1085
#define IO_NO_INCREMENT
Definition: iotypes.h:568
#define RfsdCompleteRequest(Irp, bPrint, PriorityBoost)
Definition: rfsd.h:1072

Referenced by RfsdAllowExtendedDasdIo(), RfsdCleanup(), RfsdClose(), RfsdCreate(), RfsdDeviceControlNormal(), RfsdDirectoryControl(), RfsdDismountVolume(), RfsdDispatchRequest(), RfsdFileSystemControl(), RfsdFlush(), RfsdInvalidateVolumes(), RfsdLockControl(), RfsdLockVolume(), RfsdMountVolume(), RfsdNotifyChangeDirectory(), RfsdQueryDirectory(), RfsdQueryInformation(), RfsdQueryVolumeInformation(), RfsdRead(), RfsdReadComplete(), RfsdReadFile(), RfsdReadVolume(), RfsdSetInformation(), RfsdSetVolumeInformation(), RfsdShutDown(), RfsdUnlockVolume(), RfsdUserFsRequest(), RfsdVerifyVolume(), RfsdWrite(), RfsdWriteComplete(), RfsdWriteFile(), and RfsdWriteVolume().

◆ RfsdCreateFcbFromMcb()

__drv_mustHoldCriticalRegion PRFSD_FCB RfsdCreateFcbFromMcb ( PRFSD_VCB  Vcb,
PRFSD_MCB  Mcb 
)

Definition at line 867 of file memory.c.

868 {
869  PRFSD_FCB Fcb = NULL;
870  RFSD_INODE RfsdIno;
871 
872  PAGED_CODE();
873 
874  if (Mcb->RfsdFcb)
875  return Mcb->RfsdFcb;
876 
877  if (RfsdLoadInode(Vcb, &(Mcb->Key), &RfsdIno)) {
879  if (!pTmpInode) {
880  goto errorout;
881  }
882 
883  RtlCopyMemory(pTmpInode, &RfsdIno, sizeof(RFSD_INODE));
884  Fcb = RfsdAllocateFcb(Vcb, Mcb, pTmpInode);
885  if (!Fcb) {
886  ExFreePool(pTmpInode);
887  }
888  }
889 
890 errorout:
891 
892  return Fcb;
893 }
__drv_mustHoldCriticalRegion PRFSD_FCB RfsdAllocateFcb(IN PRFSD_VCB Vcb, IN PRFSD_MCB RfsdMcb, IN PRFSD_INODE Inode)
Definition: memory.c:383
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define RFSD_POOL_TAG
Definition: rfsd.h:99
smooth NULL
Definition: ftsmooth.c:416
#define Vcb
Definition: cdprocs.h:1415
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
BOOLEAN RfsdLoadInode(IN PRFSD_VCB Vcb, IN PRFSD_KEY_IN_MEMORY pKey, IN OUT PRFSD_INODE Inode)
Definition: rfsd.c:253
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:343
_In_ PFCB Fcb
Definition: cdprocs.h:159
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by RfsdDeleteFile(), and RfsdSetRenameInfo().

◆ RfsdDeleteMcbNode()

BOOLEAN RfsdDeleteMcbNode ( PRFSD_VCB  Vcb,
PRFSD_MCB  McbTree,
PRFSD_MCB  RfsdMcb 
)

Definition at line 1057 of file memory.c.

1058 {
1059  PRFSD_MCB TmpMcb;
1060 
1061  PAGED_CODE();
1062 
1063  if(!IsFlagOn(RfsdMcb->Flags, MCB_IN_TREE)) {
1064  return TRUE;
1065  }
1066 
1067  if (RfsdMcb->Parent) {
1068  if (RfsdMcb->Parent->Child == RfsdMcb) {
1069  RfsdMcb->Parent->Child = RfsdMcb->Next;
1070  } else {
1071  TmpMcb = RfsdMcb->Parent->Child;
1072 
1073  while (TmpMcb && TmpMcb->Next != RfsdMcb)
1074  TmpMcb = TmpMcb->Next;
1075 
1076  if (TmpMcb) {
1077  TmpMcb->Next = RfsdMcb->Next;
1078  } else {
1079  // error
1080  return FALSE;
1081  }
1082  }
1083  } else if (RfsdMcb->Child) {
1084  return FALSE;
1085  }
1086 
1087  RemoveEntryList(&(RfsdMcb->Link));
1088  ClearFlag(RfsdMcb->Flags, MCB_IN_TREE);
1089 
1090  return TRUE;
1091 }
#define TRUE
Definition: types.h:120
PRFSD_MCB Parent
Definition: rfsd.h:684
ULONG Flags
Definition: rfsd.h:680
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
PRFSD_MCB Next
Definition: rfsd.h:686
PRFSD_MCB Child
Definition: rfsd.h:685
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
#define MCB_IN_TREE
Definition: ffsdrv.h:679
LIST_ENTRY Link
Definition: rfsd.h:706
#define PAGED_CODE()

Referenced by RfsdAllocateMcb(), RfsdDeleteFile(), RfsdFreeFcb(), and RfsdSetRenameInfo().

◆ RfsdFreeCcb()

Definition at line 661 of file memory.c.

662 {
663  PAGED_CODE();
664 
665  ASSERT(Ccb != NULL);
666 
667  ASSERT((Ccb->Identifier.Type == RFSDCCB) &&
668  (Ccb->Identifier.Size == sizeof(RFSD_CCB)));
669 
670  if (Ccb->DirectorySearchPattern.Buffer != NULL) {
671  ExFreePool(Ccb->DirectorySearchPattern.Buffer);
672  }
673 
674  if (FlagOn(Ccb->Flags, CCB_FROM_POOL)) {
675 
676  ExFreePool( Ccb );
677 
678  } else {
679 
682  TRUE );
683 
684  ExFreeToNPagedLookasideList(&(RfsdGlobal->RfsdCcbLookasideList), Ccb);
685 
689  }
690 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
ERESOURCE LAResource
Definition: rfsd.h:394
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
smooth NULL
Definition: ftsmooth.c:416
NPAGED_LOOKASIDE_LIST RfsdCcbLookasideList
Definition: rfsd.h:416
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG Flags
Definition: ntfs.h:532
ULONG Type
Definition: ntfs.h:95
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:588
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
Definition: rfsd.h:325
#define CCB_FROM_POOL
Definition: ext2fs.h:1022
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
ULONG Size
Definition: ntfs.h:96
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by RfsdClose().

◆ RfsdFreeFcb()

Definition at line 541 of file memory.c.

542 {
543  PRFSD_VCB Vcb;
544 
545  PAGED_CODE();
546 
547  ASSERT(Fcb != NULL);
548 
549  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
550  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
551 
552  Vcb = Fcb->Vcb;
553 
554  FsRtlUninitializeFileLock(&Fcb->FileLockAnchor);
555 
557 
559 
560  Fcb->RfsdMcb->RfsdFcb = NULL;
561 
563  if (Fcb->RfsdMcb) {
564  RfsdDeleteMcbNode(Vcb, Fcb->RfsdMcb->Parent, Fcb->RfsdMcb);
565  RfsdFreeMcb(Fcb->RfsdMcb);
566  }
567  }
568 
569  if (Fcb->LongName.Buffer) {
570  ExFreePool(Fcb->LongName.Buffer);
571  Fcb->LongName.Buffer = NULL;
572  }
573 
574 #if DBG
575  ExFreePool(Fcb->AnsiFileName.Buffer);
576 #endif
577 
578  ExFreePool(Fcb->Inode);
579 
580  Fcb->Header.NodeTypeCode = (SHORT)0xCCCC;
581  Fcb->Header.NodeByteSize = (SHORT)0xC0C0;
582 
583  if (FlagOn(Fcb->Flags, FCB_FROM_POOL)) {
584 
585  ExFreePool( Fcb );
586 
587  } else {
588 
591  TRUE );
592 
593  ExFreeToNPagedLookasideList(&(RfsdGlobal->RfsdFcbLookasideList), Fcb);
594 
598  }
599 
600 #if DBG
601 
604  TRUE );
605 
606  RfsdGlobal->FcbAllocated--;
607 
611 #endif
612 
613 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
ERESOURCE LAResource
Definition: rfsd.h:394
VOID NTAPI FsRtlUninitializeFileLock(IN PFILE_LOCK FileLock)
Definition: filelock.c:1278
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
Definition: rfsd.h:324
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
__drv_mustHoldCriticalRegion VOID RfsdFreeMcb(IN PRFSD_MCB Mcb)
Definition: memory.c:821
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
ERESOURCE CountResource
Definition: rfsd.h:391
short SHORT
Definition: pedump.c:59
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN RfsdDeleteMcbNode(PRFSD_VCB Vcb, PRFSD_MCB McbTree, PRFSD_MCB RfsdMcb)
Definition: memory.c:1057
#define Vcb
Definition: cdprocs.h:1415
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG Flags
Definition: ntfs.h:532
ULONG Type
Definition: ntfs.h:95
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
ERESOURCE MainResource
Definition: ntfs.h:524
#define FCB_FROM_POOL
Definition: ext2fs.h:871
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
NPAGED_LOOKASIDE_LIST RfsdFcbLookasideList
Definition: rfsd.h:415
#define FCB_FILE_DELETED
Definition: ffsdrv.h:635
ERESOURCE PagingIoResource
Definition: ntfs.h:523
PVCB Vcb
Definition: cdstruc.h:939
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
_In_ PFCB Fcb
Definition: cdprocs.h:159
ULONG Size
Definition: ntfs.h:96
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
union _FCB::@712 LongName
#define PAGED_CODE()

Referenced by RfsdClose(), and RfsdPurgeVolume().

◆ RfsdFreeIrpContext()

__drv_mustHoldCriticalRegion VOID RfsdFreeIrpContext ( IN PRFSD_IRP_CONTEXT  IrpContext)

Definition at line 192 of file memory.c.

193 {
194  PAGED_CODE();
195 
196  ASSERT(IrpContext != NULL);
197 
198  ASSERT((IrpContext->Identifier.Type == RFSDICX) &&
199  (IrpContext->Identifier.Size == sizeof(RFSD_IRP_CONTEXT)));
200 
201  RfsdUnpinRepinnedBcbs(IrpContext);
202 
203  // Return the Irp context record to the region or to pool depending on
204  // its flag
205 
206  if (FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_FROM_POOL)) {
207 
208  IrpContext->Identifier.Type = 0;
209  IrpContext->Identifier.Size = 0;
210 
211  ExFreePool( IrpContext );
212 
213  } else {
214 
215  IrpContext->Identifier.Type = 0;
216  IrpContext->Identifier.Size = 0;
217 
220  TRUE );
221 
222  ExFreeToNPagedLookasideList(&(RfsdGlobal->RfsdIrpContextLookasideList), IrpContext);
223 
227 
228  }
229 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
ERESOURCE LAResource
Definition: rfsd.h:394
NPAGED_LOOKASIDE_LIST RfsdIrpContextLookasideList
Definition: rfsd.h:414
#define IRP_CONTEXT_FLAG_FROM_POOL
Definition: ext2fs.h:1077
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
smooth NULL
Definition: ftsmooth.c:416
Definition: rfsd.h:326
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
VOID RfsdUnpinRepinnedBcbs(IN PRFSD_IRP_CONTEXT IrpContext)
Definition: memory.c:286
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by RfsdCompleteIrpContext(), RfsdExceptionFilter(), RfsdExceptionHandler(), RfsdReadFile(), RfsdReadVolume(), RfsdWriteFile(), and RfsdWriteVolume().

◆ RfsdFreeMcb()

Definition at line 821 of file memory.c.

822 {
823 #ifndef __REACTOS__
824  PRFSD_MCB Parent = Mcb->Parent;
825 #endif
826 
827  ASSERT(Mcb != NULL);
828 
829  ASSERT((Mcb->Identifier.Type == RFSDMCB) &&
830  (Mcb->Identifier.Size == sizeof(RFSD_MCB)));
831 
832  RfsdPrint((DBG_INFO, "RfsdFreeMcb: Mcb %S will be freed.\n", Mcb->ShortName.Buffer));
833 
834  if (Mcb->ShortName.Buffer)
835  ExFreePool(Mcb->ShortName.Buffer);
836 
837  if (FlagOn(Mcb->Flags, MCB_FROM_POOL)) {
838 
839  ExFreePool( Mcb );
840 
841  } else {
842 
845  TRUE );
846 
847  ExFreeToPagedLookasideList(&(RfsdGlobal->RfsdMcbLookasideList), Mcb);
848 
852  }
853 
856  TRUE );
857 
859 
863 }
#define ExGetCurrentResourceThread()
Definition: env_spec_w32.h:633
#define TRUE
Definition: types.h:120
#define MCB_FROM_POOL
Definition: ext2fs.h:943
ERESOURCE LAResource
Definition: rfsd.h:394
PAGED_LOOKASIDE_LIST RfsdMcbLookasideList
Definition: rfsd.h:417
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:728
Definition: rfsd.h:327
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
ERESOURCE CountResource
Definition: rfsd.h:391
smooth NULL
Definition: ftsmooth.c:416
USHORT McbAllocated
Definition: rfsd.h:420
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RfsdPrint(arg)
Definition: rfsd.h:1069
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:343
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
VOID NTAPI ExReleaseResourceForThreadLite(IN PERESOURCE Resource, IN ERESOURCE_THREAD Thread)
Definition: resource.c:1844
#define DBG_INFO
Definition: ffsdrv.h:1034
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by RfsdAllocateMcb(), RfsdFreeFcb(), and RfsdFreeMcbTree().

◆ RfsdFreeMcbTree()

__drv_mustHoldCriticalRegion VOID RfsdFreeMcbTree ( PRFSD_MCB  McbTree)

Definition at line 1094 of file memory.c.

1095 {
1096  PAGED_CODE();
1097 
1098  if (!McbTree)
1099  return;
1100 
1101  if (McbTree->Child) {
1102  RfsdFreeMcbTree(McbTree->Child);
1103  }
1104 
1105  if (McbTree->Next) {
1106 
1107  PRFSD_MCB Current;
1108  PRFSD_MCB Next;
1109 
1110  Current = McbTree->Next;
1111 
1112  while (Current) {
1113 
1114  Next = Current->Next;
1115 
1116  if (Current->Child) {
1117  RfsdFreeMcbTree(Current->Child);
1118  }
1119 
1120  RfsdFreeMcb(Current);
1121  Current = Next;
1122  }
1123  }
1124 
1125  RfsdFreeMcb(McbTree);
1126 }
__drv_mustHoldCriticalRegion VOID RfsdFreeMcbTree(PRFSD_MCB McbTree)
Definition: memory.c:1094
__drv_mustHoldCriticalRegion VOID RfsdFreeMcb(IN PRFSD_MCB Mcb)
Definition: memory.c:821
PRFSD_MCB Next
Definition: rfsd.h:686
PRFSD_MCB Child
Definition: rfsd.h:685
#define PAGED_CODE()

Referenced by RfsdFreeVcb().

◆ RfsdFreeVcb()

Definition at line 1581 of file memory.c.

1582 {
1583  PAGED_CODE();
1584 
1585  ASSERT(Vcb != NULL);
1586 
1587  ASSERT((Vcb->Identifier.Type == RFSDVCB) &&
1588  (Vcb->Identifier.Size == sizeof(RFSD_VCB)));
1589 
1590  FsRtlNotifyUninitializeSync(&Vcb->NotifySync);
1591 
1592  if (Vcb->StreamObj) {
1593  if (IsFlagOn(Vcb->StreamObj->Flags, FO_FILE_MODIFIED)) {
1595 
1596  CcFlushCache(&(Vcb->SectionObject), NULL, 0, &IoStatus);
1597  ClearFlag(Vcb->StreamObj->Flags, FO_FILE_MODIFIED);
1598  }
1599 
1600  if (Vcb->StreamObj->PrivateCacheMap)
1601  RfsdSyncUninitializeCacheMap(Vcb->StreamObj);
1602 
1603  ObDereferenceObject(Vcb->StreamObj);
1604  Vcb->StreamObj = NULL;
1605  }
1606 
1607 #if DBG
1608  if (FsRtlNumberOfRunsInLargeMcb(&(Vcb->DirtyMcbs)) != 0) {
1609  LONGLONG DirtyVba;
1610  LONGLONG DirtyLba;
1611  LONGLONG DirtyLength;
1612  int i;
1613 
1614  for (i = 0; FsRtlGetNextLargeMcbEntry (&(Vcb->DirtyMcbs), i, &DirtyVba, &DirtyLba, &DirtyLength); i++)
1615  {
1616  RfsdPrint((DBG_INFO, "DirtyVba = %I64xh\n", DirtyVba));
1617  RfsdPrint((DBG_INFO, "DirtyLba = %I64xh\n", DirtyLba));
1618  RfsdPrint((DBG_INFO, "DirtyLen = %I64xh\n\n", DirtyLength));
1619  }
1620 
1621  DbgBreak();
1622  }
1623 #endif
1624 
1625  FsRtlUninitializeLargeMcb(&(Vcb->DirtyMcbs));
1626 
1627  RfsdFreeMcbTree(Vcb->McbTree);
1628 
1629  if (Vcb->GroupDesc) {
1630  ExFreePool(Vcb->GroupDesc);
1631  // CcUnpinData(Vcb->GroupDescBcb);
1632  Vcb->GroupDesc = NULL;
1633  }
1634 
1635  if (Vcb->SuperBlock) {
1636  ExFreePool(Vcb->SuperBlock);
1637  Vcb->SuperBlock = NULL;
1638  }
1639 
1640  ExDeleteResourceLite(&Vcb->McbResource);
1641 
1642  ExDeleteResourceLite(&Vcb->PagingIoResource);
1643 
1644  ExDeleteResourceLite(&Vcb->MainResource);
1645 
1646  IoDeleteDevice(Vcb->DeviceObject);
1647 }
__drv_mustHoldCriticalRegion VOID RfsdFreeMcbTree(PRFSD_MCB McbTree)
Definition: memory.c:1094
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
Definition: cachesub.c:222
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2659
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
VOID RfsdSyncUninitializeCacheMap(IN PFILE_OBJECT FileObject)
Definition: memory.c:1650
ULONG NTAPI FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb)
Definition: largemcb.c:769
Definition: rfsd.h:323
BOOLEAN NTAPI FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb, IN ULONG RunIndex, OUT PLONGLONG Vbn, OUT PLONGLONG Lbn, OUT PLONGLONG SectorCount)
Definition: largemcb.c:391
#define FO_FILE_MODIFIED
Definition: iotypes.h:1747
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
int64_t LONGLONG
Definition: typedefs.h:67
#define Vcb
Definition: cdprocs.h:1415
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RfsdPrint(arg)
Definition: rfsd.h:1069
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
VOID NTAPI FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb)
Definition: largemcb.c:1053
#define DbgBreak()
Definition: ext2fs.h:46
#define DBG_INFO
Definition: ffsdrv.h:1034
VOID NTAPI FsRtlNotifyUninitializeSync(IN PNOTIFY_SYNC *NotifySync)
Definition: notify.c:1639
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by RfsdCheckDismount(), and RfsdClose().

◆ RfsdGetFullFileName()

BOOLEAN RfsdGetFullFileName ( PRFSD_MCB  Mcb,
PUNICODE_STRING  FileName 
)

Definition at line 896 of file memory.c.

897 {
898  USHORT Length = 0;
899  PRFSD_MCB TmpMcb = Mcb;
900  PUNICODE_STRING FileNames[256];
901  SHORT Count = 0 , i = 0, j = 0;
902 
903  PAGED_CODE();
904 
905  while(TmpMcb && Count < 256) {
906  if (RFSD_IS_ROOT_KEY(TmpMcb->Key))
907  break;
908 
909  FileNames[Count++] = &TmpMcb->ShortName;
910  Length += (2 + TmpMcb->ShortName.Length);
911 
912  TmpMcb = TmpMcb->Parent;
913  }
914 
915  if (Count >= 256)
916  return FALSE;
917 
918  if (Count ==0)
919  Length = 2;
920 
921  FileName->Length = Length;
922  FileName->MaximumLength = Length + 2;
924 
925  if (!FileName->Buffer) {
926  return FALSE;
927  }
928 
929  RtlZeroMemory(FileName->Buffer, FileName->MaximumLength);
930 
931  if (Count == 0) {
932  FileName->Buffer[0] = L'\\';
933  return TRUE;
934  }
935 
936  for (i = Count - 1; i >= 0 && j < (SHORT)(FileName->MaximumLength); i--) {
937  FileName->Buffer[j++] = L'\\';
938 
939  RtlCopyMemory( &(FileName->Buffer[j]),
940  FileNames[i]->Buffer,
941  FileNames[i]->Length );
942 
943  j += FileNames[i]->Length / 2;
944  }
945 
946  return TRUE;
947 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
PRFSD_MCB Parent
Definition: rfsd.h:684
#define RFSD_IS_ROOT_KEY(x)
Definition: rfsd.h:52
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1173
#define RFSD_POOL_TAG
Definition: rfsd.h:99
RFSD_KEY_IN_MEMORY Key
Definition: rfsd.h:697
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
short SHORT
Definition: pedump.c:59
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
unsigned short USHORT
Definition: pedump.c:61
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:343
UNICODE_STRING ShortName
Definition: rfsd.h:694
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define PAGED_CODE()

Referenced by RfsdNotifyChangeDirectory(), and RfsdNotifyReportChange().

◆ RfsdInitializeVcb()

__drv_mustHoldCriticalRegion NTSTATUS RfsdInitializeVcb ( IN PRFSD_IRP_CONTEXT  IrpContext,
IN PRFSD_VCB  Vcb,
IN PRFSD_SUPER_BLOCK  RfsdSb,
IN PDEVICE_OBJECT  TargetDevice,
IN PDEVICE_OBJECT  VolumeDevice,
IN PVPB  Vpb 
)

Definition at line 1251 of file memory.c.

1257 {
1258  BOOLEAN VcbResourceInitialized = FALSE;
1259  USHORT VolumeLabelLength;
1260  ULONG IoctlSize;
1261  BOOLEAN NotifySyncInitialized = FALSE;
1262  LONGLONG DiskSize;
1263  LONGLONG PartSize;
1266  USHORT Buffer[2];
1267  ULONG ChangeCount;
1268  char s_volume_name[16] = "ReiserFS\0"; /* volume name */ // FUTURE: pull in from v2 superblock, if available
1269  int templen;
1270 
1271  PAGED_CODE();
1272 
1273  _SEH2_TRY {
1274 
1275  if (!Vpb) {
1276 
1278  _SEH2_LEAVE;
1279  }
1280 
1281  RfsdPrint((DBG_ERROR, "RfsdInitializeVcb: Flink = %xh McbList = %xh\n",
1282  Vcb->McbList.Flink, &(Vcb->McbList.Flink)));
1283 
1284 #if RFSD_READ_ONLY
1285  SetFlag(Vcb->Flags, VCB_READ_ONLY);
1286 #endif //READ_ONLY
1287 
1288  if (IsFlagOn(Vpb->RealDevice->Characteristics, FILE_REMOVABLE_MEDIA)) {
1289  SetFlag(Vcb->Flags, VCB_REMOVABLE_MEDIA);
1290  }
1291 
1292  if (IsFlagOn(Vpb->RealDevice->Characteristics, FILE_FLOPPY_DISKETTE)) {
1293  SetFlag(Vcb->Flags, VCB_FLOPPY_DISK);
1294  }
1295 
1296  /*if (IsFlagOn(RfsdGlobal->Flags, RFSD_SUPPORT_WRITING)) {
1297  if ((IsFlagOn(RfsdSb->s_feature_incompat, EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) ||
1298  IsFlagOn(RfsdSb->s_feature_incompat, EXT3_FEATURE_INCOMPAT_RECOVER) ||
1299  IsFlagOn(RfsdSb->s_feature_compat, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) ) {
1300  if(IsFlagOn(RfsdGlobal->Flags, EXT3_FORCE_WRITING)) {
1301  ClearFlag(Vcb->Flags, VCB_READ_ONLY);
1302  } else {
1303  SetFlag(Vcb->Flags, VCB_READ_ONLY);
1304  }
1305  } else {
1306  ClearFlag(Vcb->Flags, VCB_READ_ONLY);
1307  }
1308  } else {
1309  SetFlag(Vcb->Flags, VCB_READ_ONLY);
1310  }*/
1311  // RFSD will be read only.
1312  SetFlag(Vcb->Flags, VCB_READ_ONLY);
1313 
1314  ExInitializeResourceLite(&Vcb->MainResource);
1315  ExInitializeResourceLite(&Vcb->PagingIoResource);
1316 
1317  ExInitializeResourceLite(&Vcb->McbResource);
1318 
1319  VcbResourceInitialized = TRUE;
1320 
1321  Vcb->Vpb = Vpb;
1322 
1323  Vcb->RealDevice = Vpb->RealDevice;
1324  Vpb->DeviceObject = VolumeDevice;
1325 
1326  {
1327  UNICODE_STRING LabelName;
1329 
1330 
1331 
1332  LabelName.MaximumLength = 16 * 2;
1333  LabelName.Length = 0;
1334  LabelName.Buffer = Vcb->Vpb->VolumeLabel;
1335 
1336  RtlZeroMemory(LabelName.Buffer, LabelName.MaximumLength);
1337 
1338  VolumeLabelLength = 16;
1339 
1340  while( (VolumeLabelLength > 0) &&
1341  ((s_volume_name[VolumeLabelLength-1] == '\0') ||
1342  (s_volume_name[VolumeLabelLength-1] == ' ')) ) {
1343  VolumeLabelLength--;
1344  }
1345 
1346  OemName.Buffer = s_volume_name;
1347  OemName.MaximumLength = 16;
1348  OemName.Length = VolumeLabelLength;
1349 
1350  templen = RtlOemStringToUnicodeSize(&OemName);
1351 
1352  Status = RfsdOEMToUnicode( &LabelName,
1353  &OemName );
1354 
1355  if (!NT_SUCCESS(Status)) {
1356  _SEH2_LEAVE;
1357  }
1358 
1359  Vpb->VolumeLabelLength = LabelName.Length;
1360  }
1361 
1362 #if DISABLED
1363  Vpb->SerialNumber = ((ULONG*)RfsdSb->s_uuid)[0] + ((ULONG*)RfsdSb->s_uuid)[1] +
1364  ((ULONG*)RfsdSb->s_uuid)[2] + ((ULONG*)RfsdSb->s_uuid)[3];
1365 #endif
1366 
1367  Vcb->StreamObj = IoCreateStreamFileObject( NULL, Vcb->Vpb->RealDevice);
1368 
1369  if (Vcb->StreamObj) {
1370 
1371  Vcb->StreamObj->SectionObjectPointer = &(Vcb->SectionObject);
1372  Vcb->StreamObj->Vpb = Vcb->Vpb;
1373  Vcb->StreamObj->ReadAccess = TRUE;
1374  if (IsFlagOn(Vcb->Flags, VCB_READ_ONLY))
1375  {
1376  Vcb->StreamObj->WriteAccess = FALSE;
1377  Vcb->StreamObj->DeleteAccess = FALSE;
1378  }
1379  else
1380  {
1381  Vcb->StreamObj->WriteAccess = TRUE;
1382  Vcb->StreamObj->DeleteAccess = TRUE;
1383  }
1384  Vcb->StreamObj->FsContext = (PVOID) Vcb;
1385  Vcb->StreamObj->FsContext2 = NULL;
1386  Vcb->StreamObj->Vpb = Vcb->Vpb;
1387 
1388  SetFlag(Vcb->StreamObj->Flags, FO_NO_INTERMEDIATE_BUFFERING);
1389  } else {
1390  _SEH2_LEAVE;
1391  }
1392 
1393  InitializeListHead(&Vcb->FcbList);
1394 
1395  InitializeListHead(&Vcb->NotifyList);
1396 
1397  FsRtlNotifyInitializeSync(&Vcb->NotifySync);
1398 
1399  NotifySyncInitialized = TRUE;
1400 
1401  Vcb->DeviceObject = VolumeDevice;
1402 
1403  Vcb->TargetDeviceObject = TargetDevice;
1404 
1405  Vcb->OpenFileHandleCount = 0;
1406 
1407  Vcb->ReferenceCount = 0;
1408 
1409  Vcb->SuperBlock = RfsdSb;
1410 
1411  Vcb->Header.NodeTypeCode = (USHORT) RFSDVCB;
1412  Vcb->Header.NodeByteSize = sizeof(RFSD_VCB);
1413  Vcb->Header.IsFastIoPossible = FastIoIsNotPossible;
1414  Vcb->Header.Resource = &(Vcb->MainResource);
1415  Vcb->Header.PagingIoResource = &(Vcb->PagingIoResource);
1416 
1417  Vcb->Vpb->SerialNumber = 'MATT';
1418 
1419  DiskSize =
1420  Vcb->DiskGeometry.Cylinders.QuadPart *
1421  Vcb->DiskGeometry.TracksPerCylinder *
1422  Vcb->DiskGeometry.SectorsPerTrack *
1423  Vcb->DiskGeometry.BytesPerSector;
1424 
1425  IoctlSize = sizeof(PARTITION_INFORMATION);
1426 
1428  TargetDevice,
1430  NULL,
1431  0,
1432  &Vcb->PartitionInformation,
1433  &IoctlSize );
1434 
1435  PartSize = Vcb->PartitionInformation.PartitionLength.QuadPart;
1436 
1437  if (!NT_SUCCESS(Status)) {
1438  Vcb->PartitionInformation.StartingOffset.QuadPart = 0;
1439 
1440  Vcb->PartitionInformation.PartitionLength.QuadPart =
1441  DiskSize;
1442 
1443  PartSize = DiskSize;
1444 
1446  }
1447 
1448  IoctlSize = sizeof(ULONG);
1450  TargetDevice,
1452  NULL,
1453  0,
1454  &ChangeCount,
1455  &IoctlSize );
1456 
1457  if (!NT_SUCCESS(Status)) {
1458  _SEH2_LEAVE;
1459  }
1460 
1461  Vcb->ChangeCount = ChangeCount;
1462 
1463  Vcb->Header.AllocationSize.QuadPart =
1464  Vcb->Header.FileSize.QuadPart = PartSize;
1465 
1466  Vcb->Header.ValidDataLength.QuadPart =
1467  (LONGLONG)(0x7fffffffffffffff);
1468 /*
1469  Vcb->Header.AllocationSize.QuadPart = (LONGLONG)(rfsd_super_block->s_blocks_count - rfsd_super_block->s_free_blocks_count)
1470  * (RFSD_MIN_BLOCK << rfsd_super_block->s_log_block_size);
1471  Vcb->Header.FileSize.QuadPart = Vcb->Header.AllocationSize.QuadPart;
1472  Vcb->Header.ValidDataLength.QuadPart = Vcb->Header.AllocationSize.QuadPart;
1473 */
1474  {
1476 
1479  Vcb->Header.AllocationSize.QuadPart;
1480 
1481  FileSizes.ValidDataLength.QuadPart= (LONGLONG)(0x7fffffffffffffff);
1482 
1483  CcInitializeCacheMap( Vcb->StreamObj,
1484  &FileSizes,
1485  TRUE,
1487  Vcb );
1488  }
1489 #if DISABLED // IN FFFS TOO
1490  if (!RfsdLoadGroup(Vcb)) {
1492  _SEH2_LEAVE;
1493  }
1494 #endif
1495 
1496  FsRtlInitializeLargeMcb(&(Vcb->DirtyMcbs), PagedPool);
1497  InitializeListHead(&(Vcb->McbList));
1498 
1499 
1500  //
1501  // Now allocating the mcb for root ...
1502  //
1503 
1504  Buffer[0] = L'\\';
1505  Buffer[1] = 0;
1506 
1507  RootNode.Buffer = Buffer;
1508  RootNode.MaximumLength = RootNode.Length = 2;
1509 
1510  Vcb->McbTree = RfsdAllocateMcb( Vcb, &RootNode,
1512 
1513  if (!Vcb->McbTree) {
1514  _SEH2_LEAVE;
1515  }
1516 
1517  // Set the root of the filesystem to the root directory's inode / stat data structure
1518  Vcb->McbTree->Key.k_dir_id = RFSD_ROOT_PARENT_ID;
1519  Vcb->McbTree->Key.k_objectid = RFSD_ROOT_OBJECT_ID;
1520  Vcb->McbTree->Key.k_offset = 0;
1521  Vcb->McbTree->Key.k_type = RFSD_KEY_TYPE_v1_STAT_DATA;
1522 
1523 #ifdef DISABLED
1525  RfsdCheckBitmapConsistency(IrpContext, Vcb);
1526  }
1527 
1528  {
1529  ULONG dwData[RFSD_BLOCK_TYPES] = {RFSD_NDIR_BLOCKS, 1, 1, 1};
1530  ULONG dwMeta[RFSD_BLOCK_TYPES] = {0, 0, 0, 0};
1531  ULONG i;
1532 
1533  KdPrint(("Reminder: " __FUNCTION__ ", dwData, dwMeta??\n"));
1534 
1535  for (i = 0; i < RFSD_BLOCK_TYPES; i++) {
1536  dwData[i] = dwData[i] << ((BLOCK_BITS - 2) * i);
1537 
1538  if (i > 0) {
1539  dwMeta[i] = 1 + (dwMeta[i - 1] << (BLOCK_BITS - 2));
1540  }
1541 
1542  Vcb->dwData[i] = dwData[i];
1543  Vcb->dwMeta[i] = dwMeta[i];
1544  }
1545  }
1546 #endif
1547 
1548  SetFlag(Vcb->Flags, VCB_INITIALIZED);
1549 
1550  } _SEH2_FINALLY {
1551 
1552  if (!NT_SUCCESS(Status)) {
1553 
1554  if (NotifySyncInitialized) {
1555  FsRtlNotifyUninitializeSync(&Vcb->NotifySync);
1556  }
1557 
1558  if (Vcb->GroupDesc) {
1559  ExFreePool(Vcb->GroupDesc);
1560  // CcUnpinData(Vcb->GroupDescBcb);
1561  Vcb->GroupDesc = NULL;
1562  }
1563 
1564  if (Vcb->SuperBlock) {
1565  ExFreePool(Vcb->SuperBlock);
1566  Vcb->SuperBlock = NULL;
1567  }
1568 
1569  if (VcbResourceInitialized) {
1570  ExDeleteResourceLite(&Vcb->MainResource);
1571  ExDeleteResourceLite(&Vcb->PagingIoResource);
1572  }
1573  }
1574  } _SEH2_END;
1575 
1576  return Status;
1577 }
#define RFSD_ROOT_OBJECT_ID
Definition: rfsd.h:51
NTSTATUS RfsdDiskIoControl(IN PDEVICE_OBJECT DeviceOjbect, IN ULONG IoctlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer, IN OUT PULONG OutputBufferSize)
Definition: blockio.c:492
#define RFSD_CHECKING_BITMAP
Definition: rfsd.h:450
#define TRUE
Definition: types.h:120
USHORT MaximumLength
Definition: env_spec_w32.h:370
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:688
NTSYSAPI UINT WINAPI RtlOemStringToUnicodeSize(const STRING *)
LONG NTSTATUS
Definition: precomp.h:26
#define IOCTL_DISK_CHECK_VERIFY
Definition: cdrw_usr.h:175
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
static HANDLE ULONG_PTR dwData
Definition: file.c:35
static CC_FILE_SIZES FileSizes
#define FO_NO_INTERMEDIATE_BUFFERING
Definition: iotypes.h:1737
STRING OEM_STRING
Definition: umtypes.h:203
struct _PARTITION_INFORMATION PARTITION_INFORMATION
Definition: rfsd.h:323
LARGE_INTEGER FileSize
Definition: cctypes.h:16
#define VCB_REMOVABLE_MEDIA
Definition: ext2fs.h:799
_SEH2_TRY
Definition: create.c:4226
#define RFSD_KEY_TYPE_v1_STAT_DATA
Definition: reiserfs.h:277
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RFSD_ROOT_PARENT_ID
Definition: rfsd.h:50
#define FILE_REMOVABLE_MEDIA
Definition: nt_native.h:807
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
VOID NTAPI FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb, IN POOL_TYPE PoolType)
Definition: largemcb.c:450
unsigned char BOOLEAN
#define BLOCK_BITS
Definition: stream.h:22
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
struct _RFSD_VCB RFSD_VCB
void * PVOID
Definition: retypes.h:9
PFILE_OBJECT NTAPI IoCreateStreamFileObject(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: file.c:3186
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
int64_t LONGLONG
Definition: typedefs.h:67
ULONG Flags
Definition: rfsd.h:431
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
Definition: fssup.c:195
#define Vcb
Definition: cdprocs.h:1415
BOOLEAN RfsdLoadGroup(IN PRFSD_VCB Vcb)
#define RFSD_BLOCK_TYPES
Definition: rfsd.h:105
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
CACHE_MANAGER_CALLBACKS CacheManagerNoOpCallbacks
Definition: rfsd.h:401
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define IOCTL_DISK_GET_PARTITION_INFO
Definition: ntdddisk.h:88
static const WCHAR L[]
Definition: oid.c:1250
#define RfsdPrint(arg)
Definition: rfsd.h:1069
LARGE_INTEGER ValidDataLength
Definition: cctypes.h:17
#define DBG_ERROR
Definition: ffsdrv.h:1031
#define VCB_READ_ONLY
Definition: ext2fs.h:795
BOOLEAN RfsdCheckBitmapConsistency(PRFSD_IRP_CONTEXT IrpContext, PRFSD_VCB Vcb)
Definition: memory.c:1208
Status
Definition: gdiplustypes.h:24
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
_SEH2_END
Definition: create.c:4400
#define VCB_FLOPPY_DISK
Definition: ext2fs.h:797
LARGE_INTEGER AllocationSize
Definition: cctypes.h:15
unsigned short USHORT
Definition: pedump.c:61
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
_SEH2_FINALLY
Definition: create.c:4371
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17
NTSTATUS RfsdOEMToUnicode(IN OUT PUNICODE_STRING Oem, IN POEM_STRING Unicode)
Definition: misc.c:195
VOID NTAPI FsRtlNotifyInitializeSync(IN PNOTIFY_SYNC *NotifySync)
Definition: notify.c:1561
__drv_mustHoldCriticalRegion PRFSD_MCB RfsdAllocateMcb(PRFSD_VCB Vcb, PUNICODE_STRING FileName, ULONG FileAttr)
Definition: memory.c:694
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID NTAPI FsRtlNotifyUninitializeSync(IN PNOTIFY_SYNC *NotifySync)
Definition: notify.c:1639
#define VCB_INITIALIZED
Definition: ext2fs.h:779
#define _SEH2_LEAVE
Definition: filesup.c:20
IN PDCB IN POEM_STRING OemName
Definition: fatprocs.h:1303
#define FILE_FLOPPY_DISKETTE
Definition: nt_native.h:809
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define __FUNCTION__
Definition: types.h:112
#define KdPrint(x)
Definition: env_spec_w32.h:288
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1673
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
LONGLONG QuadPart
Definition: typedefs.h:113
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define PAGED_CODE()

◆ RfsdInsertVcb()

VOID RfsdInsertVcb ( PRFSD_VCB  Vcb)

Definition at line 1238 of file memory.c.

1239 {
1240  InsertTailList(&(RfsdGlobal->VcbList), &Vcb->Next);
1241 }
LIST_ENTRY VcbList
Definition: rfsd.h:410
#define InsertTailList(ListHead, Entry)
#define Vcb
Definition: cdprocs.h:1415
PRFSD_GLOBAL RfsdGlobal
Definition: init.c:17

Referenced by RfsdMountVolume().

◆ RfsdRefreshMcb()

VOID RfsdRefreshMcb ( PRFSD_VCB  Vcb,
PRFSD_MCB  Mcb 
)

Definition at line 1012 of file memory.c.

1013 {
1014  PAGED_CODE();
1015 
1016  ASSERT (IsFlagOn(Mcb->Flags, MCB_IN_TREE));
1017 
1018  RemoveEntryList(&(Mcb->Link));
1019  InsertTailList(&(Vcb->McbList), &(Mcb->Link));
1020 }
#define InsertTailList(ListHead, Entry)
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
#define Vcb
Definition: cdprocs.h:1415
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define MCB_IN_TREE
Definition: ffsdrv.h:679
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:343
#define PAGED_CODE()

Referenced by RfsdSearchMcb(), and RfsdSearchMcbTree().

◆ RfsdRemoveVcb()

VOID RfsdRemoveVcb ( PRFSD_VCB  Vcb)

Definition at line 1244 of file memory.c.

1245 {
1246  RemoveEntryList(&Vcb->Next);
1247 }
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define Vcb
Definition: cdprocs.h:1415

Referenced by RfsdCheckDismount(), and RfsdClose().

◆ RfsdRepinBcb()

VOID RfsdRepinBcb ( IN PRFSD_IRP_CONTEXT  IrpContext,
IN PBCB  Bcb 
)

Definition at line 232 of file memory.c.

236 {
237  PRFSD_REPINNED_BCBS Repinned;
238 
239  Repinned = &IrpContext->Repinned;
240 
241  return;
242 
243 #if 0
244 
245  ULONG i;
246 
247  while (Repinned) {
248 
249  for (i = 0; i < RFSD_REPINNED_BCBS_ARRAY_SIZE; i += 1) {
250  if (Repinned->Bcb[i] == Bcb) {
251  return;
252  }
253  }
254 
255  Repinned = Repinned->Next;
256  }
257 
258  while (TRUE) {
259 
260  for (i = 0; i < RFSD_REPINNED_BCBS_ARRAY_SIZE; i += 1) {
261  if (Repinned->Bcb[i] == Bcb) {
262  return;
263  }
264 
265  if (Repinned->Bcb[i] == NULL) {
266  Repinned->Bcb[i] = Bcb;
267  CcRepinBcb( Bcb );
268 
269  return;
270  }
271  }
272 
273  if (Repinned->Next == NULL) {
275  RtlZeroMemory( Repinned->Next, sizeof(RFSD_REPINNED_BCBS) );
276  }
277 
278  Repinned = Repinned->Next;
279  }
280 
281 #endif
282 
283 }
PBCB Bcb[RFSD_REPINNED_BCBS_ARRAY_SIZE]
Definition: rfsd.h:369
#define TRUE
Definition: types.h:120
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define RFSD_POOL_TAG
Definition: rfsd.h:99
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
struct _RFSD_REPINNED_BCBS * Next
Definition: rfsd.h:360
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
VOID NTAPI CcRepinBcb(IN PVOID Bcb)
Definition: cachesub.c:331
#define RFSD_REPINNED_BCBS_ARRAY_SIZE
Definition: rfsd.h:352

Referenced by RfsdCheckSetBlock().

◆ RfsdSearchMcb()

PRFSD_MCB RfsdSearchMcb ( PRFSD_VCB  Vcb,
PRFSD_MCB  Parent,
PUNICODE_STRING  FileName 
)

Returns NULL is the parent has no child, or if we search through the child's brothers and hit a NULL Otherwise, returns the MCB of one of the the parent's children, which matches FileName.

Definition at line 987 of file memory.c.

990 {
991  PRFSD_MCB TmpMcb = Parent->Child;
992 
993  PAGED_CODE();
994 
995  while (TmpMcb) {
997  &(TmpMcb->ShortName),
998  FileName, TRUE ))
999  break;
1000 
1001  TmpMcb = TmpMcb->Next;
1002  }
1003 
1004  if (TmpMcb) {
1005  RfsdRefreshMcb(Vcb, TmpMcb);
1006  }
1007 
1008  return TmpMcb;
1009 }
#define TRUE
Definition: types.h:120
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:728
PRFSD_MCB Next
Definition: rfsd.h:686
#define Vcb
Definition: cdprocs.h:1415
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
UNICODE_STRING ShortName
Definition: rfsd.h:694
VOID RfsdRefreshMcb(PRFSD_VCB Vcb, PRFSD_MCB Mcb)
Definition: memory.c:1012
#define PAGED_CODE()

Referenced by RfsdLookupFileName().

◆ RfsdSearchMcbTree()

PRFSD_MCB RfsdSearchMcbTree ( PRFSD_VCB  Vcb,
PRFSD_MCB  RfsdMcb,
PRFSD_KEY_IN_MEMORY  Key 
)

Definition at line 950 of file memory.c.

953 {
954  PRFSD_MCB Mcb = NULL;
956  BOOLEAN bFind = FALSE;
957 
958  PAGED_CODE();
959 
960  List = Vcb->McbList.Flink;
961 
962  while ((!bFind) && (List != &(Vcb->McbList))) {
964  List = List->Flink;
965 
966  if (CompareShortKeys(&(Mcb->Key), Key) == RFSD_KEYS_MATCH) {
967  bFind = TRUE;
968  break;
969  }
970  }
971 
972  if (bFind) {
973  ASSERT(Mcb != NULL);
975  } else {
976  Mcb = NULL;
977  }
978 
979  return Mcb;
980 }
#define TRUE
Definition: types.h:120
static int Link(const char **args)
Definition: vfdcmd.c:2414
RFSD_KEY_COMPARISON CompareShortKeys(IN PRFSD_KEY_IN_MEMORY a, IN PRFSD_KEY_IN_MEMORY b)
Definition: rfsd.c:2811
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
LIST_ENTRY List
Definition: psmgr.c:57
#define RFSD_KEYS_MATCH
Definition: rfsd.h:63
#define Vcb
Definition: cdprocs.h:1415
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Definition: typedefs.h:118
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:343
VOID RfsdRefreshMcb(PRFSD_VCB Vcb, PRFSD_MCB Mcb)
Definition: memory.c:1012
#define PAGED_CODE()

◆ RfsdSyncUninitializeCacheMap()

VOID RfsdSyncUninitializeCacheMap ( IN PFILE_OBJECT  FileObject)

Definition at line 1650 of file memory.c.

1653 {
1654  CACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent;
1655  NTSTATUS WaitStatus;
1656  LARGE_INTEGER RfsdLargeZero = {0,0};
1657 
1658  PAGED_CODE();
1659 
1660  KeInitializeEvent( &UninitializeCompleteEvent.Event,
1662  FALSE);
1663 
1665  &RfsdLargeZero,
1666  &UninitializeCompleteEvent );
1667 
1668  WaitStatus = KeWaitForSingleObject( &UninitializeCompleteEvent.Event,
1669  Executive,
1670  KernelMode,
1671  FALSE,
1672  NULL);
1673 
1674  ASSERT (NT_SUCCESS(WaitStatus));
1675 }
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:588
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:286
#define PAGED_CODE()

Referenced by RfsdFreeVcb().

◆ RfsdUnpinRepinnedBcbs()

VOID RfsdUnpinRepinnedBcbs ( IN PRFSD_IRP_CONTEXT  IrpContext)

Definition at line 286 of file memory.c.

289 {
290  IO_STATUS_BLOCK RaiseIosb;
291  PRFSD_REPINNED_BCBS Repinned;
292  BOOLEAN WriteThroughToDisk;
294  BOOLEAN ForceVerify = FALSE;
295  ULONG i;
296 
297  Repinned = &IrpContext->Repinned;
298  RaiseIosb.Status = STATUS_SUCCESS;
299 
300  WriteThroughToDisk = (BOOLEAN) (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WRITE_THROUGH) ||
301  IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_FLOPPY));
302 
303  while (Repinned != NULL) {
304  for (i = 0; i < RFSD_REPINNED_BCBS_ARRAY_SIZE; i += 1) {
305  if (Repinned->Bcb[i] != NULL) {
307 
309 
310  if ( FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_FLOPPY) ) {
311  FileObject = CcGetFileObjectFromBcb( Repinned->Bcb[i] );
312  }
313 
315 
316  CcUnpinRepinnedBcb( Repinned->Bcb[i],
317  WriteThroughToDisk,
318  &Iosb );
319 
321 
322  if ( !NT_SUCCESS(Iosb.Status) ) {
323  if (RaiseIosb.Status == STATUS_SUCCESS) {
324  RaiseIosb = Iosb;
325  }
326 
327  if (FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_FLOPPY) &&
328  (IrpContext->MajorFunction != IRP_MJ_CLEANUP) &&
329  (IrpContext->MajorFunction != IRP_MJ_FLUSH_BUFFERS) &&
330  (IrpContext->MajorFunction != IRP_MJ_SET_INFORMATION)) {
331 
332  CcPurgeCacheSection( FileObject->SectionObjectPointer,
333  NULL,
334  0,
335  FALSE );
336 
337  ForceVerify = TRUE;
338  }
339  }
340 
341  Repinned->Bcb[i] = NULL;
342 
343  } else {
344 
345  break;
346  }
347  }
348 
349  if (Repinned != &IrpContext->Repinned)
350 {
351  PRFSD_REPINNED_BCBS Saved;
352 
353  Saved = Repinned->Next;
354  ExFreePool( Repinned );
355  Repinned = Saved;
356 
357  } else {
358 
359  Repinned = Repinned->Next;
360  IrpContext->Repinned.Next = NULL;
361  }
362  }
363 
364  if (!NT_SUCCESS(RaiseIosb.Status)) {
365 
366  DbgBreak();
367 
368  if (ForceVerify && FileObject) {
369  SetFlag(FileObject->DeviceObject->Flags, DO_VERIFY_VOLUME);
370  IoSetHardErrorOrVerifyDevice( IrpContext->Irp,
371  FileObject->DeviceObject );
372  }
373 
374  IrpContext->Irp->IoStatus = RaiseIosb;
375  RfsdNormalizeAndRaiseStatus(IrpContext, RaiseIosb.Status );
376  }
377 
378  return;
379 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
PBCB Bcb[RFSD_REPINNED_BCBS_ARRAY_SIZE]
Definition: rfsd.h:369
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
Definition: fssup.c:386
#define TRUE
Definition: types.h:120
#define IRP_MJ_FLUSH_BUFFERS
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
Definition: ext2fs.h:1079
#define DO_VERIFY_VOLUME
Definition: env_spec_w32.h:393
PFILE_OBJECT NTAPI CcGetFileObjectFromBcb(PVOID Bcb)
Definition: fssup.c:625
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:588
VOID NTAPI CcUnpinRepinnedBcb(IN PVOID Bcb, IN BOOLEAN WriteThrough, OUT PIO_STATUS_BLOCK IoStatus)
Definition: cachesub.c:343
return Iosb
Definition: create.c:4402
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
* PFILE_OBJECT
Definition: iotypes.h:1957
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define IRP_CONTEXT_FLAG_FLOPPY
Definition: ext2fs.h:1080
#define IRP_MJ_CLEANUP
struct _RFSD_REPINNED_BCBS * Next
Definition: rfsd.h:360
#define BOOLEAN
Definition: pedump.c:73
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
unsigned int ULONG
Definition: retypes.h:1
#define DbgBreak()
Definition: ext2fs.h:46
VOID NTAPI IoSetHardErrorOrVerifyDevice(IN PIRP Irp, IN PDEVICE_OBJECT DeviceObject)
Definition: util.c:316
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define RFSD_REPINNED_BCBS_ARRAY_SIZE
Definition: rfsd.h:352
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define RfsdNormalizeAndRaiseStatus(IRPCONTEXT, STATUS)
Definition: rfsd.h:182

Referenced by RfsdCreate(), and RfsdFreeIrpContext().

Variable Documentation

◆ RfsdGlobal