0a831d97caa7db536f8a734b9cd12e5d6a3cc63d
[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(LPCTSTR ServiceName)
15 {
16 SC_HANDLE hSc;
17
18 /* testing */
19 printf("service to delete - %s\n\n", ServiceName);
20
21 hSc = OpenService(hSCManager, ServiceName, DELETE);
22
23 if (hSc == NULL)
24 {
25 _tprintf(_T("openService failed\n"));
26 ReportLastError();
27 return FALSE;
28 }
29
30 if (! DeleteService(hSc))
31 {
32 _tprintf(_T("DeleteService failed\n"));
33 ReportLastError();
34 return FALSE;
35 }
36
37 CloseServiceHandle(hSc);
38 return TRUE;
39 }