Fix, use library-path rather than library name for LoadLibrary
authorMichael Zucchi <notzed@gmail.com>
Tue, 16 Jul 2019 09:52:44 +0000 (19:22 +0930)
committerMichael Zucchi <notzed@gmail.com>
Tue, 16 Jul 2019 09:52:44 +0000 (19:22 +0930)
src/notzed.nativez/jni/nativez-windows.c

index ff616e9..1602c98 100644 (file)
@@ -46,9 +46,10 @@ static int fail(const char *ctx, const char *what) {
 
 int nativez_ResolveLibraries(JNIEnv *env, NZLibTable *table) {
        for (int i=0;table[i].name;i++) {
-               table[i].lib = LoadLibrary(table[i].name);
-               if (!table[i].lib && (table[i].flags & NZSO_NONCORE) == 0)
-                       return fail("open library", table[i].name);
+               table[i].lib = LoadLibrary(table[i].path);
+               if (!table[i].lib && (table[i].flags & NZSO_NONCORE) == 0) {
+                       return fail("open library", table[i].path);
+               }
        }
        return 0;
 }