X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 200D33858425
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1710861579;
	bh=BwKh0L5RQ99NF3/c4g08pBFXiq2RcapIUIRRLLASauA=;
	h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=QVluzALaWG/7ZaIczEtmAvMKXSW6nVHGjIQO01BrGqetZbaTHZBnoUdo6w2MatqB+
	 5439r4/SJf+seP9CtAeH5eJrH4SKTsKhClfERD2sJUokoJ057hU707mk5thHHADL3Q
	 GYRTBDMGsxnsMMrl0MH4qqRJc1PCthX0XjVnsxMI=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FEF5385842B
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6FEF5385842B
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710861521; cv=none;
 b=h+O7niF4/u3Jh+FL/4WIVa8bWYC6UF805dKr6d021C311prWdb8G0Ya32v3cQVLIsOUFazc6/fvqiF2zHWJa1NVxEmqFl96TDem6y1xlHOPGZbnlwheIi0/vaVcQHauO6OHEFAKF7AKHUnXz6SXno+KjwcaN2uCEU3WqxaZW+tg=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1710861521; c=relaxed/simple;
 bh=yq3326zL3W0qwRqy27oUBOLhoZ2mdxkwb13Qdsx9QYY=;
 h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
 b=KdZur333DuZhY3HgOXL6QGzDosrncrPt+lnmxWtXvkA52nCT4aS5P4uNw7s4rmAX6WyjsqPXxsLmCr8V4iBmevLGM6ENcl4J3+QRcdEtwiSbmK8Ac/zaWrl1yl7aftXh60IY5nkzoiW2tqtsbmgK1PPBRadhgyXEioM+bdBc3Dg=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-UI-Sender-Class: f2cb72be-343f-493d-8ec3-b1efb8d6185a
X-Gm-Message-State: AOJu0YxW189PWcim8o28IxllCQQPpUCKXjUM5b8yab549qjZqyXewMG9
 rmQrv2u6nbziFV9pnKGCPPh5URtYZ1nqKl2y44nPdhwy6z0KJXU0XbMedODsR0xtPO7Np36Wap+
 8l+mwc12Guec0FPrUkfFPlyPhD/M=
X-Google-Smtp-Source: AGHT+IGsS6qeBr/RSat8A1vjpl0uLzwtYUxdRDIKZoPAIWEN22FG8ncfIWUBNah/SQlWm9T/K1Rx9PNuBNFCGqhQQUA=
X-Received: by 2002:a2e:9f07:0:b0:2d4:76d6:e9c9 with SMTP id
 u7-20020a2e9f07000000b002d476d6e9c9mr8698438ljk.52.1710861516614; Tue, 19 Mar
 2024 08:18:36 -0700 (PDT)
MIME-Version: 1.0
References: <CALXu0UdrjFfhrBmBPNYepvMJ3hL7CPf1n6HEowxZgOxwdoy1TA@mail.gmail.com>
 <b47b7092-716a-c626-a14d-e5847bc86926@t-online.de>
 <CANV9t=S2BJ2d-_zNm3ZgVeerQ+ZEONQ4fjN1MXc6JVp+Gvrxsg@mail.gmail.com>
 <CALwydEs5ZTYqSxfZOp_hWobWQxFEeLGio8WoUCwTAM2eaph_sA@mail.gmail.com>
In-Reply-To: <CALwydEs5ZTYqSxfZOp_hWobWQxFEeLGio8WoUCwTAM2eaph_sA@mail.gmail.com>
Date: Tue, 19 Mar 2024 09:18:09 -0600
X-Gmail-Original-Message-ID: <CANV9t=QHLHyv_jvvrCREpyrEX=JqmTdQvnmfUXbSKuvMrhHn9A@mail.gmail.com>
Message-ID: <CANV9t=QHLHyv_jvvrCREpyrEX=JqmTdQvnmfUXbSKuvMrhHn9A@mail.gmail.com>
Subject: Re: GetVersionEx() depreciated, what should be used instead for
 Windows 7/8/10?
To: cygwin@cygwin.com
X-Provags-ID: V03:K1:YEyg9vOqBelfEG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U8u26O
 JHeMnNh4VcpuXXRsQIMt03GoUzKlwaotBJOSaP8EWBJKY=
X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE,
 RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,
 SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.30
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Bill Stewart via Cygwin <cygwin@cygwin.com>
Reply-To: Bill Stewart <bstewart@iname.com>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 42JFJdfb783711

On Tue, Mar 19, 2024 at 9:01 AM Richard Campbell wrote:

On Tue, Mar 19, 2024 at 9:04 AM Bill Stewart via Cygwin <cygwin@cygwin.com>
> wrote:
>
> > Can you please clarify the circumstances under which the RtlGetVersion
> > function "may not return the correct values"?
>
> "Originally, using RtlGetVersion instead of GetVersionEx was supposed to
> fix the fact that GetVersionInfo returns the wrong kernel version if the
> executable has been built with an old manifest (or none at all), starting
> with Windows 8.1.  Either this never really worked as desired and our
> testing was flawed, or this has been changed again with Windows 10, so
> that RtlGetVersion does the kernel faking twist as well.  Since we're
> only reading the value in the first process in a process tree. the entire
> process tree is running with a wrong OS version information in that case.
>
> Fortunately, the (undocumented) RtlGetNtVersionNumbers function is not
> affected by this nonsense, so we simply override the OS version info
> fields with the correct values now."
>
> https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=48511f3d3847c35352d09cded56e25f0c1b22bc9
>

Interesting. I have not yet been able to find a scenario where the
RtlGetVersion function gets "manifested" like GetVersionEx.

I wrote a small Win32 console utility for displaying and testing OS
information (requires Windows Vista/Server 2008 or later):

https://github.com/Bill-Stewart/osinfo

It uses RtlGetVersion, and this function works correctly for me in all
current Windows versions (Windows 10, Server 2016, Windows 11, Server 2019,
Server 2022, etc.).

I'm not sure of the exact scenario that led to the "RtlGetVersion is
subject to manifesting" conclusion, but I can't reproduce it.

I would be interested to know what results the osinfo.exe tool reports in
these scenarios.

Regards,

Bill

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

