The C# specification indicates that function pointers can only be used on static methods. This article explains why.

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.