Win32Exception (JNA API)
Description: declaration: package: com.sun.jna.platform.win32, class: Win32Exception

Package com.sun.jna.platform.win32

# Class Win32Exception

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.sun.jna.LastErrorException
com.sun.jna.platform.win32.Win32Exception

All Implemented Interfaces:
  `Serializable`

public class Win32Exception extends LastErrorException
Win32 exception.

Author:
  dblock[at]dblock[dot]org
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `Win32Exception(int code)`
  New Win32 exception from an error code, usually obtained from `GetLastError.`
  `protected`
  `Win32Exception(int code, WinNT.HRESULT hr)`
  `protected`
  `Win32Exception(int code, WinNT.HRESULT hr, String msg)`
  ``
  `Win32Exception(WinNT.HRESULT hr)`
  New Win32 exception from HRESULT.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `(package private) void`
  `addSuppressedReflected(Throwable exception)`
  `WinNT.HRESULT`
  `getHR()`
  Returns the error code of the error.

  ### Methods inherited from class com.sun.jna.LastErrorException

  `getErrorCode`

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

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- ## Constructor Details

  - ### Win32Exception

    public Win32Exception(int code)
    New Win32 exception from an error code, usually obtained from `GetLastError.`
    Parameters:
      `code` - Error code.

  - ### Win32Exception

    public Win32Exception(WinNT.HRESULT hr)
    New Win32 exception from HRESULT.
    Parameters:
      `hr` - HRESULT

  - ### Win32Exception

    protected Win32Exception(int code, WinNT.HRESULT hr)

  - ### Win32Exception

    protected Win32Exception(int code, WinNT.HRESULT hr, String msg)

- ## Method Details

  - ### getHR

    public WinNT.HRESULT getHR()
    Returns the error code of the error.
    Returns:
      HRESULT value

  - ### addSuppressedReflected

    void addSuppressedReflected(Throwable exception)