none
Driver that behaves like a real disk RRS feed

  • Question

  • Can someone tell me which sample device actually looks like a real disk?

    I'm defining 'looks like a real disk' as in shows up in computer management and can be controlled with diskpart.

    Or; what minor modification can I make to the ramdisk driver to make it appear as a real disk?  What is missing that the sample ramdisk doesn't show up in diskpart or compute managment's disk manager?

    Or; how do I mount the ramdisk on a junction instead of a drive letter?  

    Sunday, May 17, 2015 5:15 PM

Answers

  • The ramdisk sample is known to be old and crufty.  I would start with a virtual storport and make your own ramdisk if you really want such a device.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Sunday, May 17, 2015 5:19 PM

All replies

  • The ramdisk sample is known to be old and crufty.  I would start with a virtual storport and make your own ramdisk if you really want such a device.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Sunday, May 17, 2015 5:19 PM
  • Thanks I guess that might be a hint...

    I assume you mean ...\src\storage\StorportMiniports\lsi_u3

    Is there one that will build for XP?  Unfortunatly I cannot target just the latest windows systems, and have to support back to XP.  I ask because all I get for output for 'build' is "_objects.mac"  although I don't see the message 'cannot build for this platform'

    Sunday, May 17, 2015 5:51 PM
  • No storport does not go back to XP, you need server 2003 SP1 or Vista to use a virtual storport.  Your only other choice is to take the disk.sys sample, and use it as the basis of a driver that exposes a disk device.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Sunday, May 17, 2015 10:59 PM
  • disk.sys is marked to only build for winver 0x600 +

    ADJUST_FUA_FLAG(fdoExtension)   - uses 'CdbForceUnitAccess' previously a 'ReservedByte' member in FUNCTIONAL_DEVICE_EXTENSION

    and

    IOCTL_DISK_REASSIGN_BLOCKS_EX

    Bypassing those bits of code and modifying the makefile I do get it to build... 

    There is a sample 'diskdev.inf' in the sample directory that doesn't get copied to the output...

    I see there is already a 'disk.sys' in /windows/system32/drivers  so I renamed my built version to pdisk.sys and replaced 'disk.sys' references in the diskdev.inf but all I get is 

    C:\temp\disk>..\devcon\i386\devcon.exe install diskdev.inf pdisk
    Device node created. Install is complete when drivers are installed...
    Updating drivers for pdisk from C:\temp\disk\diskdev.inf.
    devcon.exe failed.

    and my pdisk.sys is not in /windows/system32/drivers...

    the 'disk.htm' file in the sample doesn't give any hints on how to install... 

    Any hint how to install? or what is required to get it to install?

    I am using WDK 7600.16385.1...

    Monday, May 18, 2015 2:02 AM
  • Although I got disk.sys to compile; and actually renamed to pdisk.sys so it didn't conflict with disk.sys, and figured out how the 3rd parameter of devcon relates to the inf, and replaced 'gendisk' with 'testdisk' ('devcon uninstall diskdev.inf gendisk' ended up removing my real disk driver also... which I didn't find a way to undo, reinstall failed, didn't figure out how it was marked for deletion on reboot to clear that... but fortunatly boot into last known good configuration worked to save the system)

    So now I can install/uninstall the driver, but a KdPrint(("Started\n")); as the first line of DriverEntry doesn't print (I do get messages from ramdisk driver built similarly).  So I am assuming that maybe it's linked against 'classpnp.lib' which references symbols that are also not available... and attempting to backwards-compat that is turning out to be tough.  (hence it's loaded and described in the registry but is an exclamation mark in device manager).  It says (code 31); but that doesn't seem to help.

    I did have some symbol resolution issues but now using Dependancy Walker they are all resolved correctly...

    But; I still can't get it to print that DriverEntry is ever called.

    (Should I start a different thread about 'why doesn't my entry point ever get called'?)

    Tuesday, May 19, 2015 6:04 PM