📄 jwawinioctl.pas
字号:
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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -