X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1a9125b88edd1299ce33f7359d49c12a3de185e..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/msw/registry.cpp diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 0191ef8d82..2607a3f2c7 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -75,12 +75,12 @@ aStdKeys[] = #ifndef __WXWINCE__ { HKEY_PERFORMANCE_DATA, wxT("HKEY_PERFORMANCE_DATA"), wxT("HKPD") }, #endif -#if WINVER >= 0x0400 && !defined(__WXWINCE__) +#ifdef HKEY_CURRENT_CONFIG { HKEY_CURRENT_CONFIG, wxT("HKEY_CURRENT_CONFIG"), wxT("HKCC") }, -#if !defined(__GNUWIN32__) && !defined(__WXWINCE__) +#endif +#ifdef HKEY_DYN_DATA { HKEY_DYN_DATA, wxT("HKEY_DYN_DATA"), wxT("HKDD") }, // short name? -#endif //GNUWIN32 -#endif //WINVER >= 4.0 +#endif }; // the registry name separator (perhaps one day MS will change it to '/' ;-) @@ -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; } @@ -1231,7 +1239,7 @@ wxString wxRegKey::FormatValue(const wxString& name) const if ( !QueryValue(name, &value) ) break; - rhs.Printf(_T("dword:%08x"), value); + rhs.Printf(_T("dword:%08x"), (unsigned int)value); } break;