- 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:
Alex Ionescu 2006-07-25 20:21:24 +00:00
parent fb050d7eb5
commit 986d920762
3 changed files with 4 additions and 9 deletions

View file

@ -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.
//
///////////////////////////////////////////////////////////////////////////////

View file

@ -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;

View file

@ -552,8 +552,8 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
Status = ObInsertObject(ConnectedPort,
NULL,
PORT_ALL_ACCESS,
0,
NULL,
1,
(PVOID*)&ConnectedPort,
&ConnectedPortHandle);
if (!NT_SUCCESS(Status))
{