From d305f9dfff702b6678e9af38890a5431c6245bef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 10 Jun 2004 16:51:59 +0000 Subject: [PATCH] open more keys in read only mode if we need to only read from them (fixes problems with accessing some registry values under XP) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/registry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 427b33f431..d4526909e6 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -722,7 +722,7 @@ bool wxRegKey::HasValue(const wxChar *szValue) const // this function should be silent, so suppress possible messages from Open() wxLogNull nolog; - if ( !CONST_CAST Open() ) + if ( !CONST_CAST Open(Read) ) return FALSE; LONG dwRet = ::RegQueryValueEx((HKEY) m_hKey, @@ -762,7 +762,7 @@ bool wxRegKey::HasSubKey(const wxChar *szKey) const // this function should be silent, so suppress possible messages from Open() wxLogNull nolog; - if ( !CONST_CAST Open() ) + if ( !CONST_CAST Open(Read) ) return FALSE; return KeyExists(m_hKey, szKey); @@ -770,7 +770,7 @@ bool wxRegKey::HasSubKey(const wxChar *szKey) const wxRegKey::ValueType wxRegKey::GetValueType(const wxChar *szValue) const { - if ( ! CONST_CAST Open() ) + if ( ! CONST_CAST Open(Read) ) return Type_None; DWORD dwType; @@ -802,7 +802,7 @@ bool wxRegKey::SetValue(const wxChar *szValue, long lValue) bool wxRegKey::QueryValue(const wxChar *szValue, long *plValue) const { - if ( CONST_CAST Open() ) { + if ( CONST_CAST Open(Read) ) { DWORD dwType, dwSize = sizeof(DWORD); RegString pBuf = (RegString)plValue; m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED, @@ -830,7 +830,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxString& strValue, bool raw) const { - if ( CONST_CAST Open() ) { + if ( CONST_CAST Open(Read) ) { // first get the type and size of the data DWORD dwType, dwSize; @@ -922,7 +922,7 @@ wxString wxRegKey::QueryDefaultValue() const bool wxRegKey::GetFirstValue(wxString& strValueName, long& lIndex) { - if ( !Open() ) + if ( !Open(Read) ) return FALSE; lIndex = 0; @@ -967,7 +967,7 @@ bool wxRegKey::GetNextValue(wxString& strValueName, long& lIndex) const bool wxRegKey::GetFirstKey(wxString& strKeyName, long& lIndex) { - if ( !Open() ) + if ( !Open(Read) ) return FALSE; lIndex = 0; -- 2.45.2