Browse - Programming Tips - How is the INVALID_HANDLE_VALUE defined?

Date: 2014may5
Language: Java
Keywords: JNA, win32

Q.  How is the INVALID_HANDLE_VALUE defined?

A.

/** Constant value representing an invalid HANDLE. */ public HANDLE INVALID_HANDLE_VALUE = new HANDLE() { { super.setPointer(Pointer.createConstant(-1)); } public void setPointer(Pointer p) { throw new UnsupportedOperationException("Immutable reference"); } };