定义struct Buffer
[StructLayout(LayoutKind.Explicit, Size = 0x40008)] private struct Buffer { [FieldOffset(8)] public byte Buff0; [FieldOffset(0)] public int Length; [FieldOffset(4)] public int Start; }
在使用时这样传值与调用
private static unsafe void HandleComm(Buffer* inBuff, Buffer* outBuff, System.Collections.Queue queue, PacketPath path) { CommMutex.WaitOne(); while (inBuff.Length > 0) { ......... } }
inBuff定义为Buffer*指针类型, 我用到struct的Length,Start,Buff0, 怎样写代码?
*inBuff.Length
inBuff->Length