comdlg32: Make commdlg.dll into a stand-alone 16-bit module.

This commit is contained in:
Alexandre Julliard 2009-11-12 21:14:18 +01:00
parent c8deafdfaa
commit 910f331f8a
15 changed files with 100 additions and 78 deletions

1
.gitignore vendored
View File

@ -44,7 +44,6 @@ dlls/actxprxy/actxprxy_urlhist_p.c
dlls/advapi32/svcctl.h dlls/advapi32/svcctl.h
dlls/advapi32/svcctl_c.c dlls/advapi32/svcctl_c.c
dlls/atl/atliface.h dlls/atl/atliface.h
dlls/commdlg.dll16
dlls/dxdiagn/fil_data.h dlls/dxdiagn/fil_data.h
dlls/gdi.exe16 dlls/gdi.exe16
dlls/jscript/jsglobal.tlb dlls/jscript/jsglobal.tlb

9
configure vendored
View File

@ -14094,6 +14094,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/comm.drv16/Makefile: dlls/comm.drv16/Makefile.in dlls/Makedll.rules" dlls/comm.drv16/Makefile: dlls/comm.drv16/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/comm.drv16/Makefile" ac_config_files="$ac_config_files dlls/comm.drv16/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/commdlg.dll16/Makefile"
test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
commdlg.dll16"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/commdlg.dll16/Makefile: dlls/commdlg.dll16/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/commdlg.dll16/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\ ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/compobj.dll16/Makefile" dlls/compobj.dll16/Makefile"
test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ test "x$enable_win16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@ -18821,6 +18829,7 @@ do
"dlls/comdlg32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/comdlg32/Makefile" ;; "dlls/comdlg32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/comdlg32/Makefile" ;;
"dlls/comdlg32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/comdlg32/tests/Makefile" ;; "dlls/comdlg32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/comdlg32/tests/Makefile" ;;
"dlls/comm.drv16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/comm.drv16/Makefile" ;; "dlls/comm.drv16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/comm.drv16/Makefile" ;;
"dlls/commdlg.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/commdlg.dll16/Makefile" ;;
"dlls/compobj.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/compobj.dll16/Makefile" ;; "dlls/compobj.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/compobj.dll16/Makefile" ;;
"dlls/compstui/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/compstui/Makefile" ;; "dlls/compstui/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/compstui/Makefile" ;;
"dlls/credui/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/credui/Makefile" ;; "dlls/credui/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/credui/Makefile" ;;

View File

@ -2148,6 +2148,7 @@ WINE_CONFIG_MAKEFILE([dlls/comctl32/tests/Makefile],[dlls/Maketest.rules],[dlls]
WINE_CONFIG_MAKEFILE([dlls/comdlg32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/comdlg32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/comdlg32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/comdlg32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/comm.drv16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16]) WINE_CONFIG_MAKEFILE([dlls/comm.drv16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/commdlg.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/compobj.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16]) WINE_CONFIG_MAKEFILE([dlls/compobj.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/compstui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/compstui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/credui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/credui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])

View File

@ -18,7 +18,6 @@ DOCSUBDIRS = $(DLLSUBDIRS)
# 16-bit dlls # 16-bit dlls
WIN16_FILES = \ WIN16_FILES = \
commdlg.dll16 \
gdi.exe16 \ gdi.exe16 \
krnl386.exe16 \ krnl386.exe16 \
user.exe16 \ user.exe16 \
@ -32,9 +31,6 @@ all: $(BUILDSUBDIRS) @WIN16_FILES@
# Placeholders for 16-bit libraries # Placeholders for 16-bit libraries
commdlg.dll16:
echo "comdlg32.dll" >$@
gdi.exe16: gdi.exe16:
echo "gdi32.dll" >$@ echo "gdi32.dll" >$@

View File

@ -13,19 +13,10 @@ C_SRCS = \
filedlg.c \ filedlg.c \
filedlg31.c \ filedlg31.c \
filedlgbrowser.c \ filedlgbrowser.c \
finddlg32.c \ finddlg.c \
fontdlg.c \ fontdlg.c \
printdlg.c printdlg.c
C_SRCS16 = \
colordlg16.c \
filedlg16.c \
finddlg16.c \
fontdlg16.c \
printdlg16.c
SPEC_SRCS16 = commdlg.spec
RC_SRCS = \ RC_SRCS = \
cdlg_Bg.rc \ cdlg_Bg.rc \
cdlg_Ca.rc \ cdlg_Ca.rc \

View File

@ -154,7 +154,6 @@ void COMDLG32_SetCommDlgExtendedError(DWORD err)
/*********************************************************************** /***********************************************************************
* CommDlgExtendedError (COMDLG32.@) * CommDlgExtendedError (COMDLG32.@)
* CommDlgExtendedError (COMMDLG.26)
* *
* Get the thread's local error value if a comdlg32 function fails. * Get the thread's local error value if a comdlg32 function fails.
* RETURNS * RETURNS

View File

@ -72,11 +72,11 @@ static DWORD COMDLG32_FR_GetFlags(HWND hDlgWnd)
{ {
DWORD flags = 0; DWORD flags = 0;
if(IsDlgButtonChecked(hDlgWnd, rad2) == BST_CHECKED) if(IsDlgButtonChecked(hDlgWnd, rad2) == BST_CHECKED)
flags |= FR_DOWN; flags |= FR_DOWN;
if(IsDlgButtonChecked(hDlgWnd, chx1) == BST_CHECKED) if(IsDlgButtonChecked(hDlgWnd, chx1) == BST_CHECKED)
flags |= FR_WHOLEWORD; flags |= FR_WHOLEWORD;
if(IsDlgButtonChecked(hDlgWnd, chx2) == BST_CHECKED) if(IsDlgButtonChecked(hDlgWnd, chx2) == BST_CHECKED)
flags |= FR_MATCHCASE; flags |= FR_MATCHCASE;
return flags; return flags;
} }
@ -94,7 +94,7 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd, COMDLG32_FR_Data *pData, i
if(NotifyCode == BN_CLICKED) if(NotifyCode == BN_CLICKED)
{ {
switch(Id) switch(Id)
{ {
case IDOK: /* Find Next */ case IDOK: /* Find Next */
if(GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat, pData->fr.wFindWhatLen) > 0) if(GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat, pData->fr.wFindWhatLen) > 0)
@ -108,7 +108,7 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd, COMDLG32_FR_Data *pData, i
} }
else else
{ {
strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat); strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
} }
SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra); SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
} }
@ -117,15 +117,15 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd, COMDLG32_FR_Data *pData, i
case IDCANCEL: case IDCANCEL:
pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | FR_DIALOGTERM; pData->user_fr.fra->Flags |= COMDLG32_FR_GetFlags(hDlgWnd) | FR_DIALOGTERM;
SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra); SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
DestroyWindow(hDlgWnd); DestroyWindow(hDlgWnd);
break; break;
case psh2: /* Replace All */ case psh2: /* Replace All */
flag = FR_REPLACEALL; flag = FR_REPLACEALL;
goto Replace; goto Replace;
case psh1: /* Replace */ case psh1: /* Replace */
flag = FR_REPLACE; flag = FR_REPLACE;
Replace: Replace:
if((pData->fr.Flags & FR_WINE_REPLACE) if((pData->fr.Flags & FR_WINE_REPLACE)
&& GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat, pData->fr.wFindWhatLen) > 0) && GetDlgItemTextA(hDlgWnd, edt1, pData->fr.lpstrFindWhat, pData->fr.wFindWhatLen) > 0)
@ -144,8 +144,8 @@ Replace:
} }
else else
{ {
strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat); strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
strcpy(pData->user_fr.fra->lpstrReplaceWith, pData->fr.lpstrReplaceWith); strcpy(pData->user_fr.fra->lpstrReplaceWith, pData->fr.lpstrReplaceWith);
} }
SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra); SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
} }
@ -181,34 +181,34 @@ static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPA
if(iMsg == WM_INITDIALOG) if(iMsg == WM_INITDIALOG)
{ {
pdata = (COMDLG32_FR_Data *)lParam; pdata = (COMDLG32_FR_Data *)lParam;
if(!SetPropA(hDlgWnd, (LPSTR)COMDLG32_Atom, (HANDLE)pdata)) if(!SetPropA(hDlgWnd, (LPSTR)COMDLG32_Atom, (HANDLE)pdata))
{ {
ERR("Could not Set prop; invent a gracefull exit?...\n"); ERR("Could not Set prop; invent a gracefull exit?...\n");
DestroyWindow(hDlgWnd); DestroyWindow(hDlgWnd);
return FALSE; return FALSE;
} }
SendDlgItemMessageA(hDlgWnd, edt1, EM_SETLIMITTEXT, (WPARAM)pdata->fr.wFindWhatLen, 0); SendDlgItemMessageA(hDlgWnd, edt1, EM_SETLIMITTEXT, (WPARAM)pdata->fr.wFindWhatLen, 0);
SendDlgItemMessageA(hDlgWnd, edt1, WM_SETTEXT, 0, (LPARAM)pdata->fr.lpstrFindWhat); SendDlgItemMessageA(hDlgWnd, edt1, WM_SETTEXT, 0, (LPARAM)pdata->fr.lpstrFindWhat);
if(pdata->fr.Flags & FR_WINE_REPLACE) if(pdata->fr.Flags & FR_WINE_REPLACE)
{ {
SendDlgItemMessageA(hDlgWnd, edt2, EM_SETLIMITTEXT, (WPARAM)pdata->fr.wReplaceWithLen, 0); SendDlgItemMessageA(hDlgWnd, edt2, EM_SETLIMITTEXT, (WPARAM)pdata->fr.wReplaceWithLen, 0);
SendDlgItemMessageA(hDlgWnd, edt2, WM_SETTEXT, 0, (LPARAM)pdata->fr.lpstrReplaceWith); SendDlgItemMessageA(hDlgWnd, edt2, WM_SETTEXT, 0, (LPARAM)pdata->fr.lpstrReplaceWith);
} }
if(!(pdata->fr.Flags & FR_SHOWHELP)) if(!(pdata->fr.Flags & FR_SHOWHELP))
ShowWindow(GetDlgItem(hDlgWnd, pshHelp), SW_HIDE); ShowWindow(GetDlgItem(hDlgWnd, pshHelp), SW_HIDE);
if(pdata->fr.Flags & FR_HIDEUPDOWN) if(pdata->fr.Flags & FR_HIDEUPDOWN)
{ {
ShowWindow(GetDlgItem(hDlgWnd, rad1), SW_HIDE); ShowWindow(GetDlgItem(hDlgWnd, rad1), SW_HIDE);
ShowWindow(GetDlgItem(hDlgWnd, rad2), SW_HIDE); ShowWindow(GetDlgItem(hDlgWnd, rad2), SW_HIDE);
ShowWindow(GetDlgItem(hDlgWnd, grp1), SW_HIDE); ShowWindow(GetDlgItem(hDlgWnd, grp1), SW_HIDE);
} }
else if(pdata->fr.Flags & FR_NOUPDOWN) else if(pdata->fr.Flags & FR_NOUPDOWN)
{ {
EnableWindow(GetDlgItem(hDlgWnd, rad1), FALSE); EnableWindow(GetDlgItem(hDlgWnd, rad1), FALSE);
EnableWindow(GetDlgItem(hDlgWnd, rad2), FALSE); EnableWindow(GetDlgItem(hDlgWnd, rad2), FALSE);
EnableWindow(GetDlgItem(hDlgWnd, grp1), FALSE); EnableWindow(GetDlgItem(hDlgWnd, grp1), FALSE);
} }
else else
{ {
SendDlgItemMessageA(hDlgWnd, rad1, BM_SETCHECK, pdata->fr.Flags & FR_DOWN ? 0 : BST_CHECKED, 0); SendDlgItemMessageA(hDlgWnd, rad1, BM_SETCHECK, pdata->fr.Flags & FR_DOWN ? 0 : BST_CHECKED, 0);
@ -217,14 +217,14 @@ static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPA
if(pdata->fr.Flags & FR_HIDEMATCHCASE) if(pdata->fr.Flags & FR_HIDEMATCHCASE)
ShowWindow(GetDlgItem(hDlgWnd, chx2), SW_HIDE); ShowWindow(GetDlgItem(hDlgWnd, chx2), SW_HIDE);
else if(pdata->fr.Flags & FR_NOMATCHCASE) else if(pdata->fr.Flags & FR_NOMATCHCASE)
EnableWindow(GetDlgItem(hDlgWnd, chx2), FALSE); EnableWindow(GetDlgItem(hDlgWnd, chx2), FALSE);
else else
SendDlgItemMessageA(hDlgWnd, chx2, BM_SETCHECK, pdata->fr.Flags & FR_MATCHCASE ? BST_CHECKED : 0, 0); SendDlgItemMessageA(hDlgWnd, chx2, BM_SETCHECK, pdata->fr.Flags & FR_MATCHCASE ? BST_CHECKED : 0, 0);
if(pdata->fr.Flags & FR_HIDEWHOLEWORD) if(pdata->fr.Flags & FR_HIDEWHOLEWORD)
ShowWindow(GetDlgItem(hDlgWnd, chx1), SW_HIDE); ShowWindow(GetDlgItem(hDlgWnd, chx1), SW_HIDE);
else if(pdata->fr.Flags & FR_NOWHOLEWORD) else if(pdata->fr.Flags & FR_NOWHOLEWORD)
EnableWindow(GetDlgItem(hDlgWnd, chx1), FALSE); EnableWindow(GetDlgItem(hDlgWnd, chx1), FALSE);
else else
SendDlgItemMessageA(hDlgWnd, chx1, BM_SETCHECK, pdata->fr.Flags & FR_WHOLEWORD ? BST_CHECKED : 0, 0); SendDlgItemMessageA(hDlgWnd, chx1, BM_SETCHECK, pdata->fr.Flags & FR_WHOLEWORD ? BST_CHECKED : 0, 0);
@ -233,7 +233,7 @@ static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPA
/* We do not do ShowWindow if hook exists and is FALSE */ /* We do not do ShowWindow if hook exists and is FALSE */
/* per MSDN Article Q96135 */ /* per MSDN Article Q96135 */
if((pdata->fr.Flags & FR_ENABLEHOOK) if((pdata->fr.Flags & FR_ENABLEHOOK)
&& ! pdata->fr.lpfnHook(hDlgWnd, iMsg, wParam, (LPARAM) &pdata->fr)) && ! pdata->fr.lpfnHook(hDlgWnd, iMsg, wParam, (LPARAM) &pdata->fr))
return TRUE; return TRUE;
ShowWindow(hDlgWnd, SW_SHOWNORMAL); ShowWindow(hDlgWnd, SW_SHOWNORMAL);
@ -248,28 +248,28 @@ static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPA
else else
retval = FALSE; retval = FALSE;
if(pdata && !retval) if(pdata && !retval)
{ {
retval = TRUE; retval = TRUE;
switch(iMsg) switch(iMsg)
{ {
case WM_COMMAND: case WM_COMMAND:
COMDLG32_FR_HandleWMCommand(hDlgWnd, pdata, LOWORD(wParam), HIWORD(wParam)); COMDLG32_FR_HandleWMCommand(hDlgWnd, pdata, LOWORD(wParam), HIWORD(wParam));
break; break;
case WM_CLOSE: case WM_CLOSE:
COMDLG32_FR_HandleWMCommand(hDlgWnd, pdata, IDCANCEL, BN_CLICKED); COMDLG32_FR_HandleWMCommand(hDlgWnd, pdata, IDCANCEL, BN_CLICKED);
break; break;
case WM_HELP: case WM_HELP:
/* Heeeeelp! */ /* Heeeeelp! */
FIXME("Got WM_HELP. Who is gonna supply it?\n"); FIXME("Got WM_HELP. Who is gonna supply it?\n");
break; break;
case WM_CONTEXTMENU: case WM_CONTEXTMENU:
/* Heeeeelp! */ /* Heeeeelp! */
FIXME("Got WM_CONTEXTMENU. Who is gonna supply it?\n"); FIXME("Got WM_CONTEXTMENU. Who is gonna supply it?\n");
break; break;
/* FIXME: Handle F1 help */ /* FIXME: Handle F1 help */
default: default:
@ -283,8 +283,8 @@ static INT_PTR CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPA
*/ */
if(iMsg == WM_DESTROY) if(iMsg == WM_DESTROY)
{ {
RemovePropA(hDlgWnd, (LPSTR)COMDLG32_Atom); RemovePropA(hDlgWnd, (LPSTR)COMDLG32_Atom);
HeapFree(GetProcessHeap(), 0, pdata); HeapFree(GetProcessHeap(), 0, pdata);
} }
return retval; return retval;
@ -304,55 +304,55 @@ static BOOL COMDLG32_FR_CheckPartial(
) { ) {
if(!pfr) if(!pfr)
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_GENERALCODES); COMDLG32_SetCommDlgExtendedError(CDERR_GENERALCODES);
return FALSE; return FALSE;
} }
if(pfr->lStructSize != sizeof(FINDREPLACEA)) if(pfr->lStructSize != sizeof(FINDREPLACEA))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE);
return FALSE; return FALSE;
} }
if(!IsWindow(pfr->hwndOwner)) if(!IsWindow(pfr->hwndOwner))
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_DIALOGFAILURE); COMDLG32_SetCommDlgExtendedError(CDERR_DIALOGFAILURE);
return FALSE; return FALSE;
} }
if((pfr->wFindWhatLen < 1 || !pfr->lpstrFindWhat) if((pfr->wFindWhatLen < 1 || !pfr->lpstrFindWhat)
||(Replace && (pfr->wReplaceWithLen < 1 || !pfr->lpstrReplaceWith))) ||(Replace && (pfr->wReplaceWithLen < 1 || !pfr->lpstrReplaceWith)))
{ {
COMDLG32_SetCommDlgExtendedError(FRERR_BUFFERLENGTHZERO); COMDLG32_SetCommDlgExtendedError(FRERR_BUFFERLENGTHZERO);
return FALSE; return FALSE;
} }
if((FindReplaceMessage = RegisterWindowMessageA(FINDMSGSTRINGA)) == 0) if((FindReplaceMessage = RegisterWindowMessageA(FINDMSGSTRINGA)) == 0)
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL); COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL);
return FALSE; return FALSE;
} }
if((HelpMessage = RegisterWindowMessageA(HELPMSGSTRINGA)) == 0) if((HelpMessage = RegisterWindowMessageA(HELPMSGSTRINGA)) == 0)
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL); COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL);
return FALSE; return FALSE;
} }
if((pfr->Flags & FR_ENABLEHOOK) && !pfr->lpfnHook) if((pfr->Flags & FR_ENABLEHOOK) && !pfr->lpfnHook)
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_NOHOOK); COMDLG32_SetCommDlgExtendedError(CDERR_NOHOOK);
return FALSE; return FALSE;
} }
if((pfr->Flags & (FR_ENABLETEMPLATE | FR_ENABLETEMPLATEHANDLE)) && !pfr->hInstance) if((pfr->Flags & (FR_ENABLETEMPLATE | FR_ENABLETEMPLATEHANDLE)) && !pfr->hInstance)
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_NOHINSTANCE); COMDLG32_SetCommDlgExtendedError(CDERR_NOHINSTANCE);
return FALSE; return FALSE;
} }
if((pfr->Flags & FR_ENABLETEMPLATE) && !pfr->lpTemplateName) if((pfr->Flags & FR_ENABLETEMPLATE) && !pfr->lpTemplateName)
{ {
COMDLG32_SetCommDlgExtendedError(CDERR_NOTEMPLATE); COMDLG32_SetCommDlgExtendedError(CDERR_NOTEMPLATE);
return FALSE; return FALSE;
} }
@ -380,7 +380,7 @@ static HWND COMDLG32_FR_DoFindReplace(
{ {
HMODULE hmod = COMDLG32_hInstance; HMODULE hmod = COMDLG32_hInstance;
HRSRC htemplate; HRSRC htemplate;
if(pdata->fr.Flags & FR_ENABLETEMPLATE) if(pdata->fr.Flags & FR_ENABLETEMPLATE)
{ {
hmod = pdata->fr.hInstance; hmod = pdata->fr.hInstance;
if(pdata->fr.Flags & FR_WINE_UNICODE) if(pdata->fr.Flags & FR_WINE_UNICODE)
@ -391,18 +391,18 @@ static HWND COMDLG32_FR_DoFindReplace(
{ {
htemplate = FindResourceA(hmod, pdata->fr.lpTemplateName, (LPCSTR)RT_DIALOG); htemplate = FindResourceA(hmod, pdata->fr.lpTemplateName, (LPCSTR)RT_DIALOG);
} }
} }
else else
{ {
int rcid = pdata->fr.Flags & FR_WINE_REPLACE ? REPLACEDLGORD int rcid = pdata->fr.Flags & FR_WINE_REPLACE ? REPLACEDLGORD
: FINDDLGORD; : FINDDLGORD;
htemplate = FindResourceA(hmod, MAKEINTRESOURCEA(rcid), (LPCSTR)RT_DIALOG); htemplate = FindResourceA(hmod, MAKEINTRESOURCEA(rcid), (LPCSTR)RT_DIALOG);
} }
if(!htemplate) if(!htemplate)
{ {
error = CDERR_FINDRESFAILURE; error = CDERR_FINDRESFAILURE;
goto cleanup; goto cleanup;
} }
loadrc = LoadResource(hmod, htemplate); loadrc = LoadResource(hmod, htemplate);
} }
@ -424,15 +424,15 @@ static HWND COMDLG32_FR_DoFindReplace(
} }
hdlgwnd = CreateDialogIndirectParamA(COMDLG32_hInstance, hdlgwnd = CreateDialogIndirectParamA(COMDLG32_hInstance,
rcs, rcs,
pdata->fr.hwndOwner, pdata->fr.hwndOwner,
COMDLG32_FindReplaceDlgProc, COMDLG32_FindReplaceDlgProc,
(LPARAM)pdata); (LPARAM)pdata);
if(!hdlgwnd) if(!hdlgwnd)
{ {
error = CDERR_DIALOGFAILURE; error = CDERR_DIALOGFAILURE;
cleanup: cleanup:
COMDLG32_SetCommDlgExtendedError(error); COMDLG32_SetCommDlgExtendedError(error);
HeapFree(GetProcessHeap(), 0, pdata); HeapFree(GetProcessHeap(), 0, pdata);
} }
return hdlgwnd; return hdlgwnd;
@ -451,10 +451,10 @@ HWND WINAPI FindTextA(
TRACE("LPFINDREPLACE=%p\n", pfr); TRACE("LPFINDREPLACE=%p\n", pfr);
if(!COMDLG32_FR_CheckPartial(pfr, FALSE)) if(!COMDLG32_FR_CheckPartial(pfr, FALSE))
return 0; return 0;
if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data))) == NULL) if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data))) == NULL)
return 0; /* Error has been set */ return 0; /* Error has been set */
pdata->user_fr.fra = pfr; pdata->user_fr.fra = pfr;
pdata->fr = *pfr; pdata->fr = *pfr;
@ -474,10 +474,10 @@ HWND WINAPI ReplaceTextA(
TRACE("LPFINDREPLACE=%p\n", pfr); TRACE("LPFINDREPLACE=%p\n", pfr);
if(!COMDLG32_FR_CheckPartial(pfr, TRUE)) if(!COMDLG32_FR_CheckPartial(pfr, TRUE))
return 0; return 0;
if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data))) == NULL) if((pdata = COMDLG32_AllocMem(sizeof(COMDLG32_FR_Data))) == NULL)
return 0; /* Error has been set */ return 0; /* Error has been set */
pdata->user_fr.fra = pfr; pdata->user_fr.fra = pfr;
pdata->fr = *pfr; pdata->fr = *pfr;
@ -503,7 +503,7 @@ HWND WINAPI FindTextW(
TRACE("LPFINDREPLACE=%p\n", pfr); TRACE("LPFINDREPLACE=%p\n", pfr);
if(!COMDLG32_FR_CheckPartial((LPFINDREPLACEA)pfr, FALSE)) if(!COMDLG32_FR_CheckPartial((LPFINDREPLACEA)pfr, FALSE))
return 0; return 0;
len = WideCharToMultiByte( CP_ACP, 0, pfr->lpstrFindWhat, pfr->wFindWhatLen, len = WideCharToMultiByte( CP_ACP, 0, pfr->lpstrFindWhat, pfr->wFindWhatLen,
NULL, 0, NULL, NULL ); NULL, 0, NULL, NULL );
@ -537,7 +537,7 @@ HWND WINAPI ReplaceTextW(
TRACE("LPFINDREPLACE=%p\n", pfr); TRACE("LPFINDREPLACE=%p\n", pfr);
if(!COMDLG32_FR_CheckPartial((LPFINDREPLACEA)pfr, FALSE)) if(!COMDLG32_FR_CheckPartial((LPFINDREPLACEA)pfr, FALSE))
return 0; return 0;
len1 = WideCharToMultiByte( CP_ACP, 0, pfr->lpstrFindWhat, pfr->wFindWhatLen, len1 = WideCharToMultiByte( CP_ACP, 0, pfr->lpstrFindWhat, pfr->wFindWhatLen,
NULL, 0, NULL, NULL ); NULL, 0, NULL, NULL );

View File

@ -0,0 +1,18 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = commdlg.dll16
IMPORTS = comdlg32 user32 gdi32 kernel32
EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,comdlg32.dll
C_SRCS = \
colordlg.c \
filedlg.c \
finddlg.c \
fontdlg.c \
printdlg.c
@MAKE_DLL_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

View File

@ -18,7 +18,7 @@
22 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc16 22 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc16
#23 pascal EDITINTEGERONLY exported, shared data #23 pascal EDITINTEGERONLY exported, shared data
#25 pascal WANTARROWS exported, shared data #25 pascal WANTARROWS exported, shared data
26 pascal CommDlgExtendedError() CommDlgExtendedError 26 pascal CommDlgExtendedError() CommDlgExtendedError16
27 pascal -ret16 GetFileTitle(str ptr word) GetFileTitle16 27 pascal -ret16 GetFileTitle(str ptr word) GetFileTitle16
#28 pascal WEP exported, shared data #28 pascal WEP exported, shared data
#29 pascal DWLBSUBCLASS exported, shared data #29 pascal DWLBSUBCLASS exported, shared data

View File

@ -315,3 +315,12 @@ BOOL16 CALLBACK ReplaceTextDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam
{ {
return replace_text_dlgproc( HWND_32(hWnd16), wMsg, wParam, lParam ); return replace_text_dlgproc( HWND_32(hWnd16), wMsg, wParam, lParam );
} }
/***********************************************************************
* CommDlgExtendedError (COMMDLG.26)
*/
DWORD WINAPI CommDlgExtendedError16(void)
{
return CommDlgExtendedError();
}