[SHUTDOWN]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 14 Dec 2012 23:29:22 +0000 (23:29 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 14 Dec 2012 23:29:22 +0000 (23:29 +0000)
Improve functionnality of the shutdown utility :

* Added extra arguments based upon Windows 7.
* Added options to CommandLineOptions function.
* Simplify the PrintResourceString() function.
* Removed PrintUsage() since PrintResourceString() does a more flexible job at printing strings out.
* Added clear error messages when there is a problem. This makes it a bit easier to determine if there is a problem.
* Convert all the C++ comments to C.
* Since each version of Windows has a different upper limit for the length of the comment, a work around solution is used that first checks the length of the comment based upon the version of Windows that the user is currently using.
* Added support for hibernation mode, but the function SetSuspendState() is only a stub right now.
* In cases where the shutdown/restart operation is done remotely, now the proper permission is granted if the user has the proper permission.
* Added the REASON structure, which contains all the reason code combinations required for giving the proper reason code to the computer.
* Added bare bones basic support for the GUI option (/i). However, until the required features are added to ReactOS, the GUI won't do anything.
* Convert the program to full UNICODE support.

CORE-6613 #resolve #comment Committed in r57916. Thanks :)

svn path=/trunk/; revision=57916

29 files changed:
reactos/base/applications/shutdown/CMakeLists.txt
reactos/base/applications/shutdown/gui.c [new file with mode: 0644]
reactos/base/applications/shutdown/lang/bg-BG.rc
reactos/base/applications/shutdown/lang/de-DE.rc
reactos/base/applications/shutdown/lang/el-GR.rc
reactos/base/applications/shutdown/lang/en-US.rc
reactos/base/applications/shutdown/lang/es-ES.rc
reactos/base/applications/shutdown/lang/fr-FR.rc
reactos/base/applications/shutdown/lang/it-IT.rc
reactos/base/applications/shutdown/lang/ja-JP.rc
reactos/base/applications/shutdown/lang/ko-KR.rc
reactos/base/applications/shutdown/lang/lt-LT.rc
reactos/base/applications/shutdown/lang/nl-NL.rc
reactos/base/applications/shutdown/lang/no-NO.rc
reactos/base/applications/shutdown/lang/pl-PL.rc
reactos/base/applications/shutdown/lang/pt-BR.rc
reactos/base/applications/shutdown/lang/ro-RO.rc
reactos/base/applications/shutdown/lang/ru-RU.rc
reactos/base/applications/shutdown/lang/sk-SK.rc
reactos/base/applications/shutdown/lang/sv-SE.rc
reactos/base/applications/shutdown/lang/uk-UA.rc
reactos/base/applications/shutdown/lang/zh-CN.rc
reactos/base/applications/shutdown/lang/zh-TW.rc
reactos/base/applications/shutdown/misc.c
reactos/base/applications/shutdown/precomp.h
reactos/base/applications/shutdown/resource.h
reactos/base/applications/shutdown/rsrc.rc
reactos/base/applications/shutdown/shutdown.c
reactos/base/applications/shutdown/shutdown.rc

index 81b2ec7..18c7aea 100644 (file)
@@ -2,13 +2,14 @@
 set_rc_compiler()
 
 list(APPEND SOURCE
+    gui.c
     misc.c
     shutdown.c
     shutdown.rc)
 
 add_executable(shutdown ${SOURCE})
 
-set_module_type(shutdown win32cui)
-add_importlibs(shutdown advapi32 user32 msvcrt kernel32)
+set_module_type(shutdown win32cui UNICODE)
+add_importlibs(shutdown advapi32 user32 msvcrt powrprof kernel32)
 add_pch(shutdown precomp.h)
 add_cd_file(TARGET shutdown DESTINATION reactos/system32 FOR all)
diff --git a/reactos/base/applications/shutdown/gui.c b/reactos/base/applications/shutdown/gui.c
new file mode 100644 (file)
index 0000000..c3fb5a4
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS shutdown/logoff utility
+ * FILE:            base/applications/shutdown/gui.c
+ * PURPOSE:         Shows a GUI used for managing multiple remote shutdown/restarts
+ * PROGRAMMERS:     Lee Schroeder
+ */
+
+#include "precomp.h"
+
+BOOL CALLBACK ShutdownGuiProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+    switch(msg)
+    {
+        case WM_INITDIALOG:
+            break;
+
+        case WM_COMMAND:
+            switch(LOWORD(wparam))
+            {
+                case IDC_OK:
+                    EndDialog(hwnd, IDC_OK);
+                    break;
+                case IDC_CANCEL:
+                    EndDialog(hwnd, IDC_CANCEL);
+                    break;
+            }
+            break;
+
+        case WM_CLOSE:
+            EndDialog(hwnd, 0);
+            break;
+
+        default:
+            return FALSE;
+    }
+    
+    return TRUE;
+}
+
+/*
+ * NOTE: Until the ability to shutdown computers remotely, the GUI feature
+ * can't be fully implemented.
+ */
+BOOL ShutdownGuiMain(struct CommandLineOptions opts)
+{
+    INT_PTR result = DialogBoxW(GetModuleHandle(NULL),
+                                MAKEINTRESOURCEW(IDD_GUI),
+                                NULL,
+                                ShutdownGuiProc);
+
+    switch (result)
+    {
+        case IDC_OK:
+            MessageBoxW(NULL, L"This function is unimplemented.", L"Unimplemented", MB_OK);
+            break;
+
+        case IDC_CANCEL:
+            /* Exits the program */
+            break;
+
+        default:
+            MessageBoxW(NULL, L"Dialog Error!", L"Message", MB_OK);
+            return FALSE;
+    }
+
+    return TRUE;
+}
+
+/* EOF */
index d611283..d0c019e 100644 (file)
 LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Употреба: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Без ключове или -?\tПоказва това съобщение\n\
-  -l\t\t\tИзход\n\
-  -s\t\t\tИзключване на компютъра\n\
-  -r\t\t\tИзключване и презапускане на компютъра\n\
-  -f\t\t\tНасилване на работещите приложения да се затворят без предупреждение\n\
-    \t\t\tАко не сте задали други ключове, тази възможност\n\
-    \t\t\tще доведе до изход от потребителя"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 36dd91f..7d42508 100644 (file)
-/*
- *  German language file by Colin Finck <2007-07-18>
- */
-
 LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Syntax: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Keine Argumente\tDiese Meldung anzeigen\n\
-  -?\t\t\tDiese Meldung anzeigen\n\
-  -l\t\t\tBenutzer abmelden\n\
-  -s\t\t\tComputer herunterfahren\n\
-  -r\t\t\tComputer herunterfahren und neu starten\n\
-  -f\t\t\tLaufende Anwendungen ohne Warnung schließen\n\
-    \t\t\tWenn Sie keine weiteren Parameter angegeben haben,\n\
-    \t\t\tmeldet Sie diese Option auch ab"
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index f43a460..ab6c8b2 100644 (file)
 LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Χρήση: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Κανένα όρισμα ή -?\tΕμφάνιση αυτού του μηνύματος\n\
-  -l\t\t\tΑποσύνδεση\n\
-  -s\t\t\tΤερματισμός του υπολογιστή\n\
-  -r\t\t\tΤερματισμός και επανεκκίνηση του υπολογιστή\n\
-  -f\t\t\tΕξαναγκάζει τις τρέχουσες εφαρμογές να κλείσουν χωρίς προειδοποίηση\n\
-    \t\t\tΑν δε δηλώσατε κάποια άλλη παράμετρο, αυτή η επιλογή\n\
-    \t\t\tθα κάνει την αποσύνδεση"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index ee1f952..deec84f 100644 (file)
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Usage: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  No arguments or -?\tDisplay this message\n\
-  -l\t\t\tLog off\n\
-  -s\t\t\tShutdown the computer\n\
-  -r\t\t\tShutdown and restart the computer\n\
-  -f\t\t\tForces running applications to close without warnings\n\
-    \t\t\tIf you did not specify any other parameter, this option\n\
-    \t\t\twill also log off"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 6e8f4d4..4709fbb 100644 (file)
 LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Utilización: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Ningún argumento o -?\tMuestra este mensaje\n\
-  -l\t\t\tDesconectarse\n\
-  -s\t\t\tApagar el equipo\n\
-  -r\t\t\tApagar y reiniciar el equipo\n\
-  -f\t\t\tObliga las aplicaciones en curso de ejecución a apagarse sin advertencias\n\
-    \t\t\tSi no especifica algún otro parámetro, esta opción\n\
-    \t\t\tprovocará también una desconexión"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 5eb20b3..94df9df 100644 (file)
 LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Arrêt à distance"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "A&nnuler",IDC_CANCEL,178,232,50,14
+    CTEXT           "Or&dinateurs :", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "Ajout&er...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Supprimer",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "Pa&rcourir...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "&Quelle tâche voulez-vous que ces ordinateurs exécutent ?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "A&vertir les utilisateurs de l'action",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "A&fficher l'avertissement pendant",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "seconde(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Moniteur d'événements d'arrêt",IDC_STATIC,5,114,224,114
+    CTEXT           "Raison :",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planifié",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "&Commentaire :",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Utilisation : shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "              [/m \\\\ordinateur][/t xxx][/d [p|u:]xx:yy [/c ""commentaire""]]\n\n"
+                "    Sans argument ou /?    Afficher l'aide.\n"
+                "    /i      Afficher l'interface utilisateur graphique (GUI). Cette option doit\n"
+                "            être la première.\n"
+                "    /l      Fermer la session sur l'ordinateur local uniquement. Ne peut pas\n"
+                "            être utilisée avec les options /m ou /d.\n"
+                "    /s      Arrêter l'ordinateur.\n"
+                "    /r      Redémarrer l'ordinateur.\n"
+//                "    /g      Redémarrer l'ordinateur et redémarrer toutes les applications\n"
+//                "            enregistrées.\n"
+                "    /a      Annuler un arrêt du système. Ne peut être utilisée que pendant\n"
+                "            la période de délai.\n"
+                "    /p      Arrêter l'ordinateur local sans délai d'expiration ou\n"
+                "            avertissement. Peut être utilisée avec les options /d ou /f.\n"
+                "    /h      Mettre l'ordinateur local en veille prolongée. Utilisable avec\n"
+                "            l'option /f.\n"
+                "    /e      Documenter la raison de l'arrêt inattendu d'un ordinateur.\n"
+                "    /m \\\\ordinateur  Spécifier l'ordinateur cible (adresse UNC/IP).\n"
+                "    /t xxx  Définir la période de délai avant l'arrêt au bout de xxx secondes.\n"
+                "            La plage valide est comprise entre 0 et 315360000 (10 ans),\n"
+                "            30 étant la valeur par défaut.\n"
+                "    /c ""commentaire""  Commentaire sur la raison de l'arrêt ou du redémarrage.\n"
+                "            512 caractères maximum autorisés.\n"
+                "    /f      Force la fermeture des applications en cours d'exécution sans\n"
+                "            prévenir les utilisateurs. Si vous ne spécifiez aucun autre\n"
+                "            paramètre, cette option provoquera aussi une déconnexion.\n"
+                "    /d [p|u:]xx:yy  Fournit la raison de l'arrêt ou du redémarrage.\n"
+                "            p indique que l'arrêt ou le redémarrage est planifié.\n"
+                "            u indique que la raison est définie par l'utilisateur.\n"
+                "            Si ni p ni u ne sont spécifiés, l'arrêt ou le redémarrage ne sont\n"
+                "            planifiés.\n"
+                "            xx est le code de raison majeur (entier positif inférieur à 256).\n"
+                "            yy est le code de raison mineur (entier positif inférieur à 65536).\n"
 
-IDS_USAGE, "Utilisation: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Aucun argument ou -?\tAffiche ce message\n\
-  -l\t\t\tSe déconnecter\n\
-  -s\t\t\tÉteindre l'ordinateur\n\
-  -r\t\t\tÉteindre et redémarrer l'ordinateur\n\
-  -f\t\t\tForce les applications en cours de fonctionnement à se fermer sans avertissements\n\
-    \t\t\tSi vous ne spécifiez aucun autre paramètre, cette option\n\
-    \t\t\tprovoquera aussi une déconnexion"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERREUR : Impossible d'arrêter et de redémarrer en même temps.\n"
+    IDS_ERROR_TIMEOUT,                  "ERREUR : La valeur de délai %u est en-dehors des limites autorisées (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERREUR : Impossible d'annuler l'arrêt du système.\n"
+    IDS_ERROR_LOGOFF,                   "ERREUR : Impossible de se déconnecter du système.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERREUR : Impossible d'arrêter le système.\n"
+    IDS_ERROR_RESTART,                  "ERREUR : Impossible de redémarrer le système.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERREUR : La longueur du commentaire excède le nombre maximal de caractères imposé par le système.\n"
+    IDS_ERROR_HIBERNATE,                "ERREUR : Impossible de mettre le système en veille prolongée.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERREUR : La mise en veille prolongée ne peut être commandée à distance.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERREUR : La mise en veille prolongée n'est pas activée.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Arrêt à distance"
+    IDS_ERROR_DIALOG_INIT,              "Impossible d'afficher l'interface graphique utilisateur."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Arrêter le système"
+    IDS_ACTION_RESTART,                 "Redémarrer le système"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annoter l'arrêt non planifié"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Autre"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Matériel : Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Matériel : Installation"
+    IDS_REASON_OS_RECOVER,              "Système d'exploitation : Récupération"
+    IDS_REASON_OS_RECONFIGURE,          "Système d'exploitation : Reconfiguration"
+    IDS_REASON_APP_MAINTENANCE,         "Application : Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application : Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application : Aucune réponse"
+    IDS_REASON_APP_UNSTABLE,            "Application : Instable"
+    IDS_REASON_SECURITY,                "Problème de sécurité"
+    IDS_REASON_NETWORK,                 "Perte de connectivité réseau"
 END
index d19e37f..992e539 100644 (file)
 LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Uso: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Senza parametri o con -?\tvisualizza questo messaggio\n\
-  -l\t\t\tChiude la sessione\n\
-  -s\t\t\tSpegnimento del computer\n\
-  -r\t\t\tRiavvio del computer\n\
-  -f\t\t\tArresta le applicazioni senza nessun avviso\n\
-    \t\t\tSe non viene specificato nessun altro parametro verrà\n\
-    \t\t\tchiusa la sessione"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 18bc7c8..f0b9d48 100644 (file)
 LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "使用法: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  引数なしもしくは -?\tこのメッセージを表 示します\n\
-  -l\t\t\tログオフ\n\
-  -s\t\t\tコンピュータをシャットダウンします\n\
-  -r\t\t\tコンピュータをシャットダウンして再起動します\n\
-  -f\t\t\t実行中のアプリケーションを警告なしに閉じます\n\
-    \t\t\t他のパラメータを指定しない場合、ログオフn\n\
-    \t\t\tします"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 4975442..0ca38b0 100644 (file)
-/*
- * Korean translation by manatails007(www.manatails007.org)
- */
 LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "사용법: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  지시문 없음 -?\t이 메세지 표시\n\
-  -l\t\t\t로그 오프\n\
-  -s\t\t\t컴퓨터 끄기\n\
-  -r\t\t\t컴퓨터 재시작\n\
-  -f\t\t\t프로세스 강제종료\n\
-    \t\t\t아무 파라미터도 입력하지 않으시면,\n\
-    \t\t\t로그오프 될 것입니다"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index be49866..eac4856 100644 (file)
-/* Translation by Vytis "CMan" Girdžijauskas (cman@cman.us) */
-
 LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Naudojimas: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Be parametrų arba -?\tParodyti šį pranešimą\n\
-  -l\t\t\tAtsijungti\n\
-  -s\t\t\tIšjungti kompiuterį\n\
-  -r\t\t\tPerkrauti kompiuterį\n\
-  -f\t\t\tPriverstinai užverti visas paleistas programas\n\
-    \t\t\tJeigu nenurodyti jokie kiti parametrai, taip pat\n\
-    \t\t\tbus įvykdytas atsijungimas"
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index b01b2e5..438e327 100644 (file)
 LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Usage: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  No arguments or -?\tDisplay this message\n\
-  -l\t\t\tLog off\n\
-  -s\t\t\tDe computer afsluiten\n\
-  -r\t\t\tOpnieuw opstarten\n\
-  -f\t\t\tProgrammas zonder waarschuwing afsluiten\n\
-    \t\t\tAls u geen andere optie hebt geselecteerd, dan zal deze functie\n\
-    \t\t\tu ook doen afmelden"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index c87aff3..9b64910 100644 (file)
 LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Bruk: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Ingen parametere eller -?\tVis denne meldingen\n\
-  -l\t\t\tLogg av\n\
-  -s\t\t\tSkru av maskinen\n\
-  -r\t\t\tSkru av og start maskinen på nytt\n\
-  -f\t\t\tTvinger alle programmer til å avsluttes, og dersom\n\
-    \t\t\tdet ikke er spesifisert andre parametere vil\n\
-    \t\t\tbrukeren også logges ut."
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 61e1bb4..23311fe 100644 (file)
-/*
- *         translated by Caemyr - Olaf Siejka (Dec,2007)
- *         Use ReactOS forum PM or IRC to contact me
- *         http://www.reactos.org
- *         IRC: irc.freenode.net #reactos-pl;
- *         UTF-8 conversion by Caemyr (May, 2011) 
- */
-
 LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Składnia: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Bez parametrów albo z -?\tWyświetla niniejszą pomoc\n\
-  -l\t\t\tWylogowanie\n\
-  -s\t\t\tWyłączenie komputera\n\
-  -r\t\t\tRestart komputera\n\
-  -f\t\t\tZamknięcie wszystkich działających aplikacji, bez ostrzeżenia\n\
-    \t\t\tBez podania innego parametru, ta opcja domyślnie wyloguje \n\
-    \t\t\tobecnego użytkownika"
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 22c6d0e..b82c2d9 100644 (file)
-/* Translation and UTF-8 Conversion by mkbu95 <mkbu95@gmail.com> (August, 2011) */
-
 LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Uso: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Sem argumentos ou -?\tExibem esta mensagem\n\
-  -l\t\t\tFazer logoff\n\
-  -s\t\t\tDesligar o computador\n\
-  -r\t\t\tDesligar e reiniciar o computador\n\
-  -f\t\t\tForçar o fechamento dos aplicativos em execução sem avisar os usuários\n\
-    \t\t\tSe você não especificar outro parâmetro, esta opção\n\
-    \t\t\ttambém fará logoff"
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 82700d7..1afbd8b 100644 (file)
-/* 
- * FILE:             base/applications/shutdown/lang/ro-RO.rc
- *                   ReactOS Project (http://www.reactos.org)
- * TRANSLATOR:       Fulea Ștefan (PM on ReactOS Forum at fulea.stefan)
- * CHANGE LOG:       2011-08-24  initial translation
- *                   2011-10-30  diacritics change
- */
-
 LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Utilizare: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  fără arg.\n\
-  sau -?\tAfișează acest manual\n\
-  -l\t\tÎnchide sesiunea curentă\n\
-  -s\t\tÎnchide calculatorul\n\
-  -r\t\tRepornește calculatorul\n\
-  -f\t\tForțează închiderea aplicațiilor fără mesaje de avertisment.\n\
-    \t\tDacă nu ați specificat nici un alt parametru, această\n\
-    \t\topțiune are în mod implicit stabilită închiderea\n\
-       \tsesiunii curente."
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index cf60961..29ebd20 100644 (file)
-// Russian language resource file (Dmitry Chapyshev, 2007-07-19)
-
 LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Использование: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Без аргументов или -?\tОтображение этого сообщения\n\
-  -l\t\t\tЗавершение сеанса\n\
-  -s\t\t\tВыключение этого компьютера\n\
-  -r\t\t\tПерезагрузка этого компьютера\n\
-  -f\t\t\tИгнорирование запущенных программ и завершение их без\n\
-    \t\t\tпредупреждения\n\
-    \t\t\tЕсли вы не указали другие параметры, то эта опция\n\
-    \t\t\tприведет к завершению сеанса."
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index cb59de2..9db05b5 100644 (file)
-/*
- * PROJECT:     ReactOS Shutdown Utility
- * FILE:        base/applications/shutdown/lang/sk-SK.rc
- * PURPOSE:     Slovak Language File for shutdown
- * TRANSLATOR:  Kario (kario@szm.sk)
- * DATE OF TR:  25-07-2007
- */
-
 LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "Použitie: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Žiadne argumenty\tZobrazí sa táto správa\n\
-  -?\t\t\tZobrazí túto správu\n\
-  -l\t\t\tOdhlási používateľa\n\
-  -s\t\t\tVypne počítač\n\
-  -r\t\t\tReštartuje počítač\n\
-  -f\t\t\tDonúti spustené programy aby sa vypli bez upozornení.\n\
-    \t\t\tAk nebol zadaný žiadny iný parameter, tak aj odhlási\n\
-    \t\t\tpoužívateľa."
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 87e7a92..1b9d7a3 100644 (file)
-/*
- * PROJECT:         ReactOS RAPPS
- * FILE:            base/applications/shutdown/lang/sv-SE.rc
- * PURPOSE:         Swedish resource file
- * Translation:     Jaix Bly
- */
-
 LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "SYNTAX: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Ingen parameter eller -? Visar detta meddelandet.\n\
-  -l\t\tLogga ut\n\
-  -s\t\tStäng av datorn.\n\
-  -r\t\tStäng av och starta datorn.\n\
-  -f\t\tGör att program som körs avslutas utan att användare meddelas.\n\
-    \t\tOm du inte angav någon annan parameter till detta kommandot\n\
-    \t\tkommer användaren dessutom att loggas ut."
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index d6a0e5a..4674885 100644 (file)
 
 LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
 
-IDS_USAGE, "Використання: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  Без аргументів або -?\tВідображення цього повідомлення\n\
-  -l\t\t\tЗавершення сеансу\n\
-  -s\t\t\tВимкнення цього комп'ютера\n\
-  -r\t\t\tПерезавантаження цього комп'ютера\n\
-  -f\t\t\tПримусове закриття запущених додатків без попереджень\n\
-    \t\t\tЯкщо ви не вказали інший параметр, то ця опція також\n\
-    \t\t\tзавершить сеанс"
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
+
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index 4d99b28..3445526 100644 (file)
-/*
- * Translated by Song Fuchang (0xfc) <sfc_0@yahoo.com.cn>
- */
-
 LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "用法: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  没有参数或 -?\t显示这个消息\n\
-  -l\t\t\t注销\n\
-  -s\t\t\t关闭计算机\n\
-  -r\t\t\t重新启动计算机\n\
-  -f\t\t\t毫无警告地强行关闭正在运行的程序\n\
-    \t\t\t如果您没有指定其他任何参数,这个选项\n\
-    \t\t\t也会引起注销"
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index b8731ff..9d93b04 100644 (file)
-/*
- * Translated by Elton Chung aka MfldElton <elton328@gmail.com>
- */
-
 LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
 
+/* Dialog */
+IDD_GUI DIALOGEX DISCARDABLE 0, 0, 240, 255
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Shutdown"
+FONT 8, "MS Shell Dlg"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDC_OK,125,232,50,14
+    PUSHBUTTON      "&Cancel",IDC_CANCEL,178,232,50,14
+    CTEXT           "Co&mputers:", IDC_STATIC,9,9,35,36
+    LISTBOX         IDC_COMPUTER_LIST,8,19,162,55
+    PUSHBUTTON      "&Add...",IDC_ADD_SYSTEM,179,19,50,14
+    PUSHBUTTON      "&Remove",IDC_REMOVE_SYSTEM,179,36,50,14,WS_DISABLED
+    PUSHBUTTON      "&Browse...",IDC_BROWSE_SYSTEM,179,53,50,14
+    CTEXT           "Which action do you want these computers to execute?", IDC_ACTION,14,81,20,14
+    COMBOBOX        IDC_ACTION_TYPE,37,79,129,14,WS_TABSTOP | CBS_DROPDOWN
+    CHECKBOX        "Warn users",IDC_WARN_USERS,178,79,50,14,BS_AUTOCHECKBOX | WS_TABSTOP
+    CTEXT           "Display warning for",IDC_SHOW_WARN_ONE,11,99,65,14
+    EDITTEXT        IDC_SHOW_WARN,78,97,41,14
+    CTEXT           "second(s)",IDC_SHOW_WARN_TWO,124,99,32,10
+    GROUPBOX        "Shutdown Event Tracker",IDC_STATIC,5,114,224,114
+    CTEXT           "Reason:",IDC_STATIC,16,130,27,8
+    CHECKBOX        "Planned",IDC_PLANNED,175,130,40,12,BS_AUTOCHECKBOX | WS_TABSTOP
+    COMBOBOX        IDC_REASON_CODE,17,142,198,13,WS_TABSTOP | CBS_DROPDOWN
+    CTEXT           "Comm&ent:",IDC_COMMENT_CAPTION,17,159,30,8
+    EDITTEXT        IDC_COMMENT_TEXT,17,171,198,50,WS_VSCROLL
+END
+
+/* Information and error messages */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_USAGE,  "Usage: shutdown [/?] [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]\n"
+                "       [/m \\\\computer][/t xxx][/d [p|u:]xx:yy [/c ""comment""]]\n\n"
+                "    No arguments or /?    Display this help.\n"
+                "    /i      Show the graphical user interface (GUI). This option must be the\n"
+                "            first one.\n"
+                "    /l      Log off on the local system only. Cannot be used with /m or /d.\n"
+                "    /s      Shutdown the computer.\n"
+                "    /r      Restart the computer.\n"
+//                "    /g      Restart the computer and restart all the registered applications.\n"
+                "    /a      Cancel a delayed shutdown. Can only be used during the delay\n"
+                "            period.\n"
+                "    /p      Shutdown the local computer without any timeout or warning. Can be\n"
+                "            used with /d or /f.\n"
+                "    /h      Hibernate the local computer. Usable with /f.\n"
+                "    /e      Document the reason for the unexpected computer shutdown.\n"
+                "    /m \\\\computer  Specify the target computer (UNC/IP address).\n"
+                "    /t xxx  Set the timeout period to xxx seconds before shutting down.\n"
+                "            The valid range starts from 0 to 315360000 (10 years),\n"
+                "            30 being the default value.\n"
+                "    /c ""comment""  Comment on the reason for shutdown or restart.\n"
+                "            512 characters maximum allowed.\n"
+                "    /f      Force running applications to close without warning users. If you\n"
+                "            do not specify any other parameter, this option will also log off.\n"
+                "    /d [p|u:]xx:yy  Give the reason code for the shutdown or the restart.\n"
+                "            p indicates that the shutdown or the restart is planned.\n"
+                "            u indicates that the reason is defined by the user.\n"
+                "            If neither p nor u are specified, the shutdown or the restart are\n"
+                "            not planned.\n"
+                "            xx is the major reason code (positive integer smaller than 256).\n"
+                "            yy is the minor reason code (positive integer smaller than 65536).\n"
+
+    IDS_ERROR_SHUTDOWN_REBOOT,          "ERROR: Unable to shutdown and restart at the same time.\n"
+    IDS_ERROR_TIMEOUT,                  "ERROR: Timeout value of %u is out of bounds (0-315360000).\n"
+    IDS_ERROR_ABORT,                    "ERROR: Unable to abort the shutdown of the system.\n"
+    IDS_ERROR_LOGOFF,                   "ERROR: Unable to logoff the system.\n"
+    IDS_ERROR_SHUTDOWN,                 "ERROR: Unable to shutdown the system.\n"
+    IDS_ERROR_RESTART,                  "ERROR: Unable to restart the system.\n"
+    IDS_ERROR_MAX_COMMENT_LENGTH,       "ERROR: Comment length exceeds maximum character limit set by the system.\n"
+    IDS_ERROR_HIBERNATE,                "ERROR: Unable to send system into hibernation mode.\n"
+    IDS_ERROR_HIBERNATE_LOCAL,          "ERROR: Hibernation mode cannot be started remotely.\n"
+    IDS_ERROR_HIBERNATE_ENABLED,        "ERROR: Hibernation mode is not enabled.\n"
+    IDS_ERROR_DIALOG_CAPTION,           "Remote Shutdown"
+    IDS_ERROR_DIALOG_INIT,              "Unable to display the graphical user interface."
+END
+
+/* Remote shutdown action strings */
 STRINGTABLE DISCARDABLE
 BEGIN
+    IDS_ACTION_SHUTDOWN,                "Shutdown the system"
+    IDS_ACTION_RESTART,                 "Restart the system"
+    IDS_ACTION_UNEXPECTED_SHUTDOWN,     "Annotate the unexpected shutdown"
+END
 
-IDS_USAGE, "用法: shutdown [-?] [-l | -s | -r] [-f]\n\n\
-  沒有參數或 -?\t顯示這個訊息\n\
-  -l\t\t\t登出\n\
-  -s\t\t\t將電腦關機\n\
-  -r\t\t\t重新啟動電腦\n\
-  -f\t\t\t無警告地強制關閉正在執行的程式\n\
-    \t\t\t如果您沒有指定其他任何參數,這個選項\n\
-    \t\t\t也會引致登出"
+/* Remote shutdown reason strings */
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_REASON_OTHER,                   "Other"
+    IDS_REASON_HARDWARE_MAINTENANCE,    "Hardware: Maintenance"
+    IDS_REASON_HARDWARE_INSTALL,        "Hardware: Installation"
+    IDS_REASON_OS_RECOVER,              "Operating System: Recovery"
+    IDS_REASON_OS_RECONFIGURE,          "Operating System: Reconfigure"
+    IDS_REASON_APP_MAINTENANCE,         "Application: Maintenance"
+    IDS_REASON_APP_INSTALL,             "Application: Installation"
+    IDS_REASON_APP_UNRESPONSIVE,        "Application: Unresponsive"
+    IDS_REASON_APP_UNSTABLE,            "Application: Unstable"
+    IDS_REASON_SECURITY,                "Security Issue"
+    IDS_REASON_NETWORK,                 "Loss of network connectivity"
 END
index d7b042b..b26ff70 100644 (file)
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS shutdown/logoff utility
+ * FILE:            base/applications/shutdown/misc.c
+ * PURPOSE:         Misc. functions used for the shutdown utility
+ * PROGRAMMERS:     Lee Schroeder
+ */
+
 #include "precomp.h"
 
-static INT
-LengthOfStrResource(IN HINSTANCE hInst,
-                    IN UINT uID)
+const DWORD defaultReason = SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER;
+
+REASON shutdownReason[] =
 {
-    HRSRC hrSrc;
-    HGLOBAL hRes;
-    LPWSTR lpName, lpStr;
+    {L"U" , 0,  0, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER},                                             /* Other (Unplanned) */
+    {L"E" , 0,  0, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER},                                             /* Other (Unplanned) */
+    {L"EP", 0,  0, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED},                 /* Other (Planned) */
+    {L"U" , 0,  5, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_HUNG},                                              /* Other Failure: System Unresponsive */
+    {L"E" , 1,  1, SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_MAINTENANCE},                                    /* Hardware: Maintenance (Unplanned) */
+    {L"EP", 1,  1, SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_MAINTENANCE | SHTDN_REASON_FLAG_PLANNED},        /* Hardware: Maintenance (Planned) */
+    {L"E" , 1,  2, SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_INSTALLATION},                                   /* Hardware: Installation (Unplanned) */
+    {L"EP", 1,  2, SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_INSTALLATION | SHTDN_REASON_FLAG_PLANNED},       /* Hardware: Installation (Planned) */
+    {L"P" , 2,  3, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_UPGRADE | SHTDN_REASON_FLAG_PLANNED},     /* Operating System: Upgrade (Planned) */
+    {L"E" , 2,  4, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_RECONFIG},                                /* Operating System: Reconfiguration (Unplanned) */
+    {L"EP", 2,  4, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_RECONFIG | SHTDN_REASON_FLAG_PLANNED},    /* Operating System: Reconfiguration (Planned) */
+    {L"P" , 2, 16, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_RECONFIG | SHTDN_REASON_FLAG_PLANNED},    /* Operating System: Service pack (Planned) */
+    {L"U" , 2, 17, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_HOTFIX},                                  /* Operating System: Hotfix (Unplanned) */
+    {L"P" , 2, 17, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_HOTFIX | SHTDN_REASON_FLAG_PLANNED},      /* Operating System: Hotfix (Planned) */
+    {L"U" , 2, 18, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX},                             /* Operating System: Security fix (Unplanned) */
+    {L"P" , 2, 18, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX | SHTDN_REASON_FLAG_PLANNED}, /* Operating System: Security fix (Planned) */
+    {L"E" , 4,  1, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_MAINTENANCE},                                 /* Application: Maintenance (Unplanned) */
+    {L"EP", 4,  1, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_MAINTENANCE | SHTDN_REASON_FLAG_PLANNED},     /* Application: Maintenance (Planned) */
+    {L"EP", 4,  2, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_INSTALLATION | SHTDN_REASON_FLAG_PLANNED},    /* Application: Installation (Planned) */
+    {L"E" , 4,  5, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_HUNG},                                        /* Application: Unresponsive */
+    {L"E" , 4,  6, SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_UNSTABLE},                                    /* Application: Unstable */
+    {L"U" , 5, 15, SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_BLUESCREEN},                                       /* System Failure: Stop Error */
+    {L"E" , 5, 19, SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_SECURITY},                                         /* Security Issue */
+    {L"U" , 5, 19, SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_SECURITY},                                         /* Security Issue */
+    {L"EP", 5, 19, SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_SECURITY | SHTDN_REASON_FLAG_PLANNED},             /* Security Issue (Planned) */
+    {L"E" , 5, 20, SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY},                             /* Loss of Network Connectivity (Unplanned) */
+    {L"U" , 6, 11, SHTDN_REASON_MAJOR_POWER | SHTDN_REASON_MINOR_CORDUNPLUGGED},                                     /* Power Failure: Cord Unplugged */
+    {L"U" , 6, 12, SHTDN_REASON_MAJOR_POWER | SHTDN_REASON_MINOR_ENVIRONMENT},                                       /* Power Failure: Environment */
+    {L"P" , 7,  0, SHTDN_REASON_MAJOR_POWER | SHTDN_REASON_MINOR_ENVIRONMENT}                                        /* Legacy API shutdown (Planned) */
+};
 
-    if (hInst == NULL)
-    {
-        return -1;
-    }
+/*
+ * This command helps to work around the fact that the shutdown utility has
+ * different upper limits for the comment flag since each version of Windows
+ * seems to have different upper limits.
+ */
+BOOL CheckCommentLength(LPCWSTR comment)
+{
+    DWORD finalLength = 0;
+    size_t strLength = 0;
+    DWORD osVersion = 0;
+    DWORD osMajorVersion = 0;
+    DWORD osMinorVersion = 0;
 
-    /* There are always blocks of 16 strings */
-    lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1);
+    /* An empty string is always valid. */
+    if (!comment || *comment == 0)
+        return TRUE;
 
-    /* Find the string table block */
-    if ((hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING)) &&
-        (hRes = LoadResource(hInst, hrSrc)) &&
-        (lpStr = (WCHAR*) LockResource(hRes)))
-    {
-        UINT x;
+    /* Grab the version of the current Operating System. */
+    osVersion = GetVersion();
+
+    osMajorVersion = (DWORD)(LOBYTE(LOWORD(osVersion)));
+    osMinorVersion = (DWORD)(HIBYTE(LOWORD(osVersion)));
 
-        /* Find the string we're looking for */
-        uID &= 0xF; /* position in the block, same as % 16 */
-        for (x = 0; x < uID; x++)
+    /*
+     * Check to make sure that the proper length is being used
+     * based upon the version of Windows currently being used.
+     */
+    if (osMajorVersion == 5) /* Windows XP/2003 */
+    {
+        if ((osMinorVersion == 1) || (osMinorVersion == 2))
         {
-            lpStr += (*lpStr) + 1;
+            finalLength = 127;
         }
-
-        /* Found the string */
-        return (int)(*lpStr);
     }
-    return -1;
+    else if (osMajorVersion == 6) /* Windows Vista/7/2008 */
+    {
+        if ((osMinorVersion == 0) || (osMinorVersion == 1))
+        {
+            finalLength = 512;
+        }
+    }
+
+    /* Grab the length of the comment string. */
+    strLength = wcslen(comment);
+
+    /*
+     * Compare the size of the string to make sure
+     * it fits with the current version of Windows,
+     * and return TRUE or FALSE accordingly.
+     */
+    return (strLength <= finalLength);
 }
 
-INT
-AllocAndLoadString(OUT LPTSTR *lpTarget,
-                   IN HINSTANCE hInst,
-                   IN UINT uID)
+/*
+ * This function parses the reason code to a usable format that will specify
+ * why the user wants to shut the computer down. Although this is used for
+ * both client and server environments, use of a reason code is more important
+ * in a server environment since servers are supposed to be on all the time
+ * for easier access.
+ */
+DWORD ParseReasonCode(LPCWSTR code)
 {
-    INT ln;
+    PREASON reasonptr;
+    int majorCode = 0;
+    int minorCode = 0;
+    LPWSTR tmpPrefix = NULL;
+    size_t codeSize;
 
-    ln = LengthOfStrResource(hInst,
-                             uID);
-    if (ln++ > 0)
+    /* If no reason code is specified, use "Other (Unplanned)" as the default option */
+    if(code == NULL)
     {
-        (*lpTarget) = (LPTSTR)LocalAlloc(LMEM_FIXED,
-                                         ln * sizeof(TCHAR));
-        if ((*lpTarget) != NULL)
+        return defaultReason;
+    }
+    else
+    {
+        /* Store the size of the code so we can use it later */
+        codeSize = (size_t)wcslen(code);
+
+        /* A colon cannot be the first or last character in the reason code */
+        if ((code[0] == L':') || (code[codeSize] == L':'))
         {
-            INT Ret;
-            if (!(Ret = LoadString(hInst, uID, *lpTarget, ln)))
+            return defaultReason;
+        }
+
+        /* The minimum length that a reason code can be is 5-7 characters in length */
+        if ((codeSize < 5) || (codeSize > 7))
+        {
+            return defaultReason;
+        }
+
+        /* TODO: Add code for reason parsing here. */
+
+        /* Make sure that the major and minor codes are within size limits */
+        if ((majorCode > 7 ) || (majorCode < 0) ||
+            (minorCode > 20) || (minorCode < 0))
+        {
+            return defaultReason;
+        }
+
+        /* Figure out what flags to return */
+        for (reasonptr = shutdownReason ; reasonptr->prefix ; reasonptr++)
+        {
+            if ((majorCode == reasonptr->major) &&
+                (minorCode == reasonptr->minor) &&
+                (_wcsicmp(tmpPrefix, reasonptr->prefix) != 0))
             {
-                LocalFree((HLOCAL)(*lpTarget));
+                return reasonptr->flag;
             }
-            return Ret;
         }
     }
-    return 0;
+
+    return defaultReason;
 }
+
+/* Writes the last error as both text and error code to the console */
+VOID DisplayError(DWORD dwError)
+{
+    LPWSTR lpMsgBuf = NULL;
+    DWORD  errLength; /* Error message length */
+    LPSTR resMsg;     /* For error message in OEM symbols */
+
+    /* Grabs the length of the error message */
+    errLength = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                               NULL,
+                               dwError,
+                               LANG_USER_DEFAULT,
+                               (LPWSTR)&lpMsgBuf,
+                               0,
+                               NULL) + 1;
+
+    /* Gets the error message ready for output */
+    resMsg = (LPSTR)LocalAlloc(LPTR, errLength * sizeof(WCHAR));
+    CharToOemBuffW(lpMsgBuf, resMsg, errLength);
+
+    /* Prints out the error message to the user */
+    fprintf(stderr, resMsg);
+    fwprintf(stderr, L"Error code: %d\n", dwError);
+
+    LocalFree(lpMsgBuf);
+    LocalFree(resMsg);
+}
+
+/* EOF */
index 24e122b..db8280c 100644 (file)
@@ -1,16 +1,59 @@
 #ifndef __SHUTDOWN_PRECOMP_H
 #define __SHUTDOWN_PRECOMP_H
 
+/* INCLUDES ******************************************************************/
 #include <stdio.h>
 #include <stdlib.h>
+#include <ctype.h>
 #include <windows.h>
 #include <tchar.h>
-#include <reason.h> //shutdown codes
+#include <powrprof.h>
+// #include <reason.h> // Shutdown codes
 #include "resource.h"
 
-// misc.c
-INT AllocAndLoadString(OUT LPTSTR *lpTarget,
-                       IN HINSTANCE hInst,
-                       IN UINT uID);
+/* DEFINES *******************************************************************/
+#define MAX_MESSAGE_SIZE    512
+#define MAX_MAJOR_CODE      256
+#define MAX_MINOR_CODE      65536
+#define MAX_TIMEOUT         315360000
+#define MAX_BUFFER_SIZE     5024
+
+/* Reason Code List */
+typedef struct _REASON
+{
+    LPWSTR prefix;
+    int major;
+    int minor;
+    DWORD flag;
+} REASON, *PREASON;
+
+/* Used to determine how to shutdown the system. */
+struct CommandLineOptions
+{
+    BOOL abort;
+    BOOL force;
+    BOOL logoff;
+    BOOL restart;
+    BOOL shutdown;
+    BOOL document_reason;
+    BOOL hibernate;
+    DWORD shutdown_delay;
+    LPWSTR remote_system;
+    LPWSTR message;
+    DWORD reason;
+    BOOL show_gui;
+};
+
+extern const DWORD defaultReason;
+
+/* PROTOTYPES *****************************************************************/
+
+/* misc.c */
+BOOL CheckCommentLength(LPCWSTR);
+DWORD ParseReasonCode(LPCWSTR);
+VOID DisplayError(DWORD dwError);
+
+/* gui.c */
+BOOL ShutdownGuiMain(struct CommandLineOptions opts);
 
 #endif
index 11f6a09..c50dbb6 100644 (file)
@@ -1 +1,56 @@
-#define IDS_USAGE    1000
+#pragma once
+
+/* Strings */
+#define IDC_STATIC                     -1
+#define IDS_USAGE                       1
+#define IDS_ERROR_SHUTDOWN_REBOOT       2
+#define IDS_ERROR_TIMEOUT               3
+#define IDS_ERROR_ABORT                 4
+#define IDS_ERROR_LOGOFF                5
+#define IDS_ERROR_RESTART               6
+#define IDS_ERROR_SHUTDOWN              7
+#define IDS_ERROR_MAX_COMMENT_LENGTH    8
+#define IDS_ERROR_HIBERNATE             9
+#define IDS_ERROR_HIBERNATE_LOCAL       10
+#define IDS_ERROR_HIBERNATE_ENABLED     11
+#define IDS_ERROR_DIALOG_CAPTION        12
+#define IDS_ERROR_DIALOG_INIT           13
+
+/* Action strings */
+#define IDS_ACTION_SHUTDOWN             14
+#define IDS_ACTION_RESTART              15
+#define IDS_ACTION_UNEXPECTED_SHUTDOWN  16
+
+/* Reason strings */
+#define IDS_REASON_OTHER                    17
+#define IDS_REASON_HARDWARE_MAINTENANCE     18
+#define IDS_REASON_HARDWARE_INSTALL         19
+#define IDS_REASON_OS_RECOVER               20
+#define IDS_REASON_OS_RECONFIGURE           21
+#define IDS_REASON_APP_MAINTENANCE          22
+#define IDS_REASON_APP_INSTALL              23
+#define IDS_REASON_APP_UNRESPONSIVE         24
+#define IDS_REASON_APP_UNSTABLE             25
+#define IDS_REASON_SECURITY                 26
+#define IDS_REASON_NETWORK                  27
+
+/* Controls */
+#define IDC_OK                  100
+#define IDC_CANCEL              101
+#define IDC_COMPUTER_LIST       102
+#define IDC_ADD_SYSTEM          103
+#define IDC_REMOVE_SYSTEM       104
+#define IDC_BROWSE_SYSTEM       105
+#define IDC_ACTION              106
+#define IDC_ACTION_TYPE         107
+#define IDC_WARN_USERS          108
+#define IDC_SHOW_WARN_ONE       109
+#define IDC_SHOW_WARN_TWO       110
+#define IDC_SHOW_WARN           111
+#define IDC_PLANNED             112
+#define IDC_REASON_CODE         113
+#define IDC_COMMENT_CAPTION     114
+#define IDC_COMMENT_TEXT        115
+
+/* Dialogs */
+#define IDD_GUI                 200
index 1475085..1b1a9a5 100644 (file)
@@ -1,6 +1,7 @@
 #include <windows.h>
 #include "resource.h"
 
+/* Include localised resources */
 // UTF-8
 #pragma code_page(65001)
 #ifdef LANGUAGE_BG_BG
index 6088855..74a2fea 100644 (file)
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS shutdown/logoff utility
- * FILE:            base/application/shutdown/shutdown.c
+ * FILE:            base/applications/shutdown/shutdown.c
  * PURPOSE:         Initiate logoff, shutdown or reboot of the system
  */
 
 #include "precomp.h"
 
-// Print information about which commandline arguments the program accepts.
-static void PrintUsage() {
-       LPTSTR lpUsage = NULL;
-       DWORD errLength; // error message length
-       LPTSTR resMsg; // for error message in OEM symbols
-
-       if( AllocAndLoadString( &lpUsage,
-                                                       GetModuleHandle(NULL),
-                                                       IDS_USAGE ) )
-       {
-               errLength = strlen(lpUsage) + 1;
-               resMsg = (LPTSTR)LocalAlloc(LPTR, errLength * sizeof(TCHAR));
-               CharToOemBuff(lpUsage, resMsg, errLength);
-
-               _putts( resMsg );
-
-               LocalFree(lpUsage);
-               LocalFree(resMsg);
-       }
-}
-
-struct CommandLineOptions {
-       BOOL abort; // Not used yet
-       BOOL force;
-       BOOL logoff;
-       BOOL restart;
-       BOOL shutdown;
-};
-
-struct ExitOptions {
-       // This flag is used to distinguish between a user-initiated LOGOFF (which has value 0)
-       // and an underdetermined situation because user didn't give an argument to start Exit.
-       BOOL shouldExit;
-       // flags is the type of shutdown to do - EWX_LOGOFF, EWX_REBOOT, EWX_POWEROFF, etc..
-       UINT flags;
-       // reason is the System Shutdown Reason code. F.instance SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED.
-       DWORD reason;
-};
-
-// Takes the commandline arguments, and creates a struct which matches the arguments supplied.
-static struct CommandLineOptions ParseArguments(int argc, TCHAR *argv[])
+/*
+ * This takes strings from a resource stringtable
+ * and outputs it to the console.
+ */
+VOID PrintResourceString(INT resID, ...)
 {
-       struct CommandLineOptions opts;
-       int i;
-
-       // Reset all flags in struct
-       opts.abort = FALSE;
-       opts.force = FALSE;
-       opts.logoff = FALSE;
-       opts.restart = FALSE;
-       opts.shutdown = FALSE;
-
-       for (i = 1; i < argc; i++)
-       {
-               if (argv[i][0] == '-' || argv[i][0] == '/')
-               {
-                       switch(argv[i][1]) {
-                               case '?':
-                                       PrintUsage();
-                                       exit(0);
-                               case 'f':
-                               case 'F':
-                                       opts.force = TRUE;
-                                       break;
-                               case 'l':
-                               case 'L':
-                                       opts.logoff = TRUE;
-                                       break;
-                               case 'r':
-                               case 'R':
-                                       opts.restart = TRUE;
-                                       break;
-                               case 's':
-                               case 'S':
-                                       opts.shutdown = TRUE;
-                                       break;
-                               default:
-                                       // Unknown arguments will exit program.
-                                       PrintUsage();
-                                       exit(0);
-                                       break;
-                       }
-               }
-       }
-
-       return opts;
-}
+    WCHAR tmpBuffer[MAX_BUFFER_SIZE];
+    va_list arg_ptr;
 
-// Converts the commandline arguments to flags used to shutdown computer
-static struct ExitOptions ParseCommandLineOptionsToExitOptions(struct CommandLineOptions opts)
-{
-       struct ExitOptions exitOpts;
-       exitOpts.shouldExit = TRUE;
-
-       // Sets ONE of the exit type flags
-       if (opts.logoff)
-               exitOpts.flags = EWX_LOGOFF;
-       else if (opts.restart)
-               exitOpts.flags = EWX_REBOOT;
-       else if(opts.shutdown)
-               exitOpts.flags = EWX_POWEROFF;
-       else
-       {
-               exitOpts.flags = 0;
-               exitOpts.shouldExit = FALSE;
-       }
-
-       // Sets additional flags
-       if (opts.force)
-       {
-               exitOpts.flags = exitOpts.flags | EWX_FORCE;
-
-               // This makes sure that we log off, also if there is only the "-f" option specified.
-               // The Windows shutdown utility does it the same way.
-               exitOpts.shouldExit = TRUE;
-       }
-
-       // Reason for shutdown
-       // Hardcoded to "Other (Planned)"
-       exitOpts.reason = SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED;
-
-       return exitOpts;
+    va_start(arg_ptr, resID);
+    LoadStringW(GetModuleHandle(NULL), resID, tmpBuffer, MAX_BUFFER_SIZE);
+    _vcwprintf(tmpBuffer, arg_ptr);
+    va_end(arg_ptr);
 }
 
-// Writes the last error as both text and error code to the console.
-void DisplayLastError()
+/*
+ * Takes the commandline arguments, and creates a
+ * struct which matches the arguments supplied.
+ */
+static DWORD
+ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
 {
-       int errorCode = GetLastError();
-       LPTSTR lpMsgBuf = NULL;
-       DWORD errLength; // error message length
-       LPTSTR resMsg; // for error message in OEM symbols
-
-       // Display the error message to the user
-       errLength = FormatMessage(
-               FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
-               NULL,
-               errorCode,
-               LANG_USER_DEFAULT,
-               (LPTSTR) &lpMsgBuf,
-               0,
-               NULL) + 1;
-
-       resMsg = (LPTSTR)LocalAlloc(LPTR, errLength * sizeof(TCHAR));
-       CharToOemBuff(lpMsgBuf, resMsg, errLength);
-
-       _ftprintf(stderr, resMsg);
-       _ftprintf(stderr, _T("Error code: %d\n"), errorCode);
-
-       LocalFree(lpMsgBuf);
-       LocalFree(resMsg);
+    UINT index;
+
+    if (!pOpts)
+        return ERROR_INVALID_PARAMETER;
+
+    /* Reset all flags in struct */
+    pOpts->abort = FALSE;
+    pOpts->force = FALSE;
+    pOpts->logoff = FALSE;
+    pOpts->restart = FALSE;
+    pOpts->shutdown = FALSE;
+    pOpts->document_reason = FALSE;
+    pOpts->hibernate = FALSE;
+    pOpts->shutdown_delay = 30;
+    pOpts->remote_system = NULL;
+    pOpts->reason = ParseReasonCode(NULL); /* NOTE: NEVER use 0 here since it can delay the shutdown. */
+    pOpts->message = NULL;
+    pOpts->show_gui = FALSE;
+
+    /*
+     * Determine which flags the user has specified
+     * to the program so we can use them later.
+     */
+    for (index = 1; index < argc; index++)
+    {
+        if (argv[index][0] == L'-' || argv[index][0] == L'/')
+        {
+            switch(towlower(argv[index][1]))
+            {
+                case L'?': /* Help */
+                    PrintResourceString(IDS_USAGE);
+                    return ERROR_SUCCESS;
+
+                case L'a': /* Cancel delayed shutdown */
+                    pOpts->abort = TRUE;
+                    break;
+
+                case L'c': /* Comment on reason for shutdown */
+                    if(CheckCommentLength(argv[index+1]))
+                    {
+                        if(index+1 <= argc)
+                            pOpts->message = argv[index+1];
+                        else
+                            return ERROR_INVALID_DATA;
+                        index++;
+                    }
+                    else
+                    {
+                        PrintResourceString(IDS_ERROR_MAX_COMMENT_LENGTH);
+                        return ERROR_BAD_LENGTH;
+                    }
+                    break;
+
+                case L'd': /* Reason code [p|u:]xx:yy */
+                    if(index+1 <= argc)
+                        pOpts->reason = ParseReasonCode(argv[index+1]);
+                    else
+                        return ERROR_INVALID_DATA;
+                    index++;
+                    break;
+
+                case L'e': /* Documents reason for shutdown */
+                    /* TODO: Determine what this flag does exactly. */
+                    pOpts->document_reason = TRUE;
+                    break;
+
+                case L'f': /* Force shutdown without warning */
+                    pOpts->force = TRUE;
+                    break;
+
+                case L'h': /* Hibernate the local computer */
+                    pOpts->hibernate = TRUE;
+                    break;
+
+                case L'i': /* Shows GUI version of the tool */
+                    pOpts->show_gui = TRUE;
+                    break;
+
+                case L'l': /* Logoff the current user */
+                    pOpts->logoff = TRUE;
+                    break;
+
+                case L'm': /* Target remote systems (UNC name/IP address) */
+                    pOpts->remote_system = argv[index+1];
+                    break;
+
+                case L'p': /* Turn off local computer with no warning/time-out */
+                    pOpts->force = TRUE;
+                    pOpts->shutdown_delay = 0;
+                    break;
+
+                case L'r': /* Restart computer */
+                    pOpts->restart = TRUE;
+                    break;
+
+                case L's': /* Shutdown */
+                    pOpts->shutdown = TRUE;
+                    break;
+
+                case L't': /* Shutdown delay */
+                    pOpts->shutdown_delay = _wtoi(argv[index+1]);
+                    if(pOpts->shutdown_delay > 0) 
+                        pOpts->force = TRUE;
+                    break;
+
+                default:
+                    /* Unknown arguments will exit the program. */
+                    PrintResourceString(IDS_USAGE);
+                    return ERROR_SUCCESS;
+            }
+        }
+    }
+
+    return ERROR_SUCCESS;
 }
 
-void EnableShutdownPrivileges()
+static DWORD
+EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
 {
-       HANDLE token;
-       TOKEN_PRIVILEGES privs;
-
-       // Check to see if the choosen action is allowed by the user. Everyone can call LogOff, but only privilieged users can shutdown/restart etc.
-       if (! OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
-       {
-               DisplayLastError();
-               exit(1);
-       }
-
-       // Get LUID (Locally Unique Identifier) for the privilege we need
-       if (!LookupPrivilegeValue(
-                       NULL, // system - NULL is localsystem
-                       SE_SHUTDOWN_NAME, // name of the privilege
-                       &privs.Privileges[0].Luid) // output
-               )
-       {
-               DisplayLastError();
-               exit(1);
-       }
-       // and give our current process (i.e. shutdown.exe) the privilege to shutdown the machine.
-       privs.PrivilegeCount = 1;
-       privs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
-       if (AdjustTokenPrivileges(
-                       token,
-                       FALSE,
-                       &privs,
-                       0,
-                       (PTOKEN_PRIVILEGES)NULL, // previous state. Set to NULL, we don't care about previous state.
-                       NULL
-                       ) == 0) // return value 0 means failure
-               {
-                       DisplayLastError();
-                       exit(1);
-               }
+    DWORD  dwRet  = ERROR_SUCCESS;
+    HANDLE hToken = NULL;
+
+    if (OpenProcessToken(GetCurrentProcess(),
+                         TOKEN_ADJUST_PRIVILEGES,
+                         &hToken))
+    {
+        TOKEN_PRIVILEGES tp;
+
+        tp.PrivilegeCount = 1;
+        tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
+
+        if (LookupPrivilegeValueW(NULL,
+                                  lpszPrivilegeName,
+                                  &tp.Privileges[0].Luid))
+        {
+            if (AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL))
+            {
+                if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)
+                    dwRet = ERROR_NOT_ALL_ASSIGNED;
+            }
+            else
+            {
+                dwRet = GetLastError();
+            }
+        }
+        else
+        {
+            dwRet = GetLastError();
+        }
+
+        CloseHandle(hToken);
+    }
+    else
+    {
+        dwRet = GetLastError();
+    }
+
+    /* Display the error description if any */
+    if (dwRet != ERROR_SUCCESS) DisplayError(dwRet);
+
+    return dwRet;
 }
 
- // Main entry for program
-int _tmain(int argc, TCHAR *argv[])
+/* Main entry for program */
+int wmain(int argc, WCHAR *argv[])
 {
-       struct CommandLineOptions opts;
-       struct ExitOptions exitOpts;
-
-       if (argc == 1) // i.e. no commandline arguments given
-       {
-               PrintUsage();
-               exit(0);
-       }
-
-       opts = ParseArguments(argc, argv);
-       exitOpts = ParseCommandLineOptionsToExitOptions(opts);
-
-       // Perform the shutdown/restart etc. action
-       if (exitOpts.shouldExit)
-       {
-               EnableShutdownPrivileges();
-
-               if (!ExitWindowsEx(exitOpts.flags, exitOpts.reason))
-               {
-                       DisplayLastError();
-                       exit(1);
-               }
-       }
-       return 0;
+    DWORD error = ERROR_SUCCESS;
+    struct CommandLineOptions opts;
+
+    if (argc == 1) /* i.e. no commandline arguments given */
+    {
+        PrintResourceString(IDS_USAGE);
+        return EXIT_SUCCESS;
+    }
+
+    error = ParseArguments(&opts, argc, argv);
+    if (error != ERROR_SUCCESS)
+    {
+        DisplayError(error);
+        return EXIT_FAILURE;
+    }
+
+    /* If the user wants to abort a shutdown */
+    if (opts.abort)
+    {
+        /* First, the program has to determine if the shutdown/restart is local
+        or remote. This is done since each one requires separate privileges. */
+        if (opts.remote_system == NULL)
+            EnablePrivilege(SE_SHUTDOWN_NAME, TRUE);
+        else
+            EnablePrivilege(SE_REMOTE_SHUTDOWN_NAME, TRUE);
+
+        /* Abort the delayed system shutdown specified. */
+        if (!AbortSystemShutdownW(opts.remote_system))
+        {
+            PrintResourceString(IDS_ERROR_ABORT);
+            DisplayError(GetLastError());
+            return EXIT_FAILURE;
+        }
+        else
+        {
+            return EXIT_SUCCESS;
+        }
+    }
+
+    /*
+     * If the user wants to hibernate the computer. Assume
+     * that the user wants to wake the computer up from 
+     * hibernation and it should not force it on the system.
+     */
+    if (opts.hibernate)
+    {
+        if (IsPwrHibernateAllowed())
+        {
+            EnablePrivilege(SE_SHUTDOWN_NAME, TRUE);
+            
+            /* The shutdown utility cannot hibernate remote systems */
+            if (opts.remote_system != NULL)
+            {
+                return EXIT_FAILURE;
+            }
+        
+            if (!SetSuspendState(TRUE, FALSE, FALSE))
+            {
+                PrintResourceString(IDS_ERROR_HIBERNATE);
+                DisplayError(GetLastError());
+                return EXIT_FAILURE;
+            }
+            else
+            {
+                PrintResourceString(IDS_ERROR_HIBERNATE_ENABLED);
+                return EXIT_SUCCESS;
+            }
+        }
+        else
+        {
+            return EXIT_FAILURE;
+        }
+    }
+
+    /* Both shutdown and restart flags cannot both be true */
+    if (opts.shutdown && opts.restart)
+    {
+        PrintResourceString(IDS_ERROR_SHUTDOWN_REBOOT);
+        return EXIT_FAILURE;
+    }
+
+    /* Ensure that the timout amount is not too high or a negative number */
+    if ((opts.shutdown_delay < 0) || (opts.shutdown_delay > MAX_TIMEOUT))
+    {
+        PrintResourceString(IDS_ERROR_TIMEOUT, opts.shutdown_delay);
+        return EXIT_FAILURE;
+    }
+
+    /* If the user wants a GUI environment */
+    if (opts.show_gui)
+    {
+        if (ShutdownGuiMain(opts))
+            return EXIT_SUCCESS;
+        else
+            return EXIT_FAILURE;
+    }
+
+    if (opts.logoff && (opts.remote_system == NULL))
+    {
+        /*
+         * NOTE: Sometimes, shutdown and logoff are used together. If the logoff
+         * flag is used by itself, then simply logoff. But if used with shutdown,
+         * then skip logging off of the computer and eventually go to the action
+         * for shutdown.
+         */
+        if (!opts.shutdown && !opts.restart)
+        {
+            EnablePrivilege(SE_SHUTDOWN_NAME, TRUE);
+
+            if (ExitWindowsEx(EWX_LOGOFF, opts.reason))
+            {
+                return EXIT_SUCCESS;
+            }
+            else
+            {
+                PrintResourceString(IDS_ERROR_LOGOFF);
+                DisplayError(GetLastError());
+                return EXIT_FAILURE;
+            }
+        }
+    }
+
+    /*
+     * Since both shutting down the system and restarting calls the exact same
+     * function, all we need to know is if we wanted to restart or shutdown.
+     */
+    if (opts.shutdown || opts.restart)
+    {
+        /*
+         * First, the program has to determine if the shutdown/restart is local
+         * or remote. This is done since each one requires separate privileges.
+         */
+        if (opts.remote_system == NULL)
+        {
+            EnablePrivilege(SE_SHUTDOWN_NAME, TRUE);
+        }
+        else
+        {
+            /* TODO: Remote shutdown is not supported yet */
+            // EnablePrivilege(SE_REMOTE_SHUTDOWN_NAME, TRUE);
+            return EXIT_SUCCESS;
+        }
+
+        /**
+         ** HACK: When InitiateSystemShutdownExW will become really implemented,
+         ** activate this line and delete the other...
+         **
+        if(!InitiateSystemShutdownExW(opts.remote_system,
+                                      opts.message,
+                                      opts.shutdown_delay,
+                                      opts.force,
+                                      opts.restart,
+                                      opts.reason))
+        ***/
+        if (!ExitWindowsEx((opts.shutdown ? EWX_SHUTDOWN : EWX_REBOOT) |
+                           (opts.force ? EWX_FORCE : 0),
+                           opts.reason))
+        {
+            /*
+             * If there is an error, give the proper output depending
+             * on whether the user wanted to shutdown or restart.
+             */
+            if (opts.restart)
+                PrintResourceString(IDS_ERROR_RESTART);
+            else
+                PrintResourceString(IDS_ERROR_SHUTDOWN);
+            
+            DisplayError(GetLastError());
+            return EXIT_FAILURE;
+        }
+        else
+        {
+            return EXIT_SUCCESS;
+        }
+    }
+
+    return EXIT_SUCCESS;
 }
 
-// EOF
+/* EOF */
index 5f727d3..434ef05 100644 (file)
@@ -1,9 +1,13 @@
 #include <windows.h>
+#include <commctrl.h>
 #include "resource.h"
 
-#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS Shutdown Utility\0"
-#define REACTOS_STR_INTERNAL_NAME      "shutdown\0"
-#define REACTOS_STR_ORIGINAL_FILENAME  "shutdown.exe\0"
+/* Define language neutral resources */
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS Shutdown Utility"
+#define REACTOS_STR_INTERNAL_NAME       "shutdown"
+#define REACTOS_STR_ORIGINAL_FILENAME   "shutdown.exe"
 #include <reactos/version.rc>
 
 #include "rsrc.rc"