Note that there are some explanatory texts on larger screens.

plurals
  1. POC# program causes bluescreen?
    text
    copied!<p>This is only the important stuff that the bluescreen shows. I'm on Windows 7 x64.</p> <p><strong>"A problem has been detected and Windows has been shut down to prevent damage to your computer.</strong></p> <p><strong>PROCESS_HAS_LOCKED_PAGES</strong></p> <p><em><strong></em>* STOP: 0x00000076 (0x0000000000000000, 0xfffffa8009dcd060, 0x0000000000000011, 0x0000000000000000)</strong>"</p> <p>I can't work on it now because every time I close it I get a bluescreen! The program doesn't do anything yet except run the background worker below. It pings all addresses that could be part of the user's home network and attempts to connect to a certain port that another program will be listening on.</p> <pre><code>private void NetworkScanner_DoWork(object sender, DoWorkEventArgs e) { bool ExceptionEncountered = false; int IPsProcessed = 0; NetworkSearcherOutput = "Starting network scanner..."; NetworkSearcher.ReportProgress(0); Thread.Sleep(1000); foreach (IPAddress IP in Dns.GetHostAddresses(Dns.GetHostName())) { if (IP.AddressFamily == AddressFamily.InterNetwork) { string[] Octets = IP.ToString().Split('.'); Octets[3] = "0"; IPAddress CurrentAddressIteration = StringArrayToIP(Octets); while (GetLastOctet(CurrentAddressIteration) != 255) { PingReply Reply = new Ping().Send(CurrentAddressIteration, 5); if (Reply.Status == IPStatus.Success) { NetworkSearcherOutput = CurrentAddressIteration.ToString() + " sent response."; NetworkSearcher.ReportProgress(0); Thread.Sleep(500); InClient Client = new InClient(CurrentAddressIteration); try { Client.Connect(); SnapshotBox.Image = Client.Receive(typeof(Image)); NetworkSearcherOutput = CurrentAddressIteration.ToString() + " is running program."; NetworkSearcher.ReportProgress(0); Thread.Sleep(1000); } catch (Exception E) { // A socket exception is expected when the client is not running the program. if (E is SocketException) { Client.Close(); NetworkSearcherOutput = CurrentAddressIteration.ToString() + " is not running program."; NetworkSearcher.ReportProgress(0); Thread.Sleep(1000); } //Unhandled exception. Show messagebox and close. else { MessageBox.Show("Network scanner encountered an unhandled exception.\n\n" + E.GetType().ToString() + ": " + E.Message, "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); ExceptionEncountered = true; break; } } } else { NetworkSearcherOutput = CurrentAddressIteration.ToString() + " did not respond."; NetworkSearcher.ReportProgress(0); } IPsProcessed++; if (IPsProcessed == 5) { NetworkSearcher.ReportProgress(2); IPsProcessed = 0; } Octets = CurrentAddressIteration.ToString().Split('.'); Octets[3] = (Int32.Parse(Octets[3]) + 1).ToString(); CurrentAddressIteration = StringArrayToIP(Octets); } } } if (!ExceptionEncountered) { NetworkSearcherOutput = "Network scanning complete."; NetworkSearcher.ReportProgress(0); NetworkSearcher.ReportProgress(100); } else { NetworkSearcherOutput = "Network scanning encountered an error."; NetworkSearcher.ReportProgress(-1); } </code></pre> <p>I thought C# programs were supposed to never cause bluescreens?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload