mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
made SetErrorMode() thread-safe
svn path=/trunk/; revision=13134
This commit is contained in:
parent
5b0f6dccee
commit
c0ff13e571
1 changed files with 4 additions and 11 deletions
|
@ -15,25 +15,18 @@
|
|||
#define NDEBUG
|
||||
#include "../include/debug.h"
|
||||
|
||||
UINT GlobalErrMode = 0;
|
||||
UINT GlobalErrorMode = 0;
|
||||
LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter = UnhandledExceptionFilter;
|
||||
|
||||
UINT GetErrorMode(void)
|
||||
{
|
||||
return GlobalErrMode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
UINT
|
||||
STDCALL
|
||||
SetErrorMode( UINT uMode )
|
||||
SetErrorMode(UINT uMode)
|
||||
{
|
||||
UINT OldErrMode = GetErrorMode();
|
||||
GlobalErrMode = uMode;
|
||||
return OldErrMode;
|
||||
return (UINT)InterlockedExchange((LONG*)&GlobalErrorMode, (LONG)uMode);
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,7 +114,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
|
|||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
if ((GetErrorMode() & SEM_NOGPFAULTERRORBOX) == 0)
|
||||
if ((GlobalErrorMode & SEM_NOGPFAULTERRORBOX) == 0)
|
||||
{
|
||||
#ifdef _X86_
|
||||
PULONG Frame;
|
||||
|
|
Loading…
Reference in a new issue