- java.lang.Object
-
- de.ibapl.jnhw.winapi.IoAPI
-
-
Field Summary
Fields Modifier and Type Field Description static booleanHAVE_IOAPI_H
-
Constructor Summary
Constructors Constructor Description IoAPI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Winnt.HANDLECreateIoCompletionPort(Winnt.HANDLE FileHandle, Winnt.HANDLE ExistingCompletionPort, long CompletionKey, int NumberOfConcurrentThreads)CreateIoCompletionPort Creates an input/output (I/O) completion port and associates it with a specified file handle, or creates an I/O completion port that is not yet associated with a file handle, allowing association at a later time.static voidGetQueuedCompletionStatus(Winnt.HANDLE CompletionPort, IntRef lpNumberOfBytesTransferred, LongRef lpCompletionKey, ObjectRef<NativeAddressHolder> lpOverlapped, long dwMilliseconds)GetQueuedCompletionStatus Attempts to dequeue an I/O completion packet from the specified I/O completion port.static voidPostQueuedCompletionStatus(Winnt.HANDLE CompletionPort, int dwNumberOfBytesTransferred, long dwCompletionKey, Minwinbase.OVERLAPPED lpOverlapped)PostQueuedCompletionStatus Attempts to dequeue an I/O completion packet from the specified I/O completion port.
-
-
-
Method Detail
-
CreateIoCompletionPort
public static Winnt.HANDLE CreateIoCompletionPort(Winnt.HANDLE FileHandle, Winnt.HANDLE ExistingCompletionPort, long CompletionKey, int NumberOfConcurrentThreads) throws NativeErrorException
CreateIoCompletionPort Creates an input/output (I/O) completion port and associates it with a specified file handle, or creates an I/O completion port that is not yet associated with a file handle, allowing association at a later time.- Parameters:
FileHandle- An open file handle or INVALID_HANDLE_VALUE.ExistingCompletionPort- A handle to an existing I/O completion port or NULL.CompletionKey- The per-handle user-defined completion key that is included in every I/O completion packet for the specified file handle.NumberOfConcurrentThreads- The maximum number of threads that the operating system can allow to concurrently process I/O completion packets for the I/O completion port.- Returns:
- Throws:
NullPointerException- if hFile or lpBuffer isnull.NativeErrorException- if the return value of the native function indicates an error.
-
GetQueuedCompletionStatus
public static void GetQueuedCompletionStatus(Winnt.HANDLE CompletionPort, IntRef lpNumberOfBytesTransferred, LongRef lpCompletionKey, ObjectRef<NativeAddressHolder> lpOverlapped, long dwMilliseconds) throws NativeErrorException
GetQueuedCompletionStatus Attempts to dequeue an I/O completion packet from the specified I/O completion port.- Parameters:
CompletionPort- A handle to the completion port.lpNumberOfBytesTransferred- A pointer to a variable that receives the number of bytes transferred in a completed I/O operation.lpCompletionKey- A pointer to a variable that receives the completion key value associated with the file handle whose I/O operation has completed.lpOverlapped- A pointer to a variable that receives the address of the OVERLAPPED structure that was specified when the completed I/O operation was started.dwMilliseconds- The number of milliseconds that the caller is willing to wait for a completion packet to appear at the completion port.- Throws:
NullPointerException- if hFile or lpBuffer isnull.NativeErrorException- if the return value of the native function indicates an error.
-
PostQueuedCompletionStatus
public static void PostQueuedCompletionStatus(Winnt.HANDLE CompletionPort, int dwNumberOfBytesTransferred, long dwCompletionKey, Minwinbase.OVERLAPPED lpOverlapped) throws NativeErrorException
PostQueuedCompletionStatus Attempts to dequeue an I/O completion packet from the specified I/O completion port.- Parameters:
CompletionPort- A handle to an I/O completion port to which the I/O completion packet is to be posted.dwNumberOfBytesTransferred- The value to be returned through the lpNumberOfBytesTransferred parameter of the GetQueuedCompletionStatus function.dwCompletionKey- The value to be returned through the lpCompletionKey parameter of the GetQueuedCompletionStatus function.lpOverlapped- The value to be returned through the lpOverlapped parameter of the GetQueuedCompletionStatus function.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
-