microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
6.87k stars 4.91k forks source link

RAMDisk Storage Driver Sample #44

Open marinkobabic opened 8 years ago

marinkobabic commented 8 years ago

Have installed the ramdrive on Windows 10 x64. I used the manual installation approach. The device was mounted and I have been able to see the drive R in explorer. When running the cmd console as administrator and trying to switch to the drive R: "incorrect function" message is displayed.

tchaudev commented 8 years ago

Did you ever figured out this issue? I'm having a similar problem, except I don't even see the drive 'R' in explorer. When using the Command Prompt I'm also getting "incorrect function", and a "DriveNotFoundException" when using PowerShell.

marinkobabic commented 8 years ago

In the example FILE_SYSTEM_DISK is used. So when the drive gets the first request it tries to mount the volume. The mounting of the volume is not handled properly in the example and that is the reason we get this error message.

On the web a have found the previous version of ramdisk for x86 operating system and this example is working as expected. It has been built for windows 2000/xp.

tchaudev commented 8 years ago

Thanks for the info.

tchaudev commented 8 years ago

I updated the RAMDisk driver sample so that drive "R:" can be accessed via command line in Windows 10. Please see pull request #53, if you're interested.

wzydhek commented 8 years ago

I have the latest version and have it working correctly in my hyper-v machines, but I still get the incorrect function when using it on my host machine (also windows 10 x64).

szabolcsdombi commented 6 years ago

I have a virtual machine with Windows x64. the driver installs properly with the devcon.exe. The R: drive appears. When I try to open it I get an "Access Denied" error. Running a cmd as administrator and running R: I get "Incorrect function."

What is the solution for this?

tchaudev commented 6 years ago

See pull request #53

szabolcsdombi commented 6 years ago

@tchaudev I forked your repo. I had some build errors in the inx file. I fixed them. It is not working either :( I always test using a snapshot of a clean Windows install.

Did you test on Windows 10 x64?

tchaudev commented 6 years ago

Yes, I tested on Windows 10 x64, but that was a long time ago. It is possible that the fix is out dated. That said, the problem was pretty simple. The reason why you get access denied is because the Ramdisk driver was not handling IOCTL queries that was introduced in Windows 10. If you update the code to properly handle those IOCTL, then everything should work.

szabolcsdombi commented 6 years ago

Thank you! At least I know where to start. :)

chebotarevmichael commented 6 years ago

@tchaudev, could you open source code of your sample for RAMdisk? It was not found in samples :(

tchaudev commented 6 years ago

@chebotarevmichael you'll have to get the code from my fork: https://github.com/tchaudev/Windows-driver-samples

wonderkun commented 5 years ago

@cprogrammer1994 I run ramdisk on windows10 x64 without any errors. But no one can access it except the administrator. I can only read and write it with Command Prompt window as Administrator. How to fix it ? please help me ,thank you very much.

tchaudev commented 5 years ago

@wonderkun, I haven't tried it, but check out Jichao comment: https://github.com/Microsoft/Windows-driver-samples/pull/53#issuecomment-282203661

wonderkun commented 5 years ago

@tchaudev Thank you very much. I fix it.