Is it safe to intercept EXCEPTION_GUARD_PAGE

The environment is VC ++ 9 on different Win platforms (XP and later)

I am writing an unhandled exception handler. I have vague recollection from my kernel days that it was bad to catch EXCEPTION_GUARD_PAGE, as it was generated to tell the OS to increase the stack.

My question is twofold:

  • Can such an exception occur in user space?

  • If so, can it be caught?

I'm not really interested in doing anything about it. I just want to know if I need to enter special code so as not to catch it (since I find it all the time).

__ Update: __

I remembered my source, this is Raymond Chen's blog ( http://blogs.msdn.com/b/oldnewthing/archive/2006/09/27/773741.aspx )

My initial problem is that when catching all exceptions, if I catch EXCEPTION_GUARD_PAGE, I can prevent the OS from seeing the exception and increase the stack.

Upon further thought, I suspect that EXCEPTION_GUARD_PAGE may be processed in the kernel during a read / write operation that generated it, and thus never reach my user space code.

I suppose I'm looking for someone who confirms (or contradicts) this.

__ Second update: __

I have not yet chosen an answer, since no one answered this question. I will leave it open in the hope that someone else can offer the information I'm looking for.

__ Third update __

Still living (weak) hope.

__ Fourth update __

, . , , . , . , , .

+3
3

STATUS_GUARD_PAGE_VIOLATION VirtualProtectEx(), PAGE_GUARD - . , , .

, , . .

. , . , , , . , , , .

+3

virtualquery, . , . , .

+1

MSDN:

PAGE_GUARD.

, , ; .

Edit

OS , , , .

0
source

Source: https://habr.com/ru/post/1750414/


All Articles