// Called from native code as a callback, store the exception in TLS and // throw it when we return to CLR code internal static void RecordNativeException(int errorCode, string errorName, string message) { exception = new NativeException(errorCode, errorName, message); }