HookSetWindowLongPtr is called several times

RESOLVED FIXED

Status

()

Core
Plug-ins
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: m_kato, Assigned: m_kato)

Tracking

Trunk
x86
Windows Vista
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

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!)
Created attachment 555707 [details] [diff] [review]
fix v1
(Assignee)

Updated

6 years ago
Attachment #555707 - Flags: review?(joshmoz)
(Assignee)

Updated

6 years ago
Attachment #555707 - Attachment is obsolete: true
Attachment #555707 - Flags: review?(joshmoz)
Created attachment 555996 [details] [diff] [review]
fix v2
(Assignee)

Updated

6 years ago
Attachment #555996 - Flags: review?(joshmoz)
Comment on attachment 555996 [details] [diff] [review]
fix v2

I think you want jimmm to look over this.
(Assignee)

Updated

6 years ago
Attachment #555996 - Flags: review?(joshmoz) → review?(jmathies)

Comment 4

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
Blocks: 684215
(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.

Updated

6 years ago
Attachment #555996 - Flags: review?(jmathies) → review+
You need to log in before you can comment on or make changes to this bug.