AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Windows Version inkl. Win 11 ermitteln
Thema durchsuchen
Ansicht
Themen-Optionen

Windows Version inkl. Win 11 ermitteln

Ein Thema von Walter Landwehr · begonnen am 10. Sep 2025 · letzter Beitrag vom 12. Sep 2025
Antwort Antwort
Walter Landwehr

Registriert seit: 28. Mär 2006
Ort: 32816 Schieder-Schwalenberg
406 Beiträge
 
Delphi 10.4 Sydney
 
#1

Windows Version inkl. Win 11 ermitteln

  Alt 10. Sep 2025, 13:14
Hallo kennt jemand eine function die sauber die Windows Version zurück gibt.

Danke für jeden Tipp im voraus.
Walter Landwehr
Mfg

Walter
  Mit Zitat antworten Zitat
fred42

Registriert seit: 1. Jan 2025
17 Beiträge
 
#2

AW: Windows Version inkl. Win 11 ermitteln

  Alt 10. Sep 2025, 16:05
Hallo,
ueber WMI

https://www.delphipraxis.net/215190-...mitteln-3.html

Gruß
  Mit Zitat antworten Zitat
Kas Ob.
Online

Registriert seit: 3. Sep 2023
474 Beiträge
 
#3

AW: Windows Version inkl. Win 11 ermitteln

  Alt Gestern, 08:54
Hi,
Hallo kennt jemand eine function die sauber die Windows Version zurück gibt.

Danke für jeden Tipp im voraus.
Here a trick that can't be fooled by Windows Compatibility, that work for 32bit and 64bit.

Delphi-Quellcode:
type
  TWinVersion = record
    Major: Cardinal;
    Minor: Cardinal;
  end;

function GetWinVersion: TWinVersion;
const
  // Address of USER_SHARED_DATA (KUSER_SHARED_DATA) is always at FS/GS:[0x7FFE0000]
  KUSER_SHARED_DATA = $7FFE0000;
begin
  // NtMajorVersion is at offset $26C, NtMinorVersion at $270
  // https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/kuser_shared_data/index.htm
  Result.Major := PCardinal(KUSER_SHARED_DATA + $26C)^;
  Result.Minor := PCardinal(KUSER_SHARED_DATA + $270)^;
end;
As for build number is little more trickier and while it is backward compatible, there is no guarantee it will work in future, but you can access the build number by reading NtBuildNumber, whcih changed its index in the past.
Zitat:
0x0244 (4.0 to 5.1);
0x0248 (5.2 to 6.1);
0x0260
Kas
  Mit Zitat antworten Zitat
Benutzerbild von Cypheros
Cypheros

Registriert seit: 12. Sep 2024
Ort: Büren
49 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Windows Version inkl. Win 11 ermitteln

  Alt Gestern, 11:05
Nice
Frank Siek
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.740 Beiträge
 
Delphi 12 Athens
 
#5

AW: Windows Version inkl. Win 11 ermitteln

  Alt Gestern, 12:07
Feste Speicheradresse?

Zum Glück ist ASLR in aktuellen Delphis nicht aktiv.
Halt nee, ist es.
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Kas Ob.
Online

Registriert seit: 3. Sep 2023
474 Beiträge
 
#6

AW: Windows Version inkl. Win 11 ermitteln

  Alt Gestern, 15:04
Feste Speicheradresse?

Zum Glück ist ASLR in aktuellen Delphis nicht aktiv.
Halt nee, ist es.
That address belong to a magic read-only fixed page, it is there since the dawn of Windows 32bit, and it is not going anywhere anytime, also documented my Microsoft, the thing is the documentation went from mainstream to more less encouraged to be used, but it was heavily documented in DDK and not only that it was recommended to be relied on for timing instead of GetTickCount for games and more specially for low level drivers.
https://learn.microsoft.com/en-us/wi...er_shared_data
https://learn.microsoft.com/en-us/wi...gercmds/-kuser

In case you afraid of ASLR, which doesn't have a connection to non executable loading address as it is read-only page for general information, then have a look at this
https://msrc.microsoft.com/blog/2022...re-on-windows/
meaning for User space the address and that page will stay the same,
and for Driver/Kernel space where it is read+write it might be change address on boot when KASLR is enabled.
Kas
  Mit Zitat antworten Zitat
kopernikus

Registriert seit: 8. Feb 2008
21 Beiträge
 
Delphi 10 Seattle Professional
 
#7

AW: Windows Version inkl. Win 11 ermitteln

  Alt Gestern, 21:49
Es gibt eine fertige Unit auf GitHub
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz