#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
◆ WIN32_LEAN_AND_MEAN
◆ ExecuteKill()
Definition at line 38 of file kill.c.
39{
42
44 fprintf(
stderr,
"Killing the process with PID %lu...\n", dwProcessId);
45
48 {
49 fprintf(
stderr,
"Could not open the process with PID %lu\n", dwProcessId);
50 return 1;
51 }
52
54 {
55 fprintf(
stderr,
"Could not terminate the process with PID %lu\n", dwProcessId);
57 return 1;
58 }
59
61 return 0;
62}
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define PROCESS_TERMINATE
_In_ BOOL _In_ HANDLE hProcess
Referenced by main().
◆ main()
Definition at line 65 of file kill.c.
66{
68 {
70 return 1;
71 }
72
74}
int ExecuteKill(const char *lpPid)