Is there a quick and dirty way to code a driver that creates a read-only
virtual drive, say “X:”, and under “X:” there are two items a file “XFile”
and a folder “XFolder”. We’ll use this driver to experiemnt with some
ideas which may not be fruitful in the end, and so dont want to spend a
lot of time on it. You suggestion is highly appreciated. Thanks
You could use the MS ramdisk sample from KB Article 257405 or
use the ramdisk from www.ramdisk.tk and adapt it a bit.
C.
----- Original Message -----
From: “ChuBun” Newsgroups: ntdev To: “Windows System Software Devs Interest List” Sent: Monday, October 20, 2003 10:52 PM Subject: [ntdev] Virtual disk driver suggestion?
> Hello, > > Is there a quick and dirty way to code a driver that creates a read-only > virtual drive, say “X:”, and under “X:” there are two items a file “XFile” > and a folder “XFolder”. We’ll use this driver to experiemnt with some > ideas which may not be fruitful in the end, and so dont want to spend a > lot of time on it. You suggestion is highly appreciated. Thanks > > Chu Bun > > > > — > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 > > You are currently subscribed to ntdev as: xxxxx@compaqnet.be > To unsubscribe send a blank email to xxxxx@lists.osr.com >
The problem is what the OP describes requires a file system. A ram disk
will get you at blocks but the OP wants files. The only way to do this as
described requires a file system.
He might look at a device that supports paths, but this will not give him
access from all programs the way a filesystem will.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
----- Original Message -----
From: “Christiaan Ghijselinck” To: “Windows System Software Devs Interest List” Sent: Tuesday, October 21, 2003 2:40 AM Subject: [ntdev] Re: Virtual disk driver suggestion?
> > You could use the MS ramdisk sample from KB Article 257405 or > use the ramdisk from www.ramdisk.tk and adapt it a bit. > > C. > > > ----- Original Message ----- > From: “ChuBun” > Newsgroups: ntdev > To: “Windows System Software Devs Interest List” > Sent: Monday, October 20, 2003 10:52 PM > Subject: [ntdev] Virtual disk driver suggestion? > > > > Hello, > > > > Is there a quick and dirty way to code a driver that creates a read-only > > virtual drive, say “X:”, and under “X:” there are two items a file “XFile” > > and a folder “XFolder”. We’ll use this driver to experiemnt with some > > ideas which may not be fruitful in the end, and so dont want to spend a > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > Chu Bun > > > > > > > > — > > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 > > > > You are currently subscribed to ntdev as: xxxxx@compaqnet.be > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > — > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 > > You are currently subscribed to ntdev as: xxxxx@acm.org > To unsubscribe send a blank email to xxxxx@lists.osr.com
I don’t quite understand. Both MS Sample and the RAMDisk driver at www.ramdisk.tk formats
its own space to a FAT file system. It is true that the driver gets data + offset + length to read and
to write from the OS after it has initially formatted itself to FAT. If your goal is to purely block the
write access after you created file X:\file and/or X:\directory, it should be an easy job to adapt
the driver(s).
----- Original Message -----
From: “Don Burn” To: “Windows System Software Devs Interest List” Sent: Tuesday, October 21, 2003 3:06 PM Subject: [ntdev] Re: Virtual disk driver suggestion?
> The problem is what the OP describes requires a file system. A ram disk > will get you at blocks but the OP wants files. The only way to do this as > described requires a file system. > > He might look at a device that supports paths, but this will not give him > access from all programs the way a filesystem will. > > Don Burn (MVP, Windows DDK) > Windows 2k/XP/2k3 Filesystem and Driver Consulting > > ----- Original Message ----- > From: “Christiaan Ghijselinck” > To: “Windows System Software Devs Interest List” > Sent: Tuesday, October 21, 2003 2:40 AM > Subject: [ntdev] Re: Virtual disk driver suggestion? > > > > > > You could use the MS ramdisk sample from KB Article 257405 or > > use the ramdisk from www.ramdisk.tk and adapt it a bit. > > > > C. > > > > > > ----- Original Message ----- > > From: “ChuBun” > > Newsgroups: ntdev > > To: “Windows System Software Devs Interest List” > > Sent: Monday, October 20, 2003 10:52 PM > > Subject: [ntdev] Virtual disk driver suggestion? > > > > > > > Hello, > > > > > > Is there a quick and dirty way to code a driver that creates a read-only > > > virtual drive, say “X:”, and under “X:” there are two items a file > “XFile” > > > and a folder “XFolder”. We’ll use this driver to experiemnt with some > > > ideas which may not be fruitful in the end, and so dont want to spend a > > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > > > Chu Bun > > > > > > > > > > > > — > > > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > > > > > You are currently subscribed to ntdev as: > xxxxx@compaqnet.be > > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > > > > — > > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > > > You are currently subscribed to ntdev as: xxxxx@acm.org > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > — > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 > > You are currently subscribed to ntdev as: xxxxx@compaqnet.be > To unsubscribe send a blank email to xxxxx@lists.osr.com >
In other words, we need more or less a full file system driver?
That is quite a task for a beginner like me
“Don Burn” wrote in message news:xxxxx@ntdev… > > The problem is what the OP describes requires a file system. A ram disk > will get you at blocks but the OP wants files. The only way to do this as > described requires a file system. > > He might look at a device that supports paths, but this will not give him > access from all programs the way a filesystem will. > > Don Burn (MVP, Windows DDK) > Windows 2k/XP/2k3 Filesystem and Driver Consulting > > ----- Original Message ----- > From: “Christiaan Ghijselinck” > To: “Windows System Software Devs Interest List” > Sent: Tuesday, October 21, 2003 2:40 AM > Subject: [ntdev] Re: Virtual disk driver suggestion? > > > > > > You could use the MS ramdisk sample from KB Article 257405 or > > use the ramdisk from www.ramdisk.tk and adapt it a bit. > > > > C. > > > > > > ----- Original Message ----- > > From: “ChuBun” > > Newsgroups: ntdev > > To: “Windows System Software Devs Interest List” > > Sent: Monday, October 20, 2003 10:52 PM > > Subject: [ntdev] Virtual disk driver suggestion? > > > > > > > Hello, > > > > > > Is there a quick and dirty way to code a driver that creates a read-only > > > virtual drive, say “X:”, and under “X:” there are two items a file > “XFile” > > > and a folder “XFolder”. We’ll use this driver to experiemnt with some > > > ideas which may not be fruitful in the end, and so dont want to spend a > > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > > > Chu Bun > > > > > > > > > > > > — > > > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > > > > > You are currently subscribed to ntdev as: > xxxxx@compaqnet.be > > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > > > > — > > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > > > You are currently subscribed to ntdev as: xxxxx@acm.org > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > >
Unfortunately, the driver has to be “self-contain”, it cannot
rely on FAT/NTFS or other file system.
“Christiaan Ghijselinck” wrote in message news:xxxxx@ntdev… > > > You could use the MS ramdisk sample from KB Article 257405 or > use the ramdisk from www.ramdisk.tk and adapt it a bit. > > C. > > > ----- Original Message ----- > From: “ChuBun” > Newsgroups: ntdev > To: “Windows System Software Devs Interest List” > Sent: Monday, October 20, 2003 10:52 PM > Subject: [ntdev] Virtual disk driver suggestion? > > > > Hello, > > > > Is there a quick and dirty way to code a driver that creates a read-only > > virtual drive, say “X:”, and under “X:” there are two items a file “XFile” > > and a folder “XFolder”. We’ll use this driver to experiemnt with some > > ideas which may not be fruitful in the end, and so dont want to spend a > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > Chu Bun > > > > > > > > — > > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 > > > > You are currently subscribed to ntdev as: xxxxx@compaqnet.be > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > >
If you just want to poof up a file and a directory on a read-only fat volume
I think you can hack the ramdisk code to do this and not have to write your
own FSD. It will be a total hack, but isn’t that part of your requirement?
You will of course have to grovel through the FAT metadata to figure out
how to get your test file and directory into the volume data structures, and
all of your efforts will be thrown away, but it is do-able.
=====================
Mark Roddy
-----Original Message-----
From: ChuBun [mailto:xxxxx@yahoo.com]
Sent: Tuesday, October 21, 2003 11:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Virtual disk driver suggestion?
In other words, we need more or less a full file system
driver? That is quite a task for a beginner like me
“Don Burn” wrote in message news:xxxxx@ntdev… > > > > The problem is what the OP describes requires a file system. A ram > > disk will get you at blocks but the OP wants files. The > only way to > > do this as described requires a file system. > > > > He might look at a device that supports paths, but this > will not give > > him access from all programs the way a filesystem will. > > > > Don Burn (MVP, Windows DDK) > > Windows 2k/XP/2k3 Filesystem and Driver Consulting > > > > ----- Original Message ----- > > From: “Christiaan Ghijselinck” > > To: “Windows System Software Devs Interest List” > > > Sent: Tuesday, October 21, 2003 2:40 AM > > Subject: [ntdev] Re: Virtual disk driver suggestion? > > > > > > > > > > You could use the MS ramdisk sample from KB Article 257405 or use > > > the ramdisk from www.ramdisk.tk and adapt it a bit. > > > > > > C. > > > > > > > > > ----- Original Message ----- > > > From: “ChuBun” > > > Newsgroups: ntdev > > > To: “Windows System Software Devs Interest List” > > > > Sent: Monday, October 20, 2003 10:52 PM > > > Subject: [ntdev] Virtual disk driver suggestion? > > > > > > > > > > Hello, > > > > > > > > Is there a quick and dirty way to code a driver that creates a > read-only > > > > virtual drive, say “X:”, and under “X:” there are two > items a file > > “XFile” > > > > and a folder “XFolder”. We’ll use this driver to > experiemnt with > > > > some ideas which may not be fruitful in the end, and so > dont want > > > > to spend > a > > > > lot of time on it. You suggestion is highly > appreciated. Thanks > > > > > > > > Chu Bun > > > > > > > > > > > > > > > > — > > > > Questions? First check the Kernel Driver FAQ at > > http://www.osronline.com/article.cfm?id=256 > > > > > > > > You are currently subscribed to ntdev as: > > xxxxx@compaqnet.be > > > > To unsubscribe send a blank email to > > > > xxxxx@lists.osr.com > > > > > > > > > > — > > > Questions? First check the Kernel Driver FAQ at > > http://www.osronline.com/article.cfm?id=256 > > > > > > You are currently subscribed to ntdev as: xxxxx@acm.org > > > To unsubscribe send a blank email to > xxxxx@lists.osr.com > > > > > > > > > > — > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
Well assuming you wanted to something more than a static set
of data yes. If you did want static data, you could just fake it
with a stock filesystem, but that is not what it appears you are
looking for.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
----- Original Message -----
From: “ChuBun” Newsgroups: ntdev To: “Windows System Software Devs Interest List” Sent: Tuesday, October 21, 2003 11:20 AM Subject: [ntdev] Re: Virtual disk driver suggestion?
> In other words, we need more or less a full file system driver? > That is quite a task for a beginner like me > > “Don Burn” wrote in message news:xxxxx@ntdev… > > > > The problem is what the OP describes requires a file system. A ram disk > > will get you at blocks but the OP wants files. The only way to do this as > > described requires a file system. > > > > He might look at a device that supports paths, but this will not give him > > access from all programs the way a filesystem will. > > > > Don Burn (MVP, Windows DDK) > > Windows 2k/XP/2k3 Filesystem and Driver Consulting > > > > ----- Original Message ----- > > From: “Christiaan Ghijselinck” > > To: “Windows System Software Devs Interest List” > > Sent: Tuesday, October 21, 2003 2:40 AM > > Subject: [ntdev] Re: Virtual disk driver suggestion? > > > > > > > > > > You could use the MS ramdisk sample from KB Article 257405 or > > > use the ramdisk from www.ramdisk.tk and adapt it a bit. > > > > > > C. > > > > > > > > > ----- Original Message ----- > > > From: “ChuBun” > > > Newsgroups: ntdev > > > To: “Windows System Software Devs Interest List” > > > Sent: Monday, October 20, 2003 10:52 PM > > > Subject: [ntdev] Virtual disk driver suggestion? > > > > > > > > > > Hello, > > > > > > > > Is there a quick and dirty way to code a driver that creates a > read-only > > > > virtual drive, say “X:”, and under “X:” there are two items a file > > “XFile” > > > > and a folder “XFolder”. We’ll use this driver to experiemnt with some > > > > ideas which may not be fruitful in the end, and so dont want to spend > a > > > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > > > > > Chu Bun > > > > > > > > > > > > > > > > — > > > > Questions? First check the Kernel Driver FAQ at > > http://www.osronline.com/article.cfm?id=256 > > > > > > > > You are currently subscribed to ntdev as: > > xxxxx@compaqnet.be > > > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > > > > > > > — > > > Questions? First check the Kernel Driver FAQ at > > http://www.osronline.com/article.cfm?id=256 > > > > > > You are currently subscribed to ntdev as: xxxxx@acm.org > > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > > > > > > > — > Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 > > You are currently subscribed to ntdev as: xxxxx@acm.org > To unsubscribe send a blank email to xxxxx@lists.osr.com
Nope. Virtual disk driver is just a disk driver and works on sector level.
No need for any filesystem. Everything necessary is to support proper IOCTLs
(several years ago I posted the list here) which allow formatting and then
format virtual drive standard way using FAT or NTFS. It isn’t quite easy but
much easier than to implement FS driver.
The other possibility was already mentioned and IIRC ramdisk DDK sample
already contains all necessary code. The trick is easy: it creates basic FAT
structures (boot sector, empty FAT tables and root directory) during drive
creation so drive looks as already formatted and empty for OS and there is
no need to implement all IOCTLs properly. Hack inappropriate for real use
but enough for testing. When mounted, drive can be used as any other one. It
is rather easy to allow both RW and RO mounting.
I’m not sure what OP really wants; what about using a diskette with
necessary files for the test? Write necessary files there and then make it
RO.
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]
Well assuming you wanted to something more than a static set
of data yes. If you did want static data, you could just fake it
with a stock filesystem, but that is not what it appears you are
looking for.
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
----- Original Message -----
From: “ChuBun” > Newsgroups: ntdev > To: “Windows System Software Devs Interest List” > Sent: Tuesday, October 21, 2003 11:20 AM > Subject: [ntdev] Re: Virtual disk driver suggestion? > > > > In other words, we need more or less a full file system driver? > > That is quite a task for a beginner like me > > > > “Don Burn” wrote in message news:xxxxx@ntdev… > > > > > > The problem is what the OP describes requires a file system. A ram > disk > > > will get you at blocks but the OP wants files. The only way to do > this > as > > > described requires a file system. > > > > > > He might look at a device that supports paths, but this will not give > him > > > access from all programs the way a filesystem will. > > > > > > Don Burn (MVP, Windows DDK) > > > Windows 2k/XP/2k3 Filesystem and Driver Consulting > > > > > > ----- Original Message ----- > > > From: “Christiaan Ghijselinck” > > > To: “Windows System Software Devs Interest List” > > > Sent: Tuesday, October 21, 2003 2:40 AM > > > Subject: [ntdev] Re: Virtual disk driver suggestion? > > > > > > > > > > > > > > You could use the MS ramdisk sample from KB Article 257405 or > > > > use the ramdisk from www.ramdisk.tk and adapt it a bit. > > > > > > > > C. > > > > > > > > > > > > ----- Original Message ----- > > > > From: “ChuBun” > > > > Newsgroups: ntdev > > > > To: “Windows System Software Devs Interest List” > > > > > Sent: Monday, October 20, 2003 10:52 PM > > > > Subject: [ntdev] Virtual disk driver suggestion? > > > > > > > > > > > > > Hello, > > > > > > > > > > Is there a quick and dirty way to code a driver that creates a > > read-only > > > > > virtual drive, say “X:”, and under “X:” there are two items a file > > > “XFile” > > > > > and a folder “XFolder”. We’ll use this driver to experiemnt with > some > > > > > ideas which may not be fruitful in the end, and so dont want to > spend > > a > > > > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > > > > > > > Chu Bun > > > > > > > > > > > > > > > > > > > > — > > > > > Questions? First check the Kernel Driver FAQ at > > > http://www.osronline.com/article.cfm?id=256 > > > > > > > > > > You are currently subscribed to ntdev as: > > > xxxxx@compaqnet.be > > > > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > > > > > > > > > > — > > > > Questions? First check the Kernel Driver FAQ at > > > http://www.osronline.com/article.cfm?id=256 > > > > > > > > You are currently subscribed to ntdev as: xxxxx@acm.org > > > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > > > > > > > > > > > > > > > — > > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > > > You are currently subscribed to ntdev as: xxxxx@acm.org > > To unsubscribe send a blank email to xxxxx@lists.osr.com > > > — > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > You are currently subscribed to ntdev as: michal.vodicka@st.com > To unsubscribe send a blank email to xxxxx@lists.osr.com >
We cannot use stock file system. Otherwise, like suggested, a floppy disk
will do the job.
“ChuBun” wrote in message news:xxxxx@ntdev… > > Hello, > > Is there a quick and dirty way to code a driver that creates a read-only > virtual drive, say “X:”, and under “X:” there are two items a file “XFile” > and a folder “XFolder”. We’ll use this driver to experiemnt with some > ideas which may not be fruitful in the end, and so dont want to spend a > lot of time on it. You suggestion is highly appreciated. Thanks > > Chu Bun > > > >
Why not? Maybe you should describe your problem more detailed way. If you
want to access virtual drive standard way it doesn’t matter too much which
FS is used.
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]
We cannot use stock file system. Otherwise, like suggested, a floppy disk
will do the job.
“ChuBun” wrote in message news:xxxxx@ntdev… > > > > Hello, > > > > Is there a quick and dirty way to code a driver that creates a read-only > > virtual drive, say “X:”, and under “X:” there are two items a file > “XFile” > > and a folder “XFolder”. We’ll use this driver to experiemnt with some > > ideas which may not be fruitful in the end, and so dont want to spend a > > lot of time on it. You suggestion is highly appreciated. Thanks > > > > Chu Bun > > > > > > > > > > > > — > Questions? First check the Kernel Driver FAQ at > http://www.osronline.com/article.cfm?id=256 > > You are currently subscribed to ntdev as: michal.vodicka@st.com > To unsubscribe send a blank email to xxxxx@lists.osr.com >