windows: Remove references to GetVersionExA (thanks, Andrew Pilley!).
authorRyan C. Gordon <icculus@icculus.org>
Mon, 01 Jan 2018 19:16:51 -0500
changeset 11803454f6dc9cb85
parent 11802 3f5fad386f11
child 11804 8dce4b0683e6
windows: Remove references to GetVersionExA (thanks, Andrew Pilley!).

"GetVersionExA is deprecated in windows 8.1 and above's SDK, causing a warning
when building against the win10 SDK. Attached patch cleans up the usage for a
warning-free build.

GetVersionExA was being used to test to see if SDL was running on win9x or
winnt. A quick chat with Ryan on twitter suggested that SDL doesn't
officially support win9x anymore, so the call to this can be outright removed.

As an aside, replacing the call to GetVersionExA with VerifyVersionInfoA (the
recommended path) would have been pointless, as VerifyVersionInfoA only
supports VER_PLATFORM_WIN32_NT and doesn't officially support any other value
for dwPlatformId currently. (And it's probable that win9x SDKs didn't have
VerifyVersionInfo* in them anyway.)"

Fixes Bugzilla #4019.
src/video/windows/SDL_windowskeyboard.c
     1.1 --- a/src/video/windows/SDL_windowskeyboard.c	Mon Jan 01 19:40:29 2018 -0400
     1.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Mon Jan 01 19:16:51 2018 -0500
     1.3 @@ -446,16 +446,12 @@
     1.4      INT err = 0;
     1.5      BOOL vertical = FALSE;
     1.6      UINT maxuilen = 0;
     1.7 -    static OSVERSIONINFOA osversion;
     1.8  
     1.9      if (videodata->ime_uiless)
    1.10          return;
    1.11  
    1.12      videodata->ime_readingstring[0] = 0;
    1.13 -    if (!osversion.dwOSVersionInfoSize) {
    1.14 -        osversion.dwOSVersionInfoSize = sizeof(osversion);
    1.15 -        GetVersionExA(&osversion);
    1.16 -    }
    1.17 +    
    1.18      id = IME_GetId(videodata, 0);
    1.19      if (!id)
    1.20          return;
    1.21 @@ -516,9 +512,6 @@
    1.22              }
    1.23              break;
    1.24          case IMEID_CHS_VER42:
    1.25 -            if (osversion.dwPlatformId != VER_PLATFORM_WIN32_NT)
    1.26 -                break;
    1.27 -
    1.28              p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 1*4 + 1*4 + 6*4);
    1.29              if (!p)
    1.30                  break;