IFilter::Init method

[Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.]

Initializes a filtering session.

Syntax

SCODE Init(
  ULONG              grfFlags,
  ULONG              cAttributes,
  const FULLPROPSPEC *aAttributes,
  ULONG              *pFlags
);

Parameters

grfFlags

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

cAttributes

The size of the attributes array. When nonzero, cAttributes takes precedence over attributes specified in grfFlags. If no attribute flags are specified and cAttributes is zero, the default is given by the PSGUID_STORAGE storage property set, which contains the date and time of the last write to the file, size, and so on; and by the PID_STG_CONTENTS 'contents' property, which maps to the main contents of the file. For more information about properties and property sets, see Property Sets.

aAttributes

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

pFlags

Information about additional properties available to the caller; from the IFILTER_FLAGS enumeration.

Return Value

This method can return one of these values.

Return code Description
S_OK
The operation was completed successfully.
E_FAIL
File to filter was not previously loaded.
E_INVALIDARG
Count and contents of attributes do not agree.
FILTER_E_PASSWORD
Access has been denied because of password protection or similar security measures.
FILTER_E_ACCESS
General access failures

Remarks

The Init method sets the state of the filter object. The content filter positions 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 you would like returned by setting up their property set and property identifier (ID) descriptions in the aAttributes array. For more information, see Filtering File Properties.

Notes to Callers

Call the Init method before calling all 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, detection of failure to access a document may not be possible (or may be computationally expensive) until the Init method has been called, or possibly even later.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header filter.h

See Also

FULLPROPSPEC

IFILTER_FLAGS

IFILTER_INIT

IFilter