Go to the source code of this file.
◆ cmdStart()
Definition at line 172 of file cmdStart.c.
173{
175
177 {
179 }
180
182 {
184 {
189 return 1;
190 }
191 }
192
194}
void ConPuts(FILE *fp, LPCWSTR psz)
VOID PrintNetMessage(DWORD dwMessage)
VOID PrintMessageString(DWORD dwMessage)
static INT StartOneService(INT argc, WCHAR **argv)
static INT EnumerateRunningServices(VOID)
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
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Referenced by CommandShell().
◆ EnumerateRunningServices()
static INT EnumerateRunningServices |
( |
VOID |
| ) |
|
|
static |
Definition at line 15 of file cmdStart.c.
16{
17 SC_HANDLE hManager =
NULL;
18 SC_HANDLE hService =
NULL;
19 DWORD dwBufferSize = 0;
21 DWORD dwResumeHandle = 0;
27
32 {
34 nError = 1;
35 goto done;
36 }
37
42 0,
43 &dwBufferSize,
44 &dwServiceCount,
45 &dwResumeHandle);
47 {
48
49 goto done;
50 }
53 goto done;
54
55 if (dwBufferSize != 0)
56 {
58 if (lpServiceBuffer !=
NULL)
59 {
63 lpServiceBuffer,
64 dwBufferSize,
65 &dwBufferSize,
66 &dwServiceCount,
67 &dwResumeHandle))
68 {
70
71 for (
i = 0;
i < dwServiceCount;
i++)
72 {
74 }
75 }
76
78 }
79 }
80
81done:
84
87
89 {
90
92 }
93
94 return nError;
95}
void ConPrintf(FILE *fp, LPCWSTR psz,...)
#define ERROR_INSUFFICIENT_BUFFER
#define HeapFree(x, y, z)
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
BOOL WINAPI EnumServicesStatusW(SC_HANDLE hSCManager, DWORD dwServiceType, DWORD dwServiceState, LPENUM_SERVICE_STATUSW lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle)
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
DWORD WINAPI GetLastError(void)
#define SC_MANAGER_ENUMERATE_SERVICE
#define SERVICES_ACTIVE_DATABASE
Referenced by cmdStart().
◆ StartOneService()
Definition at line 100 of file cmdStart.c.
101{
102 SC_HANDLE hManager =
NULL;
103 SC_HANDLE hService =
NULL;
108
112 if (hManager ==
NULL)
113 {
115 nError = 1;
116 goto done;
117 }
118
122 if (hService ==
NULL)
123 {
125 nError = 1;
126 goto done;
127 }
128
130 0,
132 if (lpArgVectors ==
NULL)
133 {
135 nError = 1;
136 goto done;
137 }
138
140 {
141 lpArgVectors[
i - 2] =
argv[
i];
142 }
143
146 lpArgVectors))
147 {
149 nError = 1;
150 }
151
152done:
153 if (lpArgVectors !=
NULL)
155
156 if (hService !=
NULL)
158
159 if (hManager !=
NULL)
161
163 {
164
166 }
167
168 return nError;
169}
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
Referenced by cmdStart().