Can we catch access violation exceptions in tests?

Marcus Meissner meissner at
Mon May 7 06:13:08 CDT 2007

On Mon, May 07, 2007 at 12:31:02PM +0200, Mikołaj Zalewski wrote:
>  I'm trying to write a tests for invalid cbSize in Shell_NotifyIcon. 
> The behaviour under Windows XP is to assume in such a case that the size 
> is NOTIFYICONDATA_V1_SIZE. AFAIK Shell_NotifyIcon doesn't provide a way 
> to read icon data to check that the data introduced after Win95 is not 
> modified. So I'm using VirtualAlloc+VirtualProtect to make 
> Shell_NotifyIcon fail if it tries to access this data.
>  I'd like to catch the exception to make a tests fail if something goes 
> wrong instead of crashing the testsuite. However __try doesn't work 
> under gcc and using wine/exception.h gives an unresolved symbol 
> '__wine_handle_exception'. Is it possible to catch exceptions in tests?

Of course.

Check dlls/ntdll/tests/exception.c::run_exception_test()

Ciao, Marcus

More information about the wine-devel mailing list