Add information letting us know creation deletion of services has worked.
[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 #ifdef SCDBG
19 /* testing */
20 printf("service to delete - %s\n\n", ServiceName);
21 #endif
22
23 hSc = OpenService(hSCManager, ServiceName, DELETE);
24
25 if (hSc == NULL)
26 {
27 _tprintf(_T("openService failed\n"));
28 ReportLastError();
29 return FALSE;
30 }
31
32 if (! DeleteService(hSc))
33 {
34 _tprintf(_T("DeleteService failed\n"));
35 ReportLastError();
36 return FALSE;
37 }
38
39 _tprintf(_T("[SC] DeleteService SUCCESS\n"));
40 CloseServiceHandle(hSc);
41 return TRUE;
42 }