diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-10 10:14:32 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-10 10:14:32 +0200 |
commit | 248966215d5b6bcdf893bc603ede1d69e00ca17a (patch) | |
tree | 83f6cf9347b1f89ed9a11f8dbd4fb16d58707493 /configmgr | |
parent | de82b32c4a9b5b2ac0dd9dee712da061bc34c2c3 (diff) |
Clean up uses of SAL_U/SAL_W: configmgr
Change-Id: I2c3f16b4798246175ff8f3cc22b61f2d5a9967b6
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/winreg.cxx | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index 76d7abe15462..a60b345ee06e 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -85,7 +85,10 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil { HKEY hCurKey; - if(RegOpenKeyExW(hKey, SAL_W(aKeyName.getStr()), 0, KEY_READ, &hCurKey) == ERROR_SUCCESS) + if(RegOpenKeyExW( + hKey, reinterpret_cast<wchar_t const *>(aKeyName.getStr()), 0, + KEY_READ, &hCurKey) + == ERROR_SUCCESS) { DWORD nSubKeys = 0; DWORD nValues = 0; @@ -106,9 +109,13 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil //Make up full key name if(aKeyName.isEmpty()) - aSubkeyName = aKeyName + OUString(SAL_U(buffKeyName)); + aSubkeyName = aKeyName + + OUString( + reinterpret_cast<sal_Unicode const *>(buffKeyName)); else - aSubkeyName = aKeyName + "\\" + OUString(SAL_U(buffKeyName)); + aSubkeyName = aKeyName + "\\" + + OUString( + reinterpret_cast<sal_Unicode const *>(buffKeyName)); //Recursion, until no more subkeys are found dumpWindowsRegistryKey(hKey, aSubkeyName, aFileHandle); @@ -119,8 +126,8 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil // No more subkeys, we are at a leaf auto pValueName = std::unique_ptr<wchar_t[]>( new wchar_t[nLongestValueNameLen + 1]); - auto pValue = std::unique_ptr<wchar_t[]>( - new wchar_t[nLongestValueLen + 1]); + auto pValue = std::unique_ptr<unsigned char[]>( + new unsigned char[(nLongestValueLen + 1) * sizeof (wchar_t)]); bool bFinal = false; OUString aValue; @@ -131,15 +138,17 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil DWORD nValueNameLen = nLongestValueNameLen + 1; DWORD nValueLen = nLongestValueLen + 1; - RegEnumValueW(hCurKey, i, pValueName.get(), &nValueNameLen, nullptr, nullptr, reinterpret_cast<LPBYTE>(pValue.get()), &nValueLen); + RegEnumValueW(hCurKey, i, pValueName.get(), &nValueNameLen, nullptr, nullptr, pValue.get(), &nValueLen); const wchar_t wsValue[] = L"Value"; const wchar_t wsFinal[] = L"Final"; const wchar_t wsType[] = L"Type"; if(!wcscmp(pValueName.get(), wsValue)) - aValue = OUString(SAL_U(pValue.get())); + aValue = OUString( + reinterpret_cast<sal_Unicode const *>(pValue.get())); if (!wcscmp(pValueName.get(), wsType)) - aType = OUString(SAL_U(pValue.get())); + aType = OUString( + reinterpret_cast<sal_Unicode const *>(pValue.get())); if(!wcscmp(pValueName.get(), wsFinal) && *reinterpret_cast<DWORD*>(pValue.get()) == 1) bFinal = true; } |