Author: cwittich
Date: Sun Aug 3 05:38:37 2014
New Revision: 63796
URL: http://svn.reactos.org/svn/reactos?rev=63796&view=rev
Log:
user32: Make GetRegisteredRawInputDevices hotpatchable.
Steam tries to hook this function and crashes without DECLSPEC_HOTPATCH.
See http://bugs.winehq.org/show_bug.cgi?id=35361#c48
patch by Stefan Dösinger stefan(a)codeweavers.com
Modified:
trunk/reactos/win32ss/user/user32/misc/stubs.c
Modified: trunk/reactos/win32ss/user/user32/misc/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/s…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/stubs.c [iso-8859-1] Sun Aug 3 05:38:37 2014
@@ -346,6 +346,7 @@
*/
UINT
WINAPI
+DECLSPEC_HOTPATCH
GetRegisteredRawInputDevices(
PRAWINPUTDEVICE pRawInputDevices,
PUINT puiNumDevices,
Author: hbelusca
Date: Fri Aug 1 19:03:50 2014
New Revision: 63795
URL: http://svn.reactos.org/svn/reactos?rev=63795&view=rev
Log:
[KERNEL32]
Hack buffer protection check for pInputControl and lpBuffer user buffers.
Modified:
branches/condrv_restructure/dll/win32/kernel32/client/console/readwrite.c
Modified: branches/condrv_restructure/dll/win32/kernel32/client/console/readwrite.c
URL: http://svn.reactos.org/svn/reactos/branches/condrv_restructure/dll/win32/ke…
==============================================================================
--- branches/condrv_restructure/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] (original)
+++ branches/condrv_restructure/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] Fri Aug 1 19:03:50 2014
@@ -126,42 +126,53 @@
* "This parameter requires Unicode input by default.
* For ANSI mode, set this parameter to NULL."
*/
- if (bUnicode && pInputControl &&
- pInputControl->nLength == sizeof(CONSOLE_READCONSOLE_CONTROL))
- {
- /* Sanity check */
- if (pInputControl->nInitialChars <= nNumberOfCharsToRead)
- {
- ReadConsoleRequest->InitialNumBytes =
- pInputControl->nInitialChars * sizeof(WCHAR); // CharSize
-
- if (pInputControl->nInitialChars != 0)
+ _SEH2_TRY
+ {
+ if (bUnicode && pInputControl &&
+ pInputControl->nLength == sizeof(CONSOLE_READCONSOLE_CONTROL))
+ {
+ /* Sanity check */
+ if (pInputControl->nInitialChars <= nNumberOfCharsToRead)
{
- /*
- * It is possible here to overwrite the static buffer, in case
- * the number of bytes to read was smaller than the static buffer.
- * In this case, this means we are continuing a pending read,
- * and we do not need in fact the executable name that was
- * stored in the static buffer because it was first grabbed when
- * we started the first read.
- */
- RtlCopyMemory(ReadConsoleRequest->Buffer,
- lpBuffer,
- ReadConsoleRequest->InitialNumBytes);
+ ReadConsoleRequest->InitialNumBytes =
+ pInputControl->nInitialChars * sizeof(WCHAR); // CharSize
+
+ if (pInputControl->nInitialChars != 0)
+ {
+ /*
+ * It is possible here to overwrite the static buffer, in case
+ * the number of bytes to read was smaller than the static buffer.
+ * In this case, this means we are continuing a pending read,
+ * and we do not need in fact the executable name that was
+ * stored in the static buffer because it was first grabbed when
+ * we started the first read.
+ */
+ RtlCopyMemory(ReadConsoleRequest->Buffer,
+ lpBuffer,
+ ReadConsoleRequest->InitialNumBytes);
+ }
+
+ ReadConsoleRequest->CtrlWakeupMask = pInputControl->dwCtrlWakeupMask;
}
-
- ReadConsoleRequest->CtrlWakeupMask = pInputControl->dwCtrlWakeupMask;
+ else
+ {
+ // Status = STATUS_INVALID_PARAMETER;
+ }
}
else
{
- // Status = STATUS_INVALID_PARAMETER;
- }
- }
- else
- {
- /* We are in a situation where pInputControl has no meaning */
- pInputControl = NULL;
- }
+ /* We are in a situation where pInputControl has no meaning */
+ pInputControl = NULL;
+ }
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ // HACK
+ if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer);
+ SetLastError(ERROR_INVALID_ACCESS);
+ return FALSE;
+ }
+ _SEH2_END;
/* Check for sanity */
/*
Author: hbelusca
Date: Fri Aug 1 13:36:44 2014
New Revision: 63792
URL: http://svn.reactos.org/svn/reactos?rev=63792&view=rev
Log:
[CONSRV]
- Start a better fix for the mouse event problem described in r62739.
- Add a hack for the problem described in CORE-8394, that fixes some Far Manager mouse issues.
CORE-8394
Modified:
branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
URL: http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
==============================================================================
--- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original)
+++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Fri Aug 1 13:36:44 2014
@@ -610,7 +610,6 @@
static VOID
OnActivate(PGUI_CONSOLE_DATA GuiData, WPARAM wParam)
{
- PCONSOLE Console = GuiData->Console;
WORD ActivationState = LOWORD(wParam);
DPRINT1("WM_ACTIVATE - ActivationState = %d\n");
@@ -637,12 +636,11 @@
}
/*
- * When we are in QuickEdit mode, ignore the next mouse signal
- * when we are going to be enabled again via the mouse, in order
- * to prevent e.g. an erroneous right-click from the user which
- * would have as an effect to paste some unwanted text...
+ * Ignore the next mouse signal when we are going to be enabled again via
+ * the mouse, in order to prevent, e.g. when we are in Edit mode, erroneous
+ * mouse actions from the user that could spoil text selection or copy/pastes.
*/
- if (Console->QuickEdit && (ActivationState == WA_CLICKACTIVE))
+ if (ActivationState == WA_CLICKACTIVE)
GuiData->IgnoreNextMouseSignal = TRUE;
}
@@ -1386,15 +1384,18 @@
BOOL Err = FALSE;
PCONSOLE Console = GuiData->Console;
+ // FIXME: It's here that we need to check whether we has focus or not
+ // and whether we are in edit mode or not, to know if we need to deal
+ // with the mouse, or not.
+
if (GuiData->IgnoreNextMouseSignal)
{
if (msg != WM_LBUTTONDOWN &&
msg != WM_MBUTTONDOWN &&
- msg != WM_RBUTTONDOWN &&
- msg != WM_MOUSEMOVE)
+ msg != WM_RBUTTONDOWN)
{
/*
- * If this mouse signal is not a button-down action or a move,
+ * If this mouse signal is not a button-down action
* then it is the last signal being ignored.
*/
GuiData->IgnoreNextMouseSignal = FALSE;
@@ -1402,7 +1403,7 @@
else
{
/*
- * This mouse signal is a button-down action or a move.
+ * This mouse signal is a button-down action.
* Ignore it and perform default action.
*/
Err = TRUE;
@@ -1607,6 +1608,20 @@
default:
Err = TRUE;
+ break;
+ }
+
+ /*
+ * HACK FOR CORE-8394: Ignore the next mouse move signal
+ * just after mouse down click actions.
+ */
+ switch (msg)
+ {
+ case WM_LBUTTONDOWN:
+ case WM_MBUTTONDOWN:
+ case WM_RBUTTONDOWN:
+ GuiData->IgnoreNextMouseSignal = TRUE;
+ default:
break;
}