From 74050c8104a82952aadffadd11e0da12e258ab3d Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 21 Mar 2024 09:19:35 -0700 Subject: [PATCH] .NET: Convert System.RuntimeTypeHandle to TypeDefinition --- csharp-api/REFrameworkNET/Method.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/csharp-api/REFrameworkNET/Method.cpp b/csharp-api/REFrameworkNET/Method.cpp index 88c162892..6f795b19c 100644 --- a/csharp-api/REFrameworkNET/Method.cpp +++ b/csharp-api/REFrameworkNET/Method.cpp @@ -13,7 +13,7 @@ namespace REFrameworkNET { REFrameworkNET::InvokeRet^ Method::Invoke(System::Object^ obj, array^ args) { if (obj == nullptr && !this->IsStatic()) { - System::String^ declaringName = this->GetDeclaringType() != nullptr ? this->GetDeclaringType()->GetFullName() : "Unknown"; + System::String^ declaringName = this->GetDeclaringType() != nullptr ? this->GetDeclaringType()->GetFullName() : gcnew System::String("UnknownType"); System::String^ errorStr = "Cannot invoke a non-static method without an object (" + declaringName + "." + this->GetName() + ")"; REFrameworkNET::API::LogError(errorStr); throw gcnew System::InvalidOperationException(errorStr); @@ -169,6 +169,10 @@ bool Method::HandleInvokeMember_Internal(System::Object^ obj, System::String^ me // for consistency purposes MAKE_TYPE_HANDLER_2(System, Single, double, Double) MAKE_TYPE_HANDLER_2(System, Double, double, Double) + case "System.RuntimeTypeHandle"_fnv: { + result = gcnew REFrameworkNET::TypeDefinition((::REFrameworkTypeDefinitionHandle)tempResult->QWord); + break; + } default: result = tempResult; break;