Exemplo n.º 1
0
        internal static KSCAMERA_EXTENDEDPROP_HEADER FromBytes(byte[] value, int startIndex)
        {
            var KSCAMERA_EXTENDEDPROP_HEADER = new KSCAMERA_EXTENDEDPROP_HEADER();
            var caret = startIndex;

            KSCAMERA_EXTENDEDPROP_HEADER.Version = BitConverter.ToUInt32(value, caret);
            caret += sizeof(UInt32);

            KSCAMERA_EXTENDEDPROP_HEADER.PinId = BitConverter.ToUInt32(value, caret);
            caret += sizeof(UInt32);

            KSCAMERA_EXTENDEDPROP_HEADER.Size = BitConverter.ToUInt32(value, caret);
            caret += sizeof(UInt32);

            KSCAMERA_EXTENDEDPROP_HEADER.Result = BitConverter.ToUInt32(value, caret);
            caret += sizeof(UInt32);

            KSCAMERA_EXTENDEDPROP_HEADER.Flags = BitConverter.ToUInt32(value, caret);
            caret += sizeof(UInt64);

            KSCAMERA_EXTENDEDPROP_HEADER.Capability = BitConverter.ToUInt32(value, caret);
            caret += sizeof(UInt64);

            KSCAMERA_EXTENDEDPROP_HEADER.StructSize = caret;

            return(KSCAMERA_EXTENDEDPROP_HEADER);
        }
Exemplo n.º 2
0
        internal static KSCAMERA_EXTENDEDPROP FromBytes(byte[] value, int startIndex)
        {
            var KSCAMERA_EXTENDEDPROP = new KSCAMERA_EXTENDEDPROP();

            var headerSize = 0;

            headerSize += sizeof(UInt32);
            headerSize += sizeof(UInt32);
            headerSize += sizeof(UInt32);
            headerSize += sizeof(UInt32);
            headerSize += sizeof(UInt64);
            headerSize += sizeof(UInt64);

            KSCAMERA_EXTENDEDPROP.Size   = value.Length;
            KSCAMERA_EXTENDEDPROP.Header = KSCAMERA_EXTENDEDPROP_HEADER.FromBytes(value, startIndex);
            KSCAMERA_EXTENDEDPROP.Value  = KSCAMERA_EXTENDEDPROP_VALUE.FromBytes(value, startIndex + headerSize);

            return(KSCAMERA_EXTENDEDPROP);
        }