--- os2sdk/demos/examples/kill/kill.c 2018/08/09 12:25:13 1.1 +++ os2sdk/demos/examples/kill/kill.c 2018/08/09 12:26:11 1.1.1.2 @@ -1,7 +1,7 @@ /* - * Example of DOSKILLPROCESS usage. + * Example of DosKillProcess usage. * - * With DOSKILLPROCESS, any process can kill any other. While this is a + * With DosKillProcess, any process can kill any other. While this is a * powerful and versatile ability, problems can be created if a process * kills, say, the session manager or a copy of CMD. * @@ -9,13 +9,13 @@ * when a process is killed. If the process owned any RAM semaphores * when it was killed, the semaphores will not be automatically freed. * This sometimes makes it dangerous to kill a process without knowing - * what state the intended victim is in. DOSKILLPROCESS is best thought + * what state the intended victim is in. DosKillProcess is best thought * of, then, as a last ditch effort to get rid of an unwieldy process. * - * DOSKILLPROCESS does not actually kill the process but instead sends + * DosKillProcess does not actually kill the process but instead sends * it a termination signal. It is possible for processes to protect * themselves against such signals, and once the target is in EXITLIST - * processing, further calls to DOSKILLPROCESS have no effect + * processing, further calls to DosKillProcess have no effect * whatsoever. * * Invoke as "kill pid", where pid is the process id to receive the @@ -28,25 +28,28 @@ * * Compile as: cl -AL -Lp -G2 kill.c * - * Copyright (C) Microsoft Corp. 1986 + * Created by Microsoft Corp. 1986 */ +#define INCL_DOSPROCESS + +#include +#include #include -#include main(argc, argv) int argc; char *argv[]; { - unsigned pid; - unsigned kill_opt = 1; + PID pid; + USHORT kill_opt = 1; /* get the process to kill from the command line */ if(argc == 2) { pid = atoi(argv[1]); /* kill the process, but not its child processes */ - if(DOSKILLPROCESS(kill_opt, pid) != 0) + if(DosKillProcess(kill_opt, pid) != 0) printf("Unable to kill process %u\n", pid); } }