Remove some unneeded casts

This also changes the API used in WriteLibraryToRegistry.

Change-Id: Iba4c20567275a64684be8695c771e4c5535956ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168912
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2024-06-15 23:35:45 +05:00
parent aaf2967d74
commit 52a2c19fc4
3 changed files with 5 additions and 5 deletions

View file

@ -71,7 +71,7 @@ namespace {
pos += suffix.copy(pos, suffix.size());
assert(pos == end - 1);
*pos = 0;
if (ERROR_SUCCESS == RegSetValueExW(HKEY_LOCAL_MACHINE, pSubKey, 0, REG_SZ, reinterpret_cast<const BYTE*>(pLibrary), nLen*sizeof(wchar_t)))
if (ERROR_SUCCESS == RegSetKeyValueW(HKEY_LOCAL_MACHINE, pSubKey, nullptr, REG_SZ, pLibrary, nLen*sizeof(wchar_t)))
bLocalSuccess = true;
}

View file

@ -30,7 +30,7 @@
bool SetRegistryKey(HKEY RootKey, const Filepath_char_t* KeyName, const Filepath_char_t* ValueName, const Filepath_char_t* Value)
{
int rc = RegSetKeyValueW(RootKey, KeyName, ValueName, REG_SZ, reinterpret_cast<LPCVOID>(Value),
int rc = RegSetKeyValueW(RootKey, KeyName, ValueName, REG_SZ, Value,
(wcslen(Value) + 1) * sizeof(*Value));
return (ERROR_SUCCESS == rc);
}
@ -59,7 +59,7 @@ bool QueryRegistryKey(HKEY RootKey, const Filepath_char_t* KeyName, const Filepa
{
DWORD dwBytes = dwBufLen * sizeof(*pszData);
LSTATUS rc = RegGetValueW(RootKey, KeyName, ValueName, RRF_RT_REG_SZ, nullptr,
reinterpret_cast<LPBYTE>(pszData), &dwBytes);
pszData, &dwBytes);
return (ERROR_SUCCESS == rc);
}

View file

@ -2656,7 +2656,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
wchar_t aValueBuf[10];
DWORD nValueSize = sizeof( aValueBuf );
if (RegGetValueW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", L"MenuShowDelay",
RRF_RT_REG_SZ, nullptr, reinterpret_cast<LPVOID>(aValueBuf), &nValueSize)
RRF_RT_REG_SZ, nullptr, aValueBuf, &nValueSize)
== ERROR_SUCCESS)
{
aMouseSettings.SetMenuDelay( static_cast<sal_uLong>(ImplW2I( aValueBuf )) );
@ -2947,7 +2947,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
DWORD nValueSize = sizeof( aValueBuf );
if (RegGetValueW(HKEY_CURRENT_USER,
L"Control Panel\\International\\Calendars\\TwoDigitYearMax", L"1",
RRF_RT_REG_SZ, nullptr, reinterpret_cast<LPVOID>(aValueBuf), &nValueSize)
RRF_RT_REG_SZ, nullptr, aValueBuf, &nValueSize)
== ERROR_SUCCESS)
{
DWORD nValue = static_cast<sal_uLong>(ImplW2I(aValueBuf));