Removed MODULE_GetWndProcEntry16().

Use 32-bit window procedures in COMMDLG instead.
This commit is contained in:
Ulrich Weigand 1999-07-24 10:27:58 +00:00 committed by Alexandre Julliard
parent 1a97191e83
commit 8dbffe70fb
10 changed files with 140 additions and 89 deletions

View file

@ -26,6 +26,27 @@ DEFAULT_DEBUG_CHANNEL(commdlg)
#include "cdlg.h" #include "cdlg.h"
/***********************************************************************
* ColorDlgProc [internal]
*
* FIXME: Convert to real 32-bit message processing
*/
static LRESULT WINAPI ColorDlgProc(HWND hDlg, UINT msg,
WPARAM wParam, LPARAM lParam)
{
UINT16 msg16;
MSGPARAM16 mp16;
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hDlg, msg, wParam,
&msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
mp16.lResult = ColorDlgProc16( (HWND16)hDlg, msg16, mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32ATo16( hDlg, msg, wParam, lParam, &mp16 );
return mp16.lResult;
}
/*********************************************************************** /***********************************************************************
* ChooseColor (COMMDLG.5) * ChooseColor (COMMDLG.5)
*/ */
@ -85,8 +106,8 @@ BOOL16 WINAPI ChooseColor16(LPCHOOSECOLOR16 lpChCol)
hInst = GetWindowLongA( lpChCol->hwndOwner, GWL_HINSTANCE ); hInst = GetWindowLongA( lpChCol->hwndOwner, GWL_HINSTANCE );
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format, hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpChCol->hwndOwner, lpChCol->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("ColorDlgProc"), (DLGPROC16)ColorDlgProc,
(DWORD)lpChCol, WIN_PROC_16 ); (DWORD)lpChCol, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpChCol->hwndOwner); if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpChCol->hwndOwner);
if (hDlgTmpl) FreeResource16( hDlgTmpl ); if (hDlgTmpl) FreeResource16( hDlgTmpl );
@ -1165,7 +1186,6 @@ LRESULT WINAPI ColorDlgProc16(HWND16 hDlg, UINT16 message,
return FALSE ; return FALSE ;
} }
/*********************************************************************** /***********************************************************************
* ChooseColorA (COMDLG32.1) * ChooseColorA (COMDLG32.1)
*/ */

View file

@ -73,6 +73,50 @@ static BOOL FileDlg_Init(void)
return TRUE; return TRUE;
} }
/***********************************************************************
* FileOpenDlgProc [internal]
*
* FIXME: Convert to real 32-bit message processing
*/
static LRESULT WINAPI FileOpenDlgProc(HWND hDlg, UINT msg,
WPARAM wParam, LPARAM lParam)
{
UINT16 msg16;
MSGPARAM16 mp16;
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hDlg, msg, wParam,
&msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
mp16.lResult = FileOpenDlgProc16( (HWND16)hDlg, msg16,
mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32ATo16( hDlg, msg, wParam, lParam, &mp16 );
return mp16.lResult;
}
/***********************************************************************
* FileSaveDlgProc [internal]
*
* FIXME: Convert to real 32-bit message processing
*/
static LRESULT WINAPI FileSaveDlgProc(HWND hDlg, UINT msg,
WPARAM wParam, LPARAM lParam)
{
UINT16 msg16;
MSGPARAM16 mp16;
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hDlg, msg, wParam,
&msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
mp16.lResult = FileSaveDlgProc16( (HWND16)hDlg, msg16,
mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32ATo16( hDlg, msg, wParam, lParam, &mp16 );
return mp16.lResult;
}
/*********************************************************************** /***********************************************************************
* GetOpenFileName16 (COMMDLG.1) * GetOpenFileName16 (COMMDLG.1)
* *
@ -199,8 +243,8 @@ BOOL16 WINAPI GetOpenFileName16(
/* FIXME: doesn't handle win32 format correctly yet */ /* FIXME: doesn't handle win32 format correctly yet */
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format, hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpofn->hwndOwner, lpofn->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"), (DLGPROC16)FileOpenDlgProc,
ofn, WIN_PROC_16 ); ofn, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner ); if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner );
if (str1) if (str1)
@ -361,8 +405,8 @@ BOOL16 WINAPI GetSaveFileName16(
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format, hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpofn->hwndOwner, lpofn->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FileSaveDlgProc"), (DLGPROC16)FileSaveDlgProc,
ofn, WIN_PROC_16 ); ofn, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner ); if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner );
if (str1) if (str1)

View file

@ -24,6 +24,50 @@ DEFAULT_DEBUG_CHANNEL(commdlg)
#include "cdlg.h" #include "cdlg.h"
/***********************************************************************
* FindTextDlgProc [internal]
*
* FIXME: Convert to real 32-bit message processing
*/
static LRESULT WINAPI FindTextDlgProc(HWND hDlg, UINT msg,
WPARAM wParam, LPARAM lParam)
{
UINT16 msg16;
MSGPARAM16 mp16;
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hDlg, msg, wParam,
&msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
mp16.lResult = FindTextDlgProc16( (HWND16)hDlg, msg16,
mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32ATo16( hDlg, msg, wParam, lParam, &mp16 );
return mp16.lResult;
}
/***********************************************************************
* ReplaceTextDlgProc [internal]
*
* FIXME: Convert to real 32-bit message processing
*/
static LRESULT WINAPI ReplaceTextDlgProc(HWND hDlg, UINT msg,
WPARAM wParam, LPARAM lParam)
{
UINT16 msg16;
MSGPARAM16 mp16;
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( hDlg, msg, wParam,
&msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
mp16.lResult = ReplaceTextDlgProc16( (HWND16)hDlg, msg16,
mp16.wParam, mp16.lParam );
WINPROC_UnmapMsg32ATo16( hDlg, msg, wParam, lParam, &mp16 );
return mp16.lResult;
}
/*********************************************************************** /***********************************************************************
* FindText16 (COMMDLG.11) * FindText16 (COMMDLG.11)
*/ */
@ -53,8 +97,8 @@ HWND16 WINAPI FindText16( SEGPTR find )
} }
hInst = GetWindowLongA( lpFind->hwndOwner , GWL_HINSTANCE); hInst = GetWindowLongA( lpFind->hwndOwner , GWL_HINSTANCE);
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner, return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FindTextDlgProc"), (DLGPROC16)FindTextDlgProc,
find, WIN_PROC_16 ); find, WIN_PROC_32A );
} }
@ -87,8 +131,8 @@ HWND16 WINAPI ReplaceText16( SEGPTR find )
} }
hInst = GetWindowLongA( lpFind->hwndOwner , GWL_HINSTANCE); hInst = GetWindowLongA( lpFind->hwndOwner , GWL_HINSTANCE);
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner, return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("ReplaceTextDlgProc"), (DLGPROC16)ReplaceTextDlgProc,
find, WIN_PROC_16 ); find, WIN_PROC_32A );
} }

View file

@ -122,8 +122,8 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format, hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpChFont->hwndOwner, lpChFont->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FormatCharDlgProc"), (DLGPROC16)FormatCharDlgProcA,
(DWORD)lpChFont, WIN_PROC_16 ); (DWORD)lpChFont, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox(hwndDialog, lpChFont->hwndOwner); if (hwndDialog) bRet = DIALOG_DoDialogBox(hwndDialog, lpChFont->hwndOwner);
if (hDlgTmpl) FreeResource16( hDlgTmpl ); if (hDlgTmpl) FreeResource16( hDlgTmpl );
lpChFont->lpTemplateName=lpTemplateName; lpChFont->lpTemplateName=lpTemplateName;

View file

@ -67,9 +67,9 @@ BOOL16 WINAPI PrintDlg16( SEGPTR printdlg )
hwndDialog = DIALOG_CreateIndirect( hInst, template, TRUE, hwndDialog = DIALOG_CreateIndirect( hInst, template, TRUE,
lpPrint->hwndOwner, lpPrint->hwndOwner,
(DLGPROC16)((lpPrint->Flags & PD_PRINTSETUP) ? (DLGPROC16)((lpPrint->Flags & PD_PRINTSETUP) ?
MODULE_GetWndProcEntry16("PrintSetupDlgProc") : /* FIXME: PrintSetupDlgProc */ PrintDlgProcA :
MODULE_GetWndProcEntry16("PrintDlgProc")), PrintDlgProcA ),
printdlg, WIN_PROC_16 ); printdlg, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpPrint->hwndOwner); if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpPrint->hwndOwner);
return bRet; return bRet;
} }

View file

@ -1,18 +1,9 @@
name wprocs name wprocs
type win16 type win16
14 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc16
15 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc16
16 pascal ColorDlgProc(word word word long) ColorDlgProc16
17 pascal FindTextDlgProc(word word word long) FindTextDlgProc16
18 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc16
19 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc16
20 pascal PrintDlgProc(word word word long) PrintDlgProc16
23 pascal UTGlue16(ptr long ptr long) UTGlue16 23 pascal UTGlue16(ptr long ptr long) UTGlue16
24 pascal16 TASK_Reschedule() TASK_Reschedule
27 pascal EntryAddrProc(word word) NE_GetEntryPoint 27 pascal EntryAddrProc(word word) NE_GetEntryPoint
28 pascal MyAlloc(word word word) NE_AllocateSegment 28 pascal MyAlloc(word word word) NE_AllocateSegment
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc16
# Interrupt vectors 0-255 are ordinals 100-355 # Interrupt vectors 0-255 are ordinals 100-355
# The 'word' parameter are the flags pushed on the stack by the interrupt # The 'word' parameter are the flags pushed on the stack by the interrupt

View file

@ -627,13 +627,7 @@ LRESULT WINAPI FileOpenDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPAR
LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam); LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI ColorDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam); LRESULT WINAPI ColorDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam); LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProcA(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProcW(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
#define FindTextDlgProc WINELIB_NAME_AW(FindTextDlgProc)
LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam); LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI ReplaceTextDlgProcA(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT WINAPI ReplaceTextDlgProcW(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
#define ReplaceTextProc WINELIB_NAME_AW(ReplaceTextDlgProc)
LRESULT WINAPI PrintDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam); LRESULT WINAPI PrintDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI PrintDlgProcA(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); LRESULT WINAPI PrintDlgProcA(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT WINAPI PrintDlgProcW(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); LRESULT WINAPI PrintDlgProcW(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);

View file

@ -184,7 +184,6 @@ extern WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD fl
extern BOOL MODULE_FreeLibrary( WINE_MODREF *wm ); extern BOOL MODULE_FreeLibrary( WINE_MODREF *wm );
extern WINE_MODREF *MODULE_FindModule( LPCSTR path ); extern WINE_MODREF *MODULE_FindModule( LPCSTR path );
extern HMODULE MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName ); extern HMODULE MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hmodule, LPCSTR name ); extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE hmodule, LPCSTR name );
extern SEGPTR WINAPI HasGPHandler16( SEGPTR address ); extern SEGPTR WINAPI HasGPHandler16( SEGPTR address );
extern void MODULE_WalkModref( DWORD id ); extern void MODULE_WalkModref( DWORD id );

View file

@ -420,61 +420,6 @@ HMODULE MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName )
} }
/***********************************************************************
* MODULE_GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WPROCS dll.
*/
FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
{
FARPROC16 ret = NULL;
if (__winelib)
{
/* FIXME: hack for Winelib */
extern LRESULT ColorDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileOpenDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileSaveDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FindTextDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintSetupDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT ReplaceTextDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
if (!strcmp(name,"ColorDlgProc"))
return (FARPROC16)ColorDlgProc16;
if (!strcmp(name,"FileOpenDlgProc"))
return (FARPROC16)FileOpenDlgProc16;
if (!strcmp(name,"FileSaveDlgProc"))
return (FARPROC16)FileSaveDlgProc16;
if (!strcmp(name,"FindTextDlgProc"))
return (FARPROC16)FindTextDlgProc16;
if (!strcmp(name,"PrintDlgProc"))
return (FARPROC16)PrintDlgProc16;
if (!strcmp(name,"PrintSetupDlgProc"))
return (FARPROC16)PrintSetupDlgProc16;
if (!strcmp(name,"ReplaceTextDlgProc"))
return (FARPROC16)ReplaceTextDlgProc16;
FIXME_(module)("No mapping for %s(), add one in library/miscstubs.c\n",name);
assert( FALSE );
return NULL;
}
else
{
WORD ordinal;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle16( "WPROCS" );
ordinal = NE_GetOrdinal( hModule, name );
if (!(ret = NE_GetEntryPoint( hModule, ordinal )))
{
WARN_(module)("%s not found\n", name );
assert( FALSE );
}
}
return ret;
}
/********************************************************************** /**********************************************************************
* MODULE_FindModule32 * MODULE_FindModule32
* *

View file

@ -4,6 +4,7 @@
* Copyright 1999 Ulrich Weigand * Copyright 1999 Ulrich Weigand
*/ */
#include "wine/winbase16.h"
#include "windef.h" #include "windef.h"
#include "heap.h" #include "heap.h"
#include "module.h" #include "module.h"
@ -139,7 +140,20 @@ static DWORD WINAPI UTGlue32( FARPROC16 target, LPVOID lpBuff, DWORD dwUserDefin
static UTINFO *UTAlloc( HMODULE hModule, HMODULE16 hModule16, static UTINFO *UTAlloc( HMODULE hModule, HMODULE16 hModule16,
FARPROC16 target16, FARPROC target32 ) FARPROC16 target16, FARPROC target32 )
{ {
UTINFO *ut = HeapAlloc( SegptrHeap, HEAP_ZERO_MEMORY, sizeof(UTINFO) ); static FARPROC16 UTGlue16_Segptr = NULL;
UTINFO *ut;
if ( !UTGlue16_Segptr )
{
HMODULE16 hModule = GetModuleHandle16( "WPROCS" );
int ordinal = NE_GetOrdinal( hModule, "UTGlue16" );
if ( hModule && ordinal )
UTGlue16_Segptr = NE_GetEntryPoint( hModule, ordinal );
if ( !UTGlue16_Segptr ) return NULL;
}
ut = HeapAlloc( SegptrHeap, HEAP_ZERO_MEMORY, sizeof(UTINFO) );
if ( !ut ) return NULL; if ( !ut ) return NULL;
ut->hModule = hModule; ut->hModule = hModule;
@ -150,7 +164,7 @@ static UTINFO *UTAlloc( HMODULE hModule, HMODULE16 hModule16,
ut->ut16.target = (DWORD)target32; ut->ut16.target = (DWORD)target32;
ut->ut16.pushl_eax = 0x50; ut->ut16.pushl_eax = 0x50;
ut->ut16.ljmp = 0xea; ut->ut16.ljmp = 0xea;
ut->ut16.utglue16 = (DWORD)MODULE_GetWndProcEntry16( "UTGlue16" ); ut->ut16.utglue16 = (DWORD)UTGlue16_Segptr;
ut->ut32.popl_eax = 0x58; ut->ut32.popl_eax = 0x58;
ut->ut32.pushl = 0x68; ut->ut32.pushl = 0x68;