return NULL for unhandled nvapi functions, to disable them. Closes #1100

This commit is contained in:
baldurk
2018-09-07 14:22:48 +01:00
parent 553a68de19
commit c091dfa685
+14 -2
View File
@@ -395,6 +395,9 @@ private:
{
void *real = d3d11hooks.nvapi_QueryInterface()(ID);
if(real == NULL)
return real;
if(ID == 0x6A16D3A0)
{
d3d11hooks.nvapi_CreateDevice_real = (PFNNVCreateDevice)real;
@@ -405,8 +408,17 @@ private:
d3d11hooks.nvapi_CreateDeviceAndSwapChain_real = (PFNNVCreateDeviceAndSwapChain)real;
return &nvapi_CreateDeviceAndSwapChain;
}
return real;
else if(ID == 0xAD298D3F || ID == 0x0150E828 || ID == 0x33C7358C || ID == 0x593E8644)
{
// these seem to be fetched inside NvAPI_Initialize so we allow them through to avoid
// causing problems
return real;
}
else
{
RDCWARN("Returning NULL for nvapi_QueryInterface(%x)", ID);
return NULL;
}
}
PNVENCREGISTERRESOURCE real_nvEncRegisterResource = NULL;