Author: ekohl
Date: Mon Jul 18 21:49:19 2016
New Revision: 71965
URL:
http://svn.reactos.org/svn/reactos?rev=71965&view=rev
Log:
[SERVMAN]
Service logon property page:
- Fix initialization and display bugs.
- Start work on the 'Apply' function. It doe not apply changes yet.
- Add password check messages.
Modified:
trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc
trunk/reactos/base/applications/mscutils/servman/lang/cs-CZ.rc
trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc
trunk/reactos/base/applications/mscutils/servman/lang/el-GR.rc
trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc
trunk/reactos/base/applications/mscutils/servman/lang/es-ES.rc
trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc
trunk/reactos/base/applications/mscutils/servman/lang/he-IL.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/ja-JP.rc
trunk/reactos/base/applications/mscutils/servman/lang/ko-KR.rc
trunk/reactos/base/applications/mscutils/servman/lang/no-NO.rc
trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc
trunk/reactos/base/applications/mscutils/servman/lang/ro-RO.rc
trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc
trunk/reactos/base/applications/mscutils/servman/lang/sk-SK.rc
trunk/reactos/base/applications/mscutils/servman/lang/sq-AL.rc
trunk/reactos/base/applications/mscutils/servman/lang/sv-SE.rc
trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc
trunk/reactos/base/applications/mscutils/servman/lang/tr-TR.rc
trunk/reactos/base/applications/mscutils/servman/lang/uk-UA.rc
trunk/reactos/base/applications/mscutils/servman/lang/zh-CN.rc
trunk/reactos/base/applications/mscutils/servman/lang/zh-TW.rc
trunk/reactos/base/applications/mscutils/servman/misc.c
trunk/reactos/base/applications/mscutils/servman/precomp.h
trunk/reactos/base/applications/mscutils/servman/propsheet_logon.c
trunk/reactos/base/applications/mscutils/servman/resource.h
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/cs-CZ.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/cs-CZ.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -331,8 +331,14 @@
STRINGTABLE
BEGIN
- IDS_NO_ACTION "Take no action"
- IDS_RESTART_SERVICE "Restart the Service"
- IDS_RUN_PROGRAM "Run a Program"
- IDS_RESTART_COMPUTER "Restart the Computer"
-END
+ IDS_NO_ACTION "Keine Aktion durchführen"
+ IDS_RESTART_SERVICE "Dienst neu starten"
+ IDS_RUN_PROGRAM "Ein Programm ausführen"
+ IDS_RESTART_COMPUTER "Computer neu starten"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "Die Kennwörter stimmen nicht überein!"
+ IDS_INVALID_PASSWORD "Geben Sie ein gültiges Kennwort ein!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/el-GR.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/el-GR.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/es-ES.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/es-ES.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -339,3 +339,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/he-IL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/he-IL.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/he-IL.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,10 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
+
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/ja-JP.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/ja-JP.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/ko-KR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/ko-KR.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/ko-KR.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -338,3 +338,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/no-NO.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/no-NO.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -346,3 +346,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/ro-RO.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/ro-RO.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -341,3 +341,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -336,3 +336,10 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
+
Modified: trunk/reactos/base/applications/mscutils/servman/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/sk-SK.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/sk-SK.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -341,3 +341,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/sq-AL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/sq-AL.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/sq-AL.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -341,3 +341,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/sv-SE.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/sv-SE.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -343,3 +343,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
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 [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -344,3 +344,10 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
+
Modified: trunk/reactos/base/applications/mscutils/servman/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/tr-TR.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/tr-TR.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -338,3 +338,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/uk-UA.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/uk-UA.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -344,3 +344,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/zh-CN.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/zh-CN.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -338,3 +338,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/zh-TW.rc [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/zh-TW.rc [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -338,3 +338,9 @@
IDS_RUN_PROGRAM "Run a Program"
IDS_RESTART_COMPUTER "Restart the Computer"
END
+
+STRINGTABLE
+BEGIN
+ IDS_NOT_SAME_PASSWORD "The Passwords are not the same!"
+ IDS_INVALID_PASSWORD "Enter a valid Password!"
+END
Modified: trunk/reactos/base/applications/mscutils/servman/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/misc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/misc.c [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -275,3 +275,24 @@
return himl;
}
+
+
+#define BUFFERSIZE 512
+
+VOID
+ResourceMessageBox(
+ HINSTANCE hInstance,
+ HWND hwnd,
+ UINT uType,
+ UINT uCaptionId,
+ UINT uMessageId)
+{
+ WCHAR szErrorText[BUFFERSIZE];
+ WCHAR szErrorCaption[BUFFERSIZE];
+
+ LoadStringW(hInstance, uMessageId, szErrorText, sizeof(szErrorText) /
sizeof(WCHAR));
+ LoadStringW(hInstance, uCaptionId, szErrorCaption, sizeof(szErrorCaption) /
sizeof(WCHAR));
+
+ MessageBoxW(hwnd, szErrorText, szErrorCaption, uType);
+}
+
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] Mon Jul 18
21:49:19 2016
@@ -210,5 +210,12 @@
UINT Width,
UINT Height,
ULONG type);
+VOID
+ResourceMessageBox(
+ HINSTANCE hInstance,
+ HWND hwnd,
+ UINT uType,
+ UINT uCaptionId,
+ UINT uMessageId);
#endif /* __SERVMAN_PRECOMP_H */
Modified: trunk/reactos/base/applications/mscutils/servman/propsheet_logon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/propsheet_logon.c [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/mscutils/servman/propsheet_logon.c [iso-8859-1] Mon
Jul 18 21:49:19 2016
@@ -11,6 +11,8 @@
#define NDEBUG
#include <debug.h>
+#define DEFAULT_PASSWORD L" "
+
typedef struct _LOGONDATA
{
ENUM_SERVICE_STATUS_PROCESS *pService;
@@ -18,9 +20,11 @@
WCHAR szAccountName[64];
WCHAR szPassword1[64];
WCHAR szPassword2[64];
- BOOL bInitial;
- BOOL bAccountNameChanged;
+ BOOL bInitialized;
+ BOOL bLocalSystem;
+ BOOL bAccountChanged;
} LOGONDATA, *PLOGONDATA;
+
static
VOID
@@ -29,28 +33,166 @@
PLOGONDATA pLogonData,
BOOL bLocalSystem)
{
- BOOL y = bLocalSystem ? FALSE : TRUE;
-
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_INTERACTIVE), bLocalSystem);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_ACCOUNTNAME), y);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_SEARCH), y);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PW1TEXT), y);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PASSWORD1), y);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PW2TEXT), y);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PASSWORD2), y);
-
- if (bLocalSystem == TRUE && pLogonData->bInitial == FALSE)
- {
- GetDlgItemText(hwndDlg, IDC_LOGON_ACCOUNTNAME, pLogonData->szAccountName,
64);
- GetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD1, pLogonData->szPassword1, 64);
- GetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD2, pLogonData->szPassword2, 64);
- }
-
- SetDlgItemText(hwndDlg, IDC_LOGON_ACCOUNTNAME, bLocalSystem ? L"" :
pLogonData->szAccountName);
- SetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD1, bLocalSystem ? L"" :
pLogonData->szPassword1);
- SetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD2, bLocalSystem ? L"" :
pLogonData->szPassword2);
-
- pLogonData->bInitial = FALSE;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_ACCOUNTNAME), !bLocalSystem);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_SEARCH), FALSE /*!bLocalSystem*/);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PW1TEXT), !bLocalSystem);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PASSWORD1), !bLocalSystem);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PW2TEXT), !bLocalSystem);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_PASSWORD2), !bLocalSystem);
+
+ if (bLocalSystem)
+ {
+ if (pLogonData->bInitialized == TRUE)
+ {
+ GetDlgItemText(hwndDlg, IDC_LOGON_ACCOUNTNAME, pLogonData->szAccountName,
64);
+ GetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD1, pLogonData->szPassword1,
64);
+ GetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD2, pLogonData->szPassword2,
64);
+ }
+
+ SetDlgItemText(hwndDlg, IDC_LOGON_ACCOUNTNAME, L"");
+ SetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD1, L"");
+ SetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD2, L"");
+ }
+ else
+ {
+ SetDlgItemText(hwndDlg, IDC_LOGON_ACCOUNTNAME, pLogonData->szAccountName);
+ SetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD1, pLogonData->szPassword1);
+ SetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD2, pLogonData->szPassword2);
+ }
+
+ pLogonData->bLocalSystem = bLocalSystem;
+}
+
+
+#if 0
+BOOL
+SetServiceAccount(
+ LPWSTR lpServiceName,
+ LPWSTR lpStartName,
+ LPWSTR lpPassword)
+{
+ SC_HANDLE hSCManager;
+ SC_HANDLE hSc;
+ SC_LOCK scLock;
+ BOOL bRet = FALSE;
+
+ hSCManager = OpenSCManagerW(NULL,
+ NULL,
+ SC_MANAGER_LOCK);
+ if (hSCManager)
+ {
+ scLock = LockServiceDatabase(hSCManager);
+ if (scLock)
+ {
+ hSc = OpenServiceW(hSCManager,
+ lpServiceName,
+ SERVICE_CHANGE_CONFIG);
+ if (hSc)
+ {
+ if (ChangeServiceConfigW(hSc,
+ SERVICE_NO_CHANGE,
+ SERVICE_NO_CHANGE,
+ SERVICE_NO_CHANGE,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ lpStartName,
+ lpPassword,
+ NULL))
+ {
+ bRet = TRUE;
+ }
+
+ CloseServiceHandle(hSc);
+ }
+
+ UnlockServiceDatabase(scLock);
+ }
+
+ CloseServiceHandle(hSCManager);
+ }
+
+ if (!bRet)
+ GetError();
+
+ return bRet;
+}
+#endif
+
+
+static
+BOOL
+OnQueryInitialFocus(
+ HWND hwndDlg,
+ PLOGONDATA pLogonData)
+{
+ HWND hwnd = GetDlgItem(hwndDlg, pLogonData->bLocalSystem ? IDC_LOGON_SYSTEMACCOUNT
: IDC_LOGON_THISACCOUNT);
+
+ SetWindowLong(hwndDlg, DWL_MSGRESULT, (LPARAM)hwnd);
+
+ return TRUE;
+}
+
+
+static
+BOOL
+OnApply(
+ HWND hwndDlg,
+ PLOGONDATA pLogonData)
+{
+ WCHAR szAccountName[64];
+ WCHAR szPassword1[64];
+ WCHAR szPassword2[64];
+ BOOL bRet = TRUE;
+
+ if (!pLogonData->bAccountChanged)
+ return TRUE;
+
+ if (SendDlgItemMessageW(hwndDlg, IDC_LOGON_SYSTEMACCOUNT, BM_GETCHECK, 0, 0) ==
BST_CHECKED)
+ {
+ /* System account selected */
+ wcscpy(szAccountName, L"LocalSystem");
+ wcscpy(szPassword1, L"");
+ wcscpy(szPassword2, L"");
+ }
+ else
+ {
+ /* Other account selected */
+ GetDlgItemText(hwndDlg, IDC_LOGON_ACCOUNTNAME, szAccountName, 64);
+ GetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD1, szPassword1, 64);
+ GetDlgItemText(hwndDlg, IDC_LOGON_PASSWORD2, szPassword2, 64);
+
+ if (wcscmp(szPassword1, szPassword2))
+ {
+ ResourceMessageBox(GetModuleHandle(NULL), hwndDlg, MB_OK | MB_ICONWARNING,
IDS_APPNAME, IDS_NOT_SAME_PASSWORD);
+ return FALSE;
+ }
+
+ if (!wcscmp(szPassword1, DEFAULT_PASSWORD))
+ {
+ ResourceMessageBox(GetModuleHandle(NULL), hwndDlg, MB_OK | MB_ICONWARNING,
IDS_APPNAME, IDS_INVALID_PASSWORD);
+ return FALSE;
+ }
+
+
+ }
+
+#if 0
+ bRet = SetServiceAccount(pLogonData->pService->lpServiceName,
+ szAccountName,
+ szPassword1);
+ if (bRet == FALSE)
+ {
+
+ }
+#endif
+
+ if (bRet == TRUE)
+ pLogonData->bAccountChanged = FALSE;
+
+ return bRet;
}
@@ -86,25 +228,30 @@
GWLP_USERDATA,
(LONG_PTR)pLogonData);
- pLogonData->bInitial = TRUE;
+ pLogonData->bInitialized = FALSE;
pLogonData->pService =
((PSERVICEPROPSHEET)(((LPPROPSHEETPAGE)lParam)->lParam))->pService;
pLogonData->pServiceConfig =
GetServiceConfig(pLogonData->pService->lpServiceName);
if (pLogonData->pServiceConfig != NULL)
{
+ wcscpy(pLogonData->szPassword1, DEFAULT_PASSWORD);
+ wcscpy(pLogonData->szPassword2, DEFAULT_PASSWORD);
+
if (pLogonData->pServiceConfig->lpServiceStartName == NULL ||
_wcsicmp(pLogonData->pServiceConfig->lpServiceStartName,
L"LocalSystem") == 0)
{
- PostMessageW(GetDlgItem(hwndDlg, IDC_LOGON_SYSTEMACCOUNT),
BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
- PostMessageW(hwndDlg, WM_COMMAND, IDC_LOGON_SYSTEMACCOUNT, 0);
+ SendMessageW(GetDlgItem(hwndDlg, IDC_LOGON_SYSTEMACCOUNT),
BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
+ SetControlStates(hwndDlg, pLogonData, TRUE);
}
else
{
wcscpy(pLogonData->szAccountName,
pLogonData->pServiceConfig->lpServiceStartName);
- PostMessageW(GetDlgItem(hwndDlg, IDC_LOGON_THISACCOUNT),
BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
- PostMessageW(hwndDlg, WM_COMMAND, IDC_LOGON_THISACCOUNT, 0);
+ SendMessageW(GetDlgItem(hwndDlg, IDC_LOGON_THISACCOUNT),
BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
+ SetControlStates(hwndDlg, pLogonData, FALSE);
}
}
+
+ pLogonData->bInitialized = TRUE;
}
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGON_HWPROFILE), FALSE);
@@ -121,30 +268,49 @@
switch(LOWORD(wParam))
{
case IDC_LOGON_SYSTEMACCOUNT:
- SetControlStates(hwndDlg, pLogonData, TRUE);
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ if (pLogonData->bInitialized)
+ {
+ pLogonData->bAccountChanged = TRUE;
+ PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ }
+ SetControlStates(hwndDlg, pLogonData, TRUE);
+ }
break;
case IDC_LOGON_THISACCOUNT:
- SetControlStates(hwndDlg, pLogonData, FALSE);
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ if (pLogonData->bInitialized)
+ {
+ pLogonData->bAccountChanged = TRUE;
+ PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ }
+ SetControlStates(hwndDlg, pLogonData, FALSE);
+ }
break;
case IDC_LOGON_ACCOUNTNAME:
- if (HIWORD(wParam) == EN_CHANGE)
- {
- pLogonData->bAccountNameChanged = TRUE;
+ case IDC_LOGON_PASSWORD1:
+ case IDC_LOGON_PASSWORD2:
+ if (HIWORD(wParam) == EN_CHANGE &&
pLogonData->bInitialized)
+ {
+ pLogonData->bAccountChanged = TRUE;
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
}
break;
-
-
}
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
+ case PSN_QUERYINITIALFOCUS :
+ return OnQueryInitialFocus(hwndDlg, pLogonData);
+
case PSN_APPLY:
- break;
+ return OnApply(hwndDlg, pLogonData);
}
break;
}
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 [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/servman/resource.h [iso-8859-1] Mon Jul 18
21:49:19 2016
@@ -219,3 +219,6 @@
#define IDS_RESTART_SERVICE 12101
#define IDS_RUN_PROGRAM 12102
#define IDS_RESTART_COMPUTER 12103
+
+#define IDS_NOT_SAME_PASSWORD 12150
+#define IDS_INVALID_PASSWORD 12151