Asynchronous mode is used for operations which may take an indeterminate amount of time to complete. Performing an operation in an asynchronous, as opposed to a synchronous, mode allows the application to operate in Windows' native event-driven, message-based manner. The processing of an asynchronous request (e.g., WFSAsyncExecute) is as follows:
The application calls the XFS Manager.
The XFS Manager generates a sequence number, the RequestID, assigns it to the request, and calls the service provider.
The service provider schedules the request for deferred processing and immediately returns to the XFS Manager.
The XFS Manager returns the RequestID to the application, with a status indicating that the request has been initiated and is being processed.
At some point, the service provider processes the deferred request.
On completion, the service provider posts a completion message to the window handle specified by the application in its original call. (For flexibility, an application using asynchronous functions can specify a different window for each request.) The message contains a pointer to a WFSRESULT data structure defining the results of the request, including the RequestID, the status code and the other relevant data.