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

📄 hdisksn.h

📁 这个是集合几种关于硬盘的序列号的获取方式的DLL
💻 H
📖 第 1 页 / 共 2 页
字号:
	USHORT wDMATiming;					// 20. DMA时序

	struct
	{
		USHORT  CHSNumber:1;		// 1=WORD 54-58有效
		USHORT  CycleNumber:1;		// 1=WORD 64-70有效
		USHORT  UnltraDMA:1;		// 1=WORD 88有效
		USHORT  reserved:13;		// 保留
	}
	wFieldValidity;						// 21. 后续字段有效性标志

	USHORT wNumCurrentCyls;				// 22. CHS可寻址的柱面数
	USHORT wNumCurrentHeads;			// 23. CHS可寻址的磁头数
	USHORT wNumCurrentSectorsPerTrack;	// 24. CHS可寻址每磁道扇区数
	ULONG  ulCurrentSectorCapacity;		// 25. CHS可寻址的扇区数

	struct
	{
		USHORT  CurNumber:8;		// 当前一次性可读写扇区数
		USHORT  Multi:1;			// 1=已选择多扇区读写
		USHORT  reserved1:7;		// 保留
	}
	wMultSectorStuff;					// 26. 多扇区读写设定

	ULONG  ulTotalAddressableSectors;	// 27. LBA可寻址的扇区数
	USHORT wSingleWordDMA;				// 28. 单字节DMA支持能力

	struct
	{
		USHORT  Mode0:1;			// 1=支持模式0 (4.17Mb/s)
		USHORT  Mode1:1;			// 1=支持模式1 (13.3Mb/s)
		USHORT  Mode2:1;			// 1=支持模式2 (16.7Mb/s)
		USHORT  Reserved1:5;		// 保留
		USHORT  Mode0Sel:1;			// 1=已选择模式0
		USHORT  Mode1Sel:1;			// 1=已选择模式1
		USHORT  Mode2Sel:1;			// 1=已选择模式2
		USHORT  Reserved2:5;		// 保留
	}
	wMultiWordDMA;						// 29. 多字节DMA支持能力

	struct
	{
		USHORT  AdvPOIModes:8;		// 支持高级POI模式数
		USHORT  reserved:8;			// 保留
	}
	wPIOCapacity;						// 30. 高级PIO支持能力

	USHORT wMinMultiWordDMACycle;		// 31. 多字节DMA传输周期的最小值
	USHORT wRecMultiWordDMACycle;		// 32. 多字节DMA传输周期的建议值
	USHORT wMinPIONoFlowCycle;			// 33. 无流控制时PIO传输周期的最小值
	USHORT wMinPOIFlowCycle;			// 34. 有流控制时PIO传输周期的最小值
	USHORT wReserved2[11];				// 35. 保留

	struct
	{
		USHORT  Reserved1:1;
		USHORT  ATA1:1;				// 1=支持ATA-1
		USHORT  ATA2:1;				// 1=支持ATA-2
		USHORT  ATA3:1;				// 1=支持ATA-3
		USHORT  ATA4:1;				// 1=支持ATA/ATAPI-4
		USHORT  ATA5:1;				// 1=支持ATA/ATAPI-5
		USHORT  ATA6:1;				// 1=支持ATA/ATAPI-6
		USHORT  ATA7:1;				// 1=支持ATA/ATAPI-7
		USHORT  ATA8:1;				// 1=支持ATA/ATAPI-8
		USHORT  ATA9:1;				// 1=支持ATA/ATAPI-9
		USHORT  ATA10:1;			// 1=支持ATA/ATAPI-10
		USHORT  ATA11:1;			// 1=支持ATA/ATAPI-11
		USHORT  ATA12:1;			// 1=支持ATA/ATAPI-12
		USHORT  ATA13:1;			// 1=支持ATA/ATAPI-13
		USHORT  ATA14:1;			// 1=支持ATA/ATAPI-14
		USHORT  Reserved2:1;		// 保留
	}
	wMajorVersion;						// 36. 主版本

	USHORT wMinorVersion;				// 37. 副版本
	USHORT wReserved3[6];				// 38. 保留

	struct
	{
		USHORT  Mode0:1;			// 1=支持模式0 (16.7Mb/s)
		USHORT  Mode1:1;			// 1=支持模式1 (25Mb/s)
		USHORT  Mode2:1;			// 1=支持模式2 (33Mb/s)
		USHORT  Mode3:1;			// 1=支持模式3 (44Mb/s)
		USHORT  Mode4:1;			// 1=支持模式4 (66Mb/s)
		USHORT  Mode5:1;			// 1=支持模式5 (100Mb/s)
		USHORT  Mode6:1;			// 1=支持模式6 (133Mb/s)
		USHORT  Mode7:1;			// 1=支持模式7 (166Mb/s) ???
		USHORT  Mode0Sel:1;			// 1=已选择模式0
		USHORT  Mode1Sel:1;			// 1=已选择模式1
		USHORT  Mode2Sel:1;			// 1=已选择模式2
		USHORT  Mode3Sel:1;			// 1=已选择模式3
		USHORT  Mode4Sel:1;			// 1=已选择模式4
		USHORT  Mode5Sel:1;			// 1=已选择模式5
		USHORT  Mode6Sel:1;			// 1=已选择模式6
		USHORT  Mode7Sel:1;			// 1=已选择模式7
	}
	wUltraDMA;							// 39. Ultra DMA支持能力

	USHORT wReserved4[167];				// 40. 保留
}
IDSECTOR, *PIDSECTOR;

