diff options
author | Ivan Zhakov <ivan@apache.org> | 2019-06-11 16:48:19 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2019-06-11 16:48:19 +0000 |
commit | c85f86977969a9305cebc7bc80fc177bd21105e9 (patch) | |
tree | d09d2020f2e58e1cac050143cad206717f9de641 /misc | |
parent | c3dc746113fc27aa9eafd6255f0a88bd70b59c92 (diff) | |
download | apr-c85f86977969a9305cebc7bc80fc177bd21105e9.tar.gz |
* 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
Diffstat (limited to 'misc')
-rw-r--r-- | misc/win32/misc.c | 20 |
1 files changed, 4 insertions, 16 deletions
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; |