Set access mode in wxRegKey::SetHkey().

It was left uninitialized before resulting in the key being closed on access because the check for being opened in a mode with enough permissions failed even for Read.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-26 15:50:03 +00:00
parent e49776ccfb
commit 24aae88a4c

View File

@@ -294,6 +294,18 @@ void wxRegKey::SetHkey(WXHKEY hKey)
Close();
m_hKey = hKey;
// we don't know the parent of this key, assume HKLM by default
m_hRootKey = HKEY_LOCAL_MACHINE;
// we don't know in which mode was this key opened but we can't reopen it
// anyhow because we don't know its name, so the only thing we can is to hope
// that it allows all the operations which we're going to perform on it
m_mode = Write;
// reset old data
m_strKey.empty();
m_dwLastError = 0;
}
// ----------------------------------------------------------------------------