Skip to content

Commit

Permalink
Windows: Fixed crash if using current SDL_GetWindowWMInfo() from olde…
Browse files Browse the repository at this point in the history
…r programs.
  • Loading branch information
philippwiesemann committed Nov 17, 2016
1 parent d05a39d commit a49ac09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/video/windows/SDL_windowswindow.c
Expand Up @@ -697,9 +697,15 @@ WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
{
const SDL_WindowData *data = (const SDL_WindowData *) window->driverdata;
if (info->version.major <= SDL_MAJOR_VERSION) {
int versionnum = SDL_VERSIONNUM(info->version.major, info->version.minor, info->version.patch);

info->subsystem = SDL_SYSWM_WINDOWS;
info->info.win.window = data->hwnd;
info->info.win.hdc = data->hdc;

if (versionnum >= SDL_VERSIONNUM(2, 0, 4)) {
info->info.win.hdc = data->hdc;
}

return SDL_TRUE;
} else {
SDL_SetError("Application not compiled with SDL %d.%d\n",
Expand Down

0 comments on commit a49ac09

Please sign in to comment.