如何从C ++ Windows客户端使用ETW [英] How to use ETW from a C++ windows client

查看:363
本文介绍了如何从C ++ Windows客户端使用ETW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Windows的事件跟踪(ETW),以允许用户模式的Windows客户端写出跟踪信息。现有的文件是,轻轻地,疯狂地不完整。真正有用的是一个简单的C ++示例,它使用ETW写出跟踪消息。这样的例子存在吗?是否还有其他ETW文档可以推荐?

I'm researching Event Tracing for Windows (ETW) to allow a user-mode windows client to write out tracing information. The existing documentation is, to put it lightly, insanely incomplete. What would really help is a simple C++ example that writes out tracing messages using ETW. Does such an example exist? Is there other ETW documentation you might recommend?

推荐答案

编写 提供程序 您有两个选项可以将其写为基于清单的提供程序Vista或更高版本)或传统支持的经典提供程序。如果基于清单的方法是您希望使用的方法,请查看 此处的示例 。或者,您可以在此找到 经典提供程序示例

我想你想使用基于清单的方法,因为它更好,可以支持多达8个会话。基于清单的提供程序需要做的第一步是使用注册该事件 EventRegister ,然后通过 EventWrite EventWriteString 函数。

I suppose you want to use a manifest-based approach as its better and can support up to 8 sessions. The first step for a manifest-based provider needs to do is to register the event using EventRegister and and then write to it via the EventWrite or EventWriteString function.

这篇关于如何从C ++ Windows客户端使用ETW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