本文整理汇总了C#中SharpCifs.Dcerpc.Ndr.NdrBuffer.Dec_ndr_short方法的典型用法代码示例。如果您正苦于以下问题:C# NdrBuffer.Dec_ndr_short方法的具体用法?C# NdrBuffer.Dec_ndr_short怎么用?C# NdrBuffer.Dec_ndr_short使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpCifs.Dcerpc.Ndr.NdrBuffer
的用法示例。
在下文中一共展示了NdrBuffer.Dec_ndr_short方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Decode
/// <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());
}
示例3: Decode_header
/// <exception cref="SharpCifs.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();
}
示例4: 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();
}
}
}
示例5: Decode
/// <exception cref="SharpCifs.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);
}
}
示例6: Decode_out
/// <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();
}
示例7: Sendrecv
/// <exception cref="SharpCifs.Dcerpc.DcerpcException"></exception>
/// <exception cref="System.IO.IOException"></exception>
public virtual void Sendrecv(DcerpcMessage msg)
{
byte[] stub;
byte[] frag;
NdrBuffer buf;
NdrBuffer fbuf;
bool isLast;
bool isDirect;
DcerpcException de;
if (State == 0)
{
Bind();
}
isDirect = true;
stub = BufferCache.GetBuffer();
try
{
int off;
int tot;
int n;
buf = new NdrBuffer(stub, 0);
msg.Flags = DcerpcConstants.DcerpcFirstFrag | DcerpcConstants.DcerpcLastFrag;
msg.CallId = _callId++;
msg.Encode(buf);
if (SecurityProvider != null)
{
buf.SetIndex(0);
SecurityProvider.Wrap(buf);
}
tot = buf.GetLength() - 24;
off = 0;
while (off < tot)
{
n = tot - off;
if ((24 + n) > MaxXmit)
{
msg.Flags &= ~DcerpcConstants.DcerpcLastFrag;
n = MaxXmit - 24;
}
else
{
msg.Flags |= DcerpcConstants.DcerpcLastFrag;
isDirect = false;
msg.AllocHint = n;
}
msg.Length = 24 + n;
if (off > 0)
{
msg.Flags &= ~DcerpcConstants.DcerpcFirstFrag;
}
if ((msg.Flags & (DcerpcConstants.DcerpcFirstFrag | DcerpcConstants.DcerpcLastFrag)) != (DcerpcConstants.DcerpcFirstFrag |
DcerpcConstants.DcerpcLastFrag))
{
buf.Start = off;
buf.Reset();
msg.Encode_header(buf);
buf.Enc_ndr_long(msg.AllocHint);
buf.Enc_ndr_short(0);
buf.Enc_ndr_short(msg.GetOpnum());
}
DoSendFragment(stub, off, msg.Length, isDirect);
off += n;
}
DoReceiveFragment(stub, isDirect);
buf.Reset();
buf.SetIndex(8);
buf.SetLength(buf.Dec_ndr_short());
if (SecurityProvider != null)
{
SecurityProvider.Unwrap(buf);
}
buf.SetIndex(0);
msg.Decode_header(buf);
off = 24;
if (msg.Ptype == 2 && msg.IsFlagSet(DcerpcConstants.DcerpcLastFrag) == false)
{
off = msg.Length;
}
frag = null;
fbuf = null;
while (msg.IsFlagSet(DcerpcConstants.DcerpcLastFrag) == false)
{
int stubFragLen;
if (frag == null)
{
frag = new byte[MaxRecv];
fbuf = new NdrBuffer(frag, 0);
}
DoReceiveFragment(frag, isDirect);
fbuf.Reset();
fbuf.SetIndex(8);
fbuf.SetLength(fbuf.Dec_ndr_short());
if (SecurityProvider != null)
{
SecurityProvider.Unwrap(fbuf);
}
fbuf.Reset();
msg.Decode_header(fbuf);
//.........这里部分代码省略.........
示例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);
}