Commit d3c5e6b0 authored by Erwan Croze's avatar Erwan Croze 👋🏻

Update Cs wrapper for uwp

parent 1584e6e1
......@@ -1293,13 +1293,7 @@ class CSharpLangTranslator(CLikeLangTranslator):
else:
res = 'int'
elif _type.name == 'string':
if dllImport:
if type(_type.parent) is Argument:
return 'string'
else:
res = 'IntPtr' # Return as IntPtr and get string with Marshal.PtrToStringAnsi()
else:
return 'string'
return 'string'
elif _type.name == 'character':
if _type.isUnsigned:
res = 'byte'
......
......@@ -207,7 +207,7 @@ namespace Linphone
{
break;
}
string key = Marshal.PtrToStringAuto(dataPtr);
string key = Marshal.PtrToStringAnsi(dataPtr);
yield return key;
ptr = bctbx_list_next(ptr);
}
......@@ -459,7 +459,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToStringAuto(linphone_call_get_native_video_window_id(nativePtr));
return Marshal.PtrToStringAnsi(linphone_call_get_native_video_window_id(nativePtr));
}
set
{
......@@ -487,7 +487,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToStringAuto(linphone_core_get_native_video_window_id(nativePtr));
return Marshal.PtrToStringAnsi(linphone_core_get_native_video_window_id(nativePtr));
}
set
{
......@@ -500,7 +500,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToStringAuto(linphone_core_get_native_preview_window_id(nativePtr));
return Marshal.PtrToStringAnsi(linphone_core_get_native_preview_window_id(nativePtr));
}
set
{
......@@ -528,8 +528,7 @@ namespace Linphone
get
{
{{#is_string}}
IntPtr stringPtr = {{getter_c_name}}({{getter_nativePtr}});
return Marshal.PtrToStringAuto(stringPtr);
return {{getter_c_name}}({{getter_nativePtr}});
{{/is_string}}
{{#is_bool}}
return {{getter_c_name}}({{getter_nativePtr}}) != 0;
......@@ -607,8 +606,7 @@ namespace Linphone
cbs.unregister();
{{/removeListener}}
{{#is_string}}
IntPtr stringPtr = {{c_name}}({{nativePtr}}{{c_args}});
return Marshal.PtrToStringAuto(stringPtr);
return {{c_name}}({{nativePtr}}{{c_args}});
{{/is_string}}
{{#is_bool}}
{{return}}{{c_name}}({{nativePtr}}{{c_args}}) == (char)0 ? false : true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment