When ending the debugger for my program I get a BSOD with the following error:
"PROCESS_HAS_LOCKED_PAGES"
However, this only appears to happen when the ping has timed out. For example, it can ping normally, and I can end debugging. But when I try an IP Address that'll time out and then I end the debugger either during or after the For
loop it crashed windows to a blue screen. I've tried this on my laptop and that has the exact same issue. Both are running Windows 10 x64.
Any idea on what exactly is causing this? I've already fully uninstalled Visual Studio on my Desktop and re-installed, but the BSOD is still occurring. I have no issues with any other programs, and the actual debug program itself works fine when I run it outside of Visual Studio. Am I doing something wrong?
Imports System.Net.NetworkInformation
Public Class Form1
Private Sub btnStartPing_Click(sender As Object, e As EventArgs) Handles btnStartPing.Click
For I As Integer = 0 To 5
If I >= 5 Then
Exit For
End If
Dim myPing As New System.Net.NetworkInformation.Ping
Dim PR As System.Net.NetworkInformation.PingReply
PR = myPing.Send("192.168.0.78")
If PR.Status = IPStatus.Success Then
ListBox1.Items.Add("Reply from " & PR.Address.ToString & ": BYTES=" & PR.Buffer.Length & " TIME<" & PR.RoundtripTime & "ms TTL=" & PR.Options.Ttl)
Else
ListBox1.Items.Add(PR.Status.ToString)
End If
My.Application.DoEvents()
System.Threading.Thread.Sleep(500)
Next
End Sub
End Class