Dave's Brain

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"); } };

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.