Commit 3a9587e0 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Log to +seh when an IsBad* function faults.

parent 4fead33f
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(virtual); WINE_DEFAULT_DEBUG_CHANNEL(virtual);
WINE_DECLARE_DEBUG_CHANNEL(seh);
static unsigned int page_size; static unsigned int page_size;
...@@ -541,7 +542,11 @@ BOOL WINAPI IsBadReadPtr( ...@@ -541,7 +542,11 @@ BOOL WINAPI IsBadReadPtr(
dummy = p[0]; dummy = p[0];
dummy = p[count - 1]; 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 __ENDTRY
return FALSE; return FALSE;
} }
...@@ -574,7 +579,11 @@ BOOL WINAPI IsBadWritePtr( ...@@ -574,7 +579,11 @@ BOOL WINAPI IsBadWritePtr(
p[0] |= 0; p[0] |= 0;
p[count - 1] |= 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 __ENDTRY
return FALSE; return FALSE;
} }
...@@ -637,7 +646,11 @@ BOOL WINAPI IsBadStringPtrA( ...@@ -637,7 +646,11 @@ BOOL WINAPI IsBadStringPtrA(
volatile const char *p = str; volatile const char *p = str;
while (p != str + max) if (!*p++) break; 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 __ENDTRY
return FALSE; return FALSE;
} }
...@@ -654,7 +667,11 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT max ) ...@@ -654,7 +667,11 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT max )
volatile const WCHAR *p = str; volatile const WCHAR *p = str;
while (p != str + max) if (!*p++) break; 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 __ENDTRY
return FALSE; return FALSE;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment