void AcquireData(byte[] buffer, CalcDataHeader header) { int requiredSize = (int)header.DataCount * sizeof(float); if (pinnedHeader == IntPtr.Zero || dataSize < requiredSize) { ReleaseData(); pinnedData = Marshal.AllocHGlobal(requiredSize); dataSize = requiredSize; } Marshal.Copy(buffer, 64, pinnedData, requiredSize); }
bool CalcValidateHeader(CalcDataHeader header) { return(header.Token1 == 0x88FF && header.Token2 == 0x99FF); }