STL breaks after installing Microsoft Security Advisory 973882

After installing through Microsoft Update Vulnerabilities in Microsoft Active Template Library (ATL) Could Allow Remote Code Execution STL broke with the following error:
c:\program files\microsoft visual studio 9.0\vc\include\xutility(2764) : error C3861: '_Swap_adl': identifier not found

Most probably, this is caused by accidentally deleted the following function:
template inline
   void _Swap_adl(_Ty& _Left, _Ty& _Right)
   { // exchange values stored at _Left and _Right, using ADL
      swap(_Left, _Right);
   }

Placing this code back somewhere (I placed directly in xutility), fixed this problem. Not sure if there are any side effects. Most probably Microsoft will issue another fix.

Related knowledge base articles:
Description of the security update for Microsoft Visual Studio 2008 Service Pack 1: July 28, 2009
Microsoft Security Advisory: Vulnerabilities in Microsoft Active Template Library (ATL) could allow remote code execution
MS09-035: Vulnerabilities in Visual Studio Active Template Libraries could allow remote code execution

Affected system:

  • Windows XP with SP3
  • Visual Studio 2008 Professional with SP1 (Version 9.0.30729.1 SP)

Update. The following steps restores std::vector class without need to modify any headers:

  1. Uninstall the security update (Security Update for Microsoft Visual Studio 2008 Service Pack 1 – KB971092).
  2. Re-install Microsoft Visual Studio 2008 Service Pack 1 (KB945140).
  3. Re-install the security update – KB971092.

Update 2 (15 Aug 2009).

Microsoft created support topic: You receive a compile error in your ATL project after you install the Windows SDK 6.1 with Visual Studio 2008 SP1

Microsoft Windows SDK Blog: Installing Windows SDK for Server 2008 (v6.1) after VS2008 SP1 causes conflicts with Security Update (KB971092)