Fixes to both versions of win_dynld.c.

This commit is contained in:
OBattler
2022-11-02 06:28:27 +01:00
parent e2391ca6ef
commit 4fb3228628
2 changed files with 32 additions and 22 deletions

View File

@@ -23,6 +23,7 @@
#include <windows.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/plat.h>
#include <86box/plat_dynld.h>
@@ -52,9 +53,11 @@ dynld_module(const char *name, dllimp_t *table)
HMODULE h;
dllimp_t *imp;
void *func;
WCHAR uname[512];
/* See if we can load the desired module. */
if ((h = LoadLibrary(name)) == NULL) {
mbstoc16s(uname, name, strlen(name) + 1);
if ((h = LoadLibrary(uname)) == NULL) {
dynld_log("DynLd(\"%s\"): library not found! (%08X)\n", name, GetLastError());
return(NULL);
}