msvcrt: Implement _set_security_error_handler.

Hans Leidekker hans at codeweavers.com
Wed Mar 16 03:22:24 CDT 2011


---
 dlls/msvcr70/msvcr70.spec |    2 +-
 dlls/msvcr71/msvcr71.spec |    2 +-
 dlls/msvcrt/except.c      |   14 ++++++++++++++
 dlls/msvcrt/msvcrt.h      |    1 +
 dlls/msvcrt/msvcrt.spec   |    1 +
 5 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec
index b83ce7f..dc97084 100644
--- a/dlls/msvcr70/msvcr70.spec
+++ b/dlls/msvcr70/msvcr70.spec
@@ -516,7 +516,7 @@
 @ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable
 @ cdecl _set_error_mode(long) msvcrt._set_error_mode
 @ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold
-@ stub _set_security_error_handler
+@ cdecl _set_security_error_handler(ptr) msvcrt._set_security_error_handler
 @ cdecl _seterrormode(long) msvcrt._seterrormode
 @ cdecl -arch=i386,x86_64 -norelay _setjmp(ptr) msvcrt._setjmp
 @ cdecl -i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3
diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec
index 648802a..7959334 100644
--- a/dlls/msvcr71/msvcr71.spec
+++ b/dlls/msvcr71/msvcr71.spec
@@ -512,7 +512,7 @@
 @ cdecl _set_error_mode(long) msvcrt._set_error_mode
 @ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler
 @ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold
-@ stub _set_security_error_handler
+@ cdecl _set_security_error_handler(ptr) msvcrt._set_security_error_handler
 @ cdecl _seterrormode(long) msvcrt._seterrormode
 @ cdecl -arch=i386,x86_64 _setjmp(ptr) msvcrt._setjmp
 @ cdecl -i386 _setjmp3(ptr long) msvcrt._setjmp3
diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c
index 1ca6544..7404089 100644
--- a/dlls/msvcrt/except.c
+++ b/dlls/msvcrt/except.c
@@ -39,6 +39,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(seh);
 
+static MSVCRT_security_error_handler security_error_handler;
+
 /* VC++ extensions to Win32 SEH */
 typedef struct _SCOPETABLE
 {
@@ -820,3 +822,15 @@ BOOL CDECL MSVCRT___uncaught_exception(void)
 {
     return FALSE;
 }
+
+/* _set_security_error_handler - not exported in native msvcrt, added in msvcr70 */
+MSVCRT_security_error_handler CDECL _set_security_error_handler(
+    MSVCRT_security_error_handler handler )
+{
+    MSVCRT_security_error_handler old = security_error_handler;
+
+    TRACE("(%p)\n", handler);
+
+    security_error_handler = handler;
+    return old;
+}
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 311437a..69d3668 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -85,6 +85,7 @@ typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
 typedef int (*__cdecl MSVCRT__onexit_t)(void);
 typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t);
 typedef void (__cdecl *MSVCRT_purecall_handler)(void);
+typedef void (__cdecl *MSVCRT_security_error_handler)(int, void *);
 
 typedef struct {ULONG x80[3];} MSVCRT__LDOUBLE; /* Intel 80 bit FP format has sizeof() 12 */
 
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 5d07736..4826681 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -1485,6 +1485,7 @@
 @ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior
 @ cdecl _set_invalid_parameter_handler(ptr)
 @ cdecl _set_purecall_handler(ptr)
+@ cdecl _set_security_error_handler(ptr)
 @ cdecl -arch=i386 _statusfp2(ptr ptr)
 @ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
 @ cdecl _wdupenv_s(ptr ptr str)
-- 
1.7.1






More information about the wine-patches mailing list