diff --git a/MUtilities_VS2013.vcxproj b/MUtilities_VS2013.vcxproj index edd0cde..1eccd5d 100644 --- a/MUtilities_VS2013.vcxproj +++ b/MUtilities_VS2013.vcxproj @@ -164,7 +164,7 @@ Windows true $(SolutionDir)\..\Prerequisites\Qt4\MSVC-2013\Debug\lib;$(SolutionDir)\..\Prerequisites\VisualLeakDetector\lib\Win32 - QtCored4.lib;QtGuid4.lib;Winmm.lib;Psapi.lib;Sensapi.lib;PowrProf.lib;%(AdditionalDependencies) + QtCored4.lib;QtGuid4.lib;Winmm.lib;Psapi.lib;Sensapi.lib;PowrProf.lib;Shlwapi.lib;%(AdditionalDependencies) @@ -193,7 +193,7 @@ true true $(SolutionDir)\..\Prerequisites\Qt4\MSVC-2013\Shared\lib;$(SolutionDir)\..\Prerequisites\VisualLeakDetector\lib\Win32 - QtCore4.lib;QtGui4.lib;Winmm.lib;Psapi.lib;Sensapi.lib;PowrProf.lib;%(AdditionalDependencies) + QtCore4.lib;QtGui4.lib;Winmm.lib;Psapi.lib;Sensapi.lib;PowrProf.lib;Shlwapi.lib;%(AdditionalDependencies) false diff --git a/src/Registry_Win32.cpp b/src/Registry_Win32.cpp index b1b67d4..5e8b09d 100644 --- a/src/Registry_Win32.cpp +++ b/src/Registry_Win32.cpp @@ -106,6 +106,7 @@ MUtils::Registry::RegistryKey::~RegistryKey(void) p->m_hKey = NULL; p->m_isOpen = false; } + delete p; } inline bool MUtils::Registry::RegistryKey::isOpen(void) @@ -128,7 +129,7 @@ bool MUtils::Registry::RegistryKey::value_write(const QString &valueName, const bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, quint32 &value) const { DWORD size = sizeof(quint32), type = -1; - CHECK_STATUS(false); + CHECK_STATUS(true); return (RegQueryValueEx(p->m_hKey, valueName.isEmpty() ? NULL : MUTILS_WCHR(valueName), 0, &type, reinterpret_cast(&value), &size) == ERROR_SUCCESS) && (type == REG_DWORD); } @@ -136,7 +137,7 @@ bool MUtils::Registry::RegistryKey::value_read(const QString &valueName, QString { wchar_t buffer[2048]; DWORD size = sizeof(wchar_t) * 2048, type = -1; - CHECK_STATUS(false); + CHECK_STATUS(true); if((RegQueryValueEx(p->m_hKey, valueName.isEmpty() ? NULL : MUTILS_WCHR(valueName), 0, &type, reinterpret_cast(&value), &size) == ERROR_SUCCESS) && ((type == REG_SZ) || (type == REG_EXPAND_SZ))) { value = QString::fromUtf16(reinterpret_cast(buffer));