Microsoft KB Archive/268171

= TN3270 Application May Process a Screen of Host Data Twice =

Article ID: 268171

Article Last Modified on 2/20/2007

-

APPLIES TO


 * Microsoft SNA Server 3.0 Service Pack 3
 * Microsoft SNA Server 3.0 Service Pack 4
 * Microsoft SNA Server 4.0
 * Microsoft SNA Server 4.0 Service Pack 1
 * Microsoft SNA Server 4.0 Service Pack 2
 * Microsoft SNA Server 4.0 Service Pack 3
 * Microsoft Host Integration Server 2000 Standard Edition

-



This article was previously published under Q268171



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



SUMMARY
A TN3270 client application may process a screen of host data twice when the data is followed by a 3270 Write (X'F1') command and WCC (Write Control Character) from the TN3270 server.

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

328152 How to Obtain the Latest Host Integration Server 2000 Service Pack



MORE INFORMATION
The TN3270 server has been updated in SNA Server 3.0 Service Pack 3 (SP3) to modify the Keyboard Unlock bit (Bit 6) in the WCC to correct this problem.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

175384 TN3270 Client Hangs with Keyboard Locked on Some Host Screens

The TN3270 keyboard unlock handling has also been enhanced to resolve a number of reported bracket race conditions. The TN3270 server determines what to do with a keyboard unlock bit for Request Units (RUs) that start with a 3270 Write, Erase\Write, or Erase\Write Alternate command based on the settings of the End Bracket Indicator (EBI), Change Direction Indicator (CDI) and End Chain Indicator (ECI) flags in the Request Header (RH).

The TN3270 server first checks to determine if either the EBI flag or CDI flag is set. If so, the keyboard restore bit is set to 1 before the data is sent to the TN3270 application, which unlocks the keyboard.

If the EBI flag or the CDI flag is not set, then the TN3270 server checks to determine if the ECI flag is set. If the ECI flag is set, the keyboard restore bit is set to 0 before the data is sent to the TN3270 application, which locks the keyboard.

When the TN3270 server receives a null RU that has the ECI flag set and either the EBI flag set or the CDI flag set, the TN3270 server sends a 3270 Write command with a WCC of X'C2' to the client. If this is not done, the keyboard stays locked because it was locked from the previous screen data, based on the keyboard unlock handling scenarios described previously. A real 3270 emulator (non-TN3270) does not require this, because it receives the RH and unlocks the keyboard when it receives an EB even if the WCC indicates that the keyboard should be locked. The TN3270 or TN3270E RFCs do not allow for the passing of the RH to a TN3270 client.

The receipt of a 3270 Write command (and WCC) with no additional data may cause an application to process the previous screen of data that it received because the null Write command does not change the presentation space of the screen buffer that contains the data being received from the host. The application may then read and process the data that it had previously received, which causes the data to be processed twice. The following code example demonstrates this problem:

TN3270 Client        TN3270 Server               Host

Data (BB CD)    -> Data (BB CD)         -> <-   Screen 1 (KB Unlocked) <-  Screen 1 (KB Locked) <-   Null RU (EB) <-  &quot;Write&quot; (KB Unlocked) F8 (BB CD)      -> F8 (BB CD)           -> <-   Null RU (EB) <-  &quot;Write&quot; (KB Unlocked) <-   BID BID + RSP            -> <-   Screen 2 (KB Unlocked) <-  Screen 2 (KB Locked) <-   Null RU (EB) <-  &quot;Write&quot; (KB Unlocked) F8 (BB CD)      -> F8 (BB CD)           -> <-   Null RU (EB) <-  Null RU (KB Unlocked) <-   BID BID + RSP            -> F8              -> At this point, the TN3270 server ignores the F8 from the client because the host has initiated a Bracket through the BID. The client cannot send data at this point, even though the keyboard is unlocked. Shortly after this, the host sends Screen 3: <-   Screen 3 (KB Unlocked) <-  Screen 3 (KB Locked) <-   Null RU (EB) <-  &quot;Write&quot; (KB Unlocked) F8 (BB CD)      -> F8 (BB CD)           -> <-   Null RU (EB) <-  Null RU (KB Unlocked) NOTE: F8 refers to the TN3270 application sending Program Function (PF) Key 8 to the host application. &quot;Write&quot; refers to the TN3270 server sending a 3270 Write (X'F1') command to the TN3270 application with a WCC that has the KeyBoard (KB) unlock bit set.

In this scenario, the application processes each screen of data twice because the TN3270 server is sending a 3270 Write (and WCC) to the application to unlock the keyboard upon receipt of the Null RU from the host.

For additional information about the latest service pack for SNA Server 4.0, click the article number below to view the article in the Microsoft Knowledge Base:

215838 How to Obtain the Latest SNA Server Version 4.0 Service Pack

When the following registry entry is defined, the TN3270 server is updated to prevent the modification of the keyboard unlock bit and the sending of the null 3270 Write command (and WCC) to a TN3270 client:

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.

 Start Registry Editor (Regedt32.exe). Locate the following key in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TN3270\Parameters

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

Value Name: ModifyWCC

Data Type: REG_SZ

Value: NO

NOTE: The value of NO must be entered in uppercase letters.

 Quit Registry Editor.

If the ModifyWCC entry is not added or a value other than NO is used, the TN3270 server will modify the keyboard unlock bit and send a null Write command as described previously.

For more details on the 3270 Data Stream commands mentioned in this article, please see the following :

IBM 3270 Information Display System Data Stream Programmer's Reference (GA23-0059)

For more information on Request Units (RUs) and Request Headers (RHs), please refer to the following:

IBM SNA Formats (GA27-3136)

Additional query words: HIS 2000

Keywords: kbbug kbfix kbhostintegserv2000presp1fix kbhostintegserv2000sp1fix KB268171

-

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

© Microsoft Corporation. All rights reserved.