Exception handler for STATUS_GUARD_PAGE exception.

Discussion in 'C++' started by Todd A. Anderson, Nov 3, 2004.

  1. Hi,

    I want to call VirtualProtect with the PAGE_GUARD flag to cause
    subsequent
    accesses to certain regions of memory to generate the STATUS_GUARD_PAGE
    exception. When this exception happens, I want to record some information
    and
    then have the operation that caused the fault retry the operation (which
    should succeed
    because the PAGE_GUARD flag is removed by the exception process). I want to
    write the handler just once but if I put it in Main() then when the
    exception happens
    the stack will unwind all the way back to Main(). Whatever happened to the
    old style
    where you could insert yourself into a list of exception handlers and you
    would return
    to the point where you left off after you had processed the exception? It
    has been
    a while since I've had to do this and I can't seem to find it in the
    documentation as it is
    full of structured exception handling.

    I'm currently working in VC++ 6 if that matters.

    thanks,

    Todd
     
    Todd A. Anderson, Nov 3, 2004
    #1
    1. Advertising

  2. Todd A. Anderson

    Jack Klein Guest

    On Tue, 2 Nov 2004 18:03:42 -0800, "Todd A. Anderson"
    <0SPAM> wrote in comp.lang.c++:

    > Hi,
    >
    > I want to call VirtualProtect with the PAGE_GUARD flag to cause
    > subsequent
    > accesses to certain regions of memory to generate the STATUS_GUARD_PAGE
    > exception. When this exception happens, I want to record some information
    > and
    > then have the operation that caused the fault retry the operation (which
    > should succeed
    > because the PAGE_GUARD flag is removed by the exception process). I want to
    > write the handler just once but if I put it in Main() then when the
    > exception happens
    > the stack will unwind all the way back to Main(). Whatever happened to the
    > old style
    > where you could insert yourself into a list of exception handlers and you
    > would return
    > to the point where you left off after you had processed the exception? It
    > has been
    > a while since I've had to do this and I can't seem to find it in the
    > documentation as it is
    > full of structured exception handling.
    >
    > I'm currently working in VC++ 6 if that matters.
    >
    > thanks,
    >
    > Todd


    None of "VirtualProtect", "PAGE_GUARD", or "STATUS_PAGE_GUARD" are
    defined by or are part of the topic here, the standard C++ language.
    Based on your reference to Visual C++, I gather that they are Windows
    API things, not discussed here.

    You need to ask in a group like
    news:comp.os.ms-windows.win32.programmer or one of Microsoft's support
    groups in the news:microsoft.public.vc.* family. It is not a C++
    language issue.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Nov 3, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sky Fly
    Replies:
    2
    Views:
    330
    Sky Fly
    Apr 9, 2004
  2. murl
    Replies:
    2
    Views:
    685
    =?Utf-8?B?UGF1bCBNLg==?=
    Sep 1, 2004
  3. shruds
    Replies:
    1
    Views:
    871
    John C. Bollinger
    Jan 27, 2006
  4. Replies:
    1
    Views:
    727
    Damien
    Feb 22, 2007
  5. Replies:
    0
    Views:
    365
Loading...

Share This Page