src/loadso/win32/SDL_sysloadso.c
branchSDL-1.2
changeset 4178 2dc6c9f343c8
parent 4159 a1b03ba2fcd0
child 6137 4720145f848b
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),