/// <summary> /// Send and receive an RPC message. /// </summary> /// <param name="proc_num">The procedure number.</param> /// <param name="ndr_buffer">Marshal NDR buffer for the call.</param> /// <returns>Unmarshal NDR buffer for the result.</returns> public NdrUnmarshalBuffer SendReceive(int proc_num, NdrMarshalBuffer ndr_buffer) { var response = SendReceive(proc_num, ndr_buffer.DataRepresentation, ndr_buffer.ToArray(), ndr_buffer.Handles); return(new NdrUnmarshalBuffer(response.NdrBuffer, response.Handles, response.DataRepresentation)); }
/// <summary> /// Send and receive an RPC message. /// </summary> /// <param name="proc_num">The procedure number.</param> /// <param name="ndr_buffer">Marshal NDR buffer for the call.</param> /// <returns>Unmarshal NDR buffer for the result.</returns> protected NdrUnmarshalBuffer SendReceive(int proc_num, NdrMarshalBuffer ndr_buffer) { if (!Connected) { throw new InvalidOperationException("RPC client is not connected."); } byte[] buffer = ndr_buffer.ToArray(); if (buffer.Length > 0xF00) { return(SendAndReceiveLarge(proc_num, ndr_buffer, buffer)); } return(SendAndReceiveImmediate(proc_num, ndr_buffer, buffer)); }
public uint PrivGetPsmToken(int p0, int p1, string p2, string p3, out NtApiDotNet.NtToken p4, out int p5) { NdrMarshalBuffer m = new NdrMarshalBuffer(); m.WriteInt32(p0); m.WriteInt32(p1); m.WriteTerminatedString(RpcUtils.CheckNull(p2, "p2")); m.WriteTerminatedString(RpcUtils.CheckNull(p3, "p3")); var resp = SendReceive(21, m.DataRepresentation, m.ToArray(), m.Handles); NdrUnmarshalBuffer u = new NdrUnmarshalBuffer(resp.NdrBuffer, resp.Handles, resp.DataRepresentation); p4 = u.ReadSystemHandle <NtApiDotNet.NtToken>(); p5 = u.ReadInt32(); return(u.ReadUInt32()); }