mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 13:45:58 +00:00
- Fix a bug in LPC creation (missing one handle) and LPC closing (was not properly closing the port). This caused LPC_PORT_CLOSED never to be sent, and thus CSRSS never received and never closed its handle of the process, meaning that all win32 processes leaked.
- As a result, processes can die again, and also be killed by Task Manager. - And finally, "Exit" in cmd.exe as well as pressing the "x" button work. svn path=/trunk/; revision=23292
This commit is contained in:
parent
fb050d7eb5
commit
986d920762
|
@ -24,7 +24,6 @@
|
|||
// - Add support for Fast Dispatch I/O.
|
||||
//
|
||||
// Ps:
|
||||
// - Figure out why processes don't die.
|
||||
// - Generate process cookie for user-more thread.
|
||||
//
|
||||
// Ob:
|
||||
|
@ -32,11 +31,9 @@
|
|||
// - Add Directory Lock.
|
||||
// - Use Object Type Mutex/Lock.
|
||||
// - Implement handle database if anyone needs it.
|
||||
// - Figure out why cmd.exe won't close anymore.
|
||||
//
|
||||
// Ex:
|
||||
// - Use pushlocks for handle implementation.
|
||||
// - Figure out why cmd.exe won't close anymore.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -57,13 +57,11 @@ LpcpClosePort (IN PEPROCESS Process OPTIONAL,
|
|||
|
||||
/* FIXME Race conditions here! */
|
||||
|
||||
DPRINT("NiClosePort 0x%p OtherPort 0x%p State %d\n", Port, Port->OtherPort, Port->State);
|
||||
|
||||
/*
|
||||
* If the client has just closed its handle then tell the server what
|
||||
* happened and disconnect this port.
|
||||
*/
|
||||
if (HandleCount == 1 && Port->State == EPORT_CONNECTED_CLIENT)
|
||||
if (!(HandleCount)&& (Port->State == EPORT_CONNECTED_CLIENT))
|
||||
{
|
||||
DPRINT("Informing server\n");
|
||||
Message.u1.s1.TotalLength = sizeof(PORT_MESSAGE);
|
||||
|
@ -85,7 +83,7 @@ LpcpClosePort (IN PEPROCESS Process OPTIONAL,
|
|||
* If the server has closed all of its handles then disconnect the port,
|
||||
* don't actually notify the client until it attempts an operation.
|
||||
*/
|
||||
if (HandleCount == 1 && Port->State == EPORT_CONNECTED_SERVER)
|
||||
if (!(HandleCount)&& (Port->State == EPORT_CONNECTED_SERVER))
|
||||
{
|
||||
DPRINT("Cleaning up server\n");
|
||||
Port->OtherPort->OtherPort = NULL;
|
||||
|
|
|
@ -552,8 +552,8 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
|
|||
Status = ObInsertObject(ConnectedPort,
|
||||
NULL,
|
||||
PORT_ALL_ACCESS,
|
||||
0,
|
||||
NULL,
|
||||
1,
|
||||
(PVOID*)&ConnectedPort,
|
||||
&ConnectedPortHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue