Exemplo n.º 1
0
        public void Read(NDRParser parser)
        {
            parser.BeginStructure(); // SHARE_ENUM_STRUCT
            Level = parser.ReadUInt32();
            parser.BeginStructure(); // SHARE_ENUM_UNION
            // 14.3.8 - For a non-encapsulated union, the discriminant is marshalled into the transmitted data stream twice.
            // once as the field or parameter, which is referenced by the switch_is construct, in the procedure argument list;
            // and once as the first part of the union representation.
            uint level = parser.ReadUInt32();

            switch (level)
            {
            case 0:
                ShareInfo0Container info0 = null;
                parser.ReadEmbeddedStructureFullPointer <ShareInfo0Container>(ref info0);
                Info = info0;
                break;

            case 1:
                ShareInfo1Container info1 = null;
                parser.ReadEmbeddedStructureFullPointer <ShareInfo1Container>(ref info1);
                Info = info1;
                break;

            default:
                throw new NotImplementedException();
            }
            parser.EndStructure(); // SHARE_ENUM_UNION
            parser.EndStructure(); // SHARE_ENUM_STRUCT
        }
Exemplo n.º 2
0
 public ShareEnum(IShareInfoContainer info)
 {
     Level = info.Level;
     Info  = info;
 }