End Google Ads 201810 - BS.net 01 --> I'm trying to copy the used clusters of a hard disk partition(NTFS,windows os) to another partition.
I used the "FSCTL_GET_VOLUME_BITMAP" to get the cluster usage details.
And I'm getting the used and free cluster counts correctly.And the cluster number I got is continuous.
This makes problem for me. I wanna copy the used clusters to a different partition.
What type of cluster number I'm getting.? ; but the answer is correct.
It makes confusion to me.the clusters may not be continuous so what the following program segment gives..??

Sample code

//---------------------------------------------------
//Getting the Bitmap of Volume

STARTING_LCN_INPUT_BUFFER StartingLCN;
VOLUME_BITMAP_BUFFER *Bitmap = NULL;
UINT32 BitmapSize;
DWORD BytesReturned1;
BOOL Result;
ULONGLONG ClusterCount = 0;

StartingLCN.StartingLcn.QuadPart = 0;
BitmapSize = sizeof (VOLUME_BITMAP_BUFFER) + 4;
Bitmap = (VOLUME_BITMAP_BUFFER *) malloc (BitmapSize);

Result = DeviceIoControl(
h_MyDevice_src2,
FSCTL_GET_VOLUME_BITMAP,
&StartingLCN,
sizeof (StartingLCN),
Bitmap,
BitmapSize,
&BytesReturned1,
NULL);

if (Result == FALSE &&GetLastError()!= ERROR_MORE_DATA)
{
free (Bitmap);
coutStartingLcn.QuadPart;//TOT noof clusters
cout