Added .rc file support for Win16 NE modules.

Moved display.c and mouse.c to separate dll directories.
This commit is contained in:
Andreas Mohr 1999-12-06 01:20:00 +00:00 committed by Alexandre Julliard
parent 38d04b8ff4
commit a2da86898a
20 changed files with 267 additions and 71 deletions

View File

@ -36,12 +36,14 @@ LIBSUBDIRS = \
dlls/commdlg \
dlls/crtdll \
dlls/dciman32 \
dlls/display \
dlls/dplayx \
dlls/dsound \
dlls/icmp \
dlls/imagehlp \
dlls/imm32 \
dlls/lzexpand \
dlls/mouse \
dlls/mpr \
dlls/msacm \
dlls/msacm32 \
@ -147,12 +149,14 @@ LIBOBJS = \
dlls/commdlg/commdlg.o \
dlls/crtdll/crtdll.o \
dlls/dciman32/dciman32.o \
dlls/icmp/icmp.o \
dlls/display/display.o \
dlls/dplayx/dplayx.o \
dlls/dsound/dsound.o \
dlls/icmp/icmp.o \
dlls/imagehlp/imagehlp.o \
dlls/imm32/imm32.o \
dlls/lzexpand/lzexpand.o \
dlls/mouse/mouse.o \
dlls/mpr/mpr.o \
dlls/msacm/msacm.o \
dlls/msacm32/msacm32.o \

4
configure vendored
View File

@ -5844,12 +5844,14 @@ dlls/comctl32/Makefile
dlls/commdlg/Makefile
dlls/crtdll/Makefile
dlls/dciman32/Makefile
dlls/display/Makefile
dlls/dplayx/Makefile
dlls/dsound/Makefile
dlls/icmp/Makefile
dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/lzexpand/Makefile
dlls/mouse/Makefile
dlls/mpr/Makefile
dlls/msacm/Makefile
dlls/msacm32/Makefile
@ -6048,12 +6050,14 @@ dlls/comctl32/Makefile
dlls/commdlg/Makefile
dlls/crtdll/Makefile
dlls/dciman32/Makefile
dlls/display/Makefile
dlls/dplayx/Makefile
dlls/dsound/Makefile
dlls/icmp/Makefile
dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/lzexpand/Makefile
dlls/mouse/Makefile
dlls/mpr/Makefile
dlls/msacm/Makefile
dlls/msacm32/Makefile

View File

@ -869,12 +869,14 @@ dlls/comctl32/Makefile
dlls/commdlg/Makefile
dlls/crtdll/Makefile
dlls/dciman32/Makefile
dlls/display/Makefile
dlls/dplayx/Makefile
dlls/dsound/Makefile
dlls/icmp/Makefile
dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/lzexpand/Makefile
dlls/mouse/Makefile
dlls/mpr/Makefile
dlls/msacm/Makefile
dlls/msacm32/Makefile

View File

@ -5,12 +5,14 @@ SUBDIRS = \
commdlg \
crtdll \
dciman32 \
display \
dplayx \
dsound \
icmp \
imagehlp \
imm32 \
lzexpand \
mouse \
mpr \
msacm \
msacm32 \

3
dlls/display/.cvsignore Normal file
View File

@ -0,0 +1,3 @@
Makefile
disp.s
display.spec.c

23
dlls/display/Makefile.in Normal file
View File

@ -0,0 +1,23 @@
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = display
WRCEXTRA = -s -w16 -pdisplay
SPEC_SRCS = display.spec
C_SRCS = \
display_main.c
RC_SRCS = \
disp.rc
all: $(MODULE).o
@MAKE_RULES@
$(RC_SRCS:.rc=.s): $(WRC)
### Dependencies:

47
dlls/display/disp.rc Normal file
View File

@ -0,0 +1,47 @@
/*
* resource file for DISPLAY driver dll
*
*/
1 "OEMBIN"
{
0x11, /* vertical thumb height (in pixels) */
0x11, /* horizontal thumb width (in pixels) */
0x02, /* icon width (in pixels) */
0x02, /* icon height (in pixels) */
0x01, /* cursor width (in pixels) */
0x01, /* cursor height (in pixels) */
0x00, /* reserved */
0x01, /* vertical-line width */
0x01, /* horizontal-line width */
/* default system color values */
0x00c0c0c0L, /* scrollbar */
0x00c0c0c0L, /* desktop */
0x00800000L, /* active caption */
0x00ffffffL, /* inactive caption */
0x00ffffffL, /* menu */
0x00ffffffL, /* window */
0x00000000L, /* window frame */
0x00000000L, /* menu text */
0x00000000L, /* window text */
0x00ffffffL, /* caption text */
0x00c0c0c0L, /* active border */
0x00c0c0c0L, /* inactive border */
0x00ffffffL, /* app workspace */
0x00800000L, /* hilite bk */
0x00ffffffL, /* hilite text */
0x00c0c0c0L, /* btn face */
0x00808080L, /* btn shadow */
0x00c0c0c0L, /* gray text */
0x00000000L, /* btn text */
0x00000000L /* inactive caption text */
}
/* this is an icon */
DUMMY1 1
{
0x0
}

View File

@ -53,17 +53,14 @@ VOID WINAPI DISPLAY_CheckCursor( void )
* DISPLAY_GetDriverResourceID (DISPLAY.450)
*
* Used by USER to check if driver contains better version of a builtin
* resource than USER.
* resource than USER (yes, our DISPLAY does !).
* wQueriedResID is the ID USER asks about.
* lpsResName might often contain "OEMBIN".
* For now we just let USER use its own resource.
* lpsResName does often contain "OEMBIN".
*/
DWORD WINAPI DISPLAY_GetDriverResourceID( WORD wQueriedResID, LPSTR lpsResName )
{
FIXME("Return the display resource ID\n" );
if (wQueriedResID == 3)
return (DWORD)wQueriedResID/*FIXME resourceID*/;
return (DWORD)1;
return (DWORD)wQueriedResID;
}

3
dlls/mouse/.cvsignore Normal file
View File

@ -0,0 +1,3 @@
Makefile
mouse.spec.c
mouserc.s

23
dlls/mouse/Makefile.in Normal file
View File

@ -0,0 +1,23 @@
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = mouse
WRCEXTRA = -s -w16 -pmouse
SPEC_SRCS = mouse.spec
C_SRCS = \
mouse_main.c
RC_SRCS = \
mouserc.rc
all: $(MODULE).o
@MAKE_RULES@
$(RC_SRCS:.rc=.s): $(WRC)
### Dependencies:

View File

