FIX: ICallFrame::GetMarshalSizeMax() Clears IDispatch::Invoke Parameters (300683)



The information in this article applies to:

  • Microsoft COM+ 1.0, when used with:
    • the operating system: Microsoft Windows 2000

This article was previously published under Q300683

SYMPTOMS

VARIANT out parameters that are passed through the IDispatch::Invoke method may be cleared by the time they reach the method that is being called. This makes it impossible to update any out parameters.

CAUSE

This problem occurs because a private, internal COM+ interface, ICallFrame, incorrectly handles VARIANT parameters.

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


STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 2.

MORE INFORMATION

Before the call to ICallFrame::Invoke, you have the following code:
   // This is an [in, out] parameter.
   // Its value is updated to 14 by the method that is being called.
   pDispParams->rgvarg[0] = VT_I2 | VT_BYREF (value = 12)
   // [in] param
   pDispParams->rgvarg[1] = VT_I2 | VT_BYREF (value =  2)
				
After the call to ICallFrame::Invoke, you have the following code:
   // Also, lVal is 840456 (not the expected 14).
   pDispParams->rgvarg[0] = VT_EMPTY
   pDispParams->rgvarg[1] = VT_EMPTY
				
All of the parameters in the DispParams have their type set to VT_EMPTY. This makes it impossible to update any out parameters.

Modification Type:MajorLast Reviewed:6/5/2003
Keywords:kbbug kbfix kbQFE kbWin2000PreSP2Fix KB300683