BOOL KillProcess(pid, exitcode) DWORD pid unsigned int exitcode CODE: { HANDLE ph = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); if (ph) { RETVAL = TerminateProcess(ph, exitcode); if (RETVAL) CloseHandle(ph); } } OUTPUT: RETVAL #### $^E= 0; Win32::Process::KillProcess( $pid, 1 ); my $err= $^E; die "Failed to kill process, $pid: $err\n" if $err;