Microsoft KB Archive/125712

{|
 * width="100%"|

HOWTO: Opening Volumes Under Windows 95

 * }

Q125712

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * Microsoft Windows 95

-

SUMMARY
Windows 95 does not support opening disk drives or disk partitions with CreateFile, as Windows NT does. Windows 95 also does not support the DeviceIoControl IOCTL APIs, as Windows NT does. Instead, low-level disk access in Windows 95 can be achieved through DeviceIoControl calls to the VWIN32 VxD.

MORE INFORMATION
Windows NT supports obtaining a handle to a disk drive or disk partition by using CreateFile and specifying the name of the drive or partition as the filename (e.g. "\\.\PHYSICALDRIVE0" or "\\.\C:"). This handle can then be used in the DeviceIoControl Win32 API.

Windows 95 differs in the following ways:


 * 1) Obtaining a disk drive or disk partition handle is not supported. The call to CreateFile will fail, and GetLastError will return error code 2, ERROR_FILE_NOT_FOUND.
 * 2) The DeviceIoControl IOCTL functions (such as IOCTL_DISK_FORMAT_TRACKS) are not supported. These IOCTLs require the handle to a disk drive or disk partition and thus can't be used.
 * 3) DeviceIoControl is called using a handle to a VxD rather than a handle to a disk drive or disk partition. Obtain a handle to VWIN32.VXD by using CreateFile( "\\\\.\\VWIN32", ... ). Use this handle in calls to DeviceIoControl to perform volume locking (Int 21h Function 440Dh, Subfunctions 4Ah and 4Bh), and then to perform BIOS calls (Int 13h), Absolute Disk Reads/Writes (Int 25h and 26h), or MS-DOS IOCTL functions (Int 21h Function 440Dh).