磁盘厂商数据的结构IDINFO

通过IOCTL_ATA_PASS_THROUGH获取磁盘序列号的时候,遇到512字节的data buffer,但是没找到MSDN上的结构定义,于是上网搜索了一下,此处记录,方便后续查看

#pragma once
#include <WinBase.h>

typedef struct _IDINFO
{
	USHORT wGenConfig;//WORD 0: Basic information word
	USHORT wNumCyls;//WORD 1: Number of cylinders
	USHORT wReserved2;//WORD 2: reserved
	USHORT wNumHeads;//WORD 3: Number of heads
	USHORT wReserved4;//WORD 4: reserved
	USHORT wReserved5;//WORD 5: reserved
	USHORT wNumSectorsPerTrack;//WORD 6: Number of sectors per track
	USHORT wVendorUnique[3];//WORD 7-9: Factory setting value
	CHAR sSerialNumber[20];//WORD 10-19: serial number
	USHORT wBufferType;//WORD 20: buffer type
	USHORT wBufferSize;//WORD 21: buffer size
	USHORT wECCSize;//WORD 22: ECC check size
	CHAR sFirmwareRev[8];//WORD 23-26: Firmware version number
	CHAR sModelNumber[40];//WORD 27-46: Internal model
	USHORT wMoreVendorUnique;//WORD 47: Factory setting value
	USHORT wReserved48;//WORD 48: reserved
	struct {
		USHORT reserved1 : 8;
		USHORT DMA : 1;//1=support DMA
		USHORT LBA : 1;//1=Support LBA
		USHORT DisIORDY : 1;//1=IORDY may not be used
		USHORT IORDY : 1;//1=support IORDY
		USHORT SoftReset : 1;//1=Requires ATA soft start
		USHORT Overlap : 1;//1=Support overlap operation
		USHORT Queue : 1;//1=Support command queue
		USHORT InlDMA : 1;//1=Support interleaved DMA
	} wCapabilities;//WORD 49: General capabilities
	USHORT wReserved1;//WORD 50: reserved
	USHORT wPIOTiming;//WORD 51: PIO timing
	USHORT wDMATiming;//WORD 52: DMA timing
	struct {
		USHORT CHSNumber : 1;//1=WORD 54-58 is valid
		USHORT CycleNumber : 1;//1=WORD 64-70 is valid
		USHORT UnltraDMA : 1;//1=WORD 88 is valid
		USHORT reserved : 13;
	} wFieldValidity;//WORD 53: Maybe field validity flag
	USHORT wNumCurCyls;//WORD 54: CHS addressable cylinder number
	USHORT wNumCurHeads;//WORD 55: CHS addressable head number
	USHORT wNumCurSectorsPerTrack;//WORD 56: CHS addressable number of sectors per track
	USHORT wCurSectorsLow;//WORD 57: CHS addressable sector number low word
	USHORT wCurSectorsHigh;//WORD 58: High word of CHS addressable sector number
	struct {
		USHORT CurNumber : 8;//The current number of sectors that can be read and written at one time
		USHORT Multi : 1;//1=Multi-sector read and write selected
		USHORT reserved1 : 7;
	} wMultSectorStuff;//WORD 59: Multi-sector read and write settings
	ULONG dwTotalSectors;//WORD 60-61: Number of sectors addressable by LBA
	USHORT wSingleWordDMA;//WORD 62: Single-byte DMA support capability
	struct {
		USHORT Mode0 : 1;//1=Support Mode 0 (4.17Mb/s)
		USHORT Mode1 : 1;//1=Support Mode 1 (13.3Mb/s)
		USHORT Mode2 : 1;//1=Support Mode 2 (16.7Mb/s)
		USHORT Reserved1 : 5;
		USHORT Mode0Sel : 1;//1=Mode 0 has been selected
		USHORT Mode1Sel : 1;//1=Mode 1 has been selected
		USHORT Mode2Sel : 1;//1=Mode 2 has been selected
		USHORT Reserved2 : 5;
	} wMultiWordDMA;//WORD 63: Multi-byte DMA support capability
	struct {
		USHORT AdvPOIModes : 8;//Number of advanced POI modes supported
		USHORT reserved : 8;
	} wPIOCapacity;//WORD 64: Advanced PIO support capability
	USHORT wMinMultiWordDMACycle;//WORD 65: The minimum value of multi-byte DMA transmission cycle
	USHORT wRecMultiWordDMACycle;//WORD 66: Recommended value of multi-byte DMA transmission cycle
	USHORT wMinPIONoFlowCycle;//WORD 67: The minimum value of PIO transmission cycle without flow control
	USHORT wMinPOIFlowCycle;//WORD 68: The minimum value of PIO transmission cycle when there is flow control
	USHORT wReserved69[11];//WORD 69-79: reserved
	struct {
		USHORT Reserved1 : 1;
		USHORT ATA1 : 1;//1=support ATA-1
		USHORT ATA2 : 1;//1=Support ATA-2
		USHORT ATA3 : 1;//1=Support ATA-3
		USHORT ATA4 : 1;//1=Support ATA/ATAPI-4
		USHORT ATA5 : 1;//1=Support ATA/ATAPI-5
		USHORT ATA6 : 1;//1=Support ATA/ATAPI-6
		USHORT ATA7 : 1;//1=Support ATA/ATAPI-7
		USHORT ATA8 : 1;//1=Support ATA/ATAPI-8
		USHORT ATA9 : 1;//1=Support ATA/ATAPI-9
		USHORT ATA10 : 1;//1=Support ATA/ATAPI-10
		USHORT ATA11 : 1;//1=Support ATA/ATAPI-11
		USHORT ATA12 : 1;//1=Support ATA/ATAPI-12
		USHORT ATA13 : 1;//1=Support ATA/ATAPI-13
		USHORT ATA14 : 1;//1=Support ATA/ATAPI-14
		USHORT Reserved2 : 1;
	} wMajorVersion;//WORD 80: Major version number
	USHORT wMinorVersion;//WORD 81: Minor version number
	USHORT wReserved82[6];//WORD 82-87: reserved
	struct {
		USHORT Mode0 : 1;//1=Support Mode 0 (16.7Mb/s)
		USHORT Mode1 : 1;//1=Support Mode 1 (25Mb/s)
		USHORT Mode2 : 1;//1=Support Mode 2 (33Mb/s)
		USHORT Mode3 : 1;//1=Support Mode 3 (44Mb/s)
		USHORT Mode4 : 1;//1=Support Mode 4 (66Mb/s)
		USHORT Mode5 : 1;//1=Support Mode 5 (100Mb/s)
		USHORT Mode6 : 1;//1=Support Mode 6 (133Mb/s)
		USHORT Mode7 : 1;//1=Support Mode 7 (166Mb/s) ???
		USHORT Mode0Sel : 1;//1=Mode 0 has been selected
		USHORT Mode1Sel : 1;//1=Mode 1 has been selected
		USHORT Mode2Sel : 1;//1=Mode 2 has been selected
		USHORT Mode3Sel : 1;//1=Mode 3 has been selected
		USHORT Mode4Sel : 1;//1=Mode 4 has been selected
		USHORT Mode5Sel : 1;//1=Mode 5 has been selected
		USHORT Mode6Sel : 1;//1=Mode 6 has been selected
		USHORT Mode7Sel : 1;//1=Mode 7 has been selected
	} wUltraDMA;//WORD 88: Ultra DMA support capability
	USHORT wReserved89[167];//WORD 89-255
} IDINFO, * PIDINFO;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值