Share via


XACT_GETOVERLAPPEDRESULT_CALLBACK

XACT_GETOVERLAPPEDRESULT_CALLBACK

Title-defined function called by XACT to determine the status of pending overlapped operations.

  typedef BOOL (__stdcall *XACT_GETOVERLAPPEDRESULT_CALLBACK)(
    HANDLE hFile,
    LPOVERLAPPED lpOverlapped,
    LPDWORD lpNumberOfBytesTransferred,
    BOOL bWait
);

Parameters

  • hFile
    Handle to a file. This is the handle specified when the overlapped operation was started by a call to the title's read file callback.
  • lpOverlapped
    Pointer to the OVERLAPPED structure specified when the overlapped operation was started.
  • lpNumberOfBytesTransferred
    Pointer to a variable that receives the number of bytes transferred by a read or write operation.
  • bWait
    Specifies whether the function should wait for the pending overlapped operation to be completed. If this value is TRUE, the function does not return until the operation has been completed. If this value is FALSE and the operation is still pending, the function returns FALSE and the GetLastError function returns ERROR_IO_INCOMPLETE.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

Remarks

This function is analogous to the system GetOverlappedResult function. When determining the status of pending overlapped operations, the XACT engine calls the title's overlapped result callback instead of the system GetOverlappedResult function. The advantage of registering a callback is that the title can manage XACT's disk input to prioritize it along with the game's other I/O.

The simplest implementation of this callback function is to call GetOverlappedResult and return its return value.

The XACT makes extensive use of the HasOverlappedIoCompleted macro, which references the Internal member of the OVERLAPPED structure passed in lpOverlapped. Titles must properly set this flag to indicate the status of the overlapped operation. The HasOverlappedIoCompleted macro is defined as follows:

#define HasOverlappedIoCompleted( lpOverlapped ) ( (lpOverlapped)->Internal != STATUS_PENDING )

Requirements

Header: Declared in Xact.h.

See Also

XACT Callbacks