From: SMTP%"htolley@lardav.com" 31-DEC-1997 17:01:52.81 To: ntdev@atria.com CC: Subj: [ntdev] direct reading of disk sectors under win 95 Return-Path: owner-ntdev@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Wed, 31 Dec 1997 17:01:40 -0500 Received: by gw.atria.com id Wed, 31 Dec 1997 13:36:14 -0500 Received: from pub.lardav.com by gw.atria.com id Wed, 31 Dec 1997 13:36:10 -0500 Received: from dino.lardav.com (mailhost.54.141.207.in-addr.arpa [207.141.54.45] (may be forged)) by pub.lardav.com (8.8.8/8.8.3) with SMTP id LAA21380 for ; Wed, 31 Dec 1997 11:35:40 -0700 (MST) Received: from lardav.com by dino.lardav.com (SMI-8.6/SMI-SVR4) id LAA04438; Wed, 31 Dec 1997 11:35:38 -0700 Received: from LDI/SpoolDir by lardav.com (Mercury 1.21); 31 Dec 97 11:35:38 -0700 Received: from SpoolDir by LDI (Mercury 1.30); 31 Dec 97 11:35:22 -0700 From: "Hal D. Tolley ... Sensar" Organization: Larson-Davis, Inc. To: ntdev@atria.com Date: Wed, 31 Dec 1997 11:35:16 MST7MDT Subject: [ntdev] direct reading of disk sectors under win 95 Reply-to: htolley@lardav.com X-mailer: Pegasus Mail for Windows (v2.53/R1) Message-ID: <14ABA6B6EC5@lardav.com> Sender: owner-ntdev@atria.com Precedence: bulk X-Majordomo-Taboo: ntdev I cannot remember who asked this question but here is a copy of a KB article that will steer you in the right direction. -Hal ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: PSS ID Number: Q125712 Article last modified on 09-25-1995 4.00 WINDOWS ---------------------------------------------------------------------- --- The information in this article applies to: - Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows 95 version 4.0 ---------------------------------------------------------------------- --- 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). REFERENCES ========== For information on using DeviceIoControl() in Windows 95 and the IOCTL functions supported by the VWIN32 VxD, please see the help file "Windows 95 Guide to Programming". Go to "Using Windows 95 features" and select "Using Device I/O Control." For information on using CreateFile() to obtain disk drive or disk partition handles under Windows NT, see the description for CreateFile() in the Microsoft Windows Programmer's Reference, Volume 3. For information on Windows 95 extensions to the MS-DOS interrupts, please see the help file "Windows 95 Guide to Programming." Go to "Using Microsoft MS-DOS Extensions" and select "Exclusive Volume Locking", then "About Exclusive Volume Locking", then "Exclusive Use Lock". For a complete list of IOCTLs, see the description of the DeviceIoControl() function in the Microsoft Windows Programmer's Reference, Volume 3. Additional reference words: 4.00 KBCategory: kbprg KBSubcategory: BseFileio ====================================================================== ======= Copyright Microsoft Corporation 1995. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]