Ejemplo n.º 1
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int entriesp = src.Dec_ndr_long();

                if (entriesp != 0)
                {
                    src = src.Deferred;
                    int entriess = src.Dec_ndr_long();
                    int entriesi = src.Index;
                    src.Advance(12 * entriess);
                    if (Entries == null)
                    {
                        if (entriess < 0 || entriess > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Entries = new SamrSamEntry[entriess];
                    }
                    src = src.Derive(entriesi);
                    for (int i = 0; i < entriess; i++)
                    {
                        if (Entries[i] == null)
                        {
                            Entries[i] = new SamrSamEntry();
                        }
                        Entries[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 2
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int arrayp = src.Dec_ndr_long();

                if (arrayp != 0)
                {
                    src = src.Deferred;
                    int arrays = src.Dec_ndr_long();
                    int arrayi = src.Index;
                    src.Advance(4 * arrays);
                    if (Array == null)
                    {
                        if (arrays < 0 || arrays > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Array = new ShareInfo0[arrays];
                    }
                    src = src.Derive(arrayi);
                    for (int i = 0; i < arrays; i++)
                    {
                        if (Array[i] == null)
                        {
                            Array[i] = new ShareInfo0();
                        }
                        Array[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 3
0
            /// <exception cref="WinrtCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Length        = (short)src.Dec_ndr_short();
                MaximumLength = (short)src.Dec_ndr_short();
                int bufferp = src.Dec_ndr_long();

                if (bufferp != 0)
                {
                    src = src.Deferred;
                    int buffers = src.Dec_ndr_long();
                    src.Dec_ndr_long();
                    int bufferl = src.Dec_ndr_long();
                    int bufferi = src.Index;
                    src.Advance(2 * bufferl);
                    if (Buffer == null)
                    {
                        if (buffers < 0 || buffers > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Buffer = new short[buffers];
                    }
                    src = src.Derive(bufferi);
                    for (int i = 0; i < bufferl; i++)
                    {
                        Buffer[i] = (short)src.Dec_ndr_short();
                    }
                }
            }
Ejemplo n.º 4
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int domainsp = src.Dec_ndr_long();

                MaxCount = src.Dec_ndr_long();
                if (domainsp != 0)
                {
                    src = src.Deferred;
                    int domainss = src.Dec_ndr_long();
                    int domainsi = src.Index;
                    src.Advance(12 * domainss);
                    if (Domains == null)
                    {
                        if (domainss < 0 || domainss > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Domains = new LsarTrustInformation[domainss];
                    }
                    src = src.Derive(domainsi);
                    for (int i = 0; i < domainss; i++)
                    {
                        if (Domains[i] == null)
                        {
                            Domains[i] = new LsarTrustInformation();
                        }
                        Domains[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 5
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int namesp = src.Dec_ndr_long();

                if (namesp != 0)
                {
                    src = src.Deferred;
                    int namess = src.Dec_ndr_long();
                    int namesi = src.Index;
                    src.Advance(16 * namess);
                    if (Names == null)
                    {
                        if (namess < 0 || namess > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Names = new LsarTranslatedName[namess];
                    }
                    src = src.Derive(namesi);
                    for (int i = 0; i < namess; i++)
                    {
                        if (Names[i] == null)
                        {
                            Names[i] = new LsarTranslatedName();
                        }
                        Names[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 6
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int sidsp = src.Dec_ndr_long();

                if (sidsp != 0)
                {
                    src = src.Deferred;
                    int sidss = src.Dec_ndr_long();
                    int sidsi = src.Index;
                    src.Advance(12 * sidss);
                    if (Sids == null)
                    {
                        if (sidss < 0 || sidss > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Sids = new LsarTranslatedSid[sidss];
                    }
                    src = src.Derive(sidsi);
                    for (int i = 0; i < sidss; i++)
                    {
                        if (Sids[i] == null)
                        {
                            Sids[i] = new LsarTranslatedSid();
                        }
                        Sids[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 7
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int sp = src.Dec_ndr_long();

                if (sp != 0)
                {
                    src = src.Deferred;
                    int ss = src.Dec_ndr_long();
                    int si = src.Index;
                    src.Advance(4 * ss);
                    if (S == null)
                    {
                        if (ss < 0 || ss > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        S = new DfsInfo1[ss];
                    }
                    src = src.Derive(si);
                    for (int i = 0; i < ss; i++)
                    {
                        if (S[i] == null)
                        {
                            S[i] = new DfsInfo1();
                        }
                        S[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 8
0
 /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
 public override void Decode(NdrBuffer src)
 {
     src.Align(4);
     SidType  = src.Dec_ndr_short();
     Rid      = src.Dec_ndr_long();
     SidIndex = src.Dec_ndr_long();
 }
Ejemplo n.º 9
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Count = src.Dec_ndr_long();
                int ridsp = src.Dec_ndr_long();

                if (ridsp != 0)
                {
                    src = src.Deferred;
                    int ridss = src.Dec_ndr_long();
                    int ridsi = src.Index;
                    src.Advance(8 * ridss);
                    if (Rids == null)
                    {
                        if (ridss < 0 || ridss > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Rids = new SamrRidWithAttribute[ridss];
                    }
                    src = src.Derive(ridsi);
                    for (int i = 0; i < ridss; i++)
                    {
                        if (Rids[i] == null)
                        {
                            Rids[i] = new SamrRidWithAttribute();
                        }
                        Rids[i].Decode(src);
                    }
                }
            }
Ejemplo n.º 10
0
            /// <exception cref="WinrtCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Type = src.Dec_ndr_long();
                src.Align(4);
                if (Uuid == null)
                {
                    Uuid = new UuidT();
                }
                Uuid.TimeLow               = src.Dec_ndr_long();
                Uuid.TimeMid               = (short)src.Dec_ndr_short();
                Uuid.TimeHiAndVersion      = (short)src.Dec_ndr_short();
                Uuid.ClockSeqHiAndReserved = unchecked ((byte)src.Dec_ndr_small());
                Uuid.ClockSeqLow           = unchecked ((byte)src.Dec_ndr_small());
                int uuidNodes = 6;
                int uuidNodei = src.Index;

                src.Advance(1 * uuidNodes);
                if (Uuid.Node == null)
                {
                    if (uuidNodes < 0 || uuidNodes > unchecked (0xFFFF))
                    {
                        throw new NdrException(NdrException.InvalidConformance);
                    }
                    Uuid.Node = new byte[uuidNodes];
                }
                src = src.Derive(uuidNodei);
                for (int i = 0; i < uuidNodes; i++)
                {
                    Uuid.Node[i] = unchecked ((byte)src.Dec_ndr_small());
                }
            }
Ejemplo n.º 11
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode_out(NdrBuffer src)
            {
                int infop = src.Dec_ndr_long();

                if (infop != 0)
                {
                    src.Dec_ndr_short();
                    Info.Decode(src);
                }
                Retval = src.Dec_ndr_long();
            }
Ejemplo n.º 12
0
            public override void Decode_out(NdrBuffer _src)
            {
                int _lpdwTagIdp = _src.Dec_ndr_long();

                if (_lpdwTagIdp != 0)
                {
                    lpdwTagId.Decode(_src);
                }
                service_handle.Decode(_src);
                retval = (int)_src.Dec_ndr_long();
            }
Ejemplo n.º 13
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Flags = src.Dec_ndr_long();
                int dfsNamep = src.Dec_ndr_long();

                if (dfsNamep != 0)
                {
                    src     = src.Deferred;
                    DfsName = src.Dec_ndr_string();
                }
            }
Ejemplo n.º 14
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                PlatformId = src.Dec_ndr_long();
                int namep = src.Dec_ndr_long();

                if (namep != 0)
                {
                    src  = src.Deferred;
                    Name = src.Dec_ndr_string();
                }
            }
Ejemplo n.º 15
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode_out(NdrBuffer src)
            {
                int infop = src.Dec_ndr_long();

                if (infop != 0)
                {
                    if (Info == null)
                    {
                        Info = new TimeOfDayInfo();
                    }
                    Info.Decode(src);
                }
                Retval = src.Dec_ndr_long();
            }
Ejemplo n.º 16
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode_out(NdrBuffer src)
            {
                int domainsp = src.Dec_ndr_long();

                if (domainsp != 0)
                {
                    if (Domains == null)
                    {
                        Domains = new LsarRefDomainList();
                    }
                    Domains.Decode(src);
                }
                Names.Decode(src);
                Count  = src.Dec_ndr_long();
                Retval = src.Dec_ndr_long();
            }
Ejemplo n.º 17
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode_out(NdrBuffer src)
            {
                ResumeHandle = src.Dec_ndr_long();
                int samp = src.Dec_ndr_long();

                if (samp != 0)
                {
                    if (Sam == null)
                    {
                        Sam = new SamrSamArray();
                    }
                    Sam.Decode(src);
                }
                NumEntries = src.Dec_ndr_long();
                Retval     = src.Dec_ndr_long();
            }
Ejemplo n.º 18
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode_out(NdrBuffer src)
            {
                src.Dec_ndr_long();
                int infop = src.Dec_ndr_long();

                if (infop != 0)
                {
                    if (Info == null)
                    {
                        Info = new ServerInfo100();
                    }
                    src = src.Deferred;
                    Info.Decode(src);
                }
                Retval = src.Dec_ndr_long();
            }
Ejemplo n.º 19
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Level = src.Dec_ndr_long();
                src.Dec_ndr_long();
                int ep = src.Dec_ndr_long();

                if (ep != 0)
                {
                    if (E == null)
                    {
                        E = new DfsEnumArray1();
                    }
                    src = src.Deferred;
                    E.Decode(src);
                }
            }
Ejemplo n.º 20
0
 /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
 public override void Decode(NdrBuffer src)
 {
     src.Align(4);
     Length             = src.Dec_ndr_long();
     ImpersonationLevel = (short)src.Dec_ndr_short();
     ContextMode        = unchecked ((byte)src.Dec_ndr_small());
     EffectiveOnly      = unchecked ((byte)src.Dec_ndr_small());
 }
Ejemplo n.º 21
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                src.Align(4);
                if (Name == null)
                {
                    Name = new Rpc.Unicode_string();
                }
                Name.Length        = (short)src.Dec_ndr_short();
                Name.MaximumLength = (short)src.Dec_ndr_short();
                int nameBufferp = src.Dec_ndr_long();
                int sidp        = src.Dec_ndr_long();

                if (nameBufferp != 0)
                {
                    src = src.Deferred;
                    int nameBuffers = src.Dec_ndr_long();
                    src.Dec_ndr_long();
                    int nameBufferl = src.Dec_ndr_long();
                    int nameBufferi = src.Index;
                    src.Advance(2 * nameBufferl);
                    if (Name.Buffer == null)
                    {
                        if (nameBuffers < 0 || nameBuffers > unchecked (0xFFFF))
                        {
                            throw new NdrException(NdrException.InvalidConformance);
                        }
                        Name.Buffer = new short[nameBuffers];
                    }
                    src = src.Derive(nameBufferi);
                    for (int i = 0; i < nameBufferl; i++)
                    {
                        Name.Buffer[i] = (short)src.Dec_ndr_short();
                    }
                }
                if (sidp != 0)
                {
                    if (Sid == null)
                    {
                        Sid = new Rpc.SidT();
                    }
                    src = src.Deferred;
                    Sid.Decode(src);
                }
            }
Ejemplo n.º 22
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                State = src.Dec_ndr_long();
                int serverNamep = src.Dec_ndr_long();
                int shareNamep  = src.Dec_ndr_long();

                if (serverNamep != 0)
                {
                    src        = src.Deferred;
                    ServerName = src.Dec_ndr_string();
                }
                if (shareNamep != 0)
                {
                    src       = src.Deferred;
                    ShareName = src.Dec_ndr_string();
                }
            }
Ejemplo n.º 23
0
 /// <exception cref="WinrtCifs.Dcerpc.Ndr.NdrException"></exception>
 internal virtual void Decode_header(NdrBuffer buf)
 {
     if (buf.Dec_ndr_small() != 5 || buf.Dec_ndr_small() != 0)
     {
         throw new NdrException("DCERPC version not supported");
     }
     Ptype = buf.Dec_ndr_small();
     Flags = buf.Dec_ndr_small();
     if (buf.Dec_ndr_long() != unchecked (0x00000010))
     {
         throw new NdrException("Data representation not supported");
     }
     Length = buf.Dec_ndr_short();
     if (buf.Dec_ndr_short() != 0)
     {
         throw new NdrException("DCERPC authentication not supported");
     }
     CallId = buf.Dec_ndr_long();
 }
Ejemplo n.º 24
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                int netnamep = src.Dec_ndr_long();

                Type = src.Dec_ndr_long();
                int remarkp = src.Dec_ndr_long();

                if (netnamep != 0)
                {
                    src     = src.Deferred;
                    Netname = src.Dec_ndr_string();
                }
                if (remarkp != 0)
                {
                    src    = src.Deferred;
                    Remark = src.Dec_ndr_string();
                }
            }
Ejemplo n.º 25
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode_out(NdrBuffer src)
            {
                int infop = src.Dec_ndr_long();

                if (infop != 0)
                {
                    if (Info == null)
                    {
                        Info = new DfsEnumStruct();
                    }
                    Info.Decode(src);
                }
                int totalentriesp = src.Dec_ndr_long();

                if (totalentriesp != 0)
                {
                    Totalentries.Decode(src);
                }
                Retval = src.Dec_ndr_long();
            }
Ejemplo n.º 26
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                int entryPathp = src.Dec_ndr_long();

                if (entryPathp != 0)
                {
                    src       = src.Deferred;
                    EntryPath = src.Dec_ndr_string();
                }
            }
Ejemplo n.º 27
0
            /// <exception cref="WinrtCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                int subAuthoritys = src.Dec_ndr_long();

                Revision          = unchecked ((byte)src.Dec_ndr_small());
                SubAuthorityCount = unchecked ((byte)src.Dec_ndr_small());
                int identifierAuthoritys = 6;
                int identifierAuthorityi = src.Index;

                src.Advance(1 * identifierAuthoritys);
                int subAuthorityi = src.Index;

                src.Advance(4 * subAuthoritys);
                if (IdentifierAuthority == null)
                {
                    if (identifierAuthoritys < 0 || identifierAuthoritys > unchecked (0xFFFF))
                    {
                        throw new NdrException(NdrException.InvalidConformance);
                    }
                    IdentifierAuthority = new byte[identifierAuthoritys];
                }
                src = src.Derive(identifierAuthorityi);
                for (int i = 0; i < identifierAuthoritys; i++)
                {
                    IdentifierAuthority[i] = unchecked ((byte)src.Dec_ndr_small());
                }
                if (SubAuthority == null)
                {
                    if (subAuthoritys < 0 || subAuthoritys > unchecked (0xFFFF))
                    {
                        throw new NdrException(NdrException.InvalidConformance);
                    }
                    SubAuthority = new int[subAuthoritys];
                }
                src = src.Derive(subAuthorityi);
                for (int i1 = 0; i1 < subAuthoritys; i1++)
                {
                    SubAuthority[i1] = src.Dec_ndr_long();
                }
            }
Ejemplo n.º 28
0
            /// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
            public override void Decode(NdrBuffer src)
            {
                src.Align(4);
                Length = src.Dec_ndr_long();
                int rootDirectoryp = src.Dec_ndr_long();
                int objectNamep    = src.Dec_ndr_long();

                Attributes         = src.Dec_ndr_long();
                SecurityDescriptor = src.Dec_ndr_long();
                int securityQualityOfServicep = src.Dec_ndr_long();

                if (rootDirectoryp != 0)
                {
                    src = src.Deferred;
                    RootDirectory.Decode(src);
                }
                if (objectNamep != 0)
                {
                    if (ObjectName == null)
                    {
                        ObjectName = new Rpc.Unicode_string();
                    }
                    src = src.Deferred;
                    ObjectName.Decode(src);
                }
                if (securityQualityOfServicep != 0)
                {
                    if (SecurityQualityOfService == null)
                    {
                        SecurityQualityOfService = new LsarQosInfo();
                    }
                    src = src.Deferred;
                    SecurityQualityOfService.Decode(src);
                }
            }
Ejemplo n.º 29
0
 /// <exception cref="WinrtCifs.Dcerpc.Ndr.NdrException"></exception>
 public override void Decode(NdrBuffer buf)
 {
     Decode_header(buf);
     if (Ptype != 12 && Ptype != 2 && Ptype != 3 && Ptype != 13)
     {
         throw new NdrException("Unexpected ptype: " + Ptype);
     }
     if (Ptype == 2 || Ptype == 3)
     {
         AllocHint = buf.Dec_ndr_long();
         buf.Dec_ndr_short();
         buf.Dec_ndr_short();
     }
     if (Ptype == 3 || Ptype == 13)
     {
         Result = buf.Dec_ndr_long();
     }
     else
     {
         Decode_out(buf);
     }
 }
Ejemplo n.º 30
0
 public override void Decode(NdrBuffer _src)
 {
     _src.Align(4);
     service_type               = (int)_src.Dec_ndr_long();
     current_state              = (int)_src.Dec_ndr_long();
     controls_accepted          = (int)_src.Dec_ndr_long();
     win32_exit_code            = (int)_src.Dec_ndr_long();
     service_specific_exit_code = (int)_src.Dec_ndr_long();
     check_point = (int)_src.Dec_ndr_long();
     wait_hint   = (int)_src.Dec_ndr_long();
 }
Ejemplo n.º 31
0
		/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
		public override void Decode(NdrBuffer src)
		{
			Value = src.Dec_ndr_long();
		}