PRB: Synch OLE Call Fails in Inter-Process/Thread SendMessage

Article translations Article translations
Article ID: 131056 - View products that this article applies to.
This article was previously published under Q131056
Expand all | Collapse all

SYMPTOMS

A synchronous OLE call made by the recipient of an inter-process/inter- thread SendMessage fails with RPC_E_CANTCALLOUT_ININPUTSYNCCALL(0x8001010D).

CAUSE

The cause is discussed in detail in the "More Information" section of this article.

RESOLUTION

Use PostMessage instead of an inter-process/inter-thread SendMessage.

STATUS

This behavior is by design.

MORE INFORMATION

See the beginning of chapter 13 in the OLE 2 Programmer's Reference Volume 1 for the categories of OLE calls. An understanding of these categories is required for this article.

The majority of OLE calls are synchronous calls. A synchronous call to a different process yields to that process and waits for a reply from that process. In addition, OLE has input-synchronized calls that relate to the inplace-activation interfaces. Input-synchronized calls are implemented using an inter-process/inter-thread SendMessage.

16-bit Windows doesn't allow a task to yield while in an inter- process/inter-thread SendMessage because a system deadlock could occur. The deadlock occurs because a message for the sender could be present at the top of the shared system queue, and this prevents other tasks, including the recipient of the SendMessage, from retrieving their messages from the system queue until the sender does. The sender cannot retrieve its message because it is waiting for the inter-process/inter-thread SendMessage to return.

In 32-bit Windows, each process has its own system queue and this architecture normally prevents deadlock problem from occurring. However, when one process is inplace active in another process's window, the system queues of the two processes are synchronized as in 16-bit windows, so the deadlock could occur. To prevent this, OLE stops synchronous OLE calls from being made while the caller is the recipient of an input-synchronized call.

OLE determines if the caller of the synchronous call is a recipient of an input-synchronized call by using the InSendMessage() API. This broad check prevents a synchronous call from being made if the caller is currently a recipient of any inter-process/inter-thread SendMessage.

Properties

Article ID: 131056 - Last Review: July 11, 2005 - Revision: 2.2
APPLIES TO
  • Microsoft Platform Software Development Kit-January 2000 Edition, when used with:
    • Microsoft Windows NT Server 3.5
    • Microsoft Windows NT Server 4.0 Standard Edition
    • Microsoft Windows NT Workstation 3.5
    • Microsoft Windows NT Workstation 4.0 Developer Edition
    • Microsoft Windows 95
    • Microsoft Windows 2000 Standard Edition
Keywords: 
kbprb KB131056

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com