info->ofnInfos = ofn;
info->title = ofn->lpstrTitle;
+#ifdef __REACTOS__
+ if (ofn->lpstrDefExt)
+ {
+ INT cchExt = lstrlenW(ofn->lpstrDefExt);
+ LPWSTR pszExt = heap_alloc((cchExt + 1) * sizeof(WCHAR));
+ lstrcpyW(pszExt, ofn->lpstrDefExt);
+ info->defext = pszExt;
+ }
+#else
info->defext = ofn->lpstrDefExt;
+#endif
info->filter = ofn->lpstrFilter;
info->customfilter = ofn->lpstrCustomFilter;
heap_free((void *)info->filter);
heap_free((void *)info->customfilter);
}
+#ifdef __REACTOS__
+ else
+ {
+ heap_free((void *)info->defext);
+ }
+#endif
heap_free(info->filename);
heap_free(info->initdir);
else retval = FALSE;
break;
+#ifdef __REACTOS__
+ case CDM_SETDEFEXT:
+ {
+ LPWSTR olddefext = (LPWSTR)fodInfos->defext;
+ fodInfos->defext = NULL;
+
+ if (fodInfos->unicode)
+ {
+ LPCWSTR pszExt = (LPCWSTR)lParam;
+ if (pszExt)
+ {
+ INT cchExt = lstrlenW(pszExt);
+ fodInfos->defext = heap_alloc((cchExt + 1) * sizeof(WCHAR));
+ lstrcpyW((LPWSTR)fodInfos->defext, pszExt);
+ }
+ }
+ else
+ {
+ LPCSTR pszExt = (LPCSTR)lParam;
+ if (pszExt)
+ fodInfos->defext = heap_strdupAtoW(pszExt);
+ }
+
+ heap_free(olddefext);
+ break;
+ }
+#endif
+
default:
if (uMsg >= CDM_FIRST && uMsg <= CDM_LAST)
FIXME("message CDM_FIRST+%04x not implemented\n", uMsg - CDM_FIRST);