Commit in reactos/lib/shell32 on MAIN
winehq2ros.patch+20added 1.1
dialogs.c+48-331.7 -> 1.8
shell32_En.rc+91.2 -> 1.3
shresdef.h+51.1 -> 1.2
+82-33
1 added + 3 modified, total 4 files
Use string resources for ExitWindowsDialog() and RestartDialogEx() to allow
internationalization.

reactos/lib/shell32
winehq2ros.patch added at 1.1
diff -N winehq2ros.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ winehq2ros.patch	12 Jul 2004 20:53:24 -0000	1.1
@@ -0,0 +1,20 @@
+Index: shell32_En.rc
+===================================================================
+RCS file: /home/wine/wine/dlls/shell32/shell32_En.rc,v
+retrieving revision 1.14
+diff -u -r1.14 shell32_En.rc
+--- shell32_En.rc	9 Jul 2004 22:51:19 -0000	1.14
++++ shell32_En.rc	12 Jul 2004 21:01:03 -0000
+@@ -181,8 +181,8 @@
+ /* message box strings */
+ STRINGTABLE DISCARDABLE
+ {
+-       IDS_RESTART_TITLE       "Restart"
+-       IDS_RESTART_PROMPT      "Do you want to simulate a Windows reboot?"
+-       IDS_SHUTDOWN_TITLE      "Shutdown"
+-       IDS_SHUTDOWN_PROMPT     "Do you want to shutdown your Wine session?"
++	IDS_RESTART_TITLE	"Restart"
++	IDS_RESTART_PROMPT	"Do you want to restart the system?"
++	IDS_SHUTDOWN_TITLE	"Shutdown"
++	IDS_SHUTDOWN_PROMPT	"Do you want to shutdown?"
+ }

reactos/lib/shell32
dialogs.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- dialogs.c	29 Jun 2004 13:51:59 -0000	1.7
+++ dialogs.c	12 Jul 2004 20:53:24 -0000	1.8
@@ -36,6 +36,7 @@
 #include "shellapi.h"
 #include "shlobj.h"
 #include "shell32_main.h"
+#include "shresdef.h"
 #include "undocshell.h"
 
 typedef struct
@@ -379,30 +380,46 @@
 
 
 /*************************************************************************
+ * ConfirmDialog				[internal]
+ *
+ * Put up a confirm box, return TRUE if the user confirmed
+ */
+static BOOL ConfirmDialog(HWND hWndOwner, UINT PromptId, UINT TitleId)
+{
+  WCHAR Prompt[256];
+  WCHAR Title[256];
+
+  LoadStringW(shell32_hInstance, PromptId, Prompt, sizeof(Prompt) / sizeof(WCHAR));
+  LoadStringW(shell32_hInstance, TitleId, Title, sizeof(Title) / sizeof(WCHAR));
+  return MessageBoxW(hWndOwner, Prompt, Title, MB_YESNO|MB_ICONQUESTION) == IDYES;
+}
+
+
+/*************************************************************************
  * RestartDialogEx				[SHELL32.730]
  */
 
-int WINAPI RestartDialogEx(HWND hwndOwner, LPCWSTR lpwstrReason, UINT uFlags, UINT uReason)
+int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)
 {
-    TRACE("(%p)\n", hwndOwner);
+    TRACE("(%p)\n", hWndOwner);
 
     /*FIXME: use uReason */
 
-    if (MessageBoxA(hwndOwner, "Do you want to restart the system?", "Restart", MB_YESNO|MB_ICONQUESTION) == IDYES)
+    if (ConfirmDialog(hWndOwner, IDS_RESTART_PROMPT, IDS_RESTART_TITLE))
     {
-	if (SHELL_OsIsUnicode())
-	{
-	    HANDLE hToken;
-	    TOKEN_PRIVILEGES npr = {1, {{{0, 0}, SE_PRIVILEGE_ENABLED}}};
-
-	    /* enable shutdown privilege for current process */
-	    OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken);
-	    LookupPrivilegeValueA(0, "SeShutdownPrivilege", &npr.Privileges[0].Luid);
-	    AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
-	    CloseHandle(hToken);
-	}
+        HANDLE hToken;
+        TOKEN_PRIVILEGES npr;
 
-	ExitWindowsEx(EWX_REBOOT, 0);
+        /* enable shutdown privilege for current process */
+        if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
+        {
+            LookupPrivilegeValueA(0, "SeShutdownPrivilege", &npr.Privileges[0].Luid);
+            npr.PrivilegeCount = 1;
+            npr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+            AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
+            CloseHandle(hToken);
+        }
+        ExitWindowsEx(EWX_REBOOT, 0);
     }
 
     return 0;
@@ -413,9 +430,9 @@
  * RestartDialog				[SHELL32.59]
  */
 
-int WINAPI RestartDialog(HWND hwndOwner, LPCWSTR lpstrReason, UINT uFlags)
+int WINAPI RestartDialog(HWND hWndOwner, LPCWSTR lpstrReason, DWORD uFlags)
 {
-    return RestartDialogEx(hwndOwner, lpstrReason, uFlags, 0);
+    return RestartDialogEx(hWndOwner, lpstrReason, uFlags, 0);
 }
 
 
@@ -429,22 +446,20 @@
 {
     TRACE("(%p)\n", hWndOwner);
 
-    if (MessageBoxA(hWndOwner, "Do you want to shutdown?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDYES)
+    if (ConfirmDialog(hWndOwner, IDS_SHUTDOWN_PROMPT, IDS_SHUTDOWN_TITLE))
     {
-	if (SHELL_OsIsUnicode())
-	{
-	    HANDLE hToken;
-	    TOKEN_PRIVILEGES npr = {1, {{{0, 0}, SE_PRIVILEGE_ENABLED}}};
-
-	    /* enable shutdown privilege for current process */
-	    OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken);
-	    LookupPrivilegeValueA(0, "SeShutdownPrivilege", &npr.Privileges[0].Luid);
-	    AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
-	    CloseHandle(hToken);
-
-	    ExitWindowsEx(EWX_SHUTDOWN, 0);
-	}
-	else
-	    SendMessageA(hWndOwner, WM_QUIT, 0, 0);
+        HANDLE hToken;
+        TOKEN_PRIVILEGES npr;
+
+        /* enable shutdown privilege for current process */
+        if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
+        {
+            LookupPrivilegeValueA(0, "SeShutdownPrivilege", &npr.Privileges[0].Luid);
+            npr.PrivilegeCount = 1;
+            npr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+            AdjustTokenPrivileges(hToken, FALSE, &npr, 0, 0, 0);
+            CloseHandle(hToken);
+        }
+        ExitWindowsEx(EWX_SHUTDOWN, 0);
     }
 }

reactos/lib/shell32
shell32_En.rc 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- shell32_En.rc	20 Jun 2004 16:43:58 -0000	1.2
+++ shell32_En.rc	12 Jul 2004 20:53:24 -0000	1.3
@@ -177,3 +177,12 @@
 	IDS_SHV_COLUMN8		"Name"
 	IDS_SHV_COLUMN9		"Comments"
 END
+
+/* message box strings */
+STRINGTABLE DISCARDABLE
+{
+	IDS_RESTART_TITLE	"Restart"
+	IDS_RESTART_PROMPT	"Do you want to restart the system?"
+	IDS_SHUTDOWN_TITLE	"Shutdown"
+	IDS_SHUTDOWN_PROMPT	"Do you want to shutdown?"
+}

reactos/lib/shell32
shresdef.h 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- shresdef.h	2 Jan 2004 19:49:45 -0000	1.1
+++ shresdef.h	12 Jul 2004 20:53:24 -0000	1.2
@@ -51,6 +51,11 @@
 #define IDS_OVERWRITEFILE_CAPTION 36
 #define IDS_OVERWRITEFILE_TEXT	37
 
+#define IDS_RESTART_TITLE      40
+#define IDS_RESTART_PROMPT     41
+#define IDS_SHUTDOWN_TITLE     42
+#define IDS_SHUTDOWN_PROMPT    43
+
 /* browse for folder dialog box */
 #define IDD_STATUS		0x3743
 #define IDD_TITLE		0x3742
CVSspam 0.2.8