Using a 32-bit Com object from a 64-bit IFilter

I have an IFilter written in Delphi that I am trying to work under 64-bit Windows 7 Desktop Search.

Due to the fact that it is being developed in Delphi, I can only compile it as a 32-bit DLL.

To get around this, I am trying to write a 64-bit IFilter Dll in Visual C ++ that internally uses my 32-bit IFilter Com object using the DllSurogate technique described here .

I have everything that works OK under a test 64-bit console application. I can create an instance of my 64-bit shell, which internally creates a 32-bit IFilter object and delegates all calls to it. Then I can get the contents of my document.

The problem is that when I register with WDS, the 64-bit shell can no longer create a 32-bit object. CoCreateInstance returns "Server Runtime Error" (CO_E_SERVER_EXEC_FAILURE).

This is the one I am creating a 32-bit object on the side of the 64-bit shell

result = CoCreateInstance(clsid, 0, CLSCTX_LOCAL_SERVER , IID_IFilter, (LPVOID*)&m_pFilter); 

Any idea why this is happening. Is this a limitation of restrictions with IFilters in WDS?

Thanks for any help with this.

+4
source share
2 answers

Yes it is. IFilters are launched inside the hosting process with the name SearchFilterHost.exe. Because filters can potentially open files with malicious content, the host operates with very limited privileges. The ability to start the process, of course, will not be included. I don’t know how to redefine this, or if it is, if you even think about it. Googling "searchfilterhost.exe" causes a lot of disturbing calls. This should be painful news, sorry for the fact that they are carriers.

+7
source

Also keep in mind that the calling application does not necessarily unload your ifilter after each use. It will reuse ifilter in memory to parse many files. However, if the host process recognizes a problem (for example, a growing memory leak), it will unload your ifilter and try again. I worked with ifilter code on 32 bits a few years ago, but I was not able to solve much more stringent restrictions on 64 bits. If you learn how to do this, I hope you are ready to post the details online ...

+1
source

All Articles