ken-yossy / nvmetool-win

Communicate with NVMe SSD using Windows' inbox device driver
Other
83 stars 48 forks source link

Windows does not recognize PhysicalDrive%hs, how to send IOCTL commands to SSD? #16

Closed NextStory1127 closed 3 years ago

NextStory1127 commented 3 years ago

Send a command to the SSD, open PhysicalDrive%hs through CreateFile, and then send the IOCTL command to the SSD. If Windows does not recognize PhysicalDrive%hs (for example, the SSD device does not start normally), is there a way to send an IOCTL command to the SSD? Similar to the character device that can send IOCTL to SSD under Linux

Thanks

ken-yossy commented 3 years ago

Hi,

If Windows does not recognize PhysicalDrive%hs (for example, the SSD device does not start normally), is there a way to send an IOCTL command to the SSD? Similar to the character device that can send IOCTL to SSD under Linux

I agree that the situation that you point out can happen, but I have no idea to do that...

All Microsoft's document that I found about DeviceIoControl() (ex. https://docs.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-deviceiocontrol) depends on the file handles that can be retrieved by CreateFile(). And also, calling CreateFile() requires valid "FileName"...

I'm afraid that it could be done if we can make Windows recognize the device in such situation through doing device recognition process step by step (instead of Windows' auto-recognition)...

Thank you, Ken

NextStory1127 commented 3 years ago

I understand, If use the Microsoft Inbox, need to ensure the normal operation of the device, Because there is no Windows closed source driver, don't know Windows in the step by step device recognition process .

Thank you