TdhEnumerateProviders function

Retrieves a list of providers that have registered a MOF class or manifest file on the computer.

Syntax


ULONG __stdcall TdhEnumerateProviders(
  _Out_   PPROVIDER_ENUMERATION_INFO pBuffer,
  _Inout_ ULONG                      *pBufferSize
);

Parameters

pBuffer [out]

Array of providers that publicly define their events on the computer. For details, see the PROVIDER_ENUMERATION_INFO structure.

pBufferSize [in, out]

Size, in bytes, of the pBuffer buffer. If the function succeeds, this parameter receives the size of the buffer used. If the buffer is too small, the function returns ERROR_INSUFFICIENT_BUFFER and sets this parameter to the required buffer size. If the buffer size is zero on input, no data is returned in the buffer and this parameter receives the required buffer size.

Return value

Returns ERROR_SUCCESS if successful. Otherwise, this function returns one of the following return codes in addition to others.

Return codeDescription
ERROR_INSUFFICIENT_BUFFER

The size of the pBuffer buffer is too small. Use the required buffer size set in pBufferSize to allocate a new buffer.

ERROR_INVALID_PARAMETER

One or more of the parameters is not valid.

 

Remarks

Because the number of registered event providers may fluctuate between calls to this function, you should place this function in a loop that loops until the returned value is no longer ERROR_INSUFFICIENT_BUFFER.

Examples

For an example that shows how to enumerate providers, see Enumerating Providers.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Tdh.h

Library

Tdh.lib

DLL

Tdh.dll

See also

TdhEnumerateProviderFieldInformation

 

 

Show: