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
|
|