21{
23 SC_HANDLE hService;
25 DWORD BytesNeeded = 0;
31
34 DWORD dwArgsCount = 0;
37
38 if (lpStartParams !=
NULL)
39 {
40
41 lpChar = lpStartParams;
42 while (*lpChar != 0)
43 {
45 {
47 }
48 else
49 {
50 if (bWhiteSpace !=
FALSE)
51 {
52 dwArgsCount++;
54 }
55 }
56
57 lpChar++;
58 }
59
60
61
62
63
65 if (!lpArgsVector)
67
68
69 dwArgsCount = 0;
71 lpChar = lpStartParams;
72 while (*lpChar != 0)
73 {
75 {
76 *lpChar = 0;
78 }
79 else
80 {
81 if (bWhiteSpace !=
FALSE)
82 {
83 lpArgsVector[dwArgsCount] = lpChar;
84 dwArgsCount++;
86 }
87 }
88
89 lpChar++;
90 }
91 }
92
97 {
99 if (lpArgsVector)
101 return dwResult;
102 }
103
107 if (!hService)
108 {
111 if (lpArgsVector)
113 return dwResult;
114 }
115
116
118 dwArgsCount,
119 lpArgsVector);
121 {
122
124 }
126 {
127 if (hProgress)
128 {
129
131 }
132
133
138 &BytesNeeded);
140 {
145
146
148 {
150
152
153 if (WaitTime < 1000) WaitTime = 1000;
154 else if (WaitTime > 10000) WaitTime = 10000;
155
156
157 for (
i = WaitTime / 1000;
i > 0;
i--)
158 {
160 if (hProgress)
161 {
162
164 }
165 }
166
167
168
173 &BytesNeeded))
174 {
175
177 DPRINT1(
"QueryServiceStatusEx failed: %d\n", dwResult);
178 break;
179 }
180
181
183 {
184
187 }
188 else
189 {
190
192 {
193
196 break;
197 }
198 }
199 }
200 }
201 else
202 {
204 }
205
207 {
209 }
210 }
211
214
215 if (lpArgsVector)
217
218 return dwResult;
219}
VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos)
static WCHAR ServiceName[]
static SERVICE_STATUS ServiceStatus
DWORD WINAPI GetTickCount(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
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define ERROR_SERVICE_ALREADY_RUNNING
#define ERROR_SERVICE_REQUEST_TIMEOUT
#define SERVICE_QUERY_STATUS
#define SC_MANAGER_CONNECT
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO