Jump to content

Recommended Posts

Just curious... is it possible to use the Computer ID via the NI License Manager?

I haven't seen a property node for getting this. The only problem is that I've had the ID change several times due to adding cards or because LV thinks its about time to annoy me.

Besides. This disk serial thing is getting personal between me and Microsoft. Damned if I'm going to be beaten by it! throwpc.gif

Link to comment

The two drives tested are SATA. So maybe what you are seeing is peculiar to XP. I'll take one of the laptops from work home and see what happens. I wasn't particularly looking at USB drives since they can be moved from PC to PC, but in my wanderings I did notice they don't give a serial (serialoffset=0). It is looking like the only reiable way is to walk the registry and look at the device ID (was hoping to avoid that since to me it seems tacky), but if I do go that route, at least it will also get the USB drives (I already have a detect USB drive insertion that works of 7,vista and XP that uses that method).

Walking the registry, while not necessarily to bad, is still a bit of work and doing that regularly to detect addition or removal of drives seems a bit expensive to me. And the registry unfortunately doesn't help in my case either. The serial number is not in there!!!

Besides. This disk serial thing is getting personal between me and Microsoft. Damned if I'm going to be beaten by it! :throwpc:

Damn I know that feeling!! :cool:

Rolf Kalbermatter

Link to comment

Walkig the registry while not necessarily to bad is still a bit of work and doing that regularly to detect addition or removal of drives seems a bit expensive to me.

The USB detect I have uses message notification for removal andinsertion (oh what I'd give to tap into windows messages fromLabview:P) . It just walks the registry to find out what was removed or inserted from the device ID returned.

And the registry unfortunately doesn't help in my case either. The serial number is not in there!!!

Good to know that that's not foolproof either.

Link to comment

The USB detect I have uses message notification for removal andinsertion (oh what I'd give to tap into windows messages fromLabview:P) .

You can actually do that with the Windows Message Queue example on the NI side. Since it normally hooks the VI window there are events that it never will see, but hooking the application window should be possible too, albeit a bit more troublesome. (and if you mess up that hook you can hose LabVIEW pretty badly :cool:, as I know from various projects where I went that path).

Rolf Kalbermatter

Link to comment

You can actually do that with the Windows Message Queue example on the NI side. Since it normally hooks the VI window there are events that it never will see, but hooking the application window should be possible too, albeit a bit more troublesome. (and if you mess up that hook you can hose LabVIEW pretty badly :cool:, as I know from various projects where I went that path).

Rolf Kalbermatter

Not quite what I was after. I want to be able to register and use an Event structure :)

I played around with an active X dll that enabled me to register for events using the register callback node which was rather successful, but as I don't allow active X....I binned it :P. I was hoping to see the events overhauled with LV2009, but severely disapointed when it was only cosmetics.

On topic. Looking at BIOS now. Seems to work on most things except RAID. Any pitfalls?

Edited by ShaunR
Link to comment

Not quite what I was after. I want to be able to register and use an Event structure :)

I played around with an active X dll that enabled me to register for events using the register callback node which was rather successful, but as I don't allow active X....I binned it :P. I was hoping to see the events overhauled with LV2009, but severely disapointed when it was only cosmetics.

On topic. Looking at BIOS now. Seems to work on most things except RAID. Any pitfalls?

I haven't played with the BIOS serial numbers yet. I did some tests with my OpenG port IO functions to read directly the physical memory to get to the BIOS information. But this requires a kernel driver that you can only install with admin rights (and elevated admin rights in Vista and higher) and most likely loading that kernel driver is also a Windows privileged operation, just as opening the PhysicalDrive.

I was able to read various BIOS information in that way and the BIOS serial number was also part of it, but I was of course logged in as admin.

Rolf Kalbermatter

Link to comment

I haven't played with the BIOS serial numbers yet. I did some tests with my OpenG port IO functions to read directly the physical memory to get to the BIOS information. But this requires a kernel driver that you can only install with admin rights (and elevated admin rights in Vista and higher) and most likely loading that kernel driver is also a Windows privileged operation, just as opening the PhysicalDrive.

I was able to read various BIOS information in that way and the BIOS serial number was also part of it, but I was of course logged in as admin.

Rolf Kalbermatter

Indeed. Actually, it is worse than that. The restriction isn't so much Admin rights, its the "Integrity Level". For example, the elegant way of reading the bios is to use ZwOpenSection or NTOpenSection. However, those functions have an "IL" of High and Admin is only granted "Medium". Its all got very complicated in Vista.

But not to be daunted, and since you seem to have one of these problematic drives can you try this one?

Link to comment

Indeed. Actually, it is worse than that. The restriction isn't so much Admin rights, its the "Integrity Level". For example, the elegant way of reading the bios is to use ZwOpenSection or NTOpenSection. However, those functions have an "IL" of High and Admin is only granted "Medium". Its all got very complicated in Vista.

But not to be daunted, and since you seem to have one of these problematic drives can you try this one?

Unfortunately this only returns NULL as serial number on my XP SP3 system, independent of the log in I use. And I have tinkered quite a bit with IOCTL_STORAGE_QUERY_PROPERTY myself but it just doesn't seem to work on my machine and with that harddrive, except when using directly SMART, but for that I need to open Physicaldrive0 with READ and WRITE access and that fails without admin rights.

Rolf Kalbermatter

Link to comment

Unfortunately this only returns NULL as serial number on my XP SP3 system, independent of the log in I use. And I have tinkered quite a bit with IOCTL_STORAGE_QUERY_PROPERTY myself but it just doesn't seem to work on my machine and with that harddrive, except when using directly SMART, but for that I need to open Physicaldrive0 with READ and WRITE access and that fails without admin rights.

Rolf Kalbermatter

Well. Your drive also seems resistant to WMI as well :o The pervious DLL used 3 methods, the final one being querying the WMI database.

Hmmm. Digging deeper........

Link to comment
  • 2 months later...

Hi gentle men !

Who can do me a big favour and convert the vi to labview 8.5 or give me the parameters to call it from labview 8.5 without the wrapper ?

This could solve my little pesky problem

Thanks

Wally

' timestamp='1252322442' post='65482']

Well. Your drive also seems resistant to WMI as well ohmy.gif The pervious DLL used 3 methods, the final one being querying the WMI database.

Hmmm. Digging deeper........

Link to comment

Thanks Asbo ! This is great and may make my day tomorrow... I hope it can work on usb mass storage for my labview dongle !

Later

I will let your guys know

I was able to get the model of mine, but got a NULL for the serial. It's a Fujitsu MHW2160BH PL in a cheap Rosewill case.

Flash drives probably won't work with this; my 8GB Cruzer Micro didn't give back a serial number. I haven't checked it with HD Tune, though (which always manages to give me serial numbers for my devices).

Link to comment

Flash drives probably won't work with this; my 8GB Cruzer Micro didn't give back a serial number. I haven't checked it with HD Tune, though (which always manages to give me serial numbers for my devices).

Flash memory doesn't seem to have a serial number that Windows wants to provide. For USB HDs it seems also not possible to get the serial number in any way. And for SATA devices at least in my XP system there won't be any serial number either, unless I directly query the drive using ATAPI SMART but that requires admin privileges.

Do you mean to say that HD Tune can give you HD serial numbers without being logged in as administrator? That would be very interesting.

Link to comment

Do you mean to say that HD Tune can give you HD serial numbers without being logged in as administrator? That would be very interesting.

I'll double-check when I get home tonight, but it's possible that I'm mixing up my experience with HD Tune between when I'm using my NDAS drive (ethernet based) versus a normal USB drive. As for administrator-ness, my personal accounts are always administrator so I can't comment - I'll check that too.

Link to comment

I'll double-check when I get home tonight, but it's possible that I'm mixing up my experience with HD Tune between when I'm using my NDAS drive (ethernet based) versus a normal USB drive.

No such luck - HD Tune doesn't give me a serial number over USB. This isn't surprising as USB devices can't be queried for a whole lot of details.

Link to comment
  • 5 years later...

its-alive.jpg

 

2009. Sheesh. Its true what they say about software - you support it for life :D

 

I had a query to ask if I had the 64 bit version of Diskinfo. I didn't because it was written in Delphi 7 which only had a 32 bit compiler.  but I did pull out the WMI part from another of my little side projects and recreated DiskInfo (for 32 and 64 bit Windoze) .

 

Your mileage may vary.

 

Have fun.

Edited by ShaunR
Link to comment

its-alive.jpg

 

2009. Sheesh. Its true what they say about software - you support it for life :D

 

I had a query to ask if I had the 64 bit version of Diskinfo. I didn't because it was written in Delphi 7 which only had a 32 bit compiler.  but I did pull out the WMI part from another of my little side projects and recreated DiskInfo (for 32 and 64 bit Windoze) .

 

Your mileage may vary.

 

Have fun.

 

And I tried to implement the WMI calls through COM in a DLL to be called from LabVIEW. No such luck. Turns out you can't CoInitialize() the COM system in the DLL since LabVIEW has done that already. And you also can't initialize the COM system with extra security privileges either since LabVIEW has done this initialization (most likely implicitedly on startup with the lowest possible privileges) and COM does not support to readjust the security privileges later on. Without those security privileges quering any WMI database info then fails.  :throwpc:

Link to comment

And I tried to implement the WMI calls through COM in a DLL to be called from LabVIEW. No such luck. Turns out you can't CoInitialize() the COM system in the DLL since LabVIEW has done that already. And you also can't initialize the COM system with extra security privileges either since LabVIEW has done this initialization (most likely implicitedly on startup with the lowest possible privileges) and COM does not support to readjust the security privileges later on. Without those security privileges quering any WMI database info then fails.  :throwpc:

This seems to work with a standard user on Windows 7/8 but like I said. Your mileage may vary.

What windows are you using?

Edited by ShaunR
Link to comment

This seems to work with a standard user on Windows 7/8 but like I said. Your mileage may vary.

What windows are you using?

 

Windows 7, but even explicitedly changing the security settings for the WMI root\\CIMV2 tree wouldn't allow me to do an WMIService->ExecQuery() no matter what I try to query so there might be something else going wrong despite of the error code 80041003 indicating some access right issue.

 

I'll try to debug it a bit more but have found in the meantime code that uses various Win32 APIs to query this information more quickly and more reliably as WMI can sometimes misreport this.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.