comparison src/loadso/win32/SDL_sysloadso.c @ 4178:2dc6c9f343c8 SDL-1.2

Fixed dynamic loading on Windows CE
author Sam Lantinga <slouken@libsdl.org>
date Thu, 07 May 2009 12:03:51 +0000
parents a1b03ba2fcd0
children
comparison
equal deleted inserted replaced
4177:04a75cf3ff1c 4178:2dc6c9f343c8
91 int length = SDL_strlen(name); 91 int length = SDL_strlen(name);
92 92
93 wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t)); 93 wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t));
94 wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t)); 94 wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
95 95
96 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length); 96 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length+1);
97 97
98 symbol = (void *)GetProcAddress((HMODULE)handle, name_t); 98 symbol = (void *)GetProcAddress((HMODULE)handle, name_t);
99 if ( symbol == NULL ) { 99 if ( symbol == NULL ) {
100 FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS | 100 FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
101 FORMAT_MESSAGE_FROM_SYSTEM), 101 FORMAT_MESSAGE_FROM_SYSTEM),