The MASM Forum

General => The Laboratory => Topic started by: Raistlin on January 24, 2017, 10:19:31 PM

Title: Hardware Enumerator [pre-release]
Post by: Raistlin on January 24, 2017, 10:19:31 PM
Hi all,

Please find attached test piece for my ongoing project that includes a system profiler.

Should work on Windows                 : Everything since XP SP3 (WORKSTATION AND SERVER)
Should support run on all Hardware : Since the 486 CPU, but realistically PII-233 Mhz and up (XP minimum system requirements)

I'd be interested in your feedback concerning:
1) Any deviations reported from commercial products like CPU-Z, HWiNFO etc.
2) Any crashes without explanation.
3) Any data corruptions

CURRENT STATUS OF ATTACHMENT : UPDATED TO VER 0.8 & SAMPLE  :biggrin:

-STATUS: a DLL you can use in your own projects (non-commercial, non-open source) with sample GUI dialog implementation

-ADDED: Minor Bug Fixes [Thanks goes out to Siekmanski, zed151, AW27 for reporting these]
-ADDED: Detections for DirectX, Default DirectSound Adapter, MotherBoard & BIOS, dotNET4

Known issues or perhaps of intellectual interest:
1) If a machine is running a VM (hyper-visor installed - as typically found in Win 8.1 on wards) the CPUID switches for x2APIC and VMX/SVM
    are typically disabled by the OS. This can cause CPUID topology detection algorithms to misbehave. It also requires the programmer to then
    start comparing OS versus CPUID reported information, in order to determine if the application is running inside a host or client instance.
    Lastly, we know Intel supports x2APIC on all CPUs after 2009. AMD only started supporting x2APIC on the later Ryzen CPUs, circa beginning 2018.
2) A display adapter brand detect, is intimately reliant on proper driver installation. Failing proper driver installation, the Windows
    default/generic display driver reports as a blank string, even though it shows up in device manager as "Generic VGA..whatever".
3) The MTU size in Windows may possibly under-report, typically during high bandwidth utilization scenarios (background downloads)
    due to TCP/IP egress scaling. 
4) Timings, on an i5 laptop = Windows based detects are around 1 second versus Console based detects at 0.5 or less seconds.
    The overhead on GUI apps seems to be significant in the reflected context.

Let me know what you think
Raistlin
Title: Re: Hardware Enumerator [Beta Test]
Post by: jj2007 on January 24, 2017, 11:23:10 PM
No problems on Win7-64 with an Intel Core i5 :t
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on January 24, 2017, 11:38:55 PM
Running Windows 2000 Pro under VMware gives me "TestID.exe is not a valid Win32 application." You might need an older linker and use the "/subsystem:windows,5.0" switch.
Works fine under Windows 10 Pro x64.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on January 24, 2017, 11:45:16 PM
Thanks so much @ Sinsi & jj2007 - will do the link thingum and update the zip attachment
Test on as many platforms as you can get hold of please. Windows CE / Home etc. anyone ?
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on January 24, 2017, 11:50:35 PM
Changed the version in the header to 5.0 and got a little further...

"The procedure entry point GetNativeSystemInfo could not be located in the dynamic link library kernel32.dll."

From MSDN: GetNativeSystemInfo function (https://msdn.microsoft.com/en-us/library/windows/desktop/ms724340(v=vs.85).aspx)
Quote
To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later.
So, Windows XP or later.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on January 24, 2017, 11:53:08 PM
Ouch - that sux - erm... my bad - thanks for the info Sinsi - Windows XP and up it is.... :icon_redface:

EDIT : It seems that x64 (WOW) OS test, requires GetNativeSystemInfo API (XP/2003 & up) to detect accurately and
           thus a GetSystemInfo (Win 2000) won't cut it. Well spotted.
Title: Re: Hardware Enumerator [Beta Test]
Post by: hutch-- on January 25, 2017, 12:00:25 AM
Works fine on my Win 10 64 Professional. Processor ID and data is correct, memory specs are right, everything seems to work well.  :t
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on January 25, 2017, 12:28:12 AM
XP Pro x64 error"
Quote
The application, C:\Documents and Settings\Administrator\Desktop\TestID.exe, generated an application error The error occurred on 01/24/2017 @ 23:41:46.015 The exception generated was c0000005 at address 00402B6C (TestID)
Title: Re: Hardware Enumerator [Beta Test]
Post by: pro3carp3 on January 25, 2017, 03:10:02 AM
In comparing to CPU-Z I find a difference with the cache information:

CPU-Z:
L1 Inst: 32k X 4, 8-way
L1 Data: 32K x 4, 8-way
L2: 256K, 4-way
L3: 6MB, 12-way

ExternalD:
L1 Inst: 32k X 2, 8-way
L1 Data: 32K x 2, 8-way
L2: 256K, 8-way
L3: 6MB, 12-way

 My CPU:
Intel i5 6400 Skylake 1151LGA
Title: Re: Hardware Enumerator [Beta Test]
Post by: TWell on January 25, 2017, 08:23:39 AM
AMD
CPU-Z:
L1 Inst: 32k X 2, 2-way
L1 Data: 32K x 2, 8-way
L2: 512K X 2, 16-way

ExtremeID:
L1 Inst: 32k X 0, 2-way
L1 Data: 32K x 0, 16-way
L2: 512K, 16-way
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on January 25, 2017, 04:53:34 PM
Thanks to TWell/pro3carp3/sinsi(again)/hutch   - for the feedback

@sinsi - could you please possibly attach a debugger onto application (ex. ollydbg) and
             email me the screenshot at which point the access violation occurs. I'll boot a VM
             with XP and replicate - thanks so much for all the effort

@Twell/pro3carp3 - Thanks for you're time - I'am working on the bug
Title: Re: Hardware Enumerator [Beta Test]
Post by: Adamanteus on January 25, 2017, 08:02:06 PM
For  AMD Athlon(tm) X4 760K Quad Core Processor :
- SSE 5 - is
- L2 Cache 2048Kb - 524Kb
- Windows Vista SP no - is SP 1
- AVX - I not found in it

and Detection complited with errors ...

- but interface excellent !!!
Title: Re: Hardware Enumerator [Beta Test]
Post by: Siekmanski on January 25, 2017, 08:28:31 PM
Hi Raistlin,

Code: [Select]
i7-4930K  Windows 8.1 / Server 2012R2

L1 Instr Cache 32 KB X 2   ( should be 32 X 6 KB)
L1 Data  Cache 32 KB X 2   ( should be 32 X 6 KB)
L2 Cache       256 KB      ( should be 256 X 6 KB)
L3 Cache       12288 KB    ( is correct)
Title: Re: Hardware Enumerator [Beta Test]
Post by: adeyblue on January 26, 2017, 06:41:55 AM
@sinsi - could you please possibly attach a debugger onto application (ex. ollydbg) and
             email me the screenshot at which point the access violation occurs. I'll boot a VM
             with XP and replicate - thanks so much for all the effort
It's offset 0x2b6c into the exe as the address given hints (it also crashed for me on XP32 VM at the same place), just before sending a LB_ADDSTRING message. It crashes because esi is 0 and is dereferenced (it's loaded with a global that seems like it should hold memory from GlobalAlloc, but doesn't)
Title: Re: Hardware Enumerator [Beta Test]
Post by: hutch-- on January 26, 2017, 12:25:59 PM
I just downloaded both cpuz and the version posted here again and had no problems running it at all on Win 10 64 professional. Processor is a 6 core Haswell running at 3.3 gig.

Cache data is identical
Instruction set recognition correct on both and identical.
Processor details identical (core count etc)

The old version of cpuz crashed and blue screened win 10 and had to reboot but TestID has run correctly each time I have run it.
Title: Re: Hardware Enumerator [Beta Test]
Post by: HSE on January 27, 2017, 12:23:01 AM
Hi Raistlin!

There is a resolution problem in 1024*768.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on January 27, 2017, 11:45:17 PM
Hi all - and thanks again for being guinea -pigs  :t

I've updated the application via original attachment of this forum thread start -> Ver 0.2

** Fixed (hopefully) in this version ** :
1) Windows XP crash <- due to idiocy on my part
2) Minor Display issues <- addressed possible misconceptions on the user's side
3) Added application Mutex <- single instance app
4) AMD detection <- revisited but not fully tested at all (works on my dual core QL 66)
5) Intel detection <- revisited with better NUMA break down
6) Started playing around with display enumeration <- early days

Thanks loads, much appreciated
Raistlin
Title: Re: Hardware Enumerator [Beta Test]
Post by: Siekmanski on January 28, 2017, 01:58:58 AM
i7-4930K  Windows 8.1

Windows OS should be 6.3
It shows 6.2 = windows 8.0  this has something to do with the manifest, see MSDN "GetVersionEx"

The rest is correct.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on January 30, 2017, 05:13:38 PM
Thanks Siekmanski - thought I'd solved that  ::) - may I know you're
extended version number RE: 6.3.9200 or  6.3.9600 ? I'll double check
the manifest include.
[EDIT : FOUND THE PROBLEM - RADASM DROPPED THE MANIFEST FILE ! :eusa_naughty: (FIXED ATTACHMENT)]

As to VER0.2 :
--------------------
A) I believe the INTEL Detection side is now reasonably accurate but would
dearly love to confirm this on exotic platforms : double socket XEON's etc. anyone?

B) I'am really worried about AMD detection -  some feedback appreciated
RE: Adamanteus SSE5 question - from Wiki (yes I know it's not a legitimate source...)
Code: [Select]
The SSE5 (short for Streaming SIMD Extensions version 5) was a SIMD instruction set extension proposed by AMD on 30 August 2007 as a supplement to the 128-bit SSE core instructions in the AMD64 architecture. AMD chose not to implement SSE5 as originally proposed.
C) XP crash fix - anyone?

Thanks
Raistlin
Title: Re: Hardware Enumerator [Beta Test]
Post by: hutch-- on January 30, 2017, 07:16:19 PM
Works fine here.

(http://www.masm32.com/photos/result.jpg)

Title: Re: Hardware Enumerator [Beta Test]
Post by: Siekmanski on January 30, 2017, 08:32:10 PM
 :t

(http://members.home.nl/siekmanski/ExtremeID.png)
Title: Re: Hardware Enumerator [Beta Test]
Post by: HSE on January 30, 2017, 10:52:02 PM
Here the system say service pack 1, but I don't how correct is the report.
Title: Re: Hardware Enumerator [Beta Test]
Post by: hutch-- on January 30, 2017, 10:54:06 PM
One favour here, if you are going to post images, please post them on a server, adding them here as attachments takes up a lot of server space and eventually it will fill up the server.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on January 30, 2017, 11:37:37 PM
Awesome HSE - thanks so much - you may delete picture as per hutch last post

Your'e AMD CPU detected perfectly ! - I'am so happy  :t
Note : System Cores report 4 but actual cores are 3 <- precisely what it should be per AMD docs
          Cache sizes and association is also correct - service pack is fine
Title: Re: Hardware Enumerator [Beta Test]
Post by: adeyblue on February 01, 2017, 07:47:28 AM
It doesn't crash on XPVM, but it isn't completely correct either (http://i.imgur.com/YBy3mV3.png). (link is to picture).

Looks like you're shifting the service pack version numbers right by 16, which is guaranteeing them to be 0.
Code: [Select]
mov     cx, [esi+94h]   ; SP Major
mov     dx, [esi+96h]   ; SP Minor
mov     di, [esi+98h]   ; suite mask
shr     ecx, 10h
shr     edx, 10h
Also looks like it's just picking the first display device returned rather than the one with the primary flag, though that looks to be because of a typo because there are two checks for 0 flags.
Code: [Select]
call    EnumDisplayDevicesA
or      eax, eax
jz      short locret_40147E
cmp     DisplayDevice.StateFlags, 0
jz      short loc_401479
cmp     DisplayDevice.StateFlags, 0
jz      short loc_401479

These things are both problems outside the VM too. The processor being reported as 0 MHz is specific to the VM.

EDIT: CPU-Z reports them. Also reports your L1 Data cache value as L2:
Code: [Select]
Core Speed 2371.0 MHz
Stock frequency 2400 MHz
L1 Data cache 32 KBytes, 8-way set associative, 64-byte line size
L2 Data cache 6144 KBytes, 24-way set associative, 64-byte line size
L2 cache 256 KBytes, 8-way set associative, 64-byte line size
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on February 01, 2017, 05:32:19 PM
Thanks adeyblue - for spotting the service pack & display issue - looks like using 'Defines' or 'equ' in RADASM is'nt guaranteed
to populate correctly - very strange..... :shock:

Will fix and update to Ver0.3 shortly - just working on the Networking and Storage portions currently. Will post soonest.

Keep well
Raistlin
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on February 02, 2017, 08:35:27 AM
Second test, running on bare metal (not a VM) - XP Pro and the latest Win 10 insider preview.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on February 02, 2017, 08:19:49 PM
Thanks Sinsi - looks great !

I've now updated to Ver 0.3 - see first post attachment
- fixed reported bugs RE: service pack, display (I'am hopeful as ever  ::))
- added Network detection - socket based
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on February 02, 2017, 08:30:45 PM
Version 3 running on Win8 Pro 64 shows the wrong network - VMware Network Adapter VMnet8 - which isn't being used.
Everything else looks OK. Will try XP and 10 later.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on February 02, 2017, 08:44:50 PM
Thanks Sinsi,

I believe the problem is the actual API itself within a "weak host model".
On multi-homed machines (more than 1 NIC) - I'll have to programmatic-ally figure out
the preferred Network Adapter with associated IPv4/IPv6. Ouch.. more work. :shock:
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on February 07, 2017, 04:47:05 PM
RE: non-default IP - thanks again for all the interest.

OK found the solution - seems we have to get the information from the
routing table. We extract the routing table linked list in sorted format.
If first Dest. entry = 0.0.0.0 - the gateway is present and the NIC's IP
given as index into the routing table. Other information like subnet mask
and Network ID can therefore also be extracted.

Will update the app shortly if all goes well......
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on February 20, 2017, 01:16:00 AM
Updated to Ver 0.4 - please see first thread for attachment
Title: Re: Hardware Enumerator [Beta Test]
Post by: hutch-- on February 20, 2017, 02:46:02 AM
Most looks fine but under the section WINDOWS REPORT the OS version is recognised as version 6 - 2 but the following name is incorrect "Windows 8 / Server 2012". I am running Win 10 Professional 64 bit.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on February 20, 2017, 06:03:09 AM
thanks , soooo it's Manifest before
VersionInfo? As it was accurate before update....
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on February 20, 2017, 07:40:13 AM
Same problem for me, shows 6.2 (Windows 8), should be 6.3 (Windows 8.1).
All the other stuff seems to be OK.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 12, 2017, 01:08:42 AM
Uploaded version 0.5 [new features and hopefully bug fixes]
Title: Re: Hardware Enumerator [Beta Test]
Post by: Siekmanski on December 12, 2017, 05:13:57 AM
 :t
What about including sound devices.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 12, 2017, 06:05:03 AM
OUCH, ERM :icon_exclaim:  Siekmanski = Massive respect.
But have you any idea how I might explore such? Inc and libs
are hard to find for Masm. It took me a year for this test piece
, in off time, because of this, not so small fact.....

PPS- did the test piece work for what it was meant for ?
Title: Re: Hardware Enumerator [Beta Test]
Post by: sinsi on December 12, 2017, 10:07:11 AM
Win10 Pro x64  :t
Title: Re: Hardware Enumerator [Beta Test]
Post by: Siekmanski on December 12, 2017, 05:34:18 PM
It just came to my mind when I saw your app displays the default graphics adapter name.

Don't know if it is something you want in your app.
I can write an example how to get the default sound adapter name or, you can extract the code from EnumSoundcards.zip
http://masm32.com/board/index.php?action=dlattach;topic=6291.0;attach=6668

PPS- did the test piece work for what it was meant for ?

Yes.  :t
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 12, 2017, 11:43:11 PM
@Siekmanski - Cool, will check it out thanks man.

Almost done with the DLL conversion - looks semi professional  :P
Will upload soon.
Title: Re: Hardware Enumerator [Beta Test]
Post by: Jokaste on December 13, 2017, 02:04:29 PM
(https://yoppiw-am3pap001.files.1drv.com/y4m2b5lAzA1KJoHQ33sCc8LCIhOkRD4YKiPo8hRYWgWgxqb7QZDsZ6HY9erBulMLJKvU_Gdui-kf2kTbGkgMKfWg3OxLUhrq-oSsfDETwqrjDtx5TWpW8KIX8bnbuV6CACk9j6mbFyEfaaRy7dg9tPOirC0uCQB9GfhmTStt5eOTO2T_J2es-c1iYTKfMQh2TvnpWsNLn6H5lX57NA_B-gvbQ?width=912&height=594&cropmode=none)
Title: Re: Hardware Enumerator [Beta Test]
Post by: felipe on December 13, 2017, 02:10:04 PM
Wow! rastlin, looks pretty cool stuff.  :eusa_clap:
 
I will prove it on my machine (but i will not upload a picture of it...)  :biggrin:
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 13, 2017, 07:16:25 PM
@Jokaste : OUCH - multiple issues - is this running inside a Virtual Machine ? that might explain allot

1) Speed Approx = 720Mhz - was your laptop in speed-step mode ? (try running detect with charger plugged in)
2) Cores per package count - should be 2 - damnit....
3) Reporting L3 cache - is this correct ? - please try CPU Z and let me know. Ca'nt seem to get full spec sheet on this CPU
4) Display card not popping up - damnit.....

Thanks so Much ! - appreciated - this is beta test after-all - lets catch those bugs. :shock:
Title: Re: Hardware Enumerator [Beta Test]
Post by: LiaoMi on December 13, 2017, 08:14:25 PM
Hi Raistlin,

there is an error with the exception in the kernel of windows

Code: [Select]
EXCEPTION_DEBUG_INFO:
           dwFirstChance: 1
           ExceptionCode: C0000005 (EXCEPTION_ACCESS_VIOLATION)
          ExceptionFlags: 00000000
        ExceptionAddress: 77BDA280 ntdll.77BDA280
        NumberParameters: 2
ExceptionInformation[00]: 00000000 Read
ExceptionInformation[01]: 00000008 Inaccessible Address
First chance exception on 77BDA280 (C0000005, EXCEPTION_ACCESS_VIOLATION)!

after the function call

Code: [Select]
003315AA                                    | MOV     EDX, DWORD PTR SS:[EBP - C]                             |
003315AD                                    | MOV     DWORD PTR DS:[335218], EDI                              |
003315B3                                    | MOV     EAX, DWORD PTR DS:[EDX + 8]                             |
003315B6                                    | MOV     DWORD PTR DS:[33521C], EAX                              |
003315BB                                    | PUSH    DWORD PTR SS:[EBP - 4]                                  |
003315BE                                    | CALL    <testid.IcmpCloseHandle>                                |
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 13, 2017, 11:37:11 PM
@LiaoMi - THANX

-> Possibly: all I could find on the Internet for this exception is that the receive buffer might have been too small,
    causing the overwrite of the ICMP handle
-> Solution: updated the receive buffer size in ver 0.6, so we'll see if resolved - posting soon
-> Other: perhaps you have an ultra large or small MTU configured or windows is fire-walling "Ping /ICMP" traffic
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 14, 2017, 08:25:48 PM
UPDATED TO VER 0.6 & SAMPLE  :biggrin:

- ADDED : Now a DLL that you can include in your own project
- ADDED : Sample code to implement

@LiaoMi
- BUG-FIX HOPEFULLY: MTU Detect causes kernel panic with too small return buffer

@Jokaste - Please give it a try now and PM me please with result
- BUG-FIX HOPEFULLY: New CPU speed approximation algorithm - should now be more generic
- BUG-FIX HOPEFULLY: Revisited cache detection and package/core/thread calculation
- BUG-FIX HOPEFULLY: Larger Display Card strings that may have caused truncation previously
Title: Re: Hardware Enumerator [Beta Test]
Post by: jj2007 on December 14, 2017, 10:43:30 PM
UPDATED TO VER 0.6 & SAMPLE  :biggrin:
:t
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 15, 2017, 01:14:43 AM
@LiaoMi - Attached PING Test APP / Source code - to try an isolate Firewall or Other Issue
Title: Re: Hardware Enumerator [Beta Test]
Post by: felipe on December 15, 2017, 04:10:16 AM
 :greenclp:
Title: Re: Hardware Enumerator [Beta Test]
Post by: Raistlin on December 15, 2017, 04:42:05 PM
@Jokaste : Please try the test piece / source attached and email me result please
Title: Re: Hardware Enumerator [Beta Test]
Post by: Jokaste on December 15, 2017, 10:17:43 PM
Oui CHEF
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 20, 2018, 04:30:24 PM
Updated to Ver 0.7 - please see first post in this thread for information and the attachment.
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 20, 2018, 06:33:33 PM
I am afraid you need to review it because it does not produce correct results in many instances.
I attach also, results obtained with CPU-Z.

PS: Disk is also wrong. I have 2 disks: 1 SSD of 500 GB and another of 3 TB.
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 20, 2018, 06:43:58 PM
Thanks AW, hmmm - seems to corrupt the data someplace around the core detects
and then skews all other results. Can I bug you via PM to try and isolate the error ?
Seems like some sort of buffer overflow....  :(

Here's my results... and Zedd151's :redface:

https://drive.google.com/open?id=1LWP_Fo-PYEC81ItRTI2zGz4hWLO8aO28
https://drive.google.com/open?id=1DPwFbmMIxaK0Fq9JgCMQZWzV08ocVXH3

But please see if you can assist AW...
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on June 20, 2018, 07:05:40 PM
Quote from: Raistlin...

Here's my results... and Zedd151's :redface:

 :P

Were there any significant changes since I tested it for you last? Should I run it again and post screenshot?
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 20, 2018, 07:08:37 PM
Thanks AW, hmmm - seems to corrupt the data someplace around the core detects
and then skews all other results. Can I bug you via PM to try and isolate the error ?
Seems like some sort of buffer overflow....  :(

Here's my results... and Zedd151's :redface:

https://drive.google.com/open?id=1LWP_Fo-PYEC81ItRTI2zGz4hWLO8aO28
https://drive.google.com/open?id=1DPwFbmMIxaK0Fq9JgCMQZWzV08ocVXH3

But please see if you can assist AW...

Sure, I will assist you via PM although you never acknowledge my answers via PM - probably you don't read them  :(.
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 20, 2018, 08:55:24 PM
Quote
Sure, I will assist you via PM although you never acknowledge my answers via PM - probably you don't read them  :(.

Thanx AW, I will definitely reply ! - promise  :bgrin:

I need to get this thing bulletproof - which is REALLY hard if you don't have access to a WIDE variety of platforms.
SO thank you all so much for your feedback & input.

Quote
PS: Disk is also wrong. I have 2 disks: 1 SSD of 500 GB and another of 3 TB.

Actually the disk size is as intended - the output shows your 3 TB - the idea was to detect the size and available
disk space of the "process" instance's storage. Was thinking of scenarios like network drives and quota rules that
could influence what a process could access. It's more a system profiler for programmers versus an asset register
of all hardware.
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 20, 2018, 10:09:06 PM
Actually the disk size is as intended - the output shows your 3 TB - the idea was to detect the size and available
disk space of the "process" instance's storage. Was thinking of scenarios like network drives and quota rules that
could influence what a process could access. It's more a system profiler for programmers versus an asset register
of all hardware.
Impressive explanation, but I have no idea what you are talking about. I am just a guy willing to know my hard disks capacity.  :biggrin:
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 20, 2018, 10:31:39 PM
@AW -  :biggrin: - Let me try again.....hope it helps.

The idea is that a program/process/application always runs within a user security context. The user being the one that executed it.
Some users might have restrictions applied to storage - for example a quota (max limit) on amount of logical free disk-space accessible.
Because the process/application shares the user security context - the application is also restricted by this amount of logical storage.
It would be of more interest for an application when trying to discover its environment, rather than physical storage.

PPS: Is anyone else getting data corruption as well for feature values etc. ?
Title: Re: Hardware Enumerator [pre-release]
Post by: Siekmanski on June 21, 2018, 12:58:54 AM
Hi Raistlin,

@ approximately 1 MHz ?

Cores/Packages ( should be 6 )
Threads/core ( should be 2 )

Physical RAM = 0 ?
Available RAM = 0 ?

Cache Line = 4196354 bytes ( should be 64 bytes )

L1 Instr Cache = 0 ( should be 32 KB x 6 )
L1 Data  Cache = 0 ( should be 32 KB x 6 )

(http://members.home.nl/siekmanski/ExtremeID_raistlin.png)
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 21, 2018, 01:06:15 AM
Thanks Siekmanski, same corruption as AW.
That confirms it, I've got a HeapAlloc issue
somewhere. That or the PE compressor is
screwing around on the DLL.

Valuable input thanks man.
Title: Re: Hardware Enumerator [pre-release]
Post by: Siekmanski on June 21, 2018, 01:16:39 AM
These are also not correct on my COSMOS box,

Stepping = 4 ,not 0
Model = E ,not C00
Family = 6 ,not 2
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 21, 2018, 01:27:54 AM
Same issue, I allocate (HeapAlloc) OS Cores times APIC data
structure and a sorted linklist, which then overwrites SYSTEMSET .data? for 4 * Dword allocations, ending at
the L1 cache entries which you refer to. See SYSTEMSET STRUCT
in the sample.  :(
To fix, no idea why more than 2 cores
causes this issue yet.
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 21, 2018, 01:58:30 AM
The idea is that a program/process/application always runs within a user security context. The user being the one that executed it.
Some users might have restrictions applied to storage - for example a quota (max limit) on amount of logical free disk-space accessible.
Because the process/application shares the user security context - the application is also restricted by this amount of logical storage.
It would be of more interest for an application when trying to discover its environment, rather than physical storage.
Finally, I could translate what you are saying. The values refer to the partition size not to the physical disk itself.  :t
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on June 21, 2018, 02:38:12 AM
Looks okay here.  8)

But again, I'm not sure what most of these values REALLY are supposed to be. But I believe 'stepping' and 'model' should not be zero. But they were also zero in the previous runs of the program - so I don't know for sure.
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 21, 2018, 02:50:19 AM
No its perfect Zedd151. I need to do
some serious debugging to understand
why a buffer-overflow is occurring. :(
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 21, 2018, 06:57:51 PM
If I were you I would publish the source code of the .dll
Nothing in there is secret. No need to hide it and use a compressor on top to hide more  :biggrin:.
Title: Re: Hardware Enumerator [pre-release]
Post by: FORTRANS on June 21, 2018, 10:25:22 PM
Hi,

I need to get this thing bulletproof - which is REALLY hard if you don't have access to a WIDE variety of platforms.

   I guess I should ask what type of systems you want data from.
I have some older systems if that is relevant.  Back to Windows 98.
And some not so old laptops, so probably limited capability.

Steve N.
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 22, 2018, 03:19:23 PM
Thanks FORTRANS - I will definitely PM you some test pieces.

@AW:
Quote
If I were you I would publish the source code of the .dll
Nothing in there is secret. No need to hide it and use a compressor on top to hide more

Currently the dll is part of a larger project, sponsored by the university and thus subject to ethics clearance.
I would need to request permission to publish the source. Perhaps end of the year.
- that's after the small bug is dealt with and I'am sure it runs stable. :t
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 22, 2018, 07:46:45 PM
It is all right then, but this sort of bugs are very easily debugged when we have the source.
It is also easy without source, but nobody will do it to help you.  :biggrin:
So, it is all in your hands. :t
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on June 23, 2018, 02:12:16 AM
Yes master  :( I shall endeavour to do better. Meaning
fixing the bug without freaking out too many ppl.
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on June 23, 2018, 03:13:01 AM
Yes master  :( I shall endeavour to do better. Meaning
fixing the bug without freaking out too many ppl.
I am sure you will make everybody here very happy with your upcoming fixed release.  :t
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 04:02:44 AM
Dear Siekmanski, zedd151, Aw27 and you know who,
(& they thalts shalt not be named) THANK YOU so much.
Almost final release coming soon. Tommorow probably ...
You guys are the best, but you probabably know that
already! All bugs sorted and additional strange and
wonderful newish things will be revealed. ETA tommorow
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 01, 2018, 05:20:09 PM
That is great.  :t
Don't forget to tell us what sort of bug was that only appeared in some computers and not on others.
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 08:09:59 PM
[UPDATED to Ver 0.8 pre-release]

Added : Detects for DirectX, dotNET4, M/B & BIOS, default S/Card

@AW27: Memory bug -> crazy pointers (my fault entirely)
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 01, 2018, 08:43:16 PM
Almost all bugs fixed.
However:
1) It does not detect more than 1 monitor. I have 2,  some people more. (* see below)
2) Model is wrong, what it is showing is Extended Model.
3) I have no explanation for the font style changing to bold or for font color change. I have not checked in the help file.  :biggrin:
4) Static boxes are small to contain the information, I believe you should use read-only Edit boxes allowing the user to read till the end, or show it in a tool tip when it does not fit in the static box.
5) It should save all the information to a file.

* This is the monitor information provided by my software AWRCP about my 2 28" monitors:

*DISPLAY\BNQ78DD\5&818829c&0&UID4353_0*
1) Monitor ID:
Commercial Name: BenQ GC2870
Manufacturer Name Code: BNQ
Product Code ID: 78DD
Serial Number ID: L6H05058019
Week of Manufacture: 25
Year of Manufacture: 2017
2) Basic Display Parameters:
Display Transfer Characteristic: 120
Max Horizontal Image Size (cm): 62
Max Vertical Image Size (cm): 34
Video Input Type: Digital
Supported Display Features:
- Active Off Supported: True
- Display Type: RGB color display
- GTF Support: False
- Has Preferred Timing Mode: True
- sRGB Supported: True
- Standby Supported (VESA DPMS): False
- Suspend Supported (VESA DPMS): False
3) Video Connector Type:
Technology: HDMI
4) Analog Video Input Parameters:
5) Digital Video Input Parameters:
Is DFP 1.x Compatible: False
6) Color Characteristics:
Blue: X=156, Y=55
Default White: X=321, Y=337
Green: X=268, Y=704
Red: X=702, Y=317

*DISPLAY\BNQ78DD\5&818829c&0&UID4354_0*
1) Monitor ID:
Commercial Name: BenQ GC2870
Manufacturer Name Code: BNQ
Product Code ID: 78DD
Serial Number ID: 86H11124019
Week of Manufacture: 23
Year of Manufacture: 2017
2) Basic Display Parameters:
Display Transfer Characteristic: 120
Max Horizontal Image Size (cm): 62
Max Vertical Image Size (cm): 34
Video Input Type: Digital
Supported Display Features:
- Active Off Supported: True
- Display Type: RGB color display
- GTF Support: False
- Has Preferred Timing Mode: True
- sRGB Supported: True
- Standby Supported (VESA DPMS): False
- Suspend Supported (VESA DPMS): False
3) Video Connector Type:
Technology: HDMI
4) Analog Video Input Parameters:
5) Digital Video Input Parameters:
Is DFP 1.x Compatible: False
6) Color Characteristics:
Blue: X=156, Y=55
Default White: X=321, Y=337
Green: X=268, Y=704
Red: X=702, Y=317
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 09:02:29 PM
Quote
Almost all bugs fixed.
However:
1) It does not detect more than 1 monitor. I have 2,  some people more. (* see below)
2) Model is wrong, what it is showing is Extended Model.
3) I have no explanation for the font style changing to bold or for font color change. I have not checked in the help file.

@AW:
0) "Almost all bugs fixed " -  :bgrin: - I take it the data corruption is now solved - again thanks for your input
1) I'am not quite sure I understand your meaning - the detections are for the default display adapter attached to the desktop.
    (sample code on page 4 of this thread)
2) But I do see your point, I'll add this in the next version update
3) Can you clarify ? - or PM/email me a screenshot please

Quote
4) Static boxes are small to contain the information, I believe you should use read-only Edit boxes allowing the user to read till the end..
5) It should save all the information to a file

Very GOOD ideas - I should really brush-up on my interface design.
I'll definitely add & modify for these in the next version update.  :t
Title: Re: Hardware Enumerator [pre-release]
Post by: Siekmanski on July 01, 2018, 09:15:23 PM
Hi Raistlin,

My computer has 2 sound cards on board and 1 virtual sound card.
In total 11 Stereo output channels.

As default sound card it shows the 7th stereo output channel of my default soundcard. ( should be the first )
hint: the first guid returned is the default and is equal to 1 of the following enumerated guids.

The rest seems correct.  8)
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 09:24:29 PM
Thanks Siekmanski - it was'nt clear on MSDN (see below). Your explanation makes more sense  :biggrin:

RE:
Code: [Select]
The primary device is enumerated twice, first with NULL in lpGuid and then with its GUID in that parameter.So I mistakenly thought the GUID on first return was NULL and then the first actual GUID was the default.
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 01, 2018, 10:30:48 PM
Lemme switch over to Windows 10 - I'm on Windows 7 right now without the proper drivers installed.... (can't get new drivers for an older OS for this 'puter)
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 10:35:35 PM
Why zedd151, what's it showing?
You've got my email\PM.  :icon_eek:
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 01, 2018, 10:44:47 PM
Why zedd151, what's it showing?
You've got my email\PM.  :icon_eek:

Nothing bad, just it's missing the Display info.. I'm still on 7 now if you want to see it...
 
This is from Windows 7 Ultimate:
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 10:45:53 PM
Wow, you had me worried. No problems then  :icon_mrgreen:
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 01, 2018, 10:51:00 PM
Oh no, it's all good.  :t
 
I put the screen capture in my previous post...
As soon as I'm finished defragging my storage drive, I'll do another from Windows 10 Home Edition....
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 01, 2018, 11:31:28 PM
Here is the screen capture from WIndows 10 Home edition...
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 01, 2018, 11:34:29 PM
All good, thanks zedd151.
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 01, 2018, 11:35:55 PM
All good, thanks zedd151.

happy to help out   8)
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 06:00:06 AM
From Windows xp sp3 Professional in Virtual Box --- 32 bits


Surprisingly a lot of the info still holds true from Virtual Box, but not all. Being in a virtual environment does strip away some functionality.


This is a test, only a test.   :P


(https://www.dropbox.com/s/tim2zse5ivm0arp/xptest.PNG?dl=1)
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 19, 2018, 03:18:08 PM
@Zedd: Yes a VM will do that - I tested the profiler under under HyperV with
             Linux OpenSuse Leap & WINE = It works !  :bgrin: Even shows WINE
             .NET support, however still need to get DirectX to work for Linux.

             As to the screenshot you posted:
             1) SVM switch is toggled (VM mode - so no problems there)
             2) Interestingly FMA3 switch is now off (probably the VM hypervisor ? - I'll investigate)
             3) HTT switch is off // (VM mode - you assigned 1 core to the VM & cache also reflects such - so all good)
             4) RAM size is understandable - you assigned 1 GB of the 4GB actual - display card is probably utilizing partial RAM
             5) Display card is not showing - what Display adapter is showing inside the XP's device manager ? - I'am interested to know please
             6) x64 mode now disabled in CPUID - did you specifically select x86 compatable VM ? - I'am interested to know please
             7) Registry error showing on internal error flags - probably due to .NET detection - so all fine there as well.
                                                             
             But yes, the VM environment loads it's own hardware kernel
             emulation that strips the standard functionalities. More updates
             coming soon.
Title: Re: Hardware Enumerator [pre-release]
Post by: hutch-- on July 19, 2018, 04:03:35 PM
Version 8 works fine here. I won't post an image as I have to keep an eye on the disk usage but it all seems to match this 2 years old Haswell I am using, memory size is right, networking looks correct etc ....
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 04:04:22 PM

             5) Display card is not showing - what Display adapter is showing inside the XP's device manager ? - I'am interested to know please



 8)


Most of the drivers are VirtualBox drivers, I only had to install SDCard and USB3 drivers.


(https://www.dropbox.com/s/qadba2rbhekl6jh/test.GIF?dl=1)
Title: Re: Hardware Enumerator [pre-release]
Post by: hutch-- on July 19, 2018, 04:05:39 PM
Z,

Do me a favour, when you post a new image would you delete the old one as I must keep an eye on the total disk usage.
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 04:08:06 PM
Z,

Do me a favour, when you post a new image would you delete the old one as I must keep an eye on the total disk usage.


Okay, gotcha.  :t
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 19, 2018, 04:41:11 PM
It is possible to use DropBox for image direct links (Zed found the trick for ZIPs but works as well for images :t)

This is for XP Sp3 in VMware

(https://www.dropbox.com/s/vtaoo91t7l8tdkl/xpsp3.png?dl=1)

One note: XP does not support AVX and AVX2. AVX2 is not ticked here but is ticked for Zed's AMD.
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 05:27:50 PM
It is possible to use DropBox for image direct links (Zed found the trick for ZIPs but works as well for images :t )


I had forgotten about that, until I looked at the url for the image. ( dl=1 )





Quote
One note: XP does not support AVX and AVX2. AVX2 is not ticked here but is ticked for Zed's AMD.


I'm special that way.   8)
Actually I think that the virtual machines are furbarring the results.  I'm running VirtualBox for my XP
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 19, 2018, 05:52:05 PM
Quote
If you are running under a VM / Hypervisor (e.g. Hyper-V), it may disable support for various instruction sets (including OS-XSAVE) in order to facilitate migration across hardware
- http://support.sisoftware.net/knowledgebase.php?article=70

It's interesting that Virtual Box did not disable AVX for the known OS, in this case XP :icon_eek: - as CPUID
is still reporting support. I assume a compiler would change the executable header if AVX instructions are
detected in code - to then exclude XP as a run-time. So no damage there either way. Thanks for the reminder
about AVX support AW.

Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 19, 2018, 06:00:53 PM
You need the xgetbv instruction to check for OS support.

Code: [Select]

avxSupported proc uses ebx

mov eax, 1
cpuid
bt  ecx, 27
jnc @exitfalse
xor ecx, ecx
xgetbv
and eax, 6
cmp eax, 6
jne @exitfalse
mov eax, 1
cpuid
bt ecx, 28
jnc @exitfalse
mov eax, 1
ret
@exitfalse:
mov eax, 0
ret
avxSupported endp

Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 06:17:38 PM
You need the xgetbv instruction to check for OS support.



Does xgetbv work on AMD as well, the docs I looked at said Intel and IA32, but no mention of AMD.


I'll have to research further as 'xgetbv' is new to me.


edit = typo
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 19, 2018, 06:26:04 PM
AMD has to support  xgetbv,  :biggrin:
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 06:30:40 PM
AMD has to support  xgetbv,  :biggrin:


Well, the info is hard to come by.  :P


I did find this piece on github, it's copyrighted and in C(++ ?) but it is of interest here I think.


 cpuid.go  (https://github.com/klauspost/cpuid/blob/master/cpuid.go)


raistlin is off busy tracking a bug.


The xgetbv references are near the end of the source code.
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 19, 2018, 06:36:24 PM
Test it then. I am sure it will say NO in XP and say YES in Windows 7.
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 06:41:55 PM
AVX not supported.   :P    xp - virtual box


I'll be back from 7 and/or 10.   :badgrin:


AVX supported  :biggrin:  Windows 7 Ultimate 32 bit native install





AVX supported Windows 10 Home 64 bit -  but we already knew that.   :P
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 19, 2018, 06:49:54 PM
Nothing wrong with Virtual Box then.  :t
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 06:52:45 PM
Nothing wrong with Virtual Box then.  :t


Are you inferring that raistlin writes buggy code? 
Title: Re: Hardware Enumerator [pre-release]
Post by: aw27 on July 19, 2018, 06:56:51 PM
Everybody does, some do it more than others.
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 07:00:51 PM
...some do it more than others....


Sounds a lot like me.   :biggrin:
Title: Re: Hardware Enumerator [pre-release]
Post by: Raistlin on July 19, 2018, 07:42:15 PM
Hey this is bug hunting at it's finest - as I've mentioned several times, I do not have
access to all possible configurations - nor could I realistically get hold of all configurations out there -
so these kinds of issues are bound to happen and are most welcome! We all learn
from them I'am sure. This is a fairly large project after-all. Finding a bug - makes the code
quality better in the end, rather than not knowing you had a bug in the first place.  :t 

But it would stand to reason that if the hyper-visor (VM) is tweaking CPUID function reports
in order to support the client OS - why are they not disabling the AVX switch for known
non-supported OS's ?

Thanks for the heads-up AW on the xgetbv thing. Learnt something again. :bgrin:
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on July 19, 2018, 07:50:48 PM

Quote
Finding a bug - makes the code quality better in the end, rather than not knowing you had a bug in the first place




Which is why also, it is good to post it here in the forum, where other members can test it on their particular system setup/configuration/ etc.
Better here than releasing it out in the wild after running a few rudimentary tests. 
Title: Re: Hardware Enumerator [pre-release]
Post by: 0000 on August 09, 2018, 03:23:57 PM
New Hardware :lol:
Actually its an older Gateway Laptop. Running Windows 10 32 bit via USB drive.   :bgrin:
(https://www.dropbox.com/s/1iixap2975dat5h/gatewaypc.bmp?dl=1)