/*++ Copyright (c) 1994-1998 Microsoft Corporation Module Name: kill.c Abstract: This module implements a task killer application. Author: Wesley Witt (wesw) 20-May-1994 Environment: User Mode --*/ #include "pch.h" #pragma hdrstop BOOL ForceKill; struct _arg { DWORD pid; CHAR *pname; } Arguments[ 64 ]; DWORD NumberOfArguments; TASK_LIST tlist[MAX_TASKS]; VOID GetCommandLineArgs(VOID); VOID Usage(VOID); int __cdecl main( int argc, char *argv[] ) { DWORD i, j; DWORD numTasks; TASK_LIST_ENUM te; int rval = 0; char tname[PROCESS_SIZE]; LPSTR p; DWORD ThisPid; GetCommandLineArgs(); if (NumberOfArguments == 0) { printf( "missing pid or task name\n" ); return 1; } // // lets be god // EnableDebugPriv(); // // get the task list for the system // numTasks = GetTaskList( tlist, MAX_TASKS ); // // enumerate all windows and try to get the window // titles for each task // te.tlist = tlist; te.numtasks = numTasks; GetWindowTitles( &te ); ThisPid = GetCurrentProcessId(); for (i=0; i | >*\n\n" ); fprintf( stderr, " [options]:\n" ); fprintf( stderr, " -f Force process kill\n\n" ); fprintf( stderr, " \n" ); fprintf( stderr, " This is the process id for the task\n" ); fprintf( stderr, " to be killed. Use TLIST to get a\n" ); fprintf( stderr, " valid pid\n\n" ); fprintf( stderr, " \n" ); fprintf( stderr, " The pattern can be a complete task\n" ); fprintf( stderr, " name or a regular expression pattern\n" ); fprintf( stderr, " to use as a match. Kill matches the\n" ); fprintf( stderr, " supplied pattern against the task names\n" ); fprintf( stderr, " and the window titles.\n" ); ExitProcess(0); }