//-------------------------------------------------------------------------//

// SCSI驱动所需的输入输出共用的结构
typedef struct _SRB_IO_CONTROL
{
	ULONG	HeaderLength;		// 头长度
	UCHAR	Signature[8];		// 特征名称
	ULONG	Timeout;			// 超时时间
	ULONG	ControlCode;		// 控制码
	ULONG	ReturnCode;			// 返回码
	ULONG	Length;				// 缓冲区长度
}
SRB_IO_CONTROL, *PSRB_IO_CONTROL;

#define SRB_IOBUFF_SIZE	(sizeof(SRB_IO_CONTROL) + sizeof(SENDCMDOUTPARAMS))

//-------------------------------------------------------------------------//

// 模拟的32位寄存器:DeviceIoControl入口参数
typedef struct _DEVIOCTL_REGISTERS
{
	DWORD EBX;
	DWORD EDX;
	DWORD ECX;
	DWORD EAX;
	DWORD EDI;
	DWORD ESI;
	DWORD Flags;
}
DEVIOCTL_REGISTERS, *PDEVIOCTL_REGISTERS;

// 在DS:BX寄存器所采用的磁盘IO结构(在Windows下不用设置DS)
typedef struct _DEVIOCTL_DISKIOPACK
{
	DWORD dwStartSector;
	WORD  wSectors;
	BYTE  *lpBuffer;
}
DEVIOCTL_DISKIOPACK, *PDEVIOCTL_DISKIOPACK;

// 自定义的LONGLONG结构,用于提取64位的高32位和低32位
typedef union _SCK_LARGE_INTEGER
{
	struct
	{
		DWORD Low;
		LONG High;
	} u;
	LONGLONG Quad;
}
SCK_LARGE_INTEGER;

//-------------------------------------------------------------------------//

typedef struct type_sdeffsd_req_usage
{
   USHORT _IOR_ioctl_drive;
   USHORT _IOR_ioctl_function ;
   ULONG _IOR_ioctl_control_param ;
   ULONG _IOR_ioctl_buffer_ptr;
   ULONG _IOR_ioctl_client_params;
   ULONG _IOR_ioctl_return;
}
_type_sdeffsd_req_usage;

typedef union urequestor_usage
{
   ULONG  _IOR_requestor_usage[5];

   struct type_sdeffsd_req_usage sdeffsd_req_usage;
}
_urequestor_usage;

typedef  void (* CMDCPLT)(void);

