mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:23:34 +00:00
[CONSRV]
Fix input/output (read/write) waiter threads notifications. Now console is usable. Go and test it! :D svn path=/branches/ros-csrss/; revision=58225
This commit is contained in:
parent
50a9e6a485
commit
6d28ec8640
3 changed files with 42 additions and 27 deletions
|
@ -93,6 +93,10 @@ ConioProcessChar(PCONSOLE Console,
|
||||||
WaitAny,
|
WaitAny,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!IsListEmpty(&Console->InputBuffer.ReadWaitQueue))
|
||||||
|
{
|
||||||
|
CsrDereferenceWait(&Console->InputBuffer.ReadWaitQueue);
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -358,18 +362,6 @@ ReadInputBufferThread(IN PLIST_ENTRY WaitList,
|
||||||
|
|
||||||
DPRINT1("ReadInputBufferThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
|
DPRINT1("ReadInputBufferThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
|
||||||
|
|
||||||
/*
|
|
||||||
* Somebody is closing a handle to this input buffer,
|
|
||||||
* by calling ConSrvCloseHandleEntry.
|
|
||||||
* See whether we are linked to that handle (ie. we
|
|
||||||
* are a waiter for this handle), and if so, return.
|
|
||||||
*/
|
|
||||||
if (InputHandle == InputInfo->HandleEntry)
|
|
||||||
{
|
|
||||||
Status = STATUS_ALERTED;
|
|
||||||
goto Quit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are notified of the process termination via a call
|
* If we are notified of the process termination via a call
|
||||||
* to CsrNotifyWaitBlock triggered by CsrDestroyProcess or
|
* to CsrNotifyWaitBlock triggered by CsrDestroyProcess or
|
||||||
|
@ -381,6 +373,20 @@ ReadInputBufferThread(IN PLIST_ENTRY WaitList,
|
||||||
goto Quit;
|
goto Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Somebody is closing a handle to this input buffer,
|
||||||
|
* by calling ConSrvCloseHandleEntry.
|
||||||
|
* See whether we are linked to that handle (ie. we
|
||||||
|
* are a waiter for this handle), and if so, return.
|
||||||
|
* Otherwise, ignore the call and continue waiting.
|
||||||
|
*/
|
||||||
|
if (InputHandle != NULL)
|
||||||
|
{
|
||||||
|
Status = (InputHandle == InputInfo->HandleEntry ? STATUS_ALERTED
|
||||||
|
: STATUS_PENDING);
|
||||||
|
goto Quit;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we go there, that means we are notified for some new input.
|
* If we go there, that means we are notified for some new input.
|
||||||
* The console is therefore already locked.
|
* The console is therefore already locked.
|
||||||
|
@ -489,18 +495,6 @@ ReadCharsThread(IN PLIST_ENTRY WaitList,
|
||||||
|
|
||||||
DPRINT1("ReadCharsThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
|
DPRINT1("ReadCharsThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
|
||||||
|
|
||||||
/*
|
|
||||||
* Somebody is closing a handle to this input buffer,
|
|
||||||
* by calling ConSrvCloseHandleEntry.
|
|
||||||
* See whether we are linked to that handle (ie. we
|
|
||||||
* are a waiter for this handle), and if so, return.
|
|
||||||
*/
|
|
||||||
if (InputHandle == InputInfo->HandleEntry)
|
|
||||||
{
|
|
||||||
Status = STATUS_ALERTED;
|
|
||||||
goto Quit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are notified of the process termination via a call
|
* If we are notified of the process termination via a call
|
||||||
* to CsrNotifyWaitBlock triggered by CsrDestroyProcess or
|
* to CsrNotifyWaitBlock triggered by CsrDestroyProcess or
|
||||||
|
@ -512,6 +506,20 @@ ReadCharsThread(IN PLIST_ENTRY WaitList,
|
||||||
goto Quit;
|
goto Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Somebody is closing a handle to this input buffer,
|
||||||
|
* by calling ConSrvCloseHandleEntry.
|
||||||
|
* See whether we are linked to that handle (ie. we
|
||||||
|
* are a waiter for this handle), and if so, return.
|
||||||
|
* Otherwise, ignore the call and continue waiting.
|
||||||
|
*/
|
||||||
|
if (InputHandle != NULL)
|
||||||
|
{
|
||||||
|
Status = (InputHandle == InputInfo->HandleEntry ? STATUS_ALERTED
|
||||||
|
: STATUS_PENDING);
|
||||||
|
goto Quit;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we go there, that means we are notified for some new input.
|
* If we go there, that means we are notified for some new input.
|
||||||
* The console is therefore already locked.
|
* The console is therefore already locked.
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
//#define NDEBUG
|
//#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
|
@ -87,6 +88,10 @@ ConioUnpause(PCONSOLE Console, UINT Flags)
|
||||||
WaitAll,
|
WaitAll,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (!IsListEmpty(&Console->WriteWaitQueue))
|
||||||
|
{
|
||||||
|
CsrDereferenceWait(&Console->WriteWaitQueue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,11 @@ ConSrvCloseHandleEntry(PCONSOLE_IO_HANDLE Entry)
|
||||||
WaitAll,
|
WaitAll,
|
||||||
NULL,
|
NULL,
|
||||||
(PVOID)Entry);
|
(PVOID)Entry);
|
||||||
// TODO: Dereference the notified waits.
|
|
||||||
|
if (!IsListEmpty(&InputBuffer->ReadWaitQueue))
|
||||||
|
{
|
||||||
|
CsrDereferenceWait(&InputBuffer->ReadWaitQueue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the last handle to a screen buffer is closed, delete it... */
|
/* If the last handle to a screen buffer is closed, delete it... */
|
||||||
|
@ -498,8 +502,6 @@ ConSrvReleaseConsole(PCONSOLE Console,
|
||||||
ConSrvDeleteConsole(Console);
|
ConSrvDeleteConsole(Console);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
ConSrvNewProcess(PCSR_PROCESS SourceProcess,
|
ConSrvNewProcess(PCSR_PROCESS SourceProcess,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue