JwaWinIoctl.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:173k
源码类别:
Windows编程
开发平台:
Delphi
- {******************************************************************************}
- { }
- { I/O Control Codes API interface Unit for Object Pascal }
- { }
- { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
- { Corporation. All Rights Reserved. }
- { }
- { The original file is: winioctl.h, released June 2000. The original Pascal }
- { code is: WinIoCtl.pas, released December 2000. The initial developer of the }
- { Pascal code is Marcel van Brakel (brakelm@chello.nl). }
- { }
- { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
- { Marcel van Brakel. All Rights Reserved. }
- { }
- { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
- { }
- { You may retrieve the latest version of this file at the Project JEDI home }
- { page, located at http://delphi-jedi.org or my personal homepage located at }
- { http://members.chello.nl/m.vanbrakel2 }
- { }
- { The contents of this file are used with permission, subject to the Mozilla }
- { Public License Version 1.1 (the "License"); you may not use this file except }
- { in compliance with the License. You may obtain a copy of the License at }
- { http://www.mozilla.org/MPL/MPL-1.1.html }
- { }
- { Software distributed under the License is distributed on an "AS IS" basis, }
- { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
- { the specific language governing rights and limitations under the License. }
- { }
- { Alternatively, the contents of this file may be used under the terms of the }
- { GNU Lesser General Public License (the "LGPL License"), in which case the }
- { provisions of the LGPL License are applicable instead of those above. }
- { If you wish to allow use of your version of this file only under the terms }
- { of the LGPL License and not to allow others to use your version of this file }
- { under the MPL, indicate your decision by deleting the provisions above and }
- { replace them with the notice and other provisions required by the LGPL }
- { License. If you do not delete the provisions above, a recipient may use }
- { your version of this file under either the MPL or the LGPL License. }
- { }
- { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
- { }
- {******************************************************************************}
- unit JwaWinIoctl;
- {$WEAKPACKAGEUNIT}
- {$HPPEMIT ''}
- {$HPPEMIT '#include "WinIoCtl.h"'}
- {$HPPEMIT ''}
- {$I WINDEFINES.INC}
- interface
- uses
- JwaWinNT, JwaWinType;
- //
- // Device interface class GUIDs.
- //
- // need these GUIDs outside conditional includes so that user can
- // #include <winioctl.h> in precompiled header
- // #include <initguid.h> in a single source file
- // #include <winioctl.h> in that source file a second time to instantiate the GUIDs
- //
- const
- GUID_DEVINTERFACE_DISK: TGUID = (
- D1:$53f56307; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_DISK}
- GUID_DEVINTERFACE_CDROM: TGUID = (
- D1:$53f56308; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_CDROM}
- GUID_DEVINTERFACE_PARTITION: TGUID = (
- D1:$53f5630a; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_PARTITION}
- GUID_DEVINTERFACE_TAPE: TGUID = (
- D1:$53f5630b; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_TAPE}
- GUID_DEVINTERFACE_WRITEONCEDISK: TGUID = (
- D1:$53f5630c; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_WRITEONCEDISK}
- GUID_DEVINTERFACE_VOLUME: TGUID = (
- D1:$53f5630d; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_VOLUME}
- GUID_DEVINTERFACE_MEDIUMCHANGER: TGUID = (
- D1:$53f56310; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_MEDIUMCHANGER}
- GUID_DEVINTERFACE_FLOPPY: TGUID = (
- D1:$53f56311; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_FLOPPY}
- GUID_DEVINTERFACE_CDCHANGER: TGUID = (
- D1:$53f56312; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_CDCHANGER}
- GUID_DEVINTERFACE_STORAGEPORT: TGUID = (
- D1:$2accfe60; D2:$c130; D3:$11d2; D4:($b0, $82, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM GUID_DEVINTERFACE_STORAGEPORT}
- GUID_DEVINTERFACE_COMPORT: TGUID = (
- D1:$86e0d1e0; D2:$8089; D3:$11d0; D4:($9c, $e4, $08, $00, $3e, $30, $1f, $73));
- {$EXTERNALSYM GUID_DEVINTERFACE_COMPORT}
- GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR: TGUID = (
- D1:$4D36E978; D2:$E325; D3:$11CE; D4:($BF, $C1, $08, $00, $2B, $E1, $03, $18));
- {$EXTERNALSYM GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR}
- //
- // Obsolete device interface class GUID names.
- // (use of above GUID_DEVINTERFACE_* names is recommended).
- //
- // MVB: Note that these "constants" are in reality aliases for the list above. Unfortunately you can't
- // define a GUID without using a type constant and you can't alias a type constant in Delphi...
- DiskClassGuid: TGUID = (
- D1:$53f56307; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM DiskClassGuid}
- CdRomClassGuid: TGUID = (
- D1:$53f56308; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM CdRomClassGuid}
- PartitionClassGuid: TGUID = (
- D1:$53f5630a; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM PartitionClassGuid}
- TapeClassGuid: TGUID = (
- D1:$53f5630b; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM TapeClassGuid}
- WriteOnceDiskClassGuid: TGUID = (
- D1:$53f5630c; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM WriteOnceDiskClassGuid}
- VolumeClassGuid: TGUID = (
- D1:$53f5630d; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM VolumeClassGuid}
- MediumChangerClassGuid: TGUID = (
- D1:$53f56310; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM MediumChangerClassGuid}
- FloppyClassGuid: TGUID = (
- D1:$53f56311; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM FloppyClassGuid}
- CdChangerClassGuid: TGUID = (
- D1:$53f56312; D2:$b6bf; D3:$11d0; D4:($94, $f2, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM CdChangerClassGuid}
- StoragePortClassGuid: TGUID = (
- D1:$2accfe60; D2:$c130; D3:$11d2; D4:($b0, $82, $00, $a0, $c9, $1e, $fb, $8b));
- {$EXTERNALSYM StoragePortClassGuid}
- GUID_CLASS_COMPORT: TGUID = (
- D1:$86e0d1e0; D2:$8089; D3:$11d0; D4:($9c, $e4, $08, $00, $3e, $30, $1f, $73));
- {$EXTERNALSYM GUID_CLASS_COMPORT}
- GUID_SERENUM_BUS_ENUMERATOR: TGUID = (
- D1:$4D36E978; D2:$E325; D3:$11CE; D4:($BF, $C1, $08, $00, $2B, $E1, $03, $18));
- {$EXTERNALSYM GUID_SERENUM_BUS_ENUMERATOR}
- //
- // Define the various device type values. Note that values used by Microsoft
- // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
- // by customers.
- //
- type
- DEVICE_TYPE = DWORD;
- {$EXTERNALSYM DEVICE_TYPE}
- const
- FILE_DEVICE_BEEP = $00000001;
- {$EXTERNALSYM FILE_DEVICE_BEEP}
- FILE_DEVICE_CD_ROM = $00000002;
- {$EXTERNALSYM FILE_DEVICE_CD_ROM}
- FILE_DEVICE_CD_ROM_FILE_SYSTEM = $00000003;
- {$EXTERNALSYM FILE_DEVICE_CD_ROM_FILE_SYSTEM}
- FILE_DEVICE_CONTROLLER = $00000004;
- {$EXTERNALSYM FILE_DEVICE_CONTROLLER}
- FILE_DEVICE_DATALINK = $00000005;
- {$EXTERNALSYM FILE_DEVICE_DATALINK}
- FILE_DEVICE_DFS = $00000006;
- {$EXTERNALSYM FILE_DEVICE_DFS}
- FILE_DEVICE_DISK = $00000007;
- {$EXTERNALSYM FILE_DEVICE_DISK}
- FILE_DEVICE_DISK_FILE_SYSTEM = $00000008;
- {$EXTERNALSYM FILE_DEVICE_DISK_FILE_SYSTEM}
- FILE_DEVICE_FILE_SYSTEM = $00000009;
- {$EXTERNALSYM FILE_DEVICE_FILE_SYSTEM}
- FILE_DEVICE_INPORT_PORT = $0000000a;
- {$EXTERNALSYM FILE_DEVICE_INPORT_PORT}
- FILE_DEVICE_KEYBOARD = $0000000b;
- {$EXTERNALSYM FILE_DEVICE_KEYBOARD}
- FILE_DEVICE_MAILSLOT = $0000000c;
- {$EXTERNALSYM FILE_DEVICE_MAILSLOT}
- FILE_DEVICE_MIDI_IN = $0000000d;
- {$EXTERNALSYM FILE_DEVICE_MIDI_IN}
- FILE_DEVICE_MIDI_OUT = $0000000e;
- {$EXTERNALSYM FILE_DEVICE_MIDI_OUT}
- FILE_DEVICE_MOUSE = $0000000f;
- {$EXTERNALSYM FILE_DEVICE_MOUSE}
- FILE_DEVICE_MULTI_UNC_PROVIDER = $00000010;
- {$EXTERNALSYM FILE_DEVICE_MULTI_UNC_PROVIDER}
- FILE_DEVICE_NAMED_PIPE = $00000011;
- {$EXTERNALSYM FILE_DEVICE_NAMED_PIPE}
- FILE_DEVICE_NETWORK = $00000012;
- {$EXTERNALSYM FILE_DEVICE_NETWORK}
- FILE_DEVICE_NETWORK_BROWSER = $00000013;
- {$EXTERNALSYM FILE_DEVICE_NETWORK_BROWSER}
- FILE_DEVICE_NETWORK_FILE_SYSTEM = $00000014;
- {$EXTERNALSYM FILE_DEVICE_NETWORK_FILE_SYSTEM}
- FILE_DEVICE_NULL = $00000015;
- {$EXTERNALSYM FILE_DEVICE_NULL}
- FILE_DEVICE_PARALLEL_PORT = $00000016;
- {$EXTERNALSYM FILE_DEVICE_PARALLEL_PORT}
- FILE_DEVICE_PHYSICAL_NETCARD = $00000017;
- {$EXTERNALSYM FILE_DEVICE_PHYSICAL_NETCARD}
- FILE_DEVICE_PRINTER = $00000018;
- {$EXTERNALSYM FILE_DEVICE_PRINTER}
- FILE_DEVICE_SCANNER = $00000019;
- {$EXTERNALSYM FILE_DEVICE_SCANNER}
- FILE_DEVICE_SERIAL_MOUSE_PORT = $0000001a;
- {$EXTERNALSYM FILE_DEVICE_SERIAL_MOUSE_PORT}
- FILE_DEVICE_SERIAL_PORT = $0000001b;
- {$EXTERNALSYM FILE_DEVICE_SERIAL_PORT}
- FILE_DEVICE_SCREEN = $0000001c;
- {$EXTERNALSYM FILE_DEVICE_SCREEN}
- FILE_DEVICE_SOUND = $0000001d;
- {$EXTERNALSYM FILE_DEVICE_SOUND}
- FILE_DEVICE_STREAMS = $0000001e;
- {$EXTERNALSYM FILE_DEVICE_STREAMS}
- FILE_DEVICE_TAPE = $0000001f;
- {$EXTERNALSYM FILE_DEVICE_TAPE}
- FILE_DEVICE_TAPE_FILE_SYSTEM = $00000020;
- {$EXTERNALSYM FILE_DEVICE_TAPE_FILE_SYSTEM}
- FILE_DEVICE_TRANSPORT = $00000021;
- {$EXTERNALSYM FILE_DEVICE_TRANSPORT}
- FILE_DEVICE_UNKNOWN = $00000022;
- {$EXTERNALSYM FILE_DEVICE_UNKNOWN}
- FILE_DEVICE_VIDEO = $00000023;
- {$EXTERNALSYM FILE_DEVICE_VIDEO}
- FILE_DEVICE_VIRTUAL_DISK = $00000024;
- {$EXTERNALSYM FILE_DEVICE_VIRTUAL_DISK}
- FILE_DEVICE_WAVE_IN = $00000025;
- {$EXTERNALSYM FILE_DEVICE_WAVE_IN}
- FILE_DEVICE_WAVE_OUT = $00000026;
- {$EXTERNALSYM FILE_DEVICE_WAVE_OUT}
- FILE_DEVICE_8042_PORT = $00000027;
- {$EXTERNALSYM FILE_DEVICE_8042_PORT}
- FILE_DEVICE_NETWORK_REDIRECTOR = $00000028;
- {$EXTERNALSYM FILE_DEVICE_NETWORK_REDIRECTOR}
- FILE_DEVICE_BATTERY = $00000029;
- {$EXTERNALSYM FILE_DEVICE_BATTERY}
- FILE_DEVICE_BUS_EXTENDER = $0000002a;
- {$EXTERNALSYM FILE_DEVICE_BUS_EXTENDER}
- FILE_DEVICE_MODEM = $0000002b;
- {$EXTERNALSYM FILE_DEVICE_MODEM}
- FILE_DEVICE_VDM = $0000002c;
- {$EXTERNALSYM FILE_DEVICE_VDM}
- FILE_DEVICE_MASS_STORAGE = $0000002d;
- {$EXTERNALSYM FILE_DEVICE_MASS_STORAGE}
- FILE_DEVICE_SMB = $0000002e;
- {$EXTERNALSYM FILE_DEVICE_SMB}
- FILE_DEVICE_KS = $0000002f;
- {$EXTERNALSYM FILE_DEVICE_KS}
- FILE_DEVICE_CHANGER = $00000030;
- {$EXTERNALSYM FILE_DEVICE_CHANGER}
- FILE_DEVICE_SMARTCARD = $00000031;
- {$EXTERNALSYM FILE_DEVICE_SMARTCARD}
- FILE_DEVICE_ACPI = $00000032;
- {$EXTERNALSYM FILE_DEVICE_ACPI}
- FILE_DEVICE_DVD = $00000033;
- {$EXTERNALSYM FILE_DEVICE_DVD}
- FILE_DEVICE_FULLSCREEN_VIDEO = $00000034;
- {$EXTERNALSYM FILE_DEVICE_FULLSCREEN_VIDEO}
- FILE_DEVICE_DFS_FILE_SYSTEM = $00000035;
- {$EXTERNALSYM FILE_DEVICE_DFS_FILE_SYSTEM}
- FILE_DEVICE_DFS_VOLUME = $00000036;
- {$EXTERNALSYM FILE_DEVICE_DFS_VOLUME}
- FILE_DEVICE_SERENUM = $00000037;
- {$EXTERNALSYM FILE_DEVICE_SERENUM}
- FILE_DEVICE_TERMSRV = $00000038;
- {$EXTERNALSYM FILE_DEVICE_TERMSRV}
- FILE_DEVICE_KSEC = $00000039;
- {$EXTERNALSYM FILE_DEVICE_KSEC}
- FILE_DEVICE_FIPS = $0000003A;
- {$EXTERNALSYM FILE_DEVICE_FIPS}
- FILE_DEVICE_INFINIBAND = $0000003B;
- {$EXTERNALSYM FILE_DEVICE_INFINIBAND}
- //
- // Macro definition for defining IOCTL and FSCTL function control codes. Note
- // that function codes 0-2047 are reserved for Microsoft Corporation, and
- // 2048-4095 are reserved for customers.
- //
- function CTL_CODE(DeviceType, Func, Method, Access: WORD): DWORD;
- {$EXTERNALSYM CTL_CODE}
- //
- // Macro to extract device type out of the device io control code
- //
- function DEVICE_TYPE_FROM_CTL_CODE(CtrlCode: DWORD): WORD;
- {$EXTERNALSYM DEVICE_TYPE_FROM_CTL_CODE}
- //
- // Define the method codes for how buffers are passed for I/O and FS controls
- //
- const
- METHOD_BUFFERED = 0;
- {$EXTERNALSYM METHOD_BUFFERED}
- METHOD_IN_DIRECT = 1;
- {$EXTERNALSYM METHOD_IN_DIRECT}
- METHOD_OUT_DIRECT = 2;
- {$EXTERNALSYM METHOD_OUT_DIRECT}
- METHOD_NEITHER = 3;
- {$EXTERNALSYM METHOD_NEITHER}
- //
- // Define some easier to comprehend aliases:
- // METHOD_DIRECT_TO_HARDWARE (writes, aka METHOD_IN_DIRECT)
- // METHOD_DIRECT_FROM_HARDWARE (reads, aka METHOD_OUT_DIRECT)
- //
- METHOD_DIRECT_TO_HARDWARE = METHOD_OUT_DIRECT;
- {$EXTERNALSYM METHOD_DIRECT_TO_HARDWARE}
- METHOD_DIRECT_FROM_HARDWARE = METHOD_IN_DIRECT;
- {$EXTERNALSYM METHOD_DIRECT_FROM_HARDWARE}
- //
- // Define the access check value for any access
- //
- //
- // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
- // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
- // constants *MUST* always be in sync.
- //
- //
- // FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS.
- // The file systems, however, may add additional access checks for I/O and FS controls
- // that use this value.
- //
- const
- FILE_ANY_ACCESS = 0;
- {$EXTERNALSYM FILE_ANY_ACCESS}
- FILE_SPECIAL_ACCESS = FILE_ANY_ACCESS;
- {$EXTERNALSYM FILE_SPECIAL_ACCESS}
- FILE_READ_ACCESS = $0001; // file & pipe
- {$EXTERNALSYM FILE_READ_ACCESS}
- FILE_WRITE_ACCESS = $0002; // file & pipe
- {$EXTERNALSYM FILE_WRITE_ACCESS}
- //
- // IoControlCode values for storage devices
- //
- IOCTL_STORAGE_BASE = FILE_DEVICE_MASS_STORAGE;
- {$EXTERNALSYM IOCTL_STORAGE_BASE}
- //
- // The following device control codes are common for all class drivers. They
- // should be used in place of the older IOCTL_DISK, IOCTL_CDROM and IOCTL_TAPE
- // common codes
- //
- const
- IOCTL_STORAGE_CHECK_VERIFY = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0200 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_CHECK_VERIFY}
- IOCTL_STORAGE_CHECK_VERIFY2 = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0200 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_CHECK_VERIFY2}
- IOCTL_STORAGE_MEDIA_REMOVAL = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0201 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_MEDIA_REMOVAL}
- IOCTL_STORAGE_EJECT_MEDIA = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0202 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_EJECT_MEDIA}
- IOCTL_STORAGE_LOAD_MEDIA = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0203 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_LOAD_MEDIA}
- IOCTL_STORAGE_LOAD_MEDIA2 = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0203 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_LOAD_MEDIA2}
- IOCTL_STORAGE_RESERVE = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0204 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_RESERVE}
- IOCTL_STORAGE_RELEASE = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0205 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_RELEASE}
- IOCTL_STORAGE_FIND_NEW_DEVICES = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0206 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_FIND_NEW_DEVICES}
- IOCTL_STORAGE_EJECTION_CONTROL = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0250 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_EJECTION_CONTROL}
- IOCTL_STORAGE_MCN_CONTROL = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0251 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_MCN_CONTROL}
- IOCTL_STORAGE_GET_MEDIA_TYPES = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0300 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_GET_MEDIA_TYPES}
- IOCTL_STORAGE_GET_MEDIA_TYPES_EX = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0301 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_GET_MEDIA_TYPES_EX}
- IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0304 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER}
- IOCTL_STORAGE_GET_HOTPLUG_INFO = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0305 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_GET_HOTPLUG_INFO}
- IOCTL_STORAGE_SET_HOTPLUG_INFO = (
- (IOCTL_STORAGE_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0306 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_SET_HOTPLUG_INFO}
- IOCTL_STORAGE_RESET_BUS = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0400 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_RESET_BUS}
- IOCTL_STORAGE_RESET_DEVICE = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0401 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_RESET_DEVICE}
- IOCTL_STORAGE_BREAK_RESERVATION = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0405 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_BREAK_RESERVATION}
- IOCTL_STORAGE_GET_DEVICE_NUMBER = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0420 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_GET_DEVICE_NUMBER}
- IOCTL_STORAGE_PREDICT_FAILURE = (
- (IOCTL_STORAGE_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0440 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_STORAGE_PREDICT_FAILURE}
- //
- // These ioctl codes are obsolete. They are defined here to avoid resuing them
- // and to allow class drivers to respond to them more easily.
- //
- OBSOLETE_IOCTL_STORAGE_RESET_BUS = (
- (IOCTL_STORAGE_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0400 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM OBSOLETE_IOCTL_STORAGE_RESET_BUS}
- OBSOLETE_IOCTL_STORAGE_RESET_DEVICE = (
- (IOCTL_STORAGE_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0401 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM OBSOLETE_IOCTL_STORAGE_RESET_DEVICE}
- //
- // IOCTL_STORAGE_GET_HOTPLUG_INFO
- //
- type
- PSTORAGE_HOTPLUG_INFO = ^STORAGE_HOTPLUG_INFO;
- {$EXTERNALSYM PSTORAGE_HOTPLUG_INFO}
- _STORAGE_HOTPLUG_INFO = record
- Size: DWORD; // version
- MediaRemovable: BOOLEAN; // ie. zip, jaz, cdrom, mo, etc. vs hdd
- MediaHotplug: BOOLEAN; // ie. does the device succeed a lock even though its not lockable media?
- DeviceHotplug: BOOLEAN; // ie. 1394, USB, etc.
- WriteCacheEnableOverride: BOOLEAN; // This field should not be relied upon because it is no longer used
- end;
- {$EXTERNALSYM _STORAGE_HOTPLUG_INFO}
- STORAGE_HOTPLUG_INFO = _STORAGE_HOTPLUG_INFO;
- {$EXTERNALSYM STORAGE_HOTPLUG_INFO}
- TStorageHotplugInfo = STORAGE_HOTPLUG_INFO;
- PStorageHotplugInfo = PSTORAGE_HOTPLUG_INFO;
- //
- // IOCTL_STORAGE_GET_DEVICE_NUMBER
- //
- // input - none
- //
- // output - STORAGE_DEVICE_NUMBER structure
- // The values in the STORAGE_DEVICE_NUMBER structure are guaranteed
- // to remain unchanged until the system is rebooted. They are not
- // guaranteed to be persistant across boots.
- //
- type
- PSTORAGE_DEVICE_NUMBER = ^STORAGE_DEVICE_NUMBER;
- {$EXTERNALSYM PSTORAGE_DEVICE_NUMBER}
- _STORAGE_DEVICE_NUMBER = record
- //
- // The FILE_DEVICE_XXX type for this device.
- //
- DeviceType: DEVICE_TYPE;
- //
- // The number of this device
- //
- DeviceNumber: DWORD;
- //
- // If the device is partitionable, the partition number of the device.
- // Otherwise -1
- //
- PartitionNumber: DWORD;
- end;
- {$EXTERNALSYM _STORAGE_DEVICE_NUMBER}
- STORAGE_DEVICE_NUMBER = _STORAGE_DEVICE_NUMBER;
- {$EXTERNALSYM STORAGE_DEVICE_NUMBER}
- TStorageDeviceNumber = STORAGE_DEVICE_NUMBER;
- PStorageDeviceNumber = PSTORAGE_DEVICE_NUMBER;
- //
- // Define the structures for scsi resets
- //
- PSTORAGE_BUS_RESET_REQUEST = ^STORAGE_BUS_RESET_REQUEST;
- {$EXTERNALSYM PSTORAGE_BUS_RESET_REQUEST}
- _STORAGE_BUS_RESET_REQUEST = record
- PathId: BYTE;
- end;
- {$EXTERNALSYM _STORAGE_BUS_RESET_REQUEST}
- STORAGE_BUS_RESET_REQUEST = _STORAGE_BUS_RESET_REQUEST;
- {$EXTERNALSYM STORAGE_BUS_RESET_REQUEST}
- TStorageBusResetRequest = STORAGE_BUS_RESET_REQUEST;
- PStorageBusResetRequest = PSTORAGE_BUS_RESET_REQUEST;
- //
- // IOCTL_STORAGE_MEDIA_REMOVAL disables the mechanism
- // on a storage device that ejects media. This function
- // may or may not be supported on storage devices that
- // support removable media.
- //
- // TRUE means prevent media from being removed.
- // FALSE means allow media removal.
- //
- PPREVENT_MEDIA_REMOVAL = ^PREVENT_MEDIA_REMOVAL;
- {$EXTERNALSYM PPREVENT_MEDIA_REMOVAL}
- _PREVENT_MEDIA_REMOVAL = record
- PreventMediaRemoval: ByteBool;
- end;
- {$EXTERNALSYM _PREVENT_MEDIA_REMOVAL}
- PREVENT_MEDIA_REMOVAL = _PREVENT_MEDIA_REMOVAL;
- {$EXTERNALSYM PREVENT_MEDIA_REMOVAL}
- TPreventMediaRemoval = PREVENT_MEDIA_REMOVAL;
- PPreventMediaRemoval = PPREVENT_MEDIA_REMOVAL;
- //
- // This is the format of TARGET_DEVICE_CUSTOM_NOTIFICATION.CustomDataBuffer
- // passed to applications by the classpnp autorun code (via IoReportTargetDeviceChangeAsynchronous).
- //
- _CLASS_MEDIA_CHANGE_CONTEXT = record
- MediaChangeCount: DWORD;
- NewState: DWORD; // see MEDIA_CHANGE_DETECTION_STATE enum in classpnp.h in DDK
- end;
- {$EXTERNALSYM _CLASS_MEDIA_CHANGE_CONTEXT}
- CLASS_MEDIA_CHANGE_CONTEXT = _CLASS_MEDIA_CHANGE_CONTEXT;
- {$EXTERNALSYM CLASS_MEDIA_CHANGE_CONTEXT}
- PCLASS_MEDIA_CHANGE_CONTEXT = ^CLASS_MEDIA_CHANGE_CONTEXT;
- {$EXTERNALSYM PCLASS_MEDIA_CHANGE_CONTEXT}
- TClassMediaChangeContext = CLASS_MEDIA_CHANGE_CONTEXT;
- PClassMediaChangeContext = PCLASS_MEDIA_CHANGE_CONTEXT;
- PTAPE_STATISTICS = ^TAPE_STATISTICS;
- {$EXTERNALSYM PTAPE_STATISTICS}
- _TAPE_STATISTICS = record
- Version: DWORD;
- Flags: DWORD;
- RecoveredWrites: LARGE_INTEGER;
- UnrecoveredWrites: LARGE_INTEGER;
- RecoveredReads: LARGE_INTEGER;
- UnrecoveredReads: LARGE_INTEGER;
- CompressionRatioReads: BYTE;
- CompressionRatioWrites: BYTE;
- end;
- {$EXTERNALSYM _TAPE_STATISTICS}
- TAPE_STATISTICS = _TAPE_STATISTICS;
- {$EXTERNALSYM TAPE_STATISTICS}
- TTapeStatistics = TAPE_STATISTICS;
- PTapeStatistics = PTAPE_STATISTICS;
- const
- RECOVERED_WRITES_VALID = $00000001;
- {$EXTERNALSYM RECOVERED_WRITES_VALID}
- UNRECOVERED_WRITES_VALID = $00000002;
- {$EXTERNALSYM UNRECOVERED_WRITES_VALID}
- RECOVERED_READS_VALID = $00000004;
- {$EXTERNALSYM RECOVERED_READS_VALID}
- UNRECOVERED_READS_VALID = $00000008;
- {$EXTERNALSYM UNRECOVERED_READS_VALID}
- WRITE_COMPRESSION_INFO_VALID = $00000010;
- {$EXTERNALSYM WRITE_COMPRESSION_INFO_VALID}
- READ_COMPRESSION_INFO_VALID = $00000020;
- {$EXTERNALSYM READ_COMPRESSION_INFO_VALID}
- type
- PTAPE_GET_STATISTICS = ^TAPE_GET_STATISTICS;
- {$EXTERNALSYM PTAPE_GET_STATISTICS}
- _TAPE_GET_STATISTICS = record
- Operation: DWORD;
- end;
- {$EXTERNALSYM _TAPE_GET_STATISTICS}
- TAPE_GET_STATISTICS = _TAPE_GET_STATISTICS;
- {$EXTERNALSYM TAPE_GET_STATISTICS}
- TTapeGetStatistics = TAPE_GET_STATISTICS;
- PTapeGetStatistics = PTAPE_GET_STATISTICS;
- const
- TAPE_RETURN_STATISTICS = 0;
- {$EXTERNALSYM TAPE_RETURN_STATISTICS}
- TAPE_RETURN_ENV_INFO = 1;
- {$EXTERNALSYM TAPE_RETURN_ENV_INFO}
- TAPE_RESET_STATISTICS = 2;
- {$EXTERNALSYM TAPE_RESET_STATISTICS}
- //
- // IOCTL_STORAGE_GET_MEDIA_TYPES_EX will return an array of DEVICE_MEDIA_INFO
- // structures, one per supported type, embedded in the GET_MEDIA_TYPES struct.
- //
- const
- //
- // Following are defined in ntdddisk.h in the MEDIA_TYPE enum
- //
- // Unknown, // Format is unknown
- // F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
- // F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
- // F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
- // F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
- // F3_720_512, // 3.5", 720KB, 512 bytes/sector
- // F5_360_512, // 5.25", 360KB, 512 bytes/sector
- // F5_320_512, // 5.25", 320KB, 512 bytes/sector
- // F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
- // F5_180_512, // 5.25", 180KB, 512 bytes/sector
- // F5_160_512, // 5.25", 160KB, 512 bytes/sector
- // RemovableMedia, // Removable media other than floppy
- // FixedMedia, // Fixed hard disk media
- // F3_120M_512, // 3.5", 120M Floppy
- // F3_640_512, // 3.5" , 640KB, 512 bytes/sector
- // F5_640_512, // 5.25", 640KB, 512 bytes/sector
- // F5_720_512, // 5.25", 720KB, 512 bytes/sector
- // F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
- // F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
- // F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
- // F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
- // F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
- // F8_256_128, // 8", 256KB, 128 bytes/sector
- // F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
- //
- DDS_4mm = $20; // Tape - DAT DDS1,2,... (all vendors)
- MiniQic = $21; // Tape - miniQIC Tape
- Travan = $22; // Tape - Travan TR-1,2,3,...
- QIC = $23; // Tape - QIC
- MP_8mm = $24; // Tape - 8mm Exabyte Metal Particle
- AME_8mm = $25; // Tape - 8mm Exabyte Advanced Metal Evap
- AIT1_8mm = $26; // Tape - 8mm Sony AIT
- DLT = $27; // Tape - DLT Compact IIIxt, IV
- NCTP = $28; // Tape - Philips NCTP
- IBM_3480 = $29; // Tape - IBM 3480
- IBM_3490E = $2A; // Tape - IBM 3490E
- IBM_Magstar_3590 = $2B; // Tape - IBM Magstar 3590
- IBM_Magstar_MP = $2C; // Tape - IBM Magstar MP
- STK_DATA_D3 = $2D; // Tape - STK Data D3
- SONY_DTF = $2E; // Tape - Sony DTF
- DV_6mm = $2F; // Tape - 6mm Digital Video
- DMI = $30; // Tape - Exabyte DMI and compatibles
- SONY_D2 = $31; // Tape - Sony D2S and D2L
- CLEANER_CARTRIDGE = $32; // Cleaner - All Drive types that support Drive Cleaners
- CD_ROM = $33; // Opt_Disk - CD
- CD_R = $34; // Opt_Disk - CD-Recordable (Write Once)
- CD_RW = $35; // Opt_Disk - CD-Rewriteable
- DVD_ROM = $36; // Opt_Disk - DVD-ROM
- DVD_R = $37; // Opt_Disk - DVD-Recordable (Write Once)
- DVD_RW = $38; // Opt_Disk - DVD-Rewriteable
- MO_3_RW = $39; // Opt_Disk - 3.5" Rewriteable MO Disk
- MO_5_WO = $3A; // Opt_Disk - MO 5.25" Write Once
- MO_5_RW = $3B; // Opt_Disk - MO 5.25" Rewriteable (not LIMDOW)
- MO_5_LIMDOW = $3C; // Opt_Disk - MO 5.25" Rewriteable (LIMDOW)
- PC_5_WO = $3D; // Opt_Disk - Phase Change 5.25" Write Once Optical
- PC_5_RW = $3E; // Opt_Disk - Phase Change 5.25" Rewriteable
- PD_5_RW = $3F; // Opt_Disk - PhaseChange Dual Rewriteable
- ABL_5_WO = $40; // Opt_Disk - Ablative 5.25" Write Once Optical
- PINNACLE_APEX_5_RW = $41; // Opt_Disk - Pinnacle Apex 4.6GB Rewriteable Optical
- SONY_12_WO = $42; // Opt_Disk - Sony 12" Write Once
- PHILIPS_12_WO = $43; // Opt_Disk - Philips/LMS 12" Write Once
- HITACHI_12_WO = $44; // Opt_Disk - Hitachi 12" Write Once
- CYGNET_12_WO = $45; // Opt_Disk - Cygnet/ATG 12" Write Once
- KODAK_14_WO = $46; // Opt_Disk - Kodak 14" Write Once
- MO_NFR_525 = $47; // Opt_Disk - Near Field Recording (Terastor)
- NIKON_12_RW = $48; // Opt_Disk - Nikon 12" Rewriteable
- IOMEGA_ZIP = $49; // Mag_Disk - Iomega Zip
- IOMEGA_JAZ = $4A; // Mag_Disk - Iomega Jaz
- SYQUEST_EZ135 = $4B; // Mag_Disk - Syquest EZ135
- SYQUEST_EZFLYER = $4C; // Mag_Disk - Syquest EzFlyer
- SYQUEST_SYJET = $4D; // Mag_Disk - Syquest SyJet
- AVATAR_F2 = $4E; // Mag_Disk - 2.5" Floppy
- MP2_8mm = $4F; // Tape - 8mm Hitachi
- DST_S = $50; // Ampex DST Small Tapes
- DST_M = $51; // Ampex DST Medium Tapes
- DST_L = $52; // Ampex DST Large Tapes
- VXATape_1 = $53; // Ecrix 8mm Tape
- VXATape_2 = $54; // Ecrix 8mm Tape
- STK_9840 = $55; // STK 9840
- LTO_Ultrium = $56; // IBM, HP, Seagate LTO Ultrium
- LTO_Accelis = $57; // IBM, HP, Seagate LTO Accelis
- DVD_RAM = $58; // Opt_Disk - DVD-RAM
- AIT_8mm = $59; // AIT2 or higher
- ADR_1 = $5A; // OnStream ADR Mediatypes
- ADR_2 = $5B;
- STK_9940 = $5C; // STK 9940
- type
- STORAGE_MEDIA_TYPE = DWORD;
- {$EXTERNALSYM STORAGE_MEDIA_TYPE}
- PSTORAGE_MEDIA_TYPE = ^STORAGE_MEDIA_TYPE;
- {$EXTERNALSYM PSTORAGE_MEDIA_TYPE}
- TStorageMediaType = STORAGE_MEDIA_TYPE;
- PStorageMediaType = ^TStorageMediaType;
- const
- MEDIA_ERASEABLE = $00000001;
- {$EXTERNALSYM MEDIA_ERASEABLE}
- MEDIA_WRITE_ONCE = $00000002;
- {$EXTERNALSYM MEDIA_WRITE_ONCE}
- MEDIA_READ_ONLY = $00000004;
- {$EXTERNALSYM MEDIA_READ_ONLY}
- MEDIA_READ_WRITE = $00000008;
- {$EXTERNALSYM MEDIA_READ_WRITE}
- MEDIA_WRITE_PROTECTED = $00000100;
- {$EXTERNALSYM MEDIA_WRITE_PROTECTED}
- MEDIA_CURRENTLY_MOUNTED = DWORD($80000000);
- {$EXTERNALSYM MEDIA_CURRENTLY_MOUNTED}
- //
- // Define the different storage bus types
- // Bus types below 128 (0x80) are reserved for Microsoft use
- //
- const
- BusTypeUnknown = 0;
- BusTypeScsi = 1;
- BusTypeAtapi = 2;
- BusTypeAta = 3;
- BusType1394 = 4;
- BusTypeSsa = 5;
- BusTypeFibre = 6;
- BusTypeUsb = 7;
- BusTypeRAID = 8;
- BusTypeMaxReserved = $7F;
- type
- STORAGE_BUS_TYPE = DWORD;
- {$EXTERNALSYM STORAGE_BUS_TYPE}
- PSTORAGE_BUS_TYPE = ^STORAGE_BUS_TYPE;
- {$EXTERNALSYM PSTORAGE_BUS_TYPE}
- TStorageBusType = STORAGE_BUS_TYPE;
- PStorageBusType = PSTORAGE_BUS_TYPE;
- TDMIDiskInfo = record
- Cylinders: LARGE_INTEGER;
- MediaType: STORAGE_MEDIA_TYPE;
- TracksPerCylinder: DWORD;
- SectorsPerTrack: DWORD;
- BytesPerSector: DWORD;
- NumberMediaSides: DWORD;
- MediaCharacteristics: DWORD; // Bitmask of MEDIA_XXX values.
- end;
- TDMIRemovableDiskInfo = record
- Cylinders: LARGE_INTEGER;
- MediaType: STORAGE_MEDIA_TYPE;
- TracksPerCylinder: DWORD;
- SectorsPerTrack: DWORD;
- BytesPerSector: DWORD;
- NumberMediaSides: DWORD;
- MediaCharacteristics: DWORD; // Bitmask of MEDIA_XXX values.
- end;
- TDMITapeInfo = record
- MediaType: STORAGE_MEDIA_TYPE;
- MediaCharacteristics: DWORD; // Bitmask of MEDIA_XXX values.
- CurrentBlockSize: DWORD;
- BusType: STORAGE_BUS_TYPE;
- //
- // Bus specific information describing the medium supported.
- //
- case Integer of {BusSpecificData}
- 0: ( {ScsiInformation}
- MediumType: BYTE;
- DensityCode: BYTE);
- end;
- PDEVICE_MEDIA_INFO = ^DEVICE_MEDIA_INFO;
- {$EXTERNALSYM PDEVICE_MEDIA_INFO}
- _DEVICE_MEDIA_INFO = record
- case Integer of
- 0: (DiskInfo: TDMIDiskInfo);
- 1: (RemovableDiskInfo: TDMIRemovableDiskInfo);
- 2: (TapeInfo: TDMITapeInfo);
- end;
- {$EXTERNALSYM _DEVICE_MEDIA_INFO}
- DEVICE_MEDIA_INFO = _DEVICE_MEDIA_INFO;
- {$EXTERNALSYM DEVICE_MEDIA_INFO}
- TDeviceMediaInfo = DEVICE_MEDIA_INFO;
- PDeviceMediaInfo = PDEVICE_MEDIA_INFO;
- PGET_MEDIA_TYPES = ^GET_MEDIA_TYPES;
- {$EXTERNALSYM PGET_MEDIA_TYPES}
- _GET_MEDIA_TYPES = record
- DeviceType: DWORD; // FILE_DEVICE_XXX values
- MediaInfoCount: DWORD;
- MediaInfo: array [0..0] of DEVICE_MEDIA_INFO;
- end;
- {$EXTERNALSYM _GET_MEDIA_TYPES}
- GET_MEDIA_TYPES = _GET_MEDIA_TYPES;
- {$EXTERNALSYM GET_MEDIA_TYPES}
- TGetMediaTypes = GET_MEDIA_TYPES;
- PGetMediaTypes = PGET_MEDIA_TYPES;
- //
- // IOCTL_STORAGE_PREDICT_FAILURE
- //
- // input - none
- //
- // output - STORAGE_PREDICT_FAILURE structure
- // PredictFailure returns zero if no failure predicted and non zero
- // if a failure is predicted.
- //
- // VendorSpecific returns 512 bytes of vendor specific information
- // if a failure is predicted
- //
- PSTORAGE_PREDICT_FAILURE = ^STORAGE_PREDICT_FAILURE;
- {$EXTERNALSYM PSTORAGE_PREDICT_FAILURE}
- _STORAGE_PREDICT_FAILURE = record
- PredictFailure: DWORD;
- VendorSpecific: array [0..511] of BYTE;
- end;
- {$EXTERNALSYM _STORAGE_PREDICT_FAILURE}
- STORAGE_PREDICT_FAILURE = _STORAGE_PREDICT_FAILURE;
- {$EXTERNALSYM STORAGE_PREDICT_FAILURE}
- TStoragePredictFailure = STORAGE_PREDICT_FAILURE;
- PStoragePredictFailure = PSTORAGE_PREDICT_FAILURE;
- //
- // IoControlCode values for disk devices.
- //
- const
- IOCTL_DISK_BASE = FILE_DEVICE_DISK;
- {$EXTERNALSYM IOCTL_DISK_BASE}
- IOCTL_DISK_GET_DRIVE_GEOMETRY = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0000 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_DRIVE_GEOMETRY}
- IOCTL_DISK_GET_PARTITION_INFO = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0001 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_PARTITION_INFO}
- IOCTL_DISK_SET_PARTITION_INFO = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0002 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_SET_PARTITION_INFO}
- IOCTL_DISK_GET_DRIVE_LAYOUT = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0003 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_DRIVE_LAYOUT}
- IOCTL_DISK_SET_DRIVE_LAYOUT = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0004 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_SET_DRIVE_LAYOUT}
- IOCTL_DISK_VERIFY = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0005 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_VERIFY}
- IOCTL_DISK_FORMAT_TRACKS = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0006 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_FORMAT_TRACKS}
- IOCTL_DISK_REASSIGN_BLOCKS = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0007 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_REASSIGN_BLOCKS}
- IOCTL_DISK_PERFORMANCE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0008 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_PERFORMANCE}
- IOCTL_DISK_IS_WRITABLE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0009 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_IS_WRITABLE}
- IOCTL_DISK_LOGGING = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($000a shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_LOGGING}
- IOCTL_DISK_FORMAT_TRACKS_EX = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($000b shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_FORMAT_TRACKS_EX}
- IOCTL_DISK_HISTOGRAM_STRUCTURE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($000c shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_HISTOGRAM_STRUCTURE}
- IOCTL_DISK_HISTOGRAM_DATA = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($000d shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_HISTOGRAM_DATA}
- IOCTL_DISK_HISTOGRAM_RESET = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($000e shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_HISTOGRAM_RESET}
- IOCTL_DISK_REQUEST_STRUCTURE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($000f shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_REQUEST_STRUCTURE}
- IOCTL_DISK_REQUEST_DATA = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0010 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_REQUEST_DATA}
- IOCTL_DISK_PERFORMANCE_OFF = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0018 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_PERFORMANCE_OFF}
- IOCTL_DISK_CONTROLLER_NUMBER = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0011 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_CONTROLLER_NUMBER}
- //
- // IOCTL support for SMART drive fault prediction.
- //
- SMART_GET_VERSION = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0020 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM SMART_GET_VERSION}
- SMART_SEND_DRIVE_COMMAND = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0021 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM SMART_SEND_DRIVE_COMMAND}
- SMART_RCV_DRIVE_DATA = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0022 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM SMART_RCV_DRIVE_DATA}
- //
- // New IOCTLs for GUID Partition tabled disks.
- //
- // 23-11-2002: various bugs reported by Carsten Grafflage corrected
- IOCTL_DISK_GET_PARTITION_INFO_EX = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0012 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_PARTITION_INFO_EX}
- IOCTL_DISK_SET_PARTITION_INFO_EX = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0013 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_SET_PARTITION_INFO_EX}
- IOCTL_DISK_GET_DRIVE_LAYOUT_EX = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0014 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_DRIVE_LAYOUT_EX}
- IOCTL_DISK_SET_DRIVE_LAYOUT_EX = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0015 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_SET_DRIVE_LAYOUT_EX}
- IOCTL_DISK_CREATE_DISK = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0016 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_CREATE_DISK}
- IOCTL_DISK_GET_LENGTH_INFO = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0017 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_LENGTH_INFO}
- IOCTL_DISK_GET_DRIVE_GEOMETRY_EX = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0028 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_DRIVE_GEOMETRY_EX}
- IOCTL_DISK_UPDATE_DRIVE_SIZE = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0032 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_UPDATE_DRIVE_SIZE}
- IOCTL_DISK_GROW_PARTITION = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0034 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GROW_PARTITION}
- IOCTL_DISK_GET_CACHE_INFORMATION = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0035 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_CACHE_INFORMATION}
- IOCTL_DISK_SET_CACHE_INFORMATION = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0036 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_SET_CACHE_INFORMATION}
- IOCTL_DISK_GET_WRITE_CACHE_STATE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0037 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_WRITE_CACHE_STATE}
- IOCTL_DISK_DELETE_DRIVE_LAYOUT = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0040 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_DELETE_DRIVE_LAYOUT}
- //
- // Called to flush cached information that the driver may have about this
- // device's characteristics. Not all drivers cache characteristics, and not
- // cached properties can be flushed. This simply serves as an update to the
- // driver that it may want to do an expensive reexamination of the device's
- // characteristics now (fixed media size, partition table, etc...)
- //
- IOCTL_DISK_UPDATE_PROPERTIES = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0050 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_UPDATE_PROPERTIES}
- //
- // Special IOCTLs needed to support PC-98 machines in Japan
- //
- IOCTL_DISK_FORMAT_DRIVE = (
- (IOCTL_DISK_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($00f3 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_FORMAT_DRIVE}
- IOCTL_DISK_SENSE_DEVICE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($00f8 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_SENSE_DEVICE}
- //
- // The following device control codes are common for all class drivers. The
- // functions codes defined here must match all of the other class drivers.
- //
- // Warning: these codes will be replaced in the future by equivalent
- // IOCTL_STORAGE codes
- //
- IOCTL_DISK_CHECK_VERIFY = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0200 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_CHECK_VERIFY}
- IOCTL_DISK_MEDIA_REMOVAL = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0201 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_MEDIA_REMOVAL}
- IOCTL_DISK_EJECT_MEDIA = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0202 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_EJECT_MEDIA}
- IOCTL_DISK_LOAD_MEDIA = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0203 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_LOAD_MEDIA}
- IOCTL_DISK_RESERVE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0204 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_RESERVE}
- IOCTL_DISK_RELEASE = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0205 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_RELEASE}
- IOCTL_DISK_FIND_NEW_DEVICES = (
- (IOCTL_DISK_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0206 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_FIND_NEW_DEVICES}
- IOCTL_DISK_GET_MEDIA_TYPES = (
- (IOCTL_DISK_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- ($0300 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_DISK_GET_MEDIA_TYPES}
- //
- // Define the partition types returnable by known disk drivers.
- //
- const
- PARTITION_ENTRY_UNUSED = $00; // Entry unused
- {$EXTERNALSYM PARTITION_ENTRY_UNUSED}
- PARTITION_FAT_12 = $01; // 12-bit FAT entries
- {$EXTERNALSYM PARTITION_FAT_12}
- PARTITION_XENIX_1 = $02; // Xenix
- {$EXTERNALSYM PARTITION_XENIX_1}
- PARTITION_XENIX_2 = $03; // Xenix
- {$EXTERNALSYM PARTITION_XENIX_2}
- PARTITION_FAT_16 = $04; // 16-bit FAT entries
- {$EXTERNALSYM PARTITION_FAT_16}
- PARTITION_EXTENDED = $05; // Extended partition entry
- {$EXTERNALSYM PARTITION_EXTENDED}
- PARTITION_HUGE = $06; // Huge partition MS-DOS V4
- {$EXTERNALSYM PARTITION_HUGE}
- PARTITION_IFS = $07; // IFS Partition
- {$EXTERNALSYM PARTITION_IFS}
- PARTITION_OS2BOOTMGR = $0A; // OS/2 Boot Manager/OPUS/Coherent swap
- {$EXTERNALSYM PARTITION_OS2BOOTMGR}
- PARTITION_FAT32 = $0B; // FAT32
- {$EXTERNALSYM PARTITION_FAT32}
- PARTITION_FAT32_XINT13 = $0C; // FAT32 using extended int13 services
- {$EXTERNALSYM PARTITION_FAT32_XINT13}
- PARTITION_XINT13 = $0E; // Win95 partition using extended int13 services
- {$EXTERNALSYM PARTITION_XINT13}
- PARTITION_XINT13_EXTENDED = $0F; // Same as type 5 but uses extended int13 services
- {$EXTERNALSYM PARTITION_XINT13_EXTENDED}
- PARTITION_PREP = $41; // PowerPC Reference Platform (PReP) Boot Partition
- {$EXTERNALSYM PARTITION_PREP}
- PARTITION_LDM = $42; // Logical Disk Manager partition
- {$EXTERNALSYM PARTITION_LDM}
- PARTITION_UNIX = $63; // Unix
- {$EXTERNALSYM PARTITION_UNIX}
- VALID_NTFT = $C0; // NTFT uses high order bits
- {$EXTERNALSYM VALID_NTFT}
- //
- // The high bit of the partition type code indicates that a partition
- // is part of an NTFT mirror or striped array.
- //
- PARTITION_NTFT = $80; // NTFT partition
- {$EXTERNALSYM PARTITION_NTFT}
- //
- // The following macro is used to determine which partitions should be
- // assigned drive letters.
- //
- //++
- //
- // BOOLEAN
- // IsRecognizedPartition(
- // IN DWORD PartitionType
- // )
- //
- // Routine Description:
- //
- // This macro is used to determine to which partitions drive letters
- // should be assigned.
- //
- // Arguments:
- //
- // PartitionType - Supplies the type of the partition being examined.
- //
- // Return Value:
- //
- // The return value is TRUE if the partition type is recognized,
- // otherwise FALSE is returned.
- //
- //--
- function IsRecognizedPartition(PartitionType: DWORD): Boolean;
- {$EXTERNALSYM IsRecognizedPartition}
- //++
- //
- // BOOLEAN
- // IsContainerPartition(
- // IN DWORD PartitionType
- // )
- //
- // Routine Description:
- //
- // This macro is used to determine to which partition types are actually
- // containers for other partitions (ie, extended partitions).
- //
- // Arguments:
- //
- // PartitionType - Supplies the type of the partition being examined.
- //
- // Return Value:
- //
- // The return value is TRUE if the partition type is a container,
- // otherwise FALSE is returned.
- //
- //--
- function IsContainerPartition(PartitionType: DWORD): Boolean;
- {$EXTERNALSYM IsContainerPartition}
- //++
- //
- // BOOLEAN
- // IsFTPartition(
- // IN DWORD PartitionType
- // )
- //
- // Routine Description:
- //
- // This macro is used to determine if the given partition is an FT
- // partition.
- //
- // Arguments:
- //
- // PartitionType - Supplies the type of the partition being examined.
- //
- // Return Value:
- //
- // The return value is TRUE if the partition type is an FT partition,
- // otherwise FALSE is returned.
- //
- //--
- function IsFTPartition(PartitionType: DWORD): Boolean;
- {$EXTERNALSYM IsFTPartition}
- //
- // Define the media types supported by the driver.
- //
- type
- _MEDIA_TYPE = (
- Unknown, // Format is unknown
- F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
- F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
- F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
- F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
- F3_720_512, // 3.5", 720KB, 512 bytes/sector
- F5_360_512, // 5.25", 360KB, 512 bytes/sector
- F5_320_512, // 5.25", 320KB, 512 bytes/sector
- F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
- F5_180_512, // 5.25", 180KB, 512 bytes/sector
- F5_160_512, // 5.25", 160KB, 512 bytes/sector
- RemovableMedia, // Removable media other than floppy
- FixedMedia, // Fixed hard disk media
- F3_120M_512, // 3.5", 120M Floppy
- F3_640_512, // 3.5" , 640KB, 512 bytes/sector
- F5_640_512, // 5.25", 640KB, 512 bytes/sector
- F5_720_512, // 5.25", 720KB, 512 bytes/sector
- F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
- F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
- F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
- F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
- F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
- F8_256_128, // 8", 256KB, 128 bytes/sector
- F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
- F3_240M_512, // 3.5", 240Mb Floppy (HiFD)
- F3_32M_512); // 3.5", 32Mb Floppy
- {$EXTERNALSYM _MEDIA_TYPE}
- MEDIA_TYPE = _MEDIA_TYPE;
- {$EXTERNALSYM MEDIA_TYPE}
- PMEDIA_TYPE = ^MEDIA_TYPE;
- {$EXTERNALSYM PMEDIA_TYPE}
- TMediaType = MEDIA_TYPE;
- PMediaType = PMEDIA_TYPE;
- //
- // Define the input buffer structure for the driver, when
- // it is called with IOCTL_DISK_FORMAT_TRACKS.
- //
- PFORMAT_PARAMETERS = ^FORMAT_PARAMETERS;
- {$EXTERNALSYM PFORMAT_PARAMETERS}
- _FORMAT_PARAMETERS = record
- MediaType: MEDIA_TYPE;
- StartCylinderNumber: DWORD;
- EndCylinderNumber: DWORD;
- StartHeadNumber: DWORD;
- EndHeadNumber: DWORD;
- end;
- {$EXTERNALSYM _FORMAT_PARAMETERS}
- FORMAT_PARAMETERS = _FORMAT_PARAMETERS;
- {$EXTERNALSYM FORMAT_PARAMETERS}
- TFormatParameters = FORMAT_PARAMETERS;
- PFormatParameters = PFORMAT_PARAMETERS;
- //
- // Define the BAD_TRACK_NUMBER type. An array of elements of this type is
- // returned by the driver on IOCTL_DISK_FORMAT_TRACKS requests, to indicate
- // what tracks were bad during formatting. The length of that array is
- // reported in the `Information' field of the I/O Status Block.
- //
- BAD_TRACK_NUMBER = WORD;
- {$EXTERNALSYM BAD_TRACK_NUMBER}
- PBAD_TRACK_NUMBER = ^WORD;
- {$EXTERNALSYM PBAD_TRACK_NUMBER}
- //
- // Define the input buffer structure for the driver, when
- // it is called with IOCTL_DISK_FORMAT_TRACKS_EX.
- //
- PFORMAT_EX_PARAMETERS = ^FORMAT_EX_PARAMETERS;
- {$EXTERNALSYM PFORMAT_EX_PARAMETERS}
- _FORMAT_EX_PARAMETERS = record
- MediaType: MEDIA_TYPE;
- StartCylinderNumber: DWORD;
- EndCylinderNumber: DWORD;
- StartHeadNumber: DWORD;
- EndHeadNumber: DWORD;
- FormatGapLength: WORD;
- SectorsPerTrack: WORD;
- SectorNumber: array [0..0] of WORD;
- end;
- {$EXTERNALSYM _FORMAT_EX_PARAMETERS}
- FORMAT_EX_PARAMETERS = _FORMAT_EX_PARAMETERS;
- {$EXTERNALSYM FORMAT_EX_PARAMETERS}
- TFormatExParameters = FORMAT_EX_PARAMETERS;
- PFormatExParameters = PFORMAT_EX_PARAMETERS;
- //
- // The following structure is returned on an IOCTL_DISK_GET_DRIVE_GEOMETRY
- // request and an array of them is returned on an IOCTL_DISK_GET_MEDIA_TYPES
- // request.
- //
- PDISK_GEOMETRY = ^DISK_GEOMETRY;
- {$EXTERNALSYM PDISK_GEOMETRY}
- _DISK_GEOMETRY = record
- Cylinders: LARGE_INTEGER;
- MediaType: MEDIA_TYPE;
- TracksPerCylinder: DWORD;
- SectorsPerTrack: DWORD;
- BytesPerSector: DWORD;
- end;
- {$EXTERNALSYM _DISK_GEOMETRY}
- DISK_GEOMETRY = _DISK_GEOMETRY;
- {$EXTERNALSYM DISK_GEOMETRY}
- TDiskGeometry = DISK_GEOMETRY;
- PDiskGeometry = PDISK_GEOMETRY;
- //
- // This wmi guid returns a DISK_GEOMETRY structure
- //
- const
- WMI_DISK_GEOMETRY_GUID: TGUID = (
- D1:$25007f51; D2:$57c2; D3:$11d1; D4:($a5, $28, $00, $a0, $c9, $06, $29, $10));
- {$EXTERNALSYM WMI_DISK_GEOMETRY_GUID}
- //
- // The following structure is returned on an IOCTL_DISK_GET_PARTITION_INFO
- // and an IOCTL_DISK_GET_DRIVE_LAYOUT request. It is also used in a request
- // to change the drive layout, IOCTL_DISK_SET_DRIVE_LAYOUT.
- //
- type
- PPARTITION_INFORMATION = ^PARTITION_INFORMATION;
- {$EXTERNALSYM PPARTITION_INFORMATION}
- _PARTITION_INFORMATION = record
- StartingOffset: LARGE_INTEGER;
- PartitionLength: LARGE_INTEGER;
- HiddenSectors: DWORD;
- PartitionNumber: DWORD;
- PartitionType: BYTE;
- BootIndicator: ByteBool;
- RecognizedPartition: ByteBool;
- RewritePartition: ByteBool;
- end;
- {$EXTERNALSYM _PARTITION_INFORMATION}
- PARTITION_INFORMATION = _PARTITION_INFORMATION;
- {$EXTERNALSYM PARTITION_INFORMATION}
- TPartitionInformation = PARTITION_INFORMATION;
- PPartitionInformation = PPARTITION_INFORMATION;
- //
- // The following structure is used to change the partition type of a
- // specified disk partition using an IOCTL_DISK_SET_PARTITION_INFO
- // request.
- //
- PSET_PARTITION_INFORMATION = ^SET_PARTITION_INFORMATION;
- {$EXTERNALSYM PSET_PARTITION_INFORMATION}
- _SET_PARTITION_INFORMATION = record
- PartitionType: BYTE;
- end;
- {$EXTERNALSYM _SET_PARTITION_INFORMATION}
- SET_PARTITION_INFORMATION = _SET_PARTITION_INFORMATION;
- {$EXTERNALSYM SET_PARTITION_INFORMATION}
- TSetPartitionInformation = _SET_PARTITION_INFORMATION;
- PSetPartitionInformation = PSET_PARTITION_INFORMATION;
- //
- // The following structures is returned on an IOCTL_DISK_GET_DRIVE_LAYOUT
- // request and given as input to an IOCTL_DISK_SET_DRIVE_LAYOUT request.
- //
- PDRIVE_LAYOUT_INFORMATION = ^DRIVE_LAYOUT_INFORMATION;
- {$EXTERNALSYM PDRIVE_LAYOUT_INFORMATION}
- _DRIVE_LAYOUT_INFORMATION = record
- PartitionCount: DWORD;
- Signature: DWORD;
- PartitionEntry: array [0..0] of PARTITION_INFORMATION;
- end;
- {$EXTERNALSYM _DRIVE_LAYOUT_INFORMATION}
- DRIVE_LAYOUT_INFORMATION = _DRIVE_LAYOUT_INFORMATION;
- {$EXTERNALSYM DRIVE_LAYOUT_INFORMATION}
- TDriveLayoutInformation = DRIVE_LAYOUT_INFORMATION;
- PDriveLayoutInformation = PDRIVE_LAYOUT_INFORMATION;
- //
- // The following structure is passed in on an IOCTL_DISK_VERIFY request.
- // The offset and length parameters are both given in bytes.
- //
- PVERIFY_INFORMATION = ^VERIFY_INFORMATION;
- {$EXTERNALSYM PVERIFY_INFORMATION}
- _VERIFY_INFORMATION = record
- StartingOffset: LARGE_INTEGER;
- Length: DWORD;
- end;
- {$EXTERNALSYM _VERIFY_INFORMATION}
- VERIFY_INFORMATION = _VERIFY_INFORMATION;
- {$EXTERNALSYM VERIFY_INFORMATION}
- TVerifyInformation = VERIFY_INFORMATION;
- PVerifyInformation = PVERIFY_INFORMATION;
- //
- // The following structure is passed in on an IOCTL_DISK_REASSIGN_BLOCKS
- // request.
- //
- PREASSIGN_BLOCKS = ^REASSIGN_BLOCKS;
- {$EXTERNALSYM PREASSIGN_BLOCKS}
- _REASSIGN_BLOCKS = record
- Reserved: WORD;
- Count: WORD;
- BlockNumber: array [0..0] of DWORD;
- end;
- {$EXTERNALSYM _REASSIGN_BLOCKS}
- REASSIGN_BLOCKS = _REASSIGN_BLOCKS;
- {$EXTERNALSYM REASSIGN_BLOCKS}
- TReassignBlocks = REASSIGN_BLOCKS;
- PReassignBlocks = PREASSIGN_BLOCKS;
- //
- // Support for GUID Partition Table (GPT) disks.
- //
- //
- // There are currently two ways a disk can be partitioned. With a traditional
- // AT-style master boot record (PARTITION_STYLE_MBR) and with a new, GPT
- // partition table (PARTITION_STYLE_GPT). RAW is for an unrecognizable
- // partition style. There are a very limited number of things you can
- // do with a RAW partititon.
- //
- type
- _PARTITION_STYLE = (
- PARTITION_STYLE_MBR,
- PARTITION_STYLE_GPT,
- PARTITION_STYLE_RAW);
- {$EXTERNALSYM _PARTITION_STYLE}
- PARTITION_STYLE = _PARTITION_STYLE;
- {$EXTERNALSYM PARTITION_STYLE}
- TPartitionStyle = PARTITION_STYLE;
- //
- // The following structure defines information in a GPT partition that is
- // not common to both GPT and MBR partitions.
- //
- PPARTITION_INFORMATION_GPT = ^PARTITION_INFORMATION_GPT;
- {$EXTERNALSYM PPARTITION_INFORMATION_GPT}
- _PARTITION_INFORMATION_GPT = record
- PartitionType: GUID; // Partition type. See table 16-3.
- PartitionId: GUID; // Unique GUID for this partition.
- Attributes: DWORD64; // See table 16-4.
- Name: array [0..35] of WCHAR; // Partition Name in Unicode.
- end;
- {$EXTERNALSYM _PARTITION_INFORMATION_GPT}
- PARTITION_INFORMATION_GPT = _PARTITION_INFORMATION_GPT;
- {$EXTERNALSYM PARTITION_INFORMATION_GPT}
- TPartitionInformationGpt = PARTITION_INFORMATION_GPT;
- PPartitionInformationGpt = PPARTITION_INFORMATION_GPT;
- //
- // The following are GPT partition attributes applicable for any
- // partition type. These attributes are not OS-specific
- //
- const
- GPT_ATTRIBUTE_PLATFORM_REQUIRED = ($0000000000000001);
- {$EXTERNALSYM GPT_ATTRIBUTE_PLATFORM_REQUIRED}
- //
- // The following are GPT partition attributes applicable when the
- // PartitionType is PARTITION_BASIC_DATA_GUID.
- //
- GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER = DWORD($8000000000000000);
- {$EXTERNALSYM GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER}
- GPT_BASIC_DATA_ATTRIBUTE_HIDDEN = ($4000000000000000);
- {$EXTERNALSYM GPT_BASIC_DATA_ATTRIBUTE_HIDDEN}
- GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY = ($1000000000000000);
- {$EXTERNALSYM GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY}
- //
- // The following structure defines information in an MBR partition that is not
- // common to both GPT and MBR partitions.
- //
- type
- PPARTITION_INFORMATION_MBR = ^PARTITION_INFORMATION_MBR;
- {$EXTERNALSYM PPARTITION_INFORMATION_MBR}
- _PARTITION_INFORMATION_MBR = record
- PartitionType: BYTE;
- BootIndicator: BOOLEAN;
- RecognizedPartition: BOOLEAN;
- HiddenSectors: DWORD;
- end;
- {$EXTERNALSYM _PARTITION_INFORMATION_MBR}
- PARTITION_INFORMATION_MBR = _PARTITION_INFORMATION_MBR;
- {$EXTERNALSYM PARTITION_INFORMATION_MBR}
- TPartitionInformationMbr = PARTITION_INFORMATION_MBR;
- PPartitionInformationMbr = PPARTITION_INFORMATION_MBR;
- //
- // The structure SET_PARTITION_INFO_EX is used with the ioctl
- // IOCTL_SET_PARTITION_INFO_EX to set information about a specific
- // partition. Note that for MBR partitions, you can only set the partition
- // signature, whereas GPT partitions allow setting of all fields that
- // you can get.
- //
- SET_PARTITION_INFORMATION_MBR = SET_PARTITION_INFORMATION;
- {$EXTERNALSYM SET_PARTITION_INFORMATION_MBR}
- TSetPartitionInformationMbr = SET_PARTITION_INFORMATION_MBR;
- SET_PARTITION_INFORMATION_GPT = PARTITION_INFORMATION_GPT;
- {$EXTERNALSYM SET_PARTITION_INFORMATION_GPT}
- TSetPartitionInformationGpt = SET_PARTITION_INFORMATION_GPT;
- PSET_PARTITION_INFORMATION_EX = ^SET_PARTITION_INFORMATION_EX;
- {$EXTERNALSYM PSET_PARTITION_INFORMATION_EX}
- _SET_PARTITION_INFORMATION_EX = record
- PartitionStyle: PARTITION_STYLE;
- case Integer of
- 0: (Mbr: SET_PARTITION_INFORMATION_MBR);
- 1: (Gpt: SET_PARTITION_INFORMATION_GPT);
- end;
- {$EXTERNALSYM _SET_PARTITION_INFORMATION_EX}
- SET_PARTITION_INFORMATION_EX = _SET_PARTITION_INFORMATION_EX;
- {$EXTERNALSYM SET_PARTITION_INFORMATION_EX}
- TSetPartitionInformationEx = SET_PARTITION_INFORMATION_EX;
- PSetPartitionInformationEx = PSET_PARTITION_INFORMATION_EX;
- //
- // The structure CREATE_DISK_GPT with the ioctl IOCTL_DISK_CREATE_DISK
- // to initialize an virgin disk with an empty GPT partition table.
- //
- PCREATE_DISK_GPT = ^CREATE_DISK_GPT;
- {$EXTERNALSYM PCREATE_DISK_GPT}
- _CREATE_DISK_GPT = record
- DiskId: GUID; // Unique disk id for the disk.
- MaxPartitionCount: DWORD; // Maximim number of partitions allowable.
- end;
- {$EXTERNALSYM _CREATE_DISK_GPT}
- CREATE_DISK_GPT = _CREATE_DISK_GPT;
- {$EXTERNALSYM CREATE_DISK_GPT}
- TCreateDiskGpt = CREATE_DISK_GPT;
- PCreateDiskGpt = PCREATE_DISK_GPT;
- //
- // The structure CREATE_DISK_MBR with the ioctl IOCTL_DISK_CREATE_DISK
- // to initialize an virgin disk with an empty MBR partition table.
- //
- PCREATE_DISK_MBR = ^CREATE_DISK_MBR;
- {$EXTERNALSYM PCREATE_DISK_MBR}
- _CREATE_DISK_MBR = record
- Signature: DWORD;
- end;
- {$EXTERNALSYM _CREATE_DISK_MBR}
- CREATE_DISK_MBR = _CREATE_DISK_MBR;
- {$EXTERNALSYM CREATE_DISK_MBR}
- TCreateDiskMbr = CREATE_DISK_MBR;
- PCreateDiskMbr = PCREATE_DISK_MBR;
- PCREATE_DISK = ^CREATE_DISK;
- {$EXTERNALSYM PCREATE_DISK}
- _CREATE_DISK = record
- PartitionStyle: PARTITION_STYLE;
- case Integer of
- 0: (Mbr: CREATE_DISK_MBR);
- 1: (Gpt: CREATE_DISK_GPT);
- end;
- {$EXTERNALSYM _CREATE_DISK}
- CREATE_DISK = _CREATE_DISK;
- {$EXTERNALSYM CREATE_DISK}
- TCreateDisk = CREATE_DISK;
- PCreateDisk = PCREATE_DISK;
- //
- // The structure GET_LENGTH_INFORMATION is used with the ioctl
- // IOCTL_DISK_GET_LENGTH_INFO to obtain the length, in bytes, of the
- // disk, partition, or volume.
- //
- PGET_LENGTH_INFORMATION = ^GET_LENGTH_INFORMATION;
- {$EXTERNALSYM PGET_LENGTH_INFORMATION}
- _GET_LENGTH_INFORMATION = record
- Length: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _GET_LENGTH_INFORMATION}
- GET_LENGTH_INFORMATION = _GET_LENGTH_INFORMATION;
- {$EXTERNALSYM GET_LENGTH_INFORMATION}
- TGetLengthInformation = GET_LENGTH_INFORMATION;
- PGetLengthInformation = PGET_LENGTH_INFORMATION;
- //
- // The PARTITION_INFORMATION_EX structure is used with the
- // IOCTL_DISK_GET_DRIVE_LAYOUT_EX, IOCTL_DISK_SET_DRIVE_LAYOUT_EX,
- // IOCTL_DISK_GET_PARTITION_INFO_EX and IOCTL_DISK_GET_PARTITION_INFO_EX calls.
- //
- PPARTITION_INFORMATION_EX = ^PARTITION_INFORMATION_EX;
- {$EXTERNALSYM PPARTITION_INFORMATION_EX}
- _PARTITION_INFORMATION_EX = record
- PartitionStyle: PARTITION_STYLE;
- StartingOffset: LARGE_INTEGER;
- PartitionLength: LARGE_INTEGER;
- PartitionNumber: DWORD;
- RewritePartition: BOOLEAN;
- case Integer of
- 0: (Mbr: PARTITION_INFORMATION_MBR);
- 1: (Gpt: PARTITION_INFORMATION_GPT);
- end;
- {$EXTERNALSYM _PARTITION_INFORMATION_EX}
- PARTITION_INFORMATION_EX = _PARTITION_INFORMATION_EX;
- {$EXTERNALSYM PARTITION_INFORMATION_EX}
- TPartitionInformationEx = PARTITION_INFORMATION_EX;
- PPartitionInformationEx = PPARTITION_INFORMATION_EX;
- //
- // GPT specific drive layout information.
- //
- PDRIVE_LAYOUT_INFORMATION_GPT = ^DRIVE_LAYOUT_INFORMATION_GPT;
- {$EXTERNALSYM PDRIVE_LAYOUT_INFORMATION_GPT}
- _DRIVE_LAYOUT_INFORMATION_GPT = record
- DiskId: GUID;
- StartingUsableOffset: LARGE_INTEGER;
- UsableLength: LARGE_INTEGER;
- MaxPartitionCount: DWORD;
- end;
- {$EXTERNALSYM _DRIVE_LAYOUT_INFORMATION_GPT}
- DRIVE_LAYOUT_INFORMATION_GPT = _DRIVE_LAYOUT_INFORMATION_GPT;
- {$EXTERNALSYM DRIVE_LAYOUT_INFORMATION_GPT}
- TDriveLayoutInformationGpt = DRIVE_LAYOUT_INFORMATION_GPT;
- PDriveLayoutInformationGpt = PDRIVE_LAYOUT_INFORMATION_GPT;
- //
- // MBR specific drive layout information.
- //
- PDRIVE_LAYOUT_INFORMATION_MBR = ^DRIVE_LAYOUT_INFORMATION_MBR;
- {$EXTERNALSYM PDRIVE_LAYOUT_INFORMATION_MBR}
- _DRIVE_LAYOUT_INFORMATION_MBR = record
- Signature: DWORD;
- end;
- {$EXTERNALSYM _DRIVE_LAYOUT_INFORMATION_MBR}
- DRIVE_LAYOUT_INFORMATION_MBR = _DRIVE_LAYOUT_INFORMATION_MBR;
- {$EXTERNALSYM DRIVE_LAYOUT_INFORMATION_MBR}
- TDriveLayoutInformationMbr = DRIVE_LAYOUT_INFORMATION_MBR;
- PDriveLayoutInformationMbr = PDRIVE_LAYOUT_INFORMATION_MBR;
- //
- // The structure DRIVE_LAYOUT_INFORMATION_EX is used with the
- // IOCTL_SET_DRIVE_LAYOUT_EX and IOCTL_GET_DRIVE_LAYOUT_EX calls.
- //
- PDRIVE_LAYOUT_INFORMATION_EX = ^DRIVE_LAYOUT_INFORMATION_EX;
- {$EXTERNALSYM PDRIVE_LAYOUT_INFORMATION_EX}
- _DRIVE_LAYOUT_INFORMATION_EX = record
- PartitionStyle: DWORD;
- PartitionCount: DWORD;
- Union: record
- case Integer of
- 0: (Mbr: DRIVE_LAYOUT_INFORMATION_MBR);
- 1: (Gpt: DRIVE_LAYOUT_INFORMATION_GPT);
- end;
- PartitionEntry: array [0..0] of PARTITION_INFORMATION_EX;
- end;
- {$EXTERNALSYM _DRIVE_LAYOUT_INFORMATION_EX}
- DRIVE_LAYOUT_INFORMATION_EX = _DRIVE_LAYOUT_INFORMATION_EX;
- {$EXTERNALSYM DRIVE_LAYOUT_INFORMATION_EX}
- TDriveLayoutInformationEx = DRIVE_LAYOUT_INFORMATION_EX;
- PDriveLayoutInformationEx = PDRIVE_LAYOUT_INFORMATION_EX;
- //
- // The DISK_GEOMETRY_EX structure is returned on issuing an
- // IOCTL_DISK_GET_DRIVE_GEOMETRY_EX ioctl.
- //
- _DETECTION_TYPE = (
- DetectNone,
- DetectInt13,
- DetectExInt13);
- {$EXTERNALSYM _DETECTION_TYPE}
- DETECTION_TYPE = _DETECTION_TYPE;
- {$EXTERNALSYM DETECTION_TYPE}
- TDetectionType = DETECTION_TYPE;
- PDISK_INT13_INFO = ^DISK_INT13_INFO;
- {$EXTERNALSYM PDISK_INT13_INFO}
- _DISK_INT13_INFO = record
- DriveSelect: WORD;
- MaxCylinders: DWORD;
- SectorsPerTrack: WORD;
- MaxHeads: WORD;
- NumberDrives: WORD;
- end;
- {$EXTERNALSYM _DISK_INT13_INFO}
- DISK_INT13_INFO = _DISK_INT13_INFO;
- {$EXTERNALSYM DISK_INT13_INFO}
- TDiskInt13Info = DISK_INT13_INFO;
- PDiskInt13Info = PDISK_INT13_INFO;
- PDISK_EX_INT13_INFO = ^DISK_EX_INT13_INFO;
- {$EXTERNALSYM PDISK_EX_INT13_INFO}
- _DISK_EX_INT13_INFO = record
- ExBufferSize: WORD;
- ExFlags: WORD;
- ExCylinders: DWORD;
- ExHeads: DWORD;
- ExSectorsPerTrack: DWORD;
- ExSectorsPerDrive: DWORD64;
- ExSectorSize: WORD;
- ExReserved: WORD;
- end;
- {$EXTERNALSYM _DISK_EX_INT13_INFO}
- DISK_EX_INT13_INFO = _DISK_EX_INT13_INFO;
- {$EXTERNALSYM DISK_EX_INT13_INFO}
- TDiskExInt13Info = DISK_EX_INT13_INFO;
- PDiskExInt13Info = PDISK_EX_INT13_INFO;
- PDISK_DETECTION_INFO = ^DISK_DETECTION_INFO;
- {$EXTERNALSYM PDISK_DETECTION_INFO}
- _DISK_DETECTION_INFO = record
- SizeOfDetectInfo: DWORD;
- DetectionType: DETECTION_TYPE;
- case Integer of
- 0: (
- //
- // If DetectionType == DETECTION_INT13 then we have just the Int13
- // information.
- //
- Int13: DISK_INT13_INFO;
- //
- // If DetectionType == DETECTION_EX_INT13, then we have the
- // extended int 13 information.
- //
- ExInt13: DISK_EX_INT13_INFO); // If DetectionType == DetectExInt13
- end;
- {$EXTERNALSYM _DISK_DETECTION_INFO}
- DISK_DETECTION_INFO = _DISK_DETECTION_INFO;
- {$EXTERNALSYM DISK_DETECTION_INFO}
- TDiskDetectionInfo = DISK_DETECTION_INFO;
- PDiskDetectionInfo = PDISK_DETECTION_INFO;
- PDISK_PARTITION_INFO = ^DISK_PARTITION_INFO;
- {$EXTERNALSYM PDISK_PARTITION_INFO}
- _DISK_PARTITION_INFO = record
- SizeOfPartitionInfo: DWORD;
- PartitionStyle: PARTITION_STYLE; // PartitionStyle = RAW, GPT or MBR
- case Integer of
- 0: ( // If PartitionStyle == MBR
- Signature: DWORD; // MBR Signature
- CheckSum: DWORD); // MBR CheckSum
- 1: ( // If PartitionStyle == GPT
- DiskId: GUID);
- end;
- {$EXTERNALSYM _DISK_PARTITION_INFO}
- DISK_PARTITION_INFO = _DISK_PARTITION_INFO;
- {$EXTERNALSYM DISK_PARTITION_INFO}
- TDiskPartitionInfo = DISK_PARTITION_INFO;
- PDiskPartitionInfo = PDISK_PARTITION_INFO;
- //
- // The Geometry structure is a variable length structure composed of a
- // DISK_GEOMETRY_EX structure followed by a DISK_PARTITION_INFO structure
- // followed by a DISK_DETECTION_DATA structure.
- //
- function DiskGeometryGetPartition(Geometry: DWORD): PDISK_PARTITION_INFO;
- {$EXTERNALSYM DiskGeometryGetPartition}
- function DiskGeometryGetDetect(Geometry: DWORD): PDISK_DETECTION_INFO;
- {$EXTERNALSYM DiskGeometryGetDetect}
- type
- PDISK_GEOMETRY_EX = ^DISK_GEOMETRY_EX;
- {$EXTERNALSYM PDISK_GEOMETRY_EX}
- _DISK_GEOMETRY_EX = record
- Geometry: DISK_GEOMETRY; // Standard disk geometry: may be faked by driver.
- DiskSize: LARGE_INTEGER; // Must always be correct
- Data: array [0..0] of BYTE; // Partition, Detect info
- end;
- {$EXTERNALSYM _DISK_GEOMETRY_EX}
- DISK_GEOMETRY_EX = _DISK_GEOMETRY_EX;
- {$EXTERNALSYM DISK_GEOMETRY_EX}
- TDiskGeometryEx = DISK_GEOMETRY_EX;
- PDiskGeometryEx = PDISK_GEOMETRY_EX;
- //
- // IOCTL_DISK_CONTROLLER_NUMBER returns the controller and disk
- // number for the handle. This is used to determine if a disk
- // is attached to the primary or secondary IDE controller.
- //
- PDISK_CONTROLLER_NUMBER = ^DISK_CONTROLLER_NUMBER;
- {$EXTERNALSYM PDISK_CONTROLLER_NUMBER}
- _DISK_CONTROLLER_NUMBER = record
- ControllerNumber: DWORD;
- DiskNumber: DWORD;
- end;
- {$EXTERNALSYM _DISK_CONTROLLER_NUMBER}
- DISK_CONTROLLER_NUMBER = _DISK_CONTROLLER_NUMBER;
- {$EXTERNALSYM DISK_CONTROLLER_NUMBER}
- TDiskControllerNumber = DISK_CONTROLLER_NUMBER;
- PDiskControllerNumber = PDISK_CONTROLLER_NUMBER;
- //
- // IOCTL_DISK_SET_CACHE allows the caller to get or set the state of the disk
- // read/write caches.
- //
- // If the structure is provided as the input buffer for the ioctl the read &
- // write caches will be enabled or disabled depending on the parameters
- // provided.
- //
- // If the structure is provided as an output buffer for the ioctl the state
- // of the read & write caches will be returned. If both input and outut buffers
- // are provided the output buffer will contain the cache state BEFORE any
- // changes are made
- //
- DISK_CACHE_RETENTION_PRIORITY = (EqualPriority, KeepPrefetchedData, KeepReadData);
- {$EXTERNALSYM DISK_CACHE_RETENTION_PRIORITY}
- TDiskCacheRetentionPriority = DISK_CACHE_RETENTION_PRIORITY;
- _DISK_WRITE_CACHE_STATE = (
- DiskWriteCacheNormal,
- DiskWriteCacheForceDisable,
- DiskWriteCacheDisableNotSupported);
- {$EXTERNALSYM _DISK_WRITE_CACHE_STATE}
- DISK_WRITE_CACHE_STATE = _DISK_WRITE_CACHE_STATE;
- {$EXTERNALSYM DISK_WRITE_CACHE_STATE}
- PDISK_WRITE_CACHE_STATE = ^DISK_WRITE_CACHE_STATE;
- {$EXTERNALSYM PDISK_WRITE_CACHE_STATE}
- TDiskWriteCacheState = DISK_WRITE_CACHE_STATE;
- PDiskWriteCacheState = PDISK_WRITE_CACHE_STATE;
- TDCIScalarPrefetch = record
- Minimum: WORD;
- Maximum: WORD;
- //
- // The maximum number of blocks which will be prefetched - useful
- // with the scalar limits to set definite upper limits.
- //
- MaximumBlocks: WORD;
- end;
- TDCIBlockPrefetch = record
- Minimum: WORD;
- Maximum: WORD;
- end;
- PDISK_CACHE_INFORMATION = ^DISK_CACHE_INFORMATION;
- {$EXTERNALSYM PDISK_CACHE_INFORMATION}
- _DISK_CACHE_INFORMATION = record
- //
- // on return indicates that the device is capable of saving any parameters
- // in non-volatile storage. On send indicates that the device should
- // save the state in non-volatile storage.
- //
- ParametersSavable: ByteBool;
- //
- // Indicates whether the write and read caches are enabled.
- //
- ReadCacheEnabled: ByteBool;
- WriteCacheEnabled: ByteBool;
- //
- // Controls the likelyhood of data remaining in the cache depending on how
- // it got there. Data cached from a READ or WRITE operation may be given
- // higher, lower or equal priority to data entered into the cache for other
- // means (like prefetch)
- //
- ReadRetentionPriority: DISK_CACHE_RETENTION_PRIORITY;
- WriteRetentionPriority: DISK_CACHE_RETENTION_PRIORITY;
- //
- // Requests for a larger number of blocks than this may have prefetching
- // disabled. If this value is set to 0 prefetch will be disabled.
- //
- DisablePrefetchTransferLength: WORD;
- //
- // If TRUE then ScalarPrefetch (below) will be valid. If FALSE then
- // the minimum and maximum values should be treated as a block count
- // (BlockPrefetch)
- //
- PrefetchScalar: ByteBool;
- //
- // Contains the minimum and maximum amount of data which will be
- // will be prefetched into the cache on a disk operation. This value
- // may either be a scalar multiplier of the transfer length of the request,
- // or an abolute number of disk blocks. PrefetchScalar (above) indicates
- // which interpretation is used.
- //
- case Integer of
- 0: (ScalarPrefetch: TDCIScalarPrefetch);
- 1: (BlockPrefetch: TDCIBlockPrefetch);
- end;
- {$EXTERNALSYM _DISK_CACHE_INFORMATION}
- DISK_CACHE_INFORMATION = _DISK_CACHE_INFORMATION;
- {$EXTERNALSYM DISK_CACHE_INFORMATION}
- TDiskCacheInformation = DISK_CACHE_INFORMATION;
- PDiskCacheInformation = PDISK_CACHE_INFORMATION;
- //
- // IOCTL_DISK_GROW_PARTITION will update the size of a partition
- // by adding sectors to the length. The number of sectors must be
- // predetermined by examining PARTITION_INFORMATION.
- //
- PDISK_GROW_PARTITION = ^DISK_GROW_PARTITION;
- {$EXTERNALSYM PDISK_GROW_PARTITION}
- _DISK_GROW_PARTITION = record
- PartitionNumber: DWORD;
- BytesToGrow: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _DISK_GROW_PARTITION}
- DISK_GROW_PARTITION = _DISK_GROW_PARTITION;
- {$EXTERNALSYM DISK_GROW_PARTITION}
- TDiskGrowPartition = DISK_GROW_PARTITION;
- PDiskGrowPartition = PDISK_GROW_PARTITION;
- ///////////////////////////////////////////////////////
- // //
- // The following structures define disk performance //
- // statistics: specifically the locations of all the //
- // reads and writes which have occured on the disk. //
- // //
- // To use these structures, you must issue an IOCTL_ //
- // DISK_HIST_STRUCTURE (with a DISK_HISTOGRAM) to //
- // obtain the basic histogram information. The //
- // number of buckets which must allocated is part of //
- // this structure. Allocate the required number of //
- // buckets and call an IOCTL_DISK_HIST_DATA to fill //
- // in the data //
- // //
- ///////////////////////////////////////////////////////
- const
- HIST_NO_OF_BUCKETS = 24;
- {$EXTERNALSYM HIST_NO_OF_BUCKETS}
- type
- PHISTOGRAM_BUCKET = ^HISTOGRAM_BUCKET;
- {$EXTERNALSYM PHISTOGRAM_BUCKET}
- _HISTOGRAM_BUCKET = record
- Reads: DWORD;
- Writes: DWORD;
- end;
- {$EXTERNALSYM _HISTOGRAM_BUCKET}
- HISTOGRAM_BUCKET = _HISTOGRAM_BUCKET;
- {$EXTERNALSYM HISTOGRAM_BUCKET}
- THistogramBucket = HISTOGRAM_BUCKET;
- PHistogramBucket = PHISTOGRAM_BUCKET;
- const
- HISTOGRAM_BUCKET_SIZE = SizeOf(HISTOGRAM_BUCKET);
- {$EXTERNALSYM HISTOGRAM_BUCKET_SIZE}
- type
- PDISK_HISTOGRAM = ^DISK_HISTOGRAM;
- {$EXTERNALSYM PDISK_HISTOGRAM}
- _DISK_HISTOGRAM = record
- DiskSize: LARGE_INTEGER;
- Start: LARGE_INTEGER;
- End_: LARGE_INTEGER;
- Average: LARGE_INTEGER;
- AverageRead: LARGE_INTEGER;
- AverageWrite: LARGE_INTEGER;
- Granularity: DWORD;
- Size: DWORD;
- ReadCount: DWORD;
- WriteCount: DWORD;
- Histogram: PHISTOGRAM_BUCKET;
- end;
- {$EXTERNALSYM _DISK_HISTOGRAM}
- DISK_HISTOGRAM = _DISK_HISTOGRAM;
- {$EXTERNALSYM DISK_HISTOGRAM}
- TDiskHistogram = DISK_HISTOGRAM;
- PDiskHistogram = PDISK_HISTOGRAM;
- const
- DISK_HISTOGRAM_SIZE = SizeOf(DISK_HISTOGRAM);
- {$EXTERNALSYM DISK_HISTOGRAM_SIZE}
- ///////////////////////////////////////////////////////
- // //
- // The following structures define disk debugging //
- // capabilities. The IOCTLs are directed to one of //
- // the two disk filter drivers. //
- // //
- // DISKPERF is a utilty for collecting disk request //
- // statistics. //
- // //
- // SIMBAD is a utility for injecting faults in //
- // IO requests to disks. //
- // //
- ///////////////////////////////////////////////////////
- //
- // The following structure is exchanged on an IOCTL_DISK_GET_PERFORMANCE
- // request. This ioctl collects summary disk request statistics used
- // in measuring performance.
- //
- type
- PDISK_PERFORMANCE = ^DISK_PERFORMANCE;
- {$EXTERNALSYM PDISK_PERFORMANCE}
- _DISK_PERFORMANCE = record
- BytesRead: LARGE_INTEGER;
- BytesWritten: LARGE_INTEGER;
- ReadTime: LARGE_INTEGER;
- WriteTime: LARGE_INTEGER;
- IdleTime: LARGE_INTEGER;
- ReadCount: DWORD;
- WriteCount: DWORD;
- QueueDepth: DWORD;
- SplitCount: DWORD;
- QueryTime: LARGE_INTEGER;
- StorageDeviceNumber: DWORD;
- StorageManagerName: array [0..7] of WCHAR;
- end;
- {$EXTERNALSYM _DISK_PERFORMANCE}
- DISK_PERFORMANCE = _DISK_PERFORMANCE;
- {$EXTERNALSYM DISK_PERFORMANCE}
- TDiskPerformance = DISK_PERFORMANCE;
- PDiskPerformance = PDISK_PERFORMANCE;
- //
- // This structure defines the disk logging record. When disk logging
- // is enabled, one of these is written to an internal buffer for each
- // disk request.
- //
- PDISK_RECORD = ^DISK_RECORD;
- {$EXTERNALSYM PDISK_RECORD}
- _DISK_RECORD = record
- ByteOffset: LARGE_INTEGER;
- StartTime: LARGE_INTEGER;
- EndTime: LARGE_INTEGER;
- VirtualAddress: PVOID;
- NumberOfBytes: DWORD;
- DeviceNumber: BYTE;
- ReadRequest: ByteBool;
- end;
- {$EXTERNALSYM _DISK_RECORD}
- DISK_RECORD = _DISK_RECORD;
- {$EXTERNALSYM DISK_RECORD}
- TDiskRecord = DISK_RECORD;
- PDiskRecord = PDISK_RECORD;
- //
- // The following structure is exchanged on an IOCTL_DISK_LOG request.
- // Not all fields are valid with each function type.
- //
- PDISK_LOGGING = ^DISK_LOGGING;
- {$EXTERNALSYM PDISK_LOGGING}
- _DISK_LOGGING = record
- Function_: BYTE;
- BufferAddress: PVOID;
- BufferSize: DWORD;
- end;
- {$EXTERNALSYM _DISK_LOGGING}
- DISK_LOGGING = _DISK_LOGGING;
- {$EXTERNALSYM DISK_LOGGING}
- TDiskLogging = DISK_LOGGING;
- PDiskLogging = PDISK_LOGGING;
- //
- // Disk logging functions
- //
- // Start disk logging. Only the Function and BufferSize fields are valid.
- //
- const
- DISK_LOGGING_START = 0;
- {$EXTERNALSYM DISK_LOGGING_START}
- //
- // Stop disk logging. Only the Function field is valid.
- //
- DISK_LOGGING_STOP = 1;
- {$EXTERNALSYM DISK_LOGGING_STOP}
- //
- // Return disk log. All fields are valid. Data will be copied from internal
- // buffer to buffer specified for the number of bytes requested.
- //
- DISK_LOGGING_DUMP = 2;
- {$EXTERNALSYM DISK_LOGGING_DUMP}
- //
- // DISK BINNING
- //
- // DISKPERF will keep counters for IO that falls in each of these ranges.
- // The application determines the number and size of the ranges.
- // Joe Lin wanted me to keep it flexible as possible, for instance, IO
- // sizes are interesting in ranges like 0-4096, 4097-16384, 16385-65536, 65537+.
- //
- DISK_BINNING = 3;
- {$EXTERNALSYM DISK_BINNING}
- //
- // Bin types
- //
- type
- _BIN_TYPES = (RequestSize, RequestLocation);
- {$EXTERNALSYM _BIN_TYPES}
- BIN_TYPES = _BIN_TYPES;
- {$EXTERNALSYM BIN_TYPES}
- TBinTypes = _BIN_TYPES;
- //
- // Bin ranges
- //
- PBIN_RANGE = ^BIN_RANGE;
- {$EXTERNALSYM PBIN_RANGE}
- _BIN_RANGE = record
- StartValue: LARGE_INTEGER;
- Length: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _BIN_RANGE}
- BIN_RANGE = _BIN_RANGE;
- {$EXTERNALSYM BIN_RANGE}
- TBinRange = BIN_RANGE;
- PBinRange = PBIN_RANGE;
- //
- // Bin definition
- //
- PPERF_BIN = ^PERF_BIN;
- {$EXTERNALSYM PPERF_BIN}
- _PERF_BIN = record
- NumberOfBins: DWORD;
- TypeOfBin: DWORD;
- BinsRanges: array [0..0] of BIN_RANGE;
- end;
- {$EXTERNALSYM _PERF_BIN}
- PERF_BIN = _PERF_BIN;
- {$EXTERNALSYM PERF_BIN}
- TPerfBin = PERF_BIN;
- PPerfBin = PPERF_BIN;
- //
- // Bin count
- //
- PBIN_COUNT = ^BIN_COUNT;
- {$EXTERNALSYM PBIN_COUNT}
- _BIN_COUNT = record
- BinRange: BIN_RANGE;
- BinCount: DWORD;
- end;
- {$EXTERNALSYM _BIN_COUNT}
- BIN_COUNT = _BIN_COUNT;
- {$EXTERNALSYM BIN_COUNT}
- TBinCount = BIN_COUNT;
- PBinCount = PBIN_COUNT;
- //
- // Bin results
- //
- PBIN_RESULTS = ^BIN_RESULTS;
- {$EXTERNALSYM PBIN_RESULTS}
- _BIN_RESULTS = record
- NumberOfBins: DWORD;
- BinCounts: array [0..0] of BIN_COUNT;
- end;
- {$EXTERNALSYM _BIN_RESULTS}
- BIN_RESULTS = _BIN_RESULTS;
- {$EXTERNALSYM BIN_RESULTS}
- TBinResults = BIN_RESULTS;
- PBinResults = PBIN_RESULTS;
- //
- // Data structures for SMART drive fault prediction.
- //
- // GETVERSIONINPARAMS contains the data returned from the
- // Get Driver Version function.
- //
- //#include <pshpack1.h>
- LPGETVERSIONINPARAMS = ^GETVERSIONINPARAMS;
- {$EXTERNALSYM LPGETVERSIONINPARAMS}
- _GETVERSIONINPARAMS = packed record
- bVersion: BYTE; // Binary driver version.
- bRevision: BYTE; // Binary driver revision.
- bReserved: BYTE; // Not used.
- bIDEDeviceMap: BYTE; // Bit map of IDE devices.
- fCapabilities: DWORD; // Bit mask of driver capabilities.
- dwReserved: array [0..3] of DWORD; // For future use.
- end;
- {$EXTERNALSYM _GETVERSIONINPARAMS}
- GETVERSIONINPARAMS = _GETVERSIONINPARAMS;
- {$EXTERNALSYM GETVERSIONINPARAMS}
- TGetVersionInParams = GETVERSIONINPARAMS;
- PGetVersionInParams = LPGETVERSIONINPARAMS;
- //#include <poppack.h>
- //
- // Bits returned in the fCapabilities member of GETVERSIONINPARAMS
- //
- const
- CAP_ATA_ID_CMD = 1; // ATA ID command supported
- {$EXTERNALSYM CAP_ATA_ID_CMD}
- CAP_ATAPI_ID_CMD = 2; // ATAPI ID command supported
- {$EXTERNALSYM CAP_ATAPI_ID_CMD}
- CAP_SMART_CMD = 4; // SMART commannds supported
- {$EXTERNALSYM CAP_SMART_CMD}
- //
- // IDE registers
- //
- //#include <pshpack1.h>
- type
- LPIDEREGS = ^IDEREGS;
- {$EXTERNALSYM LPIDEREGS}
- _IDEREGS = packed record
- bFeaturesReg: BYTE; // Used for specifying SMART "commands".
- bSectorCountReg: BYTE; // IDE sector count register
- bSectorNumberReg: BYTE; // IDE sector number register
- bCylLowReg: BYTE; // IDE low order cylinder value
- bCylHighReg: BYTE; // IDE high order cylinder value
- bDriveHeadReg: BYTE; // IDE drive/head register
- bCommandReg: BYTE; // Actual IDE command.
- bReserved: BYTE; // reserved for future use. Must be zero.
- end;
- {$EXTERNALSYM _IDEREGS}
- IDEREGS = _IDEREGS;
- {$EXTERNALSYM IDEREGS}
- TIdeRegs = IDEREGS;
- PIdeRegs = LPIDEREGS;
- //#include <poppack.h>
- //
- // Valid values for the bCommandReg member of IDEREGS.
- //
- const
- ATAPI_ID_CMD = $A1; // Returns ID sector for ATAPI.
- {$EXTERNALSYM ATAPI_ID_CMD}
- ID_CMD = $EC; // Returns ID sector for ATA.
- {$EXTERNALSYM ID_CMD}
- SMART_CMD = $B0; // Performs SMART cmd.
- // Requires valid bFeaturesReg,
- // bCylLowReg, and bCylHighReg
- {$EXTERNALSYM SMART_CMD}
- //
- // Cylinder register defines for SMART command
- //
- SMART_CYL_LOW = $4F;
- {$EXTERNALSYM SMART_CYL_LOW}
- SMART_CYL_HI = $C2;
- {$EXTERNALSYM SMART_CYL_HI}
- //
- // SENDCMDINPARAMS contains the input parameters for the
- // Send Command to Drive function.
- //
- //#include <pshpack1.h>
- type
- LPSENDCMDINPARAMS = ^SENDCMDINPARAMS;
- {$EXTERNALSYM LPSENDCMDINPARAMS}
- _SENDCMDINPARAMS = packed record
- cBufferSize: DWORD; // Buffer size in bytes
- irDriveRegs: IDEREGS; // Structure with drive register values.
- bDriveNumber: BYTE; // Physical drive number to send
- // command to (0,1,2,3).
- bReserved: array [0..2] of BYTE; // Reserved for future expansion.
- dwReserved: array [0..3] of DWORD; // For future use.
- bBuffer: array [0..0] of BYTE; // Input buffer.
- end;
- {$EXTERNALSYM _SENDCMDINPARAMS}
- SENDCMDINPARAMS = _SENDCMDINPARAMS;
- {$EXTERNALSYM SENDCMDINPARAMS}
- TSendCmdInParams = SENDCMDINPARAMS;
- PSendCmdInParams = LPSENDCMDINPARAMS;
- //#include <poppack.h>
- //
- // Status returned from driver
- //
- //#include <pshpack1.h>
- LPDRIVERSTATUS = ^DRIVERSTATUS;
- {$EXTERNALSYM LPDRIVERSTATUS}
- _DRIVERSTATUS = packed record
- bDriverError: BYTE; // Error code from driver,
- // or 0 if no error.
- bIDEError: BYTE; // Contents of IDE Error register.
- // Only valid when bDriverError
- // is SMART_IDE_ERROR.
- bReserved: array [0..1] of BYTE; // Reserved for future expansion.
- dwReserved: array [0..1] of DWORD; // Reserved for future expansion.
- end;
- {$EXTERNALSYM _DRIVERSTATUS}
- DRIVERSTATUS = _DRIVERSTATUS;
- {$EXTERNALSYM DRIVERSTATUS}
- TDriverStatus = DRIVERSTATUS;
- PDriverStatus = LPDRIVERSTATUS;
- //#include <poppack.h>
- //
- // bDriverError values
- //
- const
- SMART_NO_ERROR = 0; // No error
- {$EXTERNALSYM SMART_NO_ERROR}
- SMART_IDE_ERROR = 1; // Error from IDE controller
- {$EXTERNALSYM SMART_IDE_ERROR}
- SMART_INVALID_FLAG = 2; // Invalid command flag
- {$EXTERNALSYM SMART_INVALID_FLAG}
- SMART_INVALID_COMMAND = 3; // Invalid command byte
- {$EXTERNALSYM SMART_INVALID_COMMAND}
- SMART_INVALID_BUFFER = 4; // Bad buffer (null, invalid addr..)
- {$EXTERNALSYM SMART_INVALID_BUFFER}
- SMART_INVALID_DRIVE = 5; // Drive number not valid
- {$EXTERNALSYM SMART_INVALID_DRIVE}
- SMART_INVALID_IOCTL = 6; // Invalid IOCTL
- {$EXTERNALSYM SMART_INVALID_IOCTL}
- SMART_ERROR_NO_MEM = 7; // Could not lock user's buffer
- {$EXTERNALSYM SMART_ERROR_NO_MEM}
- SMART_INVALID_REGISTER = 8; // Some IDE Register not valid
- {$EXTERNALSYM SMART_INVALID_REGISTER}
- SMART_NOT_SUPPORTED = 9; // Invalid cmd flag set
- {$EXTERNALSYM SMART_NOT_SUPPORTED}
- SMART_NO_IDE_DEVICE = 10; // Cmd issued to device not present
- {$EXTERNALSYM SMART_NO_IDE_DEVICE}
- // although drive number is valid
- //
- // SMART sub commands for execute offline diags
- //
- SMART_OFFLINE_ROUTINE_OFFLINE = 0;
- {$EXTERNALSYM SMART_OFFLINE_ROUTINE_OFFLINE}
- SMART_SHORT_SELFTEST_OFFLINE = 1;
- {$EXTERNALSYM SMART_SHORT_SELFTEST_OFFLINE}
- SMART_EXTENDED_SELFTEST_OFFLINE = 2;
- {$EXTERNALSYM SMART_EXTENDED_SELFTEST_OFFLINE}
- SMART_ABORT_OFFLINE_SELFTEST = 127;
- {$EXTERNALSYM SMART_ABORT_OFFLINE_SELFTEST}
- SMART_SHORT_SELFTEST_CAPTIVE = 129;
- {$EXTERNALSYM SMART_SHORT_SELFTEST_CAPTIVE}
- SMART_EXTENDED_SELFTEST_CAPTIVE = 130;
- {$EXTERNALSYM SMART_EXTENDED_SELFTEST_CAPTIVE}
- //#include <pshpack1.h>
- type
- LPSENDCMDOUTPARAMS = ^SENDCMDOUTPARAMS;
- {$EXTERNALSYM LPSENDCMDOUTPARAMS}
- _SENDCMDOUTPARAMS = packed record
- cBufferSize: DWORD; // Size of bBuffer in bytes
- DriverStatus: DRIVERSTATUS; // Driver status structure.
- bBuffer: array [0..0] of BYTE; // Buffer of arbitrary length in which to store the data read from the // drive.
- end;
- {$EXTERNALSYM _SENDCMDOUTPARAMS}
- SENDCMDOUTPARAMS = _SENDCMDOUTPARAMS;
- {$EXTERNALSYM SENDCMDOUTPARAMS}
- TSendCmdOutParams = SENDCMDOUTPARAMS;
- PSendCmdOutParams = LPSENDCMDOUTPARAMS;
- //#include <poppack.h>
- const
- READ_ATTRIBUTE_BUFFER_SIZE = 512;
- {$EXTERNALSYM READ_ATTRIBUTE_BUFFER_SIZE}
- IDENTIFY_BUFFER_SIZE = 512;
- {$EXTERNALSYM IDENTIFY_BUFFER_SIZE}
- READ_THRESHOLD_BUFFER_SIZE = 512;
- {$EXTERNALSYM READ_THRESHOLD_BUFFER_SIZE}
- SMART_LOG_SECTOR_SIZE = 512;
- {$EXTERNALSYM SMART_LOG_SECTOR_SIZE}
- //
- // Feature register defines for SMART "sub commands"
- //
- READ_ATTRIBUTES = $D0;
- {$EXTERNALSYM READ_ATTRIBUTES}
- READ_THRESHOLDS = $D1;
- {$EXTERNALSYM READ_THRESHOLDS}
- ENABLE_DISABLE_AUTOSAVE = $D2;
- {$EXTERNALSYM ENABLE_DISABLE_AUTOSAVE}
- SAVE_ATTRIBUTE_VALUES = $D3;
- {$EXTERNALSYM SAVE_ATTRIBUTE_VALUES}
- EXECUTE_OFFLINE_DIAGS = $D4;
- {$EXTERNALSYM EXECUTE_OFFLINE_DIAGS}
- SMART_READ_LOG = $D5;
- {$EXTERNALSYM SMART_READ_LOG}
- SMART_WRITE_LOG = $d6;
- {$EXTERNALSYM SMART_WRITE_LOG}
- ENABLE_SMART = $D8;
- {$EXTERNALSYM ENABLE_SMART}
- DISABLE_SMART = $D9;
- {$EXTERNALSYM DISABLE_SMART}
- RETURN_SMART_STATUS = $DA;
- {$EXTERNALSYM RETURN_SMART_STATUS}
- ENABLE_DISABLE_AUTO_OFFLINE = $DB;
- {$EXTERNALSYM ENABLE_DISABLE_AUTO_OFFLINE}
- IOCTL_CHANGER_BASE = FILE_DEVICE_CHANGER;
- {$EXTERNALSYM IOCTL_CHANGER_BASE}