public byte[] Serialize()
{
int index = 0;
byte[] serializeBuffer = new byte[this.Size()];
serializeBuffer[index++] = this.RopId;
serializeBuffer[index++] = this.LogonId;
serializeBuffer[index++] = this.InputHandleIndex;
serializeBuffer[index++] = this.RestrictFlags;
// Add this serialization for RestrictionDataSize.
Array.Copy(BitConverter.GetBytes(this.RestrictionDataSize), 0, serializeBuffer, index, sizeof(ushort));
index += sizeof(ushort);
if (null != this.RestrictionData)
{
Array.Copy(this.RestrictionData, 0, serializeBuffer, index, this.RestrictionData.Length);
}
return serializeBuffer;
}