Author: ion
Date: Thu Sep 12 21:05:58 2013
New Revision: 60065
URL:
http://svn.reactos.org/svn/reactos?rev=60065&view=rev
Log:
[CSRSRV]: hbelusca: wait a sec ;-) Fix CsrCreateWait and CSR_WAIT_BLOCK to match Windows
Server 2003 semantics, which don't have a "UserWaitList". Fix our winsrv not
to call CsrCreateWait incorrectly (which corrupted the heap/stack when using windows's
csrsrv.dll).
Modified:
trunk/reactos/include/reactos/subsys/csr/csrsrv.h
trunk/reactos/subsystems/win32/csrsrv/csrsrv.spec
trunk/reactos/subsystems/win32/csrsrv/wait.c
trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
Modified: trunk/reactos/include/reactos/subsys/csr/csrsrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/csr…
==============================================================================
--- trunk/reactos/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/csr/csrsrv.h [iso-8859-1] Thu Sep 12 21:05:58
2013
@@ -148,7 +148,6 @@
{
ULONG Size; // Size of the wait block (variable-sized)
LIST_ENTRY WaitList;
- LIST_ENTRY UserWaitList;
PVOID WaitContext;
PCSR_THREAD WaitThread;
CSR_WAIT_FUNCTION WaitFunction;
@@ -285,8 +284,7 @@
IN CSR_WAIT_FUNCTION WaitFunction,
IN PCSR_THREAD CsrWaitThread,
IN OUT PCSR_API_MESSAGE WaitApiMessage,
- IN PVOID WaitContext,
- IN PLIST_ENTRY UserWaitList OPTIONAL);
+ IN PVOID WaitContext);
NTSTATUS
NTAPI
Modified: trunk/reactos/subsystems/win32/csrsrv/csrsrv.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/cs…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/csrsrv.spec [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/csrsrv.spec [iso-8859-1] Thu Sep 12 21:05:58
2013
@@ -4,7 +4,7 @@
@ stdcall CsrCreateProcess(ptr ptr ptr ptr long ptr)
@ stdcall CsrCreateRemoteThread(ptr ptr)
@ stdcall CsrCreateThread(ptr ptr ptr long)
-@ stdcall CsrCreateWait(ptr ptr ptr ptr ptr ptr)
+@ stdcall CsrCreateWait(ptr ptr ptr ptr ptr)
@ stdcall CsrDebugProcess(ptr)
@ stdcall CsrDebugProcessStop(ptr)
@ stdcall CsrDereferenceProcess(ptr)
Modified: trunk/reactos/subsystems/win32/csrsrv/wait.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrsrv/wa…
==============================================================================
--- trunk/reactos/subsystems/win32/csrsrv/wait.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrsrv/wait.c [iso-8859-1] Thu Sep 12 21:05:58 2013
@@ -76,12 +76,11 @@
CsrWaitThread->WaitBlock = WaitBlock;
WaitBlock->WaitContext = WaitContext;
WaitBlock->WaitFunction = WaitFunction;
- WaitBlock->UserWaitList.Flink = NULL;
- WaitBlock->UserWaitList.Blink = NULL;
- WaitBlock->WaitList = WaitBlock->UserWaitList;
+ WaitBlock->WaitList.Flink = NULL;
+ WaitBlock->WaitList.Blink = NULL;
/* Copy the message */
- RtlMoveMemory(&WaitBlock->WaitApiMessage,
+ RtlCopyMemory(&WaitBlock->WaitApiMessage,
WaitApiMessage,
WaitApiMessage->Header.u1.s1.TotalLength);
@@ -158,12 +157,6 @@
RemoveEntryList(&WaitBlock->WaitList);
}
- /* Remove it from the User Wait List */
- if (WaitBlock->UserWaitList.Flink)
- {
- RemoveEntryList(&WaitBlock->UserWaitList);
- }
-
/* Dereference the thread */
CsrDereferenceThread(WaitBlock->WaitThread);
@@ -206,9 +199,6 @@
*
* @param WaitContext
* Pointer to a user-defined parameter associated to this wait.
- *
- * @param UserWaitList
- * Pointer to a list entry of the user-defined waits to associate.
*
* @return TRUE in case of success, FALSE otherwise.
*
@@ -221,8 +211,7 @@
IN CSR_WAIT_FUNCTION WaitFunction,
IN PCSR_THREAD CsrWaitThread,
IN OUT PCSR_API_MESSAGE WaitApiMessage,
- IN PVOID WaitContext,
- IN PLIST_ENTRY UserWaitList OPTIONAL)
+ IN PVOID WaitContext)
{
PCSR_WAIT_BLOCK WaitBlock;
@@ -252,9 +241,6 @@
/* Insert the wait in the queue */
InsertTailList(WaitList, &WaitBlock->WaitList);
- /* Insert the User Wait too, if one was given */
- if (UserWaitList) InsertTailList(UserWaitList, &WaitBlock->UserWaitList);
-
/* Return */
CsrReleaseWaitLock();
return TRUE;
@@ -304,12 +290,6 @@
if (WaitBlock->WaitList.Flink)
{
RemoveEntryList(&WaitBlock->WaitList);
- }
-
- /* Remove it from the User Wait List */
- if (WaitBlock->UserWaitList.Flink)
- {
- RemoveEntryList(&WaitBlock->UserWaitList);
}
/* Dereference the thread waiting on it */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/coninput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Thu Sep 12 21:05:58
2013
@@ -60,8 +60,7 @@
WaitFunction,
InputInfo->CallingThread,
ApiMessage,
- CapturedInputInfo,
- NULL))
+ CapturedInputInfo))
{
ConsoleFreeHeap(CapturedInputInfo);
return STATUS_NO_MEMORY;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Thu Sep 12 21:05:58
2013
@@ -380,7 +380,6 @@
WriteConsoleThread,
ClientThread,
ApiMessage,
- NULL,
NULL))
{
/* Fail */