ReactOS 0.4.15-dev-8241-g63935f8
delete.c File Reference
#include "sc.h"
Include dependency graph for delete.c:

Go to the source code of this file.

Functions

BOOL Delete (LPCTSTR ServiceName)
 

Function Documentation

◆ Delete()

BOOL Delete ( LPCTSTR  ServiceName)

Definition at line 12 of file delete.c.

13{
14 SC_HANDLE hSCManager = NULL;
15 SC_HANDLE hSc = NULL;
16 BOOL bRet = TRUE;
17
18#ifdef SCDBG
19 _tprintf(_T("service to delete - %s\n\n"), ServiceName);
20#endif
21
23 NULL,
25 if (hSCManager == NULL)
26 {
27 _tprintf(_T("[SC] OpenSCManager FAILED %lu:\n\n"), GetLastError());
28 bRet = FALSE;
29 goto done;
30 }
31
33 if (hSc == NULL)
34 {
35 _tprintf(_T("[SC] OpenService FAILED %lu:\n\n"), GetLastError());
36 bRet = FALSE;
37 goto done;
38 }
39
40 if (!DeleteService(hSc))
41 {
42 _tprintf(_T("[SC] DeleteService FAILED %lu:\n\n"), GetLastError());
43 bRet = FALSE;
44 goto done;
45 }
46
47 _tprintf(_T("[SC] DeleteService SUCCESS\n\n"));
48
49done:
50 if (bRet == FALSE)
52
53 if (hSc)
55
56 if (hSCManager)
58
59 return bRet;
60}
static WCHAR ServiceName[]
Definition: browser.c:19
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _tprintf
Definition: tchar.h:506
DWORD ReportLastError(void)
Definition: loadlib.c:67
#define DELETE
Definition: nt_native.h:57
SC_HANDLE hSCManager
Definition: sc.c:12
BOOL WINAPI DeleteService(SC_HANDLE hService)
Definition: scm.c:921
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
#define _T(x)
Definition: vfdio.h:22
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define OpenSCManager
Definition: winsvc.h:575
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
#define OpenService
Definition: winsvc.h:576

Referenced by _CcpFlushCache(), cmdUse(), DECLARE_INTERFACE_(), PropertySetStorage_Delete(), RawCheckForDismount(), registry_callback(), ScControl(), test_SHPropStg_functions(), UDFCleanUpFcbChain(), UDFSetDispositionInformation(), UpdateRegistry(), and VfatCheckForDismount().