我们如何在.lib项目中使用Windows事件跟踪(ETW)? [英] How can we use Event Tracing for Windows (ETW) in .lib projects?

查看:91
本文介绍了我们如何在.lib项目中使用Windows事件跟踪(ETW)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在开发一个.lib文件,该文件已扩展为供不同的应用程序甚至驱动程序使用。我想知道在这种情况下,我应该如何使用ETW机制进行跟踪?特别是,我想使用基于清单的ETW。我的第一个问题
是:

Hi there, I am developing a .lib file, which is extended to be used by different applications or even drivers. I wonder in this case, how should I use the ETW mechanism for traces? Particularly, i would like to use manifest-based ETW. The first question come in my way is that:

1。如何确定清单文件中的resourceFileName?

1. How to decide the resourceFileName in the manifest file?

例如,我需要在清单文件的开头定义两个元素:

For example, I need to define the two elements in the beginning of my manifest file:

resourceFileName =" xx",

resourceFileName="xx",

messageFileName =" xx"

messageFileName="xx"

我不知道如何将此更正确。从我能找到的所有例子中,它都固定为

I have no idea how I should put this correct. From all the examples I can find, it's all fixed as

resourceFileName ="%WinDir%\ System32 \Drivers\xx.sys" 

resourceFileName="%WinDir%\System32\Drivers\xx.sys" 

resourceFileName ="%WinDir%\ System32 \ xxxx"

resourceFileName="%WinDir%\System32\xx.dll"

但是我的问题是,输出二进制是不确定的。所以我在这里很困惑。

But the problem in my case is, the output binary is undetermined. So I am confused here.

提前感谢您的帮助!

推荐答案

您好liuchang.ee,

Hello liuchang.ee,

>>但我的问题是,输出二进制文件未确定。所以我在这里感到困惑。

>>But the problem in my case is, the output binary is undetermined. So I am confused here.

%windir%是在系统级别定义的路径。输出目录的位置无关紧要。它应该总是指向同一个地方(意味着它不是相对路径)。然后为该特定机器设置%windir%的路径。

The %windir% is a path defined at system level. It should not matter where your output directory is. It should always point to the same place(meaning it is not relative path). Then path of %windir% is set for that particular machine.

请参阅:
文件系统重定向器
还  向内核模式驱动程序添加事件跟踪

Please see: File System Redirector also Adding Event Tracing to Kernel-Mode Drivers

如果我误解了某些内容,请告诉我。

Let me know if I misunderstood something.

有问候,

Krunal Parekh

Krunal Parekh


这篇关于我们如何在.lib项目中使用Windows事件跟踪(ETW)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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