Bug 681924: Plugin container should not hook functions multiple times. no-r, landing as a bustage fix.

This commit is contained in:
Makoto Kato
2011-09-02 10:22:02 -04:00
parent 1805928bf5
commit 062ecf8a87
3 changed files with 35 additions and 20 deletions

View File

@@ -495,15 +495,23 @@ HookSetWindowLongPtr()
{
sUser32Intercept.Init("user32.dll");
#ifdef _WIN64
sUser32Intercept.AddHook("SetWindowLongPtrA", reinterpret_cast<intptr_t>(SetWindowLongPtrAHook),
(void**) &sUser32SetWindowLongAHookStub);
sUser32Intercept.AddHook("SetWindowLongPtrW", reinterpret_cast<intptr_t>(SetWindowLongPtrWHook),
(void**) &sUser32SetWindowLongWHookStub);
if (!sUser32SetWindowLongAHookStub)
sUser32Intercept.AddHook("SetWindowLongPtrA",
reinterpret_cast<intptr_t>(SetWindowLongPtrAHook),
(void**) &sUser32SetWindowLongAHookStub);
if (!sUser32SetWindowLongWHookStub)
sUser32Intercept.AddHook("SetWindowLongPtrW",
reinterpret_cast<intptr_t>(SetWindowLongPtrWHook),
(void**) &sUser32SetWindowLongWHookStub);
#else
sUser32Intercept.AddHook("SetWindowLongA", reinterpret_cast<intptr_t>(SetWindowLongAHook),
(void**) &sUser32SetWindowLongAHookStub);
sUser32Intercept.AddHook("SetWindowLongW", reinterpret_cast<intptr_t>(SetWindowLongWHook),
(void**) &sUser32SetWindowLongWHookStub);
if (!sUser32SetWindowLongAHookStub)
sUser32Intercept.AddHook("SetWindowLongA",
reinterpret_cast<intptr_t>(SetWindowLongAHook),
(void**) &sUser32SetWindowLongAHookStub);
if (!sUser32SetWindowLongWHookStub)
sUser32Intercept.AddHook("SetWindowLongW",
reinterpret_cast<intptr_t>(SetWindowLongWHook),
(void**) &sUser32SetWindowLongWHookStub);
#endif
}