Commit 8dbffe70 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Removed MODULE_GetWndProcEntry16().

Use 32-bit window procedures in COMMDLG instead.
parent 1a97191e
......@@ -27,6 +27,27 @@ DEFAULT_DEBUG_CHANNEL(commdlg)
#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)
*/
BOOL16 WINAPI ChooseColor16(LPCHOOSECOLOR16 lpChCol)
......@@ -85,8 +106,8 @@ BOOL16 WINAPI ChooseColor16(LPCHOOSECOLOR16 lpChCol)
hInst = GetWindowLongA( lpChCol->hwndOwner, GWL_HINSTANCE );
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpChCol->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol, WIN_PROC_16 );
(DLGPROC16)ColorDlgProc,
(DWORD)lpChCol, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpChCol->hwndOwner);
if (hDlgTmpl) FreeResource16( hDlgTmpl );
......@@ -1165,7 +1186,6 @@ LRESULT WINAPI ColorDlgProc16(HWND16 hDlg, UINT16 message,
return FALSE ;
}
/***********************************************************************
* ChooseColorA (COMDLG32.1)
*/
......
......@@ -74,6 +74,50 @@ static BOOL FileDlg_Init(void)
}
/***********************************************************************
* 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)
*
* Creates a dialog box for the user to select a file to open.
......@@ -199,8 +243,8 @@ BOOL16 WINAPI GetOpenFileName16(
/* FIXME: doesn't handle win32 format correctly yet */
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpofn->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"),
ofn, WIN_PROC_16 );
(DLGPROC16)FileOpenDlgProc,
ofn, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner );
if (str1)
......@@ -361,8 +405,8 @@ BOOL16 WINAPI GetSaveFileName16(
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpofn->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FileSaveDlgProc"),
ofn, WIN_PROC_16 );
(DLGPROC16)FileSaveDlgProc,
ofn, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner );
if (str1)
......
......@@ -25,6 +25,50 @@ DEFAULT_DEBUG_CHANNEL(commdlg)
#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)
*/
HWND16 WINAPI FindText16( SEGPTR find )
......@@ -53,8 +97,8 @@ HWND16 WINAPI FindText16( SEGPTR find )
}
hInst = GetWindowLongA( lpFind->hwndOwner , GWL_HINSTANCE);
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FindTextDlgProc"),
find, WIN_PROC_16 );
(DLGPROC16)FindTextDlgProc,
find, WIN_PROC_32A );
}
......@@ -87,8 +131,8 @@ HWND16 WINAPI ReplaceText16( SEGPTR find )
}
hInst = GetWindowLongA( lpFind->hwndOwner , GWL_HINSTANCE);
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
find, WIN_PROC_16 );
(DLGPROC16)ReplaceTextDlgProc,
find, WIN_PROC_32A );
}
......
......@@ -122,8 +122,8 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpChFont->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FormatCharDlgProc"),
(DWORD)lpChFont, WIN_PROC_16 );
(DLGPROC16)FormatCharDlgProcA,
(DWORD)lpChFont, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox(hwndDialog, lpChFont->hwndOwner);
if (hDlgTmpl) FreeResource16( hDlgTmpl );
lpChFont->lpTemplateName=lpTemplateName;
......
......@@ -67,9 +67,9 @@ BOOL16 WINAPI PrintDlg16( SEGPTR printdlg )
hwndDialog = DIALOG_CreateIndirect( hInst, template, TRUE,
lpPrint->hwndOwner,
(DLGPROC16)((lpPrint->Flags & PD_PRINTSETUP) ?
MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
MODULE_GetWndProcEntry16("PrintDlgProc")),
printdlg, WIN_PROC_16 );
/* FIXME: PrintSetupDlgProc */ PrintDlgProcA :
PrintDlgProcA ),
printdlg, WIN_PROC_32A );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpPrint->hwndOwner);
return bRet;
}
......
name wprocs
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
24 pascal16 TASK_Reschedule() TASK_Reschedule
27 pascal EntryAddrProc(word word) NE_GetEntryPoint
28 pascal MyAlloc(word word word) NE_AllocateSegment
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc16
# Interrupt vectors 0-255 are ordinals 100-355
# The 'word' parameter are the flags pushed on the stack by the interrupt
......
......@@ -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 ColorDlgProc16(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 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 PrintDlgProcA(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT WINAPI PrintDlgProcW(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
......
......@@ -184,7 +184,6 @@ extern WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD fl
extern BOOL MODULE_FreeLibrary( WINE_MODREF *wm );
extern WINE_MODREF *MODULE_FindModule( LPCSTR path );
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 SEGPTR WINAPI HasGPHandler16( SEGPTR address );
extern void MODULE_WalkModref( DWORD id );
......
......@@ -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
*
......
......@@ -4,6 +4,7 @@
* Copyright 1999 Ulrich Weigand
*/
#include "wine/winbase16.h"
#include "windef.h"
#include "heap.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,
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;
ut->hModule = hModule;
......@@ -150,7 +164,7 @@ static UTINFO *UTAlloc( HMODULE hModule, HMODULE16 hModule16,
ut->ut16.target = (DWORD)target32;
ut->ut16.pushl_eax = 0x50;
ut->ut16.ljmp = 0xea;
ut->ut16.utglue16 = (DWORD)MODULE_GetWndProcEntry16( "UTGlue16" );
ut->ut16.utglue16 = (DWORD)UTGlue16_Segptr;
ut->ut32.popl_eax = 0x58;
ut->ut32.pushl = 0x68;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment