如何在此获得指向 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];
}
我已经被困了一段时间了。