private NdrProcedureDefinition[] ReadProcs(NdrParser parser, Guid base_iid, CInterfaceStubHeader stub)
        {
            int start_ofs = 3;

            if (base_iid == COMInterfaceEntry.IID_IDispatch)
            {
                start_ofs = 7;
            }

            return(parser.ReadFromMidlServerInfo(stub.pServerInfo, start_ofs, stub.DispatchTableCount).ToArray());
        }
        private NdrProcedureDefinition[] ReadProcs(Dictionary <IntPtr, NdrBaseTypeReference> type_cache, Guid base_iid, CInterfaceStubHeader stub)
        {
            MIDL_SERVER_INFO server_info = stub.GetServerInfo();
            MIDL_STUB_DESC   stub_desc   = server_info.GetStubDesc();
            IntPtr           type_desc   = stub_desc.pFormatTypes;
            int start_ofs = 3;

            if (base_iid == COMInterfaceEntry.IID_IDispatch)
            {
                start_ofs = 7;
            }

            List <NdrProcedureDefinition> procs = new List <NdrProcedureDefinition>();

            while (start_ofs < stub.DispatchTableCount)
            {
                int fmt_ofs = Marshal.ReadInt16(server_info.FmtStringOffset, start_ofs * 2);
                if (fmt_ofs >= 0)
                {
                    procs.Add(new NdrProcedureDefinition(type_cache, stub_desc, server_info.ProcString + fmt_ofs, type_desc));
                }
                start_ofs++;
            }
            return(procs.ToArray());
        }