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:
parent
e49776ccfb
commit
24aae88a4c
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue