The information in this article applies to:
SUMMARYTo open a physical hard drive for direct disk access (raw I/O) in a Win32-based application, use a device name of the form \\.\PhysicalDriveNwhere N is 0, 1, 2, and so forth, representing each of the physical drives in the system. To open a logical drive, direct access is of the form \\.\X:where X: is a hard-drive partition letter, floppy disk drive, or CD-ROM drive. MORE INFORMATION
You can open a physical or logical drive using the CreateFile() application
programming interface (API) with these device names provided that you have
the appropriate access rights to the drive (that is, you must be an
administrator). You must use both the CreateFile() FILE_SHARE_READ and
FILE_SHARE_WRITE flags to gain access to the drive.
\Device\CdRom0does not work because this is not a valid Win32 device name. An application can use the QueryDosDevice() API to get a list of all valid Win32 device names and see the mapping between a particular Win32 device name and an internal Windows NT object name. An application running at a sufficient privilege level can define, redefine, or delete Win32 device mappings by calling the DefineDosDevice() API. Additional query words:
Keywords : kbAPI kbFileIO kbKernBase kbWinOS2000 kbDSupport kbGrpKernBase |
Last Reviewed: December 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |