IFilter Test Suite Topics | Previous

The Ifilttst.ini File

Ifilttst.ini File Overview

An IFilter object is initialized by calling IFilter::Init(). Init() takes the following parameters:

The user of the IFilter Test Suite can specify the values for these parameters in a file called Ifilttst.ini. (A sample Ifilttst.ini file is provided later in this document.)

The file is broken up into sections, with the section name enclosed in square brackets. In the example, the sections are named Test1, Test2, and so on. All section names must be unique. The test will read the values from the first section and initialize the filter with them. Then it will run all of its tests using this filter configuration. The test will then release the filter and reinitialize it, using parameters from the next section. It repeats the process until there are no more configurations left to test.

Each section contains a complete description of the parameters for IFilter::Init(). The parameters are described in separate fields, called entries.

ENTRYVALUE OF ENTRY
FlagsThe names of the IFILTER_INIT flags that are to be concatenated together (using a "bitwise or") to form the grfFlags parameter. They must be in all caps and must appear on the same line.
cAttributesA decimal integer representing the value of the cAttributes parameter.
aAttributesThe first token must be a globally unique identifier (GUID). The GUID must be formatted exactly as shown in section [Test3] in the example below. The second token may be either a propid (consisting of a number in hexadecimal notation) or a lpwstr (a pointer to a wide character string). The wide string character lpwstr can be specified by enclosing the string in double quotes (see section [Test6]).

If the Flags and cAttributes entries are not specified, they default to zero. If you set cAttributes equal to 2, you will usually want to specify 2 aAttributes; however, you do not have to. In section [Test5], cAttributes is 1, but no aAttributes have been specified. The test will then call IFilter::Init() with cAttributes equal to 1, and aAttributes equal to NULL. This is a useful test case, since it is likely to cause an access violation in IFilter::Init().

There is no entry for the pdwFlags parameter since this parameter is used solely to return a value to the caller; it does not need to have any special value prior to the call to Init().

If Ifilttst.exe cannot find a file named Ifilttst.ini in the present working directory, it uses a default configuration to initialize the filter object. Below is the default configuration:

[default]
grfFlags = IFILTER_INIT_APPLY_INDEX_ATTRIBUTES
cAttributes = 0

Sample Ifilttst.ini file

; Only extract text from the object
[Test1]
Flags = 
cAttributes = 0
; Get all attributes (text and pseudo-properties)
[Test2]
Flags = IFILTER_INIT_APPLY_INDEX_ATTRIBUTES
cAttributes = 0
; This also extracts just text from the object (the GUID is PSGUID_STORAGE,
; and the propid is PID_STG_CONTENTS)
[Test3]
Flags = IFILTER_INIT_CANON_PARAGRAPHS IFILTER_INIT_HARD_LINE_BREAKS
cAttributes = 1
aAttributes1 = b725f130-47ef-101a-a5f1-02608c9eebac 13
; Only extract requested attribute from the html object
; (the GUID corresponds to the html filter)
[Test4]
Flags = IFILTER_INIT_CANON_HYPHENS IFILTER_INIT_CANON_SPACES
cAttributes = 1
aAttributes1 = 70eb7a10-55d9-11cf-b75b-00aa0051fe20 3
; What happens if cAttributes is non-zero, but aAttributes is empty?
[Test5]
Flags = IFILTER_INIT_CANON_SPACES IFILTER_INIT_APPLY_INDEX_ATTRIBUTES IFILTER_INIT_APPLY_OTHER_ATTRIBUTES
cAttributes = 1
; Here is an attribute with a lpwstr instead of a propid
; (the lpwstr is enclosed in quotes)
; The GUID corresponds to the meta tag clsid for the HTML filter.
[Test6]
Flags =
cAttributes = 1
aAttributes1 = D1B5D3F0-C0B3-11CF-9A92-00A0C908DBF1 "GENERATOR"