本文整理汇总了C#中SharpCifs.Dcerpc.Ndr.NdrBuffer.Align方法的典型用法代码示例。如果您正苦于以下问题:C# NdrBuffer.Align方法的具体用法?C# NdrBuffer.Align怎么用?C# NdrBuffer.Align使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpCifs.Dcerpc.Ndr.NdrBuffer
的用法示例。
在下文中一共展示了NdrBuffer.Align方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(Length);
dst.Enc_ndr_referent(RootDirectory, 1);
dst.Enc_ndr_referent(ObjectName, 1);
dst.Enc_ndr_long(Attributes);
dst.Enc_ndr_long(SecurityDescriptor);
dst.Enc_ndr_referent(SecurityQualityOfService, 1);
if (RootDirectory != null)
{
dst = dst.Deferred;
RootDirectory.Encode(dst);
}
if (ObjectName != null)
{
dst = dst.Deferred;
ObjectName.Encode(dst);
}
if (SecurityQualityOfService != null)
{
dst = dst.Deferred;
SecurityQualityOfService.Encode(dst);
}
}
示例3: 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());
}
示例4: Decode
/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
public override void Decode(NdrBuffer src)
{
src.Align(4);
int netnamep = src.Dec_ndr_long();
if (netnamep != 0)
{
src = src.Deferred;
Netname = src.Dec_ndr_string();
}
}
示例5: Encode
/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
public override void Encode(NdrBuffer dst)
{
dst.Align(4);
dst.Enc_ndr_referent(Netname, 1);
if (Netname != null)
{
dst = dst.Deferred;
dst.Enc_ndr_string(Netname);
}
}
示例6: Encode
/// <exception cref="SharpCifs.Dcerpc.Ndr.NdrException"></exception>
public override void Encode(NdrBuffer dst)
{
dst.Align(4);
dst.Enc_ndr_referent(EntryPath, 1);
if (EntryPath != null)
{
dst = dst.Deferred;
dst.Enc_ndr_string(EntryPath);
}
}
示例7: Decode
/// <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();
}
}
示例8: Decode
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();
}
示例9: Encode
public override void Encode(NdrBuffer _dst) {
_dst.Align(4);
_dst.Enc_ndr_long(service_type);
_dst.Enc_ndr_long(current_state);
_dst.Enc_ndr_long(controls_accepted);
_dst.Enc_ndr_long(win32_exit_code);
_dst.Enc_ndr_long(service_specific_exit_code);
_dst.Enc_ndr_long(check_point);
_dst.Enc_ndr_long(wait_hint);
}
示例10: 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]);
}
}
示例11: 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();
}
}
}
示例12: Encode
/// <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]);
}
}
}