开发者

copy unsigned array from managed to unmanaged

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