fixed problem with non-const methods not working on wxRegKey initially opened in read-only mode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -364,7 +364,13 @@ bool wxRegKey::GetKeyInfo(size_t *pnSubKeys,
|
||||
bool wxRegKey::Open(AccessMode mode)
|
||||
{
|
||||
if ( IsOpened() )
|
||||
return true;
|
||||
{
|
||||
if ( mode <= m_mode )
|
||||
return true;
|
||||
|
||||
// we had been opened in read mode but now must be reopened in write
|
||||
Close();
|
||||
}
|
||||
|
||||
HKEY tmpKey;
|
||||
m_dwLastError = ::RegOpenKeyEx
|
||||
@@ -384,6 +390,8 @@ bool wxRegKey::Open(AccessMode mode)
|
||||
}
|
||||
|
||||
m_hKey = (WXHKEY) tmpKey;
|
||||
m_mode = mode;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user