We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1086

Summary: SDL crashes when creating a window on Windows XP
Product: SDL Reporter: John Wilson <johnnyc.wilson>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: roger.levy
Version: HG 2.0   
Hardware: x86   
OS: Windows (XP)   

Description John Wilson 2010-12-31 14:34:05 UTC
SDL tries to grab some functions from user32.dll

data->userDLL = LoadLibrary(TEXT("USER32.DLL"));
if (data->userDLL) {
	data->CloseTouchInputHandle = (BOOL (WINAPI *)( HTOUCHINPUT )) GetProcAddress(data->userDLL, "CloseTouchInputHandle");
	data->GetTouchInputInfo = (BOOL (WINAPI *)( HTOUCHINPUT, UINT, PTOUCHINPUT, int )) GetProcAddress(data->userDLL, "GetTouchInputInfo");
	data->RegisterTouchWindow = (BOOL (WINAPI *)( HWND, ULONG )) GetProcAddress(data->userDLL, "RegisterTouchWindow");
}

On Windows XP, these functions do not exist in user32.dll, so when SDL tries to call one of them, it calls a null pointer and crashes.

/* Enable multi-touch */
videodata->RegisterTouchWindow(hwnd, (TWF_FINETOUCH|TWF_WANTPALM));
Comment 1 Sam Lantinga 2011-01-04 00:35:29 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL/rev/6546eaa20271
Comment 2 Sam Lantinga 2011-02-16 04:06:16 UTC
*** Bug 1084 has been marked as a duplicate of this bug. ***