5.9 WFPSetTraceLevel

HRESULT WFPSetTraceLevel( hService, dwTraceLevel )

Sets the specified trace level(s) at run time, in and/or below the service provider. See WFMSetTraceLevel.

Parameters HSERVICE hService

Handle to the service provider.

DWORD dwTraceLevel

The level(s) of tracing being requested. See below.

Mode Immediate

Comments Issuing WFPSetTraceLevel for a service enables tracing on that service at various levels. The predefined trace levels that can be used in this function, with their meanings to the service provider, are as follows (see WFMSetTraceLevel for the API and support function trace levels):

 WFS_TRACE_SPI 0x00000004

Trace all the SPI calls to the service provider, and notification and event messages generated by the service provider, that are associated with the specified hService.

 WFS_TRACE_ALL_SPI 0x00000008

Trace all SPI, notification and event activity of the service provider (the hService parameter is not relevant to this trace level).

Other standard trace levels may be defined in the future, and a range of trace level values (the high order 16 bits of this parameter) is reserved for use by individual service providers. Example of other functions that may be traced include network messages, interactions between the service provider and service, and device interface interaction.

Trace level values can be ORed together in a single dwTraceLevel parameter to request more than one kind of tracing be started. A NULL value stops all tracing in the service provider.

If more than one process may be using the trace facility, this function should always be preceded with the WFMGetTraceLevel function. This value returned by this function is ORed together with the new trace level(s), and the resulting value is used with WFMSetTraceLevel, thus adding the new trace level(s) to whatever the existing trace level(s) had been,

This function has the highest priority to the service provider; it activates the trace as soon as possible.

WFPOpen also includes an option to set these trace levels, to allow the open process itself to be traced.

Error Codes If the function return is not WFS_SUCCESS, it is one of the following error conditions:

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_TRACELEVEL
The dwTraceLevel parameter does not correspond to a valid trace level or set of levels.
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.

See Also WFMGetTraceLevel, WFSOpen, WFSAsyncOpen