mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 16:41:22 +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
|
#define NDEBUG
|
||||||
#include "../include/debug.h"
|
#include "../include/debug.h"
|
||||||
|
|
||||||
UINT GlobalErrMode = 0;
|
UINT GlobalErrorMode = 0;
|
||||||
LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter = UnhandledExceptionFilter;
|
LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter = UnhandledExceptionFilter;
|
||||||
|
|
||||||
UINT GetErrorMode(void)
|
|
||||||
{
|
|
||||||
return GlobalErrMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
UINT
|
UINT
|
||||||
STDCALL
|
STDCALL
|
||||||
SetErrorMode( UINT uMode )
|
SetErrorMode(UINT uMode)
|
||||||
{
|
{
|
||||||
UINT OldErrMode = GetErrorMode();
|
return (UINT)InterlockedExchange((LONG*)&GlobalErrorMode, (LONG)uMode);
|
||||||
GlobalErrMode = uMode;
|
|
||||||
return OldErrMode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,7 +114,7 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
|
||||||
return EXCEPTION_CONTINUE_SEARCH;
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((GetErrorMode() & SEM_NOGPFAULTERRORBOX) == 0)
|
if ((GlobalErrorMode & SEM_NOGPFAULTERRORBOX) == 0)
|
||||||
{
|
{
|
||||||
#ifdef _X86_
|
#ifdef _X86_
|
||||||
PULONG Frame;
|
PULONG Frame;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue