- Do not try to initialize thread info in UserGetWindowObject. Do it in thread callout. Removing this hack is needed in order to use UserPostMessage in ProcessCallout when a process is terminating
- Notify winlogon that the shell is exiting in order to restart the shell
svn path=/trunk/; revision=51519
+NTKERNELAPI
+NTSTATUS
+NTAPI
+PsGetProcessExitStatus(
+ PEPROCESS Process
+);
+
//
// Definitions used by WM_LOGONNOTIFY
//
//
// Definitions used by WM_LOGONNOTIFY
//
+#define LN_SHELL_EXITED 0x2
#define LN_START_TASK_MANAGER 0x4
#define LN_LOCK_WORKSTATION 0x5
#define LN_UNLOCK_WORKSTATION 0x6
#define LN_START_TASK_MANAGER 0x4
#define LN_LOCK_WORKSTATION 0x5
#define LN_UNLOCK_WORKSTATION 0x6
HWND hProgmanWindow;
HWND hShellWindow;
HWND hProgmanWindow;
HWND hShellWindow;
+ PPROCESSINFO ppiShellProcess;
+
DPRINT("Destroying W32 process PID:%d at IRQ level: %lu\n", Process->UniqueProcessId, KeGetCurrentIrql());
Win32Process->W32PF_flags |= W32PF_TERMINATED;
DPRINT("Destroying W32 process PID:%d at IRQ level: %lu\n", Process->UniqueProcessId, KeGetCurrentIrql());
Win32Process->W32PF_flags |= W32PF_TERMINATED;
+ /* Notify logon application to restart shell if needed */
+ if(Win32Process->rpdeskStartup->pDeskInfo)
+ {
+ if(Win32Process->rpdeskStartup->pDeskInfo->ppiShellProcess == Win32Process)
+ {
+ DWORD ExitCode;
+ ExitCode = PsGetProcessExitStatus(Win32Process->peProcess);
+
+ DPRINT1("Shell process is exiting (%d)\n", ExitCode);
+
+ UserPostMessage(hwndSAS,
+ WM_LOGONNOTIFY,
+ LN_SHELL_EXITED,
+ ExitCode);
+ }
+ }
+
if (Win32Process->InputIdleEvent)
{
EngFreeMem((PVOID)Win32Process->InputIdleEvent);
if (Win32Process->InputIdleEvent)
{
EngFreeMem((PVOID)Win32Process->InputIdleEvent);
}
Win32Thread->MessageQueue = MsqCreateMessageQueue(Thread);
Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout();
}
Win32Thread->MessageQueue = MsqCreateMessageQueue(Thread);
Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout();
+ Win32Thread->pEThread = Thread;
/* HAAAAAAAACK! This should go to Win32kProcessCallback */
if(Win32Thread->ppi->hdeskStartup == NULL)
/* HAAAAAAAACK! This should go to Win32kProcessCallback */
if(Win32Thread->ppi->hdeskStartup == NULL)
// System thread running! Now SendMessage should be okay.
Win32Thread->pcti = &Win32Thread->cti;
}
// System thread running! Now SendMessage should be okay.
Win32Thread->pcti = &Win32Thread->cti;
}
- Win32Thread->pEThread = Thread;
/* temp hack */
PWND FASTCALL UserGetWindowObject(HWND hWnd)
{
/* temp hack */
PWND FASTCALL UserGetWindowObject(HWND hWnd)
{
- PTHREADINFO ti;
- PWND Window;
-
- if (PsGetCurrentProcess() != PsInitialSystemProcess)
- {
- ti = GetW32ThreadInfo();
- if (ti == NULL)
- {
- EngSetLastError(ERROR_ACCESS_DENIED);
- return NULL;
- }
- }
WinStaObject->ShellListView = hwndListView;
ti = GetW32ThreadInfo();
WinStaObject->ShellListView = hwndListView;
ti = GetW32ThreadInfo();
- if (ti->pDeskInfo) ti->pDeskInfo->hShellWindow = hwndShell;
+ if (ti->pDeskInfo)
+ {
+ ti->pDeskInfo->hShellWindow = hwndShell;
+ ti->pDeskInfo->ppiShellProcess = ti->ppi;
+ }
UserDerefObjectCo(WndShell);
UserDerefObjectCo(WndShell);