Replace more PROFILE_ functions by RegQueryValueExA.

This commit is contained in:
Dmitry Timoshkov 2001-06-14 19:24:02 +00:00 committed by Alexandre Julliard
parent 183eae9096
commit a57befe72d
5 changed files with 53 additions and 15 deletions

View File

@ -20,7 +20,6 @@
#include "hook.h" #include "hook.h"
#include "nonclient.h" #include "nonclient.h"
#include "debugtools.h" #include "debugtools.h"
#include "options.h"
#include "shellapi.h" #include "shellapi.h"
#include "bitmap.h" #include "bitmap.h"

View File

@ -10,10 +10,10 @@
#include <stdio.h> #include <stdio.h>
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "winreg.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "win.h" #include "win.h"
#include "options.h"
#include "debugtools.h" #include "debugtools.h"
#include "spy.h" #include "spy.h"
#include "commctrl.h" #include "commctrl.h"
@ -1756,10 +1756,17 @@ int SPY_Init(void)
int i; int i;
char buffer[1024]; char buffer[1024];
const SPY_NOTIFY *p; const SPY_NOTIFY *p;
HKEY hkey;
if (!TRACE_ON(message)) return TRUE; 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" )) if (buffer[0] && strcmp( buffer, "INCLUDEALL" ))
{ {
TRACE("Include=%s\n", buffer ); TRACE("Include=%s\n", buffer );
@ -1767,7 +1774,13 @@ int SPY_Init(void)
SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i])); 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]) if (buffer[0])
{ {
TRACE("Exclude=%s\n", buffer ); TRACE("Exclude=%s\n", buffer );
@ -1778,7 +1791,14 @@ int SPY_Init(void)
SPY_Exclude[i] = (MessageTypeNames[i] && strstr(buffer,MessageTypeNames[i])); 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 */ /* find last good entry in spy notify array and save addr for b-search */
p = &spnfy_array[0]; p = &spnfy_array[0];

View File

@ -6,19 +6,40 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <assert.h> #include <assert.h>
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "winbase.h" #include "winbase.h"
#include "winreg.h"
#include "winuser.h" #include "winuser.h"
#include "options.h"
#include "user.h" #include "user.h"
#include "sysmetrics.h" #include "sysmetrics.h"
static int sysMetrics[SM_WINE_CMETRICS+1]; 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 * SYSMETRICS_Init
* *
@ -48,21 +69,21 @@ void SYSMETRICS_Init(void)
sysMetrics[SM_WINE_BPP] = GetDeviceCaps( hdc, BITSPIXEL ); sysMetrics[SM_WINE_BPP] = GetDeviceCaps( hdc, BITSPIXEL );
if (TWEAK_WineLook > WIN31_LOOK) if (TWEAK_WineLook > WIN31_LOOK)
sysMetrics[SM_CXVSCROLL] = sysMetrics[SM_CXVSCROLL] =
PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 16); SYSMETRICS_GetProfileInt("Tweak.Layout", "ScrollBarWidth", 16);
else else
sysMetrics[SM_CXVSCROLL] = sysMetrics[SM_CXVSCROLL] =
PROFILE_GetWineIniInt("Tweak.Layout", "ScrollBarWidth", 17); SYSMETRICS_GetProfileInt("Tweak.Layout", "ScrollBarWidth", 17);
sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL];
if (TWEAK_WineLook > WIN31_LOOK) if (TWEAK_WineLook > WIN31_LOOK)
sysMetrics[SM_CYCAPTION] = sysMetrics[SM_CYCAPTION] =
PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 19); SYSMETRICS_GetProfileInt("Tweak.Layout", "CaptionHeight", 19);
else else
sysMetrics[SM_CYCAPTION] = sysMetrics[SM_CYCAPTION] =
PROFILE_GetWineIniInt("Tweak.Layout", "CaptionHeight", 20); SYSMETRICS_GetProfileInt("Tweak.Layout", "CaptionHeight", 20);
sysMetrics[SM_CXBORDER] = 1; sysMetrics[SM_CXBORDER] = 1;
sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER]; sysMetrics[SM_CYBORDER] = sysMetrics[SM_CXBORDER];
sysMetrics[SM_CXDLGFRAME] = sysMetrics[SM_CXDLGFRAME] =
PROFILE_GetWineIniInt("Tweak.Layout", "DialogFrameWidth", SYSMETRICS_GetProfileInt("Tweak.Layout", "DialogFrameWidth",
(TWEAK_WineLook > WIN31_LOOK) ? 3 : 4); (TWEAK_WineLook > WIN31_LOOK) ? 3 : 4);
sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME];
sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1; sysMetrics[SM_CYVTHUMB] = sysMetrics[SM_CXVSCROLL] - 1;
@ -71,10 +92,10 @@ void SYSMETRICS_Init(void)
sysMetrics[SM_CYICON] = 32; sysMetrics[SM_CYICON] = 32;
if (TWEAK_WineLook > WIN31_LOOK) if (TWEAK_WineLook > WIN31_LOOK)
sysMetrics[SM_CYMENU] = sysMetrics[SM_CYMENU] =
PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 19); SYSMETRICS_GetProfileInt("Tweak.Layout", "MenuHeight", 19);
else else
sysMetrics[SM_CYMENU] = sysMetrics[SM_CYMENU] =
PROFILE_GetWineIniInt("Tweak.Layout", "MenuHeight", 18); SYSMETRICS_GetProfileInt("Tweak.Layout", "MenuHeight", 18);
sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN]; sysMetrics[SM_CXFULLSCREEN] = sysMetrics[SM_CXSCREEN];
sysMetrics[SM_CYFULLSCREEN] = sysMetrics[SM_CYFULLSCREEN] =
sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION]; sysMetrics[SM_CYSCREEN] - sysMetrics[SM_CYCAPTION];

View File

@ -10,7 +10,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "options.h"
#include "win.h" #include "win.h"
#include "heap.h" #include "heap.h"
#include "user.h" #include "user.h"

View File

@ -19,7 +19,6 @@
#include "hook.h" #include "hook.h"
#include "message.h" #include "message.h"
#include "queue.h" #include "queue.h"
#include "options.h"
#include "winpos.h" #include "winpos.h"
#include "dce.h" #include "dce.h"
#include "nonclient.h" #include "nonclient.h"