Dec 27, 2010 05:07 AM
(This post was last modified: Dec 27, 2010 05:19 AM by pr0t0typ3.)
- Don't flame I know that I posted some code with a similar point some days ago.
- I found this when I did some research about undocumented Functions in the ntdll Library
- It is shorter then the other code.
- Enjoy, give Credits and don't leech.
Code
Module NTSuspendProcess
#Region "APIs"
<DllImport("ntdll.dll")> _
Private Function NtSuspendProcess(ByVal hHandle As IntPtr) As Boolean
End Function
<DllImport("ntdll.dll")> _
Private Function NtResumeProcess(ByVal hHandle As IntPtr) As Boolean
End Function
#End Region
Public Function SuspendProcess(ByVal ID As Integer) As Boolean
Try
Dim p As Process = Process.GetProcessById(ID)
Return NtSuspendProcess(p.Handle)
Catch ex As Exception
Return False
End Try
End Function
Public Function ResumeProcess(ByVal ID As Integer) As Boolean
Try
Dim p As Process = Process.GetProcessById(ID)
Return NtResumeProcess(p.Handle)
Catch ex As Exception
Return False
End Try
End Function
End Module
