ReactOS  0.4.12-dev-934-g9a4676f
proppage.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for proppage.c:

Go to the source code of this file.

Classes

struct  _MOUSE_INFO
 

Macros

#define NDEBUG
 
#define DEFAULT_SAMPLERATEINDEX   4
 
#define DEFAULT_WHEELDETECTION   2
 
#define DEFAULT_INPUTBUFFERSIZE   100
 
#define DEFAULT_MINBUFFERSIZE   100
 
#define DEFAULT_MAXBUFFERSIZE   300
 

Typedefs

typedef struct _MOUSE_INFO MOUSE_INFO
 
typedef struct _MOUSE_INFOPMOUSE_INFO
 

Functions

BOOL WINAPI CdromPropPageProvider (_In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, _In_ LPARAM lParam)
 
BOOL WINAPI DiskPropPageProvider (_In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, _In_ LPARAM lParam)
 
BOOL WINAPI EisaUpHalPropPageProvider (_In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, _In_ LPARAM lParam)
 
BOOL WINAPI LegacyDriverPropPageProvider (_In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, _In_ LPARAM lParam)
 
static DWORD MouseGetSampleRateIndex (DWORD dwSampleRate)
 
static BOOL MouseOnDialogInit (HWND hwndDlg, LPARAM lParam)
 
static VOID MouseOnCommand (HWND hwndDlg, WPARAM wParam, LPARAM lParam)
 
static VOID MouseOnApply (HWND hwndDlg)
 
