1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-23 01:08:47 +00:00

Use nint keyword not IntPtr type

This commit is contained in:
Oliver Booth 2022-11-30 19:24:58 +00:00
parent 031450ca7e
commit 1032313dff
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -34,7 +34,7 @@ internal sealed class Utf8StringToNative : ICustomMarshaler
fixed (byte* data = &MemoryMarshal.GetReference(utf8Bytes)) fixed (byte* data = &MemoryMarshal.GetReference(utf8Bytes))
{ {
IntPtr buffer = Marshal.AllocHGlobal(utf8Bytes.Length + 1); nint buffer = Marshal.AllocHGlobal(utf8Bytes.Length + 1);
Buffer.MemoryCopy(data, (void*)buffer, utf8Bytes.Length, utf8Bytes.Length); Buffer.MemoryCopy(data, (void*)buffer, utf8Bytes.Length, utf8Bytes.Length);
Marshal.WriteByte(buffer, utf8Bytes.Length, 0); Marshal.WriteByte(buffer, utf8Bytes.Length, 0);
return buffer; return buffer;