This article has been archived. It is offered "as is" and will no longer be updated.
A Microsoft Message Queuing (also known as MSMQ) component that uses the EnableNotification method call and is written in Microsoft Visual Basic may result in an access violation.
This access violation occurs because of a race condition between threads in the Mqoa.dll file. When this problem occurs, the running program thread calls the MSMQQueue.EnableNotification method. The message is peeked immediately and is dispatched to the MSMQEvent event handler. Because the MSMQEvent event handler is in a multithreaded apartment (MTA), the call is dispatched to a worker thread. This worker thread will execute the event handler code and may take some time to complete.
The race condition starts when the program thread exits and runs its destructor. Because the MSMQEvent event handler is an apartment thread, the release event is dispatched to the MSMQEvent event handler, and the MSMQEvent object is released from memory. In the meantime, the event handler worker thread still tries to finish processing the event message. When the worker thread tries to reference the MSMQEvent object, an access violation occurs because the MSMQEvent object has been released from memory.For additional information about race conditions, click the following article number to view the article in the Microsoft Knowledge Base:
317723 INFO: What Are Race Conditions and Deadlocks?
For additional information about multithreaded apartments (MTA), click the following article number to view the article in the Microsoft Knowledge Base:
150777 INFO: Descriptions and Workings of OLE Threading Models
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.
If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
No prerequisites are required.
You must restart your computer after you apply this hotfix.
Hotfix Replacement Information
This hotfix does not replace any other hotfixes.
The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.