PostError Run-Time Check Failure #2 - Stack around the variable 'dwvTable' was corrupted

Posts 1–2 of 2 · Page 1 of 1
Error Run-Time Check Failure #2 - Stack around the variable 'dwvTable' was corrupted
Code:
VOID CreateDevice(DWORD *dwVTable)
{
	LPDIRECT3D9 pD3d9;
	LPDIRECT3DDEVICE9 pD3DDevice;
	pD3d9 = Direct3DCreate9(D3D_SDK_VERSION);
	if(pD3d9 == NULL)
		return;
	D3DPRESENT_PARAMETERS pPresentParms;
	ZeroMemory(&pPresentParms, sizeof(pPresentParms));
	pPresentParms.Windowed = TRUE;
	pPresentParms.BackBufferFormat = D3DFMT_UNKNOWN;
	pPresentParms.SwapEffect = D3DSWAPEFFECT_DISCARD;
	if(FAILED(pD3d9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, GetDesktopWindow(), D3DCREATE_SOFTWARE_VERTEXPROCESSING, &pPresentParms, &pD3DDevice)))
		return;
	DWORD * dwTable = ( DWORD* )pD3DDevice;
	dwTable = ( DWORD* ) dwTable[0];
	dwVTable[0] = dwTable[16];
	dwVTable[1] = dwTable[17];
	dwVTable[2] = dwTable[82];
}
Acredito que o problema estaja ai, mas eu olho e re-olho e nao encontro nada de errado, alguem poderia me ajudar ?
O erro pode ser no ato do uso dessa função, de mais detalhes, post onde você está usando a mesma!
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?