Problem installing WPT manifest using wevtutil

寵の児 提交于 2019-12-04 10:35:53

I've just had exactly the same message, and struggled for an hour to resolve it, before I had a brainwave and read the error msg ;-).

The solution to my problem was simply to add the ".rc" file to my project, and then re-build. Looking back it is fairly obvious, but it had me stumped for a while.

Hope this helps.


Edit - 4th Feb Ok, not too sure if I know what your problem is, but the following batch script is how I did it all. Good luck.

rem -------------------------------------------------------------------
rem Do all of this from the project directory

rem -------------------------------------------------------------------
rem Generate Header and Resource - remove the ReadOnly attrib to "help" it along
attrib -r MyModuleTracing.h
mc.exe -um MyModuleTracing.xml
rem This generates MyModuleTracing.h and MyModuleTracing.rc, add both to your project

rem -------------------------------------------------------------------
rem ** Now build the project **
rem -------------------------------------------------------------------

rem Register MyModule Tracing with the system
if exist MyModuleTracing.xml (
  wevtutil um MyModuleTracing.xml

  copy MyModuleTracing.xml Release
  cd Release
  copy MyModule.dll %SystemRoot%\System32
  wevtutil im MyModuleTracing.xml
)

rem -------------------------------------------------------------------
rem Do a capture, and also export the results to an XML file.
xperf -start MyModuleSession -on [REPLACE_WITH_YOUR_GUID] -f MyModuleSession.etl
xperf -on base -f Kernel.etl

rem Run the app, wait until exit, and then stop the capture
start /wait MyModule.exe

xperf -stop
xperf -stop MyModuleSession
xperf -merge MyModuleSession.etl Kernel.etl MyModuleSessionMerged.etl

tracerpt MyModuleSessionMerged.etl -o MyModuleSessionMerged.xml -of XML

I had the same problem - as best I can tell, there's a directory length limit on wevtutil. When I installed the file from a directory with a shorter path, it worked.

In case anyone else comes across this, you can actually get things working from an arbitrary directory:

Add USER Read&Execute privs to a directory containing or above your project:

icacls projectdir /grant BUILTIN\Users:(OI)(CI)(RX)

Then installing the manifest should work with no errors:

wevtutil im yourmanifest.man /rf:c:\full\path\to\yourprogram.exe /mf:c:\full\path\to\yourprogram.exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!