本文整理汇总了C#中SharpCifs.Dcerpc.Ndr.NdrBuffer.Advance方法的典型用法代码示例。如果您正苦于以下问题:C# NdrBuffer.Advance方法的具体用法?C# NdrBuffer.Advance怎么用?C# NdrBuffer.Advance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpCifs.Dcerpc.Ndr.NdrBuffer
的用法示例。
在下文中一共展示了NdrBuffer.Advance方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
/// <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());
}
}
示例2: Encode
/// <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]);
}
}
示例3: Encode
/// <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);
}
}
}
示例4: Encode
/// <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);
}
}
}
示例5: Encode
/// <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);
}
}
}
示例6: Encode_in
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);
}
示例7: Decode
/// <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);
}
}
}
示例8: Decode_out
/// <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);
}
示例9: Decode
/// <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);
}
}
}
示例10: Decode
/// <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);
}
}
}
示例11: Decode_out
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();
}
示例12: Encode
/// <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);
}
}
示例13: Encode
/// <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);
}
示例14: Decode
/// <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();
}
}
}