• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...

  • Advanced search options...
  • About
  • Email Blog Author
  • RSS for posts
  • Atom
  • RSS for comments
    • OK
  • CDO (20)
  • Code Snippet (42)
  • Custom Providers (15)
  • Debugging (7)
  • DevMsgTeam (278)
  • Documentation (101)
  • DST (8)
  • EWS (7)
  • Exchange (100)
  • Gotchas (91)
  • Hotfix (28)
  • MAPI (220)
  • MAPI Download (48)
  • MFCMAPI (92)
  • MSDN (54)
  • Non Dev (11)
  • OOM (17)
  • Outlook (163)
  • Outlook 2007 Auxiliary Reference (45)
  • Outlook Integration API (11)
  • Protocol Docs (20)
  • PST/OST (22)
  • Referrals (8)
  • Vista (12)
  • WrapPST (15)
Links:
  • Download MFCMAPI
  • MFCMAPI on Facebook
  • Troubleshooting Outlook Crashes
  • Office Update Center
  • Developer Messaging Team Blog
This site is provided "AS IS" with no warranties, and confers no rights. Use of included code samples are subject to the terms specified in the Terms of Use.
Archives
  • May 2012 (1)
  • April 2012 (3)
  • March 2012 (3)
  • February 2012 (3)
  • January 2012 (1)
  • December 2011 (3)
  • November 2011 (1)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (4)
  • June 2011 (3)
  • May 2011 (3)
  • April 2011 (3)
  • March 2011 (5)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (1)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (3)
  • August 2010 (5)
  • July 2010 (3)
  • June 2010 (3)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (2)
  • December 2009 (3)
  • November 2009 (5)
  • October 2009 (4)
  • September 2009 (5)
  • August 2009 (5)
  • July 2009 (11)
  • June 2009 (6)
  • May 2009 (5)
  • April 2009 (3)
  • March 2009 (18)
  • February 2009 (10)
  • January 2009 (3)
  • December 2008 (2)
  • November 2008 (2)
  • October 2008 (5)
  • September 2008 (4)
  • August 2008 (10)
  • July 2008 (6)
  • June 2008 (8)
  • May 2008 (2)
  • April 2008 (4)
  • March 2008 (2)
  • February 2008 (2)
  • January 2008 (5)
  • December 2007 (3)
  • November 2007 (2)
  • October 2007 (3)
  • September 2007 (1)
  • August 2007 (4)
  • July 2007 (5)
  • June 2007 (3)
  • May 2007 (4)
  • April 2007 (1)
  • March 2007 (6)
  • February 2007 (3)
  • January 2007 (2)
  • December 2006 (4)
  • November 2006 (3)
  • October 2006 (1)
  • August 2006 (1)
  • June 2006 (5)
  • May 2006 (5)
  • December 2005 (1)
  • November 2005 (4)
  • October 2005 (2)
  • September 2005 (1)
  • April 2005 (3)
  • December 2004 (2)
  • September 2004 (2)
  • August 2004 (3)
  • July 2004 (3)
Blogs I Read
  • Exchange

  • Raymond Chen [MSFT]

  • Larry Osterman [MSFT]

  • Peter David

  • Aaron Margosis [MSFT]

  • Jason Johnston [MSFT]

  • Matt Stehle (MSFT)

  • Patrick Creehan [MSFT]

  • Ryan Gregg [MSFT]

    Outlook PM
  • WebDav 101

    Dan Bagley (MSFT)
  • Dave Vespa [MSFT]

  • Randy Topken

    Outlook EE

August, 2009

MSDN Blogs > SGriffin's MAPI Internals > August, 2009
  • Subscribe via RSS
