- Split files
[reactos.git] / reactos / subsys / system / sc / delete.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS SC utility
4 * FILE: subsys/system/sc/delete.c
5 * PURPOSE: control ReactOS services
6 * PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com)
7 * REVISIONS:
8 * Ged Murphy 20/10/05 Created
9 *
10 */
11
12 #include "sc.h"
13
14 BOOL Delete(TCHAR **Args)
15 {
16 SC_HANDLE hSc;
17 LPCTSTR ServiceName = *Args;
18
19 /* testing */
20 printf("service to delete - %s\n\n", ServiceName);
21
22 hSc = OpenService(hSCManager, ServiceName, DELETE);
23
24 if (hSc == NULL)
25 {
26 _tprintf(_T("openService failed\n"));
27 ReportLastError();
28 return FALSE;
29 }
30
31 if (! DeleteService(hSc))
32 {
33 _tprintf(_T("DeleteService failed\n"));
34 ReportLastError();
35 return FALSE;
36 }
37
38 CloseServiceHandle(hSc);
39 return TRUE;
40 }