Martin Koppmann

Hello,

Can somebody help me how to debug WDS3 PH with VS2005 (C++)

  • There are two searchprotocolhost.exe (local context and system)
    I assume that I have to attach to one of them. Which one
  • They are not running all the time.
    How do get the exe's starting so that I can attach

What is the right approach Thank you!

Martin


Re: Windows Desktop Search Development How to debug a WDS3 PH with VS2005

Eric Wolz - MSFT

Set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gathering Manager\DebugFilters to a value of one. This will stop the searchprotocolhost from shutting down when there is no more work to do.

The SYSTEM protocol host handles PH that run under the system context. This usually includes the file system PH.

The USER context protocol host handles data requiring the users data, Outlook email for example. These URLs will have the users SID value at the start of it.






Re: Windows Desktop Search Development How to debug a WDS3 PH with VS2005

Aali

I have found it useful to pop up a messagebox from my protocol handler's constructor so that I know when it is time to attach the debugger.





Re: Windows Desktop Search Development How to debug a WDS3 PH with VS2005

Martin Koppmann

Thanks thats very useful!

I did not know that services can pop-up such message boxes. I think it only works in the "FinalConstruct"

Sometimes I only heared a "bing" sound - probably from an invisible MessageBox

Last Problem: WDS does no call my CreateAccessor after construction because it always indexes "My Documents" stuff. If I uncheck this in the options and then re-start the index service "My Documents" gets added again.

Any tips how to index only my PH url, immediately!

I think it is a matter of some steps:

  • PH registration
  • clicking "re-index"
  • restarting wsearch
  • calling "WindowsSearch.exe" /startup"

I did not yet find out the right order.

Martin





Re: Windows Desktop Search Development How to debug a WDS3 PH with VS2005

Aali

A service can popup a messagebox if it has "allow service to interact with desktop" checked. It is not by default, and if it is unchecked the messagebox gets created but does not show up.

I have noticed the same problem that "My Documents" gets added even if it is unchecked. I guess it has to do something with the case when the list of indexed locations would momentarily be empty.

In the WDS SDK there is a sample called "Reindex" that shows how to initiate reindexing for certain subsets of the index.





Re: Windows Desktop Search Development How to debug a WDS3 PH with VS2005

Eric Wolz - MSFT

We aggressively add the "My Documents" scope to make your the users documents is indexed. This is something we would like to address in the next version and not be too aggressive in making sure this location is indexed. Right now, you should be able to exclude the folders right under "My Documents" if you don't want anything indexed.

Also, checking the "allow service to interact with desktop" setting on the Windows Search service is not supported and will cause issues on Vista, especially if UAC is enabled.






Re: Windows Desktop Search Development How to debug a WDS3 PH with VS2005

Aali

At least in XP (where I have developed my PH), "allow service to interact with desktop" has been extremely useful aid in debugging. It is of course clear that the setting needs not be enabled in the production environment.