The MASM Forum

General => The Workshop => Topic started by: clamicun on February 09, 2015, 04:45:13 AM

Title: A RamDisk is a Fixed drive or harddisk ?
Post by: clamicun on February 09, 2015, 04:45:13 AM
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?
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: dedndave on February 09, 2015, 05:04:05 AM
ramdisk ?
is that a DOS device ?
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: jj2007 on February 09, 2015, 05:04:34 AM
Depends on how the driver wants to be treated, see Microsoft support, Ramdisk.sys sample driver for Windows 2000: (http://support.microsoft.com/kb/257405)
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.
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: clamicun on February 09, 2015, 05:12:18 AM
Very funny, dedndave - the ramdisk is brandnew paidfor software!
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: clamicun on February 09, 2015, 05:16:55 AM
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/
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: fearless on February 09, 2015, 07:17:15 AM
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.
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: dedndave on February 09, 2015, 09:57:11 AM
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
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: MichaelW on February 11, 2015, 03:13:58 PM
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.
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: hutch-- on February 11, 2015, 04:15:56 PM

    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
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: Magnum on February 11, 2015, 05:22:06 PM
Hutch,

Could you post the complete code. :-)
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: hutch-- on February 11, 2015, 11:09:43 PM
No.
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: dedndave on February 11, 2015, 11:32:28 PM
i see Hutch is in good form, today - rofl   :lol:

http://www.masmforum.com/board/index.php?topic=12385 (http://www.masmforum.com/board/index.php?topic=12385)
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: hutch-- on February 12, 2015, 12:37:46 AM
 :biggrin:

Its more the case that "GetDriveType()" is reasonably straight forward but we don't do code orders here. Rent A Coder etc ....
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: clamicun on February 12, 2015, 03:14:28 AM
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 ?

Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: hutch-- on February 12, 2015, 04:52:05 AM
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.
Title: Re: A RamDisk is a Fixed drive or harddisk ?
Post by: Magnum on February 12, 2015, 05:42:37 AM
Thanks Dave.