@ -10,10 +10,12 @@
#include "debugtools.h"
#include "callback.h"
#include "builtin16.h"
#include "module.h"
#include "mouse.h"
#include "monitor.h"
#include "winuser.h"
#include "win.h"
#include "wine/winbase16.h"
DEFAULT_DEBUG_CHANNEL(event)
@ -52,8 +54,11 @@ VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc)
DefMouseEventProc = lpMouseEventProc;
/* Now initialize the mouse driver */
if (initDone == FALSE) MOUSE_Driver->pInit();
initDone = TRUE;
if (initDone == FALSE)
{
MOUSE_Driver->pInit();
initDone = TRUE;
}
}
static VOID WINAPI MOUSE_CallMouseEventProc( FARPROC16 proc,

20
dlls/mouse/mouserc.rc Normal file
View File

@ -0,0 +1,20 @@
/*
* Top level resource file for MOUSE driver dll
*
*/
/* this ought to be VERSION_INFO */
DUMMY1 1
{
0x1,
0x2,
0x3,
0x4,
0x5
}
/* what's that ? */
DUMMY2 3
{
0x0
}

View File

@ -2,14 +2,14 @@ This document desribes tools for handling resources within wine
### bin2res ###
This tool allows the editing of embeded binary resources within
This tool allows the editing of embedded binary resources within
*.rc files. These resources are stored as hex dump so they can be
stored within the cvs. This makes the editing of the embeded
stored within the cvs. This makes the editing of the embedded
bitmaps and icons harder.
### Create binary files from.rc ###
the resources in the.rc file has to be marked by a header:
the resources in the .rc file have to be marked by a header:
/* BINRES idb_std_small.bmp */
IDB_STD_SMALL BITMAP LOADONCALL DISCARDABLE

View File

@ -3,11 +3,9 @@ call16.s
comm.spec.c
ddeml.spec.c
dispdib.spec.c
display.spec.c
gdi.spec.c
kernel.spec.c
keyboard.spec.c
mouse.spec.c
ole2conv.spec.c
ole2nls.spec.c
ole2prox.spec.c

View File

@ -9,11 +9,9 @@ SPEC_SRCS = \
comm.spec \
ddeml.spec \
dispdib.spec \
display.spec \
gdi.spec \
kernel.spec \
keyboard.spec \
mouse.spec \
ole2conv.spec \
ole2nls.spec \
ole2prox.spec \

View File

@ -26,10 +26,18 @@
DEFAULT_DEBUG_CHANNEL(module)
typedef struct
{
LPVOID res_start; /* address of resource data */
DWORD nr_res;
DWORD res_size; /* size of resource data */
} BUILTIN16_RESOURCE;
typedef struct
{
const WIN16_DESCRIPTOR *descr; /* DLL descriptor */
int flags; /* flags (see below) */
const BUILTIN16_RESOURCE *res; /* resource descriptor */
} BUILTIN16_DLL;
/* DLL flags */
@ -81,54 +89,57 @@ extern const WIN16_DESCRIPTOR WING_Descriptor;
extern const WIN16_DESCRIPTOR WINSOCK_Descriptor;
extern const WIN16_DESCRIPTOR WPROCS_Descriptor;
extern const BUILTIN16_RESOURCE display_ResourceDescriptor;
extern const BUILTIN16_RESOURCE mouse_ResourceDescriptor;
/* Table of all built-in DLLs */
static BUILTIN16_DLL BuiltinDLLs[] =
{
{ &KERNEL_Descriptor, 0 },
{ &USER_Descriptor, 0 },
{ &GDI_Descriptor, 0 },
{ &SYSTEM_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &DISPLAY_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WPROCS_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WINDEBUG_Descriptor, DLL_FLAG_NOT_USED },
{ &AVIFILE_Descriptor, DLL_FLAG_NOT_USED },
{ &COMMDLG_Descriptor, DLL_FLAG_NOT_USED },
{ &COMPOBJ_Descriptor, DLL_FLAG_NOT_USED },
{ &DDEML_Descriptor, DLL_FLAG_NOT_USED },
{ &DISPDIB_Descriptor, 0 },
{ &KEYBOARD_Descriptor, 0 },
{ &COMM_Descriptor, 0 },
{ &LZEXPAND_Descriptor, 0 },
{ &MMSYSTEM_Descriptor, 0 },
{ &MOUSE_Descriptor, 0 },
{ &MSACM_Descriptor, 0 },
{ &MSVIDEO_Descriptor, 0 },
{ &OLE2CONV_Descriptor, DLL_FLAG_NOT_USED },
{ &OLE2DISP_Descriptor, DLL_FLAG_NOT_USED },
{ &OLE2NLS_Descriptor, DLL_FLAG_NOT_USED },
{ &OLE2PROX_Descriptor, DLL_FLAG_NOT_USED },
{ &OLE2THK_Descriptor, DLL_FLAG_NOT_USED },
{ &OLE2_Descriptor, DLL_FLAG_NOT_USED },
{ &OLECLI_Descriptor, DLL_FLAG_NOT_USED },
{ &OLESVR_Descriptor, DLL_FLAG_NOT_USED },
{ &RASAPI16_Descriptor, 0 },
{ &SHELL_Descriptor, 0 },
{ &SOUND_Descriptor, 0 },
{ &STORAGE_Descriptor, DLL_FLAG_NOT_USED },
{ &STRESS_Descriptor, 0 },
{ &TOOLHELP_Descriptor, 0 },
{ &TYPELIB_Descriptor, DLL_FLAG_NOT_USED },
{ &VER_Descriptor, 0 },
{ &W32SYS_Descriptor, DLL_FLAG_NOT_USED },
{ &WIN32S16_Descriptor, DLL_FLAG_NOT_USED },
{ &WIN87EM_Descriptor, DLL_FLAG_NOT_USED },
{ &WINASPI_Descriptor, 0 },
{ &WINEPS_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WING_Descriptor, 0 },
{ &WINSOCK_Descriptor, 0 },
{ &KERNEL_Descriptor, 0, NULL },
{ &USER_Descriptor, 0, NULL },
{ &GDI_Descriptor, 0, NULL },
{ &SYSTEM_Descriptor, DLL_FLAG_ALWAYS_USED, NULL },
{ &DISPLAY_Descriptor, DLL_FLAG_ALWAYS_USED, &display_ResourceDescriptor },
{ &WPROCS_Descriptor, DLL_FLAG_ALWAYS_USED, NULL },
{ &WINDEBUG_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &AVIFILE_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &COMMDLG_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &COMPOBJ_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &DDEML_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &DISPDIB_Descriptor, 0, NULL },
{ &KEYBOARD_Descriptor, 0, NULL },
{ &COMM_Descriptor, 0, NULL },
{ &LZEXPAND_Descriptor, 0, NULL },
{ &MMSYSTEM_Descriptor, 0, NULL },
{ &MOUSE_Descriptor, 0, &mouse_ResourceDescriptor },
{ &MSACM_Descriptor, 0, NULL },
{ &MSVIDEO_Descriptor, 0, NULL },
{ &OLE2CONV_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLE2DISP_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLE2NLS_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLE2PROX_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLE2THK_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLE2_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLECLI_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &OLESVR_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &RASAPI16_Descriptor, 0, NULL },
{ &SHELL_Descriptor, 0, NULL },
{ &SOUND_Descriptor, 0, NULL },
{ &STORAGE_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &STRESS_Descriptor, 0, NULL },
{ &TOOLHELP_Descriptor, 0, NULL },
{ &TYPELIB_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &VER_Descriptor, 0, NULL },
{ &W32SYS_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &WIN32S16_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &WIN87EM_Descriptor, DLL_FLAG_NOT_USED, NULL },
{ &WINASPI_Descriptor, 0, NULL },
{ &WINEPS_Descriptor, DLL_FLAG_ALWAYS_USED, NULL },
{ &WING_Descriptor, 0, NULL },
{ &WINSOCK_Descriptor, 0, NULL },
/* Last entry */
{ NULL, 0 }
{ NULL, 0, NULL }
};
/* Ordinal number for interrupt 0 handler in WPROCS.DLL */
@ -141,27 +152,63 @@ static BUILTIN16_DLL BuiltinDLLs[] =
* Load a built-in Win16 module. Helper function for BUILTIN_LoadModule
* and BUILTIN_Init.
*/
static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
static HMODULE16 BUILTIN_DoLoadModule16( const BUILTIN16_DLL *dll )
{
NE_MODULE *pModule;
int minsize;
int minsize, res_off;
SEGTABLEENTRY *pSegTable;
HMODULE16 hModule;
HMODULE16 hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, descr->module_start,
descr->module_size, 0,
if ( !dll->res )
{
hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, dll->descr->module_start,
dll->descr->module_size, 0,
FALSE, FALSE, FALSE, NULL );
if (!hModule) return 0;
FarSetOwner16( hModule, hModule );
TRACE("Built-in %s: hmodule=%04x\n",
descr->name, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
}
else
{
ET_BUNDLE *bundle;
hModule = GLOBAL_Alloc( GMEM_MOVEABLE,
dll->descr->module_size + dll->res->res_size,
0, FALSE, FALSE, FALSE );
if (!hModule) return 0;
FarSetOwner16( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
res_off = ((NE_MODULE *)dll->descr->module_start)->res_table;
memcpy( (LPBYTE)pModule, dll->descr->module_start, res_off );
memcpy( (LPBYTE)pModule + res_off, dll->res->res_start, dll->res->res_size );
memcpy( (LPBYTE)pModule + res_off + dll->res->res_size,
dll->descr->module_start + res_off, dll->descr->module_size - res_off );
/* Have to fix up various pModule-based near pointers. Ugh! */
pModule->name_table += dll->res->res_size;
pModule->modref_table += dll->res->res_size;
pModule->import_table += dll->res->res_size;
pModule->entry_table += dll->res->res_size;
for ( bundle = (ET_BUNDLE *)((LPBYTE)pModule + pModule->entry_table);
bundle->next;
bundle = (ET_BUNDLE *)((LPBYTE)pModule + bundle->next) )
bundle->next += dll->res->res_size;
/* NOTE: (Ab)use the hRsrcMap parameter for resource data pointer */
pModule->hRsrcMap = dll->res->res_start;
}
pModule->self = hModule;
TRACE( "Built-in %s: hmodule=%04x\n", dll->descr->name, hModule );
/* Allocate the code segment */
pSegTable = NE_SEG_TABLE( pModule );
pSegTable->hSeg = GLOBAL_CreateBlock( GMEM_FIXED, descr->code_start,
pSegTable->hSeg = GLOBAL_CreateBlock( GMEM_FIXED, dll->descr->code_start,
pSegTable->minsize, hModule,
TRUE, TRUE, FALSE, NULL );
if (!pSegTable->hSeg) return 0;
@ -176,11 +223,14 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
hModule, FALSE, FALSE, FALSE );
if (!pSegTable->hSeg) return 0;
if (pSegTable->minsize) memcpy( GlobalLock16( pSegTable->hSeg ),
descr->data_start, pSegTable->minsize);
dll->descr->data_start, pSegTable->minsize);
if (pModule->heap_size)
LocalInit16( GlobalHandleToSel16(pSegTable->hSeg),
pSegTable->minsize, minsize );
if (dll->res)
NE_InitResourceHandler(hModule);
NE_RegisterModule( pModule );
return hModule;
}
@ -200,7 +250,7 @@ BOOL BUILTIN_Init(void)
for (dll = BuiltinDLLs; dll->descr; dll++)
{
if (dll->flags & DLL_FLAG_ALWAYS_USED)
if (!BUILTIN_DoLoadModule16( dll->descr )) return FALSE;
if (!BUILTIN_DoLoadModule16( dll )) return FALSE;
}
/* Set interrupt vectors from entry points in WPROCS.DLL */
@ -248,7 +298,7 @@ HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL force )
if ((table->flags & DLL_FLAG_NOT_USED) && !force) return (HMODULE16)2;
return BUILTIN_DoLoadModule16( table->descr );
return BUILTIN_DoLoadModule16( table );
}

View File

@ -189,6 +189,25 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
{
HANDLE fd;
NE_MODULE* pModule = NE_GetPtr( hModule );
if (pModule && (pModule->flags & NE_FFLAGS_BUILTIN))
{
HGLOBAL16 handle;
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
if ( hMemObj )
handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 );
else
handle = AllocResource16( hModule, hRsrc, 0 );
if ( handle )
{
/* NOTE: hRsrcMap points to start of built-in resource data */
memcpy( GlobalLock16( handle ),
pModule->hRsrcMap + (pNameInfo->offset << sizeShift),
pNameInfo->length << sizeShift );
}
}
if (pModule && (fd = NE_OpenFile( pModule )) >= 0)
{
HGLOBAL16 handle;

View File

@ -14,7 +14,6 @@ C_SRCS = \
defwnd.c \
dialog.c \
dinput.c \
display.c \
driver.c \
event.c \
focus.c \
@ -23,7 +22,6 @@ C_SRCS = \
keyboard.c \
mdi.c \
message.c \
mouse.c \
msgbox.c \
multimon.c \
nonclient.c \