#include <windows.h>
#include <stdio.h>
DWORD exception_filter(int* k)
{
return EXCEPTION_EXECUTE_HANDLER;
}
void myThrow(int tc) // called from try block
{
RaiseException((DWORD)tc,0,0,NULL); // does not work
}
int main(void)
{
int foo = 0;
__try
{
//*(DWORD *) 0 = 0xdeadbeef;
myThrow(0);
}
__except(exception_filter(&foo))
{
printf("Exception!\n");
}
return 0;
}