summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-09-17 12:50:10 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-09-17 12:50:10 (GMT)
commit8ee8cd372fbf5a5772da6352afb13db140176b64 (patch)
tree47be9735370cc1f80a0c07fb750a5d38226d3bd5
parent18e76badb6ff3e6fafbb5febd9c9a43f0b8d8f25 (diff)
downloadCMake-8ee8cd372fbf5a5772da6352afb13db140176b64.zip
CMake-8ee8cd372fbf5a5772da6352afb13db140176b64.tar.gz
CMake-8ee8cd372fbf5a5772da6352afb13db140176b64.tar.bz2
BUG: On WIN32, since we are using subkey, set it
-rw-r--r--Source/kwsys/Registry.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/kwsys/Registry.cxx b/Source/kwsys/Registry.cxx
index 0ca1e5b..439433a 100644
--- a/Source/kwsys/Registry.cxx
+++ b/Source/kwsys/Registry.cxx
@@ -390,6 +390,10 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS );
}
+ if ( res != 0 )
+ {
+ this->SetSubKey( subkey );
+ }
return (res != 0);
}
#endif
@@ -553,8 +557,8 @@ bool RegistryHelper::ReadValue(const char *skey, const char **value)
int res = 1;
DWORD dwType, dwSize;
dwType = REG_SZ;
- dwSize = Registry_BUFFER_SIZE;
char buffer[1024]; // Replace with RegQueryInfoKey
+ dwSize = sizeof(buffer);
res = ( RegQueryValueEx(this->HKey, skey, NULL, &dwType,
(BYTE *)buffer, &dwSize) == ERROR_SUCCESS );
if ( !res )