2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* Inspired by previous work by Romeo Anghelache & Eric Stern. */
26 SQUIDCEXTERN LPCRITICAL_SECTION dbg_mutex
;
27 void WIN32_ExceptionHandlerCleanup(void);
28 static LPTOP_LEVEL_EXCEPTION_FILTER Win32_Old_ExceptionHandler
= NULL
;
31 Win32__WSAFDIsSet(int fd
, fd_set FAR
* set
)
33 fde
*F
= &fd_table
[fd
];
34 SOCKET s
= F
->win32
.handle
;
36 return __WSAFDIsSet(s
, set
);
39 LONG CALLBACK
WIN32_ExceptionHandler(EXCEPTION_POINTERS
* ep
)
43 er
= ep
->ExceptionRecord
;
45 switch (er
->ExceptionCode
) {
47 case EXCEPTION_ACCESS_VIOLATION
:
51 case EXCEPTION_DATATYPE_MISALIGNMENT
:
53 case EXCEPTION_ARRAY_BOUNDS_EXCEEDED
:
55 case EXCEPTION_IN_PAGE_ERROR
:
63 return EXCEPTION_CONTINUE_SEARCH
;
66 void WIN32_ExceptionHandlerInit()
70 if (Win32_Old_ExceptionHandler
== NULL
)
71 Win32_Old_ExceptionHandler
= SetUnhandledExceptionFilter(WIN32_ExceptionHandler
);
76 void WIN32_ExceptionHandlerCleanup()
78 if (Win32_Old_ExceptionHandler
!= NULL
)
79 SetUnhandledExceptionFilter(Win32_Old_ExceptionHandler
);
82 #endif /* SQUID_WINDOWS_ */