![]() ![]() Important: This function will only run on Windows XP, Windows 2003 and Windows Vista. ![]() If the development team is interested in adding this function i will happily write the standard UDF documentation for it. Sorry i didn't do a standard UDF writeup, didn't have time. You can call the function with the process name or PIDġ = 1 means that it failed because something errored when calling the = 2 means that it failed because the process was not found or is not running I think it would be a good idea to add these to the 3 include file. No more systeminternals 104kb PsSuspend.exe.įunc _ProcessSuspend ( $process ) $processid = ProcessExists ( $process ) If $processid Then $ai_Handle = DllCall ( "kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid ) $i_sucess = DllCall ( "ntdll.dll", "int", "NtSuspendProcess", "int", $ai_Handle ) DllCall ( 'kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle ) If IsArray ( $i_sucess ) Then Return 1 Else SetError ( 1 ) Return 0 Endif Else SetError ( 2 ) Return 0 Endif EndFunc Func _ProcessResume ( $process ) $processid = ProcessExists ( $process ) If $processid Then $ai_Handle = DllCall ( "kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid ) $i_sucess = DllCall ( "ntdll.dll", "int", "NtResumeProcess", "int", $ai_Handle ) DllCall ( 'kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle ) If IsArray ( $i_sucess ) Then Return 1 Else SetError ( 1 ) Return 0 Endif Else SetError ( 2 ) Return 0 Endif Development Team Here is a UDF to call the system API to suspend or resume a process. To save others time, here is a page with the NTAPI functions listed: ![]() :S You would think they would document functions that they took the time to write so that people could actually use them. Hours of Googling and i finally found a page that has the NTAPI functions listed. To my great distaste I could find absolutely nothing documenting the NTAPI functions, nothing at all. I finally found a process suspend NTAPI function NtSuspendProcess(). I found many thread suspend functions and other things, but not really any process suspend functions. Well, I was looking on the internet for ways to suspend processes and spent a great deal of time trying to find API commands to do this. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |