⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winioctl.pas

📁 详细Windows API大全有关知识以及相关问题
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  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;

//
// 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;

  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;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -