Author: tkreuzer
Date: Sun Jul 15 14:16:52 2012
New Revision: 56897
URL: 
http://svn.reactos.org/svn/reactos?rev=56897&view=rev
Log:
[COMDLG32]
- Don't modify a dialog template resource directly, instead make a copy of it.
- Should be sent to wine (bug #7189)
[BROWSEUI]
- Remove useless diff file.
Added:
    trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff
Removed:
    trunk/reactos/dll/win32/browseui/browseui_ros.diff
Modified:
    trunk/reactos/dll/win32/comdlg32/filedlg.c
Removed: trunk/reactos/dll/win32/browseui/browseui_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/browseu…
==============================================================================
--- trunk/reactos/dll/win32/browseui/browseui_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/browseui_ros.diff (removed)
@@ -1,15 +1,0 @@
-Index: browseui.rbuild
-===================================================================
---- browseui.rbuild    (revision 23123)
-+++ browseui.rbuild    (working copy)
-@@ -9,8 +9,8 @@
-       <define name="__WINESRC__" />
-       <define name="__USE_W32API" />
-       <define name="_WIN32_IE">0x600</define>
--      <define name="_WIN32_WINNT">0x501</define>
--      <define name="WINVER">0x501</define>
-+      <define name="_WIN32_WINNT">0x600</define>
-+      <define name="WINVER">0x600</define>
-       <library>wine</library>
-       <library>ole32</library>
-       <library>user32</library>
Added: trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/comdlg3…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff (added)
+++ trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff [iso-8859-1] Sun Jul 15 14:16:52
2012
@@ -1,0 +1,71 @@
+Index: filedlg.c
+===================================================================
+--- filedlg.c  (Revision 56893)
++++ filedlg.c  (Arbeitskopie)
+@@ -260,6 +260,8 @@
+     HRSRC hRes;
+     HANDLE hDlgTmpl = 0;
+     HRESULT hr;
++    DWORD dwSize;
++    LPDLGTEMPLATE hDialogTemplate;
+
+     /* test for missing functionality */
+     if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS)
+@@ -276,12 +278,17 @@
+         return FALSE;
+     }
+     if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) ||
++        !(dwSize = SizeofResource(COMDLG32_hInstance, hRes )) ||
++        !(hDialogTemplate = malloc(dwSize)) ||
+         !(template = LockResource( hDlgTmpl )))
+     {
+         COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
+         return FALSE;
+     }
+
++    /* Copy the read only resource */
++    memcpy(hDialogTemplate, template, dwSize);
++
+     /* msdn: explorer style dialogs permit sizing by default.
+      * The OFN_ENABLESIZING flag is only needed when a hook or
+      * custom tmeplate is provided */
+@@ -291,12 +298,12 @@
+
+     if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING)
+     {
+-        ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX;
++        hDialogTemplate->style |= WS_SIZEBOX;
+         fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0;
+         fodInfos->initial_size.x = fodInfos->initial_size.y = 0;
+     }
+     else
+-        ((LPDLGTEMPLATEW)template)->style &= ~WS_SIZEBOX;
++        hDialogTemplate->style &= ~WS_SIZEBOX;
+
+
+     /* old style hook messages */
+@@ -313,19 +320,21 @@
+
+     if (fodInfos->unicode)
+       lRes = DialogBoxIndirectParamW(COMDLG32_hInstance,
+-                                     template,
++                                     hDialogTemplate,
+                                      fodInfos->ofnInfos->hwndOwner,
+                                      FileOpenDlgProc95,
+                                      (LPARAM) fodInfos);
+     else
+       lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
+-                                     template,
++                                     hDialogTemplate,
+                                      fodInfos->ofnInfos->hwndOwner,
+                                      FileOpenDlgProc95,
+                                      (LPARAM) fodInfos);
+-    if (SUCCEEDED(hr))
++    if (SUCCEEDED(hr))
+         OleUninitialize();
+
++    free(hDialogTemplate);
++
+     /* Unable to create the dialog */
+     if( lRes == -1)
+         return FALSE;
Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
==============================================================================
--- trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] Sun Jul 15 14:16:52 2012
@@ -260,6 +260,8 @@
     HRSRC hRes;
     HANDLE hDlgTmpl = 0;
     HRESULT hr;
+    DWORD dwSize;
+    LPDLGTEMPLATE hDialogTemplate;
     /* test for missing functionality */
     if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS)
@@ -276,11 +278,16 @@
         return FALSE;
     }
     if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) ||
+        !(dwSize = SizeofResource(COMDLG32_hInstance, hRes )) ||
+        !(hDialogTemplate = malloc(dwSize)) ||
         !(template = LockResource( hDlgTmpl )))
     {
         COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
         return FALSE;
     }
+
+    /* Copy the read only resource */
+    memcpy(hDialogTemplate, template, dwSize);
     /* msdn: explorer style dialogs permit sizing by default.
      * The OFN_ENABLESIZING flag is only needed when a hook or
@@ -291,12 +298,12 @@
     if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING)
     {
-        ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX;
+        hDialogTemplate->style |= WS_SIZEBOX;
         fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0;
         fodInfos->initial_size.x = fodInfos->initial_size.y = 0;
     }
     else
-        ((LPDLGTEMPLATEW)template)->style &= ~WS_SIZEBOX;
+        hDialogTemplate->style &= ~WS_SIZEBOX;
     /* old style hook messages */
@@ -313,18 +320,20 @@
     if (fodInfos->unicode)
       lRes = DialogBoxIndirectParamW(COMDLG32_hInstance,
-                                     template,
+                                     hDialogTemplate,
                                      fodInfos->ofnInfos->hwndOwner,
                                      FileOpenDlgProc95,
                                      (LPARAM) fodInfos);
     else
       lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
-                                     template,
+                                     hDialogTemplate,
                                      fodInfos->ofnInfos->hwndOwner,
                                      FileOpenDlgProc95,
                                      (LPARAM) fodInfos);
-    if (SUCCEEDED(hr))
+    if (SUCCEEDED(hr))
         OleUninitialize();
+
+    free(hDialogTemplate);
     /* Unable to create the dialog */
     if( lRes == -1)