How to read hardware info in my filter driver?

Hi,

I want to read hardware information in my filter driver, for example serial number of CPU
,serial number of harddisk and newwork card. I don’t know how to do this in my FS filter
driver.

Can someone help me? Thanks!

headium2006@163.com wrote:

Hi,

I want to read hardware information in my filter driver, for example serial number of CPU
,serial number of harddisk and newwork card. I don’t know how to do this in my FS filter
driver.

Well you’re in ring 0 so there’s nothing stopping you issuing a CPUID
instruction, provided the user hasn’t switched it off in the BIOS and
they’re using a chip that has one in the first place (Pentium III). I
wouldn’t rely on it though.

Hard disks and network cards are going to be a problem. Hard disks
don’t have serial numbers that I’m aware of but you could issue a disk
read of the boot sector to get the serial from that (modified on every
reformat).

Network cards have MAC addresses (not serial numbers) them but reading
that from a driver is going to be a bit of a challenge. Plus MAC
addresses are easily changable from userspace so not useful as any kind
of serial check.

Tony

“Tony Hoyle” wrote in message news:xxxxx@ntfsd…
> Hard disks and network cards are going to be a problem. Hard disks don’t
> have serial numbers that I’m aware of but you could issue a disk read of
> the boot sector to get the serial from that (modified on every reformat).

Actually, most disks do have serial numbers, you can use
IOCTL_STORAGE_QUERY_PROPERTY to get the serial number.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply

Hi, Don!

Can you give me some detailed info about how to get the serial number of harddisk? Do I have to send IRP to harddisk driver?

wrote in message news:xxxxx@ntfsd…
> Hi, Don!
>
> Can you give me some detailed info about how to get the serial number of
> harddisk? Do I have to send IRP to harddisk driver?
>

You have to issue the IOCTL IOCTL_STORAGE_QUERY_PROPERTY down the stack,
look at STORAGE_DEVICE_DESCRIPTOR to get the serial nuimber. Note: on some
disks and on RAID this will fail.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply

I would collect all of this in user mode and then submit to the driver via
the helper app.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Saturday, September 30, 2006 8:55 AM
Subject: [ntfsd] How to read hardware info in my filter driver?

> Hi,
>
> I want to read hardware information in my filter driver, for example serial
number of CPU
> ,serial number of harddisk and newwork card. I don’t know how to do this in
my FS filter
> driver.
>
> Can someone help me? Thanks!
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

IOCTL_STORAGE_QUERY_PROPERTY

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From:
To: “Windows File Systems Devs Interest List”
Sent: Sunday, October 01, 2006 6:42 PM
Subject: RE:[ntfsd] How to read hardware info in my filter driver?

> Hi, Don!
>
> Can you give me some detailed info about how to get the serial number of
harddisk? Do I have to send IRP to harddisk driver?
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks for all your replies!

I have got CPU serial number by using the instruction of cpuid.

Now, I have to try my best to get serial number of harddisk! That might be interesting!