News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

OS Info for Windows 8 and 10

Started by dedndave, October 02, 2015, 07:14:44 AM

Previous topic - Next topic

dedndave

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

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


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

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

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

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

IsWindows8Point1OrGreater

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

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

Minimum supported server
   Windows 2000 Server [desktop apps only]

dedndave

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

        .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


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

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

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

Quote from: sinsi on October 02, 2015, 01:42:15 PMEnvironment 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:

Quote from: dedndave 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:
QuoteMinimum 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

New version, output for Win7-64:
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

Quote from: dedndavethis little program should get the correct minor version number for windows 8.1

Quote from: this little program on my 8.1 machine6.3

Press any key to continue ...

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

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

My laptop:


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

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