Пример #1
0
        private void SetupIPIDEntry(COMIPIDEntry obj)
        {
            textBoxIPID.Text                = obj.Ipid.FormatGuid();
            textBoxIPIDIID.Text             = obj.Iid.FormatGuid();
            textBoxIPIDIIDName.Text         = m_registry.MapIidToInterface(obj.Iid).Name;
            textBoxIPIDFlags.Text           = obj.Flags.ToString();
            textBoxIPIDInterface.Text       = String.Format("0x{0:X}", obj.Interface.ToInt64());
            textBoxIPIDInterfaceVTable.Text = GetStringValue(obj.InterfaceVTable);
            textBoxIPIDStub.Text            = String.Format("0x{0:X}", obj.Stub.ToInt64());
            textBoxIPIDStubVTable.Text      = GetStringValue(obj.StubVTable);
            textBoxIPIDOXID.Text            = obj.Oxid.FormatGuid();
            textBoxIPIDReferences.Text      = String.Format("Strong: {0}, Weak: {1}, Private: {2}",
                                                            obj.StrongRefs, obj.WeakRefs, obj.PrivateRefs);

            textBoxIPIDProcessId.Text = COMUtilities.GetProcessIdFromIPid(obj.Ipid).ToString();
            textBoxIPIDApartment.Text = COMUtilities.GetApartmentIdStringFromIPid(obj.Ipid);
            textBoxIPIDStaHwnd.Text   = String.Format("0x{0:X}", obj.ServerSTAHwnd.ToInt64());
            tabControlProperties.TabPages.Add(tabPageIPID);
        }
Пример #2
0
        private void SetupIPIDEntry(COMIPIDEntry obj)
        {
            textBoxIPID.Text                = obj.Ipid.FormatGuid();
            textBoxIPIDIID.Text             = obj.Iid.FormatGuid();
            textBoxIPIDIIDName.Text         = m_registry.MapIidToInterface(obj.Iid).Name;
            textBoxIPIDFlags.Text           = obj.Flags.ToString();
            textBoxIPIDInterface.Text       = String.Format("0x{0:X}", obj.Interface.ToInt64());
            textBoxIPIDInterfaceVTable.Text = GetStringValue(obj.InterfaceVTable);
            textBoxIPIDStub.Text            = String.Format("0x{0:X}", obj.Stub.ToInt64());
            textBoxIPIDStubVTable.Text      = GetStringValue(obj.StubVTable);
            textBoxIPIDOXID.Text            = obj.Oxid.FormatGuid();
            textBoxIPIDReferences.Text      = String.Format("Strong: {0}, Weak: {1}, Private: {2}",
                                                            obj.StrongRefs, obj.WeakRefs, obj.PrivateRefs);

            textBoxIPIDProcessId.Text = COMUtilities.GetProcessIdFromIPid(obj.Ipid).ToString();
            textBoxIPIDApartment.Text = COMUtilities.GetApartmentIdStringFromIPid(obj.Ipid);
            textBoxIPIDStaHwnd.Text   = String.Format("0x{0:X}", obj.ServerSTAHwnd.ToInt64());
            listViewIpidMethods.Items.AddRange(obj.Methods.Select((method, i) =>
            {
                ListViewItem item = new ListViewItem(i.ToString());
                item.SubItems.Add(method.Name);
                item.SubItems.Add(method.Address);
                item.SubItems.Add(method.Symbol);
                int count = method.Procedure != null ? method.Procedure.Params.Count : 0;
                if (i == 0)
                {
                    count = 3;
                }
                item.SubItems.Add(count.ToString());
                return(item);
            }
                                                                  ).ToArray());
            listViewIpidMethods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            listViewIpidMethods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            m_ipid = obj;
            tabControlProperties.TabPages.Add(tabPageIPID);
        }
Пример #3
0
        public StandardMarshalEditorControl(COMRegistry registry, COMObjRefStandard objref)
        {
            m_objref   = objref;
            m_registry = registry;
            InitializeComponent();
            textBoxStandardFlags.Text = String.Format("0x{0:X}", objref.StdObjRef.Flags);
            textBoxPublicRefs.Text    = objref.StdObjRef.PublicRefs.ToString();
            textBoxOxid.Text          = String.Format("0x{0:X016}", objref.StdObjRef.Oxid);
            textBoxOid.Text           = String.Format("0x{0:X016}", objref.StdObjRef.Oid);
            textBoxIpid.Text          = objref.StdObjRef.Ipid.FormatGuid();
            textBoxApartmentId.Text   = COMUtilities.GetApartmentIdStringFromIPid(objref.StdObjRef.Ipid);
            int pid = COMUtilities.GetProcessIdFromIPid(objref.StdObjRef.Ipid);

            textBoxProcessId.Text = COMUtilities.GetProcessIdFromIPid(objref.StdObjRef.Ipid).ToString();
            try
            {
                Process p = Process.GetProcessById(pid);
                textBoxProcessName.Text = p.ProcessName;
            }
            catch (ArgumentException)
            {
                textBoxProcessName.Text = "N/A";
            }

            COMObjRefHandler handler = objref as COMObjRefHandler;

            if (handler != null)
            {
                textBoxHandlerClsid.Text = handler.Clsid.FormatGuid();
                COMCLSIDEntry ent = registry.MapClsidToEntry(handler.Clsid);
                if (ent != null)
                {
                    textBoxHandlerName.Text = ent.Name;
                }
            }
            else
            {
                tableLayoutPanel.Controls.Remove(lblHandlerClsid);
                tableLayoutPanel.Controls.Remove(lblHandlerName);
                tableLayoutPanel.Controls.Remove(textBoxHandlerClsid);
                tableLayoutPanel.Controls.Remove(textBoxHandlerName);
            }

            foreach (COMStringBinding str in objref.StringArray.StringBindings)
            {
                ListViewItem item = listViewStringBindings.Items.Add(str.TowerId.ToString());
                item.SubItems.Add(str.NetworkAddr);
                item.Tag = str;
            }
            listViewStringBindings.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            listViewStringBindings.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            foreach (COMSecurityBinding sec in objref.StringArray.SecurityBindings)
            {
                ListViewItem item = listViewSecurityBindings.Items.Add(sec.AuthnSvc.ToString());
                item.SubItems.Add(sec.PrincName);
                item.Tag = sec;
            }
            listViewSecurityBindings.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            listViewSecurityBindings.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }