- Convert the function headers to a Doxygen-compatible style

- Fix some typos

svn path=/trunk/; revision=39050
This commit is contained in:
Colin Finck 2009-01-23 19:36:35 +00:00
parent 07814326c7
commit 16c99f33f3
3 changed files with 79 additions and 57 deletions

View file

@ -22,7 +22,7 @@ typedef struct _FAT_ENUM_DIR_CONTEXT
{ {
PFILE_OBJECT FileObject; PFILE_OBJECT FileObject;
LARGE_INTEGER PageOffset; LARGE_INTEGER PageOffset;
LONGLONG BeyoundLastEntryOffset; LONGLONG BeyondLastEntryOffset;
PVOID PageBuffer; PVOID PageBuffer;
PBCB PageBcb; PBCB PageBcb;
@ -512,9 +512,9 @@ FatEnumerateDirents(IN OUT PFAT_ENUM_DIR_CONTEXT Context,
Entry = Add2Ptr(Context->PageBuffer, OffsetWithinPage, PUCHAR); Entry = Add2Ptr(Context->PageBuffer, OffsetWithinPage, PUCHAR);
/* Next Page Offset */ /* Next Page Offset */
PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE; PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE;
if (PageOffset > Context->BeyoundLastEntryOffset) if (PageOffset > Context->BeyondLastEntryOffset)
{ {
PageValidLength = (SIZE_T) (Context->BeyoundLastEntryOffset PageValidLength = (SIZE_T) (Context->BeyondLastEntryOffset
- Context->PageOffset.QuadPart); - Context->PageOffset.QuadPart);
} }
BeyondLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PUCHAR); BeyondLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PUCHAR);
@ -545,7 +545,7 @@ FatEnumerateDirents(IN OUT PFAT_ENUM_DIR_CONTEXT Context,
/* Check if this is the last available entry */ /* Check if this is the last available entry */
if (PageValidLength < PAGE_SIZE) if (PageValidLength < PAGE_SIZE)
break; break;
/* We are getting beyound current page and /* We are getting beyond current page and
* are still in the continous run, map the next page. * are still in the continous run, map the next page.
*/ */
Context->PageOffset.QuadPart = PageOffset; Context->PageOffset.QuadPart = PageOffset;
@ -564,9 +564,9 @@ FatEnumerateDirents(IN OUT PFAT_ENUM_DIR_CONTEXT Context,
Entry = (PUCHAR) Context->PageBuffer; Entry = (PUCHAR) Context->PageBuffer;
/* Next Page Offset */ /* Next Page Offset */
PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE; PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE;
if (PageOffset > Context->BeyoundLastEntryOffset) if (PageOffset > Context->BeyondLastEntryOffset)
{ {
PageValidLength = (SIZE_T) (Context->BeyoundLastEntryOffset PageValidLength = (SIZE_T) (Context->BeyondLastEntryOffset
- Context->PageOffset.QuadPart); - Context->PageOffset.QuadPart);
} }
BeyondLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PUCHAR); BeyondLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PUCHAR);

View file

@ -16,7 +16,7 @@ typedef struct _FAT_SCAN_CONTEXT
{ {
PFILE_OBJECT FileObject; PFILE_OBJECT FileObject;
LARGE_INTEGER PageOffset; LARGE_INTEGER PageOffset;
LONGLONG BeyoundLastEntryOffset; LONGLONG BeyondLastEntryOffset;
PVOID PageBuffer; PVOID PageBuffer;
PBCB PageBcb; PBCB PageBcb;
} FAT_SCAN_CONTEXT; } FAT_SCAN_CONTEXT;
@ -127,12 +127,14 @@ FAT_METHODS Fat32Methods = {
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
/* /**
* FUNCTION:
* Determines the index of the set bit. * Determines the index of the set bit.
* ARGUMENTS: *
* Number = Number having a single bit set. * @param Number
* RETURNS: Index of the set bit. * Number having a single bit set.
*
* @return
* Index of the set bit.
*/ */
FORCEINLINE FORCEINLINE
ULONG ULONG
@ -218,17 +220,25 @@ FatSetFat16ValueRun(IN OUT PFAT_SCAN_CONTEXT Context,
ExRaiseStatus(STATUS_NOT_IMPLEMENTED); ExRaiseStatus(STATUS_NOT_IMPLEMENTED);
} }
/* /**
* FUNCTION:
* Scans FAT32 for continous chain of clusters * Scans FAT32 for continous chain of clusters
* ARGUMENTS: *
* Context = Pointer to FAT_SCAN_CONTEXT. * @param Context
* Index = Supplies the Index of the first cluster * Pointer to FAT_SCAN_CONTEXT.
*
* @param Index
* Supplies the Index of the first cluster
* and receves the last index after the last * and receves the last index after the last
* cluster in the chain. * cluster in the chain.
* CanWait = Indicates if the context allows blocking. *
* RETURNS: Value of the last claster terminated the scan. * @param CanWait
* NOTES: Raises STATUS_CANT_WAIT race condition. * Indicates if the context allows blocking.
*
* @return
* Value of the last claster terminated the scan.
*
* @note
* Raises STATUS_CANT_WAIT race condition.
*/ */
ULONG ULONG
FatScanFat32ForContinousRun(IN OUT PFAT_SCAN_CONTEXT Context, FatScanFat32ForContinousRun(IN OUT PFAT_SCAN_CONTEXT Context,
@ -270,8 +280,8 @@ FatScanFat32ForContinousRun(IN OUT PFAT_SCAN_CONTEXT Context,
Entry = Add2Ptr(Context->PageBuffer, OffsetWithinPage, PULONG); Entry = Add2Ptr(Context->PageBuffer, OffsetWithinPage, PULONG);
/* Next Page Offset */ /* Next Page Offset */
PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE; PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE;
if (PageOffset > Context->BeyoundLastEntryOffset) if (PageOffset > Context->BeyondLastEntryOffset)
PageValidLength = (SIZE_T) (Context->BeyoundLastEntryOffset PageValidLength = (SIZE_T) (Context->BeyondLastEntryOffset
- Context->PageOffset.QuadPart); - Context->PageOffset.QuadPart);
BeyoudLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PULONG); BeyoudLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PULONG);
while (TRUE) while (TRUE)
@ -284,7 +294,7 @@ FatScanFat32ForContinousRun(IN OUT PFAT_SCAN_CONTEXT Context,
/* Check if this is the last available entry */ /* Check if this is the last available entry */
if (PageValidLength < PAGE_SIZE) if (PageValidLength < PAGE_SIZE)
break; break;
/* We are getting beyound current page and /* We are getting beyond current page and
* are still in the continous run, map the next page. * are still in the continous run, map the next page.
*/ */
Context->PageOffset.QuadPart = PageOffset; Context->PageOffset.QuadPart = PageOffset;
@ -300,8 +310,8 @@ FatScanFat32ForContinousRun(IN OUT PFAT_SCAN_CONTEXT Context,
Entry = (PULONG) Context->PageBuffer; Entry = (PULONG) Context->PageBuffer;
/* Next Page Offset */ /* Next Page Offset */
PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE; PageOffset = Context->PageOffset.QuadPart + PAGE_SIZE;
if (PageOffset > Context->BeyoundLastEntryOffset) if (PageOffset > Context->BeyondLastEntryOffset)
PageValidLength = (SIZE_T) (Context->BeyoundLastEntryOffset PageValidLength = (SIZE_T) (Context->BeyondLastEntryOffset
- Context->PageOffset.QuadPart); - Context->PageOffset.QuadPart);
BeyoudLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PULONG); BeyoudLastEntry = Add2Ptr(Context->PageBuffer, PageValidLength, PULONG);
} }
@ -336,24 +346,36 @@ FatSetFat32ValueRun(IN OUT PFAT_SCAN_CONTEXT Context,
ExRaiseStatus(STATUS_NOT_IMPLEMENTED); ExRaiseStatus(STATUS_NOT_IMPLEMENTED);
} }
/* /**
* FUNCTION:
* Queries file MCB for the specified region [Vbo, Vbo + Length], * Queries file MCB for the specified region [Vbo, Vbo + Length],
* returns the number of runs in the region as well as the first * returns the number of runs in the region as well as the first
* run of the range itself. * run of the range itself.
* If the specified region is not fully cached in MCB the routine * If the specified region is not fully cached in MCB the routine
* scans FAT for the file and fills the MCB until the file offset * scans FAT for the file and fills the MCB until the file offset
* (defined as Vbo + Length) is reached. * (defined as Vbo + Length) is reached.
* ARGUMENTS: *
* Fcb = Pointer to FCB structure for the file. * @param Fcb
* Vbo = Virtual Byte Offset in the file. * Pointer to FCB structure for the file.
* Lbo = Receives the Value of Logical Byte offset corresponding *
* @param Vbo
* Virtual Byte Offset in the file.
*
* @param Lbo
* Receives the Value of Logical Byte offset corresponding
* to supplied Vbo Value. * to supplied Vbo Value.
* Length = Supplies file range length to be examined and recieves *
* @param Length
* Supplies file range length to be examined and receives
* the length of first run. * the length of first run.
* OutIndex = Recieves the index (in MCB cache) of first run. *
* RETURNS: Incremented index of the last run (+1). * @param OutIndex
* NOTES: Should be called by I/O routines to split the I/O operation * Receives the index (in MCB cache) of first run.
*
* @return
* Incremented index of the last run (+1).
*
* @note
* Should be called by I/O routines to split the I/O operation
* into sequential or parallel I/O operations. * into sequential or parallel I/O operations.
*/ */
ULONG ULONG
@ -364,7 +386,7 @@ FatScanFat(IN PFCB Fcb,
OUT PULONG Index, OUT PULONG Index,
IN BOOLEAN CanWait) IN BOOLEAN CanWait)
{ {
LONGLONG CurrentLbo, CurrentVbo, BeyoundLastVbo, CurrentLength; LONGLONG CurrentLbo, CurrentVbo, BeyondLastVbo, CurrentLength;
ULONG Entry, NextEntry, NumberOfEntries, CurrentIndex; ULONG Entry, NextEntry, NumberOfEntries, CurrentIndex;
FAT_SCAN_CONTEXT Context; FAT_SCAN_CONTEXT Context;
PVCB Vcb; PVCB Vcb;
@ -372,15 +394,15 @@ FatScanFat(IN PFCB Fcb,
/* Some often used values */ /* Some often used values */
Vcb = Fcb->Vcb; Vcb = Fcb->Vcb;
CurrentIndex = 0; CurrentIndex = 0;
BeyoundLastVbo = Vbo + *Length; BeyondLastVbo = Vbo + *Length;
CurrentLength = ((LONGLONG) Vcb->Clusters) << Vcb->BytesPerClusterLog; CurrentLength = ((LONGLONG) Vcb->Clusters) << Vcb->BytesPerClusterLog;
if (BeyoundLastVbo > CurrentLength) if (BeyondLastVbo > CurrentLength)
BeyoundLastVbo = CurrentLength; BeyondLastVbo = CurrentLength;
/* Try to locate first run */ /* Try to locate first run */
if (FsRtlLookupLargeMcbEntry(&Fcb->Mcb, Vbo, Lbo, Length, NULL, NULL, Index)) if (FsRtlLookupLargeMcbEntry(&Fcb->Mcb, Vbo, Lbo, Length, NULL, NULL, Index))
{ {
/* Check if we have a single mapped run */ /* Check if we have a single mapped run */
if (Vbo >= BeyoundLastVbo) if (Vbo >= BeyondLastVbo)
goto FatScanFcbFatExit; goto FatScanFcbFatExit;
} else { } else {
*Length = 0L; *Length = 0L;
@ -401,14 +423,14 @@ FatScanFat(IN PFCB Fcb,
{ {
if (Entry < FAT_CLUSTER_LAST) if (Entry < FAT_CLUSTER_LAST)
ExRaiseStatus(STATUS_FILE_CORRUPT_ERROR); ExRaiseStatus(STATUS_FILE_CORRUPT_ERROR);
BeyoundLastVbo = 0LL; BeyondLastVbo = 0LL;
} }
CurrentIndex = 0L; CurrentIndex = 0L;
CurrentVbo = 0LL; CurrentVbo = 0LL;
} }
RtlZeroMemory(&Context, sizeof(Context)); RtlZeroMemory(&Context, sizeof(Context));
Context.FileObject = Vcb->VolumeFileObject; Context.FileObject = Vcb->VolumeFileObject;
while (CurrentVbo < BeyoundLastVbo) while (CurrentVbo < BeyondLastVbo)
{ {
/* Locate Continous run starting with the current entry */ /* Locate Continous run starting with the current entry */
NumberOfEntries = Entry; NumberOfEntries = Entry;
@ -509,7 +531,7 @@ FatiInitializeVcb(PVCB Vcb)
Vcb->Clusters = ClustersCapacity; Vcb->Clusters = ClustersCapacity;
Vcb->BytesPerCluster = SectorsToBytes(Vcb, Vcb->Bpb.SectorsPerCluster); Vcb->BytesPerCluster = SectorsToBytes(Vcb, Vcb->Bpb.SectorsPerCluster);
Vcb->BytesPerClusterLog = FatPowerOfTwo(Vcb->BytesPerCluster); Vcb->BytesPerClusterLog = FatPowerOfTwo(Vcb->BytesPerCluster);
Vcb->BeyoundLastClusterInFat = ((LONGLONG) Vcb->Clusters) * Vcb->IndexDepth / 0x8; Vcb->BeyondLastClusterInFat = ((LONGLONG) Vcb->Clusters) * Vcb->IndexDepth / 0x8;
} }
NTSTATUS NTSTATUS

View file

@ -107,7 +107,7 @@ typedef struct _VCB
ULONG IndexDepth; ULONG IndexDepth;
ULONG RootDirent; ULONG RootDirent;
ULONG RootDirentSectors; ULONG RootDirentSectors;
LONGLONG BeyoundLastClusterInFat; LONGLONG BeyondLastClusterInFat;
FAT_METHODS Methods; FAT_METHODS Methods;
/* Root Directory Fcb: */ /* Root Directory Fcb: */
struct _FCB *RootFcb; struct _FCB *RootFcb;