Author: gedmurphy
Date: Wed Apr 8 18:14:16 2015
New Revision: 67099
URL:
http://svn.reactos.org/svn/reactos?rev=67099&view=rev
Log:
[SERVMAN]
- Allow params to be passed through the progress dialog
- PAss the start params
Modified:
trunk/reactos/base/applications/mscutils/servman/mainwnd.c
trunk/reactos/base/applications/mscutils/servman/precomp.h
trunk/reactos/base/applications/mscutils/servman/progress.c
trunk/reactos/base/applications/mscutils/servman/propsheet_general.c
Modified: trunk/reactos/base/applications/mscutils/servman/mainwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/mainwnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/mainwnd.c [iso-8859-1] Wed Apr 8
18:14:16 2015
@@ -475,7 +475,8 @@
RunActionWithProgress(Info->hMainWnd,
Info->pCurrentService->lpServiceName,
Info->pCurrentService->lpDisplayName,
- ACTION_START);
+ ACTION_START,
+ NULL); //FIXME: Add start params
UpdateServiceStatus(Info->pCurrentService);
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
@@ -489,7 +490,8 @@
RunActionWithProgress(Info->hMainWnd,
Info->pCurrentService->lpServiceName,
Info->pCurrentService->lpDisplayName,
- ACTION_STOP);
+ ACTION_STOP,
+ NULL);
UpdateServiceStatus(Info->pCurrentService);
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
@@ -502,7 +504,8 @@
RunActionWithProgress(Info->hMainWnd,
Info->pCurrentService->lpServiceName,
Info->pCurrentService->lpDisplayName,
- ACTION_PAUSE);
+ ACTION_PAUSE,
+ NULL);
UpdateServiceStatus(Info->pCurrentService);
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
@@ -514,7 +517,8 @@
RunActionWithProgress(Info->hMainWnd,
Info->pCurrentService->lpServiceName,
Info->pCurrentService->lpDisplayName,
- ACTION_RESUME);
+ ACTION_RESUME,
+ NULL);
UpdateServiceStatus(Info->pCurrentService);
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
@@ -526,7 +530,8 @@
RunActionWithProgress(Info->hMainWnd,
Info->pCurrentService->lpServiceName,
Info->pCurrentService->lpDisplayName,
- ACTION_RESTART);
+ ACTION_RESTART,
+ NULL);
UpdateServiceStatus(Info->pCurrentService);
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
Modified: trunk/reactos/base/applications/mscutils/servman/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/precomp.h [iso-8859-1] Wed Apr 8
18:14:16 2015
@@ -104,7 +104,7 @@
/* progress.c */
#define DEFAULT_STEP 0
-BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT
Action);
+BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT
Action, PVOID Param);
VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
VOID CompleteProgressBar(HANDLE hProgress);
Modified: trunk/reactos/base/applications/mscutils/servman/progress.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/progress.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/progress.c [iso-8859-1] Wed Apr 8
18:14:16 2015
@@ -20,6 +20,7 @@
ULONG Action;
BOOL StopDepends;
LPWSTR ServiceList;
+ PVOID Param;
} PROGRESS_DATA, *PPROGRESS_DATA;
@@ -75,7 +76,7 @@
/* Start the service */
if (DoStartService(ProgressData->ServiceName,
ProgressData->hProgress,
- NULL))
+ ProgressData->Param))
{
/* We're done, slide the progress bar up to the top */
CompleteProgressBar(ProgressData->hProgress);
@@ -322,7 +323,8 @@
RunActionWithProgress(HWND hParent,
LPWSTR ServiceName,
LPWSTR DisplayName,
- UINT Action)
+ UINT Action,
+ PVOID Param)
{
PROGRESS_DATA ProgressData;
LPWSTR ServiceList;
@@ -357,6 +359,7 @@
ProgressData.Action = Action;
ProgressData.StopDepends = StopDepends;
ProgressData.ServiceList = ServiceList;
+ ProgressData.Param = Param;
Result = DialogBoxParamW(hInstance,
MAKEINTRESOURCEW(IDD_DLG_PROGRESS),
Modified: trunk/reactos/base/applications/mscutils/servman/propsheet_general.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/propsheet_general.c [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/propsheet_general.c [iso-8859-1] Wed
Apr 8 18:14:16 2015
@@ -244,26 +244,6 @@
HeapFree(ProcessHeap,
0,
pServiceConfig);
- }
-}
-
-static
-VOID
-OnStart(HWND hwndDlg,
- PSERVICEPROPSHEET dlgInfo)
-{
- WCHAR szStartParams[256];
- LPWSTR lpStartParams = NULL;
-
- if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) > 0)
- lpStartParams = szStartParams;
-
- //if (DoStart(dlgInfo->Info, lpStartParams))
- {
- UpdateServiceStatus(dlgInfo->pService);
- ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS);
- SetButtonStates(dlgInfo, hwndDlg);
- SetServiceStatusText(dlgInfo, hwndDlg);
}
}
@@ -312,52 +292,64 @@
break;
case IDC_START:
+ {
+ WCHAR szStartParams[256];
+ LPWSTR lpStartParams = NULL;
+
+ if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) >
0)
+ lpStartParams = szStartParams;
+
RunActionWithProgress(hwndDlg,
dlgInfo->pService->lpServiceName,
dlgInfo->pService->lpDisplayName,
- ACTION_START);
+ ACTION_START,
+ lpStartParams);
UpdateServiceStatus(dlgInfo->pService);
ChangeListViewText(dlgInfo->Info, dlgInfo->pService,
LVSTATUS);
SetButtonStates(dlgInfo, hwndDlg);
SetServiceStatusText(dlgInfo, hwndDlg);
- break;
+ break;
+ }
case IDC_STOP:
RunActionWithProgress(hwndDlg,
dlgInfo->pService->lpServiceName,
dlgInfo->pService->lpDisplayName,
- ACTION_STOP);
+ ACTION_STOP,
+ NULL);
UpdateServiceStatus(dlgInfo->pService);
ChangeListViewText(dlgInfo->Info, dlgInfo->pService,
LVSTATUS);
SetButtonStates(dlgInfo, hwndDlg);
SetServiceStatusText(dlgInfo, hwndDlg);
- break;
+ break;
case IDC_PAUSE:
RunActionWithProgress(hwndDlg,
dlgInfo->pService->lpServiceName,
dlgInfo->pService->lpDisplayName,
- ACTION_PAUSE);
+ ACTION_PAUSE,
+ NULL);
UpdateServiceStatus(dlgInfo->pService);
ChangeListViewText(dlgInfo->Info, dlgInfo->pService,
LVSTATUS);
SetButtonStates(dlgInfo, hwndDlg);
SetServiceStatusText(dlgInfo, hwndDlg);
- break;
+ break;
case IDC_RESUME:
RunActionWithProgress(hwndDlg,
dlgInfo->pService->lpServiceName,
dlgInfo->pService->lpDisplayName,
- ACTION_RESUME);
+ ACTION_RESUME,
+ NULL);
UpdateServiceStatus(dlgInfo->pService);
ChangeListViewText(dlgInfo->Info, dlgInfo->pService,
LVSTATUS);
SetButtonStates(dlgInfo, hwndDlg);
SetServiceStatusText(dlgInfo, hwndDlg);
- break;
+ break;
case IDC_EDIT:
{
@@ -370,12 +362,12 @@
SendMessage(hName, EM_SETREADONLY, FALSE, 0);
SendMessage(hDesc, EM_SETREADONLY, FALSE, 0);
SendMessage(hExePath, EM_SETREADONLY, FALSE, 0);
+ break;
}
- break;
case IDC_START_PARAM:
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
- break;
+ break;
}
break;