Since we can't create a swap chain for another process' window, error out gracefully.

Was triggered from Chrome trying to use a Windows XP path on the DX11 side of things. TRAC #22438 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1760 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 34f507ce
...@@ -237,6 +237,18 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap ...@@ -237,6 +237,18 @@ EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swap
if (mWindow) if (mWindow)
{ {
// We cannot create a swap chain for an HWND that is owned by a different process
DWORD currentProcessId = GetCurrentProcessId();
DWORD wndProcessId;
GetWindowThreadProcessId(mWindow, &wndProcessId);
if (currentProcessId != wndProcessId)
{
ERR("Could not create swap chain, window owned by different process");
release();
return EGL_BAD_NATIVE_WINDOW;
}
IDXGIFactory *factory = mRenderer->getDxgiFactory(); IDXGIFactory *factory = mRenderer->getDxgiFactory();
DXGI_SWAP_CHAIN_DESC swapChainDesc = {0}; DXGI_SWAP_CHAIN_DESC swapChainDesc = {0};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment