Part 4 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we learn how to call methods from
AccessViolationException. This part starts when, as I ran out of easy things to try, I decided to map the assembly code of the
IsLockHeld method to the original C++ code to understand exactly where it crashed.