static BOOL MouseOnNotify (HWND hwndDlg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR MouseOnCtrlColorStatic (HWND hwndDlg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK MouseDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static UINT CALLBACK MouseCallback (HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
 
BOOL WINAPI PS2MousePropPageProvider (_In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, _In_ LPARAM lParam)
 
BOOL WINAPI TapePropPageProvider (_In_ PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, _In_ LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, _In_ LPARAM lParam)
 

Variables

DWORD MouseSampleRates [] = {20, 40, 60, 80, 100, 200}
 

Macro Definition Documentation

◆ DEFAULT_INPUTBUFFERSIZE

#define DEFAULT_INPUTBUFFERSIZE   100

Definition at line 27 of file proppage.c.

◆ DEFAULT_MAXBUFFERSIZE

#define DEFAULT_MAXBUFFERSIZE   300

Definition at line 29 of file proppage.c.

◆ DEFAULT_MINBUFFERSIZE

#define DEFAULT_MINBUFFERSIZE   100

Definition at line 28 of file proppage.c.

◆ DEFAULT_SAMPLERATEINDEX

#define DEFAULT_SAMPLERATEINDEX   4

Definition at line 25 of file proppage.c.

◆ DEFAULT_WHEELDETECTION

#define DEFAULT_WHEELDETECTION   2

Definition at line 26 of file proppage.c.

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file proppage.c.

Typedef Documentation

◆ MOUSE_INFO

◆ PMOUSE_INFO

Function Documentation

◆ CdromPropPageProvider()

BOOL WINAPI CdromPropPageProvider ( _In_ PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
_In_ LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
_In_ LPARAM  lParam 
)

Definition at line 36 of file proppage.c.

40 {
41  DPRINT("CdromPropPageProvider(%p %p %lx)\n",
42  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
43  return FALSE;
44 }
void DPRINT(...)
Definition: polytest.cpp:61
LPARAM lParam
Definition: combotst.c:139

◆ DiskPropPageProvider()

BOOL WINAPI DiskPropPageProvider ( _In_ PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
_In_ LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
_In_ LPARAM  lParam 
)

Definition at line 52 of file proppage.c.

56 {
57  DPRINT("DiskPropPageProvider(%p %p %lx)\n",
58  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
59  return FALSE;
60 }
void DPRINT(...)
Definition: polytest.cpp:61
LPARAM lParam
Definition: combotst.c:139

◆ EisaUpHalPropPageProvider()

BOOL WINAPI EisaUpHalPropPageProvider ( _In_ PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
_In_ LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
_In_ LPARAM  lParam 
)

Definition at line 68 of file proppage.c.

72 {
73  DPRINT("EisaUpHalPropPageProvider(%p %p %lx)\n",
74  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
75  return FALSE;
76 }
void DPRINT(...)
Definition: polytest.cpp:61
LPARAM lParam
Definition: combotst.c:139

◆ LegacyDriverPropPageProvider()

BOOL WINAPI LegacyDriverPropPageProvider ( _In_ PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
_In_ LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
_In_ LPARAM  lParam 
)

Definition at line 84 of file proppage.c.

88 {
89  DPRINT1("LegacyDriverPropPageProvider(%p %p %lx)\n",
90  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
92  return FALSE;
93 }
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:114
LPARAM lParam
Definition: combotst.c:139

◆ MouseCallback()

static UINT CALLBACK MouseCallback ( HWND  hWnd,
UINT  uMsg,
LPPROPSHEETPAGE  ppsp 
)
static

Definition at line 488 of file proppage.c.

492 {
493  PMOUSE_INFO pMouseInfo;
494 
495  pMouseInfo = (PMOUSE_INFO)ppsp->lParam;
496 
497  if (uMsg == PSPCB_RELEASE)
498  {
499  if (pMouseInfo->hDeviceKey != NULL)
500  RegCloseKey(pMouseInfo->hDeviceKey);
501  HeapFree(GetProcessHeap(), 0, pMouseInfo);
502  }
503 
504  return 1;
505 }
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define PSPCB_RELEASE
Definition: prsht.h:37
HKEY hDeviceKey
Definition: proppage.c:16
#define GetProcessHeap()
Definition: compat.h:395
if(!(yy_init))
Definition: macro.lex.yy.c:714
struct _MOUSE_INFO * PMOUSE_INFO
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by PS2MousePropPageProvider().

◆ MouseDlgProc()

static INT_PTR CALLBACK MouseDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 457 of file proppage.c.

462 {
463  DPRINT("MouseDlgProc\n");
464 
465  switch (uMsg)
466  {
467  case WM_INITDIALOG:
468  return MouseOnDialogInit(hwndDlg, lParam);
469 
470  case WM_COMMAND:
471  MouseOnCommand(hwndDlg, wParam, lParam);
472  break;
473 
474  case WM_NOTIFY:
475  return MouseOnNotify(hwndDlg, wParam, lParam);
476 
477  case WM_CTLCOLORSTATIC:
478  return MouseOnCtrlColorStatic(hwndDlg, wParam, lParam);
479  }
480 
481  return FALSE;
482 }
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1748
WPARAM wParam
Definition: combotst.c:138
void DPRINT(...)
Definition: polytest.cpp:61
static INT_PTR MouseOnCtrlColorStatic(HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: proppage.c:440
#define WM_COMMAND
Definition: winuser.h:1716
static BOOL MouseOnNotify(HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: proppage.c:414
static BOOL MouseOnDialogInit(HWND hwndDlg, LPARAM lParam)
Definition: proppage.c:115
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
static VOID MouseOnCommand(HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: proppage.c:257

Referenced by PS2MousePropPageProvider().

◆ MouseGetSampleRateIndex()

static DWORD MouseGetSampleRateIndex ( DWORD  dwSampleRate)
static

Definition at line 98 of file proppage.c.

100 {
101  DWORD i;
102 
103  for (i = 0; i < ARRAYSIZE(MouseSampleRates); i++)
104  {
105  if (MouseSampleRates[i] == dwSampleRate)
106  return i;
107  }
108 
110 }
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define DEFAULT_SAMPLERATEINDEX
Definition: proppage.c:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD MouseSampleRates[]
Definition: proppage.c:23

Referenced by MouseOnDialogInit().

◆ MouseOnApply()

static VOID MouseOnApply ( HWND  hwndDlg)
static

Definition at line 320 of file proppage.c.

322 {
323  PMOUSE_INFO pMouseInfo;
324  DWORD dwSampleRateIndex = 0;
325  DWORD dwSampleRate, dwWheelDetection;
326  DWORD dwInputBufferLength;
327  DWORD dwInitPolled;
328  UINT uValue;
329  BOOL bFailed;
330  INT nIndex;
331 
332  pMouseInfo = (PMOUSE_INFO)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
333 
334  /* Get the sample rate setting and store it if it was changed */
336  CB_GETCURSEL, 0, 0);
337  if (nIndex == CB_ERR)
338  dwSampleRateIndex = DEFAULT_SAMPLERATEINDEX;
339  else
340  dwSampleRateIndex = (DWORD)nIndex;
341 
342  if (dwSampleRateIndex != pMouseInfo->dwSampleRateIndex)
343  {
344  dwSampleRate = MouseSampleRates[dwSampleRateIndex];
345  RegSetValueExW(pMouseInfo->hDeviceKey,
346  L"SampleRate",
347  0,
348  REG_DWORD,
349  (LPBYTE)&dwSampleRate,
350  sizeof(dwSampleRate));
351  }
352 
353  /* Get the wheel detection setting and store it if it was changed */
354  nIndex = SendDlgItemMessageW(hwndDlg, IDC_PS2MOUSEWHEEL,
355  CB_GETCURSEL, 0, 0);
356  if (nIndex == CB_ERR)
357  dwWheelDetection = DEFAULT_WHEELDETECTION;
358  else
359  dwWheelDetection = (DWORD)nIndex;
360 
361  if (dwWheelDetection != pMouseInfo->dwWheelDetection)
362  {
363  RegSetValueExW(pMouseInfo->hDeviceKey,
364  L"EnableWheelDetection",
365  0,
366  REG_DWORD,
367  (LPBYTE)&dwWheelDetection,
368  sizeof(dwWheelDetection));
369  }
370 
371  /* Get the input buffer length setting and store it if it was changed */
372  uValue = SendDlgItemMessageW(hwndDlg,
374  UDM_GETPOS32,
375  0,
376  (LPARAM)&bFailed);
377  if (bFailed)
378  dwInputBufferLength = DEFAULT_INPUTBUFFERSIZE;
379  else
380  dwInputBufferLength = (DWORD)uValue;
381 
382  if (dwInputBufferLength != pMouseInfo->dwInputBufferLength)
383  {
384  RegSetValueExW(pMouseInfo->hDeviceKey,
385  L"MouseDataQueueSize",
386  0,
387  REG_DWORD,
388  (LPBYTE)&dwInputBufferLength,
389  sizeof(dwInputBufferLength));
390  }
391 
392  /* Get the fast initialization setting and store it if it was changed */
393  uValue = SendDlgItemMessage(hwndDlg,
395  BM_GETCHECK,
396  0,
397  0);
398  dwInitPolled = (uValue == BST_CHECKED) ? 0 : 1;
399 
400  if (dwInitPolled != pMouseInfo->dwInitPolled)
401  {
402  RegSetValueExW(pMouseInfo->hDeviceKey,
403  L"MouseInitializePolled",
404  0,
405  REG_DWORD,
406  (LPBYTE)&dwInitPolled,
407  sizeof(dwInitPolled));
408  }
409 }
#define IDC_PS2MOUSEFASTINIT
Definition: resource.h:87
#define UDM_GETPOS32
Definition: commctrl.h:2128
#define SendDlgItemMessage
Definition: winuser.h:5708
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
#define DEFAULT_SAMPLERATEINDEX
Definition: proppage.c:25
DWORD dwInputBufferLength
Definition: proppage.c:19
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DEFAULT_INPUTBUFFERSIZE
Definition: proppage.c:27
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1879
HKEY hDeviceKey
Definition: proppage.c:16
#define CB_ERR
Definition: winuser.h:2389
#define IDC_PS2MOUSESAMPLERATE
Definition: resource.h:83
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:4917
DWORD dwInitPolled
Definition: proppage.c:20
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DEFAULT_WHEELDETECTION
Definition: proppage.c:26
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const WCHAR L[]
Definition: oid.c:1250
DWORD dwWheelDetection
Definition: proppage.c:18
#define IDC_PS2MOUSEINPUTUPDN
Definition: resource.h:86
DWORD dwSampleRateIndex
Definition: proppage.c:17
#define IDC_PS2MOUSEWHEEL
Definition: resource.h:84
unsigned int UINT
Definition: ndis.h:50
#define BST_CHECKED
Definition: winuser.h:197
DWORD MouseSampleRates[]
Definition: proppage.c:23
#define GetWindowLongPtr
Definition: treelist.c:73
#define REG_DWORD
Definition: sdbapi.c:596
struct _MOUSE_INFO * PMOUSE_INFO

Referenced by MouseOnNotify().

◆ MouseOnCommand()

static VOID MouseOnCommand ( HWND  hwndDlg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 257 of file proppage.c.

261 {
262  switch (LOWORD(wParam))
263  {
265  case IDC_PS2MOUSEWHEEL:
268  if (HIWORD(wParam) == CBN_SELCHANGE ||
270  {
271  /* Enable the Apply button */
272  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
273  }
274  break;
275 
277  if (HIWORD(wParam) == BN_CLICKED)
278  {
279  /* Sample rate: 100 */
280  SendDlgItemMessageW(hwndDlg,
282  CB_SETCURSEL,
284  0);
285 
286  /* Wheel detection: Assume wheel present */
287  SendDlgItemMessageW(hwndDlg,
289  CB_SETCURSEL,
291  0);
292 
293  /* Input buffer length: 100 packets */
294  SendDlgItemMessageW(hwndDlg,
296  UDM_SETPOS32,
297  0,
299 
300  /* Fast Initialization: Checked */
301  SendDlgItemMessage(hwndDlg,
303  BM_SETCHECK,
305  (LPARAM)0);
306 
307  /* Enable the Apply button */
308  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
309  }
310  break;
311 
312  default:
313  break;
314  }
315 }
#define IDC_PS2MOUSEFASTINIT
Definition: resource.h:87
#define IDC_PS2MOUSEDEFAULTS
Definition: resource.h:88
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
WPARAM wParam
Definition: combotst.c:138
#define DEFAULT_SAMPLERATEINDEX
Definition: proppage.c:25
#define IDC_PS2MOUSEINPUTLEN
Definition: resource.h:85
#define DEFAULT_INPUTBUFFERSIZE
Definition: proppage.c:27
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_PS2MOUSESAMPLERATE
Definition: resource.h:83
#define BM_SETCHECK
Definition: winuser.h:1882
#define CBN_EDITCHANGE
Definition: winuser.h:1936
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define UDM_SETPOS32
Definition: commctrl.h:2127
#define BN_CLICKED
Definition: winuser.h:1886
#define DEFAULT_WHEELDETECTION
Definition: proppage.c:26
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_SETCURSEL
Definition: winuser.h:1922
HWND WINAPI GetParent(_In_ HWND)
#define IDC_PS2MOUSEINPUTUPDN
Definition: resource.h:86
#define IDC_PS2MOUSEWHEEL
Definition: resource.h:84
#define CBN_SELCHANGE
Definition: winuser.h:1940
#define BST_CHECKED
Definition: winuser.h:197
#define HIWORD(l)
Definition: typedefs.h:246
#define LOWORD(l)
Definition: pedump.c:82

Referenced by MouseDlgProc().

◆ MouseOnCtrlColorStatic()

static INT_PTR MouseOnCtrlColorStatic ( HWND  hwndDlg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 440 of file proppage.c.

444 {
445  if ((HWND)lParam != GetDlgItem(hwndDlg, IDC_PS2MOUSEINPUTLEN))
446  return 0;
447 
451 }
static HDC
Definition: imagelist.c:92
int32_t INT_PTR
Definition: typedefs.h:62
#define COLOR_WINDOW
Definition: winuser.h:908
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define IDC_PS2MOUSEINPUTLEN
Definition: resource.h:85
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:884
HBRUSH WINAPI GetSysColorBrush(_In_ int)
LPARAM lParam
Definition: combotst.c:139

Referenced by MouseDlgProc().

◆ MouseOnDialogInit()

static BOOL MouseOnDialogInit ( HWND  hwndDlg,
LPARAM  lParam 
)
static

Definition at line 115 of file proppage.c.

118 {
119  PMOUSE_INFO pMouseInfo;
120  WCHAR szBuffer[64];
121  UINT i;
122  DWORD dwType, dwSize;
123  DWORD dwSampleRate;
124  LONG lError;
125 
126  /* Get the pointer to the mouse info struct */
127  pMouseInfo = (PMOUSE_INFO)((LPPROPSHEETPAGE)lParam)->lParam;
128  if (pMouseInfo == NULL)
129  return FALSE;
130 
131  /* Keep the pointer to the mouse info struct */
132  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pMouseInfo);
133 
134  /* Add the sample rates */
135  for (i = 0; i < ARRAYSIZE(MouseSampleRates); i++)
136  {
137  wsprintf(szBuffer, L"%lu", MouseSampleRates[i]);
138  SendDlgItemMessageW(hwndDlg,
140  CB_ADDSTRING,
141  0,
142  (LPARAM)szBuffer);
143  }
144 
145  /* Read the SampleRate parameter */
146  dwSize = sizeof(DWORD);
147  lError = RegQueryValueExW(pMouseInfo->hDeviceKey,
148  L"SampleRate",
149  NULL,
150  &dwType,
151  (LPBYTE)&dwSampleRate,
152  &dwSize);
153  if (lError == ERROR_SUCCESS && dwType == REG_DWORD && dwSize == sizeof(DWORD))
154  {
155  pMouseInfo->dwSampleRateIndex = MouseGetSampleRateIndex(dwSampleRate);
156  }
157  else
158  {
159  /* Set the default sample rate (100 samples per second) */
161  }
162 
163  /* Set the sample rate */
164  SendDlgItemMessageW(hwndDlg,
166  CB_SETCURSEL,
167  pMouseInfo->dwSampleRateIndex,
168  0);
169 
170  /* Add the detection options */
172  {
173  LoadStringW(hDllInstance, i, szBuffer, ARRAYSIZE(szBuffer));
174  SendDlgItemMessageW(hwndDlg,
176  CB_ADDSTRING,
177  0,
178  (LPARAM)szBuffer);
179  }
180 
181  /* Read the EnableWheelDetection parameter */
182  dwSize = sizeof(DWORD);
183  lError = RegQueryValueExW(pMouseInfo->hDeviceKey,
184  L"EnableWheelDetection",
185  NULL,
186  &dwType,
187  (LPBYTE)&pMouseInfo->dwWheelDetection,
188  &dwSize);
189  if (lError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD))
190  {
191  /* Set the default wheel detection parameter */
193  }
194 
195  /* Set the wheel detection parameter */
196  SendDlgItemMessageW(hwndDlg,
198  CB_SETCURSEL,
199  pMouseInfo->dwWheelDetection,
200  0);
201 
202  /* Set the input buffer length range: 100-300 */
203  SendDlgItemMessageW(hwndDlg,
208 
209  /* Read the MouseDataQueueSize parameter */
210  dwSize = sizeof(DWORD);
211  lError = RegQueryValueExW(pMouseInfo->hDeviceKey,
212  L"MouseDataQueueSize",
213  NULL,
214  &dwType,
215  (LPBYTE)&pMouseInfo->dwInputBufferLength,
216  &dwSize);
217  if (lError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD))
218  {
219  /* Set the default input buffer length (100 packets) */
221  }
222 
223  /* Set the input buffer length */
224  SendDlgItemMessageW(hwndDlg,
226  UDM_SETPOS32,
227  0,
228  pMouseInfo->dwInputBufferLength);
229 
230  /* Read the MouseInitializePolled parameter */
231  dwSize = sizeof(DWORD);
232  lError = RegQueryValueExW(pMouseInfo->hDeviceKey,
233  L"MouseInitializePolled",
234  NULL,
235  &dwType,
236  (LPBYTE)&pMouseInfo->dwInitPolled,
237  &dwSize);
238  if (lError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD))
239  {
240  /* Set the default init polled value (FALSE) */
241  pMouseInfo->dwInitPolled = 0;
242  }
243 
244  /* Set the fast initialization option */
245  SendDlgItemMessage(hwndDlg,
247  BM_SETCHECK,
248  (pMouseInfo->dwInitPolled == 0) ? BST_CHECKED : 0,
249  0);
250 
251  return TRUE;
252 }
#define IDC_PS2MOUSEFASTINIT
Definition: resource.h:87
#define IDS_ASSUMEPRESENT
Definition: resource.h:141
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define SendDlgItemMessage
Definition: winuser.h:5708
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DWORD
Definition: nt_native.h:44
#define SetWindowLongPtr
Definition: treelist.c:70
#define DEFAULT_SAMPLERATEINDEX
Definition: proppage.c:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
DWORD dwInputBufferLength
Definition: proppage.c:19
unsigned char * LPBYTE
Definition: typedefs.h:52
#define DEFAULT_INPUTBUFFERSIZE
Definition: proppage.c:27
long LONG
Definition: pedump.c:60
#define GWLP_USERDATA
Definition: treelist.c:63
#define CB_ADDSTRING
Definition: winuser.h:1897
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define DEFAULT_MINBUFFERSIZE
Definition: proppage.c:28
#define UDM_SETRANGE32
Definition: commctrl.h:2123
HKEY hDeviceKey
Definition: proppage.c:16
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_PS2MOUSESAMPLERATE
Definition: resource.h:83
#define BM_SETCHECK
Definition: winuser.h:1882
DWORD dwInitPolled
Definition: proppage.c:20
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define UDM_SETPOS32
Definition: commctrl.h:2127
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DEFAULT_WHEELDETECTION
Definition: proppage.c:26
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const WCHAR L[]
Definition: oid.c:1250
DWORD dwWheelDetection
Definition: proppage.c:18
#define CB_SETCURSEL
Definition: winuser.h:1922
#define IDS_DETECTIONDISABLED
Definition: resource.h:139
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define IDC_PS2MOUSEINPUTUPDN
Definition: resource.h:86
DWORD dwSampleRateIndex
Definition: proppage.c:17
#define IDC_PS2MOUSEWHEEL
Definition: resource.h:84
unsigned int UINT
Definition: ndis.h:50
#define BST_CHECKED
Definition: winuser.h:197
DWORD MouseSampleRates[]
Definition: proppage.c:23
#define wsprintf
Definition: winuser.h:5731
static DWORD MouseGetSampleRateIndex(DWORD dwSampleRate)
Definition: proppage.c:98
#define REG_DWORD
Definition: sdbapi.c:596
struct _MOUSE_INFO * PMOUSE_INFO
LPARAM lParam
Definition: combotst.c:139
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define DEFAULT_MAXBUFFERSIZE
Definition: proppage.c:29

Referenced by MouseDlgProc().

◆ MouseOnNotify()

static BOOL MouseOnNotify ( HWND  hwndDlg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 414 of file proppage.c.

418 {
419  switch (((LPNMHDR)lParam)->code)
420  {
421  case UDN_DELTAPOS:
422  if (((LPNMHDR)lParam)->idFrom == IDC_PS2MOUSEINPUTUPDN)
423  {
424  ((LPNMUPDOWN)lParam)->iDelta *= 10;
425  return FALSE;
426  }
427  break;
428 
429  case PSN_APPLY:
430  MouseOnApply(hwndDlg);
431  return TRUE;
432  }
433 
434  return FALSE;
435 }
#define TRUE
Definition: types.h:120
struct _NM_UPDOWN * LPNMUPDOWN
#define PSN_APPLY
Definition: prsht.h:117
#define UDN_DELTAPOS
Definition: commctrl.h:2141
static VOID MouseOnApply(HWND hwndDlg)
Definition: proppage.c:320
#define IDC_PS2MOUSEINPUTUPDN
Definition: resource.h:86
LPARAM lParam
Definition: combotst.c:139

Referenced by MouseDlgProc().

◆ PS2MousePropPageProvider()

BOOL WINAPI PS2MousePropPageProvider ( _In_ PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
_In_ LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
_In_ LPARAM  lParam 
)

Definition at line 513 of file proppage.c.

517 {
519  HPROPSHEETPAGE hPropSheetPage;
520  PMOUSE_INFO pMouseInfo;
521 
522  DPRINT("PS2MousePropPageProvider(%p %p %lx)\n",
523  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
524 
525  if (lpPropSheetPageRequest->PageRequested != SPPSR_ENUM_ADV_DEVICE_PROPERTIES)
526  return FALSE;
527 
528  pMouseInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MOUSE_INFO));
529  if (pMouseInfo == NULL)
530  return FALSE;
531 
532  pMouseInfo->hDeviceKey = SetupDiOpenDevRegKey(lpPropSheetPageRequest->DeviceInfoSet,
533  lpPropSheetPageRequest->DeviceInfoData,
535  0,
536  DIREG_DEV,
538  if (pMouseInfo->hDeviceKey == INVALID_HANDLE_VALUE)
539  {
540  DPRINT1("SetupDiOpenDevRegKey() failed (Error %lu)\n", GetLastError());
541  HeapFree(GetProcessHeap(), 0, pMouseInfo);
542  return FALSE;
543  }
544 
545  PropSheetPage.dwSize = sizeof(PROPSHEETPAGEW);
546  PropSheetPage.dwFlags = 0;
547  PropSheetPage.hInstance = hDllInstance;
549  PropSheetPage.pfnDlgProc = MouseDlgProc;
550  PropSheetPage.lParam = (LPARAM)pMouseInfo;
551  PropSheetPage.pfnCallback = MouseCallback;
552 
553  hPropSheetPage = CreatePropertySheetPageW(&PropSheetPage);
554  if (hPropSheetPage == NULL)
555  {
556  DPRINT1("CreatePropertySheetPageW() failed!\n");
557  HeapFree(GetProcessHeap(), 0, pMouseInfo);
558  return FALSE;
559  }
560 
561  if (!(*lpfnAddPropSheetPageProc)(hPropSheetPage, lParam))
562  {
563  DPRINT1("lpfnAddPropSheetPageProc() failed!\n");
564  DestroyPropertySheetPage(hPropSheetPage);
565  HeapFree(GetProcessHeap(), 0, pMouseInfo);
566  return FALSE;
567  }
568 
569  return TRUE;
570 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
static INT_PTR CALLBACK MouseDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: proppage.c:457
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3135
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static UINT CALLBACK MouseCallback(HWND hWnd, UINT uMsg, LPPROPSHEETPAGE ppsp)
Definition: proppage.c:488
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
struct _PROPSHEETPAGEW PROPSHEETPAGEW
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define IDD_PS2MOUSEPROPERTIES
Definition: resource.h:82
HKEY hDeviceKey
Definition: proppage.c:16
static HINSTANCE hDllInstance
Definition: clb.c:30
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
Definition: propsheet.c:3066
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define DIREG_DEV
Definition: setupapi.h:181
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
Definition: devinst.c:5919
#define SPPSR_ENUM_ADV_DEVICE_PROPERTIES
Definition: setupapi.h:610
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define DPRINT1
Definition: precomp.h:8
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ TapePropPageProvider()

BOOL WINAPI TapePropPageProvider ( _In_ PSP_PROPSHEETPAGE_REQUEST  lpPropSheetPageRequest,
_In_ LPFNADDPROPSHEETPAGE  lpfnAddPropSheetPageProc,
_In_ LPARAM  lParam 
)

Definition at line 578 of file proppage.c.

582 {
583  DPRINT("TapePropPageProvider(%p %p %lx)\n",
584  lpPropSheetPageRequest, lpfnAddPropSheetPageProc, lParam);
585  return FALSE;
586 }
void DPRINT(...)
Definition: polytest.cpp:61
LPARAM lParam
Definition: combotst.c:139

Variable Documentation

◆ MouseSampleRates

DWORD MouseSampleRates[] = {20, 40, 60, 80, 100, 200}

Definition at line 23 of file proppage.c.

Referenced by MouseGetSampleRateIndex(), MouseOnApply(), and MouseOnDialogInit().