Opening the Default Message Store
In any particular session, one message store acts as the default message store. A default message store has the following characteristics:
-
The PR_DEFAULT_STORE property is set to TRUE.
-
The STATUS_DEFAULT_STORE flag is set in the PR_RESOURCE_FLAGS property.
-
MAPI automatically creates the IPM subtree and the root folders for search-results, common views and personal views when the message store is opened. For more information about these folders, see IPM Subtree and Special Folders.
To retrieve the entry identifier for the default message store, you must call IMAPISession::GetMsgStoresTable to open the message store table and apply an appropriate restriction in a call to HrQueryAllRows. HrQueryAllRows will return a row set with the one row that represents the default message store. The restriction that you pass to HrQueryAllRows can take on one of the following forms:
-
An AND restriction that uses an SAndRestriction structure to combine:
-
A bitmask restriction that uses an SBitMaskRestriction structure for applying STATUS_DEFAULT_STORE as a mask against the PR_RESOURCE_FLAGS property.