Sort by: Most Recent | Most Views | Most Comments
Excerpt View | Full Post View
  • SGriffin's MAPI Internals

    Outlook 2010 MAPI Reference Updated

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 0 Comments

    The Outlook 2010 MAPI Reference has been updated. I don’t have a list of everything that changed, so I’ll highlight one addition that’s pretty cool: the property definition stream. Long time readers might remember I mentioned this property before – it’s one of the properties you want to delete to kill a one-off form. It’s also the property that Outlook uses to store information about named properties created via the Object model and the user interface.

    Now that the format of PidLidPropertyDefinitionStream is documented, you can create new user defined properties using MAPI and have them show up in the UI! The September release of MFCMAPI (which I’m furiously hammering on) will be able to parse this property.

    As usual, the documentation is also available for download.

    Enjoy!

  • SGriffin's MAPI Internals

    Responding to Meetings with CDO

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 0 Comments

    My colleague Edwin, writing for the Exchange Support Team Central Europe blog, posted an article on accepting meeting requests with CDO. The key takeaway from the post is this:

    This means that when calling the respond method on meeting updates / requests, the sequence number must be read from the request and written to the response, otherwise Outlook will not be able to match the response to the original meeting.
    (The proposed solution is to read the dispidApptSequence from the original message and write this to the meeting update response before sending.)

    He also points out that this requirement is spelled out in the MAPI protocol documentation, here.

    Since CDO has reach end-of life, we won’t be taking a change to CDO to have it do this, so you’ll need to do it yourself. Edwin gives sample code that demonstrates how.

    Enjoy!

  • SGriffin's MAPI Internals

    More Fun With Check Name

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 0 Comments

    I just closed a case where the customer was trying to create a profile but Check Name was constantly prompting for credentials and then failing. This wasn’t the reconfig issue I mentioned before – they couldn’t create the profile in the first place. Even GCReconnect showed the same behavior – repeated prompts for credentials, then failure, with the error MAPI_E_USER_CANCEL. We took a network trace of the attempt to create the profile to see where the failure came from. The trace showed us attempting to set up NTLM authentication, sending the request to the Exchange server. Exchange passed the packet on the the GC, which promptly returned 0x721: RPC_S_SEC_PKG_ERROR.

    This is a common error to get when attempting to use Kerberos authentication. Configuring Kerberos at times can be tricky, and if it’s not all set up right, this is the error you expect to get. One workaround usually given is to make sure NTLM is set up and fall back to NTLM when Kerberos doesn’t work. However, in this case, we were trying NTLM in the first place!

    After some poking around, we took a look at the local policy settings on the three machines. Here’s what we found:

    Client
    Network security: Minimum session security for NTLM SSP based (including secure RPC) clients- Not defined
    Network security: Minimum session security for NTLM SSP based (including secure RPC) servers- Not defined
    Exchange
    Network security: Minimum session security for NTLM SSP based (including secure RPC) clients- Require NTLMv2 session security, Require 128-bit encryption
    Network security: Minimum session security for NTLM SSP based (including secure RPC) servers- Require NTLMv2 session security, Require 128-bit encryption
    GC
    Network security: Minimum session security for NTLM SSP based (including secure RPC) clients- Require NTLMv2 session security, Require 128-bit encryption
    Network security: Minimum session security for NTLM SSP based (including secure RPC) servers- Require NTLMv2 session security, Require 128-bit encryption

    Since the client was not configured to use NTLMv2, it tried to authenticate with NTLMv1. Since the server required NTLMv2, it rejected the request, with the appropriate error message: RPC_S_SEC_PKG_ERROR. Once the customer configured the policy on the client (it had just been overlooked during setup), they were able to complete profile configuration.

    For more information on these policies, see here and here.

  • SGriffin's MAPI Internals

    Auth and Check Names

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 3 Comments

    When I posted the Referral Madness article, there was an intriguing comment that I didn’t get a chance to investigate until it came up in a case. The commenter noted that when we used RPC_C_AUTHN_GSS_NEGOTIATE as our authentication mechanism, we could no longer use “Check Name” in the dialog brought up by ConfigureMsgService:

    Check Name dialog displayed by ConfigureMsgService

    If we hit Check Name, we get an error that the name could not be resolved due to network problems:

    The name could not be resolved.

    To understand why we get this error, we look at one of the caveats I noted:

    During profile configuration (ConfigureMsgService), the Exchange provider will do an NSPIBind to the Exchange server to lookup the mailbox name. This single bind and lookup is unavoidable.

    In order to perform the name resolution involved in Check Name, the Exchange provider is going to go through DSProxy. In network terms, this means we’re sending the packets directly to the Exchange server. DSProxy picks up our packets and forwards them on, unchanged, to the GC. Consider how this affects authentication. When we use RPC_C_AUTHN_GSS_NEGOTIATE, in most environments this means we’re going to use Kerberos. Combining the two: the client thinks it needs to negotiate Kerberos authentication with the Exchange server. It begins the handshake, sending a packet with a ticket using the Service Principal Name (SPN) for the Exchange server. DSProxy grabs this packet and whips it on over to the GC. The GC tries to parse the ticket in the packet but can’t since the ticket wasn’t intended for the GC. The GC returns the Kerberos error KRB_AP_ERR_MODIFIED. This error bubbles up on the client side as MAPI_E_NETWORK_ERROR, resulting in the dialog.

    This problem with proxying Kerberos packets was noted in a KB article a long time ago, which has one of the earliest references to profile settings to enable referral. In the KB article, they wanted to enable Kerberos authentication to get around a problem with authenticating local system accounts, but due to the problem discussed here, also had to enable referral.

    Does this mean we’ve got a bug in DSProxy’s handling of Kerberos? Not really – DSProxy predates Windows’ adoption of Kerberos by a number of years. Kerberos authentication can by proxied, but the proxy must be aware it’s proxying Kerberos traffic – it’s not as simple as reading packets off one port and sending them out another. On the other hand, NTLM authentication, the default used by the Exchange provider when we don’t specify an authentication mechanism, can handle being passed to the GC by DSProxy. This would fall under the heading of design limitation.

    So – the upshot:

    • Failure to perform Check Name in this scenario does not indicate a problem with the profile and does not indicate a problem with the network.
    • If you’ve configured a profile for referral and reconnect, using RPC_C_AUTHN_GSS_NEGOTIATE, you cannot use ConfigureMsgService to reconfigure the profile. If you really want to reconfigure the profile, build a new one instead.
    • If you want to be really clever, you could remove the auth setting before calling ConfigureMsgService, then add it back when you’re done.
  • SGriffin's MAPI Internals

    Your Cache is No Good Here

    Posted over 3 years ago
    by Stephen Griffin - MSFT
    • 0 Comments

    The first time we saw this, we wrote it off as an odd thing one customer did. But we’ve seen it a few times over the past couple years and it deserves some discussion. The issue is with Exchange Client Extensions (remember – they’re dead in 2010!): Customers would report that, when client extensions from certain companies are loaded, Outlook will behave strangely. The symptoms would usually be a crash or a hang. On debugging, we would find that even the hang was preceded by an access violation.

    When we debugged this, what we saw on the stack was an Exchange Client Extension calling into an IExchExtCallback object. Nothing unusual there, that’s what a callback object is for. What was unusual though, was that when we look further up the stack, Outlook hadn’t called into into the extension! Here’s the usual sequence of operations:

    1. ECE registers for various events
    2. Outlook fires one of the events, calling into the ECE’s event handler.
    3. One of the parameters of the event is an IExchExtCallback object, which the handler can use to obtain more information about the context of the event.
    4. The event handler returns.
    5. Outlook releases the IExchExtCallback object, which had been created specifically for this event.

    Note that last bit – Outlook creates these callback objects individually for the events they’re handed to, and releases them when the event is done. Note also, that these objects only make sense in the context of an event. For instance, the GetObject method returns a message store and a MAPI object. During the context of an event, which message store and which object would be returned makes sense. But after the event is done, there’s no context to establish which store or which object should be referenced.

    And this is why these extensions were throwing an access violation. They had cached a pointer to an IExchExtCallback object they had gotten during an earlier event and were using it later outside the context of the event. Since this object was not designed to handle this, it would crash. Whether Outlook would crash, hang, or otherwise behave oddly depended on whether or not an exception handler caught the AV.

    Not only does caching these objects not make sense once you consider the design, it’s actually precluded in the documentation. On the page for IExchExtCallback:IUnknown we have the following note:

    A pointer to this interface is passed as a parameter to many methods of the Microsoft Exchange extensibility API. This interface and any interfaces it might return are valid only for the time of the call to one of its methods and might not be retained when the extension object’s method returns.

    So – even though extensions are going away in Outlook 2010, if you have an extension in market right now for Outlook 2007 or earlier, you might want to review your code and check if you’re caching this object. If you are, you’re causing crashes for your customers.

Page 1 of 1 (5 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223