FIX: COMTI Returns NULL Characters Instead of a Zero Byte String (820719)



The information in this article applies to:

  • Microsoft Host Integration Server 2000
  • Microsoft Host Integration Server 2000 SP1

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

When you use COM Transaction Integrator (COMTI) with string parameters and when string delimitation is set to "Padded with spaces", if the host returns NULL (0x00) characters, COMTI returns a string of NULL (0x00) characters to the application that is calling.

In SNA Server 4.0, if the host returns NULL (0x00) characters, COMTI returns a zero byte string to the calling application. If a calling application was created with SNA Server 4.0 and is upgraded to Host Integration Server 2000, this changed behavior may cause the calling application to return an error.

CAUSE

It is valid for a "Bstr" string to contain NULL (0x00) characters. As a result, SNA Server 4.0 COMTI incorrectly returns a zero length string to the calling application. This problem was corrected in Host Integration Server 2000 so that the NULL (0x00) characters are returned to the calling application. However, applications that were developed by using SNA Server 4.0 and that expect a zero length string to be returned can still experience problems.

RESOLUTION

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
   -------------------------------------------------------------
   14-May-2003  16:26  5.0.0.911     37,136  Capture.dll      
   14-May-2003  16:26  5.0.0.911    323,856  Cedrmsgs.dll     
   14-May-2003  16:26  5.0.0.911     33,040  Comticontext.dll  
   14-May-2003  16:26  5.0.0.911    147,728  Convert.dll      
   14-May-2003  16:26  5.0.0.911     74,000  Convertprim.dll  
   14-May-2003  16:26  5.0.0.911     33,040  Dpl1.dll         
   14-May-2003  16:27  5.0.0.911    823,568  Dtcob390.dll     
   14-May-2003  16:26  5.0.0.911     37,136  Playback.dll     
   14-May-2003  16:26  5.0.0.911     78,096  Readlib.dll      
   14-May-2003  16:26  5.0.0.911    123,152  Tadtlb.dll       
   14-May-2003  16:26  5.0.0.911    114,960  Tagen.dll        
   14-May-2003  16:26  5.0.0.911     78,096  Tranlu62.dll     
   14-May-2003  16:26  5.0.0.911    110,864  Trantcp.dll      
   14-May-2003  16:26  5.0.0.911     49,424  Turnaround.dll   
   14-May-2003  16:27  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 fix that contains the previous files may also contain additional files.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

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

WORKAROUND

Change the string delimitation to "Null terminated" resolves this problem for most situations. However, because string delimitation affects both directions for an in/out string parameter, changing string delimitation to "Null terminated" means that data that is sent to the host will no longer be padded with spaces. This method may not work on some host systems. This workaround also involves changing string delimitation for all the affected parameters in all the type libraries.

MORE INFORMATION

After you apply the update, add the following registry entry to cause COMTI to perform string delimitation as it did in SNA Server 4.0. When "Padded with spaces" is selected and the registry entry is set, COMTI will send data to the host padded with spaces, but will return a zero length string to the calling application if NULL (0x00) characters are received.
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.
Follow these steps, and then quit Registry Editor:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following key in the registry: HKEY_LOCAL_MACHINE\Software\Microsoft\Cedar\Defaults
  3. Right-click Defaults, point to New, and then click Key.
  4. Name the key AlwaysCheckForNull.
  5. Right-click AlwaysCheckForNull, point to New, and then click Binary Value.
  6. Name the binary value Activate.
  7. Right-click Activate, and then click Modify.
  8. Press the number 2 key (a value of 20 appears).
  9. Click OK, then close the Registry Editor window.
Note The value of the key can be whatever you want it to be. As long as the key exists, the change will take affect.

Modification Type:MinorLast Reviewed:10/26/2005
Keywords:kbHotfixServer kbQFE kbHotfixServer kbQFE kbQFE kbfix kbbug KB820719 kbAudDeveloper