Documentation
¶
Overview ¶
Package ioctl provides Windows IOCTL support
Package ioctl provides Windows IOCTL support ¶
Package ioctl provides Windows IOCTL support ¶
Package ioctl provides Windows IOCTL support
Index ¶
Constants ¶
const ( METHOD_NEITHER = 3 METHOD_BUFFERED = 0 FILE_ANY_ACCESS = 0 FILE_SPECIAL_ACCESS = 0 FILE_READ_ACCESS = 1 FILE_WRITE_ACCESS = 2 )
const ( IOCTL_SCSI_BASE = 0x00000004 IOCTL_DISK_BASE = 0x00000007 IOCTL_VOLUME_BASE = 0x00000056 )
const ( IOCTL_DISK_GET_DRIVE_GEOMETRY_EX = (IOCTL_DISK_BASE << 16) | (FILE_ANY_ACCESS << 14) | (0x0028 << 2) | METHOD_BUFFERED IOCTL_SCSI_GET_ADDRESS = (IOCTL_SCSI_BASE << 16) | (FILE_ANY_ACCESS << 14) | (0x0406 << 2) | METHOD_BUFFERED IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = (IOCTL_VOLUME_BASE << 16) | (FILE_ANY_ACCESS << 14) | (0x0000 << 2) | METHOD_BUFFERED )
const ( PARTITION_STYLE_MBR = iota PARTITION_STYLE_GPT PARTITION_STYLE_RAW )
const ( Unknown = iota // 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 )
const (
INVALID_HANDLE_VALUE = ^uintptr(0)
)
Variables ¶
This section is empty.
Functions ¶
func GetDiskCapacity ¶
GetDiskCapacity returns back the given disk's capacity (in bytes)
Types ¶
type DISK_EXTENT ¶
func GetVolumeDiskExtents ¶
func GetVolumeDiskExtents(volumePathID string) (diskExtents []DISK_EXTENT, err error)
GetVolumeDiskExtents issues an IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS to the given volume and returns back the volume's DISK_EXTENT array.
type DISK_GEOMETRY ¶
type DISK_GEOMETRY struct {
Cylinders uint64
MediaType MEDIA_TYPE
TracksPerCylinder uint32
SectorsPerTrack uint32
BytesPerSector uint32
}
type DISK_GEOMETRY_EX ¶
type DISK_GEOMETRY_EX struct {
Geometry DISK_GEOMETRY
DiskSize uint64
DiskPartitionMBR *DISK_PARTITION_INFO_MBR
DiskPartitionGPT *DISK_PARTITION_INFO_GPT
}
func GetDiskGeometry ¶
func GetDiskGeometry(diskNumber uint32) (diskGeometry *DISK_GEOMETRY_EX, err error)
GetDiskGeometry issues an IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS to the given volume and returns back the volume's geometry details.
type DISK_GEOMETRY_EX_RAW ¶
type DISK_GEOMETRY_EX_RAW struct {
Geometry DISK_GEOMETRY
DiskSize uint64
}
type DISK_PARTITION_INFO_GPT ¶
type DISK_PARTITION_INFO_GPT struct {
SizeOfPartitionInfo uint32
PartitionStyle PARTITION_STYLE
DiskId uuid.UUID
}
type DISK_PARTITION_INFO_MBR ¶
type DISK_PARTITION_INFO_MBR struct {
SizeOfPartitionInfo uint32
PartitionStyle PARTITION_STYLE
Signature uint32
CheckSum uint32
}
type SCSI_ADDRESS ¶
func GetScsiAddress ¶
func GetScsiAddress(devicePathID string) (scsiAddress *SCSI_ADDRESS, err error)
GetScsiAddress issues an IOCTL_SCSI_GET_ADDRESS to the given device and returns back the device's SCSI_ADDRESS struct.