public class LocalMemoryBlock extends Handle
HLOCAL native type.INFINITE_TIMEOUT, INVALID_HANDLE_VALUE, STATUS_ABANDONED_WAIT_0, STATUS_TIMEOUT, STATUS_WAIT_0| Constructor and Description |
|---|
LocalMemoryBlock()
Creates a LocalMemoryBlock object.
|
LocalMemoryBlock(Handle handle)
Creates a LocalMemoryBlock object that references the memory that handles references.
|
LocalMemoryBlock(int size,
MemoryAllocationAttributes attributes)
Allocates a local memory block of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
free()
Frees the allocated memory.
|
static void |
localFree(com.jniwrapper.Parameter localMemoryBlock)
Frees the allocated memory.
|
Handle |
lock()
Locks the memory block and returns a pointer to the allocated memory.
|
int |
size()
Returns the size of the allocated memory block.
|
int |
unlock()
Decrements the lock count for the memory block.
|
clone, closeHandle, equals, waitFor, waitForasFunction, asFunction, asTypedPointer, castTo, castTo, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, writepublic LocalMemoryBlock()
public LocalMemoryBlock(Handle handle)
handle - handle to the local memory blockpublic LocalMemoryBlock(int size,
MemoryAllocationAttributes attributes)
size - the size of the allocated memoryattributes - allocation attributespublic void free()
java.lang.RuntimeException - if failed to free the memory block.public static void localFree(com.jniwrapper.Parameter localMemoryBlock)
java.lang.RuntimeException - if failed to free the memory block.public int size()
public Handle lock()
public int unlock()
GetLastError function returns NO_ERROR, the memory block is unlocked.