WsRegisterOperationForCancel function (webservices.h)

A service operation can use this function to register for a cancel notification. It is only valid to call this API when the service operation is executing. The behavior for calling it after the completion of Service Operation is not supported.

While this API is being called and the runtime has determined that the cancellation of the service operation is necessary, it can call the callback during the call to this API by the application.

The caller should therefore assume that the runtime may call on the callback WS_OPERATION_CANCEL_CALLBACK as soon as the WsRegisterOperationForCancel is called.

Syntax

HRESULT WsRegisterOperationForCancel(
  [in]           const WS_OPERATION_CONTEXT       *context,
  [in]           WS_OPERATION_CANCEL_CALLBACK     cancelCallback,
  [in, optional] WS_OPERATION_FREE_STATE_CALLBACK freestateCallback,
  [in, optional] void                             *userState,
  [in, optional] WS_ERROR                         *error
);

Parameters

[in] context

The context that the property value is being obtained for.

[in] cancelCallback

Function pointer for cancel notification function.

[in, optional] freestateCallback

A optional parameter specifying the function pointer to the free state call.

[in, optional] userState

A optional parameter specifying the application specific state which can be used to identify call data.

[in, optional] error

Specifies where additional error information should be stored if the function fails.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll