【问题标题】:How to debug a Windows Search property handler如何调试 Windows Search 属性处理程序
【发布时间】:2015-01-13 01:22:04
【问题描述】:

我正在维护一个 Windows Search 属性处理程序项目,它由 SearchFilterHost.exe 加载。不知道SearchFilterHost.exe什么时候会启动,不知道命令行参数的用法,而且我发现SearchFilterHost.exe启动后一两分钟就会退出,所以很难用调试器来附加进程调试它加载的 DLL。

如何调试 Windows Search 属性处理程序?

【问题讨论】:

  • 你有没有想过如何做到这一点?
  • @joels 还没有

标签: windows-search


【解决方案1】:

Debugging Protocol Handlers 在 MSDN 中谈到了如何做到这一点。它涉及添加注册表项以使 SearchIndexer 和 SearchFilterHost 更易于调试。您可能需要获得注册表分支的所有权才能更改这些值。只需执行第一组就足以让您能够直接附加到 SearchFilterHost。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
   Windows Search
      Gathering Manager
         DebugFilters = 1
         DisableBackOff = 1           may also be helpful

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
   Image File Execution Options
      SearchIndexer.exe
         Debugger = <path to debugger> <debugger options> 

Example using the ntsd debugger  
Debugger = C:\debuggers\ntsd.exe -odGx -c: "sxe ld mydll.dll;g"
Option  Description
-o  Tells ntsd.exe to debug child prcoesses.
-d  Pipes ntsd.exe through the kernel debugger to ensure the debugger is lauched on the right desktop (system context).
-g  Tells ntsd.exe to exit immediately when the child terminates.
-x  Disables first-chance break on access violation exceptions. The second occurrence of an access violation will break into the debugger.
-c  Sets the order of commands passed ntsd.exe.

完成设置后,重新启动 WSearch 服务,调整搜索的文件,然后事情就会发生。

另外,这是一个old thread of others' experiences。除此之外,它还谈到在项目的调试设置中使用MSDN tool IFiltTst

In your Project properties window, open ‘configuration properties’, ‘debugging’; and enter the following settings:

Debugger to launch:  Local Windows Debugger
Command: C:\<your path here>\IFiltTst.Exe
Command arguments: /i  "D:\<your project test folder>\<good file>.<extention to filter>" /v 3 /t 5 /l /d
Working directory: /i  "D:\<your project test folder>
Attach: No

Leave all other settings as default.

这两种方法都需要注册您的 DLL,以便通过搜索找到它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多