FIX: Access Violation When You Pass Interfaces Between Components in Component Services Objects Program (279703)



The information in this article applies to:

  • Microsoft Windows 2000 Server SP1
  • Microsoft Windows 2000 Advanced Server SP1
  • Microsoft Windows 2000 Professional SP1

This article was previously published under Q279703
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SYMPTOMS

An access violation may occur during an IDispatch::Invoke call when interfaces are passed between components in the same Component Services Objects program.

CAUSE

This problem occurs because the Component Services Objects IDispatch interceptor is releasing an interface (that is passed as a parameter to Invoke) on which it does not use the AddRef method.

RESOLUTION

To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack


WORKAROUND

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To work around this problem, follow these steps:
  1. Start Registry Editor (Regedt32.exe).
  2. Locate the following key in the registry:

    HKEY_LOCAL_MACHINE\Software\Classes\Interface

  3. On the Edit menu, click Add Value, and then add the following registry value:

    Value Name: InterfaceHelperDisableAllForOle32
    Data Type: REG_SZ
    Radix: Decimal
    Value: 1

  4. Quit Registry Editor.
Using this registry value disables lightweight proxy and stubs and should prevent this problem from occurring. However, using this value slows down the program because a full NDR marshal is performed, which makes method calls across a context boundary.

STATUS

Microsoft has confirmed that this is a problem in Microsoft Windows 2000. This problem was first corrected in Windows 2000 Service Pack 2.

Modification Type:MajorLast Reviewed:11/17/2003
Keywords:kbbug kbfix kbQFE kbWin2000PreSP2Fix KB279703