src/loadso/win32/SDL_sysloadso.c
changeset 3119 f78ed7625325
parent 2859 99210400e8b9
child 3697 f7b03b6838cb
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),