Microsoft KB Archive/841386

= FIX: The COM Transaction Integrator leaks memory when it handles NULL output strings =

Article ID: 841386

Article Last Modified on 6/5/2006

-

APPLIES TO


 * Microsoft Host Integration Server 2000 Standard Edition
 * Microsoft Host Integration Server 2000 Service Pack 1

-





SYMPTOMS
Automation clients that are written in Microsoft .NET Framework languages that issue method calls to the Microsoft COM Transaction Integrator (COMTI) component may experience errors if the Dllhost.exe surrogate process (Microsoft COM+ package) that houses the COMTI component has been running for a long time without restarting. The client may receive one of the following error messages:

The object does not support automation or does not support the expected interface.

Out of memory (HR=8007000e)

The class does not support automation or does not support the expected interface.

Also, when you use Windows Performance Monitor or Windows Task Manager to view the COMTI process, you may notice a steady increase in memory usage when COMTI calls are processed by the system. Virtual memory usage also increases at 2 or 3 times the rate of private bytes usage.

For example, this problem may occur when the automation clients are written in the following languages:
 * Microsoft Visual C# .NET
 * Microsoft Visual Basic .NET



CAUSE
This problem occurs because the COMTI runtime incorrectly allocates an empty BSTR string when a client passes a NULL initialized Microsoft .NET String data type to an output-only COMTI method parameter.

A memory leak occurs even though the .NET String data type has been correctly initialized to NULL.

Note If an output-only string parameter is initialized with data before the COMTI method is called, a memory leak will occur in the COMTI Dllhost.exe process. See the &quot;More Information&quot; section for examples of how to code output-only string parameters correctly.



Service pack information
To resolve this problem, obtain the latest service pack for Microsoft Host Integration Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

328152 How to obtain the latest service pack for Host Integration Server 2000

Hotfix information
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.

  Date       Time   Version      Size     File name 04-May-2004 23:54  5.0.0.980   37,136  Capture.dll 04-May-2004 23:54  5.0.0.980  323,856  Cedrmsgs.dll 04-May-2004 23:54  5.0.0.980   33,040  Comticontext.dll 04-May-2004 23:54  5.0.0.980   28,944  Comtiperf.dll 04-May-2004 23:54  5.0.0.980  147,728  Convert.dll 04-May-2004 23:54  5.0.0.980   74,000  Convertprim.dll 04-May-2004 23:54  5.0.0.980   33,040  Dpl1.dll 04-May-2004 23:54  5.0.0.980  823,568  Dtcob390.dll 04-May-2004 23:54  5.0.0.980  311,568  Mobase.dll 04-May-2004 23:54  5.0.0.980   37,136  Playback.dll 04-May-2004 23:54  5.0.0.980   78,096  Readlib.dll 04-May-2004 23:54  5.0.0.980  123,152  Tadtlb.dll 04-May-2004 23:54  5.0.0.980  119,056  Tagen.dll 04-May-2004 23:54  5.0.0.980   82,192  Tranlu62.dll 04-May-2004 23:54  5.0.0.980  114,960  Trantcp.dll 04-May-2004 23:54  5.0.0.980   49,424  Turnaround.dll 04-May-2004 23:54  5.0.0.870  950,272  Componentbuilder.exe 29-Mar-2003 01:15             838,423  Comticb.chm 29-Mar-2003 01:15             812,988  Resnapin.chm

Note Because of file dependencies, the most recent hotfix that contains these files may also contain additional files.



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

This problem was corrected in Microsoft Host Integration Server 2000 Service Pack 2.



MORE INFORMATION
Applications that call COMTI methods that have output-only string parameters defined must have the parameter initialized to NULL before the COMTI call occurs. The following example shows how to set the parameter to NULL before the COMTI call occurs:

Visual C# .NET
NameOut = null;

// The second parameter is defined as OUTPUT by using the COMTI Component Builder.

objCOMTI.COMTIMethod (NameIn, out NameOut ); If any output string is preinitialized with data, a memory leak occurs in the COMTI process space if the string is passed into an output-only parameter method. For example, the following output strings cause a memory leak:
 * NameOut = &quot;&quot;;
 * NameOut = &quot; &quot;;
 * NameOut = &quot;Microsoft&quot;;

Keywords: kbbug kbfix kbhostintegserv2000sp2fix kbqfe kbhotfixserver KB841386

-

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

© Microsoft Corporation. All rights reserved.