// IOR (I/O Request Descriptor) Data Structure
typedef struct _IOR
{
	ULONG    IOR_next;				// client link for BCB's (MBZ for IORF_VERSION_002)
	USHORT   IOR_func;				// function to be performed - see defines below
	USHORT   IOR_status;			// request status - see defines below
	ULONG    IOR_flags;	     		// request control flags - see defines below
	CMDCPLT  IOR_callback;			// address to call request back to if
									// IORF_SYNC_COMMAND is not set
	ULONG    IOR_start_addr[2];		// volume relative starting addr
	ULONG    IOR_xfer_count;		// number of sectors to process if
	ULONG    IOR_buffer_ptr;		// BlockDev client buffer pointer

	ULONG    IOR_private_client;	// BlockDev/IOS client reserved
	ULONG    IOR_private_IOS;    	// reserved space for IOS
	ULONG    IOR_private_port;		// private area for port driver
	union    urequestor_usage _ureq;// requestor usage area, also used for IOCTL's

	ULONG    IOR_req_req_handle;	// requestor provided request
	ULONG    IOR_req_vol_handle; 	// requestor provided media handle
	ULONG    IOR_sgd_lin_phys;		// pointer to first physical SGD
	UCHAR    IOR_num_sgds;			// number of phys SGD's pointed

	UCHAR    IOR_vol_designtr;		// numeric representation of the drive letter
	USHORT   IOR_ios_private_1;		// reserved by IOS to force alignment
	ULONG    IOR_reserved_2[2];  	// reserved for internal use
}
IOR, *PIOR;

//-------------------------------------------------------------------------//

#define IOR_READ				0x0000	// Reads sectors/bytes as specified in IOR_xfer_count
#define IOR_WRITE				0x0001	// Writes sectors/bytes as specified in IOR_xfer_count
#define IORF_PHYS_CMD			0x40000000	// indicates I/O is for a physical device
#define IORF_VERSION_002		0x0400	// indicates use of extended BCB (IOR) format request
#define IORF_SYNC_COMMAND		0x0100	// indicates synchronous command complete before return
#define IORF_HIGH_PRIORITY		0x0001	// binary priority indication

// 自定义输入命令缓冲区结构:用于控制DiskIO.VXD的操作
typedef struct _SckInputOrder
{
	BOOL bOperation;						// False:Read, True:Write
	BYTE byWhichDisk;						// 0x00软盘,0x80硬盘
	UINT uiStartSecLo, uiStartSecHi;		// 开始扇区 结束扇区
	UINT uiSumSectors;						// 扇区数
}
SckInputOrder, *PSckInputOrder;

//-------------------------------------------------------------------------//

#define TCSY_GETITEMCOUNT			0x00		// 获取单元总数
#define TCSY_GETTCSYHEAD			0x01		// 获取链表标头
#define TCSY_FINDLISTHEAD			0x02		// 搜索链表标头
#define TCSY_LOADLIST				0x03		// 装载信息链表
#define TCSY_ADDEND					0x04		// 尾部追加数据
#define TCSY_READCURR				0x05		// 读取当前节点
#define TCSY_WRITECURR				0x06		// 写入当前节点
#define TCSY_DELETECURR				0x07		// 删除当前节点
#define TCSY_REWINDCURR				0x08		// 当前到首或尾
#define TCSY_CURRTOPRIOR			0x09		// 当前到上一点
#define TCSY_CURRTONEXT				0x0A		// 当前到下一点
#define TCSY_DIRECTDELETE			0x0B		// 直接删除单元
#define TCSY_REMOVELISTALL			0x0C		// 卸载链表全部
#define TCSY_SETDETECTFREQ			0x0D		// 设置监视频率
#define TCSY_SETFIRSTREGIST			0x0E		// 首次是否注册
#define TCSY_REGISTPRODUCT			0x0F		// 注册软件产品
#define TCSY_DIYREGISTSOFT			0x10		// 自定唯一标识

/////////////////////////////////////////////////////////////////////////////
#endif // #ifndef HDISK_SN_H

⌨️ 快捷键说明

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