これでvtableへのポインタを取得するにはどうすればよいですか:
ID3D11Device *dev; //the pointer to the device interface
これは私が今持っているものであり、それが正しいとは思いません。
uintptr_t* pInterfaceVTable = *(uintptr_t**)dev;
もしそうなら、どうすればメンバー関数を取得できますか? 繰り返しますが、これは私が今持っているものです。
uintptr_t** g_deviceFunctionAddresses = new uintptr_t*[D3D11_DEVICE_METHOD_COUNT];
if(dev != NULL && swapchain != NULL){
for(int i=0; i<D3D11_DEVICE_METHOD_COUNT; i++){
g_deviceFunctionAddresses[i] = (uintptr_t*)pInterfaceVTable[i];
}
smplvtablefunction = pInterfaceVTable[functionoffset];
}
私はこれでしばらく立ち往生しています。