user1878817
user1878817

Reputation: 11

Get cluster size

I am working on an upper volume filter driver taking diskperf as base.
I want to know how can I calculate cluster size(allocation unit size).
I know that using GetDiskFreeSpace I can get the desired output, but it's useful only in user mode.
I want it to work at the kernel level.
Is there any IOCTL or any function that will help me to find the cluster size?

Upvotes: 1

Views: 604

Answers (1)

Xearinox
Xearinox

Reputation: 3234

ZwQueryVolumeInformationFile/NtQueryVolumeInformationFile with FsInformationClass set to FILE_FS_SIZE_INFORMATION struct.

Or use IRP_MJ_QUERY_VOLUME_INFORMATION.

Upvotes: 1

Related Questions