comparison src/loadso/win32/SDL_sysloadso.c @ 3119:f78ed7625325

Fixed dynamic loading on Windows CE
author Sam Lantinga <slouken@libsdl.org>
date Thu, 07 May 2009 12:04:53 +0000
parents 99210400e8b9
children f7b03b6838cb
comparison
equal deleted inserted replaced
3118:5ba12c32ac6a 3119:f78ed7625325
94 int length = SDL_strlen(name); 94 int length = SDL_strlen(name);
95 95
96 wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t)); 96 wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t));
97 wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t)); 97 wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
98 98
99 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length); 99 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length + 1);
100 100
101 symbol = (void *) GetProcAddress((HMODULE) handle, name_t); 101 symbol = (void *) GetProcAddress((HMODULE) handle, name_t);
102 if (symbol == NULL) { 102 if (symbol == NULL) {
103 FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS | 103 FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
104 FORMAT_MESSAGE_FROM_SYSTEM), 104 FORMAT_MESSAGE_FROM_SYSTEM),