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?
ramdisk ?
is that a DOS device ?
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.
Very funny, dedndave - the ramdisk is brandnew paidfor software!
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/
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.
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
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.
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
Hutch,
Could you post the complete code. :-)
No.
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)
:biggrin:
Its more the case that "GetDriveType()" is reasonably straight forward but we don't do code orders here. Rent A Coder etc ....
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 ?
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.
Thanks Dave.