コード例 #1
0
 private void openNamedSectionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (NamedObjectForm frm = new NamedObjectForm("Section"))
     {
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             using (NtSection handle = (NtSection)frm.ObjectHandle)
             {
                 NtMappedSection   mapped_file = handle.Map(frm.ReadOnly ? MemoryAllocationProtect.ReadOnly : MemoryAllocationProtect.ReadWrite);
                 SectionEditorForm c           = new SectionEditorForm(mapped_file, frm.ObjectName, frm.ReadOnly);
                 c.Show(dockPanel, DockState.Document);
             }
         }
     }
 }
        private void openNamedSectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (NamedObjectForm frm = new NamedObjectForm("Section"))
            {
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    using (NtSection handle = (NtSection)frm.ObjectHandle)
                    {
                        NtMappedSection mapped_file = handle.Map(frm.ReadOnly ? ProtectionType.ReadOnly : ProtectionType.ReadWrite);
                        SectionEditorForm c = new SectionEditorForm(mapped_file, frm.ObjectName, frm.ReadOnly);

                        c.Show(dockPanel, DockState.Document);
                    }
                }
            }
        }
 private void setNamedEventToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (NamedObjectForm frm = new NamedObjectForm("Event"))
     {
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             using(NtEvent handle = (NtEvent)frm.ObjectHandle)
             {
                 try
                 {
                     handle.Set();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
         }
     }
 }
コード例 #4
0
 private void setNamedEventToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (NamedObjectForm frm = new NamedObjectForm("Event"))
     {
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             using (NtEvent handle = (NtEvent)frm.ObjectHandle)
             {
                 try
                 {
                     handle.Set();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
             }
         }
     }
 }