大网数据广告活动
性能与资源

Writing Related Events in a Classic Provider

· 52CE 我爱测

Classic providers use the TraceEventInstance function to trace events that are part of a single transaction. You can also use this function to trace parent/child events.

Classic providers use the TraceEventInstance function to trace events that are part of a single transaction. You can also use this function to trace parent/child events.

Before calling the TraceEventInstance function, you must first call the CreateTraceInstanceId function to obtain a transaction identifier. This function generates a unique transaction identifier, and maps it to a registered class GUID handle. The handles for registered class GUIDs are available in the RegHandle members of TRACE_GUID_REGISTRATION structures, after calling the RegisterTraceGuids function. The transaction identifier is placed in the InstanceId member of an EVENT_INSTANCE_INFO structure that you pass to the CreateTraceInstanceId function.

The EVENT_INSTANCE_HEADER structure that is passed to the TraceEventInstance function is similar to the EVENT_TRACE_HEADER structure (see Tracing Events), except that it contains additional information relating to instances, and does not contain a Guid member.

Event instances can be used to establish a hierarchical relationship between events. The TraceEventInstance function accepts instance-specific information from two event instances. The pInstInfo parameter points to the EVENT_INSTANCE_INFO structure of the event instance, and the pParentInstInfo parameter points to the EVENT_INSTANCE_INFO structure of a parent event instance. The definition of a "parent" event instance is application-defined; the parent can be any instance that has already been generated.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。