ReactOS 0.4.16-dev-125-g798ea90
general.c File Reference
#include "wined3dcfg.h"
#include <winreg.h>
Include dependency graph for general.c:

Go to the source code of this file.

Functions

void InitControl (HWND hWndDlg, HKEY hKey, PWCHAR szKey, PWINED3D_SETTINGS pSettings, INT iControlId, INT iCount)
 
static VOID InitSettings (HWND hWndDlg)
 
static VOID SaveSetting (HWND hWnd, HKEY hKey, PWCHAR szKey, PWINED3D_SETTINGS pCfg, INT iControlId, INT iCount)
 
static VOID WriteSettings (HWND hWndDlg)
 
INT_PTR CALLBACK GeneralPageProc (HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

WINED3D_SETTINGS gwd3dsShaderLvl []
 
WINED3D_SETTINGS gwd3dsDisable []
 
WINED3D_SETTINGS gwd3dsEnable []
 
WINED3D_SETTINGS gwd3dsOffscreen []
 
WINED3D_SETTINGS gwd3dsVidMem []
 
WINED3D_SETTINGS gwd3dsDdRender []
 

Function Documentation

◆ GeneralPageProc()

INT_PTR CALLBACK GeneralPageProc ( HWND  hWndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 146 of file general.c.

147{
148 LPPSHNOTIFY lppsn;
149
150 switch (uMsg)
151 {
152 case WM_INITDIALOG:
153 InitSettings(hWndDlg);
154 return TRUE;
155
156 case WM_COMMAND:
158 PropSheet_Changed(GetParent(hWndDlg), hWndDlg);
159 break;
160
161 case WM_NOTIFY:
162 lppsn = (LPPSHNOTIFY)lParam;
163 if (lppsn->hdr.code == PSN_APPLY)
164 {
165 WriteSettings(hWndDlg);
166 return TRUE;
167 }
168 break;
169 }
170
171 return FALSE;
172}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static VOID InitSettings(HWND hWndDlg)
Definition: general.c:9
static VOID WriteSettings(HWND hWndDlg)
Definition: general.c:124
#define IDC_MIN
Definition: resource.h:10
#define IDC_MAX
Definition: resource.h:21
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
struct _PSHNOTIFY * LPPSHNOTIFY
#define WM_NOTIFY
Definition: richedit.h:61
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3162
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
#define CBN_SELCHANGE
Definition: winuser.h:1982
HWND WINAPI GetParent(_In_ HWND)

Referenced by Applet(), AppletInit(), PropSheetThread(), and SystemApplet().

◆ InitControl()

void InitControl ( HWND  hWndDlg,
HKEY  hKey,
PWCHAR  szKey,
PWINED3D_SETTINGS  pSettings,
INT  iControlId,
INT  iCount 
)

Definition at line 51 of file general.c.

52{
53 WCHAR szBuffer[MAX_KEY_LENGTH];
54 DWORD dwSize = sizeof(szBuffer);
55 DWORD dwType = 0;
56 INT iCurrent;
57 INT iActive = 0;
58
59 RegQueryValueExW(hKey, szKey, NULL, &dwType, (LPBYTE)szBuffer, &dwSize);
60
61 for(iCurrent = 0; iCurrent < iCount; iCurrent++)
62 {
63 SendDlgItemMessageW(hWndDlg, iControlId, CB_ADDSTRING, 0, (LPARAM)pSettings[iCurrent].szValue);
64
65 if(dwSize && ((dwType == REG_DWORD && *szBuffer == pSettings[iCurrent].iValue) ||
66 (dwType == REG_SZ && !wcscmp(szBuffer, pSettings[iCurrent].szValue))))
67 {
68 iActive = iCurrent;
69 }
70 }
71
72 SendDlgItemMessageW(hWndDlg, iControlId, CB_SETCURSEL, iActive, 0);
73
74}
#define NULL
Definition: types.h:112
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define MAX_KEY_LENGTH
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
#define REG_SZ
Definition: layer.c:22
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_SETCURSEL
Definition: winuser.h:1964
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_ADDSTRING
Definition: winuser.h:1939
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ InitSettings()

static VOID InitSettings ( HWND  hWndDlg)
static

Definition at line 76 of file general.c.

77{
78 HKEY hKey;
79
81 return;
82
84 INIT_CONTROL(OFFSCREEN, gwd3dsOffscreen);
85 INIT_CONTROL(VIDMEMSIZE, gwd3dsVidMem);
86 INIT_CONTROL(MULTISAMPLING, gwd3dsDisable);
87 INIT_CONTROL(STRICTDRAWORDERING, gwd3dsEnable);
88 INIT_CONTROL(ALWAYSOFFSCREEN, gwd3dsEnable);
89 INIT_CONTROL(DDRENDERER, gwd3dsDdRender);
93
95}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
WINED3D_SETTINGS gwd3dsDisable[]
Definition: general.c:13
WINED3D_SETTINGS gwd3dsShaderLvl[]
Definition: general.c:5
WINED3D_SETTINGS gwd3dsEnable[]
Definition: general.c:19
WINED3D_SETTINGS gwd3dsOffscreen[]
Definition: general.c:25
WINED3D_SETTINGS gwd3dsDdRender[]
Definition: general.c:44
WINED3D_SETTINGS gwd3dsVidMem[]
Definition: general.c:32
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define KEY_WINE
Definition: wined3dcfg.h:23
#define INIT_CONTROL(a, b)
Definition: wined3dcfg.h:36
#define HKEY_CURRENT_USER
Definition: winreg.h:11

◆ SaveSetting()

static VOID SaveSetting ( HWND  hWnd,
HKEY  hKey,
PWCHAR  szKey,
PWINED3D_SETTINGS  pCfg,
INT  iControlId,
INT  iCount 
)
static

Definition at line 98 of file general.c.

99{
100 INT iSel = 0;
101
102 iSel = (INT)SendDlgItemMessageW(hWnd, iControlId, CB_GETCURSEL, 0, 0);
103
104 if(iSel < 0 || iSel > iCount)
105 return;
106
107 if(pCfg[iSel].iType == REG_NONE)
108 {
109 RegDeleteValueW(hKey, szKey);
110 return;
111 }
112
113 if(pCfg[iSel].iType == REG_DWORD)
114 {
115 RegSetValueExW(hKey, szKey, 0, REG_DWORD, (LPBYTE)&pCfg[iSel].iValue, sizeof(pCfg[iSel].iValue));
116 return;
117 } else if (pCfg[iSel].iType == REG_SZ)
118 {
119 RegSetValueExW(hKey, szKey, 0, pCfg[iSel].iType, (LPBYTE)pCfg[iSel].szValue, (wcslen(pCfg[iSel].szValue) + 1) * sizeof(WCHAR));
120 }
121}
HWND hWnd
Definition: settings.c:17
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_NONE
Definition: nt_native.h:1492
#define INT
Definition: polytest.cpp:20
_In_ ULONG iType
Definition: winddi.h:3748
#define CB_GETCURSEL
Definition: winuser.h:1946

◆ WriteSettings()

static VOID WriteSettings ( HWND  hWndDlg)
static

Definition at line 124 of file general.c.

125{
126 HKEY hKey;
127
129 return;
130
132 SAVE_CONTROL(OFFSCREEN, gwd3dsOffscreen);
133 SAVE_CONTROL(VIDMEMSIZE, gwd3dsVidMem);
134 SAVE_CONTROL(MULTISAMPLING, gwd3dsDisable);
135 SAVE_CONTROL(STRICTDRAWORDERING, gwd3dsEnable);
136 SAVE_CONTROL(ALWAYSOFFSCREEN, gwd3dsEnable);
137 SAVE_CONTROL(DDRENDERER, gwd3dsDdRender);
141
143}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define KEY_WRITE
Definition: nt_native.h:1031
#define SAVE_CONTROL(a, b)
Definition: wined3dcfg.h:37

Referenced by GeneralPageProc().

Variable Documentation

◆ gwd3dsDdRender

WINED3D_SETTINGS gwd3dsDdRender[]
Initial value:
=
{
}
#define VALUE_GDI
Definition: wined3dcfg.h:15
#define VALUE_DEFAULT
Definition: wined3dcfg.h:21

Definition at line 44 of file general.c.

Referenced by InitSettings(), and WriteSettings().

◆ gwd3dsDisable

WINED3D_SETTINGS gwd3dsDisable[]
Initial value:
=
{
}
#define VALUE_DISABLED
Definition: wined3dcfg.h:17

Definition at line 13 of file general.c.

Referenced by InitSettings(), and WriteSettings().

◆ gwd3dsEnable

WINED3D_SETTINGS gwd3dsEnable[]
Initial value:
=
{
}
#define VALUE_ENABLED
Definition: wined3dcfg.h:16

Definition at line 19 of file general.c.

Referenced by InitSettings(), and WriteSettings().

◆ gwd3dsOffscreen

WINED3D_SETTINGS gwd3dsOffscreen[]
Initial value:
=
{
}
#define VALUE_BACKBUFFER
Definition: wined3dcfg.h:19
#define VALUE_FBO
Definition: wined3dcfg.h:20

Definition at line 25 of file general.c.

Referenced by InitSettings(), and WriteSettings().

◆ gwd3dsShaderLvl

WINED3D_SETTINGS gwd3dsShaderLvl[]
Initial value:
=
{
{L"1.4", REG_DWORD, 1},
{L"2", REG_DWORD, 2},
{L"3", REG_DWORD, 3},
}
#define L(x)
Definition: ntvdm.h:50

Definition at line 5 of file general.c.

Referenced by InitSettings(), and WriteSettings().

◆ gwd3dsVidMem

WINED3D_SETTINGS gwd3dsVidMem[]
Initial value:
=
{
{L"8 MB", REG_SZ, 8},
{L"16 MB", REG_SZ, 16},
{L"32 MB", REG_SZ, 32},
{L"64 MB", REG_SZ, 64},
{L"128 MB", REG_SZ, 128},
{L"256 MB", REG_SZ, 256},
{L"512 MB", REG_SZ, 512},
}

Definition at line 32 of file general.c.

Referenced by InitSettings(), and WriteSettings().