!!500分!!高手请进!!如果取得SCSI硬盘的序列号

hktl 2004-09-21 06:35:28

试过了很多方法都不行

我现在用的是http://dev.csdn.net/develop/article/17/17209.shtm中介绍的方法。
(列举已安装的存储设备)
IDE的可以取到。SCSI只取到型号等资料,。就是得不到序列号。

"\\\\.\\PhysicalDrive%d" 和 "\\\\.\\SCSI%d"这两样在IDE也是可以取到了。
但是取不到SCSI硬盘的任何资料,
...全文
393 29 打赏 收藏 转发到动态 举报
写回复
用AI写文章
29 条回复
切换为时间正序
请发表友善的回复…
发表回复
MikeChen2003 2005-06-15
  • 打赏
  • 举报
回复
mark
HuWenjin 2004-11-13
  • 打赏
  • 举报
回复
真是重金之下必有勇夫

我觉得这里的不错
http://www.winsim.com/diskid32/diskid32.html

但是没有用SCSI试过
我的软件注册码用到它的部分代码,还不错
wenyuzhang168 2004-11-12
  • 打赏
  • 举报
回复
我有源程序,发email给我吧。
哈哈。
hdwyz123@163.net
luoxiangdong 2004-11-11
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3543/3543776.xml?temp=.34219
Atomictry 2004-10-31
  • 打赏
  • 举报
回复
当时我取SCSI硬盘的序列号时找了n多读序列号的资料,没找到相关SCSI代码, 都是取IDE硬盘的。
后来没办法只能取系统盘的序号。 帮你顶。
talker 2004-10-30
  • 打赏
  • 举报
回复
Get SCSI Disk Information Command
Prototype: DWORD SendASPI32Command(LPSRB)

Declaration: LPSRB lpSRB;

The SendASPI32Command function with command code SC_GET_DISK_INFO is used to obtain information about a disk type SCSI device. The information returned includes BIOSint13h control and accessibility of the device, the drive's INT 13h physical drive number, and the geometry used by the INT 13h services for the drive.

Note: This command is not valid for Windows NT/Windows 2000, which does not use the INT 13 interface.

Parameter Description
lpSRB Points to the following SCSI request block


typedef struct {
BYTE SRB_Cmd; // ASPI command code = SC_EXEC_SCSI_CMD
BYTE SRB_Status; // ASPI command status byte
BYTE SRB_HaId; // ASPI host adapter number
BYTE SRB_Flags; // Reserved
DWORD SRB_Hdr_Rsvd; // Reserved
BYTE SRB_Target; // Target's SCSI ID
BYTE SRB_Lun; // Target's LUN number
BYTE SRB_DriveFlags; // Driver flags
BYTE SRB_Int13HDriveInfo; // Host Adapter Status
BYTE SRB_Heads; // Preferred number of heads translation
BYTE SRB_Sectors; // Preferred number of sectors translation
BYTE SRB_Rsvd1[10]; // Reserved

} SRB_GetDiskInfo, *PSRB_GetDiskInfo;

Table 4-12. Get SCSI Disk Information Command

Member Description
SRB_Cmd [IN] This field must contain SC_GET_DISK_INFO.
SRB_Status [OUT] On return, this field will be the same as the return status defined in the following.
SRB_HaId [IN] This field specifies which installed host adapter the request is intended for. Host adapter numbers are always assigned by the ASPI manager layer beginning with zero.
SRB_Flags [IN] Reserved = zero
SRB_Hdr_Rsvd Reserved = zero
SRB_Target [IN] SCSI ID of target device.
SRB_Lun [IN] Logical Unit Number (LUN) of device. This field is ignored by ASPI for Win32, since SCSI Bus Device resets are done on a per-target basis only.
SRB_DriveFlags [OUT] Upon completion of the SCSI command, the ASPI manager sets this field as follows:

Bit 7-2 Reserved
Bit 1-0 These bits are encoded to reflect INT 13h control and accessibility to the device. Bit 1 is the most significant bit. DISK_NOT_INT13 Device is not controlled by INT 13h services DISK_INT13_AND_DOS Device is under INT 13h control and is claimed by DOS DISK_INT1 Device is under INT 13h control but not claimed by DOS

