How to use DeviceIOControl with FSCTL_GET_VOLUME_BITMAP

G

Guest

Hi All,

I need to check if there is the volume large enough to accept the entire
file, I need to save my file on continuous clusters.

So, I decide to use DeviceIOControl with FSCTL_GET_VOLUME_BITMAP, however, I
always get AccessViolation when printing GetLastError(), also I cannot get
the BITMAP.

Generally, I use the following:

hVolume = CreateFile("\\\\.\\f:",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);

stStartLCN.StartingLcn.QuadPart = 0;

bResult = DeviceIoControl(hVolume,
FSCTL_GET_VOLUME_BITMAP,
&stStartLCN,
sizeof(stStartLCN),
vbb,
sizeof(*vbb) + (512 * sizeof VOLUME_BITMAP_BUFFER)),

&junk,
(LPOVERLAPPED) NULL);

Also, how do I use vbb to check a continuous cluster space?

Any help will be highly appreciated. Thank you in advance for your time.

Sincerely,

bbdd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top