Last modified: July 23, 2011

Applies to: Outlook

Compares two message store entry identifiers to determine whether they refer to the same store object.

HRESULT CompareStoreIDs(
  ULONG cbEntryID1,
  ULONG cbEntryID2,
  ULONG ulFlags,
  ULONG FAR * lpulResult


[in] The size, in bytes, of the entry identifier pointed to by the lpEntryID1 parameter.


[in] A pointer to the first entry identifier to be compared.


[in] The size, in bytes, of the entry identifier pointed to by the lpEntryID2 parameter.


[in] A pointer to the second entry identifier to be compared.


[in] Reserved; must be zero.


[out] A pointer to the returned result of the comparison. TRUE if the two entry identifiers refer to the same object; otherwise, FALSE.


The call succeeded and has returned the expected value or values.

MAPI calls the IMSProvider::CompareStoreIDs method when it processes a call to the IMAPISession::OpenMsgStore method. CompareStoreIDs is called at this point to determine which profile section, if any, is associated with the message store being opened. A CompareStoreIDs call can be made when no message stores are open for a particular store provider. In addition, MAPI also calls CompareStoreIDs when it processes a store provider call to the IMAPISupport::OpenProfileSection method.

The entry identifiers compared by CompareStoreIDs are both for the current store provider's dynamic-link library (DLL) and are both unwrapped store entry identifiers. For more information about wrapping store entry identifiers, see IMAPISupport::WrapStoreEntryID.

Comparing entry identifiers is useful because an object can have more than one valid entry identifier. This can occur, for example, after a new version of a message store provider is installed.