4.5 WFSAsyncClose

HRESULT WFSAsyncClose( hService, hWnd, lpRequestID )

Terminates a session (a series of service requests initiated with the WFSOpen or WFSAsyncOpen function) between the application and the specified service. The asynchronous version of WFSClose.

Parameters HSERVICE hService

The service handle returned by WFSOpen or WFSAsyncOpen. Matches the close request to the open request, allowing an application to maintain several "open sessions" simultaneously.

HWND hWnd

The window handle which is to receive the completion message for this request.

LPREQUESTID lpRequestID

Pointer to the request identifier for this request (returned parameter).

Mode Asynchronous

Comments See WFSClose.

The application must call WFSFreeResult to deallocate the WFSRESULT data structure which is pointed to by the completion message. Note that a WFSRESULT structure may be returned even if the function completes with an error; see Section 3.13.

Messages WFS_CLOSE_COMPLETE

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions, indicating that the asynchronous operation was not initiated:

WFS_ERR_CONNECTION_LOST
The connection to the service is lost.
WFS_ERR_INTERNAL_ERROR
An internal inconsistency or other unexpected error occurred in the WOSA/XFS subsystem.
WFS_ERR_INVALID_HSERVICE
The hService parameter is not a valid service handle.
WFS_ERR_INVALID_HWND
The hWnd parameter is not a valid window handle.
WFS_ERR_INVALID_POINTER
A pointer parameter does not point to accessible memory.
WFS_ERR_NOT_STARTED
The application has not previously performed a successful WFSStartUp.
WFS_ERR_OP_IN_PROGRESS
A blocking operation is in progress on the thread; only WFSCancelBlockingCall and WFSIsBlocking are permitted at this time.

The following error condition can be returned via the asynchronous command completion message, as the hResult from the WFSRESULT structure.

WFS_ERR_CANCELED
The request was canceled by WFSCancelAsyncRequest.
WFS_ERR_INTERNAL_ERROR
An internal inconsistency or other unexpected error occurred in the WOSA/XFS subsystem.

See also WFSOpen, WFSDeregister