Author: gedmurphy
Date: Tue Aug 28 23:54:25 2007
New Revision: 28630
URL:
http://svn.reactos.org/svn/reactos?rev=28630&view=rev
Log:
- improve the start code
- add an edit button on the properties dialog to give admins the option to modify the
service config
Modified:
trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc
trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc
trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc
trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc
trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc
trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc
trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc
trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc
trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc
trunk/reactos/base/applications/mscutils/servman/mainwnd.c
trunk/reactos/base/applications/mscutils/servman/precomp.h
trunk/reactos/base/applications/mscutils/servman/propsheet.c
trunk/reactos/base/applications/mscutils/servman/query.c
trunk/reactos/base/applications/mscutils/servman/resource.h
trunk/reactos/base/applications/mscutils/servman/start.c
Modified: trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc Tue Aug 28 23:54:25
2007
@@ -74,7 +74,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "Îáùî"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -100,6 +100,7 @@
LTEXT "Ìîæåòå äà çàäàäåòå ïóñêîâè óêàçàíèÿ, êîèòî äà ñå ïðèëîæàò ïðè ïóñêàíå íà
óñëóãàòà îò òóê.",IDC_STATIC, 6,177,240,15
LTEXT "Ïóñêîâè óêàçàòåëè:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc Tue Aug 28 23:54:25
2007
@@ -74,7 +74,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "Allgemein"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -98,6 +98,7 @@
LTEXT "Sie können die Startparameter angeben, die übernommen werden sollen, wenn
der Dienst von hier aus gestartet wird.",IDC_STATIC, 6,177,240,20
LTEXT "Startparameter:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc Tue Aug 28 23:54:25
2007
@@ -74,7 +74,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6, 6, 253, 232
CAPTION "General"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -98,6 +98,7 @@
LTEXT "You can specify the start parameters that apply when you start the service
from here.",IDC_STATIC, 6,177,240,15
LTEXT "Start parameters:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc Tue Aug 28 23:54:25
2007
@@ -75,7 +75,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "Général"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -99,6 +99,7 @@
LTEXT "Vous pouvez définir les paramètres passés au service lorsque vous le
démarrez.",IDC_STATIC, 6,177,240,15
LTEXT "Paramètres:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc Tue Aug 28 23:54:25
2007
@@ -74,7 +74,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "Umum"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -98,6 +98,7 @@
LTEXT "Anda menetapkan parameter mulai yang diterapkan ketika anda memulai layanan
dari sini.",IDC_STATIC, 6,177,240,15
LTEXT "Parameter Mulai:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc Tue Aug 28 23:54:25
2007
@@ -74,7 +74,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "General"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -98,6 +98,7 @@
LTEXT "Puoi indicarei parametri in uso quando il servizio è avviato da
qui.",IDC_STATIC, 6,177,240,15
LTEXT "Parametri di avvio:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc Tue Aug 28 23:54:25
2007
@@ -81,7 +81,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "Ogólny"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -105,6 +105,7 @@
LTEXT "Mo¿esz okreli parametry pocz¹tkowe, które bêd¹ u¿yte przy uruchomieniu
us³ugi z tego miejsca.",IDC_STATIC, 6,177,240,15
LTEXT "Parametry uruchomienia:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc Tue Aug 28 23:54:25
2007
@@ -73,7 +73,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "Îáùèå"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -97,6 +97,7 @@
LTEXT "Ìîæíî óêàçàòü ïàðàìåòðû çàïóñêà, ïðèìåíÿåìûå ïðè çàïóñêå ñëóæáû èç ýòîãî
êàòàëîãà.",IDC_STATIC, 6,177,240,15
LTEXT "Ïàðàìåòðû çàïóñêà:", IDC_STATIC, 6, 200, 73, 11
EDITTEXT IDC_START_PARAM, 78, 199, 168, 11, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
Modified: trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc Tue Aug 28 23:54:25
2007
@@ -83,7 +83,7 @@
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
END
-IDD_DLG_GENERAL DIALOGEX 6,6,253,225
+IDD_DLG_GENERAL DIALOGEX 6,6,253,232
CAPTION "·ÑèÇä»"
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME | WS_GROUP |
WS_TABSTOP
@@ -107,6 +107,7 @@
LTEXT "¤Ø³ÊÒÁÒö¡Ó˹´¤èÒµÑÇá»ÃµèÒ§æ㹵͹àÃÔèÁµé¹¡ÒÃãªé§Ò¹
àÁ×èͤسàÃÔèÁãËéºÃÔ¡Ò÷ÕèµÃ§¹Õé.",IDC_STATIC, 6,177,240,15
LTEXT "àÃÔèÁµé¹¤èÒµÑÇá»ÃµèÒ§æ:", IDC_STATIC, 6, 200, 58, 11
EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "Edit", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED
END
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
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 (original)
+++ trunk/reactos/base/applications/mscutils/servman/mainwnd.c Tue Aug 28 23:54:25 2007
@@ -122,7 +122,7 @@
{
SendMessage(Info->hStatus,
SB_SIMPLE,
- (WPARAM)Info->InMenuLoop,
+ (WPARAM)Info->bInMenuLoop,
0);
}
}
@@ -623,6 +623,8 @@
MAKEINTRESOURCE(IDR_POPUP));
Info->hShortcutMenu = GetSubMenu(Info->hShortcutMenu,
0);
+
+ Info->bIsUserAnAdmin = IsUserAnAdmin();
return TRUE;
}
@@ -1055,14 +1057,14 @@
case WM_ENTERMENULOOP:
{
- Info->InMenuLoop = TRUE;
+ Info->bInMenuLoop = TRUE;
UpdateMainStatusBar(Info);
break;
}
case WM_EXITMENULOOP:
{
- Info->InMenuLoop = FALSE;
+ Info->bInMenuLoop = FALSE;
UpdateMainStatusBar(Info);
break;
}
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 (original)
+++ trunk/reactos/base/applications/mscutils/servman/precomp.h Tue Aug 28 23:54:25 2007
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <tchar.h>
#include <commctrl.h>
+#include <shlobj.h>
#include "resource.h"
#ifdef _MSC_VER
@@ -30,7 +31,8 @@
INT SelectedItem;/* selection number in the list view */
BOOL bDlgOpen;
- BOOL InMenuLoop;
+ BOOL bInMenuLoop;
+ BOOL bIsUserAnAdmin;
} MAIN_WND_INFO, *PMAIN_WND_INFO;
@@ -72,6 +74,7 @@
/* query.c */
ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPTSTR lpServiceName);
+VOID SetServiceConfig(LPQUERY_SERVICE_CONFIG);
LPTSTR GetServiceDescription(LPTSTR lpServiceName);
LPTSTR GetExecutablePath(LPTSTR lpServiceName);
BOOL RefreshServiceList(PMAIN_WND_INFO Info);
Modified: trunk/reactos/base/applications/mscutils/servman/propsheet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/propsheet.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/propsheet.c Tue Aug 28 23:54:25 2007
@@ -190,7 +190,39 @@
0,
(LPARAM)szServiceStatus);
}
-}
+
+ if (dlgInfo->Info->bIsUserAnAdmin)
+ {
+ HWND hEdit = GetDlgItem(hwndDlg,
+ IDC_EDIT);
+ EnableWindow(hEdit,
+ TRUE);
+ }
+}
+
+
+SaveDlgInfo(PSERVICEPROPSHEET dlgInfo,
+ HWND hwndDlg)
+{
+ LPQUERY_SERVICE_CONFIG pServiceConfig = NULL;
+ HWND hList;
+ DWORD StartUp;
+
+ hList = GetDlgItem(hwndDlg, IDC_START_TYPE);
+
+ StartUp = SendMessage(hList,
+ CB_GETCURSEL,
+ 0,
+ 0);
+
+ switch (StartUp)
+ {
+ case 0: pServiceConfig->dwStartType = SERVICE_AUTO_START; break;
+ case 1: pServiceConfig->dwStartType = SERVICE_DEMAND_START; break;
+ case 2: pServiceConfig->dwStartType = SERVICE_DISABLED; break;
+ }
+}
+
/*
@@ -258,14 +290,25 @@
//SendMessage(Info->hMainWnd, WM_COMMAND, ID_RESUME, 0);
break;
+ case IDC_EDIT:
+ {
+ HWND hName, hDesc, hExePath;
+
+ hName = GetDlgItem(hwndDlg, IDC_DISP_NAME);
+ hDesc = GetDlgItem(hwndDlg, IDC_DESCRIPTION);
+ hExePath = GetDlgItem(hwndDlg, IDC_EXEPATH);
+
+ SendMessage(hName, EM_SETREADONLY, FALSE, 0);
+ SendMessage(hDesc, EM_SETREADONLY, FALSE, 0);
+ SendMessage(hExePath, EM_SETREADONLY, FALSE, 0);
+ }
+ break;
+
case IDC_START_PARAM:
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
break;
}
break;
-
- case WM_DESTROY:
- break;
case WM_NOTIFY:
{
@@ -296,13 +339,13 @@
WPARAM wParam,
LPARAM lParam)
{
- PMAIN_WND_INFO Info;
+ PSERVICEPROPSHEET dlgInfo;
/* Get the window context */
- Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwndDlg,
- GWLP_USERDATA);
-
- if (Info == NULL && uMsg != WM_INITDIALOG)
+ dlgInfo = (PSERVICEPROPSHEET)GetWindowLongPtr(hwndDlg,
+ GWLP_USERDATA);
+
+ if (dlgInfo == NULL && uMsg != WM_INITDIALOG)
{
return FALSE;
}
@@ -311,12 +354,12 @@
{
case WM_INITDIALOG:
{
- Info = (PMAIN_WND_INFO)(((LPPROPSHEETPAGE)lParam)->lParam);
- if (Info != NULL)
+ dlgInfo = (PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam);
+ if (dlgInfo != NULL)
{
SetWindowLongPtr(hwndDlg,
GWLP_USERDATA,
- (LONG_PTR)Info);
+ (LONG_PTR)dlgInfo);
}
}
break;
@@ -324,21 +367,6 @@
case WM_COMMAND:
switch(LOWORD(wParam))
{
-
- }
- break;
-
- case WM_DESTROY:
- break;
-
- case WM_NOTIFY:
- {
- LPNMHDR lpnm = (LPNMHDR)lParam;
-
- switch (lpnm->code)
- {
-
- }
}
break;
@@ -404,7 +432,7 @@
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
- psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | PSH_USECALLBACK;
+ psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | PSH_USECALLBACK;// |
PSH_MODELESS;
psh.hwndParent = Info->hMainWnd;
psh.hInstance = hInstance;
psh.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SM_ICON));
Modified: trunk/reactos/base/applications/mscutils/servman/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/query.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/query.c Tue Aug 28 23:54:25 2007
@@ -87,6 +87,13 @@
CloseServiceHandle(hSc);
return pServiceConfig;
+}
+
+
+VOID
+SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig)
+{
+
}
@@ -159,7 +166,6 @@
return lpDescription;
}
-
Modified: trunk/reactos/base/applications/mscutils/servman/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/resource.h (original)
+++ trunk/reactos/base/applications/mscutils/servman/resource.h Tue Aug 28 23:54:25 2007
@@ -132,6 +132,7 @@
#define IDC_PAUSE 10151
#define IDC_RESUME 10161
#define IDC_START_PARAM 10191
+#define IDC_EDIT 10192
/* dependancies dialog */
#define IDD_DLG_DEPEND 20001
Modified: trunk/reactos/base/applications/mscutils/servman/start.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/start.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/start.c Tue Aug 28 23:54:25 2007
@@ -19,107 +19,90 @@
DWORD BytesNeeded = 0;
INT ArgCount = 0;
DWORD dwStartTickCount, dwOldCheckPoint;
+ BOOL bRet = FALSE;
- /* open handle to the SCM */
hSCManager = OpenSCManager(NULL,
NULL,
SC_MANAGER_ALL_ACCESS);
if (hSCManager == NULL)
{
- GetError();
- return FALSE;
- }
+ hSc = OpenService(hSCManager,
+ Info->pCurrentService->lpServiceName,
+ SERVICE_ALL_ACCESS);
+ if (hSc != NULL)
+ {
+ if (StartService(hSc,
+ ArgCount,
+ NULL))
+ {
+ if (QueryServiceStatusEx(hSc,
+ SC_STATUS_PROCESS_INFO,
+ (LPBYTE)&ServiceStatus,
+ sizeof(SERVICE_STATUS_PROCESS),
+ &BytesNeeded))
+ {
+ dwStartTickCount = GetTickCount();
+ dwOldCheckPoint = ServiceStatus.dwCheckPoint;
- /* get a handle to the service requested for starting */
- hSc = OpenService(hSCManager,
- Info->pCurrentService->lpServiceName,
- SERVICE_ALL_ACCESS);
- if (hSc == NULL)
- {
- GetError();
- return FALSE;
- }
+ while (ServiceStatus.dwCurrentState != SERVICE_RUNNING)
+ {
+ DWORD dwWaitTime;
- /* start the service opened */
- if (! StartService(hSc,
- ArgCount,
- NULL))
- {
- GetError();
- return FALSE;
- }
+ dwWaitTime = ServiceStatus.dwWaitHint / 10;
- /* query the state of the service */
- if (! QueryServiceStatusEx(hSc,
- SC_STATUS_PROCESS_INFO,
- (LPBYTE)&ServiceStatus,
- sizeof(SERVICE_STATUS_PROCESS),
- &BytesNeeded))
- {
- GetError();
- return FALSE;
- }
+ if(dwWaitTime < 1000)
+ dwWaitTime = 500;
+ else if (dwWaitTime > 10000)
+ dwWaitTime = 10000;
- /* Save the tick count and initial checkpoint. */
- dwStartTickCount = GetTickCount();
- dwOldCheckPoint = ServiceStatus.dwCheckPoint;
+ IncrementProgressBar(hProgDlg);
+ Sleep(dwWaitTime );
+ IncrementProgressBar(hProgDlg);
- /* loop whilst service is not running */
- /* FIXME: needs more control adding. 'Loop' is temparary */
- while (ServiceStatus.dwCurrentState != SERVICE_RUNNING)
- {
- DWORD dwWaitTime;
+ if (!QueryServiceStatusEx(hSc,
+ SC_STATUS_PROCESS_INFO,
+ (LPBYTE)&ServiceStatus,
+ sizeof(SERVICE_STATUS_PROCESS),
+ &BytesNeeded))
+ {
+ break;
+ }
- dwWaitTime = ServiceStatus.dwWaitHint / 10;
-
- if( dwWaitTime < 500 )
- dwWaitTime = 500;
- else if ( dwWaitTime > 5000 )
- dwWaitTime = 5000;
-
- IncrementProgressBar(hProgDlg);
-
- /* wait before checking status */
- Sleep(ServiceStatus.dwWaitHint / 8);
-
- /* check status again */
- if (! QueryServiceStatusEx(hSc,
- SC_STATUS_PROCESS_INFO,
- (LPBYTE)&ServiceStatus,
- sizeof(SERVICE_STATUS_PROCESS),
- &BytesNeeded))
- {
- GetError();
- return FALSE;
+ if (ServiceStatus.dwCheckPoint > dwOldCheckPoint)
+ {
+ /* The service is making progress, increment the progress bar
*/
+ IncrementProgressBar(hProgDlg);
+ dwStartTickCount = GetTickCount();
+ dwOldCheckPoint = ServiceStatus.dwCheckPoint;
+ }
+ else
+ {
+ if(GetTickCount() - dwStartTickCount >
ServiceStatus.dwWaitHint)
+ {
+ /* No progress made within the wait hint */
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ CloseServiceHandle(hSc);
}
- if (ServiceStatus.dwCheckPoint > dwOldCheckPoint)
- {
- /* The service is making progress. increment the progress bar */
- IncrementProgressBar(hProgDlg);
- dwStartTickCount = GetTickCount();
- dwOldCheckPoint = ServiceStatus.dwCheckPoint;
- }
- else
- {
- if(GetTickCount() - dwStartTickCount > ServiceStatus.dwWaitHint)
- {
- /* No progress made within the wait hint */
- break;
- }
- }
+ CloseServiceHandle(hSCManager);
}
-
- CloseServiceHandle(hSc);
if (ServiceStatus.dwCurrentState == SERVICE_RUNNING)
{
CompleteProgressBar(hProgDlg);
Sleep(1000);
- return TRUE;
+ bRet = TRUE;
}
else
- return FALSE;
+ GetError();
+
+ return bRet;
}