SRB_Int13DriveInfo [OUT] Upon completion of the SCSI command, the ASPI manager sets this field with the physical drive number that INT 13h services assigned to the device. The valid drive numbers are 0x00 to 0xFF. This field is only valid if bits 1-0 of the SRB_DriveFlags were set to DISK_INT13_AND_DOS or DISK_INT13.
SRB_Heads [OUT] Upon completion of the SCSI command, the ASPI manager sets this field to the number of heads the Int13h services is using for this device's geometry. The valid drive numbers are 0x00 to 0xFF. This field is only valid if bits 1-0 of the SRB_DriveFlags were set to DISK_INT13_AND_DOS or DISK_INT13.
SRB_Sectors [OUT] Upon completion of the SCSI command, the ASPI manager sets this field to the number of sectors the INT 13h services is using for this device's geometry. The valid drive numbers are 0x00 to 0xFF. This field is only valid if bits 1-0 of the SRB_DriveFlags were set to DISK_INT13_AND_DOS or DISK_INT13.


Table 4-13. Return Values from Get SCSI Disk Information Command

Value Meaning
SS_COMP SCSI/ASPI request has completed without error.
SS_INVALID_HA Invalid host adapter number.
SS_INVALID_SRB One or more parameters in the SCSI Request Block (SRB) are set incorrectly.


Example

This example obtains disk information from device LUN 0, SCSI ID 2, attached to host adapter #0.

SRB_GetDiskInfo MySRB;
DWORD ASPIStatus;
.
.
MySRB.SRB_Header.SRB_Cmd = SC_GET_DISK_INFO;
MySRB.SRB_HaId = 0;
MySRB.SRB_Flags = 0;
MySRB.SRB_Hdr_Rsvd = 0;
MySRB.SRB_Target = 2;
MySRB.SRB_Lun = 0;
ASPIStatus = SendASPI32Command ( (LPSRB) &MySRB );

lpschenshengxue 2004-10-30
  • 打赏
  • 举报
回复
用USB可以解决这个问题。
fuguimao 2004-10-27
  • 打赏
  • 举报
回复
还没有解决吗?
stonewind 2004-10-27
  • 打赏
  • 举报
回复
上次看到有专门取scsi硬盘序号的源码,不过不知在哪了
dropingleaf 2004-10-18
  • 打赏
  • 举报
回复
在csdn搜索一下硬盘 序列号 就能找到现成的例子!
Bob 2004-10-18
  • 打赏
  • 举报
回复
看看这里的可以不?
http://www.winsim.com/diskid32/diskid32.html
wenyuzhang168 2004-10-01
  • 打赏
  • 举报
回复
帮顶混分
Mr-Chen 2004-09-30
  • 打赏
  • 举报
回复
都不行吗?
这方面资料太少了,有些是厂家保留的
hktl 2004-09-24
  • 打赏
  • 举报
回复
vagabond2002(星际浪子)
谢谢你。。你真幽默
nwpulipeng 2004-09-24
  • 打赏
  • 举报
回复
帮顶混分
hktl 2004-09-23
  • 打赏
  • 举报
回复
wenyuzhang168

整个系列的文章我都详细看过了。。
提供的代码取不出来序列号。。在IDE上可以

没有人写过这方面的代码吗。。取SCSI硬盘序列号
wenyuzhang168 2004-09-23
  • 打赏
  • 举报
回复
http://dev.csdn.net/develop/article/17/17097.shtm
vagabond2002 2004-09-23
  • 打赏
  • 举报
回复
你看看硬盘上面的标签,说不定会有的
hktl 2004-09-23
  • 打赏
  • 举报
回复
http://www.cz88.net/2004/7-7/235257.htm
一样是用 CreateFile(\\\\.\\PhysicalDrive%d,........)的方法
我试过了


http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=199831
这个也一样试过

hktl 2004-09-23
  • 打赏
  • 举报
回复
crystal521(水晶泪)
我也是用DeviceIoControl。。
DeviceIoControl有很多方法可以实现的,
我现在用的三个方法都是用DeviceIoControl实现的
先看看你的例子。。谢谢
加载更多回复(9)

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