Advance() public method

public Advance ( int n ) : void
n int
return void
Example #1
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				TimeLow = src.Dec_ndr_long();
				TimeMid = (short)src.Dec_ndr_short();
				TimeHiAndVersion = (short)src.Dec_ndr_short();
				ClockSeqHiAndReserved = unchecked((byte)src.Dec_ndr_small());
				ClockSeqLow = unchecked((byte)src.Dec_ndr_small());
				int nodes = 6;
				int nodei = src.Index;
				src.Advance(1 * nodes);
				if (Node == null)
				{
					if (nodes < 0 || nodes > unchecked(0xFFFF))
					{
						throw new NdrException(NdrException.InvalidConformance);
					}
					Node = new byte[nodes];
				}
				src = src.Derive(nodei);
				for (int i = 0; i < nodes; i++)
				{
					Node[i] = unchecked((byte)src.Dec_ndr_small());
				}
			}
Example #2
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(TimeLow);
				dst.Enc_ndr_short(TimeMid);
				dst.Enc_ndr_short(TimeHiAndVersion);
				dst.Enc_ndr_small(ClockSeqHiAndReserved);
				dst.Enc_ndr_small(ClockSeqLow);
				int nodes = 6;
				int nodei = dst.Index;
				dst.Advance(1 * nodes);
				dst = dst.Derive(nodei);
				for (int i = 0; i < nodes; i++)
				{
					dst.Enc_ndr_small(Node[i]);
				}
			}
Example #3
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Count);
				dst.Enc_ndr_referent(S, 1);
				if (S != null)
				{
					dst = dst.Deferred;
					int ss = Count;
					dst.Enc_ndr_long(ss);
					int si = dst.Index;
					dst.Advance(4 * ss);
					dst = dst.Derive(si);
					for (int i = 0; i < ss; i++)
					{
						S[i].Encode(dst);
					}
				}
			}
Example #4
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Count);
				dst.Enc_ndr_referent(Array, 1);
				if (Array != null)
				{
					dst = dst.Deferred;
					int arrays = Count;
					dst.Enc_ndr_long(arrays);
					int arrayi = dst.Index;
					dst.Advance(4 * arrays);
					dst = dst.Derive(arrayi);
					for (int i = 0; i < arrays; i++)
					{
						Array[i].Encode(dst);
					}
				}
			}
Example #5
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Count);
				dst.Enc_ndr_referent(Rids, 1);
				if (Rids != null)
				{
					dst = dst.Deferred;
					int ridss = Count;
					dst.Enc_ndr_long(ridss);
					int ridsi = dst.Index;
					dst.Advance(8 * ridss);
					dst = dst.Derive(ridsi);
					for (int i = 0; i < ridss; i++)
					{
						Rids[i].Encode(dst);
					}
				}
			}
Example #6
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Count);
				dst.Enc_ndr_referent(Entries, 1);
				if (Entries != null)
				{
					dst = dst.Deferred;
					int entriess = Count;
					dst.Enc_ndr_long(entriess);
					int entriesi = dst.Index;
					dst.Advance(12 * entriess);
					dst = dst.Derive(entriesi);
					for (int i = 0; i < entriess; i++)
					{
						Entries[i].Encode(dst);
					}
				}
			}
Example #7
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Idx);
				dst.Enc_ndr_short(Name.Length);
				dst.Enc_ndr_short(Name.MaximumLength);
				dst.Enc_ndr_referent(Name.Buffer, 1);
				if (Name.Buffer != null)
				{
					dst = dst.Deferred;
					int nameBufferl = Name.Length / 2;
					int nameBuffers = Name.MaximumLength / 2;
					dst.Enc_ndr_long(nameBuffers);
					dst.Enc_ndr_long(0);
					dst.Enc_ndr_long(nameBufferl);
					int nameBufferi = dst.Index;
					dst.Advance(2 * nameBufferl);
					dst = dst.Derive(nameBufferi);
					for (int i = 0; i < nameBufferl; i++)
					{
						dst.Enc_ndr_short(Name.Buffer[i]);
					}
				}
			}
Example #8
0
			/// <exception cref="SharpCifs.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();
				}
			}
Example #9
0
			/// <exception cref="SharpCifs.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();
					}
				}
			}
Example #10
0
            public override void Encode_in(NdrBuffer _dst)   {
                scmanager_handle.Encode(_dst);
                _dst.Enc_ndr_string(service_name);
                _dst.Enc_ndr_referent(display_name, 1);
                if (display_name != null) {
                    _dst.Enc_ndr_string(display_name);

                }
                _dst.Enc_ndr_long(access_mask);
                _dst.Enc_ndr_long(service_type);
                _dst.Enc_ndr_long(start_type);
                _dst.Enc_ndr_long(error_control);
                _dst.Enc_ndr_string(binary_path_name);
                _dst.Enc_ndr_referent(load_order_group, 1);
                if (load_order_group != null) {
                    _dst.Enc_ndr_string(load_order_group);

                }
                _dst.Enc_ndr_referent(lpdwTagId, 1);
                if (lpdwTagId != null) {
                    lpdwTagId.Encode(_dst);

                }
                _dst.Enc_ndr_referent(lpDependencies, 1);
                if (lpDependencies != null) {
                    int _lpDependenciess = dependency_size;
                    _dst.Enc_ndr_long(_lpDependenciess);
                    int _lpDependenciesi = _dst.Index;
                    _dst.Advance(1 * _lpDependenciess);

                    _dst = _dst.Derive(_lpDependenciesi);
                    for (int _i = 0; _i < _lpDependenciess; _i++) {
                        _dst.Enc_ndr_small(lpDependencies[_i]);
                    }
                }
                _dst.Enc_ndr_long(dependency_size);
                _dst.Enc_ndr_referent(lpServiceStartName, 1);
                if (lpServiceStartName != null) {
                    _dst.Enc_ndr_string(lpServiceStartName);

                }
                _dst.Enc_ndr_referent(password, 1);
                if (password != null) {
                    int _passwords = password_size;
                    _dst.Enc_ndr_long(_passwords);
                    int _passwordi = _dst.Index;
                    _dst.Advance(1 * _passwords);

                    _dst = _dst.Derive(_passwordi);
                    for (int _i = 0; _i < _passwords; _i++) {
                        _dst.Enc_ndr_small(password[_i]);
                    }
                }
                _dst.Enc_ndr_long(password_size);
            }
Example #11
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);
					}
				}
			}
Example #12
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();
				Permissions = src.Dec_ndr_long();
				MaxUses = src.Dec_ndr_long();
				CurrentUses = src.Dec_ndr_long();
				int pathp = src.Dec_ndr_long();
				int passwordp = src.Dec_ndr_long();
				SdSize = src.Dec_ndr_long();
				int securityDescriptorp = 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();
				}
				if (pathp != 0)
				{
					src = src.Deferred;
					Path = src.Dec_ndr_string();
				}
				if (passwordp != 0)
				{
					src = src.Deferred;
					Password = src.Dec_ndr_string();
				}
				if (securityDescriptorp != 0)
				{
					src = src.Deferred;
					int securityDescriptors = src.Dec_ndr_long();
					int securityDescriptori = src.Index;
					src.Advance(1 * securityDescriptors);
					if (SecurityDescriptor == null)
					{
						if (securityDescriptors < 0 || securityDescriptors > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						SecurityDescriptor = new byte[securityDescriptors];
					}
					src = src.Derive(securityDescriptori);
					for (int i = 0; i < securityDescriptors; i++)
					{
						SecurityDescriptor[i] = unchecked((byte)src.Dec_ndr_small());
					}
				}
			}
Example #13
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_referent(Netname, 1);
				dst.Enc_ndr_long(Type);
				dst.Enc_ndr_referent(Remark, 1);
				dst.Enc_ndr_long(Permissions);
				dst.Enc_ndr_long(MaxUses);
				dst.Enc_ndr_long(CurrentUses);
				dst.Enc_ndr_referent(Path, 1);
				dst.Enc_ndr_referent(Password, 1);
				dst.Enc_ndr_long(SdSize);
				dst.Enc_ndr_referent(SecurityDescriptor, 1);
				if (Netname != null)
				{
					dst = dst.Deferred;
					dst.Enc_ndr_string(Netname);
				}
				if (Remark != null)
				{
					dst = dst.Deferred;
					dst.Enc_ndr_string(Remark);
				}
				if (Path != null)
				{
					dst = dst.Deferred;
					dst.Enc_ndr_string(Path);
				}
				if (Password != null)
				{
					dst = dst.Deferred;
					dst.Enc_ndr_string(Password);
				}
				if (SecurityDescriptor != null)
				{
					dst = dst.Deferred;
					int securityDescriptors = SdSize;
					dst.Enc_ndr_long(securityDescriptors);
					int securityDescriptori = dst.Index;
					dst.Advance(1 * securityDescriptors);
					dst = dst.Derive(securityDescriptori);
					for (int i = 0; i < securityDescriptors; i++)
					{
						dst.Enc_ndr_small(SecurityDescriptor[i]);
					}
				}
			}
