Closed Bug 681924 Opened 9 years ago Closed 9 years ago

HookSetWindowLongPtr is called several times

Categories

(Core :: Plug-ins, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(1 file, 1 obsolete file)

When I had added multiple injenction support by bug 653361, plugin-container crashed.  Because HookSetWindowLongPtr is called several times.

HookSetWindowLongPtr should not inject after 2nd times.  (because return address is static!)
Attached patch fix v1 (obsolete) — Splinter Review
Attachment #555707 - Flags: review?(joshmoz)
Attachment #555707 - Attachment is obsolete: true
Attachment #555707 - Flags: review?(joshmoz)
Attached patch fix v2Splinter Review
Attachment #555996 - Flags: review?(joshmoz)
Comment on attachment 555996 [details] [diff] [review]
fix v2

I think you want jimmm to look over this.
Attachment #555996 - Flags: review?(joshmoz) → review?(jmathies)
Originally this was a passive error, no harm came from calling AddHook more than once. If we've changed this, I wonder if there is some way we can detect it in AddHook and assert?
I went ahead and landed this as a bustage fix for Bug 684215.

http://hg.mozilla.org/mozilla-central/rev/0664108eb19d
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
(In reply to Jim Mathies [:jimm] from comment #4)
> Originally this was a passive error, no harm came from calling AddHook more
> than once. If we've changed this, I wonder if there is some way we can
> detect it in AddHook and assert?

No assertion on current code.  But now, glandium has added TestDllIntercept test that can inject APIs.
Attachment #555996 - Flags: review?(jmathies) → review+
You need to log in before you can comment on or make changes to this bug.