N
Nikhil V S
Guest
I have created a sample MFC application to find the device number
using IOCTL_STORAGE_GET_DEVICE_NUMBER
following code block used
hDeviceHandle = CreateFile(strDrivePath,0,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,0);
if (hDeviceHandle != (HANDLE)-1)
{
STORAGE_DEVICE_NUMBER sdn;
DWORD returned;
if (DeviceIoControl( hDeviceHandle,IOCTL_STORAGE_GET_DEVICE_NUMBER,NULL,0,&sdn,sizeof(sdn),&returned,NULL));
{
printf("\tDevice type: %d number: %d partition: %d\n",sdn.DeviceType, sdn.DeviceNumber, sdn.PartitionNumber);
}
}
I Need to find out the Device number in file system driver.Is it Possible find the device number in kernel mode .
Is there any code sample available .
Continue reading...
using IOCTL_STORAGE_GET_DEVICE_NUMBER
following code block used
hDeviceHandle = CreateFile(strDrivePath,0,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,0);
if (hDeviceHandle != (HANDLE)-1)
{
STORAGE_DEVICE_NUMBER sdn;
DWORD returned;
if (DeviceIoControl( hDeviceHandle,IOCTL_STORAGE_GET_DEVICE_NUMBER,NULL,0,&sdn,sizeof(sdn),&returned,NULL));
{
printf("\tDevice type: %d number: %d partition: %d\n",sdn.DeviceType, sdn.DeviceNumber, sdn.PartitionNumber);
}
}
I Need to find out the Device number in file system driver.Is it Possible find the device number in kernel mode .
Is there any code sample available .
Continue reading...