R
Robert Green
FromTheRafters said:[snip]
This long thread has left me puzzled. If NT-based versions of Windows
don't allow any low-level access to floppies, how does a Windows NT/2K/XP
user format a floppy disk for use?
I think that it is only application level software that is denied low-level
access, and I'm not too sure what the OS replaces the BIOS routines
with. Witty apparently found a way to circumvent the barrier between
application and system software, as yet I haven't seen it explained.
This should help clarify the matter:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp
<QUOTE>
Physical Disks and Volumes
You can use the CreateFile function to open a physical disk drive or a
volume. The function returns a handle that can be used with the
DeviceIoControl function. This enables you to access the disk's
partition table. It is potentially dangerous to do so, since an
incorrect write to a disk could make its contents inaccessible. The
following requirements must be met for such a call to succeed:
The caller must have administrative privileges. For more information,
see Running with Special Privileges.
The dwCreationDisposition parameter must have the OPEN_EXISTING flag.
When opening a volume or floppy disk, the dwShareMode parameter must
have the FILE_SHARE_WRITE flag.
When opening a physical drive, x, the lpFileName string should be of
the form \\.\PHYSICALDRIVE<x>. Hard disk numbers start at zero. The
following table shows some example physical drive strings.
String Meaning
\\.\PHYSICALDRIVE0 Opens the first physical drive.
\\.\PHYSICALDRIVE2 Opens the third physical drive.
For an example showing how to open a physical drive, see Calling
DeviceIoControl.
When opening a volume or floppy drive, the lpFileName string should be
of the form \\.\<x>:. Do not use a trailing backslash. This would
indicate the root directory of the drive. The following table shows
some example drive strings.
String Meaning
\\.\A: Opens drive A (floppy drive).
\\.\C: Opens drive C (volume).
You can also open a volume by referring to its volume name. For more
information, see Naming a Volume.
</QUOTE>
Bob