From a57befe72d00ae4e24a82ad18b453cbaedf053f6 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 14 Jun 2001 19:24:02 +0000 Subject: [PATCH] Replace more PROFILE_ functions by RegQueryValueExA. --- windows/nonclient.c | 1 - windows/spy.c | 28 ++++++++++++++++++++++++---- windows/sysmetrics.c | 37 +++++++++++++++++++++++++++++-------- windows/win.c | 1 - windows/winpos.c | 1 - 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/windows/nonclient.c b/windows/nonclient.c index e8f8c8732c7..709111c1160 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -20,7 +20,6 @@ #include "hook.h" #include "nonclient.h" #include "debugtools.h" -#include "options.h" #include "shellapi.h" #include "bitmap.h" diff --git a/windows/spy.c b/windows/spy.c index 33d5718aba1..96e06728a40 100644 --- a/windows/spy.c +++ b/windows/spy.c @@ -10,10 +10,10 @@ #include #include "windef.h" #include "wingdi.h" +#include "winreg.h" #include "wine/winuser16.h" #include "wine/winbase16.h" #include "win.h" -#include "options.h" #include "debugtools.h" #include "spy.h" #include "commctrl.h" @@ -1756,10 +1756,17 @@ int SPY_Init(void) int i; char buffer[1024]; const SPY_NOTIFY *p; + HKEY hkey; if (!TRACE_ON(message)) return TRUE; - PROFILE_GetWineIniString( "Spy", "Include", "", buffer, sizeof(buffer) ); + buffer[0] = 0; + if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Spy", &hkey)) + { + DWORD type, count = sizeof(buffer); + RegQueryValueExA(hkey, "Include", 0, &type, buffer, &count); + RegCloseKey(hkey); + } if (buffer[0] && strcmp( buffer, "INCLUDEALL" )) { TRACE("Include=%s\n", buffer ); @@ -1767,7 +1774,13 @@ int SPY_Init(void) SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i])); } - PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer, sizeof(buffer) ); + buffer[0] = 0; + if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Spy", &hkey)) + { + DWORD type, count = sizeof(buffer); + RegQueryValueExA(hkey, "Exclude", 0, &type, buffer, &count); + RegCloseKey(hkey); + } if (buffer[0]) { TRACE("Exclude=%s\n", buffer ); @@ -1778,7 +1791,14 @@ int SPY_Init(void) SPY_Exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i])); } - SPY_ExcludeDWP = PROFILE_GetWineIniInt( "Spy", "ExcludeDWP", 0 ); + SPY_ExcludeDWP = 0; + if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Spy", &hkey)) + { + DWORD type, count = sizeof(buffer); + if(!RegQueryValueExA(hkey, "ExcludeDWP", 0, &type, buffer, &count)) + SPY_ExcludeDWP = atoi(buffer); + RegCloseKey(hkey); + } /* find last good entry in spy notify array and save addr for b-search */ p = &spnfy_array[0]; diff --git a/windows/sysmetrics.c b/windows/sysmetrics.c index cdf59c07a1a..80656efa486 100644 --- a/windows/sysmetrics.c +++ b/windows/sysmetrics.c @@ -6,19 +6,40 @@ */ #include +#include #include #include "windef.h" #include "wingdi.h" #include "wine/winuser16.h" #include "winbase.h" +#include "winreg.h" #include "winuser.h" -#include "options.h" #include "user.h" #include "sysmetrics.h" static int sysMetrics[SM_WINE_CMETRICS+1]; +static int SYSMETRICS_GetProfileInt(const char *section, const char *key, + int default_value) +{ + int ret = default_value; + char buffer[1024]; + HKEY hkey; + + strcpy(buffer, "Software\\Wine\\Wine\\Config\\"); + strncat(buffer, section, sizeof(buffer) - strlen(buffer)); + + if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, buffer, &hkey)) + { + DWORD type, count = sizeof(buffer); + if(!RegQueryValueExA(hkey, key, 0, &type, buffer, &count)) + ret = atoi(buffer); + RegCloseKey(hkey); + } + return ret; +} + /*********************************************************************** * SYSMETRICS_Init * @@ -48,21 +69,21 @@ void SYSMETRICS_Init(void) sysMetrics[SM_WINE_BPP] = GetDeviceCaps( hdc, BITSPIXEL ); if (TWEAK_WineLook > WIN31_LOOK) sysMetrics[SM_CXVSCROLL] = - PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16); + SYSMETRICS_GetProfileInt("Tweak.Layout", "ScrollBarWidth", 16); else sysMetrics[SM_CXVSCROLL] = - PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 17); + SYSMETRICS_GetProfileInt("Tweak.Layout", "ScrollBarWidth", 17); sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; if (TWEAK_WineLook > WIN31_LOOK) sysMetrics[SM_CYCAPTION] = - PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 19); + SYSMETRICS_GetProfileInt("Tweak.Layout", "CaptionHeight", 19); else sysMetrics[SM_CYCAPTION] = - PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 20); + SYSMETRICS_GetProfileInt("Tweak.Layout", "CaptionHeight", 20); sysMetrics[SM_CXBORDER] = 1; sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER]; sysMetrics[SM_CXDLGFRAME] = - PROFILE_GetWineIniInt("Tweak.Layout", "DialogFrameWidth", + SYSMETRICS_GetProfileInt("Tweak.Layout", "DialogFrameWidth", (TWEAK_WineLook > WIN31_LOOK) ? 3 : 4); sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1; @@ -71,10 +92,10 @@ void SYSMETRICS_Init(void) sysMetrics[SM_CYICON] = 32; if (TWEAK_WineLook > WIN31_LOOK) sysMetrics[SM_CYMENU] = - PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 19); + SYSMETRICS_GetProfileInt("Tweak.Layout", "MenuHeight", 19); else sysMetrics[SM_CYMENU] = - PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 18); + SYSMETRICS_GetProfileInt("Tweak.Layout", "MenuHeight", 18); sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN]; sysMetrics[SM_CYFULLSCREEN] = sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION]; diff --git a/windows/win.c b/windows/win.c index ab43058e1f7..785dd222b67 100644 --- a/windows/win.c +++ b/windows/win.c @@ -10,7 +10,6 @@ #include "wine/winbase16.h" #include "wine/winuser16.h" #include "wine/unicode.h" -#include "options.h" #include "win.h" #include "heap.h" #include "user.h" diff --git a/windows/winpos.c b/windows/winpos.c index afcf9cc0bdc..42a7e3513e1 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -19,7 +19,6 @@ #include "hook.h" #include "message.h" #include "queue.h" -#include "options.h" #include "winpos.h" #include "dce.h" #include "nonclient.h"