Old School Entry IDs


Back when Outlook 2003 shipped, we were looking for ways to reduce the number of calls we made to the server. One optimization we found was to include the FQDN of the server in the entry ID for an Exchange store. In some situations, this eliminated the need to call back to the server to get a referral. However, this also had two side effects:



  1. Exchange store entry IDs got much longer

  2. More scenarios were created where two different entry IDs point at the same object.

Now – technically, 2 shouldn’t be a concern because we all know you’re supposed to use CompareEntryIDs when comparing entry IDs (hence the name of the function). However, wouldn’t it be nice if you could get the old style entry ID for scenarios where you’re space constrained, or want to avoid the potentially expensive CompareEntryIDs call? Now you can. Whenever you want to ask for PR_STORE_ENTRYID, you can ask for PR_STORE_ENTRYID_EMSMDB_V1 instead. It’s defined as follows:

#define PR_STORE_ENTRYID_EMSMDB_V1 PROP_TAG(PT_BINARY, 0x65f6)

This will return the “old style” entry IDs that we used to use back in Outlook XP. They’re still valid now, though using them to open a mailbox may incur some additional RPCs if a referral is required. Also note that while you can memcmp two of these style entry IDs to see if they’re equal, you should not interpret a difference to mean they point at different mailboxes. To determine that they’re truly different you’d still need to use CompareEntryIDs.


Some other things to keep in mind: If you’re in cached mode, to ask for PR_STORE_ENTRYID_EMSMDB_V1 you have to bypass the cache using MAPI_NO_CACHE in your GetProps call. Also, in case the property isn’t available, your code should fall back to PR_STORE_ENTRYID. Finally, only Outlook 2003 and higher’s version of MAPI supports this property.

Comments (3)

  1. Wait a sec, is MAPI_NO_CACHE supposed to work with GetProps?

    I thought it was only used in OpenEntry?

    Will it also work for OpenProperty?

  2. Stephen Griffin says:

    Yep – I hadn’t really realized it either until I was asked to document this. :) AFAIK, it doesn’t work with OpenProperty, but I’m sure you’ll test it anyway – lemme know what you find.

  3. Renata says:

    Does anyone know how can I get the value of this PR_STORE_ENTRYID property for a given contact (object of ContactItemType)using Exchange Web Service (EWS) API ?