News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

A RamDisk is a Fixed drive or harddisk ?

Started by clamicun, February 09, 2015, 04:45:13 AM

Previous topic - Next topic

clamicun

Question...

A RamDisk is a fixed drive or a harddisk ?

I wrote this prog which gives info on the computers drives.
Everything is fine, but...

The result on my ramdisk is 'eax value 3'  that is FIXED DRIVE.

I checked dozens of entries in the net on "GetDriveType" - no mention on ramdisks.
Someone knows something?

dedndave


jj2007

Depends on how the driver wants to be treated, see Microsoft support, Ramdisk.sys sample driver for Windows 2000:
QuoteWhile you call the IoCreateDevice function (RamdiskAddDevice function in pnp.c), change the device type from FILE_DEVICE_VIRTUAL_DISK to FILE_DEVICE_DISK and recompile the driver.

clamicun

Very funny, dedndave - the ramdisk is brandnew paidfor software!

clamicun

Buona sera, JJ

Thank you. I'll check this out.

But I did not create it - I use software from Patric Remus
http://www.archicrypt.de/

fearless

Could check registry to see if ramdisk driver is loaded or various other ramdrive type drivers from different vendors

SYSTEM\CurrentControlSet\Services\Ramdisk for example

Other than that, maybe the serial no or volume name might give you a clue as to if its a ramdrive - volume name might be changeble by user, but serial no might be set to a particular value maybe - depending on vendor - its a long shot, not sure if that will apply in all cases if at all.

Also if your checking for SUBST drives. you can loop around all your collected drive info, assuming you went through all drive letters already and saved volume and serial no previously to an array - or whatever way you want to check that info. Check each entry for a volume and serial no that is already in your array, if so you have a subst drive. My c: drive and my m: drive have same volume name and serial no, m: is mapped to c:\develop folder.

dedndave

i wasn't trying to be funny - lol

i wrote a few RAMDRIVE type device drivers for DOS, back in the day
software wise, you really couldn't tell it wasn't a hard drive   :P

MichaelW

I seem to recall that at one time, in the DOS era, there was a specific identifier for ram drives and the identifier could be read in the same way as the identifiers for other types of drives, but I don't recall any details.
Well Microsoft, here's another nice mess you've gotten us into.

hutch--


    invoke GetDriveType,pbuf

    switch eax
      case 0                                ; The drive type cannot be determined.
        mov cloc, append$(pBuffer,chr$("Unknown type"),cloc)
      case 1                                ; The root directory does not exist.
        mov cloc, append$(pBuffer,chr$("No root dir "),cloc)
      case DRIVE_REMOVABLE                  ; The drive can be removed from the drive.
        mov cloc, append$(pBuffer,chr$("Removable   "),cloc)
      case DRIVE_FIXED                      ; The disk cannot be removed from the drive.
        mov cloc, append$(pBuffer,chr$("Local disk  "),cloc)
      case DRIVE_REMOTE                     ; The drive is a remote (network) drive.
        mov cloc, append$(pBuffer,chr$("Network drv "),cloc)
      case DRIVE_CDROM                      ; The drive is a CD-ROM drive.
        mov cloc, append$(pBuffer,chr$("CD/DVD drv  "),cloc)
      case DRIVE_RAMDISK                    ; The drive is a RAM disk.
        mov cloc, append$(pBuffer,chr$("Ram drive   "),cloc)
    endsw


https://msdn.microsoft.com/en-us/library/windows/desktop/aa364939%28v=vs.85%29.aspx

Magnum

Hutch,

Could you post the complete code. :-)
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

hutch--


dedndave


hutch--

 :biggrin:

Its more the case that "GetDriveType()" is reasonably straight forward but we don't do code orders here. Rent A Coder etc ....

clamicun

Thank you hutch,

your example is "more or less"  what I wrote. (attached zipfile in my first post).
And it returns the same results.

My ramdisk is a "DRIVE_FIXED".
-----------
Your code from http://www.masmforum.com/board/index.php?topic=12385

also returns the same:  "HDD partition".

What can I say -
The ramdrive  "The disk cannot be removed from the drive" is logically absolutely right,
but why then checking on Case DRIVE_RAMDISK  ?

So my question stays unanswered.
What is a ramdrive ?


hutch--

clamicun,

It probably means that the author of the device driver has written it so it returns that information rather than identifying it as a ramdrive.