diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index 415016c9..b3af0139 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -398,14 +398,19 @@ namespace Cxxi.Generators.CLI } else { - Return = string.Format("(::{0}*)&{1}", @class.OriginalName, + if (!Context.Parameter.Type.IsPointer()) + Return = "*"; + + Return += string.Format("(::{0}*)&{1}", @class.QualifiedOriginalName, Context.Parameter.Name); } - } else { - Return = string.Format("{0}->NativePtr", Context.Parameter.Name); + if (!Context.Parameter.Type.IsPointer()) + Return = "*"; + + Return += string.Format("{0}->NativePtr", Context.Parameter.Name); } return true;