Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions MetadataProcessor.Shared/Utility/NativeMethodsCrc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,18 @@ internal static string GetNanoCLRTypeName(TypeReference parameterType)
// check if it's generic
return "DATATYPE_GENERICTYPE";
}
else
else if(parameterType.IsPointer)
{
// this is not a generic, get full qualified type name
string typeName = parameterType.FullName.Replace(".", String.Empty);

return CleanupGenericName(typeName);
if (nanoSignaturesTable.PrimitiveTypes.TryGetValue(parameterType.GetElementType().FullName, out myType))
{
return $"{myType}ptr";
}
}

// last attempt: get full qualified type name
string typeName = parameterType.FullName.Replace(".", string.Empty);

return CleanupGenericName(typeName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ public void Method()

[MethodImpl(MethodImplOptions.InternalCall)]
private static extern byte NativeStaticMethodReturningByte(char charParam);

[MethodImpl(MethodImplOptions.InternalCall)]
public extern unsafe void MethodWithPointerParm(void* pointer, int length);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<RootNamespace>StubsGenerationTestNFApp</RootNamespace>
<AssemblyName>StubsGenerationTestNFApp</AssemblyName>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Label="nanoFramework">
<NFMDP_GENERATE_STUBS>True</NFMDP_GENERATE_STUBS>
Expand All @@ -35,4 +36,4 @@
<ProjectConfigurationsDeclaredAsItems />
</ProjectCapabilities>
</ProjectExtensions>
</Project>
</Project>