Condividi tramite


Funzione TraceLoggingSetInformation (traceloggingprovider.h)

Configura un provider TraceLogging chiamando EventSetInformation.

Sintassi

TLG_STATUS TraceLoggingSetInformation(
  TraceLoggingHProvider hProvider,
  EVENT_INFO_CLASS      informationClass,
  PVOID                 pvInformation,
  ULONG                 cbInformation
);

Parametri

hProvider

Gestire il provider TraceLogging da configurare. Il provider deve trovarsi nello stato registrato .

informationClass

EVENT_INFO_CLASS dell'impostazione da configurare.

pvInformation

Buffer di input con il valore dell'impostazione da configurare. Il formato di questo buffer dipende dal valore del parametro informationClass .

cbInformation

Dimensione, in byte, dei dati nel buffer di input.

Valore restituito

Se si chiama questa funzione dal codice in modalità utente, la funzione restituisce un oggetto HRESULT. Utilizzare la SUCCEEDED() macro per determinare se la funzione ha esito positivo.

Se si chiama questa funzione dal codice in modalità kernel, la funzione restituisce un oggetto NTSTATUS. Utilizzare la NT_SUCCESS() macro per determinare se la funzione ha esito positivo.

Commenti

Questa funzione funge da wrapper per la funzione EventSetInformation .

La funzione EventSetInformation non è disponibile in tutte le versioni di Windows. Il comportamento predefinito di TraceLoggingSetInformation dipende dai valori in fase di compilazione delle WINVER macro (modalità utente) o NTDDI_VERSION (modalità kernel):

  • Se la versione di destinazione di Windows (come specificato da WINVER o NTDDI_VERSION) è nota per supportare EventSetInformation , TraceLoggingSetInformation richiamerà direttamente EventSetInformation.
  • In caso contrario, TraceLoggingSetInformation userà GetProcAddress (modalità utente) o MmGetSystemRoutineAddress (modalità kernel) per individuare e richiamare EventSetInformation. In caso di errore, TraceLoggingSetInformation restituirà HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) (modalità utente) o STATUS_NOT_SUPPORTED (modalità kernel).

Per eseguire l'override del comportamento predefinito di questa funzione, definire la TLG_HAVE_EVENT_SET_INFORMATION macro prima #include <TraceLoggingProvider.h>di :

  • Se poi #define TLG_HAVE_EVENT_SET_INFORMATION 0TraceLoggingSetInformation non eseguirà alcuna operazione e restituirà HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) (modalità utente) o STATUS_ENTRYPOINT_NOT_FOUND (modalità kernel).
  • Se quindi TraceLoggingSetInformation#define TLG_HAVE_EVENT_SET_INFORMATION 1 richiamerà direttamente EventSetInformation.
  • Se quindi #define TLG_HAVE_EVENT_SET_INFORMATION 2TraceLoggingSetInformation richiamerà EventSetInformation tramite GetProcAddress (modalità utente) o MmGetSystemRoutineAddress (modalità kernel).

Per altre informazioni, vedere i commenti nell'intestazione TraceLoggingProvider.h relativa alla TLG_HAVE_EVENT_SET_INFORMATION macro.

Requisiti

Requisito Valore
Client minimo supportato Windows Vista [app desktop | App UWP]
Server minimo supportato Windows Server 2008 [app desktop | App UWP]
Intestazione traceloggingprovider.h
Libreria Advapi32.lib

Vedi anche

TraceLoggingRegister

EventSetInformation

EVENT_INFO_CLASS