private static void OnDebuggerError(IntPtr thisPtr, IntPtr processRef, SharpGen.Runtime.Result errorHR, int errorCode) { var shadow = ToShadow <ManagedCallbackShadow>(thisPtr); var callback = (ManagedCallbackImpl)shadow.Callback; callback.OnDebuggerError(Process.GetCorProcess(processRef), errorHR, errorCode); }