|
-
March 17th, 2003, 10:01 PM
#1
How can I get the SCSI harddisk serial number?
Hi:
Now I have a question :
How can I program to get the SCSI harddisk serial number??
I can get the IDE harddisk serial number through create the devive file . But I cannot get the SCSI hard disk
Who can help me to solve this problem???
Thanks a lot.
Best Regards
tempstack
-
March 19th, 2003, 08:05 PM
#2
My coworker and I are trying to do the same thing. If we figure it out before you, we'll let you know. If not, we'll be watching this thread.
-
March 19th, 2003, 08:47 PM
#3
Any reason why your not using WMI and CIM to get this type of information?
-
March 20th, 2003, 01:58 AM
#4
Well, for one I just came across WMI today as a possibility while searching for info on finding SCSI serial numbers, and haven't found a clear example yet on how to do it that way. The example I found for VB doesn't work:
set objinst = GetObject("WinMgmts::Win32_LogicalDisk='C:'")
MsgBox (GetObject "WinMgmts::Win32_LogicalDisk='C:'").VolumeSerialNumber)
VB didn't like it. Changed the second line to:
MsgBox objinst.VolumeSerialNumber
But the first line gives me an Automation Error, 0x80041012.
--------
And two, I don't want to have to install WMI on 95/98/NT4 just to get at this one serial number, even if I do figure out how to get WMI to work.
-
March 20th, 2003, 07:33 AM
#5
Originally posted by ryoken
Well, for one I just came across WMI today as a possibility while searching for info on finding SCSI serial numbers, and haven't found a clear example yet on how to do it that way. The example I found for VB doesn't work:
set objinst = GetObject("WinMgmts::Win32_LogicalDisk='C:'")
MsgBox (GetObject "WinMgmts::Win32_LogicalDisk='C:'").VolumeSerialNumber)
VB didn't like it. Changed the second line to:
MsgBox objinst.VolumeSerialNumber
But the first line gives me an Automation Error, 0x80041012.
--------
And two, I don't want to have to install WMI on 95/98/NT4 just to get at this one serial number, even if I do figure out how to get WMI to work.
Can't help you with VB, could help you with C++. And yes WMI needs to be installed on those machines, but you have the ability to remotly retrieve information etc etc. Think of it as an extension of SNMP.
How are you retrieving the serial number with an IOCTL?
-
March 20th, 2003, 07:37 PM
#6
I agree that WMI looks nice, but I've got clients, not users. I can't (and don't want to) force them to install management software on their own personal machines. So there's no SNMP here to extend.
VC++ is fine with me, and actually preferable. I was only messing with VB, as that's what the example was in. If I could get it to work in VB, moving to VC++ wouldn't be an issue.
To retrieve IDE serial numbers we are using DeviceIoControl(), not ioctl(). However, SCSI drives don't seem to want to report a serial number though this call.
-
March 21st, 2003, 03:30 AM
#7
I am also working one this problem now.
Some other guys have suggested me to use the DDK programming:
"ssue a SCSI_PASS_THROUGH_DIRECT INQUIRY command. The adapter will pass
this command to the Physcial drive you open. Then you can see the product ID,
serial Number etc information in the inquiry info.
"
I am not familar with DDK programming.
Is here some body know this clearly?
If I have use the "SCSI_PASS_THROUGH_DIRECT " in my C file, which is defined in the DDK\inc\**.h.
Can I compile my C file as usual??
How can I begin with the DDK programmng?
Any now know this? I think it is seems resonable to use this way to get the SCSI infomation.
Thanks.
-
March 21st, 2003, 11:29 AM
#8
We've tried that method already, actually. The command works, you get back the drive's model and vendor ID's, but the serial number field is returned as an empty string.
We pulled all the defines and structures off MSDN Library help and other online sources and included them directly into our source instead of using the DDK header files themselves.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|