X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/bf133a73a78d9ea39ff5cd50dfea926253ec021a..4c48c989a62fba2809d684b30963b4411038fe96:/pageant.c diff --git a/pageant.c b/pageant.c index e8428b03..0ca6b950 100644 --- a/pageant.c +++ b/pageant.c @@ -1810,7 +1810,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { WNDCLASS wndclass; MSG msg; - OSVERSIONINFO osi; HMODULE advapi; char *command = NULL; int added_keys = 0; @@ -1821,9 +1820,11 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) * Determine whether we're an NT system (should have security * APIs) or a non-NT system (don't do security). */ - memset(&osi, 0, sizeof(OSVERSIONINFO)); - osi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (GetVersionEx(&osi) && osi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + if (!init_winver()) + { + modalfatalbox("Windows refuses to report a version"); + } + if (osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT) { has_security = TRUE; } else has_security = FALSE;