CallNextHookEx
(1)
AfxCbtFilterHook
(1)
SetWindowsHookEx
(1)
MFC
(1)
DavidRe
(1)
MSFTNGP
(1)
BillRe
(1)
HookFinder
(1)

CallNextHookEx/AfxCbtFilterHook => stack overflow

Asked By Bill Davy
08-Sep-08 04:47 AM
Stack overflowed in call of CallNextHookEx() after label (!) in
AfxCbtFilterHook(int code=69762, unsigned int wParam=134, long lParam=0).

Nothing that looked interesting on the stack (and none of my functions
either).

I've a feeling/hunch/guess this is down to leaving my program running (with
a progress bar being updated) when I lock this computer.

It was worse on VS.2003 and better under VS.2005 (and do not have anything
later to try).

Any suggestions?

TIA

Bill

CallNextHookEx/AfxCbtFilterHook => stack overflow

Asked By David Ching
08-Sep-08 05:20 AM
More info please.  What are you doing that is causing MFC to use a CBT
filter hook?

-- David

Not explicitly using hooks at all (what are they?

Asked By Bill Davy
08-Sep-08 07:14 AM
Not explicitly using hooks at all (what are they?).  What might cause MFC to
use one?

Does CBT = "cognitive behavioral therapy"?

If there is a next time, I'll gather the call stack in csae that contains
something revealing.

Rgds,
Bill

CallNextHookEx/AfxCbtFilterHook => stack overflow

Asked By David Ching
08-Sep-08 06:51 PM
LOL, no, it stands for "Computer based training".  I think MFC uses this
hook to get notified of when a window is created so that it can, e.g. center
a modal window over its parent.  (Yes, I was amazed it took something as low
level as a hook to perform this function.)  But I don't see why this code
should fail in your case.

One thing is that hooks are sensitive to other apps that have installed the
same hook.  In fact, you say the crash occurs when CallNextHookEx() is
running, and that is what causes the next app to have registered for the
hook notification to be called.  So it might have something to do with
another app in your system that is misbehaving.

-- David
CallNextHookEx/AfxCbtFilterHook => stack overflow
Asked By Bill Davy
09-Sep-08 04:40 AM
That seems reasonable.  I suppose the hook list is global.  Is there an easy
way to see when and who has registered?  It might help me point the finger,
otherwise it is left pointing at me.  This is a corporate machine and there
are things going on of which I know not.  The problem is not thought to
happen when disconnected from the network (a perception on which I lean
heavily).

TIA,
Bill
CallNextHookEx/AfxCbtFilterHook => stack overflow
Asked By David Ching
09-Sep-08 09:57 AM
There are some anti-malware packages that intercept SetWindowsHookEx() and
display a big message saying "app so and so just tried to install a hook, do
you want to let it?" (of course they use vaguer terminology).  Maybe you
could run one of those.  But it needs to run early on, before the other
apps.

You can search for this; I found HookFinder article at
http://www.cylab.cmu.edu/files/cmucylab07015.pdf which mentions some.

-- David
CallNextHookEx/AfxCbtFilterHook => stack overflow
Asked By Bill Davy
09-Sep-08 12:59 PM
Many thanks.  Now I know what I am looking for,  I will follow it up from
here.

Rgds,
Bill
Post Question To EggHeadCafe