Francois Gouget wrote:
if (SendMessageTimeoutW( *phwnd, WM_QUERYENDSESSION, 0, 0, send_flags, INFINITE, &result) && !result) break;
if (SendMessageTimeoutW( *phwnd, WM_QUERYENDSESSION, 0, 0, send_flags, 0, &result))
Was this change deliberate to remove the check of result? If so, I don't see where else the result of the message can be properly checked.
Robert Shearman wrote:
Francois Gouget wrote:
if (SendMessageTimeoutW( *phwnd, WM_QUERYENDSESSION,
0, 0, send_flags, INFINITE, &result) && !result) break;
if (SendMessageTimeoutW( *phwnd, WM_QUERYENDSESSION,
0, 0, send_flags, 0, &result))
Was this change deliberate to remove the check of result? If so, I don't see where else the result of the message can be properly checked.
The result is sent back to the application in the WM_ENDSESSION message and checked in the if branch to exit the loop, and then again right outside the loop to abort the Windows shutdown.
if (SendMessageTimeoutW( *phwnd, WM_QUERYENDSESSION, 0, 0, send_flags, 0, &result)) { DWORD_PTR dummy; SendMessageTimeoutW( *phwnd, WM_ENDSESSION, result, 0, send_flags, 0, &dummy ); if (!result) break; } } HeapFree( GetProcessHeap(), 0, list );
if (!result) return TRUE;
Francois Gouget wrote:
Robert Shearman wrote:
Francois Gouget wrote:
if (SendMessageTimeoutW( *phwnd,
WM_QUERYENDSESSION, 0, 0, send_flags, INFINITE, &result) && !result) break;
if (SendMessageTimeoutW( *phwnd,
WM_QUERYENDSESSION, 0, 0, send_flags, 0, &result))
Was this change deliberate to remove the check of result? If so, I don't see where else the result of the message can be properly checked.
The result is sent back to the application in the WM_ENDSESSION message and checked in the if branch to exit the loop, and then again right outside the loop to abort the Windows shutdown.
if (SendMessageTimeoutW( *phwnd, WM_QUERYENDSESSION,
0, 0, send_flags, 0, &result)) { DWORD_PTR dummy; SendMessageTimeoutW( *phwnd, WM_ENDSESSION, result, 0, send_flags, 0, &dummy ); if (!result) break; } } HeapFree( GetProcessHeap(), 0, list );
if (!result) return TRUE;
Yes, you are right. I obviously didn't spend enough time reading your patch.