4.10 WFSExecute

HRESULT WFSExecute ( hService, dwCommand, lpCmdData, dwTimeOut, lppResult )

Sends a service-specific command to a service provider. The synchronous version of WFSAsyncExecute.

Parameters HSERVICE hService

Handle to the service as returned by WFSOpen or WFSAsyncOpen.

DWORD dwCommand

Command to be executed by the service provider.

LPVOID lpCmdData

Pointer to a command data structure to be passed to the service provider.

DWORD dwTimeOut

Number of milliseconds to wait for completion (WFS_INDEFINITE_WAIT to specify a request that will wait until completion).

LPWFSRESULT * lppResult

Pointer to the pointer to the result data structure used to return the results of the execution. The service provider allocates the memory for this structure.

Mode Synchronous

Comments This function is used to execute service-specific commands. Each class of service includes a unique set of commands for the given type of device or service; they are defined in the service-specific command specifications. Each service provider developer is responsible for recognizing the complete set of commands for a given class, even if the service provider doesn't support them all. Each command, for each service class, defines a command data structure and/or a result data structure. See the separate specifications for each service class for more discussion of these issues, and the definitions of the service-specific commands and associated data structures.

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

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions. Any service-specific errors that can be returned are defined in the specifications for each service class.

WFS_ERR_CANCELED
The request was canceled by WFSCancelBlockingCall.
WFS_ERR_CONNECTION_LOST
The connection to the service is lost.
WFS_ERR_DEV_NOT_READY
The function required device access, and the device was not ready or timed out.
WFS_ERR_HARDWARE_ERROR
The function required device access, and an error occured on the device.
WFS_ERR_INTERNAL_ERROR
An internal inconsistency or other unexpected error occurred in the WOSA/XFS subsystem.
WFS_ERR_INVALID_COMMAND
The dwCommand issued is not supported by this service class.
WFS_ERR_INVALID_DATA
The data structure passed as input parameter contains invalid data.
WFS_ERR_INVALID_POINTER
A pointer parameter does not point to accessible memory.
WFS_ERR_INVALID_HSERVICE
The hService parameter is not a valid service handle.
WFS_ERR_LOCKED
The service is locked under a different hService.
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.
WFS_ERR_SOFTWARE_ERROR
The function required access to configuration information, and an error occured on the software.
WFS_ERR_TIMEOUT
The timeout interval expired.
WFS_ERR_UNSUPP_COMMAND
The dwCommand issued, although valid for this service class, is not supported by this service provider or device.

See Also WFSAsyncExecute