C
C#5d ago
Oleander

Native AOT Shared Library - Correct Typing for Struct Pointer Parameter

I'm trying to define an exported static method to conform with the following procedure: void retro_get_system_info(struct retro_system_info *info) Currently I'm defining my method as:
public static class RetroEntrypoint
{
[UnmanagedCallersOnly(EntryPoint = "retro_get_system_info")]
public static void RetroGetSystemInfo(nuint info)
{
// ...
}
}
public static class RetroEntrypoint
{
[UnmanagedCallersOnly(EntryPoint = "retro_get_system_info")]
public static void RetroGetSystemInfo(nuint info)
{
// ...
}
}
Is there a better way of typing the info parameter to avoid having to try marshalling the struct within the method?
2 Replies
reflectronic
reflectronic5d ago
why can't you do retro_system_info* info?
Oleander
OleanderOP5d ago
That's... a good question I was under the impression that struct pointers were not valid blittable types It works! Thanks for the help!

Did you find this page helpful?