- Make other filesystems use the new heap mm routines.

svn path=/trunk/; revision=32112
This commit is contained in:
Aleksey Bragin 2008-02-04 09:37:59 +00:00
parent 73bf020856
commit f971658fb8
3 changed files with 57 additions and 57 deletions

View file

@ -106,7 +106,7 @@ FILE* Ext2OpenFile(PCSTR FileName)
{ {
if (TempExt2FileInfo.FileBlockList != NULL) if (TempExt2FileInfo.FileBlockList != NULL)
{ {
MmFreeMemory(TempExt2FileInfo.FileBlockList); MmHeapFree(TempExt2FileInfo.FileBlockList);
} }
return NULL; return NULL;
@ -148,20 +148,20 @@ FILE* Ext2OpenFile(PCSTR FileName)
if (TempExt2FileInfo.FileBlockList != NULL) if (TempExt2FileInfo.FileBlockList != NULL)
{ {
MmFreeMemory(TempExt2FileInfo.FileBlockList); MmHeapFree(TempExt2FileInfo.FileBlockList);
} }
return Ext2OpenFile(FullPath); return Ext2OpenFile(FullPath);
} }
else else
{ {
FileHandle = MmAllocateMemory(sizeof(EXT2_FILE_INFO)); FileHandle = MmHeapAlloc(sizeof(EXT2_FILE_INFO));
if (FileHandle == NULL) if (FileHandle == NULL)
{ {
if (TempExt2FileInfo.FileBlockList != NULL) if (TempExt2FileInfo.FileBlockList != NULL)
{ {
MmFreeMemory(TempExt2FileInfo.FileBlockList); MmHeapFree(TempExt2FileInfo.FileBlockList);
} }
return NULL; return NULL;
@ -230,11 +230,11 @@ BOOLEAN Ext2LookupFile(PCSTR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer)
// //
if (!Ext2SearchDirectoryBufferForFile(DirectoryBuffer, (ULONG)Ext2GetInodeFileSize(&InodeData), PathPart, &DirectoryEntry)) if (!Ext2SearchDirectoryBufferForFile(DirectoryBuffer, (ULONG)Ext2GetInodeFileSize(&InodeData), PathPart, &DirectoryEntry))
{ {
MmFreeMemory(DirectoryBuffer); MmHeapFree(DirectoryBuffer);
return FALSE; return FALSE;
} }
MmFreeMemory(DirectoryBuffer); MmHeapFree(DirectoryBuffer);
DirectoryInode = DirectoryEntry.inode; DirectoryInode = DirectoryEntry.inode;
} }
@ -581,7 +581,7 @@ BOOLEAN Ext2ReadSuperBlock(VOID)
// //
if (Ext2SuperBlock != NULL) if (Ext2SuperBlock != NULL)
{ {
MmFreeMemory(Ext2SuperBlock); MmHeapFree(Ext2SuperBlock);
Ext2SuperBlock = NULL; Ext2SuperBlock = NULL;
} }
@ -589,7 +589,7 @@ BOOLEAN Ext2ReadSuperBlock(VOID)
// //
// Now allocate the memory to hold the super block // Now allocate the memory to hold the super block
// //
Ext2SuperBlock = (PEXT2_SUPER_BLOCK)MmAllocateMemory(1024); Ext2SuperBlock = (PEXT2_SUPER_BLOCK)MmHeapAlloc(1024);
// //
// Make sure we got the memory // Make sure we got the memory
@ -744,7 +744,7 @@ BOOLEAN Ext2ReadGroupDescriptors(VOID)
// //
if (Ext2GroupDescriptors != NULL) if (Ext2GroupDescriptors != NULL)
{ {
MmFreeMemory(Ext2GroupDescriptors); MmHeapFree(Ext2GroupDescriptors);
Ext2GroupDescriptors = NULL; Ext2GroupDescriptors = NULL;
} }
@ -753,7 +753,7 @@ BOOLEAN Ext2ReadGroupDescriptors(VOID)
// Now allocate the memory to hold the group descriptors // Now allocate the memory to hold the group descriptors
// //
GroupDescBlockCount = ROUND_UP(Ext2GroupCount, Ext2GroupDescPerBlock) / Ext2GroupDescPerBlock; GroupDescBlockCount = ROUND_UP(Ext2GroupCount, Ext2GroupDescPerBlock) / Ext2GroupDescPerBlock;
Ext2GroupDescriptors = (PEXT2_GROUP_DESC)MmAllocateMemory(GroupDescBlockCount * Ext2BlockSizeInBytes); Ext2GroupDescriptors = (PEXT2_GROUP_DESC)MmHeapAlloc(GroupDescBlockCount * Ext2BlockSizeInBytes);
// //
// Make sure we got the memory // Make sure we got the memory
@ -812,14 +812,14 @@ BOOLEAN Ext2ReadDirectory(ULONG Inode, PVOID* DirectoryBuffer, PEXT2_INODE Inode
// //
// Now allocate the memory to hold the group descriptors // Now allocate the memory to hold the group descriptors
// //
*DirectoryBuffer = (PEXT2_DIR_ENTRY)MmAllocateMemory(DirectoryFileInfo.FileSize); *DirectoryBuffer = (PEXT2_DIR_ENTRY)MmHeapAlloc(DirectoryFileInfo.FileSize);
// //
// Make sure we got the memory // Make sure we got the memory
// //
if (*DirectoryBuffer == NULL) if (*DirectoryBuffer == NULL)
{ {
MmFreeMemory(DirectoryFileInfo.FileBlockList); MmHeapFree(DirectoryFileInfo.FileBlockList);
FileSystemError("Out of memory."); FileSystemError("Out of memory.");
return FALSE; return FALSE;
} }
@ -827,13 +827,13 @@ BOOLEAN Ext2ReadDirectory(ULONG Inode, PVOID* DirectoryBuffer, PEXT2_INODE Inode
// Now read the root directory data // Now read the root directory data
if (!Ext2ReadFileBig(&DirectoryFileInfo, DirectoryFileInfo.FileSize, NULL, *DirectoryBuffer)) if (!Ext2ReadFileBig(&DirectoryFileInfo, DirectoryFileInfo.FileSize, NULL, *DirectoryBuffer))
{ {
MmFreeMemory(*DirectoryBuffer); MmHeapFree(*DirectoryBuffer);
*DirectoryBuffer = NULL; *DirectoryBuffer = NULL;
MmFreeMemory(DirectoryFileInfo.FileBlockList); MmHeapFree(DirectoryFileInfo.FileBlockList);
return FALSE; return FALSE;
} }
MmFreeMemory(DirectoryFileInfo.FileBlockList); MmHeapFree(DirectoryFileInfo.FileBlockList);
return TRUE; return TRUE;
} }
@ -1023,7 +1023,7 @@ ULONG* Ext2ReadBlockPointerList(PEXT2_INODE Inode)
BlockCount = (FileSize / Ext2BlockSizeInBytes); BlockCount = (FileSize / Ext2BlockSizeInBytes);
// Allocate the memory for the block list // Allocate the memory for the block list
BlockList = MmAllocateMemory(BlockCount * sizeof(ULONG)); BlockList = MmHeapAlloc(BlockCount * sizeof(ULONG));
if (BlockList == NULL) if (BlockList == NULL)
{ {
return NULL; return NULL;
@ -1044,7 +1044,7 @@ ULONG* Ext2ReadBlockPointerList(PEXT2_INODE Inode)
{ {
if (!Ext2CopyIndirectBlockPointers(BlockList, &CurrentBlockInList, BlockCount, Inode->i_block[EXT3_IND_BLOCK])) if (!Ext2CopyIndirectBlockPointers(BlockList, &CurrentBlockInList, BlockCount, Inode->i_block[EXT3_IND_BLOCK]))
{ {
MmFreeMemory(BlockList); MmHeapFree(BlockList);
return FALSE; return FALSE;
} }
} }
@ -1054,7 +1054,7 @@ ULONG* Ext2ReadBlockPointerList(PEXT2_INODE Inode)
{ {
if (!Ext2CopyDoubleIndirectBlockPointers(BlockList, &CurrentBlockInList, BlockCount, Inode->i_block[EXT3_DIND_BLOCK])) if (!Ext2CopyDoubleIndirectBlockPointers(BlockList, &CurrentBlockInList, BlockCount, Inode->i_block[EXT3_DIND_BLOCK]))
{ {
MmFreeMemory(BlockList); MmHeapFree(BlockList);
return FALSE; return FALSE;
} }
} }
@ -1064,7 +1064,7 @@ ULONG* Ext2ReadBlockPointerList(PEXT2_INODE Inode)
{ {
if (!Ext2CopyTripleIndirectBlockPointers(BlockList, &CurrentBlockInList, BlockCount, Inode->i_block[EXT3_TIND_BLOCK])) if (!Ext2CopyTripleIndirectBlockPointers(BlockList, &CurrentBlockInList, BlockCount, Inode->i_block[EXT3_TIND_BLOCK]))
{ {
MmFreeMemory(BlockList); MmHeapFree(BlockList);
return FALSE; return FALSE;
} }
} }
@ -1118,7 +1118,7 @@ BOOLEAN Ext2CopyDoubleIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBloc
BlockPointersPerBlock = Ext2BlockSizeInBytes / sizeof(ULONG); BlockPointersPerBlock = Ext2BlockSizeInBytes / sizeof(ULONG);
BlockBuffer = (ULONG*)MmAllocateMemory(Ext2BlockSizeInBytes); BlockBuffer = (ULONG*)MmHeapAlloc(Ext2BlockSizeInBytes);
if (BlockBuffer == NULL) if (BlockBuffer == NULL)
{ {
return FALSE; return FALSE;
@ -1126,7 +1126,7 @@ BOOLEAN Ext2CopyDoubleIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBloc
if (!Ext2ReadBlock(DoubleIndirectBlock, BlockBuffer)) if (!Ext2ReadBlock(DoubleIndirectBlock, BlockBuffer))
{ {
MmFreeMemory(BlockBuffer); MmHeapFree(BlockBuffer);
return FALSE; return FALSE;
} }
@ -1134,12 +1134,12 @@ BOOLEAN Ext2CopyDoubleIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBloc
{ {
if (!Ext2CopyIndirectBlockPointers(BlockList, CurrentBlockInList, BlockCount, BlockBuffer[CurrentBlock])) if (!Ext2CopyIndirectBlockPointers(BlockList, CurrentBlockInList, BlockCount, BlockBuffer[CurrentBlock]))
{ {
MmFreeMemory(BlockBuffer); MmHeapFree(BlockBuffer);
return FALSE; return FALSE;
} }
} }
MmFreeMemory(BlockBuffer); MmHeapFree(BlockBuffer);
return TRUE; return TRUE;
} }
@ -1153,7 +1153,7 @@ BOOLEAN Ext2CopyTripleIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBloc
BlockPointersPerBlock = Ext2BlockSizeInBytes / sizeof(ULONG); BlockPointersPerBlock = Ext2BlockSizeInBytes / sizeof(ULONG);
BlockBuffer = (ULONG*)MmAllocateMemory(Ext2BlockSizeInBytes); BlockBuffer = (ULONG*)MmHeapAlloc(Ext2BlockSizeInBytes);
if (BlockBuffer == NULL) if (BlockBuffer == NULL)
{ {
return FALSE; return FALSE;
@ -1161,7 +1161,7 @@ BOOLEAN Ext2CopyTripleIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBloc
if (!Ext2ReadBlock(TripleIndirectBlock, BlockBuffer)) if (!Ext2ReadBlock(TripleIndirectBlock, BlockBuffer))
{ {
MmFreeMemory(BlockBuffer); MmHeapFree(BlockBuffer);
return FALSE; return FALSE;
} }
@ -1169,12 +1169,12 @@ BOOLEAN Ext2CopyTripleIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBloc
{ {
if (!Ext2CopyDoubleIndirectBlockPointers(BlockList, CurrentBlockInList, BlockCount, BlockBuffer[CurrentBlock])) if (!Ext2CopyDoubleIndirectBlockPointers(BlockList, CurrentBlockInList, BlockCount, BlockBuffer[CurrentBlock]))
{ {
MmFreeMemory(BlockBuffer); MmHeapFree(BlockBuffer);
return FALSE; return FALSE;
} }
} }
MmFreeMemory(BlockBuffer); MmHeapFree(BlockBuffer);
return TRUE; return TRUE;
} }

View file

@ -265,7 +265,7 @@ FILE* IsoOpenFile(PCSTR FileName)
return NULL; return NULL;
} }
FileHandle = MmAllocateMemory(sizeof(ISO_FILE_INFO)); FileHandle = MmHeapAlloc(sizeof(ISO_FILE_INFO));
if (FileHandle == NULL) if (FileHandle == NULL)
{ {

View file

@ -89,7 +89,7 @@ static PNTFS_ATTR_CONTEXT NtfsPrepareAttributeContext(PNTFS_ATTR_RECORD AttrReco
{ {
PNTFS_ATTR_CONTEXT Context; PNTFS_ATTR_CONTEXT Context;
Context = MmAllocateMemory(FIELD_OFFSET(NTFS_ATTR_CONTEXT, Record) + AttrRecord->Length); Context = MmHeapAlloc(FIELD_OFFSET(NTFS_ATTR_CONTEXT, Record) + AttrRecord->Length);
RtlCopyMemory(&Context->Record, AttrRecord, AttrRecord->Length); RtlCopyMemory(&Context->Record, AttrRecord, AttrRecord->Length);
if (AttrRecord->IsNonResident) if (AttrRecord->IsNonResident)
{ {
@ -120,7 +120,7 @@ static PNTFS_ATTR_CONTEXT NtfsPrepareAttributeContext(PNTFS_ATTR_RECORD AttrReco
static VOID NtfsReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context) static VOID NtfsReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
{ {
MmFreeMemory(Context); MmHeapFree(Context);
} }
/* FIXME: Optimize for multisector reads. */ /* FIXME: Optimize for multisector reads. */
@ -338,7 +338,7 @@ static PNTFS_ATTR_CONTEXT NtfsFindAttributeHelper(PNTFS_ATTR_RECORD AttrRecord,
ListContext = NtfsPrepareAttributeContext(AttrRecord); ListContext = NtfsPrepareAttributeContext(AttrRecord);
ListSize = NtfsGetAttributeSize(&ListContext->Record); ListSize = NtfsGetAttributeSize(&ListContext->Record);
ListBuffer = MmAllocateMemory(ListSize); ListBuffer = MmHeapAlloc(ListSize);
ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer; ListAttrRecord = (PNTFS_ATTR_RECORD)ListBuffer;
ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize); ListAttrRecordEnd = (PNTFS_ATTR_RECORD)((PCHAR)ListBuffer + ListSize);
@ -349,7 +349,7 @@ static PNTFS_ATTR_CONTEXT NtfsFindAttributeHelper(PNTFS_ATTR_RECORD AttrRecord,
Type, Name, NameLength); Type, Name, NameLength);
NtfsReleaseAttributeContext(ListContext); NtfsReleaseAttributeContext(ListContext);
MmFreeMemory(ListBuffer); MmHeapFree(ListBuffer);
if (Context != NULL) if (Context != NULL)
return Context; return Context;
@ -495,7 +495,7 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
ULONG RecordOffset; ULONG RecordOffset;
ULONG IndexBlockSize; ULONG IndexBlockSize;
MftRecord = MmAllocateMemory(NtfsMftRecordSize); MftRecord = MmHeapAlloc(NtfsMftRecordSize);
if (MftRecord == NULL) if (MftRecord == NULL)
{ {
return FALSE; return FALSE;
@ -508,14 +508,14 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
IndexRootCtx = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_INDEX_ROOT, L"$I30"); IndexRootCtx = NtfsFindAttribute(MftRecord, NTFS_ATTR_TYPE_INDEX_ROOT, L"$I30");
if (IndexRootCtx == NULL) if (IndexRootCtx == NULL)
{ {
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return FALSE; return FALSE;
} }
IndexRecord = MmAllocateMemory(NtfsIndexRecordSize); IndexRecord = MmHeapAlloc(NtfsIndexRecordSize);
if (IndexRecord == NULL) if (IndexRecord == NULL)
{ {
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return FALSE; return FALSE;
} }
@ -534,8 +534,8 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
if (NtfsCompareFileName(FileName, IndexEntry)) if (NtfsCompareFileName(FileName, IndexEntry))
{ {
*OutMFTIndex = IndexEntry->Data.Directory.IndexedFile; *OutMFTIndex = IndexEntry->Data.Directory.IndexedFile;
MmFreeMemory(IndexRecord); MmHeapFree(IndexRecord);
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return TRUE; return TRUE;
} }
IndexEntry = (PNTFS_INDEX_ENTRY)((PCHAR)IndexEntry + IndexEntry->Length); IndexEntry = (PNTFS_INDEX_ENTRY)((PCHAR)IndexEntry + IndexEntry->Length);
@ -551,16 +551,16 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
if (IndexBitmapCtx == NULL) if (IndexBitmapCtx == NULL)
{ {
DbgPrint((DPRINT_FILESYSTEM, "Corrupted filesystem!\n")); DbgPrint((DPRINT_FILESYSTEM, "Corrupted filesystem!\n"));
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return FALSE; return FALSE;
} }
BitmapDataSize = NtfsGetAttributeSize(&IndexBitmapCtx->Record); BitmapDataSize = NtfsGetAttributeSize(&IndexBitmapCtx->Record);
DbgPrint((DPRINT_FILESYSTEM, "BitmapDataSize: %x\n", BitmapDataSize)); DbgPrint((DPRINT_FILESYSTEM, "BitmapDataSize: %x\n", BitmapDataSize));
BitmapData = MmAllocateMemory(BitmapDataSize); BitmapData = MmHeapAlloc(BitmapDataSize);
if (BitmapData == NULL) if (BitmapData == NULL)
{ {
MmFreeMemory(IndexRecord); MmHeapFree(IndexRecord);
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return FALSE; return FALSE;
} }
NtfsReadAttribute(IndexBitmapCtx, 0, BitmapData, BitmapDataSize); NtfsReadAttribute(IndexBitmapCtx, 0, BitmapData, BitmapDataSize);
@ -570,9 +570,9 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
if (IndexAllocationCtx == NULL) if (IndexAllocationCtx == NULL)
{ {
DbgPrint((DPRINT_FILESYSTEM, "Corrupted filesystem!\n")); DbgPrint((DPRINT_FILESYSTEM, "Corrupted filesystem!\n"));
MmFreeMemory(BitmapData); MmHeapFree(BitmapData);
MmFreeMemory(IndexRecord); MmHeapFree(IndexRecord);
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return FALSE; return FALSE;
} }
IndexAllocationSize = NtfsGetAttributeSize(&IndexAllocationCtx->Record); IndexAllocationSize = NtfsGetAttributeSize(&IndexAllocationCtx->Record);
@ -614,9 +614,9 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
{ {
DbgPrint((DPRINT_FILESYSTEM, "File found\n")); DbgPrint((DPRINT_FILESYSTEM, "File found\n"));
*OutMFTIndex = IndexEntry->Data.Directory.IndexedFile; *OutMFTIndex = IndexEntry->Data.Directory.IndexedFile;
MmFreeMemory(BitmapData); MmHeapFree(BitmapData);
MmFreeMemory(IndexRecord); MmHeapFree(IndexRecord);
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
NtfsReleaseAttributeContext(IndexAllocationCtx); NtfsReleaseAttributeContext(IndexAllocationCtx);
return TRUE; return TRUE;
} }
@ -627,16 +627,16 @@ static BOOLEAN NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIn
} }
NtfsReleaseAttributeContext(IndexAllocationCtx); NtfsReleaseAttributeContext(IndexAllocationCtx);
MmFreeMemory(BitmapData); MmHeapFree(BitmapData);
} }
MmFreeMemory(IndexRecord); MmHeapFree(IndexRecord);
} }
else else
{ {
DbgPrint((DPRINT_FILESYSTEM, "Can't read MFT record\n")); DbgPrint((DPRINT_FILESYSTEM, "Can't read MFT record\n"));
} }
MmFreeMemory(MftRecord); MmHeapFree(MftRecord);
return FALSE; return FALSE;
} }
@ -703,7 +703,7 @@ BOOLEAN NtfsOpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG
return FALSE; return FALSE;
} }
NtfsBootSector = MmAllocateMemory(NtfsBootSector->BytesPerSector); NtfsBootSector = MmHeapAlloc(NtfsBootSector->BytesPerSector);
if (NtfsBootSector == NULL) if (NtfsBootSector == NULL)
{ {
return FALSE; return FALSE;
@ -740,10 +740,10 @@ BOOLEAN NtfsOpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG
return FALSE; return FALSE;
} }
NtfsMasterFileTable = MmAllocateMemory(NtfsMftRecordSize); NtfsMasterFileTable = MmHeapAlloc(NtfsMftRecordSize);
if (NtfsMasterFileTable == NULL) if (NtfsMasterFileTable == NULL)
{ {
MmFreeMemory(NtfsBootSector); MmHeapFree(NtfsBootSector);
return FALSE; return FALSE;
} }
@ -765,7 +765,7 @@ FILE* NtfsOpenFile(PCSTR FileName)
PNTFS_FILE_HANDLE FileHandle; PNTFS_FILE_HANDLE FileHandle;
PNTFS_MFT_RECORD MftRecord; PNTFS_MFT_RECORD MftRecord;
FileHandle = MmAllocateMemory(sizeof(NTFS_FILE_HANDLE) + NtfsMftRecordSize); FileHandle = MmHeapAlloc(sizeof(NTFS_FILE_HANDLE) + NtfsMftRecordSize);
if (FileHandle == NULL) if (FileHandle == NULL)
{ {
return NULL; return NULL;
@ -774,7 +774,7 @@ FILE* NtfsOpenFile(PCSTR FileName)
MftRecord = (PNTFS_MFT_RECORD)(FileHandle + 1); MftRecord = (PNTFS_MFT_RECORD)(FileHandle + 1);
if (!NtfsLookupFile(FileName, MftRecord, &FileHandle->DataContext)) if (!NtfsLookupFile(FileName, MftRecord, &FileHandle->DataContext))
{ {
MmFreeMemory(FileHandle); MmHeapFree(FileHandle);
return NULL; return NULL;
} }
@ -787,7 +787,7 @@ VOID NtfsCloseFile(FILE *File)
{ {
PNTFS_FILE_HANDLE FileHandle = (PNTFS_FILE_HANDLE)File; PNTFS_FILE_HANDLE FileHandle = (PNTFS_FILE_HANDLE)File;
NtfsReleaseAttributeContext(FileHandle->DataContext); NtfsReleaseAttributeContext(FileHandle->DataContext);
MmFreeMemory(FileHandle); MmHeapFree(FileHandle);
} }
BOOLEAN NtfsReadFile(FILE *File, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer) BOOLEAN NtfsReadFile(FILE *File, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer)