Package icyllis.modernui.core

# Class Kernel32

java.lang.Object
icyllis.modernui.core.Kernel32

public class Kernel32 extends Object
Native bindings to kernel32.dll.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `Kernel32.Functions`
  Contains the function pointers loaded from the kernel32 `SharedLibrary`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `HANDLE_FLAG_INHERIT`
  `static final int`
  `HANDLE_FLAG_PROTECT_FROM_CLOSE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Kernel32()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static long`
  `AddDllDirectory(String NewDirectory)`
  Adds a directory to the process DLL search path.
  `static boolean`
  `CloseHandle(long hObject)`
  Closes an open object handle.
  `static boolean`
  `GetHandleInformation(long hObject, IntBuffer lpdwFlags)`
  Retrieves certain properties of an object handle.
  `static int`
  `GetLastError()`
  Retrieves the calling thread's last-error code value.
  `static org.lwjgl.system.SharedLibrary`
  `getLibrary()`
  Returns the kernel32 `SharedLibrary`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### HANDLE_FLAG_INHERIT

    public static final int HANDLE_FLAG_INHERIT
    See Also:
      - Constant Field Values

  - ### HANDLE_FLAG_PROTECT_FROM_CLOSE

    public static final int HANDLE_FLAG_PROTECT_FROM_CLOSE
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Kernel32

    public Kernel32()

- ## Method Details

  - ### getLibrary

    public static org.lwjgl.system.SharedLibrary getLibrary()
    Returns the kernel32 `SharedLibrary`.

  - ### CloseHandle

    public static boolean CloseHandle(long hObject)
    Closes an open object handle.
    Parameters:
      `hObject` - A valid handle to an open object.
    Returns:
      If the function succeeds, the return value is nonzero.

  - ### GetHandleInformation

    public static boolean GetHandleInformation(long hObject, IntBuffer lpdwFlags)
    Retrieves certain properties of an object handle.
    Parameters:
      `hObject` - A handle to an object whose information is to be retrieved.
      `lpdwFlags` - A pointer to a variable that receives a set of bit flags that specify properties of the object handle or 0.
    Returns:
      If the function succeeds, the return value is nonzero.

  - ### GetLastError

    public static int GetLastError()
    Retrieves the calling thread's last-error code value. The last-error code is maintained on a per-thread basis. Multiple threads do not overwrite each other's last-error code.
    Returns:
      The return value is the calling thread's last-error code.

  - ### AddDllDirectory

    public static long AddDllDirectory(String NewDirectory)
    Adds a directory to the process DLL search path.
    Parameters:
      `NewDirectory` - An absolute path to the directory to add to the search path.
    Returns:
      If the function fails, the return value is zero.