Fix what I broke in revision r58447, namely at which process the terminal window belongs to.
svn path=/branches/ros-csrss/; revision=58557
DWORD ShiftState,
UINT VirtualKeyCode,
BOOL Down);
+ VOID (WINAPI *RefreshInternalInfo)(struct _CONSOLE* Console);
/*
* External interface (functions corresponding to the Console API)
#define ConioResizeBuffer(Console, Buff, Size) (Console)->TermIFace.Vtbl->ResizeBuffer((Console), (Buff), (Size))
#define ConioProcessKeyCallback(Console, Msg, KeyStateMenu, ShiftState, VirtualKeyCode, Down) \
(Console)->TermIFace.Vtbl->ProcessKeyCallback((Console), (Msg), (KeyStateMenu), (ShiftState), (VirtualKeyCode), (Down))
+#define ConioGetConsoleWindowHandle(Console) \
+ (Console)->TermIFace.Vtbl->GetConsoleWindowHandle((Console))
+#define ConioRefreshInternalInfo(Console) \
+ (Console)->TermIFace.Vtbl->RefreshInternalInfo((Console))
typedef struct _TERMINAL_IFACE
{
} CONSOLE, *PCONSOLE;
-/**************************************************************\
-\** Define the Console Leader Process for the console window **/
-#define GWLP_CONSOLEWND_ALLOC (2 * sizeof(LONG_PTR))
-#define GWLP_CONSOLE_LEADER_PID 0
-#define GWLP_CONSOLE_LEADER_TID 4
-
-#define SetConsoleWndConsoleLeaderCID(GuiData) \
-do { \
- PCONSOLE_PROCESS_DATA ProcessData; \
- CLIENT_ID ConsoleLeaderCID; \
- ProcessData = CONTAINING_RECORD((GuiData)->Console->ProcessList.Blink, \
- CONSOLE_PROCESS_DATA, \
- ConsoleLink); \
- ConsoleLeaderCID = ProcessData->Process->ClientId; \
- SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_PID, (LONG_PTR)(ConsoleLeaderCID.UniqueProcess)); \
- SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_TID, (LONG_PTR)(ConsoleLeaderCID.UniqueThread )); \
-} while(0)
-/**************************************************************/
-
/* CONSOLE_SELECTION_INFO dwFlags values */
#define CONSOLE_NO_SELECTION 0x0
#define CONSOLE_SELECTION_IN_PROGRESS 0x1
Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE);
if (!NT_SUCCESS(Status)) return Status;
- GetWindowRequest->WindowHandle = Console->TermIFace.Vtbl->GetConsoleWindowHandle(Console);
+ GetWindowRequest->WindowHandle = ConioGetConsoleWindowHandle(Console);
ConSrvReleaseConsole(Console, TRUE);
return STATUS_SUCCESS;
GUI_CONSOLE_INFO GuiInfo; /* GUI terminal settings */
} GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA;
+
+/**************************************************************\
+\** Define the Console Leader Process for the console window **/
+#define GWLP_CONSOLEWND_ALLOC (2 * sizeof(LONG_PTR))
+#define GWLP_CONSOLE_LEADER_PID 0
+#define GWLP_CONSOLE_LEADER_TID 4
+
+#define SetConsoleWndConsoleLeaderCID(GuiData) \
+do { \
+ PCONSOLE_PROCESS_DATA ProcessData; \
+ CLIENT_ID ConsoleLeaderCID; \
+ ProcessData = CONTAINING_RECORD((GuiData)->Console->ProcessList.Blink, \
+ CONSOLE_PROCESS_DATA, \
+ ConsoleLink); \
+ ConsoleLeaderCID = ProcessData->Process->ClientId; \
+ SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_PID, (LONG_PTR)(ConsoleLeaderCID.UniqueProcess)); \
+ SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_TID, (LONG_PTR)(ConsoleLeaderCID.UniqueThread )); \
+} while(0)
+/**************************************************************/
+
+
static BOOL ConsInitialized = FALSE;
static HICON ghDefaultIcon = NULL;
static HICON ghDefaultIconSm = NULL;
WindowCount++;
SetWindowLongW(hWnd, GWL_USERDATA, WindowCount);
- // SetConsoleWndConsoleLeaderCID(Console);
-
DPRINT1("Set icons via PM_CREATE_CONSOLE\n");
if (GuiData->hIcon == NULL)
{
return FALSE;
}
+static VOID WINAPI
+GuiRefreshInternalInfo(PCONSOLE Console)
+{
+ PGUI_CONSOLE_DATA GuiData = Console->TermIFace.Data;
+
+ /* Update the console leader information held by the window */
+ SetConsoleWndConsoleLeaderCID(GuiData);
+}
+
static VOID WINAPI
GuiChangeTitle(PCONSOLE Console)
{
GuiUpdateScreenInfo,
GuiResizeBuffer,
GuiProcessKeyCallback,
+ GuiRefreshInternalInfo,
GuiChangeTitle,
GuiChangeIcon,
GuiGetConsoleWindowHandle
/* Add a reference count because the process is tied to the console */
_InterlockedIncrement(&ProcessData->Console->ReferenceCount);
+ /* Update the internal info of the terminal */
+ ConioRefreshInternalInfo(ProcessData->Console);
+
return STATUS_SUCCESS;
}
/* Add a reference count because the process is tied to the console */
_InterlockedIncrement(&ProcessData->Console->ReferenceCount);
+ /* Update the internal info of the terminal */
+ ConioRefreshInternalInfo(ProcessData->Console);
+
return STATUS_SUCCESS;
}
/* Remove ourselves from the console's list of processes */
RemoveEntryList(&ProcessData->ConsoleLink);
- /* Update the console leader process */
- // SetConsoleWndConsoleLeaderCID(Console);
+ /* Update the internal info of the terminal */
+ ConioRefreshInternalInfo(Console);
/* Release the console */
ConSrvReleaseConsole(Console, TRUE);