1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-17 07:44:09 +02:00

Added GetFieldReference, ability to explicitly reference in Variant

This commit is contained in:
Brian Fiete 2020-07-06 09:09:28 -07:00
parent 5cfe9e6196
commit 78dd56d6c5
11 changed files with 279 additions and 54 deletions

View file

@ -137,7 +137,16 @@ namespace System.Reflection
added = true;
}
else
isValid = false;
{
if ((Type)argType != refParamType.UnderlyingType)
isValid = false;
ffiParamList.Add(&FFIType.Pointer);
int* stackDataPtr = scope:mixin int();
*stackDataPtr = (int)dataPtr;
ffiArgList.Add(stackDataPtr);
added = true;
}
}
else if (paramType.IsValueType)
{
@ -412,7 +421,22 @@ namespace System.Reflection
added = true;
}
else
isValid = false;
{
var elemType = argType.UnderlyingType;
if (elemType != refParamType.UnderlyingType)
{
if (elemType.IsTypedPrimitive)
elemType = elemType.UnderlyingType;
if (elemType != refParamType.UnderlyingType)
isValid = false;
}
ffiParamList.Add(&FFIType.Pointer);
int* stackDataPtr = scope:mixin int();
*stackDataPtr = (int)dataPtr;
ffiArgList.Add(stackDataPtr);
added = true;
}
}
else if (paramType.IsValueType)
{