mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 13:01:40 +00:00
[CONSRV] Set 0 as a console leader PID/TID when unsetting it.
Instead of whatever is behind the NULL pointer.
This commit is contained in:
parent
73fd52a164
commit
f12e6016b6
1 changed files with 17 additions and 6 deletions
|
@ -48,14 +48,25 @@ VOID
|
|||
SetConWndConsoleLeaderCID(IN PGUI_CONSOLE_DATA GuiData)
|
||||
{
|
||||
PCONSOLE_PROCESS_DATA ProcessData;
|
||||
CLIENT_ID ConsoleLeaderCID;
|
||||
|
||||
ProcessData = ConSrvGetConsoleLeaderProcess(GuiData->Console);
|
||||
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));
|
||||
|
||||
DPRINT("ProcessData: %p, ProcessData->Process %p.\n", ProcessData, ProcessData->Process);
|
||||
ASSERT(ProcessData != NULL);
|
||||
|
||||
if (ProcessData->Process)
|
||||
{
|
||||
CLIENT_ID 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));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLongPtrW(GuiData->hWindow, GWLP_CONSOLE_LEADER_PID, 0);
|
||||
SetWindowLongPtrW(GuiData->hWindow, GWLP_CONSOLE_LEADER_TID, 0);
|
||||
}
|
||||
}
|
||||
/**************************************************************/
|
||||
|
||||
|
|
Loading…
Reference in a new issue