Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a 32 Bit Com Object from a 64 Bit IFilter

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.

like image 349
Jamie Avatar asked Feb 26 '23 03:02

Jamie


1 Answers

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.

like image 168
Hans Passant Avatar answered Mar 07 '23 13:03

Hans Passant