Date: Thu, 18 Sep 2003 14:24:35 -0400
authorSam Lantinga <slouken@libsdl.org>
Sun, 21 Sep 2003 18:40:51 +0000
changeset 721ab0656314eef
parent 720 f90d80d68071
child 722 90dfd3f5782c
Date: Thu, 18 Sep 2003 14:24:35 -0400
From: Scott Watson
Subject: [SDL] Improper Windows message routine calling

If this hasn't been caught yet, there's an improper method of calling a
user's window message routine in the various SDL_xxevents.c files.

Calling it improperly can cause a crash under at least XP.
src/video/windib/SDL_dibevents.c
src/video/windx5/SDL_dx5events.c
     1.1 --- a/src/video/windib/SDL_dibevents.c	Sun Sep 21 18:32:04 2003 +0000
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Sun Sep 21 18:40:51 2003 +0000
     1.3 @@ -177,7 +177,7 @@
     1.4  				along to any win32 specific window proc.
     1.5  			 */
     1.6  			} else if (userWindowProc) {
     1.7 -				return userWindowProc(hwnd, msg, wParam, lParam);
     1.8 +				return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
     1.9  			}
    1.10  		}
    1.11  		break;
     2.1 --- a/src/video/windx5/SDL_dx5events.c	Sun Sep 21 18:32:04 2003 +0000
     2.2 +++ b/src/video/windx5/SDL_dx5events.c	Sun Sep 21 18:40:51 2003 +0000
     2.3 @@ -537,13 +537,13 @@
     2.4  				wmmsg.lParam = lParam;
     2.5  				posted = SDL_PrivateSysWMEvent(&wmmsg);
     2.6  
     2.7 -         /* DJM: If the user isn't watching for private messages in her
     2.8 -            SDL event loop, then pass it along to any win32 specific
     2.9 -            window proc.
    2.10 -          */
    2.11 -         } else if (userWindowProc) {
    2.12 -            return userWindowProc(hwnd, msg, wParam, lParam);
    2.13 -         }
    2.14 +			/* DJM: If the user isn't watching for private
    2.15 +				messages in her SDL event loop, then pass it
    2.16 +				along to any win32 specific window proc.
    2.17 +			 */
    2.18 +			} else if (userWindowProc) {
    2.19 +				return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
    2.20 +			}
    2.21  		}
    2.22  		break;
    2.23  	}