I have created a sample MFC application to find the 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)
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 .
It looks like you're new here. If you want to get involved, click one of these buttons!
|Upcoming OSR Seminars|
|Developing Minifilters||4 Feb 2019||OSR Seminar Space|
|Writing WDF Drivers||25 Feb 2019||OSR Seminar Space|
|Kernel Debugging and Crash Analysis||25 Mar 2019||OSR Seminar Space|