I'm doing some tutorials about hooking endScene and I don't understand why there are three ***
instead of one. What are the second and the third ones representing:
memcpy(pTable, *(void***)(pDummyDevice), size);
I can't understand why do I put three '*' instead of just a one if someone can explain to me why there are three I would very appreciate it
bool GetD3D9Device(void** pTable, size_t size)
{
if (!pTable)
return false;
IDirect3D9* pD3D = Direct3DCreate9(D3D_SDK_VERSION);
if (!pD3D) {
return false;
}
IDirect3DDevice9* pDummyDevice = nullptr;
D3DPRESENT_PARAMETERS d3dpp = {};
d3dpp.Windowed = false;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = GetProcessWindow();
HRESULT dummyDevCreated = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3dpp.hDeviceWindow,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pDummyDevice);
if (dummyDevCreated != S_OK) {
d3dpp.Windowed = !d3dpp.Windowed;
HRESULT dummyDevCreated = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3dpp.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &pDummyDevice);
if (dummyDevCreated != S_OK)
{
pD3D->Release();
return false;
}
}
memcpy(pTable, *(void***)(pDummyDevice), size);
pDummyDevice->Release();
pD3D->Release();
}
void* d3d9Device[119]; // this is the var