Commit 4d958a1c authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Preserve the 2K block size returned for CDROMs.

parent a1131786
...@@ -2264,10 +2264,18 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io ...@@ -2264,10 +2264,18 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
} }
bsize = stfs.f_bsize; bsize = stfs.f_bsize;
#endif #endif
info->BytesPerSector = 512; if (bsize == 2048) /* assume CD-ROM */
info->SectorsPerAllocationUnit = 8; {
info->TotalAllocationUnits.QuadPart = bsize * stfs.f_blocks / (512 * 8); info->BytesPerSector = 2048;
info->AvailableAllocationUnits.QuadPart = bsize * stfs.f_bavail / (512 * 8); info->SectorsPerAllocationUnit = 1;
}
else
{
info->BytesPerSector = 512;
info->SectorsPerAllocationUnit = 8;
}
info->TotalAllocationUnits.QuadPart = bsize * stfs.f_blocks / (info->BytesPerSector * info->SectorsPerAllocationUnit);
info->AvailableAllocationUnits.QuadPart = bsize * stfs.f_bavail / (info->BytesPerSector * info->SectorsPerAllocationUnit);
io->Information = sizeof(*info); io->Information = sizeof(*info);
io->u.Status = STATUS_SUCCESS; io->u.Status = STATUS_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment