Author Topic: OS Info for Windows 8 and 10  (Read 45187 times)

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
OS Info for Windows 8 and 10
« on: October 02, 2015, 07:14:44 AM »
as a continuation of this thread...

http://www.masmforum.com/board/index.php?topic=11963.0

i would like to see some new runs for Windows 8 and 10, please

this is the archived download link

http://www.masmforum.com/archive2012/6537_OSinfo23.zip

many thanks   :t

Zen

  • Member
  • ****
  • Posts: 962
  • slightly red-shifted
Re: OS Info for Windows 8 and 10
« Reply #1 on: October 02, 2015, 07:42:34 AM »
Hi, DAVE,
I was reading the code, in, OSinfo23.asm (DednDave OS Info Dump - Version 2.03),...and, I thought this might help:
Version Helper Functions, MSDN

GetVersionEx, is officially deprecated starting in version 8.1. You CANNOT get accurate version information in a way that works in both Windows 7 and Windows 8. In Windows 8.1, GetVersionEx returns 6.2.9200, which is the version number for Windows 8.0.

...As you know,...I am a huge WMI fan. But, then,...as you also know,...I'm definitely crazy: Win32_OperatingSystem Class, MSDN

...Also, here are a couple of interesting articles:
Overcoming Windows 8.1's Deprecation of GetVersionEx and GetVersion APIs, Part One, CodeProject
Overcoming Windows 8.1's Deprecation of GetVersionEx and GetVersion APIs, Part Two, CodeProject
Zen

Siekmanski

  • Member
  • *****
  • Posts: 2590
Re: OS Info for Windows 8 and 10
« Reply #2 on: October 02, 2015, 07:43:00 AM »
Code: [Select]
DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Windows 8.1"
"CurrentVersion"="6.3"
"CurrentBuildNumber"="9600"
"SubVersionNumber"=(Value not found)
"CSDVersion"=(Value not found)
"BuildLab"="9600.winblue_ltsb.150715-0840"
"ProductId"=(Value not found)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Value not found)

OSVERSIONINFOEX Structure:

       Version.Build: 6.2.9200
         Platform ID: Win32 on Windows NT
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000001100000000
        Product Type: Windows 2000 Pro/XP/Vista Workstation

Press any key to exit
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Member
  • *****
  • Posts: 13304
  • Assembly is fun ;-)
    • MasmBasic
Re: OS Info for Windows 8 and 10
« Reply #3 on: October 02, 2015, 09:02:07 AM »
Code: [Select]
DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Windows 8.1 Connected"
"CurrentVersion"="6.3"
"CurrentBuildNumber"="9600"
"SubVersionNumber"=(Value not found)
"CSDVersion"=(Value not found)
"BuildLab"="9600.winblue_ltsb.150715-0840"
"ProductId"=(Value not found)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Value not found)

OSVERSIONINFOEX Structure:

       Version.Build: 6.2.9200
         Platform ID: Win32 on Windows NT
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000001100000000
        Product Type: Windows 2000 Pro/XP/Vista Workstation

Can I have some tests for the attached exe? Sample output:

JOCHEN-WXP runs OS version 5.1
JOCHEN-W7-64 runs OS version 6.1
JOCHEN-W8.1 runs OS version 6.3

This is the source:

include \masm32\MasmBasic\MasmBasic.inc      ; download
uselib netapi32
wsi MACRO arg
  exitm @CatStr(<[edi.WKSTA_INFO_100].wki100_>, <arg>)
ENDM
  Init
  PrintLine "Environment variable OS  ", Tb$, ExpandEnv$("%OS%")
  PrintLine "Return value from DOS 'ver'", Tb$, Trim$(Launch$("cmd.exe /C ver"))
  push eax
  invoke NetWkstaGetInfo, 0, 100, esp
  pop edi
  wInkey "NetWkstaGetInfo returns   ", wTb$, wsi(computername), wStr$(" runs OS version %i.", wsi(ver_major)), Str$(wsi(ver_minor)) 
  invoke NetApiBufferFree, edi
  Exit
EndOfCode

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: OS Info for Windows 8 and 10
« Reply #4 on: October 02, 2015, 11:36:02 AM »
right, Zen - i was aware of that little issue
but, i guess you want to start with the old stuff, then work toward newer OS's   :t

here are the results from Jochens GetVersion for XP MCE 2005 SP3, which probably doesn't help - lol

Code: [Select]
Environment variable OS         Windows_NT
Return value from DOS 'ver'     Microsoft Windows XP [Version 5.1.2600]
NetWkstaGetInfo returns         K7NL runs OS version 5.1

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: OS Info for Windows 8 and 10
« Reply #5 on: October 02, 2015, 11:39:48 AM »
IsWindows8Point1OrGreater

https://msdn.microsoft.com/en-us/library/windows/desktop/dn424962%28v=vs.85%29.aspx

 :biggrin:
Quote
Minimum supported client
   Windows 2000 Professional [desktop apps only]

Minimum supported server
   Windows 2000 Server [desktop apps only]

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: OS Info for Windows 8 and 10
« Reply #6 on: October 02, 2015, 11:47:09 AM »
Code: [Select]
;############################################################

        .DATA

szKernel32 db 'Kernel32.dll',0
szWin81    db 'IsWindows8Point1OrGreater',0

;############################################################

        .CODE

;************************************************************

main    PROC

    INVOKE  GetModuleHandle,offset szKernel32
    .if eax
        INVOKE  GetProcAddress,eax,offset szWin81
        .if eax
            call    eax
        .endif
    .endif
    print   str$(eax),13,10

sinsi

  • Guest
Re: OS Info for Windows 8 and 10
« Reply #7 on: October 02, 2015, 01:42:15 PM »
Code: [Select]
DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Windows 10 Pro"
"CurrentVersion"="6.3"
"CurrentBuildNumber"="10240"
"SubVersionNumber"=(Value not found)
"CSDVersion"=(Value not found)
"BuildLab"="10240.th1.150819-1946"
"ProductId"=(Value not found)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Value not found)

OSVERSIONINFOEX Structure:

       Version.Build: 6.2.9200
         Platform ID: Win32 on Windows NT
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000000100000000
        Product Type: Windows 2000 Pro/XP/Vista Workstation


Environment variable OS         Windows_NT
Return value from DOS 'ver'     Microsoft Windows [Version 10.0.10240]
NetWkstaGetInfo returns         JOHN runs OS version 10.0


sinsi

  • Guest
Re: OS Info for Windows 8 and 10
« Reply #8 on: October 02, 2015, 02:23:24 PM »
Code: [Select]
DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Windows 10 Home Insider Preview"
"CurrentVersion"="6.3"
"CurrentBuildNumber"="10547"
"SubVersionNumber"=(Value not found)
"CSDVersion"=(Value not found)
"BuildLab"="10547.th2_release.150913-1511"
"ProductId"=(Value not found)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Value not found)

OSVERSIONINFOEX Structure:

       Version.Build: 6.2.9200
         Platform ID: Win32 on Windows NT
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000001100000000
        Product Type: Windows 2000 Pro/XP/Vista Workstation

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: OS Info for Windows 8 and 10
« Reply #9 on: October 02, 2015, 03:41:14 PM »
that's nice, sinsi - windows 10 returns the "edition string" - one of the goals of my little project

this little program should get the correct minor version number for windows 8.1
it uses RtlGetVersion....

jj2007

  • Member
  • *****
  • Posts: 13304
  • Assembly is fun ;-)
    • MasmBasic
Re: OS Info for Windows 8 and 10
« Reply #10 on: October 02, 2015, 03:45:56 PM »
Environment variable OS         Windows_NT
Return value from DOS 'ver'     Microsoft Windows [Version 10.0.10240]
NetWkstaGetInfo returns         JOHN runs OS version 10.0

Thanks, John :biggrin:

IsWindows8Point1OrGreater

https://msdn.microsoft.com/en-us/library/windows/desktop/dn424962%28v=vs.85%29.aspx

 :biggrin:
Quote
Minimum supported client
   Windows 2000 Professional [desktop apps only]

So they knew about Win 8.1 15 years ago?  ::)
VersionHelpers.h should be interesting - this is inlined stuff for C compilers, not built-in functions.
OTOH, from community additions:
Quote
As of Windows 10 build 10041, this lies

jj2007

  • Member
  • *****
  • Posts: 13304
  • Assembly is fun ;-)
    • MasmBasic
