网站首页  词典首页

请输入您要查询的函数:

 

术语 traceeventinstance
释义 TraceEventInstance
语法:
C++
ULONG TraceEventInstance(
__in TRACEHANDLE SessionHandle,
__in PEVENT_INSTANCE_HEADER EventTrace,
__in PEVENT_INSTANCE_INFO pInstInfo,
__in PEVENT_INSTANCE_INFO pParentInstInfo
);
TraceEventInstance功能
该TraceEventInstance函数将事件发送到一个事件跟踪会话。事件使用一个实例标识符关联的事件与交易。此功能也可用于跟踪相关的活动之间的等级关系。
参数
SessionHandle [in]
句柄事件跟踪会话记录事件实例。提供者获得的处理要求时,在其ControlCallback执行GetTraceLoggerHandle功能。
EventTrace [in]
指针的EVENT_INSTANCE_HEADER结构。事件的具体数据是选择附加到结构。最大的一次活动就可以登录是64K。您必须指定为EVENT_INSTANCE_HEADER结构的下列成员的值。
大小

RegHandle
取决于您的信息提供者提供的复杂性,您也应该考虑,指定以下成员的值。
Class.Type
Class.Level
要跟踪有关的事件之间的等级关系,还成立了ParentRegHandle成员。
pInstInfo [in]
指针的EVENT_INSTANCE_INFO结构,其中包含此事件跟踪类和实例标识符登记处理。使用CreateTraceInstanceId函数来初始化结构。
pParentInstInfo [in]
指针的EVENT_INSTANCE_INFO结构,它包含父事件跟踪类及其实例标识符登记处理。使用CreateTraceInstanceId函数来初始化结构。设置为NULL,如果您不是跟踪层次的关系。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是系统错误代码之一。下表列出了一些常见的错误及其原因。
返回codeDescription
ERROR_INVALID_FLAGSThe旗帜的EVENT_INSTANCE_HEADER成员不包含WNODE_FLAG_TRACED_GUID。
ERROR_OUTOFMEMORYThere足够的内存来完成函数调用。为此错误代码的原因是将在以下备注部分。
以下ERROR_INVALID_PARAMETEROne是正确的:
EventTrace为NULL。
pInstInfo为NULL。
对pInstInfo成员为NULL。
SessionHandle为NULL。
该EVENT_INSTANCE_HEADER大小的成员是不正确的。
ERROR_INVALID_HANDLESessionHandle是无效的,或者指定的NT内核记录器会处理。
ERROR_NOT_ENOUGH_MEMORYThe会议跑出可用缓冲区进行写入。这期间发生的事件发生率高,因为磁盘子系统超载或缓冲区的数目太少。而不是阻塞直到更多的缓冲区变得可用,TraceEvent丢弃事件。
Windows 2000和Windows XP中:不支持。
ERROR_OUTOFMEMORYThe事件被丢弃,因为,虽然缓冲池并没有达到其最大大小,没有足够的可用内存分配一个额外的缓冲,也没有提供接收缓冲区的事件。
从一个单一的事件ERROR_MORE_DATAData不能跨越多个缓冲区。阿跟踪事件仅限于事件的规模跟踪会话的减去EVENT_INSTANCE_HEADER结构大小的缓冲区。
备注
供应商调用这个函数。
之前提供者可以调用此函数,提供程序
必须调用RegisterTraceGuids函数登记本身和事件跟踪类。
必须调用CreateTraceInstanceId函数创建一个已注册的事件跟踪类的实例标识符。
必须启用。阿控制器调用EnableTrace功能,使供应商。
这次活动是可以写入日志文件,发送到事件跟踪,实时,或两者消费者。该EVENT_TRACE_PROPERTIES结构LogFileMode成员传递给StartTrace定义了事件发送。
跟踪中的顺序写的事件发生。
要跟踪事件无关,使用TraceEvent功能。
Windows XP中:不能正常工作。
实例
对于生成使用CreateTraceInstanceId和TraceEventInstance事件的相关规定,例如,见跟踪事件实例。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
参见
CreateTraceInstanceId
EVENT_INSTANCE_HEADER
EVENT_INSTANCE_INFO
RegisterTraceGuids
TraceEvent
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==TraceEventInstance Function
The TraceEventInstance function sends an event to an event tracing session. The event uses an instance identifier to associate the event with a transaction. This function may also be used to trace hierarchical relationships between related events.
Syntax
C++
ULONG TraceEventInstance(
__in TRACEHANDLE SessionHandle,
__in PEVENT_INSTANCE_HEADER EventTrace,
__in PEVENT_INSTANCE_INFO pInstInfo,
__in PEVENT_INSTANCE_INFO pParentInstInfo
);
Parameters
SessionHandle [in]
Handle to the event tracing session that records the event instance. The provider obtains the handle when it calls the GetTraceLoggerHandle function in its ControlCallback implementation.
EventTrace [in]
Pointer to an EVENT_INSTANCE_HEADER structure. Event-specific data is optionally appended to the structure. The largest event you can log is 64K. You must specify values for the following members of the EVENT_INSTANCE_HEADER structure.
Size
Flags
RegHandle
Depending on the complexity of the information your provider provides, you should also consider specifying values for the following members.
Class.Type
Class.Level
To trace hierarchical relationships between related events, also set the ParentRegHandle member.
pInstInfo [in]
Pointer to an EVENT_INSTANCE_INFO structure, which contains the registration handle for this event trace class and the instance identifier. Use the CreateTraceInstanceId function to initialize the structure.
pParentInstInfo [in]
Pointer to an EVENT_INSTANCE_INFO structure, which contains the registration handle for the parent event trace class and its instance identifier. Use the CreateTraceInstanceId function to initialize the structure. Set to NULL if you are not tracing a hierarchical relationship.
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.
Return codeDescription
ERROR_INVALID_FLAGSThe Flags member of the EVENT_INSTANCE_HEADER does not contain WNODE_FLAG_TRACED_GUID.
ERROR_OUTOFMEMORYThere was insufficient memory to complete the function call. The causes for this error code are described in the following Remarks section.
ERROR_INVALID_PARAMETEROne of the following is true:
EventTrace is NULL.
pInstInfo is NULL.
The members of pInstInfo are NULL.
SessionHandle is NULL.
The Size member of the EVENT_INSTANCE_HEADER is incorrect.
ERROR_INVALID_HANDLESessionHandle is not valid or specifies the NT Kernel Logger session handle.
ERROR_NOT_ENOUGH_MEMORYThe session ran out of free buffers to write to. This can occur during high event rates because the disk subsystem is overloaded or the number of buffers is too small. Rather than blocking until more buffers become available, TraceEvent discards the event.
Windows 2000 and Windows XP: Not supported.
ERROR_OUTOFMEMORYThe event is discarded because, although the buffer pool has not reached its maximum size, there is insufficient available memory to allocate an additional buffer and there is no buffer available to receive the event.
ERROR_MORE_DATAData from a single event cannot span multiple buffers. A trace event is limited to the size of the event tracing session's buffer minus the size of the EVENT_INSTANCE_HEADER structure.

Remarks
Providers call this function.
Before the provider can call this function, the provider
Must call the RegisterTraceGuids function to register itself and the event trace class.
Must call the CreateTraceInstanceId function to create an instance identifier for the registered event trace class.
Must be enabled. A controller calls the EnableTrace function to enable a provider.
The event is either written to a log file, sent to event trace consumers in real time, or both. The LogFileMode member of the EVENT_TRACE_PROPERTIES structure passed to the StartTrace defines where the event is sent.
The trace events are written in the order in which they occur.
To trace unrelated events, use the TraceEvent function.
Windows XP: Does not work correctly.
Examples
For an example of generating related sets of events using CreateTraceInstanceId and TraceEventInstance, see Tracing Event Instances .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
See Also
CreateTraceInstanceId
EVENT_INSTANCE_HEADER
EVENT_INSTANCE_INFO
RegisterTraceGuids
TraceEvent
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364138(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 13:21:27