From c85f86977969a9305cebc7bc80fc177bd21105e9 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Tue, 11 Jun 2019 16:48:19 +0000 Subject: * misc/win32/misc.c (apr_get_oslevel): Use GetVersionExW() with OSVERSIONINFOEXW to version information with service pack info. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861049 13f79535-47bb-0310-9956-ffa450edef68 --- misc/win32/misc.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'misc') diff --git a/misc/win32/misc.c b/misc/win32/misc.c index 2b38a4aa5..630147b43 100644 --- a/misc/win32/misc.c +++ b/misc/win32/misc.c @@ -27,27 +27,15 @@ apr_status_t apr_get_oslevel(apr_oslevel_e *level) { if (apr_os_level == APR_WIN_UNK) { - OSVERSIONINFO oslev; - oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (!GetVersionEx(&oslev)) { + OSVERSIONINFOEXW oslev; + oslev.dwOSVersionInfoSize = sizeof(oslev); + if (!GetVersionExW((OSVERSIONINFOW*) &oslev)) { return apr_get_os_error(); } if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) { - unsigned int servpack = 0; - TCHAR *pservpack; - if ((pservpack = oslev.szCSDVersion)) { - while (*pservpack && !apr_isdigit(*pservpack)) { - pservpack++; - } - if (*pservpack) -#ifdef _UNICODE - servpack = _wtoi(pservpack); -#else - servpack = atoi(pservpack); -#endif - } + unsigned int servpack = oslev.wServicePackMajor; if (oslev.dwMajorVersion < 3) { apr_os_level = APR_WIN_UNSUP; -- cgit v1.2.1