FinishAsyncLoadFile

Finalizes an async file load operation.

Synopsis

Err FinishAsyncLoadFile (LoadFileInfo *lf, Err loadStatus)

Description

Releases resources no longer needed after completion of an async file load, leaving just the file data in the buffer (if the load was successful).

If you received I/O completion nofitication via message, call this function passing ioreqPtr->io_Error as the loadStatus value and ioreqPtr->io_User as the LoadFileInfo pointer. If you detected I/O completion using CheckAsyncLoadFile(), pass the return value from that function as the loadStatus value.

If the loadStatus value is negative and a buffer was automatically allocated by AsyncLoadFile() this function frees the buffer. It release other resources (IOReq, etc.) in all cases.

Arguments

lf
Pointer to the LoadFileInfo structure for the load operation.
loadStatus
Status returned by CheckAsyncLoadFile() or contained in the I/O completion message you received.

Return Value

Returns the loadStatus value you passed in.

Implementation

Library call implemented in lib3do.lib.

Associated Files

lib3do.lib, blockfile.h

See Also

AsyncLoadFile