Init Method
Collapse the table of content
Expand the table of content

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.


  [in]   ULONG grfFlags,
  [in]   ULONG cAttributes,
  [in]   const FULLPROPSPEC *aAttributes,
  [out]  ULONG *pFlags


grfFlags [in]

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

cAttributes [in]

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 [in]

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

pFlags [out]

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

Return value

This method can return one of these values.

Return codeDescription

The operation was completed successfully.


File to filter was not previously loaded.


Count and contents of attributes do not agree.


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


General access failures



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.


Minimum supported client

Windows 2000 Professional (desktop apps only)

Minimum supported server

Windows 2000 Server (desktop apps only)

End of client support

Windows 7

End of server support

Windows Server 2008 R2



See also




Build date: 9/10/2012

Community Additions

© 2015 Microsoft