From 3a9587e09f6548ca7f0fd7801b282565a3d1a14c Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Tue, 22 Mar 2005 21:16:39 +0000 Subject: [PATCH] Log to +seh when an IsBad* function faults. --- dlls/kernel/virtual.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dlls/kernel/virtual.c b/dlls/kernel/virtual.c index c5d8e8d032a..d1c3a3c6384 100644 --- a/dlls/kernel/virtual.c +++ b/dlls/kernel/virtual.c @@ -44,6 +44,7 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(virtual); +WINE_DECLARE_DEBUG_CHANNEL(seh); static unsigned int page_size; @@ -541,7 +542,11 @@ BOOL WINAPI IsBadReadPtr( dummy = p[0]; dummy = p[count - 1]; } - __EXCEPT(page_fault) { return TRUE; } + __EXCEPT(page_fault) + { + TRACE_(seh)("%p caused page fault during read\n", ptr); + return TRUE; + } __ENDTRY return FALSE; } @@ -574,7 +579,11 @@ BOOL WINAPI IsBadWritePtr( p[0] |= 0; p[count - 1] |= 0; } - __EXCEPT(page_fault) { return TRUE; } + __EXCEPT(page_fault) + { + TRACE_(seh)("%p caused page fault during write\n", ptr); + return TRUE; + } __ENDTRY return FALSE; } @@ -637,7 +646,11 @@ BOOL WINAPI IsBadStringPtrA( volatile const char *p = str; while (p != str + max) if (!*p++) break; } - __EXCEPT(page_fault) { return TRUE; } + __EXCEPT(page_fault) + { + TRACE_(seh)("%p caused page fault during read\n", str); + return TRUE; + } __ENDTRY return FALSE; } @@ -654,7 +667,11 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT max ) volatile const WCHAR *p = str; while (p != str + max) if (!*p++) break; } - __EXCEPT(page_fault) { return TRUE; } + __EXCEPT(page_fault) + { + TRACE_(seh)("%p caused page fault during read\n", str); + return TRUE; + } __ENDTRY return FALSE; }