summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-11 19:30:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-11 19:30:42 (GMT)
commit0ad251426f08aff23e62fff6365bafc1af4e182f (patch)
treee27700ed8c7b156d4def38a90ab9d4b47194999e
parentfcb1a092aeea82d23c7d8957f677c0af36fc7371 (diff)
parentc31e9810372c9b7fb8b61dd0840ed8f87ecf79f0 (diff)
downloadtcl-0ad251426f08aff23e62fff6365bafc1af4e182f.zip
tcl-0ad251426f08aff23e62fff6365bafc1af4e182f.tar.gz
tcl-0ad251426f08aff23e62fff6365bafc1af4e182f.tar.bz2
[Bug #3362446]: registry keys command fails with 8.5/8.6. Follow Microsofts example better in order to prevent problems when using HKEY_PERFORMANCE_DATA.
-rw-r--r--ChangeLog6
-rw-r--r--win/tclWinReg.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 389279c..e5c2dc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tclWinReg.c: [Bug #3362446]: registry keys command fails
+ with 8.5/8.6. Follow Microsofts example better in order to prevent
+ problems when using HKEY_PERFORMANCE_DATA.
+
2012-07-10 Jan Nijtmans <nijtmans@users.sf.net>
* unix/tclUnixNotfy.c: [Bug 3541646] Don't panic on triggerPipe overrun
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 565188c..d2f233e 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -780,7 +780,7 @@ GetValue(
* HKEY_PERFORMANCE_DATA
*/
- length *= 2;
+ length = Tcl_DStringLength(&data) * (2 / sizeof(TCHAR));
Tcl_DStringSetLength(&data, (int) length * sizeof(TCHAR));
result = RegQueryValueEx(key, nativeValue,
NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length);