Allow NULL NE resource handler; call the default handler directly.

Removed WPROCS / Callbacks support for WineLib resource handlers.
This commit is contained in:
Ulrich Weigand 1999-04-01 10:08:21 +00:00 committed by Alexandre Julliard
parent e3dcfcaa3e
commit 6903156eb5
4 changed files with 19 additions and 13 deletions

View File

@ -12,10 +12,7 @@ type win16
24 pascal16 TASK_Reschedule() TASK_Reschedule
27 pascal EntryAddrProc(word word) NE_GetEntryPoint
28 pascal MyAlloc(word word word) NE_AllocateSegment
29 pascal DefResourceHandler(word word word) NE_DefResourceHandler
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc16
31 pascal LoadDIBIconHandler(word word word) LoadDIBIconHandler16
32 pascal LoadDIBCursorHandler(word word word) LoadDIBCursorHandler16
# Interrupt vectors 0-255 are ordinals 100-355
# The 'word' parameter are the flags pushed on the stack by the interrupt

View File

@ -404,8 +404,6 @@ FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
return (FARPROC16)PrintSetupDlgProc16;
if (!strcmp(name,"ReplaceTextDlgProc"))
return (FARPROC16)ReplaceTextDlgProc16;
if (!strcmp(name,"DefResourceHandler"))
return (FARPROC16)NE_DefResourceHandler;
FIXME(module,"No mapping for %s(), add one in library/miscstubs.c\n",name);
assert( FALSE );
return NULL;

View File

@ -26,6 +26,8 @@
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
(pTypeInfo)->count * sizeof(NE_NAMEINFO)))
static FARPROC16 DefResourceHandlerProc = (FARPROC16)0xffffffff;
/***********************************************************************
* NE_FindNameTableId
*
@ -221,13 +223,22 @@ BOOL NE_InitResourceHandler( HMODULE16 hModule )
NE_MODULE *pModule = NE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
FARPROC16 handler = MODULE_GetWndProcEntry16("DefResourceHandler");
if ( DefResourceHandlerProc == (FARPROC16)0xffffffff )
{
HMODULE16 hModule = GetModuleHandle16( "KERNEL" );
int ordinal = hModule? NE_GetOrdinal( hModule, "DefResourceHandler" ) : 0;
if ( ordinal )
DefResourceHandlerProc = NE_GetEntryPointEx( hModule, ordinal, FALSE );
else
DefResourceHandlerProc = NULL;
}
TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
pTypeInfo->resloader = handler;
pTypeInfo->resloader = DefResourceHandlerProc;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
return TRUE;
@ -453,15 +464,13 @@ HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc )
}
else
{
if (pTypeInfo->resloader)
if ( pTypeInfo->resloader
&& pTypeInfo->resloader != DefResourceHandlerProc )
pNameInfo->handle = Callbacks->CallResourceHandlerProc(
pTypeInfo->resloader, pNameInfo->handle, pModule->self, hRsrc );
else /* this is really bad */
{
ERR(resource, "[%04x]: Missing resource handler!\n", pModule->self);
else
pNameInfo->handle = NE_DefResourceHandler(
pNameInfo->handle, pModule->self, hRsrc );
}
if (pNameInfo->handle)
{

View File

@ -130,7 +130,9 @@ static HGLOBAL16 WINAPI CALLBACK_CallResourceHandlerProc( FARPROC16 proc,
HMODULE16 hModule,
HRSRC16 hRsrc )
{
return proc( hMemObj, hModule, hRsrc );
ERR( relay, "Cannot call a 16-bit resource handler in Winelib\n" );
assert( FALSE );
return 0;
}