예제 #1
0
        public BugCheckWindow()
        {
            InitializeComponent();

            try
            {
                _KBugCheck = new KBugCheck("KBugCheck");
            }
            catch
            {
                MessageBox.Show("Could not create or open the kernel driver. Make sure you are running as an administrator.", "Bug Check",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(System.Runtime.InteropServices.Marshal.GetLastWin32Error());
            }

            comboBugCheckCode.Items.Add("Custom...");

            try
            {
                XmlDocument doc = new XmlDocument();

                doc.Load(Application.StartupPath + "\\db.xml");

                foreach (XmlNode node in doc.SelectSingleNode("db").SelectNodes("code"))
                {
                    BugCheckCode code = new BugCheckCode();
                    code.Code = (uint)BaseConverter.ToNumberParse(node.Attributes["id"].Value);
                    code.Name = node.Attributes["name"].Value;

                    foreach (XmlNode n in node.SelectNodes("description"))
                        code.Description = n.ChildNodes[0].Value.Trim();
                    foreach (XmlNode n in node.SelectNodes("p1"))
                        code.Param1 = n.ChildNodes[0].Value.Trim();
                    foreach (XmlNode n in node.SelectNodes("p2"))
                        code.Param2 = n.ChildNodes[0].Value.Trim();
                    foreach (XmlNode n in node.SelectNodes("p3"))
                        code.Param3 = n.ChildNodes[0].Value.Trim();
                    foreach (XmlNode n in node.SelectNodes("p4"))
                        code.Param4 = n.ChildNodes[0].Value.Trim();

                    comboBugCheckCode.Items.Add(code.Name);
                    _bugCheckCodes.Add(code.Name, code);
                }
            }
            catch
            {
                MessageBox.Show("Could not load the bug check database.", "Bug Check",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            comboBugCheckCode_SelectedIndexChanged(null, null);
        }
예제 #2
0
        public BugCheckWindow()
        {
            InitializeComponent();

            try
            {
                _KBugCheck = new KBugCheck("KBugCheck");
            }
            catch
            {
                MessageBox.Show("Could not create or open the kernel driver. Make sure you are running as an administrator.", "Bug Check",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(System.Runtime.InteropServices.Marshal.GetLastWin32Error());
            }

            comboBugCheckCode.Items.Add("Custom...");

            try
            {
                XmlDocument doc = new XmlDocument();

                doc.Load(Application.StartupPath + "\\db.xml");

                foreach (XmlNode node in doc.SelectSingleNode("db").SelectNodes("code"))
                {
                    BugCheckCode code = new BugCheckCode();
                    code.Code = (uint)BaseConverter.ToNumberParse(node.Attributes["id"].Value);
                    code.Name = node.Attributes["name"].Value;

                    foreach (XmlNode n in node.SelectNodes("description"))
                    {
                        code.Description = n.ChildNodes[0].Value.Trim();
                    }
                    foreach (XmlNode n in node.SelectNodes("p1"))
                    {
                        code.Param1 = n.ChildNodes[0].Value.Trim();
                    }
                    foreach (XmlNode n in node.SelectNodes("p2"))
                    {
                        code.Param2 = n.ChildNodes[0].Value.Trim();
                    }
                    foreach (XmlNode n in node.SelectNodes("p3"))
                    {
                        code.Param3 = n.ChildNodes[0].Value.Trim();
                    }
                    foreach (XmlNode n in node.SelectNodes("p4"))
                    {
                        code.Param4 = n.ChildNodes[0].Value.Trim();
                    }

                    comboBugCheckCode.Items.Add(code.Name);
                    _bugCheckCodes.Add(code.Name, code);
                }
            }
            catch
            {
                MessageBox.Show("Could not load the bug check database.", "Bug Check",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            comboBugCheckCode_SelectedIndexChanged(null, null);
        }