• Amaury Forgeot d'Arc's avatar
    On Windows, when import fails to load a dll module, the message says · d6179e12
    Amaury Forgeot d'Arc authored
    "error code 193" instead of a more informative text.
    
    It turns out that FormatMessage needs additional parameters for some error codes.
    For example: 193 means "%1 is not a valid Win32 application".
    Since it is impossible to know which parameter to pass, we use
    FORMAT_MESSAGE_IGNORE_INSERTS to get the raw message, which is still better
    than the number.
    
    Also use the Unicode version of the API, to deal with accented letters.
    d6179e12
dynload_win.c 7.32 KB