com.sun.jna.win32.W32APIOptions Java Examples

The following examples show how to use com.sun.jna.win32.W32APIOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecureStorageWindowsManager.java    From snowflake-jdbc with Apache License 2.0 5 votes vote down vote up
public static Advapi32Lib getInstance()
{
  if (INSTANCE == null)
  {
    synchronized (Advapi32LibManager.class)
    {
      if (INSTANCE == null)
      {
        INSTANCE = (Advapi32Lib) Native.loadLibrary("advapi32", Advapi32Lib.class, W32APIOptions.UNICODE_OPTIONS);
      }
    }
  }
  return INSTANCE;
}
 
Example #2
Source File: KernelController.java    From Spark-Reader with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Internal function. Ensures kernel libraries are loaded if possible.
 */
private static void attemptLoad()
{
    if(attemptedLoad)return;
    try
    {
        kernel32 = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.UNICODE_OPTIONS);
        user32 = (User32) Native.loadLibrary("user32", User32.class, W32APIOptions.UNICODE_OPTIONS);
    }catch(UnsatisfiedLinkError ignored)
    {
        System.out.println("Native libraries not available");
    }
    attemptedLoad = true;
}
 
Example #3
Source File: VirtualMachine.java    From byte-buddy with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new connection factory for Windows using JNA.
 */
@SuppressWarnings("deprecation")
public Factory() {
    library = Native.loadLibrary("kernel32", WindowsLibrary.class, W32APIOptions.DEFAULT_OPTIONS);
    attachLibrary = Native.loadLibrary(System.getProperty(LIBRARY_NAME, "attach_hotspot_windows"), WindowsAttachLibrary.class);
}
 
Example #4
Source File: VirtualMachine.java    From byte-buddy with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new connector for a Windows environment using JNA.
 */
@SuppressWarnings("deprecation")
public ForJnaWindowsEnvironment() {
    library = Native.loadLibrary("kernel32", WindowsLibrary.class, W32APIOptions.DEFAULT_OPTIONS);
}