2 ===================================================================
3 --- filedlg.c (Revision 56893)
4 +++ filedlg.c (Arbeitskopie)
10 + LPDLGTEMPLATE hDialogTemplate;
12 /* test for missing functionality */
13 if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS)
17 if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) ||
18 + !(dwSize = SizeofResource(COMDLG32_hInstance, hRes )) ||
19 + !(hDialogTemplate = malloc(dwSize)) ||
20 !(template = LockResource( hDlgTmpl )))
22 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
26 + /* Copy the read only resource */
27 + memcpy(hDialogTemplate, template, dwSize);
29 /* msdn: explorer style dialogs permit sizing by default.
30 * The OFN_ENABLESIZING flag is only needed when a hook or
31 * custom tmeplate is provided */
34 if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING)
36 - ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX;
37 + hDialogTemplate->style |= WS_SIZEBOX;
38 fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0;
39 fodInfos->initial_size.x = fodInfos->initial_size.y = 0;
42 - ((LPDLGTEMPLATEW)template)->style &= ~WS_SIZEBOX;
43 + hDialogTemplate->style &= ~WS_SIZEBOX;
46 /* old style hook messages */
49 if (fodInfos->unicode)
50 lRes = DialogBoxIndirectParamW(COMDLG32_hInstance,
53 fodInfos->ofnInfos->hwndOwner,
57 lRes = DialogBoxIndirectParamA(COMDLG32_hInstance,
60 fodInfos->ofnInfos->hwndOwner,
67 + free(hDialogTemplate);
69 /* Unable to create the dialog */