summaryrefslogtreecommitdiffstats
path: root/win/tclWinReg.c
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-10-05 22:47:04 (GMT)
committerhobbs <hobbs>1999-10-05 22:47:04 (GMT)
commitc67d7bf369b87f7440411eb5c4ec8d5773ec1461 (patch)
tree5646f922262ffbf32320f68c25a6415d94f66da5 /win/tclWinReg.c
parent0e113a9fa52d8d8f9c8be444d0e1a180084d6d8b (diff)
downloadtcl-c67d7bf369b87f7440411eb5c4ec8d5773ec1461.zip
tcl-c67d7bf369b87f7440411eb5c4ec8d5773ec1461.tar.gz
tcl-c67d7bf369b87f7440411eb5c4ec8d5773ec1461.tar.bz2
* {win,mac,unix,tools,}/README:
* win/README.binary: * win/makefile.vc: * {win,unix}/configure.in: * generic/tcl.h: * library/init.tcl: updated to 8.3a1 from 8.2.0. * win/tclWinReg.c: fixed registry command to properly 'get' HKEY_PERFORMANCE_DATA root key data. Needs more work. * win/tclWinSerial.c: changed SerialSetOptionProc to return TCL_OK by default. (patch from Rolf Schroedter)
Diffstat (limited to 'win/tclWinReg.c')
-rw-r--r--win/tclWinReg.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 479435c..7d296a1 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinReg.c,v 1.9 1999/04/16 00:48:09 stanton Exp $
+ * RCS: @(#) $Id: tclWinReg.c,v 1.10 1999/10/05 22:47:05 hobbs Exp $
*/
#include <tclPort.h>
@@ -694,7 +694,13 @@ GetValue(
result = (*regWinProcs->regQueryValueExProc)(key, valueName, NULL, &type,
(BYTE *) Tcl_DStringValue(&data), &length);
- if (result == ERROR_MORE_DATA) {
+ while (result == ERROR_MORE_DATA) {
+ /*
+ * The Windows docs say that in this error case, we just need
+ * to expand our buffer and request more data.
+ * Required for HKEY_PERFORMANCE_DATA
+ */
+ length *= 2;
Tcl_DStringSetLength(&data, length);
result = (*regWinProcs->regQueryValueExProc)(key, valueName, NULL,
&type, (BYTE *) Tcl_DStringValue(&data), &length);
@@ -975,8 +981,18 @@ OpenSubKey(
result = (*regWinProcs->regCreateKeyExProc)(rootKey, keyName, 0, "",
REG_OPTION_NON_VOLATILE, mode, NULL, keyPtr, &create);
} else {
- result = (*regWinProcs->regOpenKeyExProc)(rootKey, keyName, 0, mode,
- keyPtr);
+ if (rootKey == HKEY_PERFORMANCE_DATA) {
+ /*
+ * Here we fudge it for this special root key.
+ * See MSDN for more info on HKEY_PERFORMANCE_DATA and
+ * the peculiarities surrounding it
+ */
+ *keyPtr = HKEY_PERFORMANCE_DATA;
+ result = ERROR_SUCCESS;
+ } else {
+ result = (*regWinProcs->regOpenKeyExProc)(rootKey, keyName, 0,
+ mode, keyPtr);
+ }
}
Tcl_DStringFree(&buf);