Added code to detect if running on 64bit Windows to the Win32NetBIOS static initializer method and load the appropriate DLL.

Added the X64 utility class, currently just has a method for detecting 64bit Windows.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2627 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-04-06 08:50:45 +00:00
parent 166de93b48
commit fe6fec12bc
2 changed files with 77 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import java.util.Hashtable;
import org.alfresco.filesys.netbios.NetBIOSName;
import org.alfresco.filesys.util.DataBuffer;
import org.alfresco.filesys.util.IPAddress;
import org.alfresco.filesys.util.X64;
/**
* Win32 NetBIOS Native Call Wrapper Class
@@ -696,15 +697,23 @@ public class Win32NetBIOS
*/
static
{
// Check if we are running under 64 bit Windows
String dllName = "Win32NetBIOS";
if ( X64.isWindows64())
dllName = "Win32NetBIOSx64";
// Load the Win32 NetBIOS interface library
try
{
System.loadLibrary("Win32NetBIOS");
System.loadLibrary( dllName);
}
catch (Throwable ex)
{
ex.printStackTrace();
// Save the native code load exception
m_loadDLLException = ex;