I index office documents in my application (MS Office 03, 07). If you load an IFilter using a specific file, everything is OK, the filter works as it should:
HRESULT hr_f = LoadIFilter(filename, 0, (void **)&pFilter); However, initialization from the buffer:
HRESULT hr_ss = BindIFilterFromStream(spStream, 0, (void **)&pFilter); returns E_FAIL , and pFilter , of course, does not work. IStream from IStream , methods implemented, the main thing that is needed to initialize the desired plug-in, I suspect, is created in the method:
HRESULT StreamFilter::Stat(STATSTG * pstatstg, DWORD grfStatFlag) { //Microsoft Office Ifilter from Windows Registry const IID CLSID_IFilter = { 0xf07f3920, 0x7b8c, 0x11cf, { 0x9b, 0xe8, 0x00, 0xaa, 0x00, 0x4b, 0x99, 0x86 } //{f07f3920-7b8c-11cf-9be8-00aa004b9986} }; LARGE_INTEGER pSize; int fl = GetFileSizeEx(_hFile, &pSize); memset(pstatstg, 0, sizeof(STATSTG)); pstatstg->clsid = CLSID_IFilter; pstatstg->type = STGTY_STREAM; pstatstg->cbSize.QuadPart = pSize.QuadPart; return S_OK; } pstatstg tried different variants of initialization of the pstatstg structure, everything is useless ... After calling this method, judging by the call stack it goes to query.dll and from there I get E_FAIL . I can not imagine what else might be needed.
There is a similar question, Using IFilter in C # , and the method described for * .pdf really works in pluses. But unfortunately for MSO is not suitable.