views:

111

answers:

2

I have an IFilter written in Delphi that I'm trying to get working under 64 bit Windows 7 Desktop Search.

Due to it being developed in Delphi I can only compile this as a 32 Bit DLL.

To work around this I am trying to write a 64bit IFilter Dll in Visual C++ which internally uses my 32Bit IFilter Com Object using the DllSurogate technique outlined here.

I have got all this working OK under a test 64 bit console application. I can create an instance of my 64 bit wrapper, which internally creates the 32 bit IFilter object and delegates all calls to it. I can then retrieve the contents of my document.

The problem is when I register is with WDS the 64 bit wrapper can no longer create the 32 bit object. CoCreateInstance returns 'Server Execution Failed' (CO_E_SERVER_EXEC_FAILURE).

This is who I am creating the 32 bit object in side the 64 bit wrapper

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

Any idea why this is happening. Is it a permissions limitation with IFilters in WDS?

Thanks for any help on this.

+5  A: 

Yes it is. The IFilters run inside a hosting process named SearchFilterHost.exe. Since the filters can potentially open files with malicious content, the host runs with very restricted privileges. The ability to start a process would certainly not be included. No idea how to override this, or for that matter if you should even consider doing so. Googling "searchfilterhost.exe" brings up plenty of alarm bells. That's gotta be painful news, sorry to be the bearer.

Hans Passant
Do you (or anyone else) know if SQL Server and SharePoint have the same limitations? I'm unable to test them right now and can't find any info on Google. I'm mainly doing this for SharePoint some maybe there is some hope! Otherwise I need to rethink it
Jamie
A: 

Also keep in mind the calling app will not necessary unload your ifilter after each usage. It will reuse the ifilter in memory to parse many files. However if the host process senses a problem (such as a growing memory leak) it will unload your ifilter and try again. I have worked with ifilter code on 32 bit a few years ago, but I have not been able to address the much stricter limitations on 64 bit. If you find out how this is done, I hope you are willing to post specifics on the net...

marco