Author: hbelusca
Date: Tue Apr 22 00:55:03 2014
New Revision: 62863
URL: http://svn.reactos.org/svn/reactos?rev=62863&view=rev
Log:
[CONSRV]... and fix comments (forgotten in revision 62861).
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Tue Apr 22 00:55:03 2014
@@ -282,8 +282,8 @@
CONSOLE_STATE State; /* State of the console */
LIST_ENTRY ProcessList; /* List of processes owning the console. The first one is the so-called "Console Leader Process" */
- PCONSOLE_PROCESS_DATA NotifiedLastCloseProcess; /* Pointer to the unique process that needs to be notified when all the other processes have been detached from the console */
- BOOLEAN NotifyLastClose; /* TRUE if the console should send a control event to the last attached process after all the others detached, if it wanted to be notified */
+ PCONSOLE_PROCESS_DATA NotifiedLastCloseProcess; /* Pointer to the unique process that needs to be notified when the console leader process is killed */
+ BOOLEAN NotifyLastClose; /* TRUE if the console should send a control event when the console leader process is killed */
FRONTEND TermIFace; /* Frontend-specific interface */
Author: hbelusca
Date: Tue Apr 22 00:46:49 2014
New Revision: 62861
URL: http://svn.reactos.org/svn/reactos?rev=62861&view=rev
Log:
[CONSRV]
- Introduce a helper function to query the console leader process (instead of using duplicated code).
- Fix the algorithm of the last close notification, as demonstrated by the tests I did on windows 2003 (test app is provided in CORE-7250):
a console app that registered for the last close notification, closes only if the process that was the console leader process at the time the app registered for the notification, is killed.
In this case, we notify the app, and we clear some flags. On the contrary, if we close the app that registered for the notification, we just clear the flags without doing extra operations.
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
trunk/reactos/win32ss/user/winsrv/consrv/handle.c
trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] Tue Apr 22 00:46:49 2014
@@ -1091,6 +1091,16 @@
return STATUS_SUCCESS;
}
+PCONSOLE_PROCESS_DATA NTAPI
+ConDrvGetConsoleLeaderProcess(IN PCONSOLE Console)
+{
+ if (Console == NULL) return NULL;
+
+ return CONTAINING_RECORD(Console->ProcessList.Blink,
+ CONSOLE_PROCESS_DATA,
+ ConsoleLink);
+}
+
NTSTATUS NTAPI
ConDrvGetConsoleProcessList(IN PCONSOLE Console,
IN OUT PULONG ProcessIdsList,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Tue Apr 22 00:46:49 2014
@@ -48,9 +48,7 @@
PCONSOLE_PROCESS_DATA ProcessData;
CLIENT_ID ConsoleLeaderCID;
- ProcessData = CONTAINING_RECORD(GuiData->Console->ProcessList.Blink,
- CONSOLE_PROCESS_DATA,
- ConsoleLink);
+ ProcessData = ConDrvGetConsoleLeaderProcess(GuiData->Console);
ConsoleLeaderCID = ProcessData->Process->ClientId;
SetWindowLongPtrW(GuiData->hWindow, GWLP_CONSOLE_LEADER_PID,
(LONG_PTR)(ConsoleLeaderCID.UniqueProcess));
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] Tue Apr 22 00:46:49 2014
@@ -356,9 +356,7 @@
NtUnmapViewOfSection(NtCurrentProcess(), pSharedInfo);
/* Get the console leader process, our client */
- ProcessData = CONTAINING_RECORD(Console->ProcessList.Blink,
- CONSOLE_PROCESS_DATA,
- ConsoleLink);
+ ProcessData = ConDrvGetConsoleLeaderProcess(Console);
/* Duplicate the section handle for the client */
Status = NtDuplicateObject(NtCurrentProcess(),
@@ -430,9 +428,7 @@
PGUI_CONSOLE_INFO GuiInfo = NULL;
/* Get the console leader process, our client */
- ProcessData = CONTAINING_RECORD(Console->ProcessList.Blink,
- CONSOLE_PROCESS_DATA,
- ConsoleLink);
+ ProcessData = ConDrvGetConsoleLeaderProcess(Console);
/* Duplicate the section handle for ourselves */
Status = NtDuplicateObject(ProcessData->Process->ProcessHandle,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/handle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/handle.c [iso-8859-1] Tue Apr 22 00:46:49 2014
@@ -633,10 +633,6 @@
return Status;
}
-NTSTATUS
-ConDrvConsoleCtrlEvent(IN ULONG CtrlEvent,
- IN PCONSOLE_PROCESS_DATA ProcessData);
-
VOID
FASTCALL
ConSrvRemoveConsole(PCONSOLE_PROCESS_DATA ProcessData)
@@ -652,6 +648,9 @@
ProcessData->ConsoleHandle,
CONSOLE_RUNNING, TRUE))
{
+ /* Retrieve the console leader process */
+ PCONSOLE_PROCESS_DATA ConsoleLeaderProcess = ConDrvGetConsoleLeaderProcess(Console);
+
DPRINT("ConSrvRemoveConsole - Locking OK\n");
/* Close all console handles and free the handles table */
@@ -660,35 +659,40 @@
/* Detach the process from the console */
ProcessData->ConsoleHandle = NULL;
- /* Remove ourselves from the console's list of processes */
+ /* Remove the process from the console's list of processes */
RemoveEntryList(&ProcessData->ConsoleLink);
+
+ /* Check whether the console should send a last close notification */
+ if (Console->NotifyLastClose)
+ {
+ /* If we are removing the process which wants the last close notification... */
+ if (ProcessData == Console->NotifiedLastCloseProcess)
+ {
+ /* ... just reset the flag and the pointer... */
+ Console->NotifyLastClose = FALSE;
+ Console->NotifiedLastCloseProcess = NULL;
+ }
+ /*
+ * ... otherwise, if we are removing the console leader process
+ * (that cannot be the process wanting the notification, because
+ * the previous case already dealt with it)...
+ */
+ else if (ProcessData == ConsoleLeaderProcess)
+ {
+ /*
+ * ... reset the flag first (so that we avoid multiple notifications)
+ * and then send the last close notification.
+ */
+ Console->NotifyLastClose = FALSE;
+ ConDrvConsoleCtrlEvent(CTRL_LAST_CLOSE_EVENT, Console->NotifiedLastCloseProcess);
+
+ /* Only now, reset the pointer */
+ Console->NotifiedLastCloseProcess = NULL;
+ }
+ }
/* Update the internal info of the terminal */
TermRefreshInternalInfo(Console);
-
- /*
- * Check if there is only one process still attached to the console,
- * and that the console should send a control event in this case.
- */
- if ((Console->ProcessList.Flink != &Console->ProcessList) &&
- (Console->ProcessList.Flink->Flink == &Console->ProcessList) &&
- // (Console->ProcessList.Flink == Console->ProcessList.Blink) &&
- Console->NotifyLastClose)
- {
- PCONSOLE_PROCESS_DATA LastProcess = CONTAINING_RECORD(Console->ProcessList.Flink,
- CONSOLE_PROCESS_DATA,
- ConsoleLink);
- /* If the remaining process is the one that wanted the notification... */
- if (LastProcess == Console->NotifiedLastCloseProcess)
- {
- /* ... notify it that it's the only one remaining on the console */
- ConDrvConsoleCtrlEvent(CTRL_LAST_CLOSE_EVENT, LastProcess);
- }
-
- /* In any case reset the pointer and the flag */
- Console->NotifiedLastCloseProcess = NULL;
- Console->NotifyLastClose = FALSE;
- }
/* Release the console */
DPRINT("ConSrvRemoveConsole - Decrement Console->ReferenceCount = %lu\n", Console->ReferenceCount);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Tue Apr 22 00:46:49 2014
@@ -343,6 +343,11 @@
VOID FASTCALL ConioPause(PCONSOLE Console, UINT Flags);
VOID FASTCALL ConioUnpause(PCONSOLE Console, UINT Flags);
+PCONSOLE_PROCESS_DATA NTAPI
+ConDrvGetConsoleLeaderProcess(IN PCONSOLE Console);
+NTSTATUS
+ConDrvConsoleCtrlEvent(IN ULONG CtrlEvent,
+ IN PCONSOLE_PROCESS_DATA ProcessData);
NTSTATUS NTAPI
ConDrvConsoleProcessCtrlEvent(IN PCONSOLE Console,
IN ULONG ProcessGroupId,
Author: akhaldi
Date: Mon Apr 21 20:05:34 2014
New Revision: 62859
URL: http://svn.reactos.org/svn/reactos?rev=62859&view=rev
Log:
[PSDK]
* Import wsnwlink.h from Wine 1.7.17.
CORE-8080
Added:
trunk/reactos/include/psdk/wsnwlink.h (with props)
Added: trunk/reactos/include/psdk/wsnwlink.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wsnwlink.h?re…
==============================================================================
--- trunk/reactos/include/psdk/wsnwlink.h (added)
+++ trunk/reactos/include/psdk/wsnwlink.h [iso-8859-1] Mon Apr 21 20:05:34 2014
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2003,2004 Roderick Colenbrander
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _WSNWLINK_
+#define _WSNWLINK_
+
+#define IPX_PTYPE 0x4000
+#define IPX_FILTERPTYPE 0x4001
+#define IPX_DSTYPE 0x4002
+#define IPX_STOPFILTERPTYPE 0x4003
+#define IPX_EXTENDED_ADDRESS 0x4004
+#define IPX_RECVHDR 0x4005
+#define IPX_MAXSIZE 0x4006
+#define IPX_ADDRESS 0x4007
+#define IPX_GETNETINFO 0x4008
+#define IPX_GETNETINFO_NORIP 0x4009
+#define IPX_SPXGETCONNECTIONSTATUS 0x400b
+#define IPX_ADDRESS_NOTIFY 0x400c
+#define IPX_MAX_ADAPTER_NUM 0x400d
+#define IPX_RERIPNETNUMBER 0x400e
+#define IPX_RECEIVE_BROADCAST 0x400f
+#define IPX_IMMEDIATESPXACK 0x4010
+
+typedef struct _IPX_ADDRESS_DATA {
+ INT adapternum;
+ UCHAR netnum[4];
+ UCHAR nodenum[6];
+ BOOLEAN wan;
+ BOOLEAN status;
+ INT maxpkt;
+ ULONG linkspeed;
+} IPX_ADDRESS_DATA, *PIPX_ADDRESS_DATA;
+
+#endif /* _WSNWLINK_ */
Propchange: trunk/reactos/include/psdk/wsnwlink.h
------------------------------------------------------------------------------
svn:eol-style = native