## com.sun.jna.platform.win32
Class Win32Exception

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

All Implemented Interfaces:
  java.io.Serializable

    public class Win32Exception

extends java.lang.RuntimeException

Win32 exception.

See Also:
  Serialized Form

Constructor Summary
`Win32Exception(int code)` New Win32 exception from an error code, usually obtained from GetLastError.
`Win32Exception(W32API.HRESULT hr)` New Win32 exception from HRESULT.

Method Summary
`W32API.HRESULT` `getHR()` Returns the error code of the error.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Win32Exception

    public Win32Exception(W32API.HRESULT hr)

  New Win32 exception from HRESULT.

  Parameters:
    `hr` - HRESULT

### Win32Exception

    public Win32Exception(int code)

  New Win32 exception from an error code, usually obtained from GetLastError.

  Parameters:
    `code` - Error code.

Method Detail

### getHR

    public W32API.HRESULT getHR()

  Returns the error code of the error.

  Returns:
    Error code.