X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/86a7257f11c83f7d584a4c1d639e38f3e56367c8..d3e780ecdf69233c872d51216eedbc64a1b6db25:/src/msw/registry.cpp diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 0c0cda7752..72515030b0 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -374,7 +374,7 @@ bool wxRegKey::GetKeyInfo(size_t *pnSubKeys, // ---------------------------------------------------------------------------- // opens key (it's not an error to call Open() on an already opened key) -bool wxRegKey::Open() +bool wxRegKey::Open(AccessMode mode) { if ( IsOpened() ) return TRUE; @@ -385,7 +385,7 @@ bool wxRegKey::Open() (HKEY) m_hRootKey, m_strKey, RESERVED, - KEY_ALL_ACCESS, + mode == Read ? KEY_READ : KEY_ALL_ACCESS, &tmpKey ); @@ -685,7 +685,7 @@ bool wxRegKey::DeleteSelf() m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey); // deleting a key which doesn't exist is not considered an error if ( m_dwLastError != ERROR_SUCCESS && - m_dwLastError !- ERROR_FILE_NOT_FOUND ) { + m_dwLastError != ERROR_FILE_NOT_FOUND ) { wxLogSysError(m_dwLastError, _("Can't delete key '%s'"), GetName().c_str()); return FALSE; @@ -1097,7 +1097,7 @@ bool KeyExists(WXHKEY hRootKey, const wxChar *szKey) (HKEY)hRootKey, szKey, RESERVED, - KEY_ALL_ACCESS, + KEY_READ, // we might not have enough rights for rw access &hkeyDummy ) == ERROR_SUCCESS ) {