X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FA0D3858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1710843701; bh=XsM4kUDOLUMF3fLmwl5kPfEwwXf1/YcBpgBqoaaFnAM=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=H3Eyv/1o4bruIRWkoR0K81Fu2xfOX7uzcWnfPFxwTGTHqFqiTor2zbMg6BQAPO3Wz RYN8YqRgVqavp56DHWnkvUkxfbQBb67QiZpW0Ed8Wm4p4ZwWCWI5tFRgPB1VHG45hX DGGhEbUxq1/KX6Yot1Du8OcyRXZ8KOKvhIgtXRrA= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF28F3858CD1 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF28F3858CD1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710843678; cv=none; b=g6m/kB+ibAZVRt6wzqFCK6wSLpLd3VmRVxPkFFcKLDmFVFZgFr+t70KP442y0DtwATMbTSdpujnBK8edkRWSoptm1jaP00GYbjcHHc52bMTTWJ7QKnN0cygDQ2ILZJjANfbDkN5GBe2G2o841qtO0JAzxia3e4MQJhOU2sAKcaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710843678; c=relaxed/simple; bh=MW+Dq+NU7Hk9s7oVqxx58r4Ltc22FSjA5tctXN3GLQE=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=tBIZ5oppVJnYb2ZaU2vc2/SkWNd1iEhWxDKtYaT6Bl0tBH9VsqH92pLJPpsnJYbtfQiNZaw0Rr0VPqelaDAD7OAzMASgJZ6bqAUV30GyBFkIlrpk7XaE+3voPBRqS+DhIFUxYtNvGXngYjsrOy/ihBQc/vhdnBMHcxXRGPoq1Ig= ARC-Authentication-Results: i=1; server2.sourceware.org Subject: Re: GetVersionEx() depreciated, what should be used instead for Windows 7/8/10? To: cygwin AT cygwin DOT com References: Message-ID: Date: Tue, 19 Mar 2024 11:20:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 SeaMonkey/2.53.16 MIME-Version: 1.0 In-Reply-To: X-TOI-EXPURGATEID: 150726::1710843659-3CFF6877-961C1346/0/0 CLEAN NORMAL X-TOI-MSGID: 60557f7b-9496-4e1a-b45b-7402f40d543c X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christian Franke via Cygwin Reply-To: Christian Franke Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Cedric Blancher via Cygwin wrote: > How does cygwin uname -s work, i.e. how does it get the OS version, > revision and build number ('10.0-19045')? > I tried to replicate it via GetVersionEx(), but that is deprecated. > AFAICS, MS does not offer an official way to retrieve the actual Windows version via the Win32 API layer. GetVersionEx() is unable to detect Windows versions which are more recent than the compatibility level advertised in the application manifest. Cygwin uses the undocumented RtlGetNtVersionNumbers() from ntdll.dll because even RtlGetVersion() may not return the correct values. See function wincapc::init() https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/wincap.cc -- Regards, Christian -- 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