Package jtermios.windows
Class WinAPI.OVERLAPPED
- java.lang.Object
-
- com.sun.jna.Structure
-
- jtermios.windows.WinAPI.OVERLAPPED
-
- Enclosing class:
- WinAPI
public static class WinAPI.OVERLAPPED extends com.sun.jna.StructureRepresent the Windows API struct OVERLAPPED. The constructor of this class does 'this.setAutoSynch(false)' because instances of this class should not be auto synchronized nor written as a whole, because Windows stores pointers to the actual memory representing this this struct and modifies it outside the function calls and copying (writing) the Java class fields to the actual memory will destroy those structures.To set the fields it recommend to use the 'writeField(String,Object)'. It is ok to read those fields of OVERLAPPED using Java dot-notatio. that have been written by Java code, but those field that Windows modifies should be accessed using 'readField(String)' or by invoking 'read()' on the object before accessing the fields with the java dot-notation.
For example this is acceptable usage for doing overlapped I/O (except this code does no error checking!):
OVERLAPPED ovl = new OVERLAPPED(); ovl.writeField("hEvent", CreateEvent(null, true, false, null)); ResetEvent(osReader.hEvent); ReadFile(hComm, buffer, reqN, recN, ovl);- Author:
- nyholku
-
-
Field Summary
Fields Modifier and Type Field Description WinAPI.HANDLEhEventWinAPI.ULONG_PTRInternalWinAPI.ULONG_PTRInternalHighintOffsetintOffsetHigh
-
Constructor Summary
Constructors Constructor Description OVERLAPPED()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ListgetFieldOrder()StringtoString()-
Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
-
-
-
Field Detail
-
Internal
public WinAPI.ULONG_PTR Internal
-
InternalHigh
public WinAPI.ULONG_PTR InternalHigh
-
Offset
public int Offset
-
OffsetHigh
public int OffsetHigh
-
hEvent
public WinAPI.HANDLE hEvent
-
-