From b1be10c6b8e7aded4883060f5f0c3ede8b869c69 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 5 Jun 2009 03:15:12 +0000 Subject: Adding debug flag to native dynamic linker git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/branches/JOGL_2_SANDBOX@141 a78bb65f-1512-4460-ba86-f6dc96a7bf27 --- .../com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java') diff --git a/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java b/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java index 45cb289..325078b 100755 --- a/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java +++ b/src/java/com/sun/gluegen/runtime/WindowsDynamicLinkerImpl.java @@ -22,13 +22,19 @@ public class WindowsDynamicLinkerImpl implements DynamicLinker // --- Begin CustomJavaCode .cfg declarations - public long openLibraryLocal(String libraryName) { + public long openLibraryLocal(String libraryName, boolean debug) { // How does that work under Windows ? - return LoadLibraryW(libraryName); + // Don't know .. so it's an alias for the time being + return openLibraryGlobal(libraryName, debug); } - public long openLibraryGlobal(String libraryName) { - return LoadLibraryW(libraryName); + public long openLibraryGlobal(String libraryName, boolean debug) { + long handle = LoadLibraryW(libraryName); + if(0==handle && debug) { + int err = GetLastError(); + System.err.println("LoadLibraryW \""+libraryName+"\" failed, error code: 0x"+Integer.toHexString(err)+", "+err); + } + return handle; } public long lookupSymbol(long libraryHandle, String symbolName) { -- cgit v1.2.3