﻿id	summary	reporter	owner	description	type	status	component	version	resolution	keywords	cc	guest	host
5640	Hang during Direct3D access from Windows XP	Vladimir		"The following C++ code hangs.
{{{
HRESULT hr = S_OK;

m_d3dobj = Direct3DCreate9(D3D_SDK_VERSION);

RECT rc;
GetWindowRect(m_hwnd, &rc);
int wnd_width = rc.right - rc.left;
int wnd_height = rc.bottom - rc.top;
if (wnd_width || wnd_height)	{
  m_wnd_width = wnd_width;
  m_wnd_height = wnd_height;
}

wnd_width += wnd_width % 2;

D3DDISPLAYMODE d3ddm;
hr = IDirect3D9_GetAdapterDisplayMode(m_d3dobj, D3DADAPTER_DEFAULT, &d3ddm);
if (FAILED(hr)) return false;
m_texture_format = d3ddm.Format;

D3DPRESENT_PARAMETERS d3dpp;
memset(&d3dpp, 0, sizeof(D3DPRESENT_PARAMETERS));
d3dpp.Flags                  = D3DPRESENTFLAG_VIDEO;
d3dpp.Windowed               = TRUE;
d3dpp.hDeviceWindow          = m_hwnd;
d3dpp.BackBufferWidth        = m_wnd_width;
d3dpp.BackBufferHeight       = m_wnd_height;
d3dpp.SwapEffect             = D3DSWAPEFFECT_COPY;
d3dpp.MultiSampleType        = D3DMULTISAMPLE_NONE;
d3dpp.PresentationInterval   = D3DPRESENT_INTERVAL_DEFAULT;
d3dpp.BackBufferFormat       = m_texture_format;
d3dpp.BackBufferCount        = 1;
d3dpp.EnableAutoDepthStencil = FALSE;

hr = IDirect3D9_CreateDevice(m_d3dobj, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &m_d3ddev);

}}}

I am using DirectX SDK 9. of March 2008, Visual Studio 2008 SP1.

The call to IDirect3D9_GetAdapterDisplayMode has returned d3ddm.Format = D3DFMT_X8R8G8B8 

Guest OS is Windows XP SP3, russian.

Host OS is Ubuntu 9.10, 32-bit, with all updates.

The output of uname -a:
{{{
$ uname -a
Linux veremeev 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009 i686 GNU/Linux
}}}

Host video adapter is NVidia GeForce 8400 GS, driver version is 190.42
"	defect	closed	3D support	VirtualBox 3.1.0	fixed			Windows	Linux
