Top Description Constructors Methods
com.sun.jna.platform.win32

public abstract Class W32Errors

extends Object
implements WinError
Class Inheritance
All Implemented Interfaces
com.sun.jna.platform.win32.WinError
Imports
com.sun.jna.platform.win32.WinNT.HRESULT

Utility class for some common error functions.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final boolean

Returns:

true, if successful
FAILED
(int
the hr
hr
)

and the inverse.

public static final boolean

Returns:

true, if successful
FAILED
(WinNT.HRESULT
the hr
hr
)

Failed.

public static final int

Returns:

the int
FILTER_HRESULT_FROM_FLT_NTSTATUS
(int
the x
x
)

FACILITY_USERMODE_FILTER_MANAGER

Translation macro for converting: NTSTATUS --> HRESULT.

public static final int

Returns:

the int
HRESULT_CODE
(int
the hr
hr
)

Extract error code from HRESULT.

public static final int

Returns:

the int
HRESULT_FACILITY
(int
the hr
hr
)

Return the facility.

public static final WinNT.HRESULT

Returns:

the converted value
HRESULT_FROM_WIN32
(int
original w32 error code
x
)

Map a WIN32 error value into a HRESULT Note: This assumes that WIN32 errors fall in the range -32k to=32k.

public static short

Returns:

the short
HRESULT_SEVERITY
(int
the hr
hr
)

Return the severity.

public static int

Returns:

the int
MAKE_HRESULT
(short
the sev
sev
,
short
the fac
fac
,
short
the code
code
)

Create an HRESULT value from component pieces.

public static final int

Returns:

the int
MAKE_SCODE
(short
the sev
sev
,
short
the fac
fac
,
short
the code
code
)

Make scode.

public static final int

Returns:

the int
SCODE_CODE
(int
the sc
sc
)

Extract error code from SCODE.

public static final int

Returns:

the int
SCODE_FACILITY
(short
the sc
sc
)

Scode facility.

public static short

Returns:

the short
SCODE_SEVERITY
(short
the sc
sc
)

Scode severity.

public static final boolean

Returns:

true, if successful
SUCCEEDED
(int
the hr
hr
)

Generic test for success on any status value (non-negative numbers indicate success).

public static final boolean

Returns:

true, if successful
SUCCEEDED
(WinNT.HRESULT
the hr
hr
)

Succeeded.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

W32Errorsback to summary
public W32Errors()

Method Detail

FAILEDback to summary
public static final boolean FAILED(int hr)

and the inverse.

Parameters
hr:int

the hr

Returns:boolean

true, if successful

FAILEDback to summary
public static final boolean FAILED(WinNT.HRESULT hr)

Failed.

Parameters
hr:WinNT.HRESULT

the hr

Returns:boolean

true, if successful

FILTER_HRESULT_FROM_FLT_NTSTATUSback to summary
public static final int FILTER_HRESULT_FROM_FLT_NTSTATUS(int x)

FACILITY_USERMODE_FILTER_MANAGER

Translation macro for converting: NTSTATUS --> HRESULT.

Parameters
x:int

the x

Returns:int

the int

HRESULT_CODEback to summary
public static final int HRESULT_CODE(int hr)

Extract error code from HRESULT.

Parameters
hr:int

the hr

Returns:int

the int

HRESULT_FACILITYback to summary
public static final int HRESULT_FACILITY(int hr)

Return the facility.

Parameters
hr:int

the hr

Returns:int

the int

HRESULT_FROM_WIN32back to summary
public static final WinNT.HRESULT HRESULT_FROM_WIN32(int x)

Map a WIN32 error value into a HRESULT Note: This assumes that WIN32 errors fall in the range -32k to=32k.

Parameters
x:int

original w32 error code

Returns:WinNT.HRESULT

the converted value

HRESULT_SEVERITYback to summary
public static short HRESULT_SEVERITY(int hr)

Return the severity.

Parameters
hr:int

the hr

Returns:short

the short

MAKE_HRESULTback to summary
public static int MAKE_HRESULT(short sev, short fac, short code)

Create an HRESULT value from component pieces.

Parameters
sev:short

the sev

fac:short

the fac

code:short

the code

Returns:int

the int

MAKE_SCODEback to summary
public static final int MAKE_SCODE(short sev, short fac, short code)

Make scode.

Parameters
sev:short

the sev

fac:short

the fac

code:short

the code

Returns:int

the int

SCODE_CODEback to summary
public static final int SCODE_CODE(int sc)

Extract error code from SCODE.

Parameters
sc:int

the sc

Returns:int

the int

SCODE_FACILITYback to summary
public static final int SCODE_FACILITY(short sc)

Scode facility.

Parameters
sc:short

the sc

Returns:int

the int

SCODE_SEVERITYback to summary
public static short SCODE_SEVERITY(short sc)

Scode severity.

Parameters
sc:short

the sc

Returns:short

the short

SUCCEEDEDback to summary
public static final boolean SUCCEEDED(int hr)

Generic test for success on any status value (non-negative numbers indicate success).

Parameters
hr:int

the hr

Returns:boolean

true, if successful

SUCCEEDEDback to summary
public static final boolean SUCCEEDED(WinNT.HRESULT hr)

Succeeded.

Parameters
hr:WinNT.HRESULT

the hr

Returns:boolean

true, if successful