locked
EWS ExtendedProperty PR_STORE_ENTRYID (0x0FFB) is different than MFCMAPI/OutlookSpy RRS feed

  • Question

  • Hi,

    I just found out that the Store Id received via EWS is different than in MFC MAPI.

    Before I could analyse the Store Id in MFCMAPI I have to add some additional digits to the beginning of the string:

    "0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D44422E444C4C00000000"
    
    abFlags = 0x00000000
    Provider GUID = {10BBA138-E505-1A10-A1BB-08002B2A56C2} = muidStoreWrap
    Version = 0x00 = MAPIMDB_VERSION
    Flag = 0x00 = MAPIMDB_NORMAL
    DLLFileName = EMSMDB.DLL
    Wrapped Flags = 0x00000000
    
    resource: http://msdn.microsoft.com/en-us/library/ee203516%28v=EXCHG.80%29.aspx

    After this, MFCMAPI shows me the following:

    MAPI Message Store Entry ID:
    abFlags = 0x00000000
    Provider GUID = {10BBA138-E505-1A10-A1BB-08002B2A56C2} = muidStoreWrap
    Version = 0x00 = MAPIMDB_VERSION
    Flag = 0x00 = MAPIMDB_NORMAL
    DLLFileName = EMSMDB.DLL
    Wrapped Flags = 0x00000000
    WrappedProviderUID = {20FA551B-66AA-CD11-9BC8-00AA002FC45A} = g_muidStorePrivate
    WrappedType = 0x00400008 = OPENSTORE_TAKE_OWNERSHIP | 0x400000
    ServerShortname = TESTSERVER.BBC.LOCAL
    MailboxDN = /o=BBC/ou=Exchange Administrative Group (XXXXXXXXXXXXX)/cn=Recipients/cn=account.name

     

    When I am trying to use the store Id with OOM GetFolderFromID(EntryID,StoreID); it comes up with an error:

    "The attempt to log on to Microsoft Exchange has failed"

    Opening the Mailbox in MFCMAPI shows me:

    MAPI Message Store Entry ID:
    abFlags = 0x00000000
    Provider GUID = {10BBA138-E505-1A10-A1BB-08002B2A56C2} = muidStoreWrap
    Version = 0x00 = MAPIMDB_VERSION
    Flag = 0x00 = MAPIMDB_NORMAL
    DLLFileName = EMSMDB.DLL
    Wrapped Flags = 0x00000000
    WrappedProviderUID = {20FA551B-66AA-CD11-9BC8-00AA002FC45A} = g_muidStorePrivate
    WrappedType = 0x0000000C = OPENSTORE_HOME_LOGON | OPENSTORE_TAKE_OWNERSHIP
    ServerShortname = DIFFERENT-SERVER.bbc.local
    MailboxDN = /o=BBC/ou=Exchange Administrative Group (XXXXXXXXXXXXX)/cn=Recipients/cn=account.name

    and GetFolderFromID(EntryId,StoreID); works fine...without any error!

    So changing WrappedType to 0x0000000C made my day. And I do not need to MAP the mailbox into Outlook.

    I already found out because of the WrappedType it causes the error. But it does not happen once the Mailboxes I am opening is directly MAPPED to Outlook

    BTW: I have used Exchange 2010 and outlook 2010 but was also reproducable in Outlook 2007.

     


    • Edited by Ole K Thursday, October 20, 2011 3:51 PM layout
    • Changed type Ole K Friday, October 21, 2011 12:37 PM why EWS sets 0x400000 to WrappedType
    Thursday, October 20, 2011 3:39 PM

Answers

  • As you know, the WrappedType field stores flags used in opening the message store. EWS uses a different set of flags than is typically used from MAPI. Basically, they should be ignored when mapping an EWS entry ID over to MAPI. Instead, you should parse out the provider ID, server name, and mailbox DN, and use those to construct a MAPI entry ID using whatever flags are appropriate, much in the same way you would construct an Entry ID using CreateStoreEntryID.
    Monday, October 24, 2011 1:34 PM

All replies

  • That's really to be expected underlying EWS doesn't use Mapi to access the store so what you see in MFCMapi is the wrapped Stored_EntryId with the provider UID what you get in EWS is what you get when using the wire protocols . You might want to have a read of http://social.msdn.microsoft.com/Forums/en-SG/os_exchangeprotocols/thread/8c3df444-213f-4966-a00d-6d2e660b31e5. which explains this much better.

    Cheers
    Glen

    Friday, October 21, 2011 5:17 AM
  • Well, interesting...

    Thank you Glen.

    The link does not explain why WrappedType has value OPENSTORE_TAKE_OWNERSHIP | 0x400000. Or I am blind

    I would like to know why its set to 0x400000 when using EWS.

     

    According to http://blogs.msdn.com/b/stephen_griffin/archive/2011/07/21/store-entry-id-v2.aspx 0x400000 seams to be invalid...

    • WrappedType (4 bytes): MUST be %x0C.00.00.00 for a mailbox store, or %x06.00.00.00 for a public store.



    • Edited by Ole K Friday, October 21, 2011 7:26 AM
    Friday, October 21, 2011 7:16 AM
  • As you know, the WrappedType field stores flags used in opening the message store. EWS uses a different set of flags than is typically used from MAPI. Basically, they should be ignored when mapping an EWS entry ID over to MAPI. Instead, you should parse out the provider ID, server name, and mailbox DN, and use those to construct a MAPI entry ID using whatever flags are appropriate, much in the same way you would construct an Entry ID using CreateStoreEntryID.
    Monday, October 24, 2011 1:34 PM