Microsoft KB Archive/331260

= FIX: The CoUninitialize function is not thread-safe in a multithreaded environment =

Article ID: 331260

Article Last Modified on 11/8/2004

-

APPLIES TO

 Microsoft COM+ 1.0, when used with:  Microsoft Windows 2000 Standard Edition

  

-



This article was previously published under Q331260





SYMPTOMS
When one Microsoft Component Object Model (COM) DLL has a global variable references COM object in another COM DLL, if these two DLLs are loaded and then unloaded in a multithreaded fashion, an access violation may occur.



CAUSE
When the last COM apartment in a process calls the CoUninitialize function, all DLLs that are loaded by COM will be unloaded. An access violation will occur if the following events occur:
 * 1) COM unloads.
 * 2) While COM unloads , a new thread/apartment is started that references the global variable in.
 * 3) The global variable in   references an address in the unloaded   that is no longer valid.

<div class="resolution_section">

How to Obtain the Hotfix
This issue is fixed in the Microsoft Windows 2000 Server COM+ 1.0 Hotfix Package 24. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

810578 Availability of Windows 2000 Post-Service Pack 3 COM+ Hotfix Rollup Package 24

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.

Additional query words: kbWin2000preSP4COMRollup24Fix multi-threaded

Keywords: kbwin2000presp5fix kbbug kbfix kbqfe kbwin2000presp4fix KB331260

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.