Supporting Searches in Message Store Providers

Client applications frequently have some user interface components devoted to searching for messages within a message store. Search criteria are specified within the IMAPIContainer interface by means of the IMAPIContainer::SetSearchCriteria and IMAPIContainer::GetSearchCriteria methods.

Clients use the message store object's PR_FINDER_ENTRYID property to identify the root folder in the message store that contains folders for search results. The search-results folder is often a folder at the top level of the message store that is not part of the IPM folder tree and is therefore hidden.

Whether your message store provider uses a permanent search-results folder or creates one when a client opens the entry identifier stored in the PR_FINDER_ENTRYID property is an implementation detail. It is somewhat easier for your message store provider to use a permanent folder that is created when the message store is created, because doing so avoids the complication of checking the entry identifier whenever any folder is opened to see whether to create a search-results folder. However, not all message store providers can do that; notably, read-only message stores or stores that provide a MAPI interface to a legacy database often are not allowed or are unable to create a permanent search-results folder in the underlying storage mechanism.