Ignore:
Timestamp:
Apr 18, 2012, 10:46:37 PM (13 years ago)
Author:
dmik
Message:

kernel32: Make SEH work in OS/2 context.

See #82 for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/testapp/exceptions/seh/crash.c

    r21663 r21999  
    2424    _argc = argc;
    2525    _argv = argv;
    26     EnableSEH();
     26#ifdef ODIN_FORCE_WIN32_TIB
     27    ForceWin32TIB();
     28#endif
    2729    RegisterLxExe(WinMain, NULL);
    2830}
     
    8789void foo(int code)
    8890{
    89    __try
    90    {
    91        printf("In foo(%d)...\n", code);
     91    __try
     92    {
     93        printf("In foo(%d)...\n", code);
    9294
    93        if (code == 2)
    94        {
    95            throw_EXCEPTION_INT_DIVIDE_BY_ZERO();
    96            printf("FAILED: No exception!\n");
    97        }
    98        else
    99        {
    100            foo(code + 1);
    101        }
    102    }
    103    __except(exc_filter(exception_info()))
    104    {
    105        printf("FAILED: foo(%d) exception handled.\n", code);
    106    }
     95        if (code == 2)
     96        {
     97            throw_EXCEPTION_INT_DIVIDE_BY_ZERO();
     98            printf("FAILED: No exception!\n");
     99        }
     100        else
     101        {
     102            foo(code + 1);
     103        }
     104    }
     105    __except(exc_filter(exception_info()))
     106    {
     107        printf("FAILED: foo(%d) exception handled.\n", code);
     108    }
    107109}
    108110
     
    118120{
    119121    printf("The program should now expectedly crash "
    120            "(but NO POPUPLOG.OS2 entry!)...\n");
     122           "(and may be a NO POPUPLOG.OS2 entry)...\n");
    121123
    122124    HANDLE hThread = CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL);
Note: See TracChangeset for help on using the changeset viewer.