Re: OS Info for Windows 8 and 10
« Reply #11 on: October 03, 2015, 04:42:21 AM »
New version, output for Win7-64:
Code: [Select]
RtlGetVersion   6.1 SP1.0 build 7601
Platform ID     2
Suite mask      0300: SINGLEUSERTS PERSONAL
ProductType     WORKSTATION
CSDVersion      Service Pack 1

Environment variable OS         Windows_NT
Return value from DOS 'ver'     Microsoft Windows [Versione 6.1.7601]
HKLM\Software\..\CurrentVersion 6.1
HKLM\..\CurrentBuildNumber      7601
LanRoot=[], LanGroup=[HOME] with 1 users
NetWkstaGetInfo returns         JOCHEN-DEV runs OS version 6.1

rrr314159

  • Member
  • *****
  • Posts: 1378
Re: OS Info for Windows 8 and 10
« Reply #12 on: October 03, 2015, 07:16:30 AM »
Quote from: dedndave
this little program should get the correct minor version number for windows 8.1

Quote from: this little program on my 8.1 machine
6.3

Press any key to continue ...

jj2007's GetVersionInfo, posted above, agrees, so apparently 8.1 = 6.3! Microsoft needs to hire better arithmeticians

Code: [Select]
RtlGetVersion   6.3 SP0.0 build 9600
Platform ID     2
Suite mask      0300: SINGLEUSERTS PERSONAL
ProductType     WORKSTATION
CSDVersion

Environment variable OS         Windows_NT
Return value from DOS 'ver'     Microsoft Windows [Version 6.3.9600]
HKLM\Software\..\CurrentVersion 6.3
HKLM\..\CurrentBuildNumber      9600
LanRoot=[], LanGroup=[WORKGROUP] with 2 users
NetWkstaGetInfo returns         LENOVO-PC runs OS version 6.3

---- hit any key ----
I am NaN ;)

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1196
Re: OS Info for Windows 8 and 10
« Reply #13 on: October 03, 2015, 04:00:18 PM »
My laptop:
Code: [Select]

DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Windows 8.1 Connected"
"CurrentVersion"="6.3"
"CurrentBuildNumber"="9600"
"SubVersionNumber"=(Value not found)
"CSDVersion"=(Value not found)
"BuildLab"="9600.winblue_ltsb.150715-0840"
"ProductId"=(Value not found)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Value not found)

OSVERSIONINFOEX Structure:

       Version.Build: 6.2.9200
         Platform ID: Win32 on Windows NT
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000001100000000
        Product Type: Windows 2000 Pro/XP/Vista Workstation

Press any key to exit
Well Microsoft, here’s another nice mess you’ve gotten us into.

TouEnMasm

  • Member
  • *****
  • Posts: 1762
    • EditMasm
Re: OS Info for Windows 8 and 10
« Reply #14 on: October 03, 2015, 10:13:06 PM »
For dedndave,
There is a very few dll concerned by Dllgetversion
Here is the full list given by MSDN
Quote
comctl32.dll dwMajorVersion:5h
comctl32.dll dwMinorVersion:52h
Failed to find DllGetVersion in NtDll.dll
Shell32.dll dwMajorVersion:ah
Shell32.dll dwMinorVersion:0h
Shdocvw.dll dwMajorVersion:ah
Shdocvw.dll dwMinorVersion:0h
Shlwapi.dll dwMajorVersion:ah
Shlwapi.dll dwMinorVersion:0h
Press any key
[\quote]

source code and exe in zip

Windows 10 result

Quote
DednDave OS Info Dump Ver 2.03

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"ProductName"="Windows 10 Home"
"CurrentVersion"="6.3"
"CurrentBuildNumber"="10240"
"SubVersionNumber"=(Value not found)
"CSDVersion"=(Value not found)
"BuildLab"="10240.th1.150819-1946"
"ProductId"=(Value not found)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"Ident"=(Value not found)

OSVERSIONINFOEX Structure:

       Version.Build: 6.2.9200
         Platform ID: Win32 on Windows NT
         CSD Version:
Service Pack Version: 0.0
          Suite Mask: 0000001100000000
        Product Type: Windows 2000 Pro/XP/Vista Workstation

Press any key to exit
Fa is a musical note to play with CL