mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
[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. svn path=/trunk/; revision=56897
This commit is contained in:
@@ -1,15 +0,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>
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user