Prevent 'd3d9.dll' function 'D3D9SetMode' calling 'ChangeDisplaySettingsExA'

411 Views Asked by At

I am using a third party .dll which wraps around the DirectX d3d9.dll, modifying the original .dll's execution. A well known example of this type of setup is used by Fraps.

I am creating a Fullscreen exclusive device in multihead mode (D3DCREATE_ADAPTERGROUP_DEVICE).

I am running up against a problem where the .dll wrapper exits my program when a particular function is called from D3D9SetMode.

Here is a partial call stack generated by WinDbg from breaking when ChangeDisplaySettingsExA function is called:

0018e748 7024712d USER32!ChangeDisplaySettingsExA
0018e828 7024702e d3d9!D3D9SetMode+0xec
0018e858 70246fab d3d9!DdSetModeLH+0x83
0018e954 7024760b d3d9!CSwapChain::SetSwapChainDisplayMode+0x5ca
0018e9a4 702492b0 d3d9!CSwapChain::DoneExclusiveMode+0xc7
0018e9c8 702491fc d3d9!CEnum::DoneExclusiveMode+0x5d
0018ea18 7024904a d3d9!handleActivateApp+0x12f
0018ea40 763862fa d3d9!WindowProc+0x30f
...

I have worked out the WM_ACTIVATE is the last message to be processed before this occurs.

I have tried building against the DirectX9 February 2005 and 2007 SDK's (d3dx9_24.dll and d3dx9_32.dll respectively) - they both have the same problem.

I suspect there is a flag or setup scenario to prevent the call to ChangeDisplaySettingsExA. I have tried D3DCREATE_NOWINDOWCHANGES on device creation without any success.

Any links, information, ideas?

0

There are 0 best solutions below