- If given the EWX_FORCE flag, ExitWindowsEx() should not send the
WM_{QUERY}ENDSESSION messages. - Add support for EWX_FORCEIFHUNG. - ExitWindowsEx() should return true if it succeeds, even if the user cancels the shutdown. - Don't crash if there are no windows.
This commit is contained in:
parent
d06a464ce9
commit
20afe30d76
@ -409,13 +409,15 @@ static BOOL USER_StartRebootProcess(void)
|
|||||||
BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved )
|
BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BOOL result;
|
BOOL result = FALSE;
|
||||||
HWND *list, *phwnd;
|
HWND *list, *phwnd;
|
||||||
|
|
||||||
/* We have to build a list of all windows first, as in EnumWindows */
|
/* We have to build a list of all windows first, as in EnumWindows */
|
||||||
|
TRACE("(%x,%lx)\n", flags, reserved);
|
||||||
|
|
||||||
if (!(list = WIN_ListChildren( GetDesktopWindow() ))) return FALSE;
|
list = WIN_ListChildren( GetDesktopWindow() );
|
||||||
|
if (list)
|
||||||
|
{
|
||||||
/* Send a WM_QUERYENDSESSION message to every window */
|
/* Send a WM_QUERYENDSESSION message to every window */
|
||||||
|
|
||||||
for (i = 0; list[i]; i++)
|
for (i = 0; list[i]; i++)
|
||||||
@ -435,6 +437,10 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved )
|
|||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, list );
|
HeapFree( GetProcessHeap(), 0, list );
|
||||||
|
|
||||||
|
if ( !(result || (flags & EWX_FORCE) ))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* USER_DoShutdown will kill all processes except the current process */
|
/* USER_DoShutdown will kill all processes except the current process */
|
||||||
USER_DoShutdown();
|
USER_DoShutdown();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user