hVolume = CreateFile(TEXT("\\NORFlash\\VOL:"),
GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hVolume== INVALID_HANDLE_VALUE)
{
wprintf(L"Failed to open handle to NORFlash volume\r\n");
return FALSE;
}
DWORD cb = 0;
FMTVOLREQ fv;
// Format the drive.
ZeroMemory(&fv, sizeof(fv));
fv.fv_flags = FMTVOL_QUICK;
fv.fv_flags |=FMTVOL_16BIT_FAT;
retVal= DeviceIoControl(hVolume, IOCTL_DISK_FORMAT_VOLUME, &fv,
sizeof(fv), NULL, 0, &cb, NULL);
return retVal;
This no longer seems to work under 6.0, as I keep getting an error code of
0x57 (The parameter is incorrect) when I complete the DeviceIoControl call.
Is this method of formatting drives not available under 6.0?
http://msdn2.microsoft.com/en-us/library/aa918576.aspx
Sachin
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2006 Microsoft Corporation. All rights
reserved.
"tdacosta" <tdac...@discussions.microsoft.com> wrote in message
news:94866E00-BB2D-417F...@microsoft.com...
Thanks for the reply, the FormatVolume is working fine. I did have to use
the Storage Manager functions to obtain a handle to the partition. Opening
the "\drive\vol:" using CreateFile did not yield a usable handle for
FormatVolume.
As for the DeviceIoControl that I was trying, it is still listed in the 6.0
documentation:
http://msdn2.microsoft.com/en-ca/library/aa914221.aspx
I hope the documentation gets fixed up with these sorts of changes.
...Tony