BOOL GetOverlappedResult(hFile, lpo, lpcbTransfer, fWait) | |||
HANDLE hFile; | |||
LPOVERLAPPED lpo; | |||
LPDWORD lpcbTransfer; | |||
BOOL fWait; |
The GetOverlappedResult function returns the result of the last operation that used lpo and returned ERROR_IO_PENDING.
hFile
Supplies the open handle to the file that the overlapped structure lpo was supplied to ReadFile, WriteFile, ConnectNamedPipe or TransactNamedPipe.
lpo
Points to an OVERLAPPED structure previously supplied to ReadFile, WriteFile, ConnectNamedPipe or TransactNamedPipe. The OVERLAPPED structure has the following form:
typedef struct _OVERLAPPED { /* o */
DWORD Internal;
DWORD InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
} OVERLAPPED;
typedef OVERLAPPED *LPOVERLAPPED;
lpcbTransfer
Returns the number of bytes transferred by the operation.
fWait
A boolean value that affects the behavior when the operation is still in progress. If TRUE and the operation is still in progress, GetOverlappedResult will wait for the operation to complete before returning. If FALSE and the operation is incomplete, GetOverlappedResult will return FALSE. In this case the extended error information available from the GetLastError function will be set to ERROR_IO_INCOMPLETE.
The return value is TRUE if the function is successful. Otherwise, it is FALSE in which case extended error information is available from the GetLastError function.
GetOverlappedResult waits on the event specified by the hEvent member of the OVERLAPPED structure. If hEvent is null, GetOverlappedResult waits on hFile.
If hEvent refers to an auto-reset event, the caller must not wait on the event after initiating the transfer until GetOverlappedResult is called. Otherwise the caller's wait would reset the event to the not-signalled state, causing GetOverlappedResult to block indefinitely.
GetLastError, CreateEvent, OVERLAPPED