1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Make init_winver() idempotent.

This way, anyone who needs to use the version data can quickly call
init_winver to make sure it's been set up, and not waste too much faff
redoing the actual work.
This commit is contained in:
Simon Tatham 2022-03-12 15:21:18 +00:00
parent 5de1df1b94
commit 26dcfcbd44

View File

@ -4,6 +4,11 @@ DWORD osMajorVersion, osMinorVersion, osPlatformId;
void init_winver(void)
{
static bool initialised = false;
if (initialised)
return;
initialised = true;
OSVERSIONINFO osVersion;
static HMODULE kernel32_module;
DECL_WINDOWS_FUNCTION(static, BOOL, GetVersionExA, (LPOSVERSIONINFO));