Export (0) Print
Expand All

IFilter::Init method

Initializes a filtering session.

Syntax


SCODE Init(
  [in]   ULONG grfFlags,
  [in]   ULONG cAttributes,
  [in]   FULLPROPSPEC const *aAttributes,
  [out]  ULONG *pdwFlags
);

Parameters

grfFlags [in]

Type: ULONG

Flag settings from the IFILTER_INIT enumeration for controlling text standardization, property output, embedding scope, and IFilter access patterns.

cAttributes [in]

Type: ULONG

The size of the attribute array. When nonzero, aAttributes takes precedence over attributes specified in grfFlags.

aAttributes [in]

Type: FULLPROPSPEC const*

Pointer to an array of FULLPROPSPEC structures for the requested properties. When cAttributes is nonzero, only the properties in aAttributes are retrieved.

pdwFlags [out]

Type: ULONG*

A value from the IFILTER_FLAGS enumeration that indicates how to get additional properties that are available to the caller.

Return value

Type: SCODE

Return codeDescription
S_OK

Successful completion.

E_FAIL

The file to be filtered was not previously loaded.

E_INVALIDARG

The count and the contents of attributes do not agree.

FILTER_E_PASSWORD

Access has been denied because of password protection or other security measures.

FILTER_E_ACCESS

General access failures.

 

Remarks

The IFilter::Init method sets the state of the filter object. The content filter is positioned at the beginning of the object and the object state is frozen until the object is released. You can pass the filter object the set of properties that you want returned by setting their property set and property ID descriptions in the aAttributes array. For more information, see Returning Properties from a Filter Handler.

If no attribute flags are specified and cAttributes is zero, the filter can default to use the PSGUID_STORAGE storage property set (which contains the date and time that the file was last written to, the file size, and so on) and the PID_STG_CONTENTS "contents" property (which maps to the main contents of the file). For more information, see Property Sets.

Notes to Callers

Call the Init method before calling any other IFilter methods.

Notes to Implementers

Chunk IDs must remain consistent across multiple calls to the Init method with the same parameters.

For some implementations of the IFilter interface, it might not be possible to detect failure to access a document (or it might be computationally expensive) until after the Init method has been called, or possibly even later.

The IFilterSample code sample, available on Code Gallery and the Windows 7 SDK, demonstrates how to create an IFilter base class for implementing the IFilter interface.

For conceptual information about IFilter implementation, see Developing Filter Handlers. For information about IFilters and property handlers, see "Full-Text Support" and "Operating System Implementation Considerations" in Developing Property Handlers for Windows Search.

Important  In Windows 7 and later, filters written in managed code are explicitly blocked. Filters MUST be written in native code due to potential CLR versioning issues with the process that multiple add-ins run in.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

the Windows NT 4.0 Option Pack

Header

Filter.h

See also

Reference
FULLPROPSPEC
IFilter
IFILTER_FLAGS
IFILTER_INIT
Other Resources
PSGUID_STORAGE

 

 

Community Additions

ADD
Show:
© 2014 Microsoft