97{
101 SC_HANDLE ScHandle;
102 SC_HANDLE hService;
103 DWORD BytesNeeded = 0;
104 DWORD ResumeHandle = 0;
105 DWORD NumServices = 0;
106 DWORD dwHandle, dwLen;
112 TCHAR szStrFileInfo[80];
115
119
121 if (ScHandle !=
NULL)
122 {
124 {
125
127 {
128
130 if (!pServiceStatus)
131 {
133 return;
134 }
135
136
138 {
141 return;
142 }
143 }
144 else
145 {
147 return;
148 }
149 }
150
151 if (NumServices)
152 {
153 if (!pServiceStatus)
154 {
156 return;
157 }
158
160 {
164 item.pszText = pServiceStatus[
Index].lpDisplayName;
168
170 {
172 }
173
174 BytesNeeded = 0;
176 if (hService !=
NULL)
177 {
178
180 {
182 {
184 if (pServiceFailureActions ==
NULL)
185 {
189 return;
190 }
191
193 {
198 return;
199 }
200 }
201 else
202 {
206 return;
207 }
208 }
209
210 if (pServiceFailureActions !=
NULL)
211 {
212 if (pServiceFailureActions->cActions && pServiceFailureActions->lpsaActions[0].Type ==
SC_ACTION_REBOOT)
213 {
215 item.pszText = szStatus;
218 }
220 pServiceFailureActions =
NULL;
221 }
222
223
224 BytesNeeded = 0;
226 {
228 {
230 if (pServiceConfig ==
NULL)
231 {
235 return;
236 }
238 {
243 return;
244 }
245 }
246 else
247 {
251 return;
252 }
253 }
254
256 {
257
258
259
264 }
265 else
266 {
267
272 }
273
275 pServiceConfig =
NULL;
276
278 if (dwLen)
279 {
282 {
286 return;
287 }
289 {
294 return;
295 }
296
298 {
301 wsprintf(szStrFileInfo,
_T(
"StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID);
302 }
303
305 {
309 }
311 }
312 else
313 {
315 item.pszText = szStatus;
318 }
320 }
321
323 item.pszText = szStatus;
326
327 }
328 }
329
332 }
333
334}
#define IDS_SERVICES_UNKNOWN
#define IDS_SERVICES_STATUS_STOPPED
#define IDS_SERVICES_STATUS_RUNNING
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define ERROR_INSUFFICIENT_BUFFER
#define HeapFree(x, y, z)
#define ListView_InsertItem(hwnd, pitem)
#define ListView_SetCheckState(hwndLV, i, fCheck)
#define ListView_GetItemCount(hwnd)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
_In_ WDFCOLLECTION _In_ ULONG Index
DWORD WINAPI GetLastError(void)
_In_ ULONG _In_opt_ PVOID pvData
#define SERVICE_STATE_ALL
#define QueryServiceConfig
#define SC_MANAGER_ENUMERATE_SERVICE
#define SC_MANAGER_CONNECT
#define EnumServicesStatusEx
#define SERVICE_CONFIG_FAILURE_ACTIONS
#define QueryServiceConfig2
#define GetFileVersionInfo
#define GetFileVersionInfoSize