dwDataSize needs to be reset before each RegQueryValueEx() call.

This commit is contained in:
Slava Monich 1999-06-12 06:46:46 +00:00 committed by Alexandre Julliard
parent db98ffdd8e
commit 50d74e1ff2
1 changed files with 6 additions and 4 deletions

View File

@ -118,7 +118,6 @@ void SYSCOLOR_Init(void)
char buffer[100];
BOOL bOk = FALSE, bNoReg = FALSE;
HKEY hKey;
DWORD dwDataSize = 32;
p = (TWEAK_WineLook == WIN31_LOOK) ? DefSysColors : DefSysColors95;
@ -134,9 +133,12 @@ void SYSCOLOR_Init(void)
/* first try, registry */
if (!bNoReg)
if (!(RegQueryValueExA(hKey, (LPSTR)(p[i*2]), 0, 0, (LPBYTE) &buffer[0], &dwDataSize)))
if (sscanf( buffer, "%d %d %d", &r, &g, &b ) == 3)
bOk = TRUE;
{
DWORD dwDataSize = sizeof(buffer);
if (!(RegQueryValueExA(hKey,(LPSTR)p[i*2], 0, 0, buffer, &dwDataSize)))
if (sscanf( buffer, "%d %d %d", &r, &g, &b ) == 3)
bOk = TRUE;
}
/* second try, win.ini */
if (!bOk)