Skip to content

Problem with C style typed pointers #1907

Open
@DarioDaF

Description

@DarioDaF

I might be missing some parts, but I have in a header this definition:

typedef struct _MYSTRUCT *MYSTRUCT ;

with no real reference, just a pointer to an empty struct that is never to be "managed" from inside the code and only passed around, sort of like a void*.

This gets mapped to a MYSTRUCT type as it's correct in C#, but I don't have a way to create an instance of this pointing to null (to then pass to the constructor function etc, typed bool CreateMyStruct(MYSTRUCT s);, I tried MYSTRUCT .__CreateInstance(IntPtr.Zero); but this is short circuited and not updated when passed to the create function, is there an intended way to handle this or a workaround to consume this type of create/destroy C style?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions