mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
[FORMATTING][KILL] kill.c: reformat it
This commit is contained in:
parent
352b7f6785
commit
56baf8e2e8
1 changed files with 35 additions and 36 deletions
|
@ -28,51 +28,50 @@
|
||||||
* from the old shell.exe
|
* from the old shell.exe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
|
#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecuteKill(char * lpPid)
|
ExecuteKill(char *lpPid)
|
||||||
{
|
{
|
||||||
HANDLE hProcess;
|
HANDLE hProcess;
|
||||||
DWORD dwProcessId;
|
DWORD dwProcessId;
|
||||||
|
|
||||||
dwProcessId = (DWORD) atol(lpPid);
|
dwProcessId = (DWORD)atol(lpPid);
|
||||||
fprintf( stderr, "Killing PID %ld...\n",dwProcessId);
|
fprintf(stderr, "Killing PID %ld...\n", dwProcessId);
|
||||||
hProcess = OpenProcess(
|
|
||||||
PROCESS_TERMINATE,
|
hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, dwProcessId);
|
||||||
FALSE,
|
if (hProcess == NULL)
|
||||||
dwProcessId
|
{
|
||||||
);
|
fprintf(stderr, "Could not open the process with PID = %ld\n", dwProcessId);
|
||||||
if (NULL == hProcess)
|
return 0;
|
||||||
{
|
}
|
||||||
fprintf( stderr, "Could not open the process with PID = %ld\n", dwProcessId);
|
|
||||||
return 0;
|
if (!TerminateProcess(hProcess, 0))
|
||||||
}
|
{
|
||||||
if (FALSE == TerminateProcess(
|
fprintf(stderr, "Could not terminate the process with PID = %ld\n", dwProcessId);
|
||||||
hProcess,
|
return 0;
|
||||||
0
|
}
|
||||||
)
|
|
||||||
) {
|
CloseHandle(hProcess);
|
||||||
fprintf( stderr, "Could not terminate the process with PID = %ld\n", dwProcessId);
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CloseHandle(hProcess);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char tail;
|
char tail;
|
||||||
DBG_UNREFERENCED_LOCAL_VARIABLE(tail);
|
DBG_UNREFERENCED_LOCAL_VARIABLE(tail);
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Usage: %s PID (Process ID) \n", argv[0] );
|
fprintf(stderr, "Usage: %s PID (Process ID) \n", argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
tail = ExecuteKill(argv[1]);
|
|
||||||
return 0;
|
tail = ExecuteKill(argv[1]);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue