Commit 8664b890 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 960405

Fri Apr 5 15:22:55 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] [controls/static.c] Changes to use WND * wherever possible. * [debugger/dbg.y] [debugger/debug.l] Added 'info module' and 'walk module' commands. * [if1632/Makefile.in] [if1632/relay.c] [tools/build.c] Added assembly code generation to call from Wine into 32-bit code. Changed all 'call32' references in 'callfrom16' to avoid confusion with Win32 routines. * [include/callback.h] Added prototypes for 32-bit callbacks. * [loader/module.c] [if1632/relay32.c] [tools/build.c] Unified 16- and 32-bit modules. The fake module for 32-bit DLLs is now generated by the build program. * [include/module.h] Added extra info to NE_MODULE for Win32 modules to point to the PE module data. * [include/pe_image.h] [loader/pe_image.c] [win32/resource.c] Removed the wine_files list. The PE data for a module can now be accessed with the NE_WIN32_MODULE macro. * [loader/signal.c] [miscemu/instr.c] Don't start the BIOS timer at startup, but only after an access to the 0x40 segment. * [memory/local.c] Changed LOCAL_Lock() to return a 32-bit pointer. * [misc/main.c] [include/dlls.h] Some built-in DLLs (like KERNEL) can no longer be disabled from the command-line. Thu Apr 4 19:54:39 1996 Keith Reynolds <keithr@sco.COM> * [*/*] A lot of small changes to support SCO OpenServer 5. Thu Apr 4 15:38:13 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl> * [controls/edit.c] Fixed GetKeyState() call to use 0x8000 convention. * [include/windows.h] Added undocumented messages EM_SCROLL and EM_GETTHUMB. Thu Apr 4 09:52:52 1996 John Harvey <john@division.co.uk> * [if1632/except.S] Modified code to assemble on unixware. Wed Apr 3 09:38:26 1996 Juergen Marquardt <marqu@lunar.advantest.de> * [objects/font.c] Implementation of a second font cache which will be updated dynamically. Mon Apr 1 16:47:40 1996 Robert Pouliot <krynos@qbc.clic.net> * [resources/sysres_Cz.rc] [resources/sysres_Da.rc] [resources/sysres_De.rc] [resources/sysres_Eo.rc] [resources/sysres_Es.rc] [resources/sysres_Fi.rc] [resources/sysres_No.rc] [resources/TODO] Updated FIND_TEXT and REPLACE_TEXT to work like the English version.
parent c981d0bf
This is release 960331 of Wine the MS Windows emulator. This is still a This is release 960405 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work. features. Most applications still do not work.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry. forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960331: (see ChangeLog for details) WHAT'S NEW with Wine-960405: (see ChangeLog for details)
- Many improvements to keyboard handling. - Faster text display.
- New registry code with Win32 support. - Support for SCO OpenServer 5.
- Support for Italian language. - Cleaner Win32 module handling.
- Lots of bug fixes. - Lots of bug fixes.
See the README file in the distribution for installation instructions. See the README file in the distribution for installation instructions.
...@@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before ...@@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available the release is available at the ftp sites. The sources will be available
from the following locations: from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960331.tar.gz sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960405.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960331.tar.gz tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960405.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960331.tar.gz ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960405.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960331.tar.gz aris.com:/pub/linux/ALPHA/Wine/development/Wine-960405.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite. It should also be available from any site that mirrors tsx-11 or sunsite.
......
---------------------------------------------------------------------- ----------------------------------------------------------------------
Fri Apr 5 15:22:55 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/static.c]
Changes to use WND * wherever possible.
* [debugger/dbg.y] [debugger/debug.l]
Added 'info module' and 'walk module' commands.
* [if1632/Makefile.in] [if1632/relay.c] [tools/build.c]
Added assembly code generation to call from Wine into 32-bit code.
Changed all 'call32' references in 'callfrom16' to avoid confusion
with Win32 routines.
* [include/callback.h]
Added prototypes for 32-bit callbacks.
* [loader/module.c] [if1632/relay32.c] [tools/build.c]
Unified 16- and 32-bit modules. The fake module for 32-bit DLLs is
now generated by the build program.
* [include/module.h]
Added extra info to NE_MODULE for Win32 modules to point to the PE
module data.
* [include/pe_image.h] [loader/pe_image.c] [win32/resource.c]
Removed the wine_files list. The PE data for a module can now be
accessed with the NE_WIN32_MODULE macro.
* [loader/signal.c] [miscemu/instr.c]
Don't start the BIOS timer at startup, but only after an access to
the 0x40 segment.
* [memory/local.c]
Changed LOCAL_Lock() to return a 32-bit pointer.
* [misc/main.c] [include/dlls.h]
Some built-in DLLs (like KERNEL) can no longer be disabled from
the command-line.
Thu Apr 4 19:54:39 1996 Keith Reynolds <keithr@sco.COM>
* [*/*]
A lot of small changes to support SCO OpenServer 5.
Thu Apr 4 15:38:13 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>
* [controls/edit.c]
Fixed GetKeyState() call to use 0x8000 convention.
* [include/windows.h]
Added undocumented messages EM_SCROLL and EM_GETTHUMB.
Thu Apr 4 09:52:52 1996 John Harvey <john@division.co.uk>
* [if1632/except.S]
Modified code to assemble on unixware.
Wed Apr 3 09:38:26 1996 Juergen Marquardt <marqu@lunar.advantest.de>
* [objects/font.c]
Implementation of a second font cache which will be updated
dynamically.
Mon Apr 1 16:47:40 1996 Robert Pouliot <krynos@qbc.clic.net>
* [resources/sysres_Cz.rc] [resources/sysres_Da.rc]
[resources/sysres_De.rc] [resources/sysres_Eo.rc]
[resources/sysres_Es.rc] [resources/sysres_Fi.rc]
[resources/sysres_No.rc] [resources/TODO]
Updated FIND_TEXT and REPLACE_TEXT to work like the English version.
----------------------------------------------------------------------
Sun Mar 31 13:54:46 1996 Alexandre Julliard <julliard@lrc.epfl.ch> Sun Mar 31 13:54:46 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [tools/build.c] * [tools/build.c]
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# First some useful definitions # First some useful definitions
CC = @CC@ SHELL = /bin/sh
CC = @CC@
CPP = @CPP@ CPP = @CPP@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
DEFS = @DEFS@ DEFS = @DEFS@
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
# First some useful definitions # First some useful definitions
CC = @CC@ SHELL = /bin/sh
CC = @CC@
CPP = @CPP@ CPP = @CPP@
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
DEFS = @DEFS@ -DWINE_INI_GLOBAL=\"$(WINE_INI_GLOBAL)\" DEFS = @DEFS@ -DWINE_INI_GLOBAL=\"$(WINE_INI_GLOBAL)\"
......
...@@ -135,16 +135,7 @@ static HLOCAL EDIT_HeapAlloc(HWND hwnd, int bytes, WORD flags) ...@@ -135,16 +135,7 @@ static HLOCAL EDIT_HeapAlloc(HWND hwnd, int bytes, WORD flags)
*/ */
static void *EDIT_HeapLock(HWND hwnd, HANDLE handle) static void *EDIT_HeapLock(HWND hwnd, HANDLE handle)
{ {
HINSTANCE hinstance = WIN_GetWindowInstance( hwnd ); return LOCAL_Lock( WIN_GetWindowInstance(hwnd), handle );
#if defined(WINELIB)
return LOCAL_Lock( hinstance, handle );
#else
HANDLE offs;
if (handle == 0) return 0;
offs = LOCAL_Lock( hinstance, handle );
return PTR_SEG_OFF_TO_LIN( hinstance, offs );
#endif
} }
/********************************************************************* /*********************************************************************
...@@ -2798,7 +2789,7 @@ static void EDIT_WM_KeyDown(HWND hwnd, WPARAM wParam) ...@@ -2798,7 +2789,7 @@ static void EDIT_WM_KeyDown(HWND hwnd, WPARAM wParam)
return; return;
} }
if(motionKey && (0x80 & GetKeyState(VK_SHIFT))) { if(motionKey && (0x8000 & GetKeyState(VK_SHIFT))) {
EDIT_ExtendSel(hwnd, es->WndCol, es->WndRow*es->txtht); EDIT_ExtendSel(hwnd, es->WndCol, es->WndRow*es->txtht);
} else { } else {
EDIT_SetAnchor(hwnd, es->CurrLine, es->CurrCol); EDIT_SetAnchor(hwnd, es->CurrLine, es->CurrCol);
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
* *
* Copyright David W. Metcalfe, 1993 * Copyright David W. Metcalfe, 1993
* *
static char Copyright[] = "Copyright David W. Metcalfe, 1993"; */
*/
#include <stdio.h> #include <stdio.h>
#include <windows.h> #include <windows.h>
...@@ -12,35 +11,35 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1993"; ...@@ -12,35 +11,35 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1993";
#include "user.h" #include "user.h"
#include "static.h" #include "static.h"
extern void DEFWND_SetText( HWND hwnd, LPSTR text ); /* windows/defwnd.c */ extern void DEFWND_SetText( WND *wndPtr, LPSTR text ); /* windows/defwnd.c */
static void PaintTextfn( HWND hwnd, HDC hdc ); static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc );
static void PaintRectfn( HWND hwnd, HDC hdc ); static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc );
static void PaintIconfn( HWND hwnd, HDC hdc ); static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc );
static COLORREF color_windowframe, color_background, color_window; static COLORREF color_windowframe, color_background, color_window;
typedef void (*pfPaint)(HWND, HDC); typedef void (*pfPaint)( WND *, HDC);
#define LAST_STATIC_TYPE SS_LEFTNOWORDWRAP #define LAST_STATIC_TYPE SS_LEFTNOWORDWRAP
static pfPaint staticPaintFunc[LAST_STATIC_TYPE+1] = static pfPaint staticPaintFunc[LAST_STATIC_TYPE+1] =
{ {
PaintTextfn, /* SS_LEFT */ STATIC_PaintTextfn, /* SS_LEFT */
PaintTextfn, /* SS_CENTER */ STATIC_PaintTextfn, /* SS_CENTER */
PaintTextfn, /* SS_RIGHT */ STATIC_PaintTextfn, /* SS_RIGHT */
PaintIconfn, /* SS_ICON */ STATIC_PaintIconfn, /* SS_ICON */
PaintRectfn, /* SS_BLACKRECT */ STATIC_PaintRectfn, /* SS_BLACKRECT */
PaintRectfn, /* SS_GRAYRECT */ STATIC_PaintRectfn, /* SS_GRAYRECT */
PaintRectfn, /* SS_WHITERECT */ STATIC_PaintRectfn, /* SS_WHITERECT */
PaintRectfn, /* SS_BLACKFRAME */ STATIC_PaintRectfn, /* SS_BLACKFRAME */
PaintRectfn, /* SS_GRAYFRAME */ STATIC_PaintRectfn, /* SS_GRAYFRAME */
PaintRectfn, /* SS_WHITEFRAME */ STATIC_PaintRectfn, /* SS_WHITEFRAME */
NULL, /* Not defined */ NULL, /* Not defined */
PaintTextfn, /* SS_SIMPLE */ STATIC_PaintTextfn, /* SS_SIMPLE */
PaintTextfn /* SS_LEFTNOWORDWRAP */ STATIC_PaintTextfn /* SS_LEFTNOWORDWRAP */
}; };
...@@ -49,10 +48,9 @@ static pfPaint staticPaintFunc[LAST_STATIC_TYPE+1] = ...@@ -49,10 +48,9 @@ static pfPaint staticPaintFunc[LAST_STATIC_TYPE+1] =
* *
* Set the icon for an SS_ICON control. * Set the icon for an SS_ICON control.
*/ */
static HICON STATIC_SetIcon( HWND hwnd, HICON hicon ) static HICON STATIC_SetIcon( WND *wndPtr, HICON hicon )
{ {
HICON prevIcon; HICON prevIcon;
WND *wndPtr = WIN_FindWndPtr( hwnd );
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra; STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
if ((wndPtr->dwStyle & 0x0f) != SS_ICON) return 0; if ((wndPtr->dwStyle & 0x0f) != SS_ICON) return 0;
...@@ -61,7 +59,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon ) ...@@ -61,7 +59,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon )
if (hicon) if (hicon)
{ {
CURSORICONINFO *info = (CURSORICONINFO *) GlobalLock( hicon ); CURSORICONINFO *info = (CURSORICONINFO *) GlobalLock( hicon );
SetWindowPos( hwnd, 0, 0, 0, info->nWidth, info->nHeight, SetWindowPos( wndPtr->hwndSelf, 0, 0, 0, info->nWidth, info->nHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
GlobalUnlock( hicon ); GlobalUnlock( hicon );
} }
...@@ -94,7 +92,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -94,7 +92,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
createStruct->lpszName ); createStruct->lpszName );
if (!hicon) /* Try OEM icon (FIXME: is this right?) */ if (!hicon) /* Try OEM icon (FIXME: is this right?) */
hicon = LoadIcon( 0, createStruct->lpszName ); hicon = LoadIcon( 0, createStruct->lpszName );
STATIC_SetIcon( hWnd, hicon ); STATIC_SetIcon( wndPtr, hicon );
} }
return 1; return 1;
} }
...@@ -115,7 +113,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -115,7 +113,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCDESTROY: case WM_NCDESTROY:
if (style == SS_ICON) if (style == SS_ICON)
DestroyIcon( STATIC_SetIcon( hWnd, 0 ) ); DestroyIcon( STATIC_SetIcon( wndPtr, 0 ) );
else else
lResult = DefWindowProc(hWnd, uMsg, wParam, lParam); lResult = DefWindowProc(hWnd, uMsg, wParam, lParam);
break; break;
...@@ -125,7 +123,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -125,7 +123,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PAINTSTRUCT ps; PAINTSTRUCT ps;
BeginPaint( hWnd, &ps ); BeginPaint( hWnd, &ps );
if (staticPaintFunc[style]) if (staticPaintFunc[style])
(staticPaintFunc[style])( hWnd, ps.hdc ); (staticPaintFunc[style])( wndPtr, ps.hdc );
EndPaint( hWnd, &ps ); EndPaint( hWnd, &ps );
} }
break; break;
...@@ -140,10 +138,10 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -140,10 +138,10 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SETTEXT: case WM_SETTEXT:
if (style == SS_ICON) if (style == SS_ICON)
/* FIXME : should we also return the previous hIcon here ??? */ /* FIXME : should we also return the previous hIcon here ??? */
STATIC_SetIcon( hWnd, LoadIcon( wndPtr->hInstance, STATIC_SetIcon( wndPtr, LoadIcon( wndPtr->hInstance,
(SEGPTR)lParam )); (SEGPTR)lParam ));
else else
DEFWND_SetText( hWnd, (LPSTR)PTR_SEG_TO_LIN(lParam) ); DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(lParam) );
InvalidateRect( hWnd, NULL, FALSE ); InvalidateRect( hWnd, NULL, FALSE );
UpdateWindow( hWnd ); UpdateWindow( hWnd );
break; break;
...@@ -171,7 +169,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -171,7 +169,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return infoPtr->hIcon; return infoPtr->hIcon;
case STM_SETICON: case STM_SETICON:
lResult = STATIC_SetIcon( hWnd, (HICON)wParam ); lResult = STATIC_SetIcon( wndPtr, (HICON)wParam );
InvalidateRect( hWnd, NULL, FALSE ); InvalidateRect( hWnd, NULL, FALSE );
UpdateWindow( hWnd ); UpdateWindow( hWnd );
break; break;
...@@ -185,18 +183,17 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -185,18 +183,17 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
static void PaintTextfn( HWND hwnd, HDC hdc ) static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
{ {
RECT rc; RECT rc;
HBRUSH hBrush; HBRUSH hBrush;
char *text; char *text;
WORD wFormat; WORD wFormat;
WND *wndPtr = WIN_FindWndPtr(hwnd);
LONG style = wndPtr->dwStyle; LONG style = wndPtr->dwStyle;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra; STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect(hwnd, &rc); GetClientRect( wndPtr->hwndSelf, &rc);
text = USER_HEAP_LIN_ADDR( wndPtr->hText ); text = USER_HEAP_LIN_ADDR( wndPtr->hText );
switch (style & 0x0000000F) switch (style & 0x0000000F)
...@@ -230,24 +227,23 @@ static void PaintTextfn( HWND hwnd, HDC hdc ) ...@@ -230,24 +227,23 @@ static void PaintTextfn( HWND hwnd, HDC hdc )
if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont ); if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont );
#ifdef WINELIB32 #ifdef WINELIB32
hBrush = SendMessage( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd ); hBrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
#else #else
hBrush = SendMessage( GetParent(hwnd), WM_CTLCOLOR, (WORD)hdc, hBrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, (WORD)hdc,
MAKELONG(hwnd, CTLCOLOR_STATIC)); MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif #endif
if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH); if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
FillRect(hdc, &rc, hBrush); FillRect(hdc, &rc, hBrush);
if (text) DrawText( hdc, text, -1, &rc, wFormat ); if (text) DrawText( hdc, text, -1, &rc, wFormat );
} }
static void PaintRectfn( HWND hwnd, HDC hdc ) static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc )
{ {
RECT rc; RECT rc;
HBRUSH hBrush; HBRUSH hBrush;
WND *wndPtr = WIN_FindWndPtr(hwnd); GetClientRect( wndPtr->hwndSelf, &rc);
GetClientRect(hwnd, &rc);
switch (wndPtr->dwStyle & 0x0f) switch (wndPtr->dwStyle & 0x0f)
{ {
...@@ -282,19 +278,19 @@ static void PaintRectfn( HWND hwnd, HDC hdc ) ...@@ -282,19 +278,19 @@ static void PaintRectfn( HWND hwnd, HDC hdc )
} }
static void PaintIconfn( HWND hwnd, HDC hdc ) static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc )
{ {
RECT rc; RECT rc;
HBRUSH hbrush; HBRUSH hbrush;
WND *wndPtr = WIN_FindWndPtr(hwnd);
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra; STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect(hwnd, &rc); GetClientRect( wndPtr->hwndSelf, &rc);
#ifdef WINELIB32 #ifdef WINELIB32
hbrush = SendMessage( GetParent(hwnd), WM_CTLCOLORSTATIC, hdc, hwnd ); hbrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
#else #else
hbrush = SendMessage( GetParent(hwnd), WM_CTLCOLOR, hdc, hbrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_STATIC)); MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif #endif
FillRect( hdc, &rc, hbrush ); FillRect( hdc, &rc, hbrush );
if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon ); if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon );
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "windows.h" #include "windows.h"
#include "debugger.h" #include "debugger.h"
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include "class.h" #include "class.h"
#include "module.h"
#include "options.h" #include "options.h"
#include "queue.h" #include "queue.h"
#include "win.h" #include "win.h"
...@@ -38,7 +39,7 @@ int yyerror(char *); ...@@ -38,7 +39,7 @@ int yyerror(char *);
%token tCONT tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tINFO tWALK %token tCONT tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tINFO tWALK
%token tENABLE tDISABLE tBREAK tDELETE tSET tMODE tPRINT tEXAM tDEFINE tABORT %token tENABLE tDISABLE tBREAK tDELETE tSET tMODE tPRINT tEXAM tDEFINE tABORT
%token tCLASS tSTACK tSEGMENTS tREGS tWND tQUEUE %token tCLASS tMODULE tSTACK tSEGMENTS tREGS tWND tQUEUE
%token tNO_SYMBOL tEOL %token tNO_SYMBOL tEOL
%token tSYMBOLFILE %token tSYMBOLFILE
...@@ -129,6 +130,7 @@ break_command: ...@@ -129,6 +130,7 @@ break_command:
info_command: info_command:
tINFO tBREAK tEOL { DEBUG_InfoBreakpoints(); } tINFO tBREAK tEOL { DEBUG_InfoBreakpoints(); }
| tINFO tCLASS expr tEOL { CLASS_DumpClass( $3 ); } | tINFO tCLASS expr tEOL { CLASS_DumpClass( $3 ); }
| tINFO tMODULE expr tEOL { MODULE_DumpModule( $3 ); }
| tINFO tQUEUE expr tEOL { QUEUE_DumpQueue( $3 ); } | tINFO tQUEUE expr tEOL { QUEUE_DumpQueue( $3 ); }
| tINFO tREGS tEOL { DEBUG_InfoRegisters(); } | tINFO tREGS tEOL { DEBUG_InfoRegisters(); }
| tINFO tSEGMENTS expr tEOL { LDT_Print( SELECTOR_TO_ENTRY($3), 1 ); } | tINFO tSEGMENTS expr tEOL { LDT_Print( SELECTOR_TO_ENTRY($3), 1 ); }
...@@ -138,6 +140,7 @@ info_command: ...@@ -138,6 +140,7 @@ info_command:
walk_command: walk_command:
tWALK tCLASS tEOL { CLASS_WalkClasses(); } tWALK tCLASS tEOL { CLASS_WalkClasses(); }
| tWALK tMODULE tEOL { MODULE_WalkModules(); }
| tWALK tQUEUE tEOL { QUEUE_WalkQueues(); } | tWALK tQUEUE tEOL { QUEUE_WalkQueues(); }
| tWALK tWND tEOL { WIN_WalkWindows( 0, 0 ); } | tWALK tWND tEOL { WIN_WalkWindows( 0, 0 ); }
| tWALK tWND tNUM tEOL { WIN_WalkWindows( $3, 0 ); } | tWALK tWND tNUM tEOL { WIN_WalkWindows( $3, 0 ); }
......
...@@ -94,6 +94,7 @@ walk|w { return tWALK; } ...@@ -94,6 +94,7 @@ walk|w { return tWALK; }
x { return tEXAM; } x { return tEXAM; }
class|clas|cla { return tCLASS; } class|clas|cla { return tCLASS; }
module|modul|modu|mod { return tMODULE; }
queue|queu|que { return tQUEUE; } queue|queu|que { return tQUEUE; }
registers|regs|reg|re { return tREGS; } registers|regs|reg|re { return tREGS; }
segments|segment|segm|seg|se { return tSEGMENTS; } segments|segment|segm|seg|se { return tSEGMENTS; }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
#include <sys/statfs.h> #include <sys/statfs.h>
#endif #endif
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/errno.h> #include <sys/errno.h>
#endif #endif
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
#include <sys/statfs.h> #include <sys/statfs.h>
#endif #endif
...@@ -437,7 +437,7 @@ int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available ) ...@@ -437,7 +437,7 @@ int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
return 0; return 0;
} }
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
if (statfs( DOSDrives[drive].root, &info, 0, 0) < 0) if (statfs( DOSDrives[drive].root, &info, 0, 0) < 0)
#else #else
if (statfs( DOSDrives[drive].root, &info) < 0) if (statfs( DOSDrives[drive].root, &info) < 0)
...@@ -449,7 +449,7 @@ int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available ) ...@@ -449,7 +449,7 @@ int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
} }
*size = info.f_bsize * info.f_blocks; *size = info.f_bsize * info.f_blocks;
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
*available = info.f_bfree * info.f_bsize; *available = info.f_bfree * info.f_bsize;
#else #else
*available = info.f_bavail * info.f_bsize; *available = info.f_bavail * info.f_bsize;
......
...@@ -50,10 +50,11 @@ C_SRCS = \ ...@@ -50,10 +50,11 @@ C_SRCS = \
ASM_SRCS = \ ASM_SRCS = \
$(SPEC_FILES) \ $(SPEC_FILES) \
call16.S \ callfrom16.S \
call32.S \ callfrom32.S \
except.S \ callto16.S \
stdcall.S callto32.S \
except.S
.SUFFIXES: .spec .SUFFIXES: .spec
...@@ -69,16 +70,19 @@ $(SPEC_FILES): $(BUILD) ...@@ -69,16 +70,19 @@ $(SPEC_FILES): $(BUILD)
$(BUILD) checkbuild: $(BUILD) checkbuild:
cd $(TOPSRC)/tools; $(SUBMAKE) build cd $(TOPSRC)/tools; $(SUBMAKE) build
call16.S: $(TOPSRC)/include/callback.h $(BUILD) callfrom16.S: $(SPEC_FILES)
$(BUILD) -call16 `cat $(TOPSRC)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > call16.S $(BUILD) -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq` > callfrom16.S
call32.S: $(SPEC_FILES) callfrom32.S: $(SPEC_FILES)
$(BUILD) -call32 `cat $(SPEC_FILES) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S $(BUILD) -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\([0-9]*\)/\1/' | sort | uniq` > callfrom32.S
stdcall.S: $(SPEC_FILES) callto16.S: $(TOPSRC)/include/callback.h $(BUILD)
$(BUILD) -stdcall `cat $(SPEC_FILES) | grep Stdcall_ | sed 's/.*Stdcall_\([0-9]*\)/\1/' | sort | uniq` > stdcall.S $(BUILD) -callto16 `cat $(TOPSRC)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > callto16.S
callto32.S: $(TOPSRC)/include/callback.h $(BUILD)
$(BUILD) -callto32 `cat $(TOPSRC)/include/callback.h | grep "extern.*CallTo32_" | sed 's/.*CallTo32_\(.*\)(.*/\1/' | sort | uniq` > callto32.S
clean:: clean::
rm -f $(SPEC_FILES) call32.S call16.S stdcall.S rm -f $(SPEC_FILES) callfrom16.S callfrom32.S callto16.S callto32.S
### Dependencies: ### Dependencies:
...@@ -39,8 +39,7 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message, ...@@ -39,8 +39,7 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
fprintf(stderr,"Where is the Win32 callback?\n"); fprintf(stderr,"Where is the Win32 callback?\n");
if (UsesLParamPtr(message)) if (UsesLParamPtr(message))
return RELAY32_CallWindowProcConvStruct(a->win32,hwnd,message,wParam,lParam); return RELAY32_CallWindowProcConvStruct(a->win32,hwnd,message,wParam,lParam);
else return CallWndProc32( (FARPROC)a->win32, hwnd, message, wParam, lParam );
return RELAY32_CallWindowProc(a->win32,hwnd,message,wParam,lParam);
} }
/********************************************************************** /**********************************************************************
......
...@@ -4,17 +4,20 @@ ...@@ -4,17 +4,20 @@
* Copyright (c) 1996 Onno Hovers, (onno@stack.urc.tue.nl) * Copyright (c) 1996 Onno Hovers, (onno@stack.urc.tue.nl)
* *
*/ */
#if defined(__svr4__) || defined(_SCO_DS)
#define __ELF__ 1
#endif
#ifndef __ELF__ #ifndef __ELF__
.globl _EXC_CallUnhandledExceptionFilter
.extern _pTopExcHandler
.globl _EXC_CallUnhandledExceptionFilter
_EXC_CallUnhandledExceptionFilter: _EXC_CallUnhandledExceptionFilter:
#else /* __ELF__ */ #else /* __ELF__ */
.globl EXC_CallUnhandledExceptionFilter
.extern pTopExcHandler
.globl EXC_CallUnhandledExceptionFilter
EXC_CallUnhandledExceptionFilter: EXC_CallUnhandledExceptionFilter:
#endif /* __ELF__ */ #endif /* __ELF__ */
leal 4(%esp),%eax leal 4(%esp),%eax
pushl %eax pushl %eax
...@@ -45,56 +48,55 @@ ...@@ -45,56 +48,55 @@
* we pass the function to be called as a fifth parameter to ContextCall * we pass the function to be called as a fifth parameter to ContextCall
* *
*/ */
.equ CONTEXT_SegSs, -4 #define CONTEXT_SegSs -4
.equ CONTEXT_Esp, -8 #define CONTEXT_Esp -8
.equ CONTEXT_EFlags, -12 #define CONTEXT_EFlags -12
.equ CONTEXT_SegCs, -16 #define CONTEXT_SegCs -16
.equ CONTEXT_Eip, -20 #define CONTEXT_Eip -20
.equ CONTEXT_Ebp, -24 #define CONTEXT_Ebp -24
.equ CONTEXT_Eax, -28 #define CONTEXT_Eax -28
.equ CONTEXT_Ecx, -32 #define CONTEXT_Ecx -32
.equ CONTEXT_Edx, -36 #define CONTEXT_Edx -36
.equ CONTEXT_Ebx, -40 #define CONTEXT_Ebx -40
.equ CONTEXT_Esi, -44 #define CONTEXT_Esi -44
.equ CONTEXT_Edi, -48 #define CONTEXT_Edi -48
.equ CONTEXT_SegDs, -52 #define CONTEXT_SegDs -52
.equ CONTEXT_SegEs, -56 #define CONTEXT_SegEs -56
.equ CONTEXT_SegFs, -60 #define CONTEXT_SegFs -60
.equ CONTEXT_SegGs, -64 #define CONTEXT_SegGs -64
.equ FLOAT_Cr0NpxState, -68 #define FLOAT_Cr0NpxState -68
.equ FLOAT_RegisterArea, -148 #define FLOAT_RegisterArea -148
.equ FLOAT_DataSelector, -152 #define FLOAT_DataSelector -152
.equ FLOAT_DataOffset, -156 #define FLOAT_DataOffset -156
.equ FLOAT_ErrorSelector, -160 #define FLOAT_ErrorSelector -160
.equ FLOAT_ErrorOffset, -164 #define FLOAT_ErrorOffset -164
.equ FLOAT_TagWord, -168 #define FLOAT_TagWord -168
.equ FLOAT_StatusWord, -172 #define FLOAT_StatusWord -172
.equ FLOAT_ControlWord, -176 #define FLOAT_ControlWord -176
.equ CONTEXT_FloatSave, -176 #define CONTEXT_FloatSave -176
.equ CONTEXT_Dr7, -180 #define CONTEXT_Dr7 -180
.equ CONTEXT_Dr6, -184 #define CONTEXT_Dr6 -184
.equ CONTEXT_Dr3, -188 #define CONTEXT_Dr3 -188
.equ CONTEXT_Dr2, -192 #define CONTEXT_Dr2 -192
.equ CONTEXT_Dr1, -196 #define CONTEXT_Dr1 -196
.equ CONTEXT_Dr0, -200 #define CONTEXT_Dr0 -200
.equ CONTEXT_ContextFlags, -204 #define CONTEXT_ContextFlags -204
.equ CONTEXT, -204 #define CONTEXT -204
.equ CONTEXTSIZE, 204 #define CONTEXTSIZE 204
.equ CONTEXTFLAGS, 0x10007 #define CONTEXTFLAGS 0x10007
.equ ORIG_ESP, 16 /** cdecl !!! **/ #define ORIG_ESP 16 /** cdecl !!! **/
.equ PARM_ARG4, 28 #define PARM_ARG4 28
.equ PARM_ARG3, 24 #define PARM_ARG3 24
.equ PARM_ARG2, 20 #define PARM_ARG2 20
.equ PARM_ARG1, 16 #define PARM_ARG1 16
.equ PARM_RETURN, 12 #define PARM_RETURN 12
.equ PARM_CALLFUNC, 8 #define PARM_CALLFUNC 8
.equ PARM_EBP, 4 #define PARM_EBP 4
.equ PARM_EFLAGS, 0 #define PARM_EFLAGS 0
#ifndef __ELF__ #ifndef __ELF__
.globl _RaiseException .globl _RaiseException
.extern _EXC_RaiseException
_RaiseException: _RaiseException:
push $_EXC_RaiseException push $_EXC_RaiseException
...@@ -107,7 +109,6 @@ ...@@ -107,7 +109,6 @@
#else /* __ELF__ */ #else /* __ELF__ */
.globl RaiseException .globl RaiseException
.extern EXC_RaiseException
RaiseException: RaiseException:
push $EXC_RaiseException push $EXC_RaiseException
......
...@@ -25,43 +25,59 @@ dprintf_relay ...@@ -25,43 +25,59 @@ dprintf_relay
BUILTIN_DLL dll_builtin_table[] = BUILTIN_DLL dll_builtin_table[] =
{ {
DLL_ENTRY( KERNEL, 0), /* Win16 DLLs */
DLL_ENTRY( USER, 0), DLL_ENTRY( KERNEL, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( GDI, 0), DLL_ENTRY( USER, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( WIN87EM, DLL_FLAG_NOT_USED), DLL_ENTRY( GDI, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( SHELL, 0), DLL_ENTRY( WIN87EM, DLL_FLAG_NOT_USED),
DLL_ENTRY( SOUND, 0), DLL_ENTRY( SHELL, 0),
DLL_ENTRY( KEYBOARD, 0), DLL_ENTRY( SOUND, 0),
DLL_ENTRY( WINSOCK, 0), DLL_ENTRY( KEYBOARD, 0),
DLL_ENTRY( STRESS, 0), DLL_ENTRY( WINSOCK, 0),
DLL_ENTRY( MMSYSTEM, 0), DLL_ENTRY( STRESS, 0),
DLL_ENTRY( SYSTEM, 0), DLL_ENTRY( MMSYSTEM, 0),
DLL_ENTRY( TOOLHELP, 0), DLL_ENTRY( SYSTEM, 0),
DLL_ENTRY( MOUSE, 0), DLL_ENTRY( TOOLHELP, 0),
DLL_ENTRY( COMMDLG, DLL_FLAG_NOT_USED), DLL_ENTRY( MOUSE, 0),
DLL_ENTRY( OLE2, DLL_FLAG_NOT_USED), DLL_ENTRY( COMMDLG, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2CONV, DLL_FLAG_NOT_USED), DLL_ENTRY( OLE2, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2DISP, DLL_FLAG_NOT_USED), DLL_ENTRY( OLE2CONV, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2NLS, DLL_FLAG_NOT_USED), DLL_ENTRY( OLE2DISP, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2PROX, DLL_FLAG_NOT_USED), DLL_ENTRY( OLE2NLS, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLECLI, DLL_FLAG_NOT_USED), DLL_ENTRY( OLE2PROX, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLESVR, DLL_FLAG_NOT_USED), DLL_ENTRY( OLECLI, DLL_FLAG_NOT_USED),
DLL_ENTRY( COMPOBJ, DLL_FLAG_NOT_USED), DLL_ENTRY( OLESVR, DLL_FLAG_NOT_USED),
DLL_ENTRY( STORAGE, DLL_FLAG_NOT_USED), DLL_ENTRY( COMPOBJ, DLL_FLAG_NOT_USED),
DLL_ENTRY( WINPROCS, 0), DLL_ENTRY( STORAGE, DLL_FLAG_NOT_USED),
DLL_ENTRY( DDEML, DLL_FLAG_NOT_USED), DLL_ENTRY( WINPROCS, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( LZEXPAND, 0), DLL_ENTRY( DDEML, DLL_FLAG_NOT_USED),
{ NULL, } /* Last entry */ DLL_ENTRY( LZEXPAND, 0),
/* Win32 DLLs */
DLL_ENTRY( ADVAPI32, 0),
DLL_ENTRY( COMCTL32, 0),
DLL_ENTRY( COMDLG32, 0),
DLL_ENTRY( OLE32, 0),
DLL_ENTRY( GDI32, 0),
DLL_ENTRY( KERNEL32, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( SHELL32, 0),
DLL_ENTRY( USER32, 0),
DLL_ENTRY( WINPROCS32, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( WINSPOOL, 0),
/* Last entry */
{ NULL, }
}; };
/* Saved 16-bit stack */ /* Saved 16-bit stack for current process (Win16 only) */
WORD IF1632_Saved16_ss = 0; WORD IF1632_Saved16_ss = 0;
WORD IF1632_Saved16_sp = 0; WORD IF1632_Saved16_sp = 0;
/* Saved 32-bit stack */ /* Saved 32-bit stack for current process (Win16 only) */
DWORD IF1632_Saved32_esp = 0; DWORD IF1632_Saved32_esp = 0;
SEGPTR IF1632_Stack32_base = 0; SEGPTR IF1632_Stack32_base = 0;
DWORD IF1632_Original32_esp = 0;
/* Original Unix stack */
DWORD IF1632_Original32_esp;
/*********************************************************************** /***********************************************************************
* RELAY_Init * RELAY_Init
...@@ -72,20 +88,20 @@ BOOL RELAY_Init(void) ...@@ -72,20 +88,20 @@ BOOL RELAY_Init(void)
/* Allocate the code selector for CallTo16 routines */ /* Allocate the code selector for CallTo16 routines */
extern void CALL16_Start(), CALL16_End(); extern void CALLTO16_Start(), CALLTO16_End();
extern void CALL16_Ret_word(), CALL16_Ret_long(); extern void CALLTO16_Ret_word(), CALLTO16_Ret_long();
extern DWORD CALL16_RetAddr_word, CALL16_RetAddr_long; extern DWORD CALLTO16_RetAddr_word, CALLTO16_RetAddr_long;
codesel = GLOBAL_CreateBlock( GMEM_FIXED, (void *)CALL16_Start, codesel = GLOBAL_CreateBlock( GMEM_FIXED, (void *)CALLTO16_Start,
(int)CALL16_End - (int)CALL16_Start, (int)CALLTO16_End - (int)CALLTO16_Start,
0, TRUE, TRUE, FALSE, NULL ); 0, TRUE, TRUE, FALSE, NULL );
if (!codesel) return FALSE; if (!codesel) return FALSE;
/* Patch the return addresses for CallTo16 routines */ /* Patch the return addresses for CallTo16 routines */
CALL16_RetAddr_word = MAKELONG( (int)CALL16_Ret_word - (int)CALL16_Start, CALLTO16_RetAddr_word=MAKELONG( (int)CALLTO16_Ret_word-(int)CALLTO16_Start,
codesel ); codesel );
CALL16_RetAddr_long = MAKELONG( (int)CALL16_Ret_long - (int)CALL16_Start, CALLTO16_RetAddr_long=MAKELONG( (int)CALLTO16_Ret_long-(int)CALLTO16_Start,
codesel ); codesel );
return TRUE; return TRUE;
...@@ -93,10 +109,10 @@ BOOL RELAY_Init(void) ...@@ -93,10 +109,10 @@ BOOL RELAY_Init(void)
/*********************************************************************** /***********************************************************************
* RELAY_DebugCall32 * RELAY_DebugCallFrom16
*/ */
void RELAY_DebugCall32( int func_type, char *args, void RELAY_DebugCallFrom16( int func_type, char *args,
void *entry_point, int args32 ) void *entry_point, int args32 )
{ {
STACK16FRAME *frame; STACK16FRAME *frame;
struct dll_table_s *table; struct dll_table_s *table;
...@@ -162,9 +178,9 @@ void RELAY_DebugCall32( int func_type, char *args, ...@@ -162,9 +178,9 @@ void RELAY_DebugCall32( int func_type, char *args,
/*********************************************************************** /***********************************************************************
* RELAY_DebugReturn * RELAY_DebugCallFrom16Ret
*/ */
void RELAY_DebugReturn( int func_type, int ret_val, int args32 ) void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
{ {
STACK16FRAME *frame; STACK16FRAME *frame;
struct dll_table_s *table; struct dll_table_s *table;
...@@ -230,7 +246,7 @@ void RELAY_Unimplemented16(void) ...@@ -230,7 +246,7 @@ void RELAY_Unimplemented16(void)
* *
* This function is called for unimplemented 32-bit entry points (declared * This function is called for unimplemented 32-bit entry points (declared
* as 'stub' in the spec file). * as 'stub' in the spec file).
* (The args are the same than for RELAY_DebugStdcall). * (The args are the same than for RELAY_DebugCallFrom32).
*/ */
void RELAY_Unimplemented32( int nb_args, void *entry_point, void RELAY_Unimplemented32( int nb_args, void *entry_point,
const char *func_name ) const char *func_name )
...@@ -241,7 +257,7 @@ void RELAY_Unimplemented32( int nb_args, void *entry_point, ...@@ -241,7 +257,7 @@ void RELAY_Unimplemented32( int nb_args, void *entry_point,
/*********************************************************************** /***********************************************************************
* RELAY_DebugCall16 * RELAY_DebugCallTo16
* *
* 'stack' points to the called function address on the 32-bit stack. * 'stack' points to the called function address on the 32-bit stack.
* Stack layout: * Stack layout:
...@@ -251,7 +267,7 @@ void RELAY_Unimplemented32( int nb_args, void *entry_point, ...@@ -251,7 +267,7 @@ void RELAY_Unimplemented32( int nb_args, void *entry_point,
* (stack+4) 16-bit ds * (stack+4) 16-bit ds
* (stack) func to call * (stack) func to call
*/ */
void RELAY_DebugCall16( int* stack, int nbargs ) void RELAY_DebugCallTo16( int* stack, int nbargs )
{ {
if (!debugging_relay) return; if (!debugging_relay) return;
...@@ -264,10 +280,11 @@ void RELAY_DebugCall16( int* stack, int nbargs ) ...@@ -264,10 +280,11 @@ void RELAY_DebugCall16( int* stack, int nbargs )
/*********************************************************************** /***********************************************************************
* RELAY_DebugStdcall * RELAY_DebugCallFrom32
*/ */
void RELAY_DebugStdcall( int nb_args, void *entry_point, const char *func_name, void RELAY_DebugCallFrom32( int nb_args, void *entry_point,
int ebp, int ret_addr, int arg1 ) const char *func_name, int ebp, int ret_addr,
int arg1 )
{ {
int *parg; int *parg;
if (!debugging_relay) return; if (!debugging_relay) return;
...@@ -282,12 +299,28 @@ void RELAY_DebugStdcall( int nb_args, void *entry_point, const char *func_name, ...@@ -282,12 +299,28 @@ void RELAY_DebugStdcall( int nb_args, void *entry_point, const char *func_name,
/*********************************************************************** /***********************************************************************
* RELAY_DebugStdcallRet * RELAY_DebugCallFrom32Ret
*/ */
void RELAY_DebugStdcallRet( int ret_val, void *entry_point, void RELAY_DebugCallFrom32Ret( int ret_val, void *entry_point,
const char *func_name, int ebp, int ret_addr ) const char *func_name, int ebp, int ret_addr )
{ {
if (!debugging_relay) return; if (!debugging_relay) return;
printf( "Ret %s() retval=0x%08x ret=%08x\n", printf( "Ret %s() retval=0x%08x ret=%08x\n",
func_name, ret_val, ret_addr ); func_name, ret_val, ret_addr );
} }
/***********************************************************************
* RELAY_DebugCallTo32
*/
void RELAY_DebugCallTo32( unsigned int func, int nbargs, unsigned int arg1 )
{
unsigned int *argptr;
if (!debugging_relay) return;
printf( "CallTo32(func=%08x", func );
for (argptr = &arg1; nbargs; nbargs--, argptr++)
printf( ",%08x", *argptr );
printf( ")\n" );
}
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "windows.h" #include "windows.h"
#include "callback.h"
#include "dlls.h" #include "dlls.h"
#include "module.h" #include "module.h"
#include "neexe.h" #include "neexe.h"
#include "pe_image.h"
#include "peexe.h" #include "peexe.h"
#include "relay32.h" #include "relay32.h"
#include "struct32.h" #include "struct32.h"
...@@ -24,116 +24,57 @@ ...@@ -24,116 +24,57 @@
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
#define DLL_ENTRY(name) \ typedef struct
{ #name, (WIN32_function *)name##_Module_Start, \
(WIN32_function *)name##_Module_End, (int *)name##_Data_Start, NULL }
static WIN32_builtin WIN32_builtin_list[] =
{ {
DLL_ENTRY(ADVAPI32), char *name;
DLL_ENTRY(COMCTL32), void *definition;
DLL_ENTRY(COMDLG32), } WIN32_function;
DLL_ENTRY(OLE32),
DLL_ENTRY(GDI32),
DLL_ENTRY(KERNEL32),
DLL_ENTRY(SHELL32),
DLL_ENTRY(USER32),
DLL_ENTRY(WINPROCS32),
DLL_ENTRY(WINSPOOL)
};
#define NB_DLLS (sizeof(WIN32_builtin_list)/sizeof(WIN32_builtin_list[0]))
static void RELAY32_MakeFakeModule(WIN32_builtin*dll);
int RELAY32_Init(void)
{
int i;
for (i = 0; i < NB_DLLS; i++)
RELAY32_MakeFakeModule( &WIN32_builtin_list[i] );
/* Why should it fail, anyways? */ typedef struct
return 1;
}
WIN32_builtin *RELAY32_GetBuiltinDLL(char *name)
{ {
WIN32_builtin *it; int base;
size_t len; int size;
char *cp; WIN32_function functions[1];
int i; } WIN32_DLL_INFO;
len = (cp=strchr(name,'.')) ? (cp-name) : strlen(name);
for(i = NB_DLLS, it = WIN32_builtin_list; (i > 0); i--, it++)
if (!lstrncmpi(name,it->name,len)) return it;
return NULL;
}
void RELAY32_Unimplemented(char *dll, int item) void *RELAY32_GetEntryPoint(BUILTIN_DLL *dll, char *item, int hint)
{ {
WIN32_builtin *Dll; const WIN32_DLL_INFO *info = (const WIN32_DLL_INFO *)dll->data_start;
fprintf( stderr, "No handler for routine %s.%d", dll, item); int i;
Dll=RELAY32_GetBuiltinDLL(dll);
if(Dll && Dll->functions[item].name)
fprintf(stderr, "(%s?)\n", Dll->functions[item].name);
else
fprintf(stderr, "\n");
fflush(stderr);
exit(1);
}
void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint)
{
int i, size;
dprintf_module(stddeb, "Looking for %s in %s, hint %x\n",
item ? item: "(no name)", dll->name, hint);
if(!dll)
return 0;
size = (int)(dll->last_func - dll->functions);
/* import by ordinal */
if(!item){
if(hint && hint < size)
return dll->functions[hint - *dll->base].definition;
return 0;
}
/* hint is correct */
if(hint && hint < size &&
dll->functions[hint].name &&
strcmp(item,dll->functions[hint].name)==0)
return dll->functions[hint].definition;
/* hint is incorrect, search for name */
for(i=0;i < size;i++)
if (dll->functions[i].name && !strcmp(item,dll->functions[i].name))
return dll->functions[i].definition;
/* function at hint has no name (unimplemented) */
if(hint && hint < size && !dll->functions[hint].name)
{
dll->functions[hint].name=xstrdup(item);
dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
dll->name,hint);
return dll->functions[hint].definition;
}
return 0;
}
LONG RELAY32_CallWindowProc( WNDPROC func, int hwnd, int message, dprintf_module(stddeb, "Looking for %s in %s, hint %x\n",
int wParam, int lParam ) item ? item: "(no name)", dll->name, hint);
{ if(!dll) return 0;
int ret;
__asm__ ( /* import by ordinal */
"push %1;" if(!item)
"push %2;" {
"push %3;" if(hint && hint < info->size)
"push %4;" return info->functions[hint - info->base].definition;
"call %5;" return 0;
: "=a" (ret) }
: "g" (lParam), "g" (wParam), "g" (message), "g" (hwnd), "g" (func)
); /* hint is correct */
return ret; if (hint && hint < info->size &&
info->functions[hint].name &&
strcmp(item,info->functions[hint].name)==0)
return info->functions[hint].definition;
/* hint is incorrect, search for name */
for(i=0;i < info->size;i++)
if (info->functions[i].name && !strcmp(item,info->functions[i].name))
return info->functions[i].definition;
/* function at hint has no name (unimplemented) */
if(hint && hint < info->size && !info->functions[hint].name)
{
/* info->functions[hint].name=xstrdup(item); */
dprintf_module(stddeb,"Returning unimplemented function %s.%d (%s?)\n",
dll->name,hint,item);
return info->functions[hint].definition;
}
return 0;
} }
LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message, LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
...@@ -149,18 +90,18 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message, ...@@ -149,18 +90,18 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
LONG result; LONG result;
void *lParam; void *lParam;
if(!lParam16) if(!lParam16)
return RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)lParam16); return CallWndProc32(func,hwnd,message,wParam,(int)lParam16);
lParam = PTR_SEG_TO_LIN(lParam16); lParam = PTR_SEG_TO_LIN(lParam16);
switch(message) { switch(message) {
case WM_GETMINMAXINFO: case WM_GETMINMAXINFO:
STRUCT32_MINMAXINFO16to32(lParam,&st.mmi); STRUCT32_MINMAXINFO16to32(lParam,&st.mmi);
result=RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)&st.mmi); result=CallWndProc32(func,hwnd,message,wParam,(int)&st.mmi);
STRUCT32_MINMAXINFO32to16(&st.mmi,lParam); STRUCT32_MINMAXINFO32to16(&st.mmi,lParam);
return result; return result;
case WM_WINDOWPOSCHANGING: case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED: case WM_WINDOWPOSCHANGED:
STRUCT32_WINDOWPOS16to32(lParam,&wp); STRUCT32_WINDOWPOS16to32(lParam,&wp);
result=RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)&wp); result=CallWndProc32(func,hwnd,message,wParam,(int)&wp);
STRUCT32_WINDOWPOS32to16(&wp,lParam); STRUCT32_WINDOWPOS32to16(&wp,lParam);
return result; return result;
case WM_NCCALCSIZE: case WM_NCCALCSIZE:
...@@ -170,7 +111,7 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message, ...@@ -170,7 +111,7 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
st.nccs.lppos=&wp; st.nccs.lppos=&wp;
} else } else
st.nccs.lppos= 0; st.nccs.lppos= 0;
result=RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)&st.nccs); result=CallWndProc32(func,hwnd,message,wParam,(int)&st.nccs);
STRUCT32_NCCALCSIZE32to16Flat(&st.nccs,lParam); STRUCT32_NCCALCSIZE32to16Flat(&st.nccs,lParam);
if(((NCCALCSIZE_PARAMS*)lParam)->lppos) if(((NCCALCSIZE_PARAMS*)lParam)->lppos)
STRUCT32_WINDOWPOS32to16(&wp,((NCCALCSIZE_PARAMS*)lParam)->lppos); STRUCT32_WINDOWPOS32to16(&wp,((NCCALCSIZE_PARAMS*)lParam)->lppos);
...@@ -182,7 +123,7 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message, ...@@ -182,7 +123,7 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
PTR_SEG_TO_LIN(lpcs->lpszName) : (char*)lpcs->lpszName; PTR_SEG_TO_LIN(lpcs->lpszName) : (char*)lpcs->lpszName;
st.cs.lpszClass = HIWORD(lpcs->lpszClass) ? st.cs.lpszClass = HIWORD(lpcs->lpszClass) ?
PTR_SEG_TO_LIN(lpcs->lpszClass) : (char*)lpcs->lpszClass; PTR_SEG_TO_LIN(lpcs->lpszClass) : (char*)lpcs->lpszClass;
result=RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)&st.cs); result=CallWndProc32(func,hwnd,message,wParam,(int)&st.cs);
STRUCT32_CREATESTRUCT32to16(&st.cs,lParam); STRUCT32_CREATESTRUCT32to16(&st.cs,lParam);
lpcs->lpszName = HIWORD(st.cs.lpszName) ? lpcs->lpszName = HIWORD(st.cs.lpszName) ?
MAKE_SEGPTR(st.cs.lpszName) : (SEGPTR)st.cs.lpszName; MAKE_SEGPTR(st.cs.lpszName) : (SEGPTR)st.cs.lpszName;
...@@ -191,71 +132,9 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message, ...@@ -191,71 +132,9 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
return result; return result;
case WM_GETTEXT: case WM_GETTEXT:
case WM_SETTEXT: case WM_SETTEXT:
return RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)lParam); return CallWndProc32(func,hwnd,message,wParam,(int)lParam);
default: default:
fprintf(stderr,"No conversion function for message %d\n",message); fprintf(stderr,"No conversion function for message %d\n",message);
} }
return RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)lParam); return CallWndProc32(func,hwnd,message,wParam,(int)lParam);
} }
static void RELAY32_MakeFakeModule(WIN32_builtin*dll)
{
NE_MODULE *pModule;
struct w_files *wpnt;
int size;
HMODULE hModule;
OFSTRUCT *pFileInfo;
char *pStr;
wpnt=xmalloc(sizeof(struct w_files));
wpnt->hinstance=0;
wpnt->hModule=0;
wpnt->initialised=1;
wpnt->mz_header=wpnt->pe=0;
size=sizeof(NE_MODULE) +
/* loaded file info */
sizeof(*pFileInfo) - sizeof(pFileInfo->szPathName) +
strlen(dll->name) + 1 +
/* name table */
12 +
/* several empty tables */
8;
hModule = GlobalAlloc( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
wpnt->hModule = hModule;
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE*)GlobalLock(hModule);
/* Set all used entries */
pModule->magic=NE_SIGNATURE;
pModule->count=1;
pModule->next=0;
pModule->flags=NE_FFLAGS_WIN32;
pModule->dgroup=0;
pModule->ss=0;
pModule->cs=0;
pModule->heap_size=0;
pModule->stack_size=0;
pModule->seg_count=0;
pModule->modref_count=0;
pModule->nrname_size=0;
pModule->seg_table=0;
pModule->fileinfo=sizeof(NE_MODULE);
pModule->os_flags=NE_OSFLAGS_WINDOWS;
pModule->expected_version=0x30A;
pFileInfo=(OFSTRUCT *)(pModule + 1);
pFileInfo->cBytes = sizeof(*pFileInfo) - sizeof(pFileInfo->szPathName)
+ strlen(dll->name);
strcpy( pFileInfo->szPathName, dll->name );
pStr = ((char*)pFileInfo) + pFileInfo->cBytes + 1;
pModule->name_table=(int)pStr-(int)pModule;
*pStr=strlen(dll->name);
strcpy(pStr+1,dll->name);
pStr += *pStr+1;
pModule->res_table=pModule->import_table=pModule->entry_table=
(int)pStr-(int)pModule;
MODULE_RegisterModule(hModule);
wpnt->builtin=dll;
wpnt->next=wine_files;
wine_files=wpnt;
}
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
#include "stackframe.h" #include "stackframe.h"
extern int CallTo32_LargeStack( int (*func)(), int nbargs, ... ); extern
int CallTo32_LargeStack( int (*func)(), int nbargs, ... );
/* List of the 16-bit callback functions. This list is used */ /* List of the 16-bit callback functions. This list is used */
/* by the build program to generate the file if1632/call16.S */ /* by the build program to generate the file if1632/callto16.S */
/* func ds parameters */ /* func ds parameters */
extern WORD CallTo16_word_ ( FARPROC, WORD ); extern WORD CallTo16_word_ ( FARPROC, WORD );
...@@ -68,6 +69,22 @@ extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax, ...@@ -68,6 +69,22 @@ extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \ #define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
CallTo16_word_lwww( func, CURRENT_DS, lpch, ichCurrent, cch, code ) CallTo16_word_lwww( func, CURRENT_DS, lpch, ichCurrent, cch, code )
/* List of the 32-bit callback functions. This list is used */
/* by the build program to generate the file if1632/callto32.S */
extern LONG CallTo32_0( FARPROC );
extern LONG CallTo32_3( FARPROC, DWORD, DWORD, DWORD );
extern LONG CallTo32_4( FARPROC, DWORD, DWORD, DWORD, DWORD );
#define CallTaskStart32( func ) \
CallTo32_0( func )
#define CallDLLEntryProc32( func, hmodule, a, b ) \
CallTo32_3( func, hmodule, a, b )
#define CallWndProc32( func, hwnd, msg, wParam, lParam ) \
CallTo32_4( func, hwnd, msg, wParam, lParam )
#else /* WINELIB */ #else /* WINELIB */
#define CallEnumChildProc( func, hwnd, lParam ) \ #define CallEnumChildProc( func, hwnd, lParam ) \
......
...@@ -40,6 +40,10 @@ typedef struct ...@@ -40,6 +40,10 @@ typedef struct
DEBUG_PrintAddress(addr,dbg_mode), \ DEBUG_PrintAddress(addr,dbg_mode), \
fprintf(stderr,"\n"),0)) fprintf(stderr,"\n"),0))
#ifdef REG_SP /* Some Sun includes define this */
#undef REG_SP
#endif
enum debug_regs enum debug_regs
{ {
REG_EAX, REG_EBX, REG_ECX, REG_EDX, REG_ESI, REG_EAX, REG_EBX, REG_ECX, REG_EDX, REG_ESI,
......
...@@ -20,8 +20,9 @@ typedef struct dll_table_s ...@@ -20,8 +20,9 @@ typedef struct dll_table_s
} BUILTIN_DLL; } BUILTIN_DLL;
/* DLL flags */ /* DLL flags */
#define DLL_FLAG_NOT_USED 1 /* Use original Windows DLL if possible */ #define DLL_FLAG_NOT_USED 0x01 /* Use original Windows DLL if possible */
#define DLL_FLAG_WIN32 2 /* DLL is a Win32 DLL */ #define DLL_FLAG_ALWAYS_USED 0x02 /* Always use built-in DLL */
#define DLL_FLAG_WIN32 0x04 /* DLL is a Win32 DLL */
#define DECLARE_DLL(name) \ #define DECLARE_DLL(name) \
extern const BYTE name##_Code_Start[]; \ extern const BYTE name##_Code_Start[]; \
......
...@@ -20,7 +20,7 @@ extern HLOCAL LOCAL_Handle( HANDLE ds, WORD addr ); ...@@ -20,7 +20,7 @@ extern HLOCAL LOCAL_Handle( HANDLE ds, WORD addr );
extern WORD LOCAL_Size( HANDLE ds, HLOCAL handle ); extern WORD LOCAL_Size( HANDLE ds, HLOCAL handle );
extern WORD LOCAL_Flags( HANDLE ds, HLOCAL handle ); extern WORD LOCAL_Flags( HANDLE ds, HLOCAL handle );
extern WORD LOCAL_HeapSize( HANDLE ds ); extern WORD LOCAL_HeapSize( HANDLE ds );
extern NPVOID LOCAL_Lock( HANDLE ds, HLOCAL handle ); extern LPSTR LOCAL_Lock( HANDLE ds, HLOCAL handle );
extern BOOL LOCAL_Unlock( HANDLE ds, HLOCAL handle ); extern BOOL LOCAL_Unlock( HANDLE ds, HLOCAL handle );
#endif /* __WINE_LOCAL_H */ #endif /* __WINE_LOCAL_H */
...@@ -51,6 +51,14 @@ typedef struct ...@@ -51,6 +51,14 @@ typedef struct
WORD self_loading_sel; /* Selector used for self-loading apps. procs */ WORD self_loading_sel; /* Selector used for self-loading apps. procs */
} NE_MODULE; } NE_MODULE;
/* Extra module info appended to NE_MODULE for Win32 modules */
typedef struct
{
DWORD pe_module;
} NE_WIN32_EXTRAINFO;
/* In-memory segment table */ /* In-memory segment table */
typedef struct typedef struct
{ {
...@@ -61,6 +69,7 @@ typedef struct ...@@ -61,6 +69,7 @@ typedef struct
HANDLE selector; /* Selector of segment in memory */ HANDLE selector; /* Selector of segment in memory */
} SEGTABLEENTRY; } SEGTABLEENTRY;
/* Self-loading modules contain this structure in their first segment */ /* Self-loading modules contain this structure in their first segment */
typedef struct typedef struct
...@@ -97,11 +106,17 @@ typedef struct ...@@ -97,11 +106,17 @@ typedef struct
#define NE_MODULE_NAME(pModule) \ #define NE_MODULE_NAME(pModule) \
(((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName) (((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
#define NE_WIN32_MODULE(pModule) \
((struct pe_data *)(((pModule)->flags & NE_FFLAGS_WIN32) ? \
((NE_WIN32_EXTRAINFO *)((pModule) + 1))->pe_module : 0))
#ifndef WINELIB #ifndef WINELIB
#pragma pack(4) #pragma pack(4)
#endif #endif
extern BOOL MODULE_Init(void); extern BOOL MODULE_Init(void);
extern void MODULE_DumpModule( HMODULE hmodule );
extern void MODULE_WalkModules(void);
extern int MODULE_OpenFile( HMODULE hModule ); extern int MODULE_OpenFile( HMODULE hModule );
extern LPSTR MODULE_GetModuleName( HMODULE hModule ); extern LPSTR MODULE_GetModuleName( HMODULE hModule );
extern void MODULE_RegisterModule( HMODULE hModule ); extern void MODULE_RegisterModule( HMODULE hModule );
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "windows.h" #include "windows.h"
#include "dlls.h"
struct pe_data { struct pe_data {
struct pe_header_s *pe_header; struct pe_header_s *pe_header;
...@@ -17,40 +18,7 @@ struct pe_data { ...@@ -17,40 +18,7 @@ struct pe_data {
int resource_offset; /* offset to resource typedirectory in file */ int resource_offset; /* offset to resource typedirectory in file */
}; };
typedef struct _WIN32_function{ extern int PE_unloadImage(HMODULE hModule);
char *name;
void *definition;
} WIN32_function;
typedef struct _WIN32_builtin{
char *name;
WIN32_function *functions;
WIN32_function *last_func;
const int *base;
struct _WIN32_builtin *next;
} WIN32_builtin;
struct w_files
{
struct w_files * next;
char * name; /* Name, as it appears in the windows binaries */
char * filename; /* Actual name of the unix file that satisfies this */
int type; /* DLL or EXE */
HINSTANCE hinstance;
HMODULE hModule;
int initialised;
struct mz_header_s *mz_header;
struct pe_data *pe;
OFSTRUCT ofs;
unsigned int load_addr;
WIN32_builtin* builtin;
};
extern int PE_unloadImage(struct w_files *wpnt);
extern int PE_StartProgram(struct w_files *wpnt);
extern void PE_InitDLL(HMODULE hModule);
extern void my_wcstombs(char * result, u_short * source, int len); extern void my_wcstombs(char * result, u_short * source, int len);
extern struct w_files *wine_files;
#endif /* __WINE_PE_IMAGE_H */ #endif /* __WINE_PE_IMAGE_H */
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <windows.h> #include <windows.h>
#include "wine.h" #include "wine.h"
#ifndef __svr4__ #if !defined(__svr4__) && !defined(_SCO_DS)
#define EAX_reg(context) ((context)->sc_eax) #define EAX_reg(context) ((context)->sc_eax)
#define EBX_reg(context) ((context)->sc_ebx) #define EBX_reg(context) ((context)->sc_ebx)
...@@ -65,7 +65,11 @@ ...@@ -65,7 +65,11 @@
#define SET_CFLAG(context) (EFL_reg(context) |= 0x0001) #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
#define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe) #define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
#else /* __svr4__ */ #else /* __svr4__ || _SCO_DS */
#ifdef _SCO_DS
#define gregs regs
#endif
#define EAX_reg(context) ((context)->uc_mcontext.gregs[EAX]) #define EAX_reg(context) ((context)->uc_mcontext.gregs[EAX])
#define EBX_reg(context) ((context)->uc_mcontext.gregs[EBX]) #define EBX_reg(context) ((context)->uc_mcontext.gregs[EBX])
...@@ -122,6 +126,6 @@ ...@@ -122,6 +126,6 @@
#define SET_CFLAG(context) (EFL_reg(context) |= 0x0001) #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
#define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe) #define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
#endif /* __svr4__ */ #endif /* __svr4__ || _SCO_DS */
#endif /* __WINE_REGISTERS_H */ #endif /* __WINE_REGISTERS_H */
...@@ -4,16 +4,13 @@ ...@@ -4,16 +4,13 @@
* Copyright 1995 Martin von Loewis * Copyright 1995 Martin von Loewis
*/ */
#ifndef _RELAY32_H #ifndef __WINE_RELAY32_H
#define _RELAY32_H #define __WINE_RELAY32_H
#include "pe_image.h"
#include "dlls.h"
#include "struct32.h" #include "struct32.h"
void RELAY32_Unimplemented(char *dll, int item); void *RELAY32_GetEntryPoint(BUILTIN_DLL *dll, char *item, int hint);
WIN32_builtin *RELAY32_GetBuiltinDLL(char *name);
void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint);
LONG RELAY32_CallWindowProc(WNDPROC,int,int,int,int);
void RELAY32_DebugEnter(char *dll,char *name);
typedef struct tagWNDCLASSA{ typedef struct tagWNDCLASSA{
UINT style; UINT style;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#pragma pack(1) #pragma pack(1)
#endif #endif
/* 16-bit stack layout after CallTo32() */ /* 16-bit stack layout after CallFrom16() */
typedef struct typedef struct
{ {
WORD saved_ss; /* saved previous 16-bit stack */ WORD saved_ss; /* saved previous 16-bit stack */
...@@ -49,13 +49,15 @@ typedef struct ...@@ -49,13 +49,15 @@ typedef struct
#pragma pack(4) #pragma pack(4)
#endif #endif
/* Saved 16-bit stack */ /* Saved 16-bit stack for current process (Win16 only) */
extern WORD IF1632_Saved16_ss; extern WORD IF1632_Saved16_ss;
extern WORD IF1632_Saved16_sp; extern WORD IF1632_Saved16_sp;
/* Saved 32-bit stack */ /* Saved 32-bit stack for current process (Win16 only) */
extern DWORD IF1632_Saved32_esp; extern DWORD IF1632_Saved32_esp;
extern SEGPTR IF1632_Stack32_base; extern SEGPTR IF1632_Stack32_base;
/* Original Unix stack */
extern DWORD IF1632_Original32_esp; extern DWORD IF1632_Original32_esp;
#ifndef WINELIB #ifndef WINELIB
......
...@@ -2158,6 +2158,9 @@ typedef struct tagDRAGINFO { ...@@ -2158,6 +2158,9 @@ typedef struct tagDRAGINFO {
#define EM_SETWORDBREAKPROC (WM_USER+32) #define EM_SETWORDBREAKPROC (WM_USER+32)
#define EM_GETWORDBREAKPROC (WM_USER+33) #define EM_GETWORDBREAKPROC (WM_USER+33)
#define EM_GETPASSWORDCHAR (WM_USER+34) #define EM_GETPASSWORDCHAR (WM_USER+34)
/* Edit control undocumented messages */
#define EM_SCROLL (WM_USER+5)
#define EM_GETTHUMB (WM_USER+14)
typedef int (CALLBACK *EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, typedef int (CALLBACK *EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent,
int cch, int code); int cch, int code);
......
...@@ -46,8 +46,11 @@ struct sigcontext_struct ...@@ -46,8 +46,11 @@ struct sigcontext_struct
#define WINE_CODE_SELECTOR 0x17 #define WINE_CODE_SELECTOR 0x17
#endif #endif
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
#include <signal.h> #include <signal.h>
#ifdef _SCO_DS
#include <sys/regset.h>
#endif
#include <sys/ucontext.h> #include <sys/ucontext.h>
#define sigcontext_struct ucontext #define sigcontext_struct ucontext
#define WINE_DATA_SELECTOR 0x1f #define WINE_DATA_SELECTOR 0x1f
......
...@@ -57,7 +57,7 @@ HLOCAL LOCAL_Alloc(WORD ds, WORD flags, WORD size) ...@@ -57,7 +57,7 @@ HLOCAL LOCAL_Alloc(WORD ds, WORD flags, WORD size)
{ return LocalAlloc(flags,size); } { return LocalAlloc(flags,size); }
HLOCAL LOCAL_ReAlloc(WORD ds, HLOCAL handle, WORD size, WORD flags) HLOCAL LOCAL_ReAlloc(WORD ds, HLOCAL handle, WORD size, WORD flags)
{ return LocalReAlloc(handle,size,flags); } { return LocalReAlloc(handle,size,flags); }
NPVOID LOCAL_Lock( WORD ds, HLOCAL handle ) LPSTR LOCAL_Lock( WORD ds, HLOCAL handle )
{ return LocalLock(handle); } { return LocalLock(handle); }
BOOL LOCAL_Unlock( WORD ds, HLOCAL handle ) BOOL LOCAL_Unlock( WORD ds, HLOCAL handle )
{ return LocalUnlock(handle); } { return LocalUnlock(handle); }
...@@ -129,12 +129,7 @@ HGLOBAL GlobalHandle(LPCVOID a) ...@@ -129,12 +129,7 @@ HGLOBAL GlobalHandle(LPCVOID a)
return 0; return 0;
} }
WIN32_builtin *RELAY32_GetBuiltinDLL(char *name) void *RELAY32_GetEntryPoint(BUILTIN_DLL *dll, char *item, int hint)
{
return NULL;
}
void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint)
{ {
return NULL; return NULL;
} }
......
...@@ -49,7 +49,6 @@ void init_wine_signals(void); ...@@ -49,7 +49,6 @@ void init_wine_signals(void);
int MAIN_Init(void) int MAIN_Init(void)
{ {
extern BOOL RELAY_Init(void); extern BOOL RELAY_Init(void);
extern BOOL RELAY32_Init(void);
int queueSize; int queueSize;
...@@ -62,9 +61,6 @@ int MAIN_Init(void) ...@@ -62,9 +61,6 @@ int MAIN_Init(void)
#ifndef WINELIB #ifndef WINELIB
/* Initialize relay code */ /* Initialize relay code */
if (!RELAY_Init()) return 0; if (!RELAY_Init()) return 0;
/* Initialize Win32 relay code */
if (!RELAY32_Init()) return 0;
#endif #endif
/* Create built-in modules */ /* Create built-in modules */
......
...@@ -47,7 +47,7 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force ) ...@@ -47,7 +47,7 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
HMODULE hModule; HMODULE hModule;
NE_MODULE *pModule; NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable; SEGTABLEENTRY *pSegTable;
struct dll_table_s *table; BUILTIN_DLL *table;
char dllname[16], *p; char dllname[16], *p;
/* Fix the name in case we have a full path and extension */ /* Fix the name in case we have a full path and extension */
...@@ -71,25 +71,31 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force ) ...@@ -71,25 +71,31 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n", dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n",
table->name, hModule ); table->name, hModule );
/* Allocate the code segment */
pModule = (NE_MODULE *)GlobalLock( hModule ); pModule = (NE_MODULE *)GlobalLock( hModule );
pSegTable = NE_SEG_TABLE( pModule );
pSegTable->selector = GLOBAL_CreateBlock( GMEM_FIXED, table->code_start,
pSegTable->minsize, hModule,
TRUE, TRUE, FALSE, NULL );
if (!pSegTable->selector) return 0;
pSegTable++;
/* Allocate the data segment */
pSegTable->selector = GLOBAL_Alloc( GMEM_FIXED, pSegTable->minsize, if (pModule->flags & NE_FFLAGS_WIN32)
hModule, FALSE, FALSE, FALSE ); {
if (!pSegTable->selector) return 0; ((NE_WIN32_EXTRAINFO*)(pModule+1))->pe_module = (DWORD)table;
memcpy( GlobalLock( pSegTable->selector ), }
table->data_start, pSegTable->minsize ); else /* Win16 module */
{
/* Allocate the code segment */
pSegTable = NE_SEG_TABLE( pModule );
pSegTable->selector = GLOBAL_CreateBlock(GMEM_FIXED, table->code_start,
pSegTable->minsize, hModule,
TRUE, TRUE, FALSE, NULL );
if (!pSegTable->selector) return 0;
pSegTable++;
/* Allocate the data segment */
pSegTable->selector = GLOBAL_Alloc( GMEM_FIXED, pSegTable->minsize,
hModule, FALSE, FALSE, FALSE );
if (!pSegTable->selector) return 0;
memcpy( GlobalLock( pSegTable->selector ),
table->data_start, pSegTable->minsize );
}
pModule->next = hFirstModule; pModule->next = hFirstModule;
hFirstModule = hModule; hFirstModule = hModule;
...@@ -104,13 +110,14 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force ) ...@@ -104,13 +110,14 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
*/ */
BOOL MODULE_Init(void) BOOL MODULE_Init(void)
{ {
/* For these, built-in modules are always used */
#ifndef WINELIB32 #ifndef WINELIB32
if (!MODULE_LoadBuiltin( "KERNEL", TRUE ) || BUILTIN_DLL *dll;
!MODULE_LoadBuiltin( "GDI", TRUE ) ||
!MODULE_LoadBuiltin( "USER", TRUE ) || /* Load all modules marked as always used */
!MODULE_LoadBuiltin( "WINPROCS", TRUE )) return FALSE;
for (dll = dll_builtin_table; dll->name; dll++)
if (dll->flags & DLL_FLAG_ALWAYS_USED)
if (!MODULE_LoadBuiltin(dll->name, TRUE)) return FALSE;
#endif #endif
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */ /* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
...@@ -120,9 +127,9 @@ BOOL MODULE_Init(void) ...@@ -120,9 +127,9 @@ BOOL MODULE_Init(void)
/*********************************************************************** /***********************************************************************
* MODULE_PrintModule * MODULE_DumpModule
*/ */
void MODULE_PrintModule( HMODULE hmodule ) void MODULE_DumpModule( HMODULE hmodule )
{ {
int i, ordinal; int i, ordinal;
SEGTABLEENTRY *pSeg; SEGTABLEENTRY *pSeg;
...@@ -130,6 +137,12 @@ void MODULE_PrintModule( HMODULE hmodule ) ...@@ -130,6 +137,12 @@ void MODULE_PrintModule( HMODULE hmodule )
WORD *pword; WORD *pword;
NE_MODULE *pModule = (NE_MODULE *)GlobalLock( hmodule ); NE_MODULE *pModule = (NE_MODULE *)GlobalLock( hmodule );
if (!pModule || (pModule->magic != NE_SIGNATURE))
{
fprintf( stderr, "**** %04x is not a module handle\n", hmodule );
return;
}
/* Dump the module info */ /* Dump the module info */
printf( "Module %04x:\n", hmodule ); printf( "Module %04x:\n", hmodule );
...@@ -142,6 +155,8 @@ void MODULE_PrintModule( HMODULE hmodule ) ...@@ -142,6 +155,8 @@ void MODULE_PrintModule( HMODULE hmodule )
printf( "os_flags=%d swap_area=%d version=%04x\n", printf( "os_flags=%d swap_area=%d version=%04x\n",
pModule->os_flags, pModule->min_swap_area, pModule->os_flags, pModule->min_swap_area,
pModule->expected_version ); pModule->expected_version );
if (pModule->flags & NE_FFLAGS_WIN32)
printf( "PE module=%08x\n", (unsigned int)NE_WIN32_MODULE(pModule) );
/* Dump the file info */ /* Dump the file info */
...@@ -251,6 +266,31 @@ void MODULE_PrintModule( HMODULE hmodule ) ...@@ -251,6 +266,31 @@ void MODULE_PrintModule( HMODULE hmodule )
/*********************************************************************** /***********************************************************************
* MODULE_WalkModules
*
* Walk the module list and print the modules.
*/
void MODULE_WalkModules(void)
{
HMODULE hModule = hFirstModule;
fprintf( stderr, "Module Flags Name\n" );
while (hModule)
{
NE_MODULE *pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule || (pModule->magic != NE_SIGNATURE))
{
fprintf( stderr, "**** Bad module %04x in list\n", hModule );
return;
}
fprintf( stderr, " %04x %04x %.*s\n", hModule, pModule->flags,
*((char *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1 );
hModule = pModule->next;
}
}
/***********************************************************************
* MODULE_OpenFile * MODULE_OpenFile
*/ */
int MODULE_OpenFile( HMODULE hModule ) int MODULE_OpenFile( HMODULE hModule )
...@@ -591,7 +631,7 @@ HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs ) ...@@ -591,7 +631,7 @@ HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs )
} }
else pModule->dlls_to_init = 0; else pModule->dlls_to_init = 0;
if (debugging_module) MODULE_PrintModule( hModule ); if (debugging_module) MODULE_DumpModule( hModule );
pModule->next = hFirstModule; pModule->next = hFirstModule;
hFirstModule = hModule; hFirstModule = hModule;
return hModule; return hModule;
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/timeb.h> #include <sys/timeb.h>
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__svr4__) #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__svr4__) || defined(_SCO_DS)
#ifndef _SCO_DS
#include <sys/syscall.h> #include <sys/syscall.h>
#endif
#include <sys/param.h> #include <sys/param.h>
#else #else
#include <syscall.h> #include <syscall.h>
...@@ -76,7 +78,7 @@ static void wine_timer(int signal, int code, struct sigcontext *context) ...@@ -76,7 +78,7 @@ static void wine_timer(int signal, int code, struct sigcontext *context)
static void win_fault(int signal, struct sigcontext_struct context_struct) static void win_fault(int signal, struct sigcontext_struct context_struct)
{ {
struct sigcontext_struct *context = &context_struct; struct sigcontext_struct *context = &context_struct;
#elif defined(__svr4__) #elif defined(__svr4__) || defined(_SCO_DS)
static void win_fault(int signal, void *siginfo, ucontext_t *context) static void win_fault(int signal, void *siginfo, ucontext_t *context)
{ {
#else #else
...@@ -128,7 +130,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)() ) ...@@ -128,7 +130,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)() )
#ifdef linux #ifdef linux
sig_act.sa_handler = func; sig_act.sa_handler = func;
sig_act.sa_flags = SA_RESTART; sig_act.sa_flags = SA_RESTART | SA_NOMASK;
/* Point to the top of the stack, minus 4 just in case, and make /* Point to the top of the stack, minus 4 just in case, and make
it aligned */ it aligned */
sig_act.sa_restorer = sig_act.sa_restorer =
...@@ -145,14 +147,14 @@ static void SIGNAL_SetHandler( int sig, void (*func)() ) ...@@ -145,14 +147,14 @@ static void SIGNAL_SetHandler( int sig, void (*func)() )
ret = sigaction( sig, &sig_act, NULL ); ret = sigaction( sig, &sig_act, NULL );
#endif /* __FreeBSD__ || __NetBSD__ */ #endif /* __FreeBSD__ || __NetBSD__ */
#if defined (__svr4__) #if defined (__svr4__) || defined(_SCO_DS)
sigset_t sig_mask; sigset_t sig_mask;
sigemptyset(&sig_mask); sigemptyset(&sig_mask);
sig_act.sa_handler = func; sig_act.sa_handler = func;
sig_act.sa_flags = SA_ONSTACK | SA_SIGINFO; sig_act.sa_flags = SA_ONSTACK | SA_SIGINFO;
sig_act.sa_mask = sig_mask; sig_act.sa_mask = sig_mask;
ret = sigaction( sig, &sig_act, NULL ); ret = sigaction( sig, &sig_act, NULL );
#endif /* __svr4__ */ #endif /* __svr4__ || _SCO_DS */
if (ret < 0) if (ret < 0)
{ {
...@@ -189,7 +191,7 @@ void init_wine_signals(void) ...@@ -189,7 +191,7 @@ void init_wine_signals(void)
} }
#endif /* __FreeBSD__ || __NetBSD__ */ #endif /* __FreeBSD__ || __NetBSD__ */
#if defined (__svr4__) #if defined (__svr4__) || defined(_SCO_DS)
struct sigaltstack ss; struct sigaltstack ss;
if ((ss.ss_sp = malloc(SIGSTKSZ) ) == NULL) { if ((ss.ss_sp = malloc(SIGSTKSZ) ) == NULL) {
...@@ -203,7 +205,7 @@ void init_wine_signals(void) ...@@ -203,7 +205,7 @@ void init_wine_signals(void)
perror("sigstack"); perror("sigstack");
exit(1); exit(1);
} }
#endif /* __svr4__ */ #endif /* __svr4__ || _SCO_DS */
SIGNAL_SetHandler( SIGALRM, (void (*)())wine_timer ); SIGNAL_SetHandler( SIGALRM, (void (*)())wine_timer );
SIGNAL_SetHandler( SIGSEGV, (void (*)())win_fault ); SIGNAL_SetHandler( SIGSEGV, (void (*)())win_fault );
...@@ -217,19 +219,21 @@ void init_wine_signals(void) ...@@ -217,19 +219,21 @@ void init_wine_signals(void)
#ifdef CONFIG_IPC #ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */ SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */
#endif #endif
SIGNAL_StartBIOSTimer();
} }
/********************************************************************** /**********************************************************************
* SIGNAL_StartTimer * SIGNAL_StartBIOSTimer
* *
* Start the BIOS tick timer. * Start the BIOS tick timer.
*/ */
void SIGNAL_StartBIOSTimer(void) void SIGNAL_StartBIOSTimer(void)
{ {
struct itimerval vt_timer; struct itimerval vt_timer;
static int timer_started = 0;
if (timer_started) return;
timer_started = 1;
vt_timer.it_interval.tv_sec = 0; vt_timer.it_interval.tv_sec = 0;
vt_timer.it_interval.tv_usec = 54929; vt_timer.it_interval.tv_usec = 54929;
vt_timer.it_value = vt_timer.it_interval; vt_timer.it_value = vt_timer.it_interval;
......
...@@ -384,7 +384,7 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance, ...@@ -384,7 +384,7 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance,
char *stack16Top, *stack32Top; char *stack16Top, *stack32Top;
STACK16FRAME *frame16; STACK16FRAME *frame16;
STACK32FRAME *frame32; STACK32FRAME *frame32;
extern DWORD CALL16_RetAddr_word; extern DWORD CALLTO16_RetAddr_word;
#endif #endif
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0; if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
...@@ -529,8 +529,8 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance, ...@@ -529,8 +529,8 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance,
frame16->ordinal_number = 24; /* WINPROCS.24 is TASK_Reschedule */ frame16->ordinal_number = 24; /* WINPROCS.24 is TASK_Reschedule */
frame16->dll_id = 24; /* WINPROCS */ frame16->dll_id = 24; /* WINPROCS */
frame16->bp = 0; frame16->bp = 0;
frame16->ip = LOWORD( CALL16_RetAddr_word ); frame16->ip = LOWORD( CALLTO16_RetAddr_word );
frame16->cs = HIWORD( CALL16_RetAddr_word ); frame16->cs = HIWORD( CALLTO16_RetAddr_word );
pTask->sp -= sizeof(STACK16FRAME); pTask->sp -= sizeof(STACK16FRAME);
/* If there's no 16-bit stack yet, use a part of the new task stack */ /* If there's no 16-bit stack yet, use a part of the new task stack */
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount) _syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount)
#endif /* linux */ #endif /* linux */
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
#include <sys/sysi86.h> #include <sys/sysi86.h>
#include <sys/seg.h> #include <sys/seg.h>
#endif #endif
...@@ -153,7 +153,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content ) ...@@ -153,7 +153,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
} }
} }
#endif /* __NetBSD__ || __FreeBSD__ */ #endif /* __NetBSD__ || __FreeBSD__ */
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
{ {
struct ssd ldt_mod; struct ssd ldt_mod;
int i; int i;
......
...@@ -823,16 +823,14 @@ HLOCAL LOCAL_ReAlloc( HANDLE ds, HLOCAL handle, WORD size, WORD flags ) ...@@ -823,16 +823,14 @@ HLOCAL LOCAL_ReAlloc( HANDLE ds, HLOCAL handle, WORD size, WORD flags )
/*********************************************************************** /***********************************************************************
* LOCAL_Lock * LOCAL_InternalLock
*/ */
HANDLE LOCAL_Lock( HANDLE ds, HLOCAL handle ) static HLOCAL LOCAL_InternalLock( LPSTR heap, HLOCAL handle )
{ {
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
dprintf_local( stddeb, "LocalLock: %04x ", handle ); dprintf_local( stddeb, "LocalLock: %04x ", handle );
if (HANDLE_MOVEABLE(handle)) if (HANDLE_MOVEABLE(handle))
{ {
LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(heap + handle);
if (pEntry->lock < 255) pEntry->lock++; if (pEntry->lock < 255) pEntry->lock++;
handle = pEntry->addr; handle = pEntry->addr;
} }
...@@ -842,6 +840,16 @@ HANDLE LOCAL_Lock( HANDLE ds, HLOCAL handle ) ...@@ -842,6 +840,16 @@ HANDLE LOCAL_Lock( HANDLE ds, HLOCAL handle )
/*********************************************************************** /***********************************************************************
* LOCAL_Lock
*/
LPSTR LOCAL_Lock( HANDLE ds, HLOCAL handle )
{
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
return handle ? ptr + LOCAL_InternalLock( ptr, handle ) : NULL;
}
/***********************************************************************
* LOCAL_Unlock * LOCAL_Unlock
*/ */
BOOL LOCAL_Unlock( WORD ds, HLOCAL handle ) BOOL LOCAL_Unlock( WORD ds, HLOCAL handle )
...@@ -929,7 +937,8 @@ HLOCAL LocalFree( HLOCAL handle ) ...@@ -929,7 +937,8 @@ HLOCAL LocalFree( HLOCAL handle )
*/ */
NPVOID LocalLock( HLOCAL handle ) NPVOID LocalLock( HLOCAL handle )
{ {
return LOCAL_Lock( CURRENT_DS, handle ); char *ptr = PTR_SEG_OFF_TO_LIN( CURRENT_DS, 0 );
return (NPVOID)LOCAL_InternalLock( ptr, handle );
} }
......
...@@ -54,7 +54,7 @@ void COMM_Init(void) ...@@ -54,7 +54,7 @@ void COMM_Init(void)
} }
stat(temp, &st); stat(temp, &st);
if (!S_ISCHR(st.st_mode)) if (!S_ISCHR(st.st_mode))
fprintf(stderr,"comm: can 't use `%s' as %s !\n", temp, option); fprintf(stderr,"comm: can't use `%s' as %s !\n", temp, option);
else else
if ((COM[x].devicename = malloc(strlen(temp)+1)) == NULL) if ((COM[x].devicename = malloc(strlen(temp)+1)) == NULL)
fprintf(stderr,"comm: can't malloc for device info!\n"); fprintf(stderr,"comm: can't malloc for device info!\n");
...@@ -77,7 +77,7 @@ void COMM_Init(void) ...@@ -77,7 +77,7 @@ void COMM_Init(void)
else { else {
stat(temp, &st); stat(temp, &st);
if (!S_ISCHR(st.st_mode)) if (!S_ISCHR(st.st_mode))
fprintf(stderr,"comm: can 't use `%s' as %s !\n", temp, option); fprintf(stderr,"comm: can't use `%s' as %s !\n", temp, option);
else else
if ((LPT[x].devicename = malloc(strlen(temp)+1)) == NULL) if ((LPT[x].devicename = malloc(strlen(temp)+1)) == NULL)
fprintf(stderr,"comm: can't malloc for device info!\n"); fprintf(stderr,"comm: can't malloc for device info!\n");
...@@ -352,15 +352,19 @@ LONG EscapeCommFunction(int fd, int nFunction) ...@@ -352,15 +352,19 @@ LONG EscapeCommFunction(int fd, int nFunction)
return 0x80 + max; return 0x80 + max;
break; break;
#ifdef TIOCM_DTR
case CLRDTR: case CLRDTR:
port.c_cflag &= TIOCM_DTR; port.c_cflag &= TIOCM_DTR;
break; break;
#endif
#ifdef TIOCM_RTS
case CLRRTS: case CLRRTS:
port.c_cflag &= TIOCM_RTS; port.c_cflag &= TIOCM_RTS;
break; break;
#endif
#ifndef __svr4__ #ifdef CRTSCTS
case SETDTR: case SETDTR:
port.c_cflag |= CRTSCTS; port.c_cflag |= CRTSCTS;
break; break;
...@@ -464,7 +468,11 @@ int SetCommState(DCB FAR *lpdcb) ...@@ -464,7 +468,11 @@ int SetCommState(DCB FAR *lpdcb)
port.c_cc[VMIN] = 0; port.c_cc[VMIN] = 0;
port.c_cc[VTIME] = 1; port.c_cc[VTIME] = 1;
#ifdef IMAXBEL
port.c_iflag &= ~(ISTRIP|BRKINT|IGNCR|ICRNL|INLCR|IMAXBEL); port.c_iflag &= ~(ISTRIP|BRKINT|IGNCR|ICRNL|INLCR|IMAXBEL);
#else
port.c_iflag &= ~(ISTRIP|BRKINT|IGNCR|ICRNL|INLCR);
#endif
port.c_iflag |= (IGNBRK); port.c_iflag |= (IGNBRK);
port.c_oflag &= ~(OPOST); port.c_oflag &= ~(OPOST);
...@@ -622,7 +630,7 @@ int SetCommState(DCB FAR *lpdcb) ...@@ -622,7 +630,7 @@ int SetCommState(DCB FAR *lpdcb)
commerror = IE_BYTESIZE; commerror = IE_BYTESIZE;
return -1; return -1;
} }
#ifndef __svr4__ #ifdef CRTSCTS
if (lpdcb->fDtrflow || lpdcb->fRtsflow || lpdcb->fOutxCtsFlow) if (lpdcb->fDtrflow || lpdcb->fRtsflow || lpdcb->fOutxCtsFlow)
port.c_cflag |= CRTSCTS; port.c_cflag |= CRTSCTS;
...@@ -730,7 +738,7 @@ int GetCommState(int fd, DCB FAR *lpdcb) ...@@ -730,7 +738,7 @@ int GetCommState(int fd, DCB FAR *lpdcb)
lpdcb->fBinary = 1; lpdcb->fBinary = 1;
lpdcb->fDtrDisable = 0; lpdcb->fDtrDisable = 0;
#ifndef __svr4__ #ifdef CRTSCTS
if (port.c_cflag & CRTSCTS) { if (port.c_cflag & CRTSCTS) {
lpdcb->fDtrflow = 1; lpdcb->fDtrflow = 1;
......
...@@ -266,7 +266,7 @@ BOOL ParseDebugOptions(char *options) ...@@ -266,7 +266,7 @@ BOOL ParseDebugOptions(char *options)
*/ */
static BOOL MAIN_ParseDLLOptions(char *options) static BOOL MAIN_ParseDLLOptions(char *options)
{ {
int i, l; int l;
BUILTIN_DLL *dll; BUILTIN_DLL *dll;
if (strlen(options)<3) return FALSE; if (strlen(options)<3) return FALSE;
...@@ -280,7 +280,11 @@ static BOOL MAIN_ParseDLLOptions(char *options) ...@@ -280,7 +280,11 @@ static BOOL MAIN_ParseDLLOptions(char *options)
if (!lstrncmpi(options+1,dll->name,l-1)) if (!lstrncmpi(options+1,dll->name,l-1))
{ {
if (*options == '+') dll->flags &= ~DLL_FLAG_NOT_USED; if (*options == '+') dll->flags &= ~DLL_FLAG_NOT_USED;
else dll->flags |= DLL_FLAG_NOT_USED; else
{
if (dll->flags & DLL_FLAG_ALWAYS_USED) return FALSE;
dll->flags |= DLL_FLAG_NOT_USED;
}
break; break;
} }
} }
...@@ -438,8 +442,9 @@ static void MAIN_ParseOptions( int *argc, char *argv[] ) ...@@ -438,8 +442,9 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
fprintf(stderr,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv[0]); fprintf(stderr,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv[0]);
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n"); fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs\n"); fprintf(stderr,"Available DLLs\n");
for (dll = dll_builtin_table; dll->name; dll++) for (i = 0, dll = dll_builtin_table; dll->name; dll++)
fprintf(stderr,"%-9s%c",dll->name, (((i+2)%8==0)?'\n':' ')); if (!(dll->flags & DLL_FLAG_ALWAYS_USED))
fprintf(stderr,"%-9s%c",dll->name, (((++i)%8==0)?'\n':' '));
fprintf(stderr,"\n\n"); fprintf(stderr,"\n\n");
exit(1); exit(1);
} }
......
...@@ -9,8 +9,7 @@ unsigned int usleep (unsigned int useconds) ...@@ -9,8 +9,7 @@ unsigned int usleep (unsigned int useconds)
delay.tv_sec = 0; delay.tv_sec = 0;
delay.tv_usec = useconds; delay.tv_usec = useconds;
(void) select (0, (fd_set *) NULL, (fd_set *) NULL, (fd_set *) NULL, (void) select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &delay);
&delay);
return 0; return 0;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include "windows.h" #include "windows.h"
#include "win.h" #include "win.h"
#include "winerror.h" #include "winerror.h"
...@@ -76,7 +77,7 @@ add_handle(HKEY hkey,LPKEYSTRUCT lpkey,REGSAM accessmask) { ...@@ -76,7 +77,7 @@ add_handle(HKEY hkey,LPKEYSTRUCT lpkey,REGSAM accessmask) {
} }
static LPKEYSTRUCT static LPKEYSTRUCT
get_handle(hkey) { get_handle(HKEY hkey) {
int i; int i;
for (i=0;i<nrofopenhandles;i++) for (i=0;i<nrofopenhandles;i++)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef __svr4__ #if defined__svr4__
#include <sys/filio.h> #include <sys/filio.h>
#include <sys/ioccom.h> #include <sys/ioccom.h>
#endif #endif
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
#ifdef _SCO_DS
#define _IOR _IOSR
#define _IOW _IOSW
#endif
static WORD wsa_errno; static WORD wsa_errno;
static int wsa_initted; static int wsa_initted;
static key_t wine_key = 0; static key_t wine_key = 0;
...@@ -208,7 +213,9 @@ static WORD wsaerrno(void) ...@@ -208,7 +213,9 @@ static WORD wsaerrno(void)
#ifdef EPROCLIM #ifdef EPROCLIM
case EPROCLIM: return WSAEPROCLIM; case EPROCLIM: return WSAEPROCLIM;
#endif #endif
#ifdef EUSERS
case EUSERS: return WSAEUSERS; case EUSERS: return WSAEUSERS;
#endif
#ifdef EDQUOT #ifdef EDQUOT
case EDQUOT: return WSAEDQUOT; case EDQUOT: return WSAEDQUOT;
#endif #endif
......
...@@ -138,7 +138,7 @@ BOOL DOSMEM_Init(void) ...@@ -138,7 +138,7 @@ BOOL DOSMEM_Init(void)
*/ */
void DOSMEM_Tick(void) void DOSMEM_Tick(void)
{ {
pBiosData->Ticks++; if (pBiosData) pBiosData->Ticks++;
} }
...@@ -149,8 +149,6 @@ void DOSMEM_Tick(void) ...@@ -149,8 +149,6 @@ void DOSMEM_Tick(void)
*/ */
void DOSMEM_FillBiosSegment(void) void DOSMEM_FillBiosSegment(void)
{ {
extern void SIGNAL_StartBIOSTimer(void);
pBiosData = (BIOSDATA *)GlobalLock( DOSMEM_BiosSeg ); pBiosData = (BIOSDATA *)GlobalLock( DOSMEM_BiosSeg );
/* Clear all unused values */ /* Clear all unused values */
...@@ -175,7 +173,5 @@ void DOSMEM_FillBiosSegment(void) ...@@ -175,7 +173,5 @@ void DOSMEM_FillBiosSegment(void)
pBiosData->NbHardDisks = 2; pBiosData->NbHardDisks = 2;
pBiosData->KbdBufferStart = 0x1e; pBiosData->KbdBufferStart = 0x1e;
pBiosData->KbdBufferEnd = 0x3e; pBiosData->KbdBufferEnd = 0x3e;
SIGNAL_StartBIOSTimer();
} }
...@@ -28,8 +28,10 @@ static WORD INSTR_ReplaceSelector( struct sigcontext_struct *context, WORD sel) ...@@ -28,8 +28,10 @@ static WORD INSTR_ReplaceSelector( struct sigcontext_struct *context, WORD sel)
{ {
if (sel == 0x40) if (sel == 0x40)
{ {
extern void SIGNAL_StartBIOSTimer(void);
fprintf( stderr, "Direct access to segment 0x40 (cs:ip=%04x:%04lx).\n", fprintf( stderr, "Direct access to segment 0x40 (cs:ip=%04x:%04lx).\n",
CS_reg(context), EIP_reg(context) ); CS_reg(context), EIP_reg(context) );
SIGNAL_StartBIOSTimer();
return DOSMEM_BiosSeg; return DOSMEM_BiosSeg;
} }
return 0; /* Can't replace selector */ return 0; /* Can't replace selector */
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "xmalloc.h" #include "xmalloc.h"
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
/* SVR4 DOESNTdo locking the same way must implement properly */ /* SVR4 DOESNT do locking the same way must implement properly */
#define LOCK_EX 0 #define LOCK_EX 0
#define LOCK_SH 1 #define LOCK_SH 1
#define LOCK_NB 8 #define LOCK_NB 8
...@@ -346,7 +346,7 @@ void OpenExistingFile(struct sigcontext_struct *context) ...@@ -346,7 +346,7 @@ void OpenExistingFile(struct sigcontext_struct *context)
int result,retries=sharing_retries; int result,retries=sharing_retries;
{ {
#ifdef __svr4__ #if defined(__svr4__) || defined(_SCO_DS)
printf("Should call flock and needs porting to lockf\n"); printf("Should call flock and needs porting to lockf\n");
result = 0; result = 0;
retries = 0; retries = 0;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "windows.h" #include "windows.h"
#include "win.h" #include "win.h"
#include "ldt.h" #include "ldt.h"
#include "module.h"
#include "callback.h" #include "callback.h"
#include "user.h" #include "user.h"
#include "driver.h" #include "driver.h"
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* *
* Copyright 1993 Alexandre Julliard * Copyright 1993 Alexandre Julliard
* *
* Enhacements by Juergen Marquardt 1996
*
* Implementation of a second font cache which
* will be updated dynamically
*/ */
#include <stdio.h> #include <stdio.h>
...@@ -17,6 +21,7 @@ ...@@ -17,6 +21,7 @@
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
#define FONTCACHE 32 /* dynamic font cache size */
#define MAX_FONTS 256 #define MAX_FONTS 256
static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL }; static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL };
...@@ -139,10 +144,15 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc ) ...@@ -139,10 +144,15 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
if (height == 0) height = 120; /* Default height = 12 */ if (height == 0) height = 120; /* Default height = 12 */
else if (height < 0) else if (height < 0)
{ {
/* If height is negative, it means the height of the characters */ /* If height is negative, it means the height of the characters */
/* *without* the internal leading. So we adjust it a bit to */ /* *without* the internal leading. So we adjust it a bit to */
/* compensate. 5/4 seems to give good results for small fonts. */ /* compensate. 5/4 seems to give good results for small fonts. */
height = 10 * (-height * 8 / 7); /*
* J.M.: This causes wrong font size for bigger fonts e.g. in Winword & Write
height = 10 * (-height * 9 / 8);
* may be we have to use an non linear function
*/
height *= -10;
} }
else height *= 10; else height *= 10;
width = 10 * (font->lfWidth * dc->w.VportExtY / dc->w.WndExtY); width = 10 * (font->lfWidth * dc->w.VportExtY / dc->w.WndExtY);
...@@ -151,10 +161,17 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc ) ...@@ -151,10 +161,17 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
width, font->lfWidth ); width, font->lfWidth );
width = -width; width = -width;
} }
spacing = (font->lfPitchAndFamily & FIXED_PITCH) ? 'm' : spacing = (font->lfPitchAndFamily & FIXED_PITCH) ? 'm' :
(font->lfPitchAndFamily & VARIABLE_PITCH) ? 'p' : '*'; (font->lfPitchAndFamily & VARIABLE_PITCH) ? 'p' : '*';
charset = (font->lfCharSet == ANSI_CHARSET) ? "iso8859-1" : "*-*"; charset = (font->lfCharSet == ANSI_CHARSET) ? "iso8859-1" : "*-*";
if (*font->lfFaceName) family = FONT_TranslateName( font->lfFaceName ); if (*font->lfFaceName) {
family = FONT_TranslateName( font->lfFaceName );
/* FIX ME: I don't if that's correct but it works J.M. */
spacing = '*';
}
else switch(font->lfPitchAndFamily & 0xf0) else switch(font->lfPitchAndFamily & 0xf0)
{ {
case FF_ROMAN: case FF_ROMAN:
...@@ -191,6 +208,7 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc ) ...@@ -191,6 +208,7 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
names = XListFonts( display, pattern, 1, &count ); names = XListFonts( display, pattern, 1, &count );
if (count > 0) break; if (count > 0) break;
if (spacing == 'm') /* try 'c' if no 'm' found */ { if (spacing == 'm') /* try 'c' if no 'm' found */ {
spacing = 'c'; spacing = 'c';
continue; continue;
} else if (spacing == 'p') /* try '*' if no 'p' found */ { } else if (spacing == 'p') /* try '*' if no 'p' found */ {
...@@ -367,6 +385,15 @@ int FONT_GetObject( FONTOBJ * font, int count, LPSTR buffer ) ...@@ -367,6 +385,15 @@ int FONT_GetObject( FONTOBJ * font, int count, LPSTR buffer )
HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font ) HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
{ {
static X_PHYSFONT stockFonts[LAST_STOCK_FONT-FIRST_STOCK_FONT+1]; static X_PHYSFONT stockFonts[LAST_STOCK_FONT-FIRST_STOCK_FONT+1];
static struct {
HFONT id;
LOGFONT logfont;
int access;
int used;
X_PHYSFONT cacheFont; } cacheFonts[FONTCACHE], *cacheFontsMin;
int i;
X_PHYSFONT * stockPtr; X_PHYSFONT * stockPtr;
HFONT prevHandle = dc->w.hFont; HFONT prevHandle = dc->w.hFont;
XFontStruct * fontStruct; XFontStruct * fontStruct;
...@@ -393,9 +420,46 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font ) ...@@ -393,9 +420,46 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
if ((hfont >= FIRST_STOCK_FONT) && (hfont <= LAST_STOCK_FONT)) if ((hfont >= FIRST_STOCK_FONT) && (hfont <= LAST_STOCK_FONT))
stockPtr = &stockFonts[hfont - FIRST_STOCK_FONT]; stockPtr = &stockFonts[hfont - FIRST_STOCK_FONT];
else else {
stockPtr = NULL; stockPtr = NULL;
/*
* Ok, It's not a stock font but
* may be it's cached in dynamic cache
*/
for(i=0; i<FONTCACHE; i++) /* search for same handle */
if (cacheFonts[i].id==hfont) { /* Got the handle */
/*
* Check if Handle matches the font
*/
if(memcmp(&cacheFonts[i].logfont,&(font->logfont), sizeof(LOGFONT))) {
/* No: remove handle id from dynamic font cache */
cacheFonts[i].access=0;
cacheFonts[i].used=0;
cacheFonts[i].id=0;
/* may be there is an unused handle which contains the font */
for(i=0; i<FONTCACHE; i++) {
if((cacheFonts[i].used == 0) &&
(memcmp(&cacheFonts[i].logfont,&(font->logfont), sizeof(LOGFONT)))== 0) {
/* got it load from cache and set new handle id */
stockPtr = &cacheFonts[i].cacheFont;
cacheFonts[i].access=1;
cacheFonts[i].used=1;
cacheFonts[i].id=hfont;
dprintf_font(stddeb,"FONT_SelectObject: got font from unused handle\n");
break;
}
}
}
else {
/* Yes: load from dynamic font cache */
stockPtr = &cacheFonts[i].cacheFont;
cacheFonts[i].access++;
cacheFonts[i].used++;
}
break;
}
}
if (!stockPtr || !stockPtr->fstruct) if (!stockPtr || !stockPtr->fstruct)
{ {
if (!(fontStruct = FONT_MatchFont( &font->logfont, dc ))) if (!(fontStruct = FONT_MatchFont( &font->logfont, dc )))
...@@ -422,16 +486,14 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font ) ...@@ -422,16 +486,14 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
hfont, fontStruct ); hfont, fontStruct );
} }
/* Free previous font */ /* Unuse previous font */
for (i=0; i < FONTCACHE; i++) {
if ((prevHandle < FIRST_STOCK_FONT) || (prevHandle > LAST_STOCK_FONT)) if (cacheFonts[i].id == prevHandle) {
{ cacheFonts[i].used--;
if (dc->u.x.font.fstruct) }
XFreeFont( display, dc->u.x.font.fstruct ); }
}
/* Store font */ /* Store font */
dc->w.hFont = hfont; dc->w.hFont = hfont;
if (stockPtr) if (stockPtr)
{ {
...@@ -444,8 +506,31 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font ) ...@@ -444,8 +506,31 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
} }
else else
{ {
dc->u.x.font.fstruct = fontStruct; /*
FONT_GetMetrics( &font->logfont, fontStruct, &dc->u.x.font.metrics ); * Check in cacheFont
*/
cacheFontsMin=NULL;
for (i=0; i < FONTCACHE; i++) {
if (cacheFonts[i].used==0)
if ((!cacheFontsMin) || ((cacheFontsMin) && (cacheFontsMin->access > cacheFonts[i].access)))
cacheFontsMin=&cacheFonts[i];
}
if (!cacheFontsMin)
fprintf(stderr,"No unused font cache entry !!!!\n" );
if (cacheFontsMin->id!=0) {
dprintf_font(stddeb,
"FONT_SelectObject: Freeing %04x \n",cacheFontsMin->id );
XFreeFont( display, cacheFontsMin->cacheFont.fstruct );
}
cacheFontsMin->cacheFont.fstruct = fontStruct;
FONT_GetMetrics( &font->logfont, fontStruct, &cacheFontsMin->cacheFont.metrics );
cacheFontsMin->access=1;
cacheFontsMin->used=1;
cacheFontsMin->id=hfont;
memcpy( &dc->u.x.font, &(cacheFontsMin->cacheFont), sizeof(cacheFontsMin->cacheFont) );
memcpy(&cacheFontsMin->logfont,&(font->logfont), sizeof(LOGFONT));
} }
return prevHandle; return prevHandle;
} }
......
Due to the implementation of FindText() and ReplaceText() in /misc/commdlg.c The dimensions of the controls should be changed so that they will be big
I had to change the definition in sysres_En.rc of the dialogs FIND_TEXT and enough to contain the text for every individual language.
REPLACE_TEXT. These changes should also be made for the other languages.
Not only should the definitions in sysres_??.rc made up to date with the
Enlish version, but also the dimensions of the controls should be changed so
that they will be big enough to contain the text for every individual
language.
Therefore: Therefore:
- Definitions of FIND_TEXT and REPLACE_TEXT in sysres_??.rc should match
those in sysres_En.rc
- Dimensions of controls are based on sysres_En.rc. Other languages should - Dimensions of controls are based on sysres_En.rc. Other languages should
change these dimensions in order to make the text fit. change these dimensions in order to make the text fit.
Frans van Dorsselaer I (krynos@qbc.clic.net) will try to make sysres_Fr.rc fit correctly, if
dorssel@rulhm1.LeidenUniv.nl someone is interrested in others languages, message me. I may correct
others languages after, but not soon.
Here are structure of each line (for example):
PUSHBUTTON "&Help", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
1038: The ID of this button, you shouldn't change this.
174 : X-offset of the button with respect to the upper-left corner of
the dialog box.
75 : Y-offset
50 : The width of the button
14 : The height
flags (WS_??? etc): They control how the dialog behaves. Things like:
changing the focus with a TAB, scrolling to a list
of radiobuttons with up/down keys, etc. If you're
not sure: leave them as they are (in the english
version).
Robert Pouliot (krynos@qbc.clic.net): Changes to sysres_Fr.rc have been made. Frans van Dorsselaer
dorssel@rulhm1.LeidenUniv.nl
...@@ -165,36 +165,38 @@ FONT 8, "Helv" ...@@ -165,36 +165,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Hledn" CAPTION "Hledn"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Vyhledat:", 1088, 6, 6, 40, 9 LTEXT "&Vyhledat:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Pouze &cel slova", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Pouze &cel slova", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "&Rozliovat mal a velk psmena", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Rozliovat mal a velk psmena", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Smr", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Smr", 1072, 107, 26, 68, 28
RADIOBUTTON "&Nahoru", 1056, 100, 50, 50, 12 CONTROL "N&ahoru", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Dolu", 1057, 150, 50, 50, 12 CONTROL "&Dolu", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "Vyhledat d&al", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Vyhledat d&al", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Zavt", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Zavt", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Npovda", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Zmna" CAPTION "Zmna"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Vyhledat:", 1088, 6, 6, 40, 9 LTEXT "&Vyhledat:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "&Zamnit za:", 1090, 6, 26, 40, 9 LTEXT "&Zamnit za:", -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Pouze &cel slova", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Pouze &cel slova", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "&Rozliovat mal a velk psmena", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Rozliovat mal a velk psmena", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP
DEFPUSHBUTTON "Vyhledat d&al", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Vyhledat d&al", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Za&mnit", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Za&mnit", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Zamnit ve v&bru", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Zamnit ve v&bru", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Zavt", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Zavt", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Npovda", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -165,36 +165,38 @@ FONT 8, "Helv" ...@@ -165,36 +165,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Find" CAPTION "Find"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Find hvad:", 1088, 6, 6, 40, 9 LTEXT "&Find hvad:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Kun &hele ord", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Kun hele ord", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Forskel p store/sm &bogstaver", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Forskel p store/sm &bogstaver", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Retning", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Retning", 1072, 107, 26, 68, 28
RADIOBUTTON "&Op", 1056, 100, 50, 50, 12 CONTROL "&Op", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Ned", 1057, 150, 50, 50, 12 CONTROL "&Ned", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "&Find nste", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Find nste", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Annuller", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Annuller", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Hjlp", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Erstat" CAPTION "Erstat"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Find hvad:", 1088, 6, 6, 40, 9 LTEXT "&Find hvad:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "&Erstat med:", 1090, 6, 26, 40, 9 LTEXT "&Erstat med:", -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Kun &hele ord", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Kun hele ord", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_TABSTOP
CHECKBOX "Forskel p store/sm &bogstaver", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Forskel p store/sm &bogstaver", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP
DEFPUSHBUTTON "&Find nste", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Find nste", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Erstat", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Erstat", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Erstat &alle", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Erstat &alle", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Afbryd", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Annuller", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Hjlp", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -165,37 +165,38 @@ FONT 8, "Helv" ...@@ -165,37 +165,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Suchen" CAPTION "Suchen"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "S&uchen nach:", 1088, 6, 6, 40, 9 LTEXT "S&uchen nach:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Nur ganze &Worte", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Nur ganze &Worte", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Beachte Gro/Kleinschreibung", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Beachte Gro/Kleinschreibung", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Richtung", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Richtung", 1072, 107, 26, 68, 28
RADIOBUTTON "&Hoch", 1056, 100, 50, 50, 12 CONTROL "H&och", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Runter", 1057, 150, 50, 50, 12 CONTROL "&Runter", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "&Nchsten finden", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Nchsten finden", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Abbrechen", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Abbrechen", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Hilfe", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ersetzen" CAPTION "Ersetzen"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "S&uchen nach:", 1088, 6, 6, 40, 9 LTEXT "S&uchen nach:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "Ersetzen &durch:", 1090, 6, 26, 40, 9 LTEXT "Ersetzen &durch:", -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Nur ganze &Worte", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Nur ganze &Worte", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Beachte Gro/Kleinschreibung", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Beachte Gro/Kleinschreibung", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP
DEFPUSHBUTTON "&Nchsten finden", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Nchsten finden", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Ersetzen", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Ersetzen", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Alle ersetzen", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Alle ersetzen", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Abbrechen", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Abbrechen", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Hilfe", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -165,37 +165,38 @@ FONT 8, "Helv" ...@@ -165,37 +165,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Seru" CAPTION "Seru"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Seru:", 1088, 6, 6, 40, 9 LTEXT "&Seru:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Nur tutan &vorton", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Nur tutan &vorton", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Atentu &Usklecon", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Atentu &Usklecon", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Direkto", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Direkto", 1072, 107, 26, 68, 28
RADIOBUTTON "&Retro", 1056, 100, 50, 50, 12 CONTROL "&Retro", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Antaen", 1057, 150, 50, 50, 12 CONTROL "&Antaen", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "&Pluseru", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Pluseru", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Nuligu", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Nuligu", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Helpu", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Anstataigu" CAPTION "Anstataigu"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "Anstataigu:", 1088, 6, 6, 40, 9 LTEXT "Anstataigu:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "&per:", 1090, 6, 26, 40, 9 LTEXT "&per:", -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "Nur tutan &vorton", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Nur tutan &vorton", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Atentu &Usklecon", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Atentu &Usklecon", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP
DEFPUSHBUTTON "Plu&seru", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Plu&seru", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Anstataigu", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Anstataigu", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Anstataigu &iujn", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Anstataigu &iujn", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Nuligu", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Nuligu", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Helpu", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -166,37 +166,38 @@ FONT 8, "Helv" ...@@ -166,37 +166,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Buscar" CAPTION "Buscar"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "Buscar:", 1088, 6, 6, 40, 9 LTEXT "Buscar:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "&Comparar palabra entera solamente", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Comparar palabra entera solamente", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "&Maysculas/minsculas", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Maysculas/minsculas", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Direccin", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Direccin", 1072, 107, 26, 68, 28
RADIOBUTTON "A&rriba", 1056, 100, 50, 50, 12 CONTROL "A&rriba", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Abajo", 1057, 150, 50, 50, 12 CONTROL "&Abajo", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "Buscar &siguiente", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Buscar &siguiente", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Cancelar", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Cancelar", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "A&yuda", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "R&eemplazar" CAPTION "R&eemplazar"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "Buscar:", 1088, 6, 6, 40, 9 LTEXT "Buscar:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "Re&place With:", 1090, 6, 26, 40, 9 LTEXT "Re&emplazar por:", 1090, -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "&Comparar palabra entera solamente", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Comparar palabra entera solamente", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "&Maysculas/minsculas", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Maysculas/minsculas", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP
DEFPUSHBUTTON "Reemplazar &siguiente", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Reemplazar &siguiente", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Reemplazar", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Reemplazar", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Reemplazar &todo", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Reemplazar &todo", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Cancelar", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Cancelar", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "A&yuda", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -165,36 +165,38 @@ FONT 8, "Helv" ...@@ -165,36 +165,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Etsi" CAPTION "Etsi"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Etsittv:", 1088, 6, 6, 40, 9 LTEXT "&Etsittv:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "&Koko sana", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Koko sana", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Kirjaink&oko", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Kirjaink&oko", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Suunta", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Suunta", 1072, 107, 26, 68, 28
RADIOBUTTON "&Yls", 1056, 100, 50, 50, 12 CONTROL "&Yls", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Alas", 1057, 150, 50, 50, 12 CONTROL "&Alas", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "Etsi &seuraava", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Etsi &seuraava", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Peruuta", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Peruuta", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "O&hje", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Korvaa" CAPTION "Korvaa"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Etsittv:", 1088, 6, 6, 40, 9 LTEXT "&Etsittv:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "Ko&rvattava:", 1090, 6, 26, 40, 9 LTEXT "Ko&rvattava:", -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "&Koko sana", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Koko sana", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "Kirjaink&oko", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "Kirjaink&oko", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP
DEFPUSHBUTTON "Etsi &seuraava", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "Etsi &seuraava", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Korv&aa", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Korv&aa", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Korvaa ka&ikki", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Korvaa ka&ikki", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "S&ulje", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "S&ulje", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "O&hje", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -165,36 +165,38 @@ FONT 8, "Helv" ...@@ -165,36 +165,38 @@ FONT 8, "Helv"
} }
FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84 FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 236, 62
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Finn" CAPTION "Finn"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Finn hva:", 1088, 6, 6, 40, 9 LTEXT "&Finn hva:", -1, 4, 8, 42, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 47, 7, 128, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "&Kun hele ord", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Kun hele ord", 1040, 4, 26, 100, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "&Skill p store/sm bokstaver", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Skill p store/sm bokstaver", 1041, 4, 42, 64, 12, BS_AUTOCHECKBOX | WS_TABSTOP
GROUPBOX "Retning", 1072, 90, 40, 80, 40, BS_GROUPBOX GROUPBOX "Retning", 1072, 107, 26, 68, 28
RADIOBUTTON "&Opp", 1056, 100, 50, 50, 12 CONTROL "&Opp", 1056, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 111, 38, 20, 12
RADIOBUTTON "&Ned", 1057, 150, 50, 50, 12 CONTROL "&Ned", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12
DEFPUSHBUTTON "&Finn neste", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Finn neste", 1, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Avbryt", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Avbryt", 2, 182, 23, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Hjelp", 1038, 182, 45, 50, 14, WS_GROUP | WS_TABSTOP
} }
REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114 REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 230, 94
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Bytt" CAPTION "Bytt"
FONT 8, "Helv" FONT 8, "Helv"
{ {
LTEXT "&Finn hva:", 1088, 6, 6, 40, 9 LTEXT "&Finn hva:", -1, 4, 9, 48, 8
LTEXT "", 1089, 60, 6, 150, 9 EDITTEXT 1152, 54, 7, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
LTEXT "&Bytt med:", 1090, 6, 26, 40, 9 LTEXT "&Bytt med:", -1, 4, 26, 48, 8
LTEXT "", 1091, 60, 26, 150, 9 EDITTEXT 1153, 54, 24, 114, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
CHECKBOX "&Kun hele ord", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Kun hele ord", 1040, 5, 46, 104, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
CHECKBOX "&Skill p store/sm bokstaver", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Skill p store/sm bokstaver", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
DEFPUSHBUTTON "&Finn neste", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP DEFPUSHBUTTON "&Finn neste", 1, 174, 4, 50, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Bytt", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Bytt", 1024, 174, 21, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Bytt alt", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Bytt alt", 1025, 174, 38, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Avbryt", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Avbryt", 2, 174, 55, 50, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Hjelp", 1038, 174, 75, 50, 14, WS_GROUP | WS_TABSTOP
} }
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include "windows.h" #include "windows.h"
#include "winerror.h" #include "winerror.h"
#include "kernel32.h" #include "kernel32.h"
#include "module.h"
#include "task.h" #include "task.h"
#include "pe_image.h"
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
...@@ -26,7 +26,7 @@ LPSTR GetCommandLineA(void) ...@@ -26,7 +26,7 @@ LPSTR GetCommandLineA(void)
PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() ); PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
#ifndef WINELIB #ifndef WINELIB
strcpy(buffer, wine_files->name); strcpy(buffer, MODULE_GetModuleName( GetExePtr(GetCurrentTask()) ) );
cp = buffer+strlen(buffer); cp = buffer+strlen(buffer);
*cp++ = ' '; *cp++ = ' ';
#else #else
......
...@@ -39,17 +39,14 @@ ...@@ -39,17 +39,14 @@
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
#include "except.h" #include "except.h"
#include "relay32.h"
WINAPI DWORD KERNEL32_537(PEXCEPTION_POINTERS ptrs);
LPTOP_LEVEL_EXCEPTION_FILTER pTopExcHandler = NULL; LPTOP_LEVEL_EXCEPTION_FILTER pTopExcHandler = NULL;
void EXC_Init(void) void EXC_Init(void)
{ {
WIN32_builtin *dll = RELAY32_GetBuiltinDLL("KERNEL32"); pTopExcHandler = (LPTOP_LEVEL_EXCEPTION_FILTER)PE_GetProcAddress(
pTopExcHandler = (LPTOP_LEVEL_EXCEPTION_FILTER)RELAY32_GetEntryPoint( dll, GetModuleHandle("KERNEL32"),
"UnhandledExceptionFilter", 537 ); "UnhandledExceptionFilter" );
} }
/* /*
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "kernel32.h" #include "kernel32.h"
#include "handle32.h" #include "handle32.h"
#include "except.h" #include "except.h"
#include "pe_image.h"
#include "task.h" #include "task.h"
#include "stddebug.h" #include "stddebug.h"
#define DEBUG_WIN32 #define DEBUG_WIN32
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "windows.h" #include "windows.h"
#include "kernel32.h" #include "kernel32.h"
#include "pe_image.h" #include "pe_image.h"
#include "module.h"
#include "handle32.h" #include "handle32.h"
#include "libres.h" #include "libres.h"
#include "resource32.h" #include "resource32.h"
...@@ -92,7 +93,8 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntry(PIMAGE_RESOURCE_DIRECTORY resdirptr, ...@@ -92,7 +93,8 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntry(PIMAGE_RESOURCE_DIRECTORY resdirptr,
HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type ) HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
{ {
#ifndef WINELIB #ifndef WINELIB
struct w_files *wptr = wine_files; struct pe_data *pe;
NE_MODULE *pModule;
PIMAGE_RESOURCE_DIRECTORY resdirptr; PIMAGE_RESOURCE_DIRECTORY resdirptr;
DWORD root; DWORD root;
HANDLE32 result; HANDLE32 result;
...@@ -103,11 +105,11 @@ HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type ) ...@@ -103,11 +105,11 @@ HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
dprintf_resource( stddeb, " name=" ); dprintf_resource( stddeb, " name=" );
PrintId( name ); PrintId( name );
dprintf_resource( stddeb, "\n" ); dprintf_resource( stddeb, "\n" );
while (wptr != NULL && (wptr->hModule != hModule)) if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
wptr = wptr->next; if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0; /* FIXME? */
if ((wptr == NULL) || (wptr->pe == NULL) || (wptr->pe->pe_resource == NULL)) if (!(pe = NE_WIN32_MODULE(pModule)) || !pe->pe_resource) return 0;
return 0;
resdirptr = (PIMAGE_RESOURCE_DIRECTORY) wptr->pe->pe_resource; resdirptr = (PIMAGE_RESOURCE_DIRECTORY) pe->pe_resource;
root = (DWORD) resdirptr; root = (DWORD) resdirptr;
if ((resdirptr = GetResDirEntry(resdirptr, type, root)) == NULL) if ((resdirptr = GetResDirEntry(resdirptr, type, root)) == NULL)
return 0; return 0;
...@@ -129,17 +131,18 @@ HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type ) ...@@ -129,17 +131,18 @@ HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
HANDLE32 LoadResource32( HINSTANCE hModule, HANDLE32 hRsrc ) HANDLE32 LoadResource32( HINSTANCE hModule, HANDLE32 hRsrc )
{ {
#ifndef WINELIB #ifndef WINELIB
struct w_files *wptr = wine_files; struct pe_data *pe;
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */ hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "LoadResource: module=%04x res=%04x\n", dprintf_resource(stddeb, "LoadResource: module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!hRsrc) return 0; if (!hRsrc) return 0;
while (wptr != NULL && (wptr->hModule != hModule))
wptr = wptr->next; if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
if ((wptr == NULL) || (wptr->pe == NULL) || (wptr->pe->pe_resource == NULL)) if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0; /* FIXME? */
return 0; if (!(pe = NE_WIN32_MODULE(pModule)) || !pe->pe_resource) return 0;
return (HANDLE32) (wptr->load_addr+((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData); return (HANDLE32) (pe->load_addr+((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
#else #else
return LIBRES_LoadResource( hModule, hRsrc ); return LIBRES_LoadResource( hModule, hRsrc );
#endif #endif
......
...@@ -33,10 +33,9 @@ static short iMenuSysKey = 0; ...@@ -33,10 +33,9 @@ static short iMenuSysKey = 0;
* *
* Set the window text. * Set the window text.
*/ */
void DEFWND_SetText( HWND hwnd, LPSTR text ) void DEFWND_SetText( WND *wndPtr, LPSTR text )
{ {
LPSTR textPtr; LPSTR textPtr;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!text) text = ""; if (!text) text = "";
if (wndPtr->hText) USER_HEAP_FREE( wndPtr->hText ); if (wndPtr->hText) USER_HEAP_FREE( wndPtr->hText );
...@@ -66,7 +65,7 @@ LRESULT DefWindowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) ...@@ -66,7 +65,7 @@ LRESULT DefWindowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{ {
CREATESTRUCT *createStruct = (CREATESTRUCT*)PTR_SEG_TO_LIN(lParam); CREATESTRUCT *createStruct = (CREATESTRUCT*)PTR_SEG_TO_LIN(lParam);
if (createStruct->lpszName) if (createStruct->lpszName)
DEFWND_SetText( hwnd, DEFWND_SetText( wndPtr,
(LPSTR)PTR_SEG_TO_LIN(createStruct->lpszName) ); (LPSTR)PTR_SEG_TO_LIN(createStruct->lpszName) );
return 1; return 1;
} }
...@@ -249,7 +248,7 @@ LRESULT DefWindowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) ...@@ -249,7 +248,7 @@ LRESULT DefWindowProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
} }
case WM_SETTEXT: case WM_SETTEXT:
DEFWND_SetText( hwnd, (LPSTR)PTR_SEG_TO_LIN(lParam) ); DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(lParam) );
NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */ NC_HandleNCPaint( hwnd , (HRGN)1 ); /* Repaint caption */
return 0; return 0;
......
...@@ -182,7 +182,6 @@ int MessageBox(HWND hWnd, LPCSTR text, LPCSTR title, WORD type) ...@@ -182,7 +182,6 @@ int MessageBox(HWND hWnd, LPCSTR text, LPCSTR title, WORD type)
HANDLE handle; HANDLE handle;
MSGBOX mbox; MSGBOX mbox;
int ret; int ret;
DWORD WineProc,Win16Proc,Win32Proc;
mbox.title = title; mbox.title = title;
mbox.text = text; mbox.text = text;
......
...@@ -272,7 +272,7 @@ void WIN_SendParentNotify( HWND hwnd, WORD event, WORD idChild, LONG lValue ) ...@@ -272,7 +272,7 @@ void WIN_SendParentNotify( HWND hwnd, WORD event, WORD idChild, LONG lValue )
/* if lValue contains cursor coordinates they have to be /* if lValue contains cursor coordinates they have to be
* mapped to the client area of parent window */ * mapped to the client area of parent window */
if (bMouse) MapWindowPoints(0, hwnd, lppt, 2); if (bMouse) MapWindowPoints(0, hwnd, lppt, 1);
#ifndef WINELIB32 #ifndef WINELIB32
else lValue = MAKELONG( LOWORD(lValue), idChild ); else lValue = MAKELONG( LOWORD(lValue), idChild );
#endif #endif
......
...@@ -40,6 +40,9 @@ SymbolTableFile=./wine.sym ...@@ -40,6 +40,9 @@ SymbolTableFile=./wine.sym
system=*-helvetica system=*-helvetica
mssansserif=*-helvetica mssansserif=*-helvetica
msserif=*-times msserif=*-times
courier new=adobe-courier
times new roman=adobe-times
symbol=adobe-symbol
fixedsys=*-fixed fixedsys=*-fixed
arial=*-helvetica arial=*-helvetica
helv=*-helvetica helv=*-helvetica
......
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