So after 36 hours of research and checking, I got it.
VS2012 Is the cause after the 'process has locked pages' BSOD.
I tried to open a thread to get the active IPs on my network (using C#). Apparently, When you press the 'Stop' Button when the thread is active, windows is crushing.
This is the thread code:
private void Button_Click_2(object sender, RoutedEventArgs e)
{
var thread = new Thread(() => TryToConnect(targetsList));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
private static void TryToConnect(ListBox targetsList)
{
for (int i = 1; i < 3; i++)
{
Uri url = new Uri("http://192.168.1." + i.ToString());
string pingurl = string.Format("{0}", url.Host);
string host = pingurl;
Ping p = new Ping();
try
{
PingReply reply = p.Send(host, 3000);
if (reply.Status == IPStatus.Success)
{
ListBoxItem item = new ListBoxItem();
item.Content = "192.168.1." + i.ToString();
targetsList.Items.Add(item);
targetsList.Items.Refresh();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
// Thread.Sleep(10);
}
}
As you can see the thread is using Ping 255 times, so it takes time to be finished. When I press the Stop button apparently the VS2012 Debug Process makes Windows to crush. Every time that I tried it, Windows crashed. (My OS: Win7 64Bit) Am I right with this? And if not, is it fixable?
It's a known issue with Visual Studio (since VS2010, apparently) and the Ping
class.
Posted by Microsoft on 06/02/2012 at 09:11
Thank you for your feedback. This is a known issue with the underlying Windows APIs used by the Ping class. The Windows team is will determine how to best handle the issue.