home *** CD-ROM | disk | FTP | other *** search
- /* WarpOS tool program which lets a task (specified by task ID) crash
- Useful to interrupt tasks which are caught in endless loops
-
-
- 27.3.1998 by Sam Jordan */
-
- #include <stdio.h>
- #include <exec/libraries.h>
- #include <dos/rdargs.h>
- #include <utility/tagitem.h>
- #include <powerpc/tasksppc.h>
- #include <clib/dos_protos.h>
- #include <clib/powerpc_protos.h>
-
- extern struct Library* PowerPCBase;
- struct TaskPPC* taskptr;
- char template[] = "TASKID/N/A";
- int* array;
- int lock;
- struct RDArgs* result;
- struct TaskPtr* ptr;
-
- void main(void)
- {
- if (PowerPCBase->lib_Version < 14)
- {
- printf("Error: powerpc.library V14+ required");
- return;
- }
- if ((result = ReadArgs(template,(LONG *)&array,NULL)) == NULL)
- {
- printf("PPC task interruption utility. Please specify a task ID.\n");
- return;
- }
- if (array)
- {
- taskptr = FindTaskByID(*array);
- if (taskptr != NULL)
- {
- printf("Interrupting task '%s' (ID=%ld)\n",taskptr->tp_Task.tc_Node.ln_Name,taskptr->tp_Id);
- ptr = LockTaskList();
- taskptr->tp_Flags |= TASKPPCF_THROW;
- UnLockTaskList(ptr);
- }
- }
- FreeArgs(result);
- }
-