Bug 681924: Plugin container should not hook functions multiple times. no-r, landing as a bustage fix.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user