//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Source Executable: c:\windows\system32\spoolsv.exe
// Interface ID: 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1
// Interface Version: 1.0

namespace rpc_0b6edbfa_4a24_4fc6_8a23_942b1eca65d1_1_0
{
    
    #region Marshal Helpers
    internal class _Marshal_Helper : NtApiDotNet.Ndr.Marshal.NdrMarshalBuffer
    {
        public void Write_0(NtApiDotNet.Ndr.Marshal.NdrUnsupported p0)
        {
            WriteUnsupported(p0, "FC_BOGUS_ARRAY -   handle_t[]");
        }
        public void Write_1(byte[] p0, long p1)
        {
            WriteConformantArray<byte>(p0, p1);
        }
        public void Write_2(byte[] p0, long p1)
        {
            WriteConformantArray<byte>(p0, p1);
        }
        public void Write_3(byte[] p0, long p1)
        {
            WriteConformantArray<byte>(p0, p1);
        }
    }
    internal class _Unmarshal_Helper : NtApiDotNet.Ndr.Marshal.NdrUnmarshalBuffer
    {
        public _Unmarshal_Helper(NtApiDotNet.Win32.Rpc.RpcClientResponse r) : 
                base(r.NdrBuffer, r.Handles, r.DataRepresentation)
        {
        }
        public _Unmarshal_Helper(byte[] ba) : 
                base(ba)
        {
        }
        public NtApiDotNet.Ndr.Marshal.NdrUnsupported Read_0()
        {
            return ReadUnsupported("FC_BOGUS_ARRAY -   handle_t[]");
        }
        public byte[] Read_1()
        {
            return ReadConformantArray<byte>();
        }
        public byte[] Read_2()
        {
            return ReadConformantArray<byte>();
        }
        public byte[] Read_3()
        {
            return ReadConformantArray<byte>();
        }
    }
    #endregion
    #region Client Implementation
    public sealed class Client : NtApiDotNet.Win32.Rpc.RpcClientBase
    {
        public Client() : 
                base("0b6edbfa-4a24-4fc6-8a23-942b1eca65d1", 1, 0)
        {
        }
        private _Unmarshal_Helper SendReceive(int p, _Marshal_Helper m)
        {
            return new _Unmarshal_Helper(SendReceive(p, m.DataRepresentation, m.ToArray(), m.Handles));
        }
        public int IRPCAsyncNotify_RegisterClient(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, string p1, System.Guid p2, int p3, int p4, out string p5)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            m.WriteReferent(p1, new System.Action<string>(m.WriteTerminatedString));
            m.WriteGuid(p2);
            m.WriteInt32(p3);
            m.WriteInt32(p4);
            _Unmarshal_Helper u = SendReceive(0, m);
            p5 = u.ReadReferent<string>(new System.Func<string>(u.ReadConformantVaryingString), false);
            return u.ReadInt32();
        }
        public int IRPCAsyncNotify_UnregisterClient(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            _Unmarshal_Helper u = SendReceive(1, m);
            return u.ReadInt32();
        }
        // async
        public int IRPCAsyncNotify_GetServerRefferal(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, out string p1)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            _Unmarshal_Helper u = SendReceive(2, m);
            p1 = u.ReadReferent<string>(new System.Func<string>(u.ReadConformantVaryingString), false);
            return u.ReadInt32();
        }
        // async
        public int IRPCAsyncNotify_GetNewChannel(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, out int p1, out NtApiDotNet.Ndr.Marshal.NdrUnsupported p2)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            _Unmarshal_Helper u = SendReceive(3, m);
            p1 = u.ReadInt32();
            p2 = u.ReadReferent<NtApiDotNet.Ndr.Marshal.NdrUnsupported>(new System.Func<NtApiDotNet.Ndr.Marshal.NdrUnsupported>(u.Read_0), false);
            return u.ReadInt32();
        }
        // async
        public int IRPCAsyncNotify_GetNotificationSendResponse(ref NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, System.Nullable<System.Guid> p1, int p2, byte[] p3, out System.Nullable<System.Guid> p4, out int p5, out byte[] p6)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            m.WriteReferent(p1, new System.Action<System.Guid>(m.WriteGuid));
            m.WriteInt32(p2);
            m.WriteReferent(p3, new System.Action<byte[], long>(m.Write_1), p2);
            _Unmarshal_Helper u = SendReceive(4, m);
            p0 = u.ReadContextHandle();
            p4 = u.ReadReferentValue<System.Guid>(new System.Func<System.Guid>(u.ReadGuid), false);
            p5 = u.ReadInt32();
            p6 = u.ReadReferent<byte[]>(new System.Func<byte[]>(u.Read_2), false);
            return u.ReadInt32();
        }
        // async
        public int IRPCAsyncNotify_GetNotification(NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, out System.Nullable<System.Guid> p1, out int p2, out byte[] p3)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            _Unmarshal_Helper u = SendReceive(5, m);
            p1 = u.ReadReferentValue<System.Guid>(new System.Func<System.Guid>(u.ReadGuid), false);
            p2 = u.ReadInt32();
            p3 = u.ReadReferent<byte[]>(new System.Func<byte[]>(u.Read_3), false);
            return u.ReadInt32();
        }
        // async
        public int IRPCAsyncNotify_CloseChannel(ref NtApiDotNet.Ndr.Marshal.NdrContextHandle p0, System.Guid p1, int p2, byte[] p3)
        {
            _Marshal_Helper m = new _Marshal_Helper();
            m.WriteContextHandle(p0);
            m.WriteGuid(p1);
            m.WriteInt32(p2);
            m.WriteReferent(p3, new System.Action<byte[], long>(m.Write_1), p2);
            _Unmarshal_Helper u = SendReceive(6, m);
            p0 = u.ReadContextHandle();
            return u.ReadInt32();
        }
    }
    #endregion
}

