Use nuint instead of IntPtr for size/length parameters.
This commit is contained in:
Родитель
2f5e14434f
Коммит
e04d7fdf9d
|
@ -39,14 +39,14 @@ namespace Network {
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport (Constants.NetworkLibrary)]
|
[DllImport (Constants.NetworkLibrary)]
|
||||||
static extern void nw_advertise_descriptor_set_txt_record (IntPtr handle, string txtRecord, IntPtr txtLen);
|
static extern void nw_advertise_descriptor_set_txt_record (IntPtr handle, string txtRecord, nuint txtLen);
|
||||||
|
|
||||||
public void SetTxtRecord (string txt)
|
public void SetTxtRecord (string txt)
|
||||||
{
|
{
|
||||||
if (txt == null)
|
if (txt == null)
|
||||||
throw new ArgumentNullException (nameof (txt));
|
throw new ArgumentNullException (nameof (txt));
|
||||||
var n = System.Text.Encoding.UTF8.GetByteCount (txt);
|
var n = System.Text.Encoding.UTF8.GetByteCount (txt);
|
||||||
nw_advertise_descriptor_set_txt_record (GetHandle (), txt, (IntPtr) n);
|
nw_advertise_descriptor_set_txt_record (GetHandle (), txt, (nuint) n);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport (Constants.NetworkLibrary)]
|
[DllImport (Constants.NetworkLibrary)]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче