DISKCONTEXT* Context = FsGetDeviceSpecific(FileId);
RtlZeroMemory(Information, sizeof(FILEINFORMATION));
- Information->EndingAddress.QuadPart = (Context->SectorOffset + Context->SectorCount) * Context->SectorSize;
- Information->CurrentAddress.QuadPart = (Context->SectorOffset + Context->SectorNumber) * Context->SectorSize;
+ Information->EndingAddress.QuadPart = Context->SectorCount * Context->SectorSize;
+ Information->CurrentAddress.QuadPart = Context->SectorNumber * Context->SectorSize;
return ESUCCESS;
}
{
Volume->BytesPerSector = 512;
Volume->SectorsPerCluster = SWAPD(FatXVolumeBootSector->SectorsPerCluster);
- Volume->FatSectorStart = (4096 / Volume->BytesPerSector);
+ Volume->FatSectorStart = (0x1000 / Volume->BytesPerSector);
Volume->ActiveFatSectorStart = Volume->FatSectorStart;
Volume->NumberOfFats = 1;
FatSize = (ULONG)(PartitionSectorCount / Volume->SectorsPerCluster *
(Volume->FatType == FATX16 ? 2 : 4));
- Volume->SectorsPerFat = (((FatSize + 4095) / 4096) * 4096) / Volume->BytesPerSector;
+ Volume->SectorsPerFat = ROUND_UP(FatSize, 0x1000) / Volume->BytesPerSector;
Volume->RootDirSectorStart = Volume->FatSectorStart + Volume->NumberOfFats * Volume->SectorsPerFat;
Volume->RootDirSectors = FatXVolumeBootSector->SectorsPerCluster;
/*
* We found the entry, now fill in the FAT_FILE_INFO struct
*/
+ FatFileInfoPointer->Attributes = DirEntry->Attr;
FatFileInfoPointer->FileSize = DirEntry->Size;
FatFileInfoPointer->FilePointer = 0;