Example #14
0
		/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
		public override void Decode_out(NdrBuffer src)
		{
			src.Dec_ndr_short();
			src.Dec_ndr_short();
			src.Dec_ndr_long();
			int n = src.Dec_ndr_short();
			src.Advance(n);
			src.Align(4);
			src.Dec_ndr_small();
			src.Align(4);
			Result = src.Dec_ndr_short();
			src.Dec_ndr_short();
			src.Advance(20);
		}
Example #15
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);
					}
				}
			}
Example #16
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);
					}
				}
			}
Example #17
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_short(Length);
				dst.Enc_ndr_short(MaximumLength);
				dst.Enc_ndr_referent(Buffer, 1);
				if (Buffer != null)
				{
					dst = dst.Deferred;
					int bufferl = Length / 2;
					int buffers = MaximumLength / 2;
					dst.Enc_ndr_long(buffers);
					dst.Enc_ndr_long(0);
					dst.Enc_ndr_long(bufferl);
					int bufferi = dst.Index;
					dst.Advance(2 * bufferl);
					dst = dst.Derive(bufferi);
					for (int i = 0; i < bufferl; i++)
					{
						dst.Enc_ndr_short(Buffer[i]);
					}
				}
			}
Example #18
0
 public override void Decode_out(NdrBuffer _src)  {
     int _services = _src.Dec_ndr_long();
     int _servicei = _src.Index;
     _src.Advance(1 * _services);
     if (service == null) {
         if (_services < 0 || _services > 0xFFFF) throw new NdrException( NdrException.InvalidConformance );
         service = new byte[_services];
     }
     _src = _src.Derive(_servicei);
     for (int _i = 0; _i < _services; _i++) {
         service[_i] = (byte)_src.Dec_ndr_small();
     }
     bytes_needed = (int)_src.Dec_ndr_long();
     services_returned = (int)_src.Dec_ndr_long();
     resume_handle = (int)_src.Dec_ndr_long();
     retval = (int)_src.Dec_ndr_long();
 }
Example #19
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				int subAuthoritys = SubAuthorityCount;
				dst.Enc_ndr_long(subAuthoritys);
				dst.Enc_ndr_small(Revision);
				dst.Enc_ndr_small(SubAuthorityCount);
				int identifierAuthoritys = 6;
				int identifierAuthorityi = dst.Index;
				dst.Advance(1 * identifierAuthoritys);
				int subAuthorityi = dst.Index;
				dst.Advance(4 * subAuthoritys);
				dst = dst.Derive(identifierAuthorityi);
				for (int i = 0; i < identifierAuthoritys; i++)
				{
					dst.Enc_ndr_small(IdentifierAuthority[i]);
				}
				dst = dst.Derive(subAuthorityi);
				for (int i1 = 0; i1 < subAuthoritys; i1++)
				{
					dst.Enc_ndr_long(SubAuthority[i1]);
				}
			}
