Commit Graph

7 Commits

Author SHA1 Message Date
Ryan C. Gordon 4d1626d042 Windows SDL_GetBasePath: free string on failure. 2015-05-28 15:36:27 -04:00
Ryan C. Gordon aa43bee434 Windows GetBasePath: fixed reallocation code. 2015-05-28 15:32:45 -04:00
Ryan C. Gordon 566316e052 Windows SDL_GetBasePath: Fixed wrong variable when growing the buffer size. 2015-05-28 15:29:43 -04:00
Sam Lantinga bccc2ad09e Fixed compiling and tested on Windows 2015-05-28 12:06:48 -07:00
Ryan C. Gordon 6d1ad3847a Windows GetBasePath should use GetModuleFileNameExW() and check for overflows.
Apparently you might get strange paths from GetModuleFileName(), such as
short path names or UNC filenames, so this avoids that problem. Since you have
to tapdance with linking different libraries and defining macros depending on
what Windows you plan to target, we dynamically load the API we need, which
works on all versions of Windows (on Win7, it'll load a compatibility wrapper
for the newer API location).

What a mess.

This also now does the right thing if there isn't enough space to store the
path, looping with a larger allocated buffer each try.

Fixes Bugzilla #2435.
2015-05-28 01:54:52 -04:00
Sam Lantinga 2c4a6ea0a2 Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon b72938c861 Windows: Always set the system timer resolution to 1ms by default.
An existing hint lets apps that don't need the timer resolution changed avoid
this, to save battery, etc, but this fixes several problems in timing, audio
callbacks not firing fast enough, etc.

Fixes Bugzilla #2944.
2015-04-20 12:22:44 -04:00