Reply to topic

Scripting RamDrive Creation
Zion Gates


Joined: 16 Apr 2012
Posts: 1
Reply with quote
Greetings Gurus,

Is it possible to script the creation of a Ramdrive (including drive letter assignment)?
Please post example if so.

If not, will it be implemented shortly?
View user's profileSend private message
Re: Scripting RamDrive Creation
Alois Kraus


Joined: 08 Aug 2013
Posts: 1
Reply with quote
Yes it is. But it requires some fiddling. First you must call the GizmoService to mount a new drive. Then you need to call one DeviceIOControl command to the device driver to initizalize the RAM disc and then you need to forma the created drive.
Gizmo does this by invoking FormatEx via its own dll via rundll32.exe call to format the drive. This is the elevated popup you get every time when you create a new RAM drive. I have said now to the UAC prompt and then executed the command by hand. Unfortunately it did never work for me and I have no idea why.

I did fall back to call format manually because all other solutions like formatting the drive via WMI Format from Win32_Volume did also not work.

The only thing I wanted to know if Gizmo is really freeware. I have found no license besides the binaries and the web site looks quite abonded.

Hope this helps a bit.

To see the DeviceIOControl commands you can use http://www.rohitab.com/apimonitor
to see the actually passed arrays from where you can deduce the command id and structure to create the drive. It is basically a structure of

DriveLetter
0000...
5
0000...
Size in 16 byte Blocks
00000...
SizeOfFollowingString
RAM Drive - RAM Drive 1

A little bit Windbg does also help. The Gizmo Serice needs a
ControlService(x,128,x) to mount a drive
ControlService(x,129,x) to unmount a drive.
To make this work you need also to check the registry keys before you can mount unmount a volume. This can be done with Procmon and you are there.


Zion Gates wrote:
Greetings Gurus,

Is it possible to script the creation of a Ramdrive (including drive letter assignment)?
Please post example if so.

If not, will it be implemented shortly?
View user's profileSend private message
Scripting RamDrive Creation
All times are GMT - 8 Hours  
Page 1 of 1  

  
  

 Reply to topic