Compartilhar via


The Microsoft Office Outlook Connector Kills Winsock

It’s true. Kills it. Kills it dead. Ok – maybe that’s a bit strong. Here’s the issue. If you installed the Microsoft Office Outlook Connector, then ran an application (other than Outlook) which uses both MAPI and Winsock, the Winsock portion of your application is likely to find its connections torn down when you’re done using MAPI. This, of course, can be quite disconcerting.

A bit about the connector: The Microsoft Office Outlook Connector is a set of MAPI provider and an Outlook Add-in that allow Outlook to connect to Microsoft Windows Live Hotmail and Microsoft Office Live Mail accounts. The file msncon32.dll implements a store, transport, and address book provider. Incidentally, the store provider is a Wrapped PST. The Add-in allows for some custom UI.

The problem is with the connector’s connection monitor feature, which uses Winsock. This feature is designed only to run when the providers were loaded inside the Outlook process, presumably when it would have access to the Add-in. However, the code which cleans up after the feature was running no matter where the providers were loaded. Since this code assumed Winsock had been initialized with WSAStartup, it cleaned it up with a call to WSACleanup. This is harmless if Winsock isn’t being used, but if it is, this tears down Winsock before the rest of the application is expecting it to be torn down. Not ideal.

The fix, of course, is only to call WSACleanup if we’ve called WSAStartup. The latest version of the Outlook Connector does just that. You can get the connector here:

https://www.microsoft.com/downloads/details.aspx?familyid=9A2279B1-DF0A-46E1-AA93-7D4870871ECF

The file with the fix in it is msncon32.dll – the fixed version is 12.0.6423.1000. Any version of msncon32.dll prior to this build will exhibit the behavior of making the unmatched call to WSACleanup. If you’re looking to code around this issue for earlier builds, you could always stack an extra call to WSAStartup to counteract the extraneous WSACleanup.

BTW – this isn’t the only fix in the connector. I don’t know if we’ve published a list of fixes. I do know one of the fixes has to do with a failure to complete migration of more than 250 calendar items from some older system to Windows Live Calendar.

Comments

  • Anonymous
    March 27, 2009
    The Outlook Connector team NEVER publishes any info on what they actually change. They are one of the worst teams of all in terms of communicating what they are doing, what they have been doing etc. Case in point: Apparently they released a new version at the beginning of the week, right? That is at least the date on the download page. BUT, the version number on the download page did not change. They link to a release not on the download page that is from December. They have no info on the Outlook blog on this update. It is one of their stealth updates, with no info what changed, fixed etc It is great that you blogged this one here, but until the connector team changes its gear, I'm not going to install it again. So many times they pushed out new versions, said "lots of stuff is fixed", but never any specifics, and then I just had to sit there and manually find out, that still the most basic things didn't work. On that note, do you know whether the update integrates better with the fast shutdown that we got from the CU update? If you have ANY way to get that team to just write a simple blog entry with a concrete list of things they fixed, it would be fantastic!

  • Anonymous
    March 27, 2009
    It looks like they've been blogging their releases over on the Outlook Team Blog (http://blogs.msdn.com/outlook/archive/tags/outlook+connector/default.aspx). I've forwarded your feedback to the appropriate folks. RE: Fast Shutdown - as far as I can tell, this latest version does not support Fast Shutdown.

  • Anonymous
    March 27, 2009
    Expect a post on the Outlook Team Blog next week - it was already in the works.

  • Anonymous
    April 01, 2009
    With respect to the store provider using "Wrapped PST", actually I found out it is not the whole story :-) When a connector message service is added to a profile, there are multiple files added in the offline store:

  1. Outlook.pst
  2. outlook.nst: this should be the Wrapped PST. However, nothing is saved in it. Interestingly it is called "NoiseTracker Module".
  3. profileName.ost: this is where all the downloaded messages are store. So, the question is: why the "Wrapped PST" is NOT used for storing information? It is because it lacks some critical capabilities which only exist in ost?