Always zero destination buffer in SYSPARAMS_LoadRaw(). Remove

now-superfluous memory zeroing in some other places.
This commit is contained in:
Frank Richter 2005-07-08 11:30:50 +00:00 committed by Alexandre Julliard
parent 7dde735180
commit cd57c21259
1 changed files with 5 additions and 7 deletions

View File

@ -458,10 +458,10 @@ static BOOL SYSPARAMS_LoadRaw( LPCWSTR lpRegKey, LPCWSTR lpValName, LPBYTE lpBuf
DWORD type; DWORD type;
HKEY hKey; HKEY hKey;
memset( lpBuf, 0, count );
if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS) || if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS) ||
(RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS)) (RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS))
{ {
memset( lpBuf, 0, count );
ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, (LPBYTE)lpBuf, &count); ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, (LPBYTE)lpBuf, &count);
RegCloseKey( hKey ); RegCloseKey( hKey );
} }
@ -2460,9 +2460,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
spi_idx = SPI_SETGRADIENTCAPTIONS_IDX; spi_idx = SPI_SETGRADIENTCAPTIONS_IDX;
if (!SYSPARAMS_LoadRaw( SPI_USERPREFERENCEMASK_REGKEY, SYSPARAMS_LoadRaw( SPI_USERPREFERENCEMASK_REGKEY,
SPI_USERPREFERENCEMASK_VALNAME, buf, sizeof(buf) )) SPI_USERPREFERENCEMASK_VALNAME, buf, sizeof(buf) );
memset (buf, 0, sizeof (buf));
if (b) if (b)
buf[0] |= 0x10; buf[0] |= 0x10;
@ -2574,9 +2573,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
spi_idx = SPI_SETFLATMENU_IDX; spi_idx = SPI_SETFLATMENU_IDX;
if (!SYSPARAMS_LoadRaw( SPI_USERPREFERENCEMASK_REGKEY, SYSPARAMS_LoadRaw( SPI_USERPREFERENCEMASK_REGKEY,
SPI_USERPREFERENCEMASK_VALNAME, buf, sizeof(buf) )) SPI_USERPREFERENCEMASK_VALNAME, buf, sizeof(buf) );
memset (buf, 0, sizeof (buf));
if (b) if (b)
buf[2] |= 0x02; buf[2] |= 0x02;