ReactOS 0.4.16-dev-297-gc569aee
cmdContinue.c File Reference
#include "net.h"
Include dependency graph for cmdContinue.c:

Go to the source code of this file.

Functions

INT cmdContinue (INT argc, WCHAR **argv)
 

Function Documentation

◆ cmdContinue()

INT cmdContinue ( INT  argc,
WCHAR **  argv 
)

Definition at line 12 of file cmdContinue.c.

13{
14 SC_HANDLE hManager = NULL;
15 SC_HANDLE hService = NULL;
17 INT nError = 0;
18 INT i;
19
20 if (argc != 3)
21 {
23 ConPuts(StdOut, L"\n");
24 PrintNetMessage(MSG_CONTINUE_SYNTAX);
25 return 1;
26 }
27
28 for (i = 2; i < argc; i++)
29 {
30 if (_wcsicmp(argv[i], L"/help") == 0)
31 {
33 ConPuts(StdOut, L"\n");
34 PrintNetMessage(MSG_CONTINUE_SYNTAX);
35 PrintNetMessage(MSG_CONTINUE_HELP);
36 return 1;
37 }
38 }
39
41 if (hManager == NULL)
42 {
43 ConPrintf(StdErr, L"[OpenSCManager] Error: %ld\n", GetLastError());
44 nError = 1;
45 goto done;
46 }
47
48 hService = OpenService(hManager, argv[2], SERVICE_PAUSE_CONTINUE);
49 if (hService == NULL)
50 {
51 ConPrintf(StdErr, L"[OpenService] Error: %ld\n", GetLastError());
52 nError = 1;
53 goto done;
54 }
55
57 {
58 ConPrintf(StdErr, L"[ControlService] Error: %ld\n", GetLastError());
59 nError = 1;
60 }
61
62done:
63 if (hService != NULL)
64 CloseServiceHandle(hService);
65
66 if (hManager != NULL)
67 CloseServiceHandle(hManager);
68
69 return nError;
70}
static int argc
Definition: ServiceArgs.c:12
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: fc.c:16
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition: fc.c:20
#define StdOut
Definition: fc.c:14
#define StdErr
Definition: fc.c:15
VOID PrintNetMessage(DWORD dwMessage)
Definition: main.c:239
VOID PrintMessageString(DWORD dwMessage)
Definition: main.c:120
#define NULL
Definition: types.h:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define argv
Definition: mplay32.c:18
#define L(x)
Definition: ntvdm.h:50
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:622
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Definition: ps.c:97
int32_t INT
Definition: typedefs.h:58
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define OpenSCManager
Definition: winsvc.h:575
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
#define SERVICES_ACTIVE_DATABASE
Definition: winsvc.h:564
#define SERVICE_PAUSE_CONTINUE
Definition: winsvc.h:59
#define SERVICE_CONTROL_CONTINUE
Definition: winsvc.h:38
#define OpenService
Definition: winsvc.h:576