Düzenle

Aracılığıyla paylaş


EvtOpenPublisherMetadata function (winevt.h)

Gets a handle that you use to read the specified provider's metadata.

Syntax

EVT_HANDLE EvtOpenPublisherMetadata(
  [in, optional] EVT_HANDLE Session,
  [in]           LPCWSTR    PublisherId,
  [in, optional] LPCWSTR    LogFilePath,
  [in]           LCID       Locale,
  [in]           DWORD      Flags
);

Parameters

[in, optional] Session

A remote session handle that the EvtOpenSession function returns. Set to NULL to get the metadata for a provider on the local computer.

[in] PublisherId

The name of the provider. To enumerate the names of the providers registered on the computer, call the EvtOpenPublisherEnum function.

[in, optional] LogFilePath

The full path to an archived log file that contains the events that the provider logged. An archived log file also contains the provider's metadata. Use this parameter when the provider is not registered on the local computer. Set to NULL when reading the metadata from a registered provider..

[in] Locale

The locale identifier to use when accessing the localized metadata from the provider. To create the locale identifier, use the MAKELCID macro. Set to 0 to use the locale identifier of the calling thread.

[in] Flags

Reserved. Must be zero.

Return value

If successful, the function returns a handle to the provider's metadata; otherwise, NULL. If NULL, call GetLastError function to get the error code.

Remarks

If you specify an archived log file, this function will check for the specified provider's metadata in the log file. If the provider's metadata is not found in the log file, the function will search for the provider in the list of registered providers on the local computer.

To read the provider's metadata, call the EvtGetPublisherMetadataProperty function. To enumerate the events that the provider defines, call the EvtOpenEventMetadataEnum function.

You must call the EvtClose function to close the metadata handle when done.

Examples

For an example that shows how to use this function, see Getting a Provider's Metadata.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winevt.h
Library Wevtapi.lib
DLL Wevtapi.dll

See also

EvtGetPublisherMetadataProperty

EvtOpenEventMetadataEnum

EvtOpenPublisherEnum