load ssleay32.dll relative to vmcontrollib.dll
This commit is contained in:
		
							parent
							
								
									ed05e577cd
								
							
						
					
					
						commit
						95a6cfcfd9
					
				@ -35,19 +35,7 @@ abstract class VMwareObject {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private static boolean loadLibraries() {
 | 
					    private static boolean loadLibraries() {
 | 
				
			||||||
        if (SigarLoader.IS_LINUX) {
 | 
					        if (!(SigarLoader.IS_LINUX || SigarLoader.IS_WIN32)) {
 | 
				
			||||||
            if (!new File("/etc/vmware/config").exists()) {
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else if (SigarLoader.IS_WIN32) {
 | 
					 | 
				
			||||||
            try {
 | 
					 | 
				
			||||||
                System.loadLibrary("ssleay32");
 | 
					 | 
				
			||||||
            } catch (UnsatisfiedLinkError e) {
 | 
					 | 
				
			||||||
                return false;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else {
 | 
					 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -55,6 +43,27 @@ abstract class VMwareObject {
 | 
				
			|||||||
            Sigar.load();
 | 
					            Sigar.load();
 | 
				
			||||||
            String lib =
 | 
					            String lib =
 | 
				
			||||||
                VMControlLibrary.getSharedLibrary();
 | 
					                VMControlLibrary.getSharedLibrary();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (lib == null) {
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (SigarLoader.IS_WIN32) {
 | 
				
			||||||
 | 
					                File libssl =
 | 
				
			||||||
 | 
					                    new File(new File(lib).getParent(),
 | 
				
			||||||
 | 
					                             "ssleay32.dll");
 | 
				
			||||||
 | 
					                if (!libssl.exists()) {
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                try {
 | 
				
			||||||
 | 
					                    System.load(libssl.getPath());
 | 
				
			||||||
 | 
					                } catch (UnsatisfiedLinkError e) {
 | 
				
			||||||
 | 
					                    e.printStackTrace();
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return init(lib);
 | 
					            return init(lib);
 | 
				
			||||||
        } catch (Exception e) {
 | 
					        } catch (Exception e) {
 | 
				
			||||||
            //e.printStackTrace();
 | 
					            //e.printStackTrace();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user