Пример #1
0
        /// <inheritdoc />
        public override byte[] GetBytes()
        {
            int Offset = 0;

            byte[] ExtraData = new byte[ExtraDataSize];

            if (ConsoleDataBlock != null)
            {
                Buffer.BlockCopy(ConsoleDataBlock.GetBytes(), 0, ExtraData, Offset, (int)ConsoleDataBlock.BlockSize);
                Offset += (int)ConsoleDataBlock.BlockSize;
            }

            if (ConsoleFEDataBlock != null)
            {
                Buffer.BlockCopy(ConsoleFEDataBlock.GetBytes(), 0, ExtraData, Offset, (int)ConsoleFEDataBlock.BlockSize);
                Offset += (int)ConsoleFEDataBlock.BlockSize;
            }

            if (DarwinDataBlock != null)
            {
                Buffer.BlockCopy(DarwinDataBlock.GetBytes(), 0, ExtraData, Offset, (int)DarwinDataBlock.BlockSize);
                Offset += (int)DarwinDataBlock.BlockSize;
            }

            if (EnvironmentVariableDataBlock != null)
            {
                Buffer.BlockCopy(EnvironmentVariableDataBlock.GetBytes(), 0, ExtraData, Offset, (int)EnvironmentVariableDataBlock.BlockSize);
                Offset += (int)EnvironmentVariableDataBlock.BlockSize;
            }

            if (IconEnvironmentDataBlock != null)
            {
                Buffer.BlockCopy(IconEnvironmentDataBlock.GetBytes(), 0, ExtraData, Offset, (int)IconEnvironmentDataBlock.BlockSize);
                Offset += (int)IconEnvironmentDataBlock.BlockSize;
            }

            if (KnownFolderDataBlock != null)
            {
                Buffer.BlockCopy(KnownFolderDataBlock.GetBytes(), 0, ExtraData, Offset, (int)KnownFolderDataBlock.BlockSize);
                Offset += (int)KnownFolderDataBlock.BlockSize;
            }

            if (PropertyStoreDataBlock != null)
            {
                Buffer.BlockCopy(PropertyStoreDataBlock.GetBytes(), 0, ExtraData, Offset, (int)PropertyStoreDataBlock.BlockSize);
                Offset += (int)PropertyStoreDataBlock.BlockSize;
            }

            if (ShimDataBlock != null)
            {
                Buffer.BlockCopy(ShimDataBlock.GetBytes(), 0, ExtraData, Offset, (int)ShimDataBlock.BlockSize);
                Offset += (int)ShimDataBlock.BlockSize;
            }

            if (SpecialFolderDataBlock != null)
            {
                Buffer.BlockCopy(SpecialFolderDataBlock.GetBytes(), 0, ExtraData, Offset, (int)SpecialFolderDataBlock.BlockSize);
                Offset += (int)SpecialFolderDataBlock.BlockSize;
            }

            if (TrackerDataBlock != null)
            {
                Buffer.BlockCopy(TrackerDataBlock.GetBytes(), 0, ExtraData, Offset, (int)TrackerDataBlock.BlockSize);
                Offset += (int)TrackerDataBlock.BlockSize;
            }

            if (VistaAndAboveIDListDataBlock != null)
            {
                Buffer.BlockCopy(VistaAndAboveIDListDataBlock.GetBytes(), 0, ExtraData, Offset, (int)VistaAndAboveIDListDataBlock.BlockSize);
                Offset += (int)VistaAndAboveIDListDataBlock.BlockSize;
            }

            Buffer.BlockCopy(TerminalBlock.GetBytes(), 0, ExtraData, Offset, 4);
            return(ExtraData);
        }