Microsoft KB Archive/223367

= FIX: RegistryKey setValue Fails for Terminating Character on NT =

Article ID: 223367

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition
 * Microsoft Software Development Kit for Java 1.0
 * Microsoft Software Development Kit for Java 1.5
 * Microsoft Software Development Kit for Java 1.51
 * Microsoft Software Development Kit for Java 2.02
 * Microsoft Software Development Kit for Java 2.01
 * Microsoft Software Development Kit for Java 2.02
 * Microsoft Software Development Kit for Java 3.0
 * Microsoft Software Development Kit for Java 3.0
 * Microsoft Software Development Kit for Java 3.1
 * Microsoft Software Development Kit for Java 3.2

-



This article was previously published under Q223367



SYMPTOMS
RegistryKey.setValue might not set the value of a registry key correctly. This problem only occurs on Windows NT.



CAUSE
The setValue method, when executed under NT, does not account for the terminating null character, which causes incorrect data to be written to the registry key.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed



Steps to Reproduce Behavior
 Create a new "Console Application." Import com.ms.wfc.app.*  Add the following code to main: RegistryKey r = Registry.CURRENT_USER.createSubKey("Software\\Microsoft\\VisualStudio\\6.0\\Debugger"); r.setValue("Test1","ABC"); r.setValue("Test2","DEF"); r.setValue("Test3","XYZ");

r.setValue("Test2","");  Compile and run the code. View the specified keys in REGEDIT.

Without Visual Studio Service Pack 3, the key "Test2" will hold the value of one of its peer keys.</ol>

Keywords: kbbug kbfix kbvs600sp3fix KB223367

-

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

© Microsoft Corporation. All rights reserved.