Find actual VHDX file size

I am doing FS minifilter. Job is to capture VHDX IOs.
I am able to capture IOs without having any issue.
However, I do not get actual vhdx size. FILE_STANDARD_INFORMATION shows current allocation size and file offset which is less than actual Virtual Size. But through hyperv manager, I could see actual size mentioned during vhdx creattion. Is there anyway way or APIs to work with VHDX files in kernel mode FS filter drivers to get VHDX properties. OR will it be OK to look into VHDX specification and figure out metadata? Any immediate help would be great.

The metadata for these files is public so I would just read the
information from there.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295

------ Original Message ------
From: xxxxx@yahoo.com
To: “Windows File Systems Devs Interest List”
Sent: 1/26/2016 11:06:28 PM
Subject: [ntfsd] Find actual VHDX file size

>I am doing FS minifilter. Job is to capture VHDX IOs.
>I am able to capture IOs without having any issue.
>However, I do not get actual vhdx size. FILE_STANDARD_INFORMATION shows
>current allocation size and file offset which is less than actual
>Virtual Size. But through hyperv manager, I could see actual size
>mentioned during vhdx creattion. Is there anyway way or APIs to work
>with VHDX files in kernel mode FS filter drivers to get VHDX
>properties. OR will it be OK to look into VHDX specification and figure
>out metadata? Any immediate help would be great.
>
>—
>NTFSD is sponsored by OSR
>
>
>MONTHLY seminars on crash dump analysis, WDF, Windows internals and
>software drivers!
>Details at http:
>
>To unsubscribe, visit the List Server section of OSR Online at
>http:</http:></http:>

Thanks Pete. Yes it might do the job. I am afraid what if metadata is changed in some windows update. My solution’s dependency on metadata should not create issue.

>OR will it be OK to look into VHDX specification and figure out metadata?

Yes, surely.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

> Thanks Pete. Yes it might do the job. I am afraid what if metadata is changed in some windows

update.

No, if the format is officially published - it will not change.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks Maxim,
I will use metadata to figure out maximum virtual disk size.
help was very useful.