MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey-v1.0 / GetOSVersion

Method GetOSVersion

Source/script.cpp:10460–10493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10458}
10459
10460VarSizeType Script::GetOSVersion(char *aBuf)
10461// Adapted from AutoIt3 source.
10462{
10463 char *version = ""; // Init in case OS is something later than Win2003.
10464 if (g_os.IsWinNT())
10465 {
10466 if (g_os.IsWinXP())
10467 version = "WIN_XP";
10468 else if (g_os.IsWin2003())
10469 version = "WIN_2003";
10470 else
10471 {
10472 if (g_os.IsWin2000())
10473 version = "WIN_2000";
10474 else
10475 version = "WIN_NT4";
10476 }
10477 }
10478 else
10479 {
10480 if (g_os.IsWin95())
10481 version = "WIN_95";
10482 else
10483 {
10484 if (g_os.IsWin98())
10485 version = "WIN_98";
10486 else
10487 version = "WIN_ME";
10488 }
10489 }
10490 if (aBuf)
10491 strcpy(aBuf, version);
10492 return (VarSizeType)strlen(version); // Always return length of version, not aBuf.
10493}
10494
10495VarSizeType Script::GetLanguage(char *aBuf)
10496// Registry locations from J-Paul Mesnage.

Callers 1

GetMethod · 0.80

Calls 6

IsWinNTMethod · 0.80
IsWinXPMethod · 0.80
IsWin2003Method · 0.80
IsWin2000Method · 0.80
IsWin95Method · 0.80
IsWin98Method · 0.80

Tested by

no test coverage detected