[user32] Add DECLSPEC_NOINLINE, use it on call_hook_proc()

Dan Kegel dank at kegel.com
Fri Apr 19 12:38:26 CDT 2013


On Fri, Apr 19, 2013 at 10:13 AM, Qian Hong <fracting at gmail.com> wrote:
> Curiosity killed the cat, what is the theory behind this patch?

Hooking is a fragile business.  Somebody somewhere is probably
making assumptions about how hooking works (like, how many stack
frames are pushed), and inlining call_hook_proc probably violates one
of those assumptions.

> I tried explicitly add 'inline' to every static functions in hook.c
> but complie with -O0, to see if the bug can be reproduced in this way,
> but nothing happen, this make me doubt being inline is not the
> culprit.

call_hook_proc is probably the only function whose inlining matters
for this problem (since my patch solved your problem at -O2).

(inline is only a hint. FORCEINLINE is stronger.)
- Dan



More information about the wine-devel mailing list