Bug 630697 - Set WindowProc using the unicode functions in plugin hook procedures. r=jmathies, a=final.

This commit is contained in:
Benjamin Smedberg 2011-02-09 16:49:15 -06:00
parent 58e86733e6
commit 37f895fef1

View File

@ -953,6 +953,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
mPluginWndProc = reinterpret_cast<WNDPROC>(
SetWindowLongPtr(mPluginWindowHWND, GWLP_WNDPROC,
reinterpret_cast<LONG_PTR>(PluginWindowProc)));
NS_ASSERTION(mPluginWndProc != PluginWindowProc, "WTF?");
}
RemoveProp(mPluginWindowHWND, kPluginIgnoreSubclassProperty);
HookSetWindowLongPtr();
@ -1150,6 +1151,7 @@ PluginInstanceChild::PluginWindowProc(HWND hWnd,
}
NS_ASSERTION(self->mPluginWindowHWND == hWnd, "Wrong window!");
NS_ASSERTION(self->mPluginWndProc != PluginWindowProc, "Self-referential windowproc. Infinite recursion will happen soon.");
// Adobe's shockwave positions the plugin window relative to the browser
// frame when it initializes. With oopp disabled, this wouldn't have an
@ -1200,6 +1202,8 @@ PluginInstanceChild::PluginWindowProc(HWND hWnd,
return 0;
}
NS_ASSERTION(self->mPluginWndProc != PluginWindowProc, "Self-referential windowproc happened inside our hook proc. Infinite recursion will happen soon.");
LRESULT res = CallWindowProc(self->mPluginWndProc, hWnd, message, wParam,
lParam);
@ -1364,8 +1368,9 @@ PluginInstanceChild::SetWindowLongAHook(HWND hWnd,
reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_WNDPROC));
if (currentProc != PluginWindowProc) {
self->mPluginWndProc =
reinterpret_cast<WNDPROC>(sUser32SetWindowLongAHookStub(hWnd, nIndex,
reinterpret_cast<WNDPROC>(sUser32SetWindowLongWHookStub(hWnd, nIndex,
reinterpret_cast<LONG_PTR>(PluginWindowProc)));
NS_ASSERTION(self->mPluginWndProc != PluginWindowProc, "Infinite recursion coming up!");
}
return proc;
}
@ -1397,8 +1402,9 @@ PluginInstanceChild::SetWindowLongWHook(HWND hWnd,
reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_WNDPROC));
if (currentProc != PluginWindowProc) {
self->mPluginWndProc =
reinterpret_cast<WNDPROC>(sUser32SetWindowLongAHookStub(hWnd, nIndex,
reinterpret_cast<WNDPROC>(sUser32SetWindowLongWHookStub(hWnd, nIndex,
reinterpret_cast<LONG_PTR>(PluginWindowProc)));
NS_ASSERTION(self->mPluginWndProc != PluginWindowProc, "Infinite recursion coming up!");
}
return proc;
}