网站首页  词典首页

请输入您要查询的函数:

 

术语 registertraceguids
释义 RegisterTraceGuids
语法:
C++
ULONG RegisterTraceGuids(
__in WMIDPREQUEST RequestAddress,
__in PVOID RequestContext,
__in LPCGUID ControlGuid,
__in ULONG GuidCount,
__inout PTRACE_GUID_REGISTRATION TraceGuidReg,
__in LPCTSTR MofImagePath,
__in LPCTSTR MofResourceName,
__out PTRACEHANDLE RegistrationHandle
);
RegisterTraceGuids功能
该RegisterTraceGuids函数注册一个事件跟踪提供程序和事件跟踪的类,它用来生成事件。此功能还指定函数的提供者用来启用和禁用跟踪。
参数
RequestAddress [in]
指针ControlCallback函数,接到通知时,提供程序启用或由一个跟踪会话事件禁用。该EnableTrace函数调用回调。
请求上下 [in]
指向一个可选的提供者定义的情况下,ETW由RequestAddress传递给指定的函数。
ControlGuid [in]
注册的GUID供应商。
GuidCount [in]
在数量TraceGuidReg数组元素。如果TraceGuidReg为NULL,则设置为0参数。
TraceGuidReg [ in , out ]
指针的TRACE_GUID_REGISTRATION结构的数组。确定了每个元素的事件类别的供应商提供。
在输入,每个结构的Guid成员包含一个事件跟踪类GUID的注册供应商分配。类的GUID标识的事件类别的供应商提供。供应商使用相同的类GUID来设置EVENT_TRACE_HEADER的Guid成员在调用函数的TraceEvent记录事件。
在输出,RegHandle成员收到的句柄事件的类GUID注册。如果提供程序调用TraceEventInstance功能,使用TRACE_GUID_REGISTRATION RegHandle成员设置EVENT_INSTANCE_HEADER RegHandle成员。
此参数可以是NULL如果提供程序调用函数只TraceEvent记录事件。如果提供的功能调用TraceEventInstance记录事件,该参数不能为NULL。
MofImagePath [in]
此参数不支持,设置为NULL。您应该使用Mofcomp.exe登记在您的应用程序的安装财政部资源。有关更多信息,请参阅,发布您的活动模式。
带有SP1的Windows XP,Windows XP和Windows 2000中:指向一个可选字符串,指定DLL或可执行程序,其中包含由MofResourceName指定的资源的路径。此参数可以是NULL如果事件提供者和消费者使用的另一种机制,分享有关该事件的跟踪信息的提供者使用的类。
MofResourceName [in]
此参数不支持,设置为NULL。您应该使用Mofcomp.exe登记在您的应用程序的安装财政部资源。有关更多信息,请参阅,发布您的活动模式。
带有SP1的Windows XP,Windows XP和Windows 2000中:指向一个可选的字符串,它指定了MofImagePath字符串资源。该字符串资源包含的二进制文件的财政部文件描述事件跟踪由提供者支持类的名称。
RegistrationHandle [out]
指针供应商的登记处理。使用此处理当您调用UnregisterTraceGuids功能。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是系统错误代码之一。下表列出了一些常见的错误及其原因。
注意:此函数可以返回从ControlCallback返回值如果一个控制器调用EnableTrace,使供应商和供应商还没有所谓的RegisterTraceGuids。如果发生这种情况,RegisterTraceGuids将返回返回值的回调,如果注册成功。
返回codeDescription
以下ERROR_INVALID_PARAMETEROne是正确的:
RequestAddress为NULL。
ControlGuid为NULL。
RegistrationHandle为NULL。
Windows XP和Windows 2000:TraceGuidReg为NULL或GuidCount小于或等于零。
备注
供应商调用这个函数。
如果提供的ControlGuid以前已注册并启用,随后注册引用同一ControlGuid自动启用。
一个进程可以登记多达1024个供应商的GUID,但是,您应该限制供应商的数量,您的过程注册一个或两个。此限制包括注册使用这个函数和EventRegister功能的。
在此之前的Windows Vista:没有对供应商的一个进程可以注册数量限制。
实例
举一个例子,它使用RegisterTraceGuids,请注册一个事件跟踪提供程序。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesRegisterTraceGuidsW(Unicode)和RegisterTraceGuidsA(ANSI)的
参见
EnableTrace
UnregisterTraceGuids
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==RegisterTraceGuids Function
The RegisterTraceGuids function registers an event trace provider and the event trace classes that it uses to generate events. This function also specifies the function the provider uses to enable and disable tracing.
Syntax
C++
ULONG RegisterTraceGuids(
__in WMIDPREQUEST RequestAddress,
__in PVOID RequestContext,
__in LPCGUID ControlGuid,
__in ULONG GuidCount,
__inout PTRACE_GUID_REGISTRATION TraceGuidReg,
__in LPCTSTR MofImagePath,
__in LPCTSTR MofResourceName,
__out PTRACEHANDLE RegistrationHandle
);
Parameters
RequestAddress [in]
Pointer to a ControlCallback function that receives notification when the provider is enabled or disabled by an event tracing session. The EnableTrace function calls the callback.
RequestContext [in]
Pointer to an optional provider-defined context that ETW passes to the function specified by RequestAddress.
ControlGuid [in]
GUID of the registering provider.
GuidCount [in]
Number of elements in the TraceGuidReg array. If TraceGuidReg is NULL, set this parameter to 0.
TraceGuidReg [in, out]
Pointer to an array of TRACE_GUID_REGISTRATION structures. Each element identifies a category of events that the provider provides.
On input, the Guid member of each structure contains an event trace class GUID assigned by the registering provider. The class GUID identifies a category of events that the provider provides. Providers use the same class GUID to set the Guid member of EVENT_TRACE_HEADER when calling the TraceEvent function to log the event.
On output, the RegHandle member receives a handle to the event's class GUID registration. If the provider calls the TraceEventInstance function, use the RegHandle member of TRACE_GUID_REGISTRATION to set the RegHandle member of EVENT_INSTANCE_HEADER .
This parameter can be NULL if the provider calls only the TraceEvent function to log events. If the provider calls the TraceEventInstance function to log events, this parameter cannot be NULL.
MofImagePath [in]
This parameter is not supported, set to NULL. You should use Mofcomp.exe to register the MOF resource during the setup of your application. For more information see, Publishing Your Event Schema .
Windows XP with SP1, Windows XP, and Windows 2000: Pointer to an optional string that specifies the path of the DLL or executable program that contains the resource specified by MofResourceName. This parameter can be NULL if the event provider and consumer use another mechanism to share information about the event trace classes used by the provider.
MofResourceName [in]
This parameter is not supported, set to NULL. You should use Mofcomp.exe to register the MOF resource during the setup of your application. For more information see, Publishing Your Event Schema.
Windows XP with SP1, Windows XP, and Windows 2000: Pointer to an optional string that specifies the string resource of MofImagePath. The string resource contains the name of the binary MOF file that describes the event trace classes supported by the provider.
RegistrationHandle [out]
Pointer to the provider's registration handle. Use this handle when you call the UnregisterTraceGuids function.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is one of the system error codes . The following table includes some common errors and their causes.
Note This function can return the return value from ControlCallback if a controller calls EnableTrace to enable the provider and the provider has not yet called RegisterTraceGuids. When this occurs, RegisterTraceGuids will return the return value of the callback if the registration was successful.
Return codeDescription
ERROR_INVALID_PARAMETEROne of the following is true:
RequestAddress is NULL.
ControlGuid is NULL.
RegistrationHandle is NULL.
Windows XP and Windows 2000: TraceGuidReg is NULL or GuidCount is less than or equal to zero.

Remarks
Providers call this function.
If the provider's ControlGuid has been previously registered and enabled, subsequent registrations that reference the same ControlGuid are automatically enabled.
A process can register up to 1,024 provider GUIDs; however, you should limit the number of providers that your process registers to one or two. This limit includes those registered using this function and the EventRegister function.
Prior to Windows Vista: There is no limit to the number of providers that a process can register.
Examples
For an example that uses RegisterTraceGuids, see Registering an Event Trace Provider .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesRegisterTraceGuidsW (Unicode) and RegisterTraceGuidsA (ANSI)
See Also
EnableTrace
UnregisterTraceGuids
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364105(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:30:39