#include "precomp.h"
#include <process.h>
Go to the source code of this file.
|
VOID | ShowError (DWORD dwLastError) |
|
static VOID | ResetProgressDialog (HWND hDlg, LPWSTR ServiceName, ULONG LabelId) |
|
unsigned int __stdcall | ActionThread (void *Param) |
|
static BOOL | InitProgressDialog (HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) |
|
INT_PTR CALLBACK | ProgressDialogProc (HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam) |
|
VOID | CompleteProgressBar (HANDLE hProgress) |
|
VOID | IncrementProgressBar (HANDLE hProgress, UINT Step) |
|
BOOL | RunActionWithProgress (HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param) |
|
◆ PROGRESS_RANGE
◆ PROGRESS_STEP_MAX
◆ PPROGRESS_DATA
◆ PROGRESS_DATA
◆ ActionThread()
Definition at line 86 of file progress.c.
87{
90
92 {
93
97
98
101 ProgressData->
Param);
103 {
104
106 }
107 else
108 {
110 }
111 }
113 {
114
116 {
118
119
120 for (;;)
121 {
122
123 if (*lpStr ==
L'\0' && *(lpStr + 1) ==
L'\0')
124 break;
125
126
127
129 lpStr++;
130
132 lpStr,
134
135
139 {
141 }
142 else
143 {
145 }
146
147
148 while (*lpStr !=
L'\0')
149 lpStr++;
150 }
151 }
152
156
160 {
162 }
163 else
164 {
166 }
167
168
169
171 {
172
176
177
182 {
183
185 }
186 else
187 {
189 }
190 }
191 }
193 {
194
198
199
204 {
205
207 }
208 else
209 {
211 }
212 }
214 {
215
219
220
225 {
226
228 }
229 else
230 {
232 }
233 }
234
235
237
239 return 0;
240}
DWORD DoControlService(LPWSTR ServiceName, HWND hProgress, DWORD Control)
DWORD DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams)
DWORD DoStopService(LPWSTR ServiceName, HANDLE hProgress)
struct _PROGRESS_DATA * PPROGRESS_DATA
static VOID ResetProgressDialog(HWND hDlg, LPWSTR ServiceName, ULONG LabelId)
VOID ShowError(DWORD dwLastError)
VOID CompleteProgressBar(HANDLE hProgress)
#define IDS_PROGRESS_INFO_STOP
#define IDS_PROGRESS_INFO_START
#define IDS_PROGRESS_INFO_PAUSE
#define IDS_PROGRESS_INFO_RESUME
_CRTIMP void __cdecl _endthreadex(_In_ unsigned _Retval)
#define SERVICE_CONTROL_CONTINUE
#define SERVICE_CONTROL_PAUSE
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
Referenced by InitProgressDialog().
◆ CompleteProgressBar()
Definition at line 311 of file progress.c.
312{
315
316
319 0,
320 0);
321
322
324 {
325
329 0);
330
331
334 }
335}
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Referenced by ActionThread().
◆ IncrementProgressBar()
◆ InitProgressDialog()
Definition at line 243 of file progress.c.
247{
250
251 ProgressData->
hDlg = hDlg;
252
253
258
259
262 0,
264
265
269 0);
270
271
274
276
278}
unsigned int __stdcall ActionThread(void *Param)
#define IDC_SERVCON_PROGRESS
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
Referenced by ProgressDialogProc().
◆ ProgressDialogProc()
Definition at line 281 of file progress.c.
285{
287 {
289 {
291 }
292
295 {
298 break;
299
300 }
301 break;
302
303 default:
305 }
306
308}
static BOOL InitProgressDialog(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
static const WCHAR Message[]
Referenced by RunActionWithProgress().
◆ ResetProgressDialog()
Definition at line 50 of file progress.c.
53{
55
56
59 LabelId))
60 {
61
65 0,
67
69 }
70
71
75 0,
77
78
82 0,
83 0);
84}
INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
static WCHAR ServiceName[]
HLOCAL NTAPI LocalFree(HLOCAL hMem)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Referenced by ActionThread().
◆ RunActionWithProgress()
Definition at line 372 of file progress.c.
377{
382
385
386
387
389 {
390
392 if (ServiceList)
393 {
394
397 DisplayName,
398 ServiceList);
399
400
401 if (StopDepends ==
FALSE)
402 {
405 }
406 }
407 }
408
414 ProgressData.
Param = Param;
415
418 hParent,
421
422 if (ServiceList)
424
426}
LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName)
BOOL CreateStopDependsDialog(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, LPWSTR ServiceList)
INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
#define HeapFree(x, y, z)
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
#define MAKEINTRESOURCEW(i)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
_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
Referenced by GeneralPageProc(), and MainWndCommand().
◆ ShowError()
Definition at line 29 of file progress.c.
30{
32
37 dwLastError,
41 {
42 return;
43 }
44
47}
#define LANG_USER_DEFAULT
#define FORMAT_MESSAGE_IGNORE_INSERTS
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
Referenced by ActionThread(), DoLoadImageFile(), CMainWindow::OnCommand(), and SaveDIBToFile().