how to create/reg/access a virtual drive

  • Thread starter Thread starter Iwan
  • Start date Start date
I

Iwan

I have a speciffic task of which i do not know how to start on.

The task is to create a virtual drive (like a ram drive og deamon tools).
Through this drive files are to be saved and loaded like a normal drive, but
the "files" are created runtime by my program. The idea is that the program
accessing the drive can not tell the diffrence.

Here is what i need:
- How to register the drive with windows.
- How to create a connection between the drive and my program.
- Which drive operations to implement in my program.

Thanks :)
Jens
 
Interesting. This would depend on how "real" the drive needs to appear.
Can it be something your application abstracts or it something other (i.e.
not yours) applications would need to see as a windows device? If you can
just abstract a device for your program, then one way I am thinking (if you
want a RAM only abstraction) is derive a class from Stream. Inside your
class, use an object[] or jagged byte array to hold each byte stream of
files. Naturally, you would need a lot of ram for many files or big files.
You could also use a backing store of a binary file to serialize your
structure to disk inside your Stream. Then other programs or your program
could use this just (kinda) like a file stream or memory stream with some
added function. If you want a device that shows up in MyComputer, then I
think you need to create a device driver using c/c++ and maybe even some
assembler. Check out the device driver SDK for samples and ideas.
 
Back
Top