How can this code compile? There are lots of typos inside...
Your
GetDiskInfo
function is not correct. Use this one:
BOOL GetDiskInfo(CHANGER_PRODUCT_DATA *Data)
{
HANDLE hDevice;
BOOL bResult;
DWORD junk;
hDevice = CreateFile(_T("\\\\.\\C:"),
0,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
if(hDevice == INVALID_HANDLE_VALUE)
{
cout << "could not access disk\n";
return FALSE;
}
bResult = DeviceIoControl(hDevice,
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
NULL,
0,
Data,
sizeof(*Data),
&junk,
NULL);
CloseHandle(hDevice);
return bResult;
}