c++.stlsoft - STLSoft 1.9.83 released
- Matt Wilson (27/27) May 18 2009 Download from http://stlsoft.org
- Sam Fisher (26/26) May 21 2009 Matt Wilson wrote:
- Matthew Wilson (6/32) May 21 2009 Ouch! Good catch.
Download from http://stlsoft.org ============================================================================ Changes for 1.9.83 (19th May 2009) Summary: ======== * fixed defects in winstl::basic_reg_value::value_sz()/value_multi_sz() * fixed defects in exception-safety in winstl::basic_reg_value and winstl::basic_reg_key * various minor fixes and documentation mods Changes: ======== WinSTL: ======= ~ include/winstl/registry/reg_key.hpp: ~ corrected exception-safety defect (by reversing the order of m_name and m_hkey) ~ added required dependency on <functional> ~ documentation simplification ~ include/winstl/registry/reg_traits.hpp: + added reg_dup_key() - deprecated key_dup() ~ linearising behaviour between operating systems ~ tightening type-conversions ~ documentation simplification ~ include/winstl/registry/reg_value.hpp: ~ modifications to value_multi_sz() and value_sz() to avoid possible race conditions (with registry changes made by other processes) ~ corrected exception-safety defect (by reversing the order of m_name and m_hkey) ~ documentation simplification ============================================================================
May 18 2009
Matt Wilson wrote: I found another bug in registry library (STLsoft 1.9.83). In function set_value_ with REG_MULTI_SZ file reg_key.hpp, line 1375: return ERROR_SUCCESS == class_type::set_value_(m_hkey, valueName, REG_MULTI_SZ, buff.data(), static_cast<size_type>(p - &buff[0])); expression "p - &buff[0]" means size in chars, not bytes. It's worked only when char_type = char Test code to reproduce bug: // unicode, TCHAR = wchar_t const TCHAR path[] = _T("SOFTWARE\\StlSoftRegTest"); winstl::reg_key rk(HKEY_CURRENT_USER, _T(""), KEY_WRITE); winstl::reg_key test = rk.create_sub_key(path); const TCHAR* values[] = { _T("123"), _T("456") }; const size_t N = sizeof(values) / sizeof(values[0]); boost::scoped_array<const TCHAR*> ss(new const TCHAR* [N]); for (size_t i=0; i<N; i++) ss[i] = values[i]; test.set_value(_T("MultiSz"), &ss[0], N); After key export: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\StlSoftRegTest] "MultiSz"=hex(7):31,00,32,00,33,00,00,00,34,00
May 21 2009
Ouch! Good catch. This has now been incorporated into the registry test suite (that is in the 1.10 branch), and the defect fixed, and will be in 1.9.84 in the next day or so. Thanks again. Keep 'em coming ... ;-) Matt "Sam Fisher" <infest21h gmail.com> wrote in message news:gv3fue$2bli$1 digitalmars.com...Matt Wilson wrote: I found another bug in registry library (STLsoft 1.9.83). In function set_value_ with REG_MULTI_SZ file reg_key.hpp, line 1375: return ERROR_SUCCESS == class_type::set_value_(m_hkey, valueName, REG_MULTI_SZ, buff.data(), static_cast<size_type>(p - &buff[0])); expression "p - &buff[0]" means size in chars, not bytes. It's worked only when char_type = char Test code to reproduce bug: // unicode, TCHAR = wchar_t const TCHAR path[] = _T("SOFTWARE\\StlSoftRegTest"); winstl::reg_key rk(HKEY_CURRENT_USER, _T(""), KEY_WRITE); winstl::reg_key test = rk.create_sub_key(path); const TCHAR* values[] = { _T("123"), _T("456") }; const size_t N = sizeof(values) / sizeof(values[0]); boost::scoped_array<const TCHAR*> ss(new const TCHAR* [N]); for (size_t i=0; i<N; i++) ss[i] = values[i]; test.set_value(_T("MultiSz"), &ss[0], N); After key export: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\StlSoftRegTest] "MultiSz"=hex(7):31,00,32,00,33,00,00,00,34,00
May 21 2009