Beispiel #1
0
        private static Ptr <RPC_SERVER_INTERFACE> Configure(MIDL_SERVER_INFO temp, RpcHandle handle, Ptr <MIDL_SERVER_INFO> me, Guid iid,
                                                            Byte[] formatTypes,
                                                            Byte[] formatProc, ExplicitBytesExecute fnExecute)
        {
            Ptr <RPC_SERVER_INTERFACE> svrIface = handle.CreatePtr(CreateExplicitBytesServer(handle, me, iid));
            Ptr <MIDL_STUB_DESC>       stub     = handle.CreatePtr(new MIDL_STUB_DESC(handle, svrIface.Handle, formatTypes, true));

            temp.pStubDesc = stub.Handle;

            IntPtr ptrFunction = handle.PinFunction(fnExecute);

            temp.DispatchTable = handle.Pin(ptrFunction);

            temp.ProcString      = handle.Pin(formatProc);
            temp.FmtStringOffset = handle.Pin(new int[1] {
                0
            });

            temp.ThunkTable      = IntPtr.Zero;
            temp.pTransferSyntax = IntPtr.Zero;
            temp.nCount          = IntPtr.Zero;
            temp.pSyntaxInfo     = IntPtr.Zero;

            //Copy us back into the pinned address
            Marshal.StructureToPtr(temp, me.Handle, false);
            return(svrIface);
        }
        private Ptr <RPC_SERVER_INTERFACE> Configure(RpcHandle handle, Ptr <MIDL_SERVER_INFO> me, Guid iid,
                                                     Byte[] formatTypes, Byte[] formatProc, ushort[] formatProcOffsets,
                                                     Delegate[] funcs)
        {
            Ptr <RPC_SERVER_INTERFACE> svrIface = handle.CreatePtr(new RPC_SERVER_INTERFACE(handle, me, iid));
            Ptr <MIDL_STUB_DESC>       stub     = handle.CreatePtr(new MIDL_STUB_DESC(handle, svrIface.Handle, formatTypes, true));

            pStubDesc = stub.Handle;

            var dispatches = new IntPtr[funcs.Length];

            for (var i = 0; i < funcs.Length; ++i)
            {
                dispatches[i] = handle.PinFunction(funcs[i]);
            }
            DispatchTable = handle.Pin(dispatches);

            ProcString      = handle.Pin(formatProc);
            FmtStringOffset = handle.Pin(formatProcOffsets.Clone());

            ThunkTable      = IntPtr.Zero;
            pTransferSyntax = IntPtr.Zero;
            nCount          = IntPtr.Zero;
            pSyntaxInfo     = IntPtr.Zero;

            //Copy us back into the pinned address
            Marshal.StructureToPtr(this, me.Handle, false);
            return(svrIface);
        }
        private static Ptr<RPC_SERVER_INTERFACE> Configure(MIDL_SERVER_INFO temp, RpcHandle handle, Ptr<MIDL_SERVER_INFO> me, Guid iid,
                                                    Byte[] formatTypes,
                                                    Byte[] formatProc, ExplicitBytesExecute fnExecute)
        {
            Ptr<RPC_SERVER_INTERFACE> svrIface = handle.CreatePtr(CreateExplicitBytesServer(handle, me, iid));
            Ptr<MIDL_STUB_DESC> stub = handle.CreatePtr(new MIDL_STUB_DESC(handle, svrIface.Handle, formatTypes, true));
            temp.pStubDesc = stub.Handle;

            IntPtr ptrFunction = handle.PinFunction(fnExecute);
            temp.DispatchTable = handle.Pin(ptrFunction);

            temp.ProcString = handle.Pin(formatProc);
            temp.FmtStringOffset = handle.Pin(new int[1] { 0 });

            temp.ThunkTable = IntPtr.Zero;
            temp.pTransferSyntax = IntPtr.Zero;
            temp.nCount = IntPtr.Zero;
            temp.pSyntaxInfo = IntPtr.Zero;

            //Copy us back into the pinned address
            Marshal.StructureToPtr( temp, me.Handle, false);
            return svrIface;
        }
        private Ptr<RPC_SERVER_INTERFACE> Configure(RpcHandle handle, Ptr<MIDL_SERVER_INFO> me, Guid iid,
                                                    Byte[] formatTypes, Byte[] formatProc, ushort[] formatProcOffsets,
                                                    Delegate[] funcs)
        {
            Ptr<RPC_SERVER_INTERFACE> svrIface = handle.CreatePtr(new RPC_SERVER_INTERFACE(handle, me, iid));
            Ptr<MIDL_STUB_DESC> stub = handle.CreatePtr(new MIDL_STUB_DESC(handle, svrIface.Handle, formatTypes, true));
            pStubDesc = stub.Handle;

            var dispatches = new IntPtr[funcs.Length];
            for (var i = 0; i < funcs.Length; ++i)
            {
              dispatches[i] = handle.PinFunction(funcs[i]);
            }
            DispatchTable = handle.Pin(dispatches);

            ProcString = handle.Pin(formatProc);
            FmtStringOffset = handle.Pin(formatProcOffsets.Clone());

            ThunkTable = IntPtr.Zero;
            pTransferSyntax = IntPtr.Zero;
            nCount = IntPtr.Zero;
            pSyntaxInfo = IntPtr.Zero;

            //Copy us back into the pinned address
            Marshal.StructureToPtr(this, me.Handle, false);
            return svrIface;
        }