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||29 July 2019||OSR Seminar Space|
|Writing WDF Drivers||23 Sept 2019||OSR Seminar Space|
|Kernel Debugging||21 Oct 2019||OSR Seminar Space|
|Internals & Software Drivers||18 Nov 2019||Dulles, VA|