Virtual Floppy Drive 2.1

This is a virtual floppy drive for Windows NT / 2000 / XP
(Reported to work also on 2003 Server and Vista).Note !!! This version works only on 32 bit systems !!!
See technical info on 64 bit compilation.

You can mount a floppy image file as a virtual floppy drive and directly access
the contents -- view, edit, rename, delete or create files on a virtual floppy,
format a virtual floppy, launch a program on a virtual floppy... almost anything
you can do with a real floppy.

Changes from 2.1.2005.404 version

Replaced zlib version from 1.2.2 to 1.2.3. Thanks to Stefan Kanthak for pointing out
the security vulnerability of the previous version. (Sorry I didn't respond soon, Stefan).

Since some people seemed to have trouble finding out how to create a new image with
VfdWin, I decided to change the text on "Open" button to "Open/Create".
I hope it helps.

Added platform checking so that VFD does not start on 64 bit OS.

Version display now shows build number (build date, in VFD's case) because
I decided to leave the major and minor versions unchanged.

No change at all to the device driver.

Major changes since 2.0 RC

Changed the name to "Virtual Floppy Drive" from
"Virtual Floppy Driver".
Well, this may seem trivial to you, but it seems more appropriate
to me :-) because while the driver is still the core of this project,
the interface programs have grown to take more and more significant
roles in the whole picture.

Save virtual floppy image into files.
You can save modified RAM disk image into files or
save mounted file image into different files.

Now you can specify either 3.5" or 5.25" for
640KB, 720KB and 1.2MB media.

Now you can specify media size different from the actual file size.
For example, you can mount a 1.44MB image as a 1.2MB media, or you can
use image files with surplus data at the end which some floppy backup
programs create.

Now you can change the driver start method without
reinstalling the driver.

VFD.EXE command line options to suppress prompting.
Now you can run your batch file without interruption.

VFD.EXE interactive console.

Removed the Mount Manager support on Windows 2000 and later.
It was causing a problem that once the driver is stopped it cannot
restart until the system is rebooted.
I may restore the feature when the driver becomes fully Plug &
Play compatible.

Other 2.x major features

2 virtual floppy drives.

FILE mode and RAM mode
In FILE mode, image files are mounted directly.
Changes made in virtual media are written to the file immediately.
In RAM mode, on memory copy of image files are mounted.
Enables to open read-only files as writable media.
Changes are not written back to the image file (discarded on image close).

Formatting virtual media
New images created with VFD are pre-formatted with FAT12.
Enables to format media which Windows' format cannot handle.

Switching write-protection of virtual media on the fly.

Persistent drive letters
A drive letter is not removed when an image is closed.
Drive letters are preserved until explicitly removed.
The same drive letter is assigned the next time the driver starts.
On Windows 2000 SP2 and later, drive letters are not deleted when the
user logged off.
On Windows XP and Terminal Servers drive letters are globally visible.
You can choose between the old (ephemeral) drive letters.

Shell extension
Open/Close an image with the right click menu on the virtual drive icon.
Virtual Floppy Drive property sheet.
Drag-and-drop an image file with the right button to the virtual drive icon
to open it (Windows 2000 and later).

Super FAQ: Current VFD can not create image from or save
to actual floppy disk. Use programs like WinImage or RawWriteWin for that
purpose.

Windows XP Explorer shows virtual drives as removable drives, not as floppy
drives. Also it shows a 5.25" floppy icon if a virtual drive is A: or B:,
and a removable drive icon otherwise. I'd say it's a bug of the Explorer.
Other properly designed programs won't have any such problem.

Windows XP Explorer sometimes doesn't respond properly when you add /
change drive letters of virtual drives. I think it's also an Explorer bug,
because the same thing happens when I change drive letters of a hard drive,
a CD drive, etc.
Restart the Explorer or, if that fails, log off and log on again and the the
virtual drives will be recognized correctly.

Windows 2000/XP Explorer's check disk does not work with VFD drives.
Use command line CHKDSK.EXE instead.

Changing a virtual media between 3.5" and 5.25" does not update the drive type
display of the Explorer. It's just cosmetic. Any programs which have to distinguish
them should recognize the drive type correctly.

Some programs (especially old ones) assume floppy drives to be either A: or B:.
If certain programs don't recognize a VFD drive, try changing the drive letter to
A: or B:.

Recently two people have independently gave me some information
about compiling and running VFD driver on a 64 bit system,
and I decided they are worth sharing here on this page.
Please note that I cannot answer any question on the matter as I myself
have never used a 64 bit system.

A person with a handle name "critical0" gave me the info
and a driver binary compiled for AMD64. Here is an extract from an email
he sent to me:

On Sat, 21 Oct 2006 critical0 wrote:

Third, x64 support is lacking, but not that
difficult to implement.
the driver builds well for AMD64 (i'm using winddk
3790.1830 for win 2003 server x64).
All I had to change was vfdioctl.c line 120 became :
(PULONG)&Irp->IoStatus.Information);
to fix up the warning about incompatible types.
I just switched driver to the one I've built and it
works perfectly.

Igor Levicki also gave me the info about changing
driver code for 64-bit compilation:

On Wed, 22 Nov 2006 Igor Levicki wrote:

This is what you have to change in driver code
to enable compilation for 64-bit platform:
vfdimg.c:
466:
< OUT PULONG ReturnLength)
> OUT ULONG_PTR* ReturnLength)
vfddrv.h
< OUT PULONG ReturnLength);
> OUT ULONG_PTR* ReturnLength);
Rationale behind this change is that in ntddk.h
IoStatus.Information field is defined as ULONG_PTR,
and not ULONG.
In case you don't know the difference, ULONG_PTR is
defined as unsigned __int3264 while ULONG is just
unsigned long. So, ULONG_PTR should be used for
portability reasons.

NOTE: Both critical0's and Igor's
suggestions take different approaches to the same problem.
Igor has pointed out that type casting from ULONG_PTR * to
PULONG, which appears in critical0's fix, is unsafe and
I agree that type casting in general can be dangerous.
However, in this particular case, I believe that critical0's
fix is reasonably safe. Because the address referred to
by the pointer in question is first initialized properly
with 0 and a value to be stored in that address never gets
to be negative or exceeds 300 or so, which is not even
close to the 32 bit limitation.

NOTE2: According to Igor, type casting
method has another drawback in terms of processor and memory
bus cycles. So you should take Igor's suggestion when you
build a 64-bit binary yourself . However if you cannot build
it yourself, I still believe that critical0's binary is not
likely to crash or anything. Sorry for inconvenience but
I'm not going to build and distribute a 64-bit binary myself
for the time being, largely because I cannot even confirm
that my build works on a 64-bit system.
At least critical0's binary actually works for him.