Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ramdisk: Added device IO control support for Windows 10 #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tchaudev
Copy link

@tchaudev tchaudev commented Mar 4, 2016

Added support for the following device IO control codes:

  • IOCTL_STORAGE_QUERY_PROPERTY
  • IOCTL_DISK_GET_LENGTH_INFO
  • IOCTL_MOUNTDEV_QUERY_DEVICE_NAME

Issues addressed: #49 and #44

Added support for the following device IO control codes:
+ IOCTL_STORAGE_QUERY_PROPERTY
+ IOCTL_DISK_GET_LENGTH_INFO
+ IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
@Smekalov
Copy link

Smekalov commented Apr 25, 2016

tchaudev, is that helped and RAMDisk working as normal under Windows 10? Inside of manual for MS RAMDisk exists info about Package project but I not found it inside Solution. Is that normal?

Open the driver solution in Visual Studio

In Visual Studio, open the solution file, ramdisk.sln, and locate Solution Explorer (if this is not already open, choose Solution Explorer from the View menu). In Solution Explorer, you can see one solution that has two projects. There is a driver project named WdfRamdisk and a package project named package (lower case)

@tchaudev
Copy link
Author

Is that helped and RAMDisk working as normal under Windows 10?
This fix will get the ramdisk working under Windows 10 via PowerShell or CommandPrompt. I explain the issue more clearly here: http://stackoverflow.com/questions/35999668/windows-ramdisk-storage-driver-sample-drive-with-the-name-r-does-not-exist.

Inside of manual for MS RAMDisk exists info about Package project but I not found it inside Solution. Is that normal?
When I forked from Windows-driver-samples, the ramdisk solution never had the package project. Maybe it was added recently. That said, you don't need the package project to build, install, and run the WdfRamdisk project.

@Jichao
Copy link

Jichao commented Feb 24, 2017

thx for your work, i finally get ramdisk run on win 10.
@tchaudev to make it works in windows explorer, you need to create the device with specific ssdl, e.g.

#define NORMAL_USER_SSDL				L"D:P(A;;GA;;;WD)"
DECLARE_CONST_UNICODE_STRING(ssdl, NORMAL_USER_SSDL);
WdfDeviceInitAssignSDDLString(DeviceInit, &ssdl);

for ssdl format refer: https://msdn.microsoft.com/en-us/windows/hardware/drivers/ifs/applying-security-descriptors-on-the-device-object

@tchaudev
Copy link
Author

@Jichao thanks for the tip.

@ghost
Copy link

ghost commented Jun 4, 2017

I can't find the .inf file, is it missing?
It doesn't want to install correctly (on a Windows 2016 Server), any tips?

@gkhanna79
Copy link
Member

The missing INF file issue happens because ramdisk.inx is not included in the project. Add it to the Driver Files section and rebuild. You will then run into two more errors about duplicate entries - just merge them into one and you will have the expected output files.

@gkhanna79
Copy link
Member

Interestingly, I was able to access the R: drive on a physical box but when I deploy the driver to Win10 VM (under HyperV), I get "Incorrect function" error as well.

I will try out the PR and share an update.

@gkhanna79
Copy link
Member

I have confirmed that this PR resolved the Incorrect Function issue. Thanks you @tchaudev.

@gkhanna79
Copy link
Member

Is there a reason this PR is not merged yet (blocked on owners to merge it)?

gkhanna79 added a commit to gkhanna79/Windows-driver-samples that referenced this pull request Jul 20, 2017
@wm1 wm1 requested review from IrinVoso and removed request for IrinVoso July 21, 2017 00:41
@Smekalov
Copy link

Dear, I tested RAMDisk sample under Windows 10 but found one trouble. Windows 10`s File Explorer defines RAMDisk drive as DVD RW Drive (R:). Any ideas how to change properties of RAMDisk drive from DVD RW to RAM DRIVE?

@tchaudev
Copy link
Author

@Smekalov, I couldn't get RAMDisk to work on Windows 10 file explorer when I posted this pull request, and I haven't touch it since. Try reading Jichao comment?

@Smekalov
Copy link

Yes, the native sample have 'rights' problem. I have fixed it before Jichao message but I had other problems, that is a reason why I not sent this 'rights/security' fix here. Right now I have sources with your IO-fix, L"D:P(A;;GA;;;WD)" security and without FAT12 limitation. The driver working under MS Windows 10 x64. The driver possible to compile under Visual Studio 2015 + WDK 1703. Visual Studio 2017 still not supported WDK. I can sign the driver and install on my MS Windows 10 x64 system but I have some problems when I use it - for example File Explorer understand it like any sort of drive but not RAM drive.

tchaudev, I can send you changed sources but not know how to do this here.

P. S. I still interesting - why RAMDisk code, so usual for xNIX platform, still so secret for MS Windows? We had Win 3.11/95/XP/Me/2000/VISTA/7/8/8.1/10 but we never had normal system RAM disk with user interface like SUBST. So interesting thing still not available for usual users in time when PC have RAM from 6GB to ~.

@tchaudev
Copy link
Author

@Smekalov, maybe you could try opening an issue. I haven't touch this code in over a year, and don't have any system setup to build, or test, windows drivers.

@wm1 wm1 changed the title Added device IO control support for Windows 10 ramdisk: Added device IO control support for Windows 10 Jan 17, 2018
@HBelusca
Copy link

HBelusca commented May 23, 2024

Asking in year 2024:
What's the current status of this PR (and the related issues #44 and #49)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants