Modify

#3849 closed Bug (Completed)

Server 2022 @OSVersion returns WIN_2019

Reported by: anonymous Owned by: Jon
Milestone: 3.3.15.5 Component: AutoIt
Version: 3.3.15.4 Severity: None
Keywords: Cc:

Description

Server 2022 was recently released just wanted to bring it to your attention. @OSVersion tested on beta 3.3.15.4

Attachments (1)

Jpm1.png (2.2 KB ) - added by mLipok on Oct 10, 2021 at 9:30:15 PM.
Results on Windows2022

Download all attachments as: .zip

Change History (10)

comment:1 by mLipok, on Sep 16, 2021 at 11:27:07 PM

btw.
Can anyone test it on Windows 11 as well ?

comment:2 by J-Paul Mesnage, on Sep 18, 2021 at 8:45:42 AM

Hi,
as I don't have access to server 2022,
can you give me the msgbox result of the following script.
For the time being the MSDN doc does not describe the corresponding value.
For Win11 perhaps we need to wait October 5th
Thanks for the help

; Dec, Int, Number Constants
Global Const $NUMBER_AUTO = 0
Global Const $NUMBER_32BIT = 1
Global Const $NUMBER_64BIT = 2
Global Const $NUMBER_DOUBLE = 3

Global Const $tagOSVERSIONINFO = 'struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct'

ConsoleWrite('Windows version: ' & _WinAPI_GetVersion() & @CRLF)

Func _WinAPI_GetVersion()
	Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
	DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))

	Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
	If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0)

	MsgBox(0, "OSVERSIONINFO", "MajorVersion = " &DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _
			"MinorVersion = " &DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _
			"BuildNumber = " &DllStructGetData($tOSVI, "BuildNumber"))

	Return Number(DllStructGetData($tOSVI, "MajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE)
EndFunc   ;==>_WinAPI_GetVersion

Version 0, edited on Sep 18, 2021 at 8:45:42 AM by J-Paul Mesnage (next)

in reply to:  2 comment:3 by mLipok, on Oct 5, 2021 at 7:04:20 PM

Replying to Jpm:

For Win11 perhaps we need to wait October 5th

Time was ticking and oops it's today.

Windows 11 gives me such results:

MajorVersion = 10
MinorVersion = 0
BuildNumber = 22000

https://www.autoitscript.com/forum/topic/206774-windows11autoit-chat-room-for-experience-exchange/?do=findComment&comment=1490352

Last edited on Oct 5, 2021 at 7:32:57 PM by mLipok (previous) (diff)

comment:4 by J-Paul Mesnage, on Oct 7, 2021 at 5:04:11 PM

Thanks for Win11
Please post the same for Server 2022

by mLipok, on Oct 10, 2021 at 9:30:15 PM

Attachment: Jpm1.png added

Results on Windows2022

comment:6 by mLipok, on Oct 10, 2021 at 9:31:16 PM

This was tested on:
Windows Server 2022 Datacenter Evaluation
MajorVersion = 10
MinorVersion = 0
BuildNumber = 20348

Last edited on Oct 10, 2021 at 9:32:58 PM by mLipok (previous) (diff)

comment:7 by J-Paul Mesnage, on Oct 16, 2021 at 10:05:31 AM

Owner: set to J-Paul Mesnage
Status: newassigned

Thanks
Fix sent to Jon

comment:8 by Jon, on Feb 27, 2022 at 2:17:33 PM

Milestone: 3.3.15.5
Owner: changed from J-Paul Mesnage to Jon
Resolution: Completed
Status: assignedclosed

Added by revision [12627] in version: 3.3.15.5

comment:9 by mLipok, on Mar 5, 2022 at 1:48:47 PM

For future testing purposes, I am posting a revised test script here:

#AutoIt3Wrapper_Change2CUI=y
; Dec, Int, Number Constants
Global Const $NUMBER_AUTO = 0
Global Const $NUMBER_32BIT = 1
Global Const $NUMBER_64BIT = 2
Global Const $NUMBER_DOUBLE = 3

Global Const $tagOSVERSIONINFO = "struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct"

Global $sInformation = _
                "AutoIt version: " & @AutoItVersion & @CRLF & _
                "Windows version: " & _WinAPI_GetVersion() & @CRLF & "  Build: " & @extended & @CRLF & _
                "@OSVersion: " & @OSVersion & @CRLF & _
                "@OSType: " & @OSType & @CRLF & _
                ""

ConsoleWrite($sInformation & @CRLF)
ClipPut($sInformation)

Func _WinAPI_GetVersion()
        Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
        DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))

        Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
        If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0)

        MsgBox(0, "OSVERSIONINFO", "MajorVersion = " & DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _
                        "MinorVersion = " & DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _
                        "BuildNumber = " & DllStructGetData($tOSVI, "BuildNumber"))

        Return SetError(0, Number(DllStructGetData($tOSVI, "BuildNumber")), Number(DllStructGetData($tOSVI, "MajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE))
EndFunc   ;==>_WinAPI_GetVersion

This is related to discussion from here:
https://www.autoitscript.com/forum/topic/207634-autoit-v33155-beta/?do=findComment&comment=1497796

My current results are:

AutoIt version: 3.3.15.5
Windows version: 10
	Build: 22000
@OSVersion: UNKNOWN
@OSType: WIN32_NT

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.