When error occurs VS falls out to ntdll and won't identify location of error.

Gavin Williams 761 Reputation points
2023-06-25T12:51:57.8766667+00:00

I'm using Vortice (DirectX wrapper) in a project and I have native code debugging enabled. When there is a DirectX error I get the expected error in the Output window but Visual Studio is completely unable to understand where the issue is. So the call stack shows...

ntdll.dll
KernelBase.dll

And I'm shown a No Symbols Loaded page (for ntdll.pdb) with a floating Exception Unhandled window - System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'

This isn't helpful at all. I expect to be taken to the code that is throwing the exception. Is this fixable? Should I file an issue with MS? Or is the issue here that DirectX is throwing an error - not an exception - and perhaps I should file an issue with the Vortice project and ask that an exception be thrown? Or do I have to write error checking code everywhere (perhaps inside my own exception code)? I'm just not sure what's going wrong or how to deal with it :(

And what's silly, is that I can locate the errored line and it's actually gray-boxed out as though VS knows exactly where the issue happened. But there's no breakpoint marker and the floating exception window that I described before is not attached to the line as it should be.

When I load symbols for ntdll and KernelBase it doesn't help, I get a similar experience with Source Not Available, same floating exception window.

I expect VS to take me to the line that causes the exception.. ie..

dc.ResolveSubresource(hdrTextureT2d_MS1, 0, hdrTextureT2d_MSx, 0, dstFormat);
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.