Example #20
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_short(Name.Length);
				dst.Enc_ndr_short(Name.MaximumLength);
				dst.Enc_ndr_referent(Name.Buffer, 1);
				dst.Enc_ndr_short(DnsDomain.Length);
				dst.Enc_ndr_short(DnsDomain.MaximumLength);
				dst.Enc_ndr_referent(DnsDomain.Buffer, 1);
				dst.Enc_ndr_short(DnsForest.Length);
				dst.Enc_ndr_short(DnsForest.MaximumLength);
				dst.Enc_ndr_referent(DnsForest.Buffer, 1);
				dst.Enc_ndr_long(DomainGuid.TimeLow);
				dst.Enc_ndr_short(DomainGuid.TimeMid);
				dst.Enc_ndr_short(DomainGuid.TimeHiAndVersion);
				dst.Enc_ndr_small(DomainGuid.ClockSeqHiAndReserved);
				dst.Enc_ndr_small(DomainGuid.ClockSeqLow);
				int domainGuidNodes = 6;
				int domainGuidNodei = dst.Index;
				dst.Advance(1 * domainGuidNodes);
				dst.Enc_ndr_referent(Sid, 1);
				if (Name.Buffer != null)
				{
					dst = dst.Deferred;
					int nameBufferl = Name.Length / 2;
					int nameBuffers = Name.MaximumLength / 2;
					dst.Enc_ndr_long(nameBuffers);
					dst.Enc_ndr_long(0);
					dst.Enc_ndr_long(nameBufferl);
					int nameBufferi = dst.Index;
					dst.Advance(2 * nameBufferl);
					dst = dst.Derive(nameBufferi);
					for (int i = 0; i < nameBufferl; i++)
					{
						dst.Enc_ndr_short(Name.Buffer[i]);
					}
				}
				if (DnsDomain.Buffer != null)
				{
					dst = dst.Deferred;
					int dnsDomainBufferl = DnsDomain.Length / 2;
					int dnsDomainBuffers = DnsDomain.MaximumLength / 2;
					dst.Enc_ndr_long(dnsDomainBuffers);
					dst.Enc_ndr_long(0);
					dst.Enc_ndr_long(dnsDomainBufferl);
					int dnsDomainBufferi = dst.Index;
					dst.Advance(2 * dnsDomainBufferl);
					dst = dst.Derive(dnsDomainBufferi);
					for (int i = 0; i < dnsDomainBufferl; i++)
					{
						dst.Enc_ndr_short(DnsDomain.Buffer[i]);
					}
				}
				if (DnsForest.Buffer != null)
				{
					dst = dst.Deferred;
					int dnsForestBufferl = DnsForest.Length / 2;
					int dnsForestBuffers = DnsForest.MaximumLength / 2;
					dst.Enc_ndr_long(dnsForestBuffers);
					dst.Enc_ndr_long(0);
					dst.Enc_ndr_long(dnsForestBufferl);
					int dnsForestBufferi = dst.Index;
					dst.Advance(2 * dnsForestBufferl);
					dst = dst.Derive(dnsForestBufferi);
					for (int i = 0; i < dnsForestBufferl; i++)
					{
						dst.Enc_ndr_short(DnsForest.Buffer[i]);
					}
				}
				dst = dst.Derive(domainGuidNodei);
				for (int i1 = 0; i1 < domainGuidNodes; i1++)
				{
					dst.Enc_ndr_small(DomainGuid.Node[i1]);
				}
				if (Sid != null)
				{
					dst = dst.Deferred;
					Sid.Encode(dst);
				}
			}
Example #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();
				src.Align(4);
				if (DnsDomain == null)
				{
					DnsDomain = new Rpc.Unicode_string();
				}
				DnsDomain.Length = (short)src.Dec_ndr_short();
				DnsDomain.MaximumLength = (short)src.Dec_ndr_short();
				int dnsDomainBufferp = src.Dec_ndr_long();
				src.Align(4);
				if (DnsForest == null)
				{
					DnsForest = new Rpc.Unicode_string();
				}
				DnsForest.Length = (short)src.Dec_ndr_short();
				DnsForest.MaximumLength = (short)src.Dec_ndr_short();
				int dnsForestBufferp = src.Dec_ndr_long();
				src.Align(4);
				if (DomainGuid == null)
				{
					DomainGuid = new Rpc.UuidT();
				}
				DomainGuid.TimeLow = src.Dec_ndr_long();
				DomainGuid.TimeMid = (short)src.Dec_ndr_short();
				DomainGuid.TimeHiAndVersion = (short)src.Dec_ndr_short();
				DomainGuid.ClockSeqHiAndReserved = unchecked((byte)src.Dec_ndr_small());
				DomainGuid.ClockSeqLow = unchecked((byte)src.Dec_ndr_small());
				int domainGuidNodes = 6;
				int domainGuidNodei = src.Index;
				src.Advance(1 * domainGuidNodes);
				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 (dnsDomainBufferp != 0)
				{
					src = src.Deferred;
					int dnsDomainBuffers = src.Dec_ndr_long();
					src.Dec_ndr_long();
					int dnsDomainBufferl = src.Dec_ndr_long();
					int dnsDomainBufferi = src.Index;
					src.Advance(2 * dnsDomainBufferl);
					if (DnsDomain.Buffer == null)
					{
						if (dnsDomainBuffers < 0 || dnsDomainBuffers > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						DnsDomain.Buffer = new short[dnsDomainBuffers];
					}
					src = src.Derive(dnsDomainBufferi);
					for (int i = 0; i < dnsDomainBufferl; i++)
					{
						DnsDomain.Buffer[i] = (short)src.Dec_ndr_short();
					}
				}
				if (dnsForestBufferp != 0)
				{
					src = src.Deferred;
					int dnsForestBuffers = src.Dec_ndr_long();
					src.Dec_ndr_long();
					int dnsForestBufferl = src.Dec_ndr_long();
					int dnsForestBufferi = src.Index;
					src.Advance(2 * dnsForestBufferl);
					if (DnsForest.Buffer == null)
					{
						if (dnsForestBuffers < 0 || dnsForestBuffers > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						DnsForest.Buffer = new short[dnsForestBuffers];
					}
					src = src.Derive(dnsForestBufferi);
					for (int i = 0; i < dnsForestBufferl; i++)
					{
						DnsForest.Buffer[i] = (short)src.Dec_ndr_short();
					}
				}
				if (DomainGuid.Node == null)
				{
					if (domainGuidNodes < 0 || domainGuidNodes > unchecked(0xFFFF))
					{
						throw new NdrException(NdrException.InvalidConformance);
					}
					DomainGuid.Node = new byte[domainGuidNodes];
				}
				src = src.Derive(domainGuidNodei);
				for (int i1 = 0; i1 < domainGuidNodes; i1++)
				{
					DomainGuid.Node[i1] = unchecked((byte)src.Dec_ndr_small());
				}
				if (sidp != 0)
				{
					if (Sid == null)
					{
						Sid = new Rpc.SidT();
					}
					src = src.Deferred;
					Sid.Decode(src);
				}
			}
Example #22
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(NumSids);
				dst.Enc_ndr_referent(Sids, 1);
				if (Sids != null)
				{
					dst = dst.Deferred;
					int sidss = NumSids;
					dst.Enc_ndr_long(sidss);
					int sidsi = dst.Index;
					dst.Advance(4 * sidss);
					dst = dst.Derive(sidsi);
					for (int i = 0; i < sidss; i++)
					{
						Sids[i].Encode(dst);
					}
				}
			}
Example #23
0
		/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
		public override void Encode(NdrBuffer buf)
		{
			int start = buf.GetIndex();
			int allocHintIndex = 0;
			buf.Advance(16);
			if (Ptype == 0)
			{
				allocHintIndex = buf.GetIndex();
				buf.Enc_ndr_long(0);
				buf.Enc_ndr_short(0);
				buf.Enc_ndr_short(GetOpnum());
			}
			Encode_in(buf);
			Length = buf.GetIndex() - start;
			if (Ptype == 0)
			{
				buf.SetIndex(allocHintIndex);
				AllocHint = Length - allocHintIndex;
				buf.Enc_ndr_long(AllocHint);
			}
			buf.SetIndex(start);
			Encode_header(buf);
			buf.SetIndex(start + Length);
		}
Example #24
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);
					}
				}
			}
Example #25
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				Idx = src.Dec_ndr_long();
				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();
				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();
					}
				}
			}
Example #26
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Encode(NdrBuffer dst)
			{
				dst.Align(4);
				dst.Enc_ndr_long(Count);
				dst.Enc_ndr_referent(Domains, 1);
				dst.Enc_ndr_long(MaxCount);
				if (Domains != null)
				{
					dst = dst.Deferred;
					int domainss = Count;
					dst.Enc_ndr_long(domainss);
					int domainsi = dst.Index;
					dst.Advance(12 * domainss);
					dst = dst.Derive(domainsi);
					for (int i = 0; i < domainss; i++)
					{
						Domains[i].Encode(dst);
					}
				}
			}
Example #27
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);
					}
				}
			}
Example #28
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);
					}
				}
			}
Example #29
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);
					}
				}
			}
Example #30
0
			/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
			public override void Decode(NdrBuffer src)
			{
				src.Align(4);
				int pathp = src.Dec_ndr_long();
				int commentp = src.Dec_ndr_long();
				State = src.Dec_ndr_long();
				NumStores = src.Dec_ndr_long();
				int storesp = src.Dec_ndr_long();
				if (pathp != 0)
				{
					src = src.Deferred;
					Path = src.Dec_ndr_string();
				}
				if (commentp != 0)
				{
					src = src.Deferred;
					Comment = src.Dec_ndr_string();
				}
				if (storesp != 0)
				{
					src = src.Deferred;
					int storess = src.Dec_ndr_long();
					int storesi = src.Index;
					src.Advance(12 * storess);
					if (Stores == null)
					{
						if (storess < 0 || storess > unchecked(0xFFFF))
						{
							throw new NdrException(NdrException.InvalidConformance);
						}
						Stores = new DfsStorageInfo[storess];
					}
					src = src.Derive(storesi);
					for (int i = 0; i < storess; i++)
					{
						if (Stores[i] == null)
						{
							Stores[i] = new DfsStorageInfo();
						}
						Stores[i].Decode(src);
					}
				}
			}