开发者

copy unsigned array from managed to unmanaged

开发者 https://www.devze.com 2022-12-23 23:55 出处:网络
Marshal.copy allows for signed data types only, but I have a giant array of uint16 to pass to IPP code. Any i开发者_如何学Godeas ?

Marshal.copy allows for signed data types only, but I have a giant array of uint16 to pass to IPP code. Any i开发者_如何学Godeas ?

unsafe for looping on it seems wrong ...


You can use the good old mem copy API from kernel32 and declare the parameter types to fit your needs.

[DllImport("kernel32.dll", EntryPoint="RtlMoveMemory")]
static extern void CopyMemory(IntPtr dest, UInt16[] src, int length);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号