GetVolumeInfo in W2K reports FAT32 as FAT -
tried using int21 f 440Dh m 66h IOCTL to get Media Descriptor - which works
in a few instances - but not always. I have tried different mixes of
permissions. Some pass, some fail either CreateFile or DeviceIoControl with
“access denied.” Mapped net drives never work (and that’s what I’m really
trying to get at - sigh!) Does anyone have info or ideas? Here is one
incarnation of my code:
case OperatingSystemInfo::WINNT40:
case OperatingSystemInfo::WIN2000:
case OperatingSystemInfo::WHISTLER:
{
HANDLE hDevice; // handle to the drive to be examined
BOOL bResult = false; // results flag
DWORD junk; // discard results
TCHAR tsz[8];
::wsprintf(tsz, TEXT(“\\.\%c:”), TEXT(‘@’) + nDrive);
hDevice = CreateFile( tsz,
0, // share mode
0,
NULL,
OPEN_EXISTING,
0,
NULL); // don’t copy any file’s attributes
if (hDevice != INVALID_HANDLE_VALUE) // we can open the drive
{
PARTITION_INFORMATION partitionInfo;
bResult = DeviceIoControl( hDevice, // device we are querying
IOCTL_DISK_GET_PARTITION_INFO, // operation to perform
NULL,
0, // no input buffer, so pass zero
&partitionInfo,
sizeof(partitionInfo), // output buffer
&junk, // discard count of bytes returned
NULL); // synchronous I/O
if (bResult)
{
switch(partitionInfo.PartitionType)
{
case PARTITION_FAT32:
case PARTITION_FAT32_XINT13:
{
return CString(“FAT32”);
}
case PARTITION_FAT_12:
{
return CString(“FAT12”);
}
case PARTITION_FAT_16:
{
return CString(“FAT”);
}
} // switch on partition type
}
CloseHandle(hDevice); // we’re done with the handle
} // got handle
if (!bResult)
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Process any inserts in lpMsgBuf.
// …
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, “Error”, MB_OK |
MB_ICONINFORMATION );
// Free the buffer.
} // failed
} // case NT/2000
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com