2.2.4 Search Folder Definition Messages and Search Folder Containers

A search folder exists only if it has a search folder definition message. Each search folder definition message has a GUID, which is stored in the PidTagSearchFolderId property (section 2.2.1.2.1). This GUID is fixed and MUST NOT change. A search folder container also has a GUID, which is stored in the SearchFolderID subproperty of the PidTagExtendedFolderFlags property (section 2.2.2.1.2). A search folder definition message is associated with a search folder container only if their GUIDs match. If both the search folder container and the search folder definition message exist with matching GUIDs, the search folder is active. If the search folder container does not exist, the search folder is inactive. The client can make an inactive search folder active by creating the search folder container as specified in section 3.1.4.1.2.

Any update of a search folder definition message requires the search folder container to be synchronized with its search folder definition message. A search folder container is synchronized with its search folder definition message only if the folder's 4-byte tag, which is stored in the SearchFolderTag subproperty (section 2.2.2.1.2), is equal to the value of the PidTagSearchFolderTag property (section 2.2.1.2.3). For details about how a client can modify a search folder, see section 3.1.4.3.

The relationship between a search folder definition message and its search folder container is summarized in the following table.

Item

Search folder definition message

Search folder container

Explanation

GUID

The PidTagSearchFolderId property (section 2.2.1.2.1) contains the GUID.

The Data field of the SearchFolderID subproperty (section 2.2.2.1.2) contains the GUID.

The GUIDs MUST match to tie the search folder definition message to the search folder container.

Tag

The PidTagSearchFolderTag property (section 2.2.1.2.3) contains the tag.

The Data field of the SearchFolderTag subproperty (section 2.2.2.1.2) contains the tag.

The tags MUST match to synchronize the search folder container with the current search folder definition message.