mirror of
https://github.com/reactos/reactos.git
synced 2026-05-28 20:03:01 +08:00
[WINLOGON] Temporarily hack around a bug in PSEH for GCC
Commit51ee32f5f8moved the `WNetClearConnections()` in the main Winlogon thread, where it now runs. `WNetClearConnections()` calls a 3rd-party module (nfs41_np.dll) that invokes `kernel32!OutputDebugStringA()`. The SEH usage pattern in `OutputDebugStringA()`, when compiled with GCC and PSEH, generates an erroneous chain of exception handlers, that, when running in an execution environment like that of winlogon.exe, triggers a crash. See CORE-20316 for more details and testing. As a temporary measure, hackfix away the problem by surrounding the `WNetClearConnections()` call in a `_SEH2_TRY/_SEH2_EXCEPT` block (the net effect is to "add" the missing exception handler entry). Hack for commit51ee32f5f8CORE-20307 CORE-20309 CORE-20316
This commit is contained in:
@@ -497,7 +497,13 @@ CloseAllConnections(
|
||||
{
|
||||
if (!Session->UserToken || !ImpersonateLoggedOnUser(Session->UserToken))
|
||||
return;
|
||||
WNetClearConnections(NULL);
|
||||
_SEH2_TRY // Temporary HACK to avoid SEH crashes triggered by OutputDebugStringA()
|
||||
{ // calls from WNetClearConnections(). CORE-20307, CORE-20309, CORE-20316
|
||||
WNetClearConnections(NULL);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{}
|
||||
_SEH2_END;
|
||||
RevertToSelf();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user