78{
82 SC_HANDLE ScHandle;
83 SC_HANDLE hService;
84 DWORD BytesNeeded = 0;
85 DWORD ResumeHandle = 0;
86 DWORD NumServices = 0;
87 DWORD dwHandle, dwLen;
93 TCHAR szStrFileInfo[80];
96
100
102 if (ScHandle !=
NULL)
103 {
105 {
106
108 {
109
111 if (!pServiceStatus)
112 {
114 return;
115 }
116
117
119 {
122 return;
123 }
124 }
125 else
126 {
128 return;
129 }
130 }
131
132 if (NumServices)
133 {
134 if (!pServiceStatus)
135 {
137 return;
138 }
139
141 {
145 item.pszText = pServiceStatus[
Index].lpDisplayName;
149
151 {
153 }
154
155 BytesNeeded = 0;
157 if (hService !=
NULL)
158 {
159
161 {
163 {
165 if (pServiceFailureActions ==
NULL)
166 {
170 return;
171 }
172
174 {
179 return;
180 }
181 }
182 else
183 {
187 return;
188 }
189 }
190
191 if (pServiceFailureActions !=
NULL)
192 {
193 if (pServiceFailureActions->cActions && pServiceFailureActions->lpsaActions[0].Type ==
SC_ACTION_REBOOT)
194 {
196 item.pszText = szStatus;
199 }
201 pServiceFailureActions =
NULL;
202 }
203
204
205 BytesNeeded = 0;
207 {
209 {
211 if (pServiceConfig ==
NULL)
212 {
216 return;
217 }
219 {
224 return;
225 }
226 }
227 else
228 {
232 return;
233 }
234 }
235
237 {
238
239
240
245 }
246 else
247 {
248
253 }
254
256 pServiceConfig =
NULL;
257
259 if (dwLen)
260 {
263 {
267 return;
268 }
270 {
275 return;
276 }
277
279 {
282 wsprintf(szStrFileInfo,
_T(
"StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID);
283 }
284
286 {
290 }
292 }
293 else
294 {
296 item.pszText = szStatus;
299 }
301 }
302
304 item.pszText = szStatus;
307
308 }
309 }
310
313 }
314
315}
#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