diff --git a/reactos/dll/win32/browseui/browseui_ros.diff b/reactos/dll/win32/browseui/browseui_ros.diff
deleted file mode 100644
index 9570e0fefe6..00000000000
--- a/reactos/dll/win32/browseui/browseui_ros.diff
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: browseui.rbuild
-===================================================================
---- browseui.rbuild (revision 23123)
-+++ browseui.rbuild (working copy)
-@@ -9,8 +9,8 @@
-
-
- 0x600
-- 0x501
-- 0x501
-+ 0x600
-+ 0x600
- wine
- ole32
- user32
diff --git a/reactos/dll/win32/comdlg32/comdlg32_ros.diff b/reactos/dll/win32/comdlg32/comdlg32_ros.diff
new file mode 100644
index 00000000000..7a310d01db6
--- /dev/null
+++ b/reactos/dll/win32/comdlg32/comdlg32_ros.diff
@@ -0,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;
diff --git a/reactos/dll/win32/comdlg32/filedlg.c b/reactos/dll/win32/comdlg32/filedlg.c
index 339547c33a0..150e29df516 100644
--- a/reactos/dll/win32/comdlg32/filedlg.c
+++ b/reactos/dll/win32/comdlg32/filedlg.c
@@ -260,6 +260,8 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
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 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
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 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
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 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos)
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;