justinstenning / Direct3DHook

DirectX Capture and Overlays by using Direct3D API hooks
http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks
MIT License
580 stars 178 forks source link

Windows 7 and DirectX11 crashes with the “Display Driver AMD stopped responding" message #41

Closed Avsteiner closed 8 years ago

Avsteiner commented 8 years ago

While I was trying to run the project on Windows 7 as well, I managed to easily hook to a simple DirectX10 window, but when I tried to hook to a simple DirectX11 window, the target window became unresponsive, followed by the message “Display Driver AMD stopped responding, and was successfully restored”. The project itself kept running, and threw debug messages. The problem seems to be related to SharpDX and calling “draw” to the overlayEngine, but I am still not very familiar with the code.

Please let me know if you can help. I really appreciate it.

Have a great year to come! Avi

This is the debug dump. The first long debug message was thrown 8 times in the activation: Debug: DXHookD3D11: PresentHook: Exeception: SharpDX.SharpDXException: SharpDX.SharpDXException: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: Unknown at SharpDX.Result.CheckError() at SharpDX.Direct3D11.DeviceContext.FinishCommandListInternal(Bool restoreDeferredContextState, CommandList& commandListOut) at SharpDX.Direct3D11.DeviceContext.FinishCommandList(Boolean restoreState) at Capture.Hook.DX11.DXOverlayEngine.End() in c:\Cyndr\Direct3DHook-master\Capture\Hook\DX11\DXOverlayEngine.cs:line 168 at Capture.Hook.DX11.DXOverlayEngine.Draw() in c:\Cyndr\Direct3DHook-master\Capture\Hook\DX11\DXOverlayEngine.cs:line 161 at Capture.Hook.DXHookD3D11.PresentHook(IntPtr swapChainPtr, Int32 syncInterval, PresentFlags flags) in c:\Cyndr\Direct3DHook-master\Capture\Hook\DXHookD3D11.cs:line 538 Debug: DXHookD3D11: Hook: Device created Debug: DXHookD3D11: Hook: Before device creation Debug: DXHookD3D11: Hook: Begin Debug: Autodetect found Direct3D 11 Information: Remote process is a 32-bit process. Information: Injected into process Id:73912. Reply

justinstenning commented 8 years ago

@Avsteiner it could be that the approach I've used for the overlay in DX11 does something that your driver isn't expecting. Are you using the latest display driver?

Avsteiner commented 8 years ago

Hi, thank you very much for pointing me to this direction. looking more into this I found out that I was trying to run the hook on a Directx11 application with a Windows7 machine that has ATI Radeon HD 4200 installed, which only supports DirectX10.1. Sorry for taking your time on this problem and thank you for giving me direction, I am pretty new to graphics/DirectX. I am glad that I got to learn something new though.

justinstenning commented 8 years ago

@Avsteiner glad you have sorted it out.