Commit 2787be87 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 950522

Sun May 21 12:30:30 1995 Alexandre Julliard (julliard@sunsite.unc.edu) * [debugger/hash.c] [debugger/info.c] Added support for symbolic segmented addresses. Add symbols for all built-in API entry points. * [if1632/relay.c] [include/dlls.h] Removed dll_table structure, as we now use the built-in module structures. * [if1632/relay.c] [loader/main.c] Removed winestat option, as it was no longer very meaningful. * [include/stackframe.h] New macro MAKE_SEGPTR that creates a segmented pointer to a local variable on the 32-bit stack. * [loader/module.c] Added support for multiple instances of an application. Implemented LoadModule() and FreeModule(). * [loader/ne_image.c] [loader/task.c] Moved initialisation of built-in DLLs to InitTask(). * [memory/global.c] Implemented discardable blocks. * [misc/file.c] Search path of current executable in OpenFile(). Fixed bug with searching in Windows path. * [misc/lstr.c] Hard-coded translation tables for Ansi<->Oem. * [misc/user.c] Moved some global initializations to InitApp(), because they need a task context to be performed. * [objects/dc.c] Handle R2_BLACK and R2_WHITE specially so that they work correctly with palette displays. * [tools/build.c] Suppressed generation of the C file for DLL specs, because it's no longer needed. Output all the assembly code directly to stdout. Some changes to integrate Win32 support from Martin von Loewis. * [windows/msgbox.c] Moved message box code from misc/ to windows/. Mon May 15 23:40:04 1995 Martin Ayotte (wine@trgcorp.mksinfo.qc.ca) * [misc/audio.c] [misc/mcicda.c] [misc/mcianim.c] [misc/midi.c] [misc/mmaux.c] [misc/mmsystem.c] Modify code & use pointers conversion macros. Make cdaudio & wave devices work again (only using some applets). * [misc/profile.c] Change getc() to fgetc() where needed. Mon May 15 22:10:56 1995 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/Imakefile] added entries for the new files gdi32.spec, kernel32.spec, user32.spec, shell32.spec and winprocs32.spec. * [if1632/commdlg.spec][if1632/kernel.spec][if1632/shell.spec] [if1632/storage.spec][if1632/system.spec][if1632/user.spec] ChooseFont, RESERVED5, InternalExtractIcon: Marked as stubs ExtractAssociatedIcon, DoEnvironmentSubst, DumpIcon: stub implementations provided marked storage.dll,storege.sys functions as stubs * [include/pe_image.h] Added structures WIN32_builtin and WIN32_function * [include/peexe.h] PE_Import_Directory: renamed reserved fields to TimeDate, Forwarder, Thunk_List * [include/winerror.h] New file. * [loader/main.c] called RELAY32_Init * [loader/pe_image.c] xmmap: map BSS anonymous dump_imports: renamed to fixup_imports, do the fixup of imported symbols PE_LoadImage: pass raw data size to xmmap * [loader/resource.c] DumpIcon: new function * [misc/kernel32.c] New file. * [misc/main.c] make stdout and stderr unbuffered * [misc/shell.c] DoEnvironmentSubst: new function * [objects/font.c] FONT_MatchFont: try oblique if there is no italic * [rc/Imakefile][rc/parser.l] yywrap: new function Don't link with libfl.a on Linux * [tools/build.c] Added keywords stdcall, subsystem, base GenerateForWin32: new function BuildSpecFiles: call GenerateForWin32 if subsystem is win32 Mon May 15 10:38:14 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> * [controls/listbox.c] [controls/combo.c] [windows/defwnd.c] Minor fixes. * [misc/message.c] [misc/main.c] [rc/sysres*.rc] [include/texts.h] Rewrote message box handling. * [windows/dialog.c] Dialogs should be invisible until after WM_INITDIALOG is seent. Don't switch to invisible dialog items on a TAB keypress. * [windows/mdi.c] Send WM_NCPAINT message in MDIRestoreChild(). * [windows/painting.c] Fixed typo (&& -> &). * [windows/message.c] [if1632/user.spec] Implemented PostAppMessage(). * [windows/event.c] SetCapture(0) should act like ReleaseCapture(). Tue May 9 11:55:52 1995 Eddie C. Dost (ecd@dressler.de) * [Imakefile] Changed CDEBUGFLAGS for systems running __ELF__ (temporarily) Added ASFLAGS to exported variables. * [debugger/readline/Imakefile] Moved defines for libreadline from DEFINES to EXTRA_DEFINES * [memory/local.c] [miscemu/int21.c] Added some more debugging outputs. Mon May 8 00:55:27 MET DST 1995 Dag Asheim (dash@ifi.uio.no) * [misc/message.c] Fixed a "FIXME" concerning norwegian translation. Sun May 7 23:25:23 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> * [*/*] Removed warnings in a couple of files and deleted some obsolete code. * [controls/listbox.c] Cleanup, speed improvements & lots of bug fixes. * [controls/combo.c] Mostly rewritten. This is still very buggy, but not quite as bad as before. * [include/commdlg.h] [misc/commdlg.c] Removed the need for sysres.dll. Small bug fixes. * [objects/oembitmap.c] [include/bitmaps/<many>] [include/windows.h] [loader/library.c] [loader/main.c] [rc/sysres*.rc] Removed sysres.dll and replaced the remaining bitmaps/icons with XPM equivalents. * [misc/message.c] [windows/nonclient.c] [misc/main.c] [if1632/winprocs.spec] "About Wine..." now brings up a standard ShellAbout() window with the Wine icon and the list of contributors. * [misc/shell.c] Fixed ShellAbout()/AboutDialogProc() to show the right icon. * [windows/event.c] Small hack for non-alphanumeric keys: Dont't send the ascii value in the WM_KEYDOWN message, but some unused code instead. Should be done properly by sending different codes for each key. The edit control used to get a VK_DELETE message each time the user typed '.'. * [windows/class.c] Removed a check for CS_GLOBALCLASS in CLASS_FindClassByName(). This used to be no problem, but breaks Resource Workshop in 950403. * [objects/dib.c] New diagnostic for a bug I've been encountering. If it shows up, please report it. Sun May 7 23:11:18 EDT 1995 William Magro (wmagro@tc.cornell.edu) * [objects/color.c] Handle situation when 'dc' exists, but palette mapping does not. (Fixes kidpix2 demo.) Sun May 7 03:32:00 1995 Charles M. Hannum (mycroft@mit.edu) * [loader/ldt.c] LDT_Print: Only show the number of entries that the kernel returned. Make this work for NetBSD. Fri May 5 02:53:26 1995 Charles M. Hannum (mycroft@mit.edu) * [debugger/dbg.y] [include/wine.h] [loader/signal.c] Modify cs and ds selector values for NetBSD-current. * [debugger/debug.l] $sp, $esp: Use RN_ESP_AT_SIGNAL rather than RN_ESP. * [debugger/regpos.h] Modify sigcontext format for NetBSD-current. SC_ESP: Use RN_ESP_AT_SIGNAL rather than RN_ESP. * [include/ldt.h] SELECTOR_TO_ENTRY: Explicitly clear the top half of the selector value, since only 16 bits of it may have been saved. * [misc/winsocket.c] Set structure packing with `#pragma pack' to accomodate other/older compilers. Tue May 2 18:15:01 1995 Paal Beyer (beyer@idt.unit.no) * [misc/commdlg.c] Fixed path-names so when changing directory the listboxes changes too. * [debugger/dbg.y debugger/debug.l wine.ini] Added SymbolTableFile to wine.ini so symbols can be read without standing in the directory containing wine.sym. Added the possibility to specify full name of wine.sym from the debugger prompt.
parent 594997c9
This is release 950430 of Wine the MS Windows emulator. This is still a
This is release 950522 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "wine-new@amscons.com". Please don't forget
to include a ChangeLog entry. I'll make a new release every other Sunday.
WHAT'S NEW with Wine-950430: (see ChangeLog for details)
- Preliminary multitasking support.
- Better DOS drives support.
- Stubs for DDEML library.
WHAT'S NEW with Wine-950522: (see ChangeLog for details)
- Preliminary Win32 support.
- Multimedia code works better.
- Better message boxes, listboxes and combos.
- SYSRES.DLL is no longer needed.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -17,10 +18,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
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-950430.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-950430.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-950430.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-950430.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-950522.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-950522.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-950522.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-950522.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sun May 21 12:30:30 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/hash.c] [debugger/info.c]
Added support for symbolic segmented addresses. Add symbols for all
built-in API entry points.
* [if1632/relay.c] [include/dlls.h]
Removed dll_table structure, as we now use the built-in module
structures.
* [if1632/relay.c] [loader/main.c]
Removed winestat option, as it was no longer very meaningful.
* [include/stackframe.h]
New macro MAKE_SEGPTR that creates a segmented pointer to a local
variable on the 32-bit stack.
* [loader/module.c]
Added support for multiple instances of an application.
Implemented LoadModule() and FreeModule().
* [loader/ne_image.c] [loader/task.c]
Moved initialisation of built-in DLLs to InitTask().
* [memory/global.c]
Implemented discardable blocks.
* [misc/file.c]
Search path of current executable in OpenFile().
Fixed bug with searching in Windows path.
* [misc/lstr.c]
Hard-coded translation tables for Ansi<->Oem.
* [misc/user.c]
Moved some global initializations to InitApp(), because they need
a task context to be performed.
* [objects/dc.c]
Handle R2_BLACK and R2_WHITE specially so that they work correctly
with palette displays.
* [tools/build.c]
Suppressed generation of the C file for DLL specs, because it's no
longer needed. Output all the assembly code directly to stdout.
Some changes to integrate Win32 support from Martin von Loewis.
* [windows/msgbox.c]
Moved message box code from misc/ to windows/.
Mon May 15 23:40:04 1995 Martin Ayotte (wine@trgcorp.mksinfo.qc.ca)
* [misc/audio.c] [misc/mcicda.c] [misc/mcianim.c] [misc/midi.c]
[misc/mmaux.c] [misc/mmsystem.c]
Modify code & use pointers conversion macros.
Make cdaudio & wave devices work again (only using some applets).
* [misc/profile.c]
Change getc() to fgetc() where needed.
Mon May 15 22:10:56 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/Imakefile]
added entries for the new files gdi32.spec, kernel32.spec,
user32.spec, shell32.spec and winprocs32.spec.
* [if1632/commdlg.spec][if1632/kernel.spec][if1632/shell.spec]
[if1632/storage.spec][if1632/system.spec][if1632/user.spec]
ChooseFont, RESERVED5, InternalExtractIcon: Marked as stubs
ExtractAssociatedIcon, DoEnvironmentSubst, DumpIcon:
stub implementations provided
marked storage.dll,storege.sys functions as stubs
* [include/pe_image.h]
Added structures WIN32_builtin and WIN32_function
* [include/peexe.h]
PE_Import_Directory: renamed reserved fields to
TimeDate, Forwarder, Thunk_List
* [include/winerror.h]
New file.
* [loader/main.c]
called RELAY32_Init
* [loader/pe_image.c]
xmmap: map BSS anonymous
dump_imports: renamed to fixup_imports, do the fixup of imported
symbols
PE_LoadImage: pass raw data size to xmmap
* [loader/resource.c]
DumpIcon: new function
* [misc/kernel32.c]
New file.
* [misc/main.c]
make stdout and stderr unbuffered
* [misc/shell.c]
DoEnvironmentSubst: new function
* [objects/font.c]
FONT_MatchFont: try oblique if there is no italic
* [rc/Imakefile][rc/parser.l]
yywrap: new function
Don't link with libfl.a on Linux
* [tools/build.c]
Added keywords stdcall, subsystem, base
GenerateForWin32: new function
BuildSpecFiles: call GenerateForWin32 if subsystem is win32
Mon May 15 10:38:14 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c] [controls/combo.c] [windows/defwnd.c]
Minor fixes.
* [misc/message.c] [misc/main.c] [rc/sysres*.rc] [include/texts.h]
Rewrote message box handling.
* [windows/dialog.c]
Dialogs should be invisible until after WM_INITDIALOG is seent.
Don't switch to invisible dialog items on a TAB keypress.
* [windows/mdi.c]
Send WM_NCPAINT message in MDIRestoreChild().
* [windows/painting.c]
Fixed typo (&& -> &).
* [windows/message.c] [if1632/user.spec]
Implemented PostAppMessage().
* [windows/event.c]
SetCapture(0) should act like ReleaseCapture().
Tue May 9 11:55:52 1995 Eddie C. Dost (ecd@dressler.de)
* [Imakefile]
Changed CDEBUGFLAGS for systems running __ELF__ (temporarily)
Added ASFLAGS to exported variables.
* [debugger/readline/Imakefile]
Moved defines for libreadline from DEFINES to EXTRA_DEFINES
* [memory/local.c] [miscemu/int21.c]
Added some more debugging outputs.
Mon May 8 00:55:27 MET DST 1995 Dag Asheim (dash@ifi.uio.no)
* [misc/message.c]
Fixed a "FIXME" concerning norwegian translation.
Sun May 7 23:25:23 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [*/*]
Removed warnings in a couple of files and deleted some obsolete code.
* [controls/listbox.c]
Cleanup, speed improvements & lots of bug fixes.
* [controls/combo.c]
Mostly rewritten. This is still very buggy, but not quite as bad as
before.
* [include/commdlg.h] [misc/commdlg.c]
Removed the need for sysres.dll. Small bug fixes.
* [objects/oembitmap.c] [include/bitmaps/<many>] [include/windows.h]
[loader/library.c] [loader/main.c] [rc/sysres*.rc]
Removed sysres.dll and replaced the remaining bitmaps/icons with
XPM equivalents.
* [misc/message.c] [windows/nonclient.c] [misc/main.c]
[if1632/winprocs.spec]
"About Wine..." now brings up a standard ShellAbout() window with
the Wine icon and the list of contributors.
* [misc/shell.c]
Fixed ShellAbout()/AboutDialogProc() to show the right icon.
* [windows/event.c]
Small hack for non-alphanumeric keys: Dont't send the ascii value in
the WM_KEYDOWN message, but some unused code instead. Should be done
properly by sending different codes for each key. The edit control
used to get a VK_DELETE message each time the user typed '.'.
* [windows/class.c]
Removed a check for CS_GLOBALCLASS in CLASS_FindClassByName().
This used to be no problem, but breaks Resource Workshop in 950403.
* [objects/dib.c]
New diagnostic for a bug I've been encountering. If it shows up,
please report it.
Sun May 7 23:11:18 EDT 1995 William Magro (wmagro@tc.cornell.edu)
* [objects/color.c]
Handle situation when 'dc' exists, but palette mapping
does not. (Fixes kidpix2 demo.)
Sun May 7 03:32:00 1995 Charles M. Hannum (mycroft@mit.edu)
* [loader/ldt.c]
LDT_Print: Only show the number of entries that the kernel
returned. Make this work for NetBSD.
Fri May 5 02:53:26 1995 Charles M. Hannum (mycroft@mit.edu)
* [debugger/dbg.y] [include/wine.h] [loader/signal.c]
Modify cs and ds selector values for NetBSD-current.
* [debugger/debug.l]
$sp, $esp: Use RN_ESP_AT_SIGNAL rather than RN_ESP.
* [debugger/regpos.h]
Modify sigcontext format for NetBSD-current.
SC_ESP: Use RN_ESP_AT_SIGNAL rather than RN_ESP.
* [include/ldt.h]
SELECTOR_TO_ENTRY: Explicitly clear the top half of the selector
value, since only 16 bits of it may have been saved.
* [misc/winsocket.c]
Set structure packing with `#pragma pack' to accomodate
other/older compilers.
Tue May 2 18:15:01 1995 Paal Beyer (beyer@idt.unit.no)
* [misc/commdlg.c]
Fixed path-names so when changing directory the listboxes
changes too.
* [debugger/dbg.y debugger/debug.l wine.ini]
Added SymbolTableFile to wine.ini so symbols can be read
without standing in the directory containing wine.sym.
Added the possibility to specify full name of wine.sym from
the debugger prompt.
----------------------------------------------------------------------
Sat Apr 29 20:42:01 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [controls/static.c]
......
......@@ -6,9 +6,11 @@ MAKE = gmake
CC = gcc -D__FreeBSD__
#endif
DEFINES = AutoDefines -DUSE_READLINE -DWINESTAT
DEFINES = AutoDefines -DUSE_READLINE
#ifdef __ELF__
CDEBUGFLAGS = -O2 -Wall -static
LD = /usr/i486-linuxaout/bin/ld -m i386linux
CDEBUGFLAGS = -O2 -Wall -b i486-linuxaout
ASFLAGS = -b i486-linuxaout
#else
CDEBUGFLAGS = -O2 -Wall
#endif
......@@ -26,7 +28,7 @@ CDEBUGFLAGS = -O2 -Wall
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'MAKE=$(MAKE)'\
'DEFINES=$(DEFINES)' 'LD=$(LD)'
'DEFINES=$(DEFINES)' 'LD=$(LD)' 'ASFLAGS=$(ASFLAGS)'
COMMONSUBDIRS = \
controls \
......
......@@ -82,10 +82,11 @@ default: c:\windows;c:\windows\system
Used to specify the path which will be used to find executables and DLL's.
format: systemresources = <filename>
default: c:\temp
format: symboltablefile = <filename>
default: wine.sym
Used to specify the name of sysres.dll, a dll which is used by Wine itself.
Used to specify the path and file name of the symbol table used by the
built-in debugger.
* [serialports]
......
In this directory you might find my implemantation of the Windows
String. The patch lstr.patch includes whats needed for the following
functions:
lstrcat,lstrcmp,lstrcmpi,lstrcpy,lstrcpyn,lstrlen,AnsiUpper,AnsiLower,
IsCharAlpha,IsCharAlphanumeric,IsCharUpper,IsCharLower,AnsiUpperBuff,
AnsiLowerBuff,AnsiNext,AnsiPrev. Simply apply the patch to Wine.0.4.1
and remake.
Also there should be the files oem2ansi.trl and ansi2oem.trl that
define how to translate between ansi and oem codepage 861 I believe
they call it. These files where created by the Windows program
oemansi.exe which is also included. To get the oem<->ansi translations
right for your part of the world just run oemansi under Windows not
Wine and oemansi will create oem2ansi and ansi2oem for your locale
that is if your Windows/Dos is set up correctly. Move the .trl files
into the directory from where you run wine. If Wine does not find the
*.trl in the current directory AnsiToOem and OemToAnsi will be
passive.
Shortcomings/Bugs:
Some functions depend upon libc functions like toupper, tolower and
isalpha that, as far as I know, are totally without support for NLS
and ISO 8859-1. Default Ansi<->OEM translations when *.trl files are
not found are missing.
NOTE: Please don't run oemansi.exe under wine.
......@@ -3,19 +3,15 @@
* Copyright (C) 1993 Johannes Ruscheinski
* Copyright (C) 1993 David Metcalfe
* Copyright (C) 1994 Alexandre Julliard
static char Copyright1[] = "Copyright Johannes Ruscheinski, 1993";
static char Copyright2[] = "Copyright David Metcalfe, 1993";
static char Copyright3[] = "Copyright Alexandre Julliard, 1994";
*/
*/
#include "win.h"
#include "user.h"
#include "syscolor.h"
#include "graphics.h"
#include "button.h"
#include "stddebug.h"
#include "debug.h"
#include "stackframe.h"
extern void DEFWND_SetText( HWND hwnd, LPSTR text ); /* windows/defwnd.c */
static void PB_Paint( HWND hWnd, HDC hDC, WORD action );
......@@ -477,26 +473,20 @@ static void UB_Paint( HWND hWnd, HDC hDC, WORD action )
static void OB_Paint( HWND hWnd, HDC hDC, WORD action )
{
HANDLE hDis;
LPDRAWITEMSTRUCT lpdis;
DRAWITEMSTRUCT dis;
WND *wndPtr = WIN_FindWndPtr( hWnd );
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
if (!(hDis = USER_HEAP_ALLOC( sizeof(DRAWITEMSTRUCT) ))) return;
lpdis = (LPDRAWITEMSTRUCT)USER_HEAP_LIN_ADDR(hDis);
lpdis->CtlType = ODT_BUTTON;
lpdis->CtlID = wndPtr->wIDmenu;
lpdis->itemID = 0;
lpdis->itemAction = action;
lpdis->itemState = (infoPtr->state & BUTTON_HASFOCUS) ? ODS_FOCUS : 0 |
dis.CtlType = ODT_BUTTON;
dis.CtlID = wndPtr->wIDmenu;
dis.itemID = 0;
dis.itemAction = action;
dis.itemState = (infoPtr->state & BUTTON_HASFOCUS) ? ODS_FOCUS : 0 |
(infoPtr->state & BUTTON_HIGHLIGHTED) ? ODS_SELECTED : 0 |
(wndPtr->dwStyle & WS_DISABLED) ? ODS_DISABLED : 0;
lpdis->hwndItem = hWnd;
lpdis->hDC = hDC;
GetClientRect( hWnd, &lpdis->rcItem );
lpdis->itemData = 0;
SendMessage(GetParent(hWnd), WM_DRAWITEM, 1, USER_HEAP_SEG_ADDR(hDis) );
USER_HEAP_FREE(hDis);
dis.hwndItem = hWnd;
dis.hDC = hDC;
GetClientRect( hWnd, &dis.rcItem );
dis.itemData = 0;
SendMessage(GetParent(hWnd), WM_DRAWITEM, 1, MAKE_SEGPTR(&dis) );
}
......@@ -114,31 +114,6 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
/***********************************************************************
* DESKTOP_Init
*
* Initialize the desktop window private information.
*/
BOOL DESKTOP_Init()
{
HWND hwnd = GetDesktopWindow();
WND *wndPtr = WIN_FindWndPtr( hwnd );
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
infoPtr->hbrushPattern = 0;
infoPtr->hbitmapWallPaper = 0;
SetDeskPattern();
SetDeskWallPaper( (LPSTR)-1 );
if (rootWindow != DefaultRootWindow(display))
{
HDC hdc = GetDC( hwnd );
DESKTOP_DoEraseBkgnd( hwnd, hdc, infoPtr );
ReleaseDC( hwnd, hdc );
}
return TRUE;
}
/***********************************************************************
* DesktopWndProc
*
* Window procedure for the desktop window.
......
......@@ -21,7 +21,6 @@
#include "menu.h"
#include "user.h"
#include "win.h"
#include "library.h"
#include "message.h"
#include "graphics.h"
#include "stddebug.h"
......@@ -667,7 +666,7 @@ static BOOL MENU_ShowPopup(HWND hwndOwner, HMENU hmenu, WORD id, int x, int y)
menu->FocusedItem = NO_SELECTED_ITEM;
}
SendMessage( hwndOwner, WM_INITMENUPOPUP, hmenu,
MAKELONG( id, (menu->wFlags & MF_POPUP) ? 1 : 0 ));
MAKELONG( id, (menu->wFlags & MF_SYSMENU) ? 1 : 0 ));
MENU_PopupMenuCalcSize( menu, hwndOwner );
if (!menu->hWnd)
{
......@@ -740,7 +739,7 @@ static void MENU_SelectItem( HMENU hmenu, WORD wIndex )
!(lppop->wFlags & MF_POPUP) );
dprintf_menu(stddeb,"Sending WM_MENUSELECT %04x %04x\n", items[lppop->FocusedItem].item_id,items[lppop->FocusedItem].item_flags);
SendMessage(lppop->hWnd, WM_MENUSELECT, items[lppop->FocusedItem].item_id,
MAKELONG( hmenu, items[lppop->FocusedItem].item_flags));
MAKELONG( items[lppop->FocusedItem].item_flags | MF_MOUSESELECT, hmenu));
}
}
ReleaseDC( lppop->hWnd, hdc );
......
......@@ -2,9 +2,7 @@
* Windows widgets (built-in window classes)
*
* Copyright 1993 Alexandre Julliard
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
*/
#include "win.h"
#include "button.h"
......@@ -15,6 +13,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "gdi.h"
#include "user.h"
#include "selectors.h"
#include "stackframe.h"
static WNDCLASS WIDGETS_BuiltinClasses[] =
......@@ -27,8 +26,10 @@ static WNDCLASS WIDGETS_BuiltinClasses[] =
sizeof(SCROLLINFO), 0, 0, 0, 0, NULL, "SCROLLBAR" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ListBoxWndProc", 0,
8, 0, 0, 0, 0, NULL, "LISTBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ComboBoxWndProc", 0,
{ CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ComboBoxWndProc", 0,
8, 0, 0, 0, 0, NULL, "COMBOBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ComboLBoxWndProc", 0,
8, 0, 0, 0, 0, NULL, "COMBOLBOX" },
{ CS_GLOBALCLASS, (WNDPROC)"EditWndProc", 0,
sizeof(WORD), 0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0,
......@@ -53,20 +54,16 @@ static WNDCLASS WIDGETS_BuiltinClasses[] =
BOOL WIDGETS_Init(void)
{
int i;
HANDLE hName;
char *name;
char name[20];
WNDCLASS *class = WIDGETS_BuiltinClasses;
if (!(hName = USER_HEAP_ALLOC( 20 ))) return FALSE;
name = USER_HEAP_LIN_ADDR( hName );
for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
{
strcpy( name, class->lpszClassName );
class->lpszClassName = (LPSTR)USER_HEAP_SEG_ADDR( hName );
class->lpszClassName = (LPSTR)MAKE_SEGPTR(name);
class->hCursor = LoadCursor( 0, IDC_ARROW );
class->lpfnWndProc = GetWndProcEntry16( (char *)class->lpfnWndProc );
if (!RegisterClass( class )) return FALSE;
}
USER_HEAP_FREE( hName );
return TRUE;
}
......@@ -74,6 +74,8 @@
#include "db_disasm.h"
#include "ldt.h"
extern void print_address(unsigned int addr, FILE * outfile, int addrlen);
/*
* Switch to disassemble 16-bit code.
*/
......@@ -1016,7 +1018,6 @@ db_read_address(loc, short_addr, regmodrm, addrp)
static void db_task_printsym(unsigned int addr, int size)
{
extern void print_address(unsigned int addr, FILE * outfile, int addrlen);
switch(size)
{
case BYTE:
......@@ -1486,7 +1487,10 @@ db_disasm(loc, altfmt, flag16)
get_value_inc(imm, loc, 4, FALSE); /* offset */
}
get_value_inc(imm2, loc, 2, FALSE); /* segment */
fprintf(stderr,"$%d,%d", imm2, imm);
if (short_addr)
print_address( (imm2 << 16) | imm, stderr, 16 );
else
fprintf(stderr,"$0x%x,0x%08x", imm2, imm);
break;
}
}
......
......@@ -11,6 +11,8 @@
#include <stdio.h>
#include <signal.h>
#include "ldt.h"
#include "windows.h"
#include "wine.h"
#define YYSTYPE int
......@@ -41,6 +43,7 @@ void mode_command(int);
%token SET
%token MODE
%token PRINT
%token FILE_IDENTIFIER
%token IDENTIFIER
%token NO_SYMBOL
%token SYMBOLFILE
......@@ -61,8 +64,8 @@ void mode_command(int);
| CONT '\n' { return 0; }
| 'c' '\n' { return 0; }
| ABORT '\n' { kill(getpid(), SIGABRT); }
| SYMBOLFILE IDENTIFIER '\n' { read_symboltable($2); }
| DEFINE IDENTIFIER expr '\n' { add_hash($2, $3); }
| SYMBOLFILE FILE_IDENTIFIER '\n' { read_symboltable($2); }
| DEFINE IDENTIFIER expr '\n' { add_hash($2, 0, $3); }
| MODE NUM { mode_command($2); }
| ENABLE NUM { enable_break($2); }
| DISABLE NUM { disable_break($2); }
......@@ -151,6 +154,7 @@ void
wine_debug(int signal, int * regs)
{
static int dummy_regs[32];
char SymbolTableFile[256];
#ifdef YYDEBUG
yydebug = 0;
#endif
......@@ -158,34 +162,23 @@ wine_debug(int signal, int * regs)
yyin = stdin;
regval = regs ? regs : dummy_regs;
#ifdef linux
if((SC_CS & 7) != 7) {
if (SC_CS == WINE_CODE_SELECTOR)
{
dbg_mask = 0xffffffff;
dbg_mode = 32;
} else {
} else
{
dbg_mask = 0xffff;
dbg_mode = 16;
}
#endif
#ifdef __NetBSD__
if(SC_CS == 0x1f) {
dbg_mask = 0xffffffff;
dbg_mode = 32;
} else {
dbg_mask = 0xffff;
dbg_mode = 16;
}
#endif
fprintf(stderr,"In %d bit mode.\n", dbg_mode);
/* This is intended to read the entry points from the Windows image, and
insert them in the hash table. It does not work yet, so it is commented out. */
if(dbg_mode == 32 && !loaded_symbols){
if(dbg_mode == 32 && !loaded_symbols)
{
loaded_symbols++;
read_symboltable("wine.sym");
#if 0
load_entrypoints();
#endif
GetPrivateProfileString("wine", "SymbolTableFile", "wine.sym",
SymbolTableFile, sizeof(SymbolTableFile), WINE_INI);
read_symboltable(SymbolTableFile);
}
/* Remove the breakpoints from memory... */
......
......@@ -29,6 +29,7 @@ DIGIT [0-9]
HEXDIGIT [0-9a-fA-F]
IDENTIFIER [_a-zA-Z\.~][_a-zA-Z0-9\.~]*
FILE_IDENTIFIER [_a-zA-Z\.~/][_a-zA-Z\.~/]*
%%
......@@ -61,9 +62,9 @@ IDENTIFIER [_a-zA-Z\.~][_a-zA-Z0-9\.~]*
}
$pc { yylval = RN_EIP; return REG;}
$sp { yylval = RN_ESP; return REG;}
$sp { yylval = RN_ESP_AT_SIGNAL; return REG;}
$eip { yylval = RN_EIP; return REG;}
$esp { yylval = RN_ESP; return REG;}
$esp { yylval = RN_ESP_AT_SIGNAL; return REG;}
$ebp { yylval = RN_EBP; return REG;}
$eax { yylval = RN_EAX; return REG;}
$ebx { yylval = RN_EBX; return REG;}
......@@ -119,6 +120,10 @@ q { return 'q'; }
return IDENTIFIER;
}
{FILE_IDENTIFIER} {yylval = (int) make_symbol(yytext);
return FILE_IDENTIFIER;
}
[ \t]+ /* Eat up whitespace */
. { if(syntax_error == 0) {
......@@ -203,7 +208,7 @@ static char *local_symbols[10];
static int next_symbol;
char * make_symbol(char * symbol){
return local_symbols[next_symbol++] = strdup(symbol);
return local_symbols[next_symbol++] = strdup(symbol);
}
void
......
......@@ -10,12 +10,13 @@
#include <string.h>
#include <sys/types.h>
#include <neexe.h>
#include "module.h"
#include "selectors.h"
#include <wine.h>
#include <dlls.h>
#include "wine.h"
struct name_hash{
struct name_hash * next;
unsigned short segment;
unsigned int * address;
char * name;
};
......@@ -36,11 +37,13 @@ static unsigned int name_hash(const char * name){
}
void add_hash(char * name, unsigned int * address){
void add_hash(char * name, unsigned short segment, unsigned int * address)
{
struct name_hash * new;
int hash;
new = (struct name_hash *) malloc(sizeof(struct name_hash));
new->segment = segment;
new->address = address;
new->name = strdup(name);
new->next = NULL;
......@@ -51,7 +54,8 @@ void add_hash(char * name, unsigned int * address){
name_hash_table[hash] = new;
}
unsigned int * find_hash(char * name){
unsigned int * find_hash(char * name)
{
char buffer[256];
struct name_hash * nh;
......@@ -72,7 +76,8 @@ unsigned int * find_hash(char * name){
static char name_buffer[256];
char * find_nearest_symbol(unsigned int * address){
char * find_nearest_symbol(unsigned int segment, unsigned int * address)
{
struct name_hash * nearest;
struct name_hash start;
struct name_hash * nh;
......@@ -83,8 +88,9 @@ char * find_nearest_symbol(unsigned int * address){
for(i=0; i<NR_NAME_HASH; i++) {
for(nh = name_hash_table[i]; nh; nh = nh->next)
if(nh->address <= address && nh->address > nearest->address)
nearest = nh;
if (nh->segment == segment &&
nh->address <= address &&
nh->address > nearest->address) nearest = nh;
};
if((unsigned int) nearest->address == 0) return NULL;
......@@ -136,7 +142,7 @@ read_symboltable(char * filename){
};
nargs = sscanf(buffer, "%x %c %s", &addr, &type, name);
add_hash(name, (unsigned int *) addr);
add_hash(name, 0, (unsigned int *) addr);
};
fclose(symbolfile);
}
......@@ -147,33 +153,40 @@ read_symboltable(char * filename){
* tables correctly
*/
void
load_entrypoints(){
char buffer[256];
char * cpnt;
int j, ordinal, len;
unsigned int address;
#if 0
struct w_files * wpnt;
for(wpnt = wine_files; wpnt; wpnt = wpnt->next){
cpnt = wpnt->ne->nrname_table;
while(1==1){
if( ((int) cpnt) - ((int)wpnt->ne->nrname_table) >
wpnt->ne->ne_header->nrname_tab_length) break;
len = *cpnt++;
strncpy(buffer, cpnt, len);
buffer[len] = 0;
ordinal = *((unsigned short *) (cpnt + len));
j = GetEntryPointFromOrdinal(wpnt, ordinal);
address = j & 0xffff;
j = j >> 16;
address |= wpnt->ne->selector_table[j] << 16;
fprintf(stderr,"%s -> %x\n", buffer, address);
add_hash(buffer, (unsigned int *) address);
cpnt += len + 2;
};
};
return;
#endif
void load_entrypoints( HMODULE hModule )
{
char buffer[256];
unsigned char *cpnt, *name;
NE_MODULE *pModule;
unsigned int address;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return;
name = (unsigned char *)pModule + pModule->name_table;
/* First search the resident names */
cpnt = (unsigned char *)pModule + pModule->name_table;
while (*cpnt)
{
cpnt += *cpnt + 1 + sizeof(WORD);
sprintf( buffer, "%*.*s.%*.*s", *name, *name, name + 1,
*cpnt, *cpnt, cpnt + 1 );
address = MODULE_GetEntryPoint( hModule, *(WORD *)(cpnt + *cpnt + 1) );
if (address)
add_hash(buffer, address >> 16, (unsigned int*)(address & 0xffff));
}
/* Now search the non-resident names table */
if (!pModule->nrname_handle) return; /* No non-resident table */
cpnt = (char *)GlobalLock( pModule->nrname_handle );
while (*cpnt)
{
cpnt += *cpnt + 1 + sizeof(WORD);
sprintf( buffer, "%*.*s.%*.*s", *name, *name, name + 1,
*cpnt, *cpnt, cpnt + 1 );
address = MODULE_GetEntryPoint( hModule, *(WORD *)(cpnt + *cpnt + 1) );
if (address)
add_hash(buffer, address >> 16, (unsigned int*)(address & 0xffff));
}
}
......@@ -21,15 +21,22 @@ void application_not_running()
void print_address(unsigned int addr, FILE * outfile, int addrlen)
{
extern char * find_nearest_symbol(unsigned short, unsigned int *);
char *name;
if (addrlen == 16)
{
fprintf( outfile, "%4.4x:%4.4x", addr >> 16, addr & 0xffff );
name = find_nearest_symbol( addr >> 16,
(unsigned int *)(addr & 0xffff) );
if (name)
fprintf( outfile, "0x%4.4x:0x%4.4x (%s)",
addr >> 16, addr & 0xffff, name );
else
fprintf( outfile, "0x%4.4x:0x%4.4x", addr >> 16, addr & 0xffff );
}
else
{
extern char * find_nearest_symbol(unsigned int *);
char * name = find_nearest_symbol((unsigned int *) addr);
name = find_nearest_symbol(0, (unsigned int *) addr);
if(name)
fprintf(outfile,"0x%8.8x(%s)", addr, name);
else
......
......@@ -4,7 +4,7 @@ MODULE = readline
YACC = yacc -b dbg -d
DEFINES = -DANSI_ARROWS -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX
EXTRA_DEFINES= -DANSI_ARROWS -DHAVE_TCGETATTR -DHIDE -DUSE_DIRENT -DSYS_UNIX
SRCS = \
complete.c \
......
......@@ -25,7 +25,28 @@
#define RN_CR2 21
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
#ifdef __NetBSD__
/* Register numbers */
#define RN_GS 0
#define RN_FS 1
#define RN_ES 2
#define RN_DS 3
#define RN_EDI 4
#define RN_ESI 5
#define RN_EBP 6
#define RN_EBX 7
#define RN_EDX 8
#define RN_ECX 9
#define RN_EAX 10
#define RN_EIP 11
#define RN_CS 12
#define RN_EFLAGS 13
#define RN_ESP_AT_SIGNAL 14
#define RN_SS 15
#define RN_OLDMASK 17
#endif
#ifdef __FreeBSD__
#define RN_OLDMASK 1
/* Register numbers */
#define RN_ESP 2
......@@ -43,7 +64,7 @@
#define RN_EDX 14
#define RN_ECX 15
#define RN_EAX 16
/* NetBSD doesn't context switch gs or fs */
/* FreeBSD doesn't save gs or fs */
#define SC_GS 0x27
#define SC_FS 0x27
#endif
......@@ -54,12 +75,15 @@
#define I387 regval[RN_I387]
#define CR2 regval[RN_CR2]
#endif
#ifdef __NetBSD__
#define SC_GS regval[RN_GS]
#define SC_FS regval[RN_FS]
#endif
#define SC_ES regval[RN_ES]
#define SC_DS regval[RN_DS]
#define SC_EDI(dbg_mask) (regval[RN_EDI] & dbg_mask)
#define SC_ESI(dbg_mask) (regval[RN_ESI] & dbg_mask)
#define SC_EBP(dbg_mask) (regval[RN_EBP] & dbg_mask)
#define SC_ESP(dbg_mask) (regval[RN_ESP] & dbg_mask)
#define SC_EBX(dbg_mask) (regval[RN_EBX] & dbg_mask)
#define SC_EDX(dbg_mask) (regval[RN_EDX] & dbg_mask)
#define SC_ECX(dbg_mask) (regval[RN_ECX] & dbg_mask)
......@@ -77,6 +101,6 @@
#define SC_EIP(dbg_mask) (regval[RN_EIP] & dbg_mask)
#define SC_CS regval[RN_CS]
#define SC_EFLAGS regval[RN_EFLAGS]
#define ESP_AT_SIGNAL regval[RN_ESP_AT_SIGNAL]
#define SC_ESP(dbg_mask) (regval[RN_ESP_AT_SIGNAL] & dbg_mask)
#define SC_SS regval[RN_SS]
#define OLDMASK regval[RN_OLDMASK]
......@@ -5,87 +5,105 @@ MODULE = if1632
SRCS = \
callback.c \
relay.c
relay.c \
relay32.c
#ifdef WINELIB
CALLOBJS =
DLLS =
DLLS16 =
DLLS32 =
#else
CALLOBJS = \
call16.o \
call32.o
DLLS = \
commdlg \
compobj \
ddeml \
gdi \
kernel \
keyboard \
mmsystem \
mouse \
ole2 \
ole2conv \
ole2disp \
ole2nls \
ole2prox \
olecli \
olesvr \
shell \
sound \
storage \
stress \
system \
toolhelp \
user \
win87em \
winprocs \
winsock
DLLS16 = \
commdlg.spec \
compobj.spec \
ddeml.spec \
gdi.spec \
kernel.spec \
keyboard.spec \
mmsystem.spec \
mouse.spec \
ole2.spec \
ole2conv.spec \
ole2disp.spec \
ole2nls.spec \
ole2prox.spec \
olecli.spec \
olesvr.spec \
shell.spec \
sound.spec \
storage.spec \
stress.spec \
system.spec \
toolhelp.spec \
user.spec \
win87em.spec \
winprocs.spec \
winsock.spec
DLLS32 = \
gdi32.spec \
kernel32.spec \
shell32.spec \
user32.spec \
winprocs32.spec
#endif
OBJS = $(SRCS:.c=.o) $(CALLOBJS) $(DLLS:%=dll_%.o) $(DLLS:%=tab_%.o)
OBJS = $(SRCS:.c=.o) $(CALLOBJS) $(DLLS16:.spec=.o) $(DLLS32:.spec=.o)
BUILD = $(TOP)/tools/build
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(tab_,name.c): name.spec $(BUILD) @@\
$(BUILD) -spec name.spec @@\
#define MakeDll16FromSpec(name) @@\
name.S : name.spec $(BUILD) @@\
$(BUILD) -spec16 name.spec > name.S @@\
#define MakeDll32FromSpec(name) @@\
name.c : name.spec $(BUILD) @@\
$(BUILD) -spec32 name.spec > name.c @@\
/*
* If you add a new spec file, copy one of these lines
*/
MakeDllFromSpec(commdlg)
MakeDllFromSpec(compobj)
MakeDllFromSpec(ddeml)
MakeDllFromSpec(gdi)
MakeDllFromSpec(kernel)
MakeDllFromSpec(keyboard)
MakeDllFromSpec(shell)
MakeDllFromSpec(mmsystem)
MakeDllFromSpec(mouse)
MakeDllFromSpec(ole2)
MakeDllFromSpec(ole2conv)
MakeDllFromSpec(ole2disp)
MakeDllFromSpec(ole2nls)
MakeDllFromSpec(ole2prox)
MakeDllFromSpec(olecli)
MakeDllFromSpec(olesvr)
MakeDllFromSpec(sound)
MakeDllFromSpec(storage)
MakeDllFromSpec(stress)
MakeDllFromSpec(system)
MakeDllFromSpec(toolhelp)
MakeDllFromSpec(user)
MakeDllFromSpec(win87em)
MakeDllFromSpec(winprocs)
MakeDllFromSpec(winsock)
MakeDll16FromSpec(commdlg)
MakeDll16FromSpec(compobj)
MakeDll16FromSpec(ddeml)
MakeDll16FromSpec(gdi)
MakeDll16FromSpec(kernel)
MakeDll16FromSpec(keyboard)
MakeDll16FromSpec(shell)
MakeDll16FromSpec(mmsystem)
MakeDll16FromSpec(mouse)
MakeDll16FromSpec(ole2)
MakeDll16FromSpec(ole2conv)
MakeDll16FromSpec(ole2disp)
MakeDll16FromSpec(ole2nls)
MakeDll16FromSpec(ole2prox)
MakeDll16FromSpec(olecli)
MakeDll16FromSpec(olesvr)
MakeDll16FromSpec(sound)
MakeDll16FromSpec(storage)
MakeDll16FromSpec(stress)
MakeDll16FromSpec(system)
MakeDll16FromSpec(toolhelp)
MakeDll16FromSpec(user)
MakeDll16FromSpec(win87em)
MakeDll16FromSpec(winprocs)
MakeDll16FromSpec(winsock)
MakeDll32FromSpec(gdi32)
MakeDll32FromSpec(kernel32)
MakeDll32FromSpec(shell32)
MakeDll32FromSpec(user32)
MakeDll32FromSpec(winprocs32)
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
#ifndef WINELIB
call32.S: $(BUILD) $(DLLS:%=dll_%.S)
$(BUILD) -call32 `cat $(DLLS:%=dll_%.S) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S
call32.S: $(BUILD) $(DLLS16:.spec=.S)
$(BUILD) -call32 `cat $(DLLS16:.spec=.S) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S
call16.S: $(BUILD) $(TOP)/include/callback.h
$(BUILD) -call16 `cat $(TOP)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > call16.S
......@@ -97,4 +115,4 @@ includes::
install::
clean::
$(RM) dll_* tab_* call32.S call16.S
$(RM) $(DLLS16:.spec=.S) $(DLLS32:.spec=.c) call32.S call16.S
......@@ -12,7 +12,7 @@ id 14
12 pascal REPLACETEXT(ptr) ReplaceText
13 pascal FINDTEXTDLGPROC(word word word long) FindTextDlgProc
14 pascal REPLACETEXTDLGPROC(word word word long) ReplaceTextDlgProc
# 15 pascal CHOOSEFONT exported, shared data
15 stub ChooseFont
# 16 pascal FORMATCHARDLGPROC exported, shared data
# 18 pascal FONTSTYLEENUMPROC exported, shared data
# 19 pascal FONTFAMILYENUMPROC exported, shared data
......
......@@ -234,6 +234,7 @@ id 3
368 stub ResizePalette
370 pascal16 GetNearestPaletteIndex(word long) GetNearestPaletteIndex
372 pascal16 ExtFloodFill(word s_word s_word long word) ExtFloodFill
374 pascal16 GetSystemPaletteUse(word) GetSystemPaletteUse
375 pascal16 GetSystemPaletteEntries(word word word ptr)
GetSystemPaletteEntries
376 stub ResetDC
......@@ -252,7 +253,8 @@ id 3
410 stub ISVALIDMETAFILE
411 pascal16 GetCurLogFont(word) GetCurLogFont
412 stub IsDCCurrentPalette
439 stub StretchDIBits
439 pascal16 StretchDIBits (word s_word s_word word word word word
word word ptr ptr word long) StretchDIBits
440 pascal16 SetDIBits(word word word word ptr ptr word) SetDIBits
441 pascal16 GetDIBits(word word word word ptr ptr word) GetDIBits
442 pascal16 CreateDIBitmap(word ptr long ptr ptr word) CreateDIBitmap
......
name gdi32
base 1
0000 stub AbortDoc
0001 stub AbortPath
0002 stub AddFontResourceA
0003 stub AddFontResourceTracking
0004 stub AddFontResourceW
0005 stub AngleArc
0006 stub AnimatePalette
0007 stub Arc
0008 stub ArcTo
0009 stub BeginPath
0010 stub BitBlt
0011 stub CancelDC
0012 stub CheckColorsInGamut
0013 stub ChoosePixelFormat
0014 stub Chord
0015 stub CloseEnhMetaFile
0016 stub CloseFigure
0017 stub CloseMetaFile
0018 stub ColorMatchToTarget
0019 stub CombineRgn
0020 stub CombineTransform
0021 stub CopyEnhMetaFileA
0022 stub CopyEnhMetaFileW
0023 stub CopyMetaFileA
0024 stub CopyMetaFileW
0025 stub CreateBitmap
0026 stub CreateBitmapIndirect
0027 stub CreateBrushIndirect
0028 stub CreateColorSpaceA
0029 stub CreateColorSpaceW
0030 stub CreateCompatibleBitmap
0031 stub CreateCompatibleDC
0032 stub CreateDCA
0033 stub CreateDCW
0034 stub CreateDIBPatternBrush
0035 stub CreateDIBPatternBrushPt
0036 stub CreateDIBSection
0037 stub CreateDIBitmap
0038 stub CreateDiscardableBitmap
0039 stub CreateEllipticRgn
0040 stub CreateEllipticRgnIndirect
0041 stub CreateEnhMetaFileA
0042 stub CreateEnhMetaFileW
0043 stub CreateFontA
0044 stub CreateFontIndirectA
0045 stub CreateFontIndirectW
0046 stub CreateFontW
0047 stub CreateHalftonePalette
0048 stub CreateHatchBrush
0049 stub CreateICA
0050 stub CreateICW
0051 stub CreateMetaFileA
0052 stub CreateMetaFileW
0053 stub CreatePalette
0054 stub CreatePatternBrush
0055 stub CreatePen
0056 stub CreatePenIndirect
0057 stub CreatePolyPolygonRgn
0058 stub CreatePolygonRgn
0059 stub CreateRectRgn
0060 stub CreateRectRgnIndirect
0061 stub CreateRoundRectRgn
0062 stub CreateScalableFontResourceA
0063 stub CreateScalableFontResourceW
0064 stub CreateSolidBrush
0065 stub DPtoLP
0066 stub DeleteColorSpace
0067 stub DeleteDC
0068 stub DeleteEnhMetaFile
0069 stub DeleteMetaFile
0070 stub DeleteObject
0071 stub DescribePixelFormat
0072 stub DeviceCapabilitiesExA
0073 stub DeviceCapabilitiesExW
0074 stub DrawEscape
0075 stub Ellipse
0076 stub EndDoc
0077 stub EndPage
0078 stub EndPath
0079 stub EnumEnhMetaFile
0080 stub EnumFontFamiliesA
0081 stub EnumFontFamiliesExA
0082 stub EnumFontFamiliesExW
0083 stub EnumFontFamiliesW
0084 stub EnumFontsA
0085 stub EnumFontsW
0086 stub EnumICMProfilesA
0087 stub EnumICMProfilesW
0088 stub EnumMetaFile
0089 stub EnumObjects
0090 stub EqualRgn
0091 stub Escape
0092 stub ExcludeClipRect
0093 stub ExtCreatePen
0094 stub ExtCreateRegion
0095 stub ExtEscape
0096 stub ExtFloodFill
0097 stub ExtSelectClipRgn
0098 stub ExtTextOutA
0099 stub ExtTextOutW
0100 stub FillPath
0101 stub FillRgn
0102 stub FixBrushOrgEx
0103 stub FlattenPath
0104 stub FloodFill
0105 stub FrameRgn
0106 stub FreeImageColorMatcher
0107 stub GdiAssociateObject
0108 stub GdiCleanCacheDC
0109 stub GdiComment
0110 stub GdiConvertAndCheckDC
0111 stub GdiConvertBitmap
0112 stub GdiConvertBrush
0113 stub GdiConvertDC
0114 stub GdiConvertEnhMetaFile
0115 stub GdiConvertFont
0116 stub GdiConvertMetaFilePict
0117 stub GdiConvertPalette
0118 stub GdiConvertRegion
0119 stub GdiCreateLocalBitmap
0120 stub GdiCreateLocalBrush
0121 stub GdiCreateLocalEnhMetaFile
0122 stub GdiCreateLocalFont
0123 stub GdiCreateLocalMetaFilePict
0124 stub GdiCreateLocalPalette
0125 stub GdiCreateLocalRegion
0126 stub GdiDeleteLocalDC
0127 stub GdiDeleteLocalObject
0128 stub GdiFlush
0129 stub GdiGetBatchLimit
0130 stub GdiGetLocalBrush
0131 stub GdiGetLocalDC
0132 stub GdiGetLocalFont
0133 stub GdiIsMetaFileDC
0134 stub GdiPlayDCScript
0135 stub GdiPlayJournal
0136 stub GdiPlayScript
0137 stub GdiReleaseLocalDC
0138 stub GdiSetAttrs
0139 stub GdiSetBatchLimit
0140 stub GdiSetServerAttr
0141 stub GetArcDirection
0142 stub GetAspectRatioFilterEx
0143 stub GetBitmapBits
0144 stub GetBitmapDimensionEx
0145 stub GetBkColor
0146 stub GetBkMode
0147 stub GetBoundsRect
0148 stub GetBrushOrgEx
0149 stub GetCharABCWidthsA
0150 stub GetCharABCWidthsFloatA
0151 stub GetCharABCWidthsFloatW
0152 stub GetCharABCWidthsW
0153 stub GetCharWidth32A
0154 stub GetCharWidth32W
0155 stub GetCharWidthA
0156 stub GetCharWidthFloatA
0157 stub GetCharWidthFloatW
0158 stub GetCharWidthW
0159 stub GetCharWidthWOW
0160 stub GetCharacterPlacementA
0161 stub GetCharacterPlacementW
0162 stub GetClipBox
0163 stub GetClipRgn
0164 stub GetColorAdjustment
0165 stub GetColorSpace
0166 stub GetCurrentObject
0167 stub GetCurrentPositionEx
0168 stub GetDCOrgEx
0169 stub GetDIBColorTable
0170 stub GetDIBits
0171 stub GetDeviceCaps
0172 stub GetDeviceGammaRamp
0173 stub GetETM
0174 stub GetEnhMetaFileA
0175 stub GetEnhMetaFileBits
0176 stub GetEnhMetaFileDescriptionA
0177 stub GetEnhMetaFileDescriptionW
0178 stub GetEnhMetaFileHeader
0179 stub GetEnhMetaFilePaletteEntries
0180 stub GetEnhMetaFileW
0181 stub GetFontData
0182 stub GetFontLanguageInfo
0183 stub GetFontResourceInfo
0184 stub GetFontResourceInfoW
0185 stub GetGlyphOutline
0186 stub GetGlyphOutlineA
0187 stub GetGlyphOutlineW
0188 stub GetGraphicsMode
0189 stub GetICMProfileA
0190 stub GetICMProfileW
0191 stub GetKerningPairs
0192 stub GetKerningPairsA
0193 stub GetKerningPairsW
0194 stub GetLogColorSpaceA
0195 stub GetLogColorSpaceW
0196 stub GetMapMode
0197 stub GetMetaFileA
0198 stub GetMetaFileBitsEx
0199 stub GetMetaFileW
0200 stub GetMetaRgn
0201 stub GetMiterLimit
0202 stub GetNearestColor
0203 stub GetNearestPaletteIndex
0204 stub GetObjectA
0205 stub GetObjectType
0206 stub GetObjectW
0207 stub GetOutlineTextMetricsA
0208 stub GetOutlineTextMetricsW
0209 stub GetPaletteEntries
0210 stub GetPath
0211 stub GetPixel
0212 stub GetPixelFormat
0213 stub GetPolyFillMode
0214 stub GetROP2
0215 stub GetRandomRgn
0216 stub GetRasterizerCaps
0217 stub GetRegionData
0218 stub GetRelAbs
0219 stub GetRgnBox
0220 stub GetStockObject
0221 stub GetStretchBltMode
0222 stub GetSystemPaletteEntries
0223 stub GetSystemPaletteUse
0224 stub GetTextAlign
0225 stub GetTextCharacterExtra
0226 stub GetTextCharset
0227 stub GetTextColor
0228 stub GetTextExtentExPointA
0229 stub GetTextExtentExPointW
0230 stub GetTextExtentPoint32A
0231 stub GetTextExtentPoint32W
0232 stub GetTextExtentPointA
0233 stub GetTextExtentPointW
0234 stub GetTextFaceA
0235 stub GetTextFaceW
0236 stub GetTextMetricsA
0237 stub GetTextMetricsW
0238 stub GetTransform
0239 stub GetViewportExtEx
0240 stub GetViewportOrgEx
0241 stub GetWinMetaFileBits
0242 stub GetWindowExtEx
0243 stub GetWindowOrgEx
0244 stub GetWorldTransform
0245 stub IntersectClipRect
0246 stub InvertRgn
0247 stub LPtoDP
0248 stub LineDDA
0249 stub LineTo
0250 stub LoadImageColorMatcherA
0251 stub LoadImageColorMatcherW
0252 stub MaskBlt
0253 stub ModifyWorldTransform
0254 stub MoveToEx
0255 stub OffsetClipRgn
0256 stub OffsetRgn
0257 stub OffsetViewportOrgEx
0258 stub OffsetWindowOrgEx
0259 stub PaintRgn
0260 stub PatBlt
0261 stub PathToRegion
0262 stub Pie
0263 stub PlayEnhMetaFile
0264 stub PlayEnhMetaFileRecord
0265 stub PlayMetaFile
0266 stub PlayMetaFileRecord
0267 stub PlgBlt
0268 stub PolyBezier
0269 stub PolyBezierTo
0270 stub PolyDraw
0271 stub PolyPolygon
0272 stub PolyPolyline
0273 stub PolyTextOutA
0274 stub PolyTextOutW
0275 stub Polygon
0276 stub Polyline
0277 stub PolylineTo
0278 stub PtInRegion
0279 stub PtVisible
0280 stub RealizePalette
0281 stub RectInRegion
0282 stub RectVisible
0283 stub Rectangle
0284 stub RemoveFontResourceA
0285 stub RemoveFontResourceTracking
0286 stub RemoveFontResourceW
0287 stub ResetDCA
0288 stub ResetDCW
0289 stub ResizePalette
0290 stub RestoreDC
0291 stub RoundRect
0292 stub SaveDC
0293 stub ScaleViewportExtEx
0294 stub ScaleWindowExtEx
0295 stub SelectBrushLocal
0296 stub SelectClipPath
0297 stub SelectClipRgn
0298 stub SelectFontLocal
0299 stub SelectObject
0300 stub SelectPalette
0301 stub SetAbortProc
0302 stub SetArcDirection
0303 stub SetBitmapBits
0304 stub SetBitmapDimensionEx
0305 stub SetBkColor
0306 stub SetBkMode
0307 stub SetBoundsRect
0308 stub SetBrushOrgEx
0309 stub SetColorAdjustment
0310 stub SetColorSpace
0311 stub SetDIBColorTable
0312 stub SetDIBits
0313 stub SetDIBitsToDevice
0314 stub SetDeviceGammaRamp
0315 stub SetEnhMetaFileBits
0316 stub SetFontEnumeration
0317 stub SetGraphicsMode
0318 stub SetICMMode
0319 stub SetICMProfileA
0320 stub SetICMProfileW
0321 stub SetMapMode
0322 stub SetMapperFlags
0323 stub SetMetaFileBitsEx
0324 stub SetMetaRgn
0325 stub SetMiterLimit
0326 stub SetPaletteEntries
0327 stub SetPixel
0328 stub SetPixelFormat
0329 stub SetPixelV
0330 stub SetPolyFillMode
0331 stub SetROP2
0332 stub SetRectRgn
0333 stub SetRelAbs
0334 stub SetStretchBltMode
0335 stub SetSystemPaletteUse
0336 stub SetTextAlign
0337 stub SetTextCharacterExtra
0338 stub SetTextColor
0339 stub SetTextJustification
0340 stub SetViewportExtEx
0341 stub SetViewportOrgEx
0342 stub SetVirtualResolution
0343 stub SetWinMetaFileBits
0344 stub SetWindowExtEx
0345 stub SetWindowOrgEx
0346 stub SetWorldTransform
0347 stub StartDocA
0348 stub StartDocW
0349 stub StartPage
0350 stub StretchBlt
0351 stub StretchDIBits
0352 stub StrokeAndFillPath
0353 stub StrokePath
0354 stub SwapBuffers
0355 stub TextOutA
0356 stub TextOutW
0357 stub UnloadNetworkFonts
0358 stub UnrealizeObject
0359 stub UpdateColors
0360 stub WidenPath
0361 stub pstackConnect
......@@ -41,7 +41,7 @@ id 1
41 return EnableDos 0 0
42 return DisableDos 0 0
45 pascal16 LoadModule(ptr ptr) LoadModule
46 pascal16 FreeModule(word) FreeLibrary
46 pascal16 FreeModule(word) FreeModule
47 pascal16 GetModuleHandle(ptr) GetModuleHandle
48 pascal16 GetModuleUsage(word) GetModuleUsage
49 pascal16 GetModuleFileName(word ptr s_word) GetModuleFileName
......@@ -82,11 +82,11 @@ id 1
84 pascal _llseek(word long word) _llseek
85 pascal16 _lopen(ptr word) _lopen
86 pascal16 _lwrite(word ptr word) _lwrite
#87 RESERVED5
87 stub RESERVED5
88 pascal lstrcpy(segptr segptr) lstrcpy
89 pascal lstrcat(segptr segptr) lstrcat
90 pascal16 lstrlen(ptr) lstrlen
91 register InitTask() KERNEL_InitTask
91 register InitTask() InitTask
92 pascal16 GetTempDrive(byte) GetTempDrive
93 pascal16 GetCodeHandle(segptr) GetCodeHandle
94 stub DefineHandleTable
......@@ -161,29 +161,29 @@ id 1
170 pascal16 AllocCStoDSAlias(word) AllocCStoDSAlias
171 pascal16 AllocDStoCSAlias(word) AllocDStoCSAlias
172 pascal16 AllocAlias(word) AllocCStoDSAlias
#173 __ROMBIOS
#174 __A000H
173 equate __ROMBIOS 0
174 equate __A000H 0
175 pascal16 AllocSelector(word) AllocSelector
176 pascal16 FreeSelector(word) FreeSelector
177 pascal16 PrestoChangoSelector(word word) PrestoChangoSelector
178 equate __WINFLAGS 0x413
#179 __D000H
179 equate __D000H 0
180 pascal16 LongPtrAdd(long long) LongPtrAdd
#181 __B000H
#182 __B800H
#183 __0000H
181 equate __B000H 0
182 equate __B800H 0
183 equate __0000H 0
184 pascal GlobalDOSAlloc(long) GlobalDOSAlloc
185 pascal16 GlobalDOSFree(word) GlobalDOSFree
186 pascal GetSelectorBase(word) GetSelectorBase
187 pascal16 SetSelectorBase(word long) SetSelectorBase
188 pascal GetSelectorLimit(word) GetSelectorLimit
189 pascal16 SetSelectorLimit(word long) SetSelectorLimit
#190 __E000H
190 equate __E000H 0
191 pascal16 GlobalPageLock(word) GlobalPageLock
192 pascal16 GlobalPageUnlock(word) GlobalPageUnlock
#193 __0040H
#194 __F000H
#195 __C000H
193 equate __0040H 0
194 equate __F000H 0
195 equate __C000H 0
196 pascal16 SelectorAccessRights(word word word) SelectorAccessRights
197 pascal16 GlobalFix(word) GlobalFix
198 pascal16 GlobalUnfix(word) GlobalUnfix
......
name mmsystem
id 10
1 pascal MMSYSTEM_WEP(word word word ptr) MMSYSTEM_WEP
#1 pascal MMSYSTEM_WEP(word word word ptr) MMSYSTEM_WEP
2 pascal SNDPLAYSOUND(ptr word) sndPlaySound
5 pascal MMSYSTEMGETVERSION() mmsystemGetVersion
6 pascal DriverProc(long word word long long) DriverProc
......@@ -20,51 +20,51 @@ id 10
107 pascal JOYSETTHRESHOLD(word word) JoySetThreshold
109 pascal JOYSETCALIBRATION(word) JoySetCalibration
201 pascal MIDIOUTGETNUMDEVS() midiOutGetNumDevs
202 pascal MIDIOUTGETDEVCAPS(word ptr word) midiOutGetDevCaps
202 pascal MIDIOUTGETDEVCAPS(word segptr word) midiOutGetDevCaps
203 pascal MIDIOUTGETERRORTEXT(word ptr word) midiOutGetErrorText
204 pascal MIDIOUTOPEN(ptr word ptr long long long) midiOutOpen
205 pascal MIDIOUTCLOSE(word) midiOutClose
206 pascal MIDIOUTPREPAREHEADER(word ptr word) midiOutPrepareHeader
207 pascal MIDIOUTUNPREPAREHEADER(word ptr word) midiOutUnprepareHeader
206 pascal MIDIOUTPREPAREHEADER(word segptr word) midiOutPrepareHeader
207 pascal MIDIOUTUNPREPAREHEADER(word segptr word) midiOutUnprepareHeader
208 pascal MIDIOUTSHORTMSG(word long) midiOutShortMsg
209 pascal MIDIOUTLONGMSG(word ptr word) midiOutLongMsg
210 pascal MIDIOUTRESET(word) midiOutReset
211 pascal MIDIOUTGETVOLUME(word ptr) midiOutGetVolume
211 pascal MIDIOUTGETVOLUME(word segptr) midiOutGetVolume
212 pascal MIDIOUTSETVOLUME(word long) midiOutSetVolume
215 pascal MIDIOUTGETID(word ptr) midiOutGetID
216 pascal MIDIOUTMESSAGE(word word long long) midiOutMessage
301 pascal MIDIINGETNUMDEVS() midiInGetNumDevs
302 pascal MIDIINGETDEVCAPS(word ptr word) midiInGetDevCaps
302 pascal MIDIINGETDEVCAPS(word segptr word) midiInGetDevCaps
303 pascal MIDIINGETERRORTEXT(word ptr word) midiInGetErrorText
304 pascal MIDIINOPEN(ptr word ptr long long long) midiInOpen
305 pascal MIDIINCLOSE(word) midiInClose
306 pascal MIDIINPREPAREHEADER(word ptr word) midiInPrepareHeader
307 pascal MIDIINUNPREPAREHEADER(word ptr word) midiInUnprepareHeader
306 pascal MIDIINPREPAREHEADER(word segptr word) midiInPrepareHeader
307 pascal MIDIINUNPREPAREHEADER(word segptr word) midiInUnprepareHeader
309 pascal MIDIINSTART(word) midiInStart
310 pascal MIDIINSTOP(word) midiInStop
311 pascal MIDIINRESET(word) midiInReset
312 pascal MIDIINGETID(word ptr) midiInGetID
313 pascal MIDIINMESSAGE(word word long long) midiInMessage
350 pascal AUXGETNUMDEVS() auxGetNumDevs
351 pascal AUXGETDEVCAPS(word ptr word) auxGetDevCaps
352 pascal AUXGETVOLUME(word ptr) auxGetVolume
351 pascal AUXGETDEVCAPS(word segptr word) auxGetDevCaps
352 pascal AUXGETVOLUME(word segptr) auxGetVolume
353 pascal AUXSETVOLUME(word long) auxSetVolume
354 pascal AUXOUTMESSAGE(word word long long) auxOutMessage
401 pascal WAVEOUTGETNUMDEVS() waveOutGetNumDevs
402 pascal WAVEOUTGETDEVCAPS(word ptr word) waveOutGetDevCaps
402 pascal WAVEOUTGETDEVCAPS(word segptr word) waveOutGetDevCaps
403 pascal WAVEOUTGETERRORTEXT(word ptr word) waveOutGetErrorText
404 pascal WAVEOUTOPEN(ptr word ptr long long long) waveOutOpen
405 pascal WAVEOUTCLOSE(word) waveOutClose
406 pascal WAVEOUTPREPAREHEADER(word ptr word) waveOutPrepareHeader
407 pascal WAVEOUTUNPREPAREHEADER(word ptr word) waveOutUnprepareHeader
408 pascal WAVEOUTWRITE(word ptr word) waveOutWrite
406 pascal WAVEOUTPREPAREHEADER(word segptr word) waveOutPrepareHeader
407 pascal WAVEOUTUNPREPAREHEADER(word segptr word) waveOutUnprepareHeader
408 pascal WAVEOUTWRITE(word segptr word) waveOutWrite
409 pascal WAVEOUTPAUSE(word) waveOutPause
410 pascal WAVEOUTRESTART(word) waveOutRestart
411 pascal WAVEOUTRESET(word) waveOutReset
412 pascal WAVEOUTGETPOSITION(word ptr word) waveOutGetPosition
412 pascal WAVEOUTGETPOSITION(word segptr word) waveOutGetPosition
413 pascal WAVEOUTGETPITCH(word ptr) waveOutGetPitch
414 pascal WAVEOUTSETPITCH(word long) waveOutSetPitch
415 pascal WAVEOUTGETVOLUME(word ptr) waveOutGetVolume
415 pascal WAVEOUTGETVOLUME(word segptr) waveOutGetVolume
416 pascal WAVEOUTSETVOLUME(word long) waveOutSetVolume
417 pascal WAVEOUTGETPLAYBACKRATE(word ptr) waveOutGetPlaybackRate
418 pascal WAVEOUTSETPLAYBACKRATE(word long) waveOutSetPlaybackRate
......@@ -72,17 +72,17 @@ id 10
420 pascal WAVEOUTGETID(word ptr) waveOutGetID
421 pascal WAVEOUTMESSAGE(word word long long) waveOutMessage
501 pascal WAVEINGETNUMDEVS() waveInGetNumDevs
502 pascal WAVEINGETDEVCAPS(word ptr word) waveInGetDevCaps
502 pascal WAVEINGETDEVCAPS(word segptr word) waveInGetDevCaps
503 pascal WAVEINGETERRORTEXT(word ptr word) waveInGetErrorText
504 pascal WAVEINOPEN(ptr word ptr long long long) waveInOpen
505 pascal WAVEINCLOSE(word) waveInClose
506 pascal WAVEINPREPAREHEADER(word ptr word) waveInPrepareHeader
507 pascal WAVEINUNPREPAREHEADER(word ptr word) waveInUnprepareHeader
508 pascal WAVEINADDBUFFER(word ptr word) waveInAddBuffer
506 pascal WAVEINPREPAREHEADER(word segptr word) waveInPrepareHeader
507 pascal WAVEINUNPREPAREHEADER(word segptr word) waveInUnprepareHeader
508 pascal WAVEINADDBUFFER(word segptr word) waveInAddBuffer
509 pascal WAVEINSTART(word) waveInStart
510 pascal WAVEINSTOP(word) waveInStop
511 pascal WAVEINRESET(word) waveInReset
512 pascal WAVEINGETPOSITION(word ptr word) waveInGetPosition
512 pascal WAVEINGETPOSITION(word segptr word) waveInGetPosition
513 pascal WAVEINGETID(word ptr) waveInGetID
514 pascal WAVEINMESSAGE(word word long long) waveInMessage
601 pascal timeGetSystemTime(ptr word) timeGetSystemTime
......
/*
static char RCSId[] = "$Id: relay.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
* Copyright 1993 Robert J. Amstadt
* Copyright 1995 Alexandre Julliard
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#ifdef linux
#include <linux/unistd.h>
#include <linux/head.h>
#include <linux/ldt.h>
#endif
#include "ldt.h"
#include "neexe.h"
#include "prototypes.h"
#include "dlls.h"
#include "options.h"
#include "selectors.h"
#include "global.h"
#include "module.h"
#include "stackframe.h"
#include "wine.h"
#include "stddebug.h"
/* #define DEBUG_RELAY */
#include "debug.h"
......@@ -35,41 +18,39 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
dprintf_relay
#endif
#ifdef WINELIB
#define WineLibSkip(x) 0
#else
#define WineLibSkip(x) x
#endif
#define DLL_ENTRY(name) \
{ #name, name##_Code_Start, name##_Data_Start, \
name##_Module_Start, name##_Module_End, TRUE, 0 }
struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS] =
struct dll_table_s dll_builtin_table[N_BUILTINS] =
{
{ "KERNEL", WineLibSkip(&KERNEL_table), 1 },
{ "USER", WineLibSkip(&USER_table), 1 },
{ "GDI", WineLibSkip(&GDI_table), 1 },
{ "WIN87EM", WineLibSkip(&WIN87EM_table), 1 },
{ "SHELL", WineLibSkip(&SHELL_table), 1 },
{ "SOUND", WineLibSkip(&SOUND_table), 1 },
{ "KEYBOARD", WineLibSkip(&KEYBOARD_table), 1 },
{ "WINSOCK", WineLibSkip(&WINSOCK_table), 1 },
{ "STRESS", WineLibSkip(&STRESS_table), 1 },
{ "MMSYSTEM", WineLibSkip(&MMSYSTEM_table), 1 },
{ "SYSTEM", WineLibSkip(&SYSTEM_table), 1 },
{ "TOOLHELP", WineLibSkip(&TOOLHELP_table), 1 },
{ "MOUSE", WineLibSkip(&MOUSE_table), 1 },
{ "COMMDLG", WineLibSkip(&COMMDLG_table), 1 },
{ "OLE2", WineLibSkip(&OLE2_table), 1 },
{ "OLE2CONV", WineLibSkip(&OLE2CONV_table), 1 },
{ "OLE2DISP", WineLibSkip(&OLE2DISP_table), 1 },
{ "OLE2NLS", WineLibSkip(&OLE2NLS_table), 1 },
{ "OLE2PROX", WineLibSkip(&OLE2PROX_table), 1 },
{ "OLECLI", WineLibSkip(&OLECLI_table), 1 },
{ "OLESVR", WineLibSkip(&OLESVR_table), 1 },
{ "COMPOBJ", WineLibSkip(&COMPOBJ_table), 1 },
{ "STORAGE", WineLibSkip(&STORAGE_table), 1 },
{ "WINPROCS", WineLibSkip(&WINPROCS_table), 1 },
{ "DDEML", WineLibSkip(&DDEML_table), 1 }
DLL_ENTRY(KERNEL),
DLL_ENTRY(USER),
DLL_ENTRY(GDI),
DLL_ENTRY(WIN87EM),
DLL_ENTRY(SHELL),
DLL_ENTRY(SOUND),
DLL_ENTRY(KEYBOARD),
DLL_ENTRY(WINSOCK),
DLL_ENTRY(STRESS),
DLL_ENTRY(MMSYSTEM),
DLL_ENTRY(SYSTEM),
DLL_ENTRY(TOOLHELP),
DLL_ENTRY(MOUSE),
DLL_ENTRY(COMMDLG),
DLL_ENTRY(OLE2),
DLL_ENTRY(OLE2CONV),
DLL_ENTRY(OLE2DISP),
DLL_ENTRY(OLE2NLS),
DLL_ENTRY(OLE2PROX),
DLL_ENTRY(OLECLI),
DLL_ENTRY(OLESVR),
DLL_ENTRY(COMPOBJ),
DLL_ENTRY(STORAGE),
DLL_ENTRY(WINPROCS),
DLL_ENTRY(DDEML)
};
/* don't forget to increase N_BUILTINS in dlls.h if you add a dll */
/* Saved 16-bit stack */
......@@ -78,7 +59,7 @@ WORD IF1632_Saved16_sp = 0;
/* Saved 32-bit stack */
DWORD IF1632_Saved32_esp = 0;
SEGPTR IF1632_Stack32_base = 0;
/***********************************************************************
* RELAY_Init
......@@ -93,9 +74,9 @@ BOOL RELAY_Init(void)
extern void CALL16_Ret_word(), CALL16_Ret_long();
extern DWORD CALL16_RetAddr_word, CALL16_RetAddr_long;
codesel = SELECTOR_AllocBlock( (void *)CALL16_Start,
codesel = GLOBAL_CreateBlock( GMEM_FIXED, (void *)CALL16_Start,
(int)CALL16_End - (int)CALL16_Start,
SEGMENT_CODE, TRUE, FALSE );
0, TRUE, TRUE, FALSE );
if (!codesel) return FALSE;
/* Patch the return addresses for CallTo16 routines */
......@@ -109,21 +90,24 @@ BOOL RELAY_Init(void)
}
#ifndef WINELIB
/***********************************************************************
* RELAY_DebugCall32
*/
void RELAY_DebugCall32( char *args )
{
STACK16FRAME *frame;
char *args16;
struct dll_table_s *table;
char *args16, *name;
int i;
if (!debugging_relay) return;
frame = CURRENT_STACK16;
printf( "Call %s.%d: %s(",
dll_builtin_table[frame->dll_id-1].dll_name,
frame->ordinal_number,
dll_builtin_table[frame->dll_id-1].table->dll_table[frame->ordinal_number].export_name );
table = &dll_builtin_table[frame->dll_id-1];
name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
printf( "Call %s.%d: %*.*s(",
table->name, frame->ordinal_number, *name, *name, name + 1 );
args16 = (char *)frame->args;
for (i = 0; i < strlen(args); i++)
{
......@@ -165,30 +149,41 @@ void RELAY_DebugCall32( char *args )
}
/***********************************************************************
* RELAY_DebugReturn
*/
void RELAY_DebugReturn( int short_ret, int ret_val )
{
STACK16FRAME *frame;
struct dll_table_s *table;
char *name;
if (!debugging_relay) return;
frame = CURRENT_STACK16;
printf( "Ret %s.%d: %s() ",
dll_builtin_table[frame->dll_id-1].dll_name,
frame->ordinal_number,
dll_builtin_table[frame->dll_id-1].table->dll_table[frame->ordinal_number].export_name );
table = &dll_builtin_table[frame->dll_id-1];
name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
printf( "Ret %s.%d: %*.*s() ",
table->name, frame->ordinal_number, *name, *name, name + 1 );
if (short_ret) printf( "retval=0x%04x\n", ret_val & 0xffff );
else printf( "retval=0x%08x\n", ret_val );
}
/***********************************************************************
* RELAY_Unimplemented
*
* This function is called for unimplemented entry points (declared
* as 'stub' in the spec file).
*/
void RELAY_Unimplemented(void)
{
STACK16FRAME *frame = CURRENT_STACK16;
struct dll_table_s *table = &dll_builtin_table[frame->dll_id-1];
char *name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
fprintf( stderr, "No handler for routine %s.%d (%s)\n",
dll_builtin_table[frame->dll_id-1].dll_name,
frame->ordinal_number,
dll_builtin_table[frame->dll_id-1].table->dll_table[frame->ordinal_number].export_name );
fprintf( stderr, "No handler for routine %s.%d (%*.*s)\n",
table->name, frame->ordinal_number, *name, *name, name + 1 );
exit(1);
}
......@@ -214,83 +209,3 @@ void RELAY_DebugCall16( int* stack, int nbargs )
while (nbargs--) printf( ",0x%x", *stack++ );
printf( ")\n" );
}
#endif /* WINELIB */
/**********************************************************************
* FindDLLTable
*/
struct dll_table_s *
FindDLLTable(char *dll_name)
{
int i;
for (i = 0; i < N_BUILTINS; i++)
if (strcasecmp(dll_builtin_table[i].dll_name, dll_name) == 0
&& dll_builtin_table[i].dll_is_used)
return dll_builtin_table[i].table;
return NULL;
}
/**********************************************************************
* FindOrdinalFromName
*/
int
FindOrdinalFromName(struct dll_table_entry_s *dll_table, char *func_name)
{
int i, limit;
for (i = 0; i < N_BUILTINS; i++)
if (dll_table == dll_builtin_table[i].table->dll_table)
break;
if (i == N_BUILTINS)
return 0;
limit = dll_builtin_table[i].table->dll_table_length;
for (i = 0; i < limit; i++)
if (strcasecmp(dll_table[i].export_name, func_name) == 0)
return i;
return 0;
}
#ifndef WINELIB
#ifdef WINESTAT
void winestat(){
int i, j;
double perc;
int used, implemented;
int tused, timplemented;
struct dll_table_entry_s *table;
tused = 0;
timplemented = 0;
for (i = 0; i < N_BUILTINS; i++) {
table = dll_builtin_table[i].table->dll_table;
used = 0;
implemented = 0;
for(j=0; j < dll_builtin_table[i].table->dll_table_length; j++) {
if(table[j].used){
used++;
if (table[j].export_name[0]) implemented++;
else
printf("%s.%d not implemented\n",
dll_builtin_table[i].dll_name,
j);
};
};
tused += used;
timplemented += implemented;
if(used)
perc = implemented * 100.00 / used;
else
perc = 0.0;
if (used)
printf("%s: %d of %d (%3.1f %%)\n", dll_builtin_table[i].dll_name, implemented, used, perc);
};
perc = timplemented * 100.00 / tused;
printf("TOTAL: %d of %d winapi functions implemented (%3.1f %%)\n",timplemented, tused, perc);
}
#endif /* WINESTAT */
#endif /* !WINELIB */
/*
* Copyright 1995 Martin von Loewis
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include "windows.h"
#include "dlls.h"
#include "pe_image.h"
#include "stddebug.h"
/* #define DEBUG_RELAY */
#include "debug.h"
WIN32_builtin *WIN32_builtin_list;
int RELAY32_Init(void)
{
#ifndef WINELIB
/* Add a call for each DLL */
GDI32_Init();
KERNEL32_Init();
SHELL32_Init();
USER32_Init();
WINPROCS32_Init();
#endif
/* Why should it fail, anyways? */
return 1;
}
WIN32_builtin *RELAY32_GetBuiltinDLL(char *name)
{
WIN32_builtin *it;
for(it=WIN32_builtin_list;it;it=it->next)
if(strcmp(name,it->name)==0)
return it;
return NULL;
}
void RELAY32_Unimplemented(char *dll, int item)
{
WIN32_builtin *Dll;
fprintf( stderr, "No handler for routine %s.%d", dll, item);
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(char *dll_name, char *item, int hint)
{
WIN32_builtin *dll;
int i;
dprintf_module(stddeb, "Looking for %s in %s, hint %x\n",
item ? item: "(no name)", dll_name, hint);
dll=RELAY32_GetBuiltinDLL(dll_name);
if(!dll)return 0;
/* import by ordinal */
if(!item){
if(hint && hint<dll->size)return dll->functions[hint].definition;
return 0;
}
/* hint is correct */
if(hint && hint<dll->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=1;i<dll->size;i++)
if(strcmp(item,dll->functions[i].name)==0)
return dll->functions[i].definition;
/* function at hint has no name (unimplemented) */
if(hint && hint<dll->size && !dll->functions[hint].name)
{
dll->functions[hint].name=strdup(item);
dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
dll_name,hint);
return dll->functions[hint].definition;
}
printf("Not found\n");
return 0;
}
void RELAY32_DebugEnter(char *dll,char *name)
{
dprintf_relay(stddeb, "Entering %s.%s\n",dll,name);
}
LONG RELAY32_CallWindowProc( WNDPROC func, int hwnd, int message,
int wParam, int lParam )
{
int ret;
SpyMessage(hwnd, message, wParam, lParam);
__asm__ (
"push %1;"
"push %2;"
"push %3;"
"push %4;"
"call %5;"
: "=a" (ret)
: "g" (lParam), "g" (wParam), "g" (message), "g" (hwnd), "g" (func)
);
return ret;
}
......@@ -22,6 +22,9 @@ id 5
22 pascal ShellAbout(word ptr ptr word) ShellAbout
33 pascal AboutDlgProc(word word word long) AboutDlgProc
34 pascal ExtractIcon(word ptr s_word) ExtractIcon
36 pascal ExtractAssociatedIcon(word ptr ptr) ExtractAssociatedIcon
37 pascal DoEnvironmentSubst(ptr word word) DoEnvironmentSubst
39 stub InternalExtractIcon
102 pascal RegisterShellHook(ptr) RegisterShellHook
103 pascal ShellHookProc() ShellHookProc
......
name shell32
base 1
0000 stub CheckEscapesA
0001 stub CheckEscapesW
0002 stub CommandLineToArgvW
0003 stub DoEnvironmentSubstA
0004 stub DoEnvironmentSubstW
0005 stub DragAcceptFiles
0006 stub DragFinish
0007 stub DragQueryFileA
0008 stub DragQueryFileAorW
0009 stub DragQueryFileW
0010 stub DragQueryPoint
0011 stub DuplicateIcon
0012 stub ExtractAssociatedIconA
0013 stub ExtractAssociatedIconExA
0014 stub ExtractAssociatedIconExW
0015 stub ExtractAssociatedIconW
0016 stub ExtractIconA
0017 stub ExtractIconResInfoA
0018 stub ExtractIconResInfoW
0019 stub ExtractIconW
0020 stub ExtractVersionResource16W
0021 stub FindExeDlgProc
0022 stub FindExecutableA
0023 stub FindExecutableW
0024 stub FreeIconList
0025 stub InternalExtractIconListA
0026 stub InternalExtractIconListW
0027 stub RealShellExecuteA
0028 stub RealShellExecuteExA
0029 stub RealShellExecuteExW
0030 stub RealShellExecuteW
0031 stub RegenerateUserEnvironment
0032 stub RegisterShellHook
0033 stub SheChangeDirA
0034 stub SheChangeDirExA
0035 stub SheChangeDirExW
0036 stub SheChangeDirW
0037 stub SheConvertPathW
0038 stub SheFullPathA
0039 stub SheFullPathW
0040 stub SheGetCurDrive
0041 stub SheGetDirA
0042 stub SheGetDirExW
0043 stub SheGetDirW
0044 stub SheGetPathOffsetW
0045 stub SheRemoveQuotesA
0046 stub SheRemoveQuotesW
0047 stub SheSetCurDrive
0048 stub SheShortenPathA
0049 stub SheShortenPathW
0050 stub ShellAboutA
0051 stub ShellAboutW
0052 stub ShellExecuteA
0053 stub ShellExecuteW
0054 stub ShellHookProc
0055 stub StrChrA
0056 stub StrChrIA
0057 stub StrChrIW
0058 stub StrChrW
0059 stub StrCmpNA
0060 stub StrCmpNIA
0061 stub StrCmpNIW
0062 stub StrCmpNW
0063 stub StrCpyNA
0064 stub StrCpyNW
0065 stub StrNCmpA
0066 stub StrNCmpIA
0067 stub StrNCmpIW
0068 stub StrNCmpW
0069 stub StrNCpyA
0070 stub StrNCpyW
0071 stub StrRChrA
0072 stub StrRChrIA
0073 stub StrRChrIW
0074 stub StrRChrW
0075 stub StrRStrA
0076 stub StrRStrIA
0077 stub StrRStrIW
0078 stub StrRStrW
0079 stub StrStrA
0080 stub StrStrIA
0081 stub StrStrIW
0082 stub StrStrW
0083 stub WOWShellExecute
name storage
id 23
#1 STGCREATEDOCFILE
#2 STGCREATEDOCFILEONILOCKBYTES
#3 STGOPENSTORAGE
#4 STGOPENSTORAGEONILOCKBYTES
#5 STGISSTORAGEFILE
#6 STGISSTORAGEILOCKBYTES
#7 STGSETTIMES
1 stub StgCreateDocFile
2 stub StgCreateDocFileOnILockBytes
3 stub StgOpenStorage
4 stub StgOpenStorageOnILockBytes
5 stub StgIsStorageFile
6 stub StgIsStorageILockBytes
7 stub StgSetTimes
#8 WEP
#9 ___EXPORTEDSTUB
#103 DLLGETCLASSOBJECT
103 stub DllGetClassObject
name system
id 11
1 stub InquireSystem
2 stub CreateSystemTimer
3 stub KillSystemTimer
4 stub EnableSystemTimers
5 stub DisableSystemTimers
6 pascal GetSystemmsecCount() GetTickCount
7 stub Get80x87SaveSize
8 stub Save80x87State
9 stub Restore80x87State
#20 stub A20_Proc
......@@ -114,7 +114,7 @@ id 2
113 pascal TranslateMessage(ptr) TranslateMessage
114 pascal DispatchMessage(ptr) DispatchMessage
115 stub ReplyMessage
116 stub PostAppMessage
116 pascal PostAppMessage(word word word long) PostAppMessage
118 pascal RegisterWindowMessage(ptr) RegisterWindowMessage
119 pascal GetMessagePos() GetMessagePos
120 pascal GetMessageTime() GetMessageTime
......@@ -372,7 +372,7 @@ id 2
456 stub LoadIconHandler
457 pascal DestroyIcon(word) DestroyIcon
458 pascal DestroyCursor(word) DestroyCursor
459 stub DumpIcon
459 pascal DumpIcon(ptr ptr ptr ptr) DumpIcon
460 pascal GetInternalWindowPos(word ptr ptr) GetInternalWindowPos
461 pascal SetInternalWindowPos(word word ptr ptr) SetInternalWindowPos
462 stub CalcChildScroll
......
......@@ -22,6 +22,6 @@ id 24
19 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc
20 pascal PrintDlgProc(word word word long) PrintDlgProc
21 pascal AboutDlgProc(word word word long) AboutDlgProc
22 pascal AboutWine_Proc(word word word long) AboutWine_Proc
22 pascal ComboLBoxWndProc(word word word long) ComboLBoxWndProc
23 pascal16 CARET_Callback(word word word long) CARET_Callback
24 pascal16 TASK_Reschedule() TASK_Reschedule
name winprocs32
1 stdcall ButtonWndProc(long long long long) ButtonWndProc
2 stdcall StaticWndProc(long long long long) StaticWndProc
3 stdcall ScrollBarWndProc(long long long long) ScrollBarWndProc
4 stdcall ListBoxWndProc(long long long long) ListBoxWndProc
5 stdcall ComboBoxWndProc(long long long long) ComboBoxWndProc
6 stdcall EditWndProc(long long long long) EditWndProc
7 stdcall PopupMenuWndProc(long long long long) PopupMenuWndProc
8 stdcall DesktopWndProc(long long long long) DesktopWndProc
9 stdcall DefDlgProc(long long long long) DefDlgProc
10 stdcall MDIClientWndProc(long long long long) MDIClientWndProc
11 stdcall DefWindowProc(long long long long) DefWindowProc
12 stdcall DefMDIChildProc(long long long long) DefMDIChildProc
13 stdcall SystemMessageBoxProc(long long long long) SystemMessageBoxProc
14 stdcall FileOpenDlgProc(long long long long) FileOpenDlgProc
15 stdcall FileSaveDlgProc(long long long long) FileSaveDlgProc
16 stdcall ColorDlgProc(long long long long) ColorDlgProc
17 stdcall FindTextDlgProc(long long long long) FindTextDlgProc
18 stdcall ReplaceTextDlgProc(long long long long) ReplaceTextDlgProc
19 stdcall PrintSetupDlgProc(long long long long) PrintSetupDlgProc
20 stdcall PrintDlgProc(long long long long) PrintDlgProc
21 stdcall AboutDlgProc(long long long long) AboutDlgProc
22 stdcall ComboLBoxWndProc(long long long long) ComboLBoxWndProc
23 stdcall CARET_Callback(long long long long) CARET_Callback
/* XPM */
static char * obm_cdrom[] = {
"20 15 5 1",
" s white c white",
". s black c black",
"X s ltgray c #c0c0c0",
"o s dkgray c #808080",
"O s red c red",
" ",
" ",
" .................. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .XoooooooooooooXo. ",
" .Xo.XXXXXXXXX.oXo. ",
" .Xoo..XXXXX..ooXo. ",
" .XXXXX.....XXXXXo. ",
" .X.XOOXXXXXXX..Xo. ",
" .X.XOOXXXXXXX..Xo. ",
" .oooooooooooooooo. ",
" .................. ",
" ",
" "};
/* XPM */
static char * obm_drive[] = {
"20 15 5 1",
" s white c white",
". s black c black",
"X s ltgray c #c0c0c0",
"o s dkgray c #808080",
"O s red c red",
" ",
" ",
" .................. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXX.........XXXo. ",
" .X.............Xo. ",
" .XXX.........XXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXOOXXXXX..XXXo. ",
" .XXXOOXXXXX..XXXo. ",
" .oooooooooooooooo. ",
" .................. ",
" ",
" "};
/* XPM */
static char * obm_folder[] = {
"20 15 4 1",
" s white c white",
". s black c black",
"X s foldercol c #00bfbf",
"o s cyan c cyan",
" ",
" .... ",
" .XXXX. ",
" .............. ",
" .XoXoXoXoXoXoX. ",
" .oXoXoXoXoXoXo. ",
" .XoXoXoXoXoXoX. ",
" .oXoXoXoXoXoXo. ",
" .XoXoXoXoXoXoX. ",
" .oXoXoXoXoXoXo. ",
" .XoXoXoXoXoXoX. ",
" .oXoXoXoXoXoXo. ",
" .............. ",
" ",
" "};
/* XPM */
static char * obm_folder2[] = {
"20 15 3 1",
" s white c white",
". s black c black",
"X s foldercol c #00bfbf",
" ",
" ",
" ... ",
" ..X.. ",
" ..X.X........ ",
" .X.X.X.X.X.X.. ",
" ..X.X.X.X.X.X. ",
" .X.X............ ",
" ..X.X.XXXXXXXXXX. ",
" .X.X.XXXXXXXXXXX. ",
" ..X.XXXXXXXXXXX. ",
" .X.XXXXXXXXXXX. ",
" ..XXXXXXXXXXX. ",
" ............. ",
" "};
/* XPM */
static char * obm_harddisk[] = {
"20 15 5 1",
" s white c white",
". s black c black",
"X s ltgray c #c0c0c0",
"o s dkgray c #808080",
"O s green c green",
" ",
" ",
" .................. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .XXXXXXXXXXXXXXXo. ",
" .oooooooooooooooo. ",
" .XXXXXXXXXXXOOXXo. ",
" .XXXXXXXXXXXOOXXo. ",
" .oooooooooooooooo. ",
" .................. ",
" ",
" "};
/* XPM */
static char * oic_landscape[] = {
"32 32 6 1",
" s None c None",
". s black c black",
"X s ltgray c #c0c0c0",
"o s white c white",
"O s dkgray c #808080",
"+ s blue c blue",
" ",
" ",
" ",
" ",
" ",
" ...................... ",
" .XXXXXXXXXXXXXXXXXXXX.. ",
" .X.....XXXXXXXXXXXXXX.o. ",
" .XX.XXX.XXXXXXXXXXXXX.oo. ",
" .XX.XXX.XXXXXXXXXXXXX.ooo. ",
" .XX....XXXXXXXXXXXXXX.oooo. ",
" .XX.XXX.XXXXXXXXXXXXX....... ",
" .XX.XXX.XXXXXXXXXXXXXXXXXXX.O ",
" .X.....XXXXXXXXXXXXXXXXXXXX.O ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXX.O ",
" .XXX++X+X++X+++X++X+++X+X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+X+X++X++X++X+X++X++X+X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+++X+++X+X++X++X+X++X+++X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X++X+X+++X++++X++X++X++++X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXXXXX.O ",
" ............................O ",
" OOOOOOOOOOOOOOOOOOOOOOOOOOOO ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};
/* XPM */
static char * oic_portrait[] = {
"32 32 6 1",
" s None c None",
". s black c black",
"X s ltgray c #c0c0c0",
"o s white c white",
"O s dkgray c #808080",
"+ s blue c blue",
" ................... ",
" .XXXXXXXXXXXXXXXXX.. ",
" .X.....XXXXXXXXXXX.o. ",
" .XX.XXX.XXXXXXXXXX.oo. ",
" .XX.XXX.XXXXXXXXXX.ooo. ",
" .XX....XXXXXXXXXXX.oooo. ",
" .XX.XXX.XXXXXXXXXX....... ",
" .XX.XXX.XXXXXXXXXXXXXXXX.O ",
" .X.....XXXXXXXXXXXXXXXXX.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .XXX++X+X++X+X+X+++X+X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+X+X++X++X+X++X++X+X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+++X+++X+X++X+X++X+++X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X++X+X+++X++X+X++X++++X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+X+X++X+X++X++X+X++X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+X+X++X++X+X++X++X+X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+++X+++X+X++X+X++X+++X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X++X+X+++X++X+X++X++++X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+X+X++X+X++X++X+X++X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .X+++X++X+X+X+X+X++X+X+X.O ",
" .XXXXXXXXXXXXXXXXXXXXXXX.O ",
" .........................O ",
" .OOOOOOOOOOOOOOOOOOOOOOOOO "};
/* XPM */
static char * oic_wineicon[] = {
"32 32 8 1",
" s None c None",
". s cyan c cyan",
"X s purple c #800080",
"o s black c black",
"O s white c white",
"+ s dkyellow c #808000",
"@ s yellow c yellow",
"# s red c red",
" . . . . . XX ",
" . XX ",
" . . XXXX ",
" . . . XXXX ",
" oo.ooooooo.oooooooXX ",
" oooooOOOOO.OOOOOO.OOOOXXooooo ",
" oOOOo.ooooooooooooooXXoOOOo ",
" oOOO++@@@.@@@@@@.@@XXOOOo ",
" o+++@@@@@@@@@@@@@XX+++o ",
" o++++++++++++++XX+++o ",
" o+++++++++++++XX++o ",
" o+++++++++++XX++o ",
" o++++++++++XX+o ",
" o+++++##+XX+o ",
" o+++####X+o ",
" o+++##XXo ",
" oo+++oo ",
" ooo ",
" oOo ",
" oOo ",
" oOo ",
" oOo ",
" oOo ",
" oOo ",
" oOo ",
" oOo ",
" oooooOooooo ",
" oooooOOOoOOOoOOOooooo ",
" oOOOOOOOoOOOOOoOOOOOOOo ",
" oOOOOOOOOOOOOOOOOOOOOOo ",
" oooooOOOOOOOOOOOooooo ",
" ooooooooooo "};
......@@ -3,15 +3,15 @@
*/
typedef struct tagHEADCOMBO {
DWORD dwStyle;
DWORD dwState;
HWND hWndEdit;
HWND hWndLBox;
short LastSel;
RECT RectEdit;
BOOL bRedrawFlag;
} HEADCOMBO;
typedef HEADCOMBO FAR* LPHEADCOMBO;
typedef struct {
DWORD dwStyle;
DWORD dwState;
HWND hWndEdit;
HWND hWndLBox;
WORD LBoxTop;
BOOL DropDownVisible;
short LastSel;
RECT RectEdit;
RECT RectButton;
BOOL bRedrawFlag;
} HEADCOMBO,*LPHEADCOMBO;
......@@ -281,20 +281,14 @@ typedef DEVNAMES * LPDEVNAMES;
* COMMDLG Resources placed in Wine SYSRES.DLL *
************************************************************************/
#define OBM_FOLDER 32520
#define OBM_FOLDER2 32521
#define OBM_FLOPPY 32522
#define OBM_HDISK 32523
#define OBM_CDROM 32524
#define OPENFILEDLG 3
#define SAVEFILEDLG 4
#define PRINTDLG 5
#define OPENFILEDLG 3
#define SAVEFILEDLG 4
#define PRINTDLG 5
#define PRINTSETUPDLG 6
#define FONTDLG 7
#define COLORDLG 8
#define FINDDLG 9
#define REPLACEDLG 10
#define FONTDLG 7
#define COLORDLG 8
#define FINDDLG 9
#define REPLACEDLG 10
......
......@@ -11,8 +11,11 @@
extern BOOL DIALOG_Init(void);
extern HWND DIALOG_GetFirstTabItem( HWND hwndDlg );
extern int DialogBoxIndirectPtr( HINSTANCE hInst, LPCSTR dlgTemplate,
HWND owner, WNDPROC dlgProc);
extern int DialogBoxIndirectPtr(HINSTANCE hInst, LPCSTR dlgTemplate,
HWND owner, WNDPROC dlgProc);
extern int DialogBoxIndirectParamPtr(HINSTANCE hInst, LPCSTR dlgTemplate,
HWND owner, WNDPROC dlgProc,
LPARAM param);
#ifndef WINELIB
#pragma pack(1)
......
......@@ -12,9 +12,6 @@
#define MAX_NAME_LENGTH 64
struct ne_data {
struct ne_header_s *ne_header;
};
struct pe_data {
struct pe_header_s *pe_header;
......@@ -36,7 +33,6 @@ struct w_files
HANDLE hModule;
int initialised;
struct mz_header_s *mz_header;
struct ne_data *ne;
struct pe_data *pe;
};
......@@ -45,64 +41,52 @@ extern struct w_files *wine_files;
#define DLL 0
#define EXE 1
struct dll_table_entry_s
{
/*
* 16->32 bit interface data
*/
char *export_name;
#ifdef WINESTAT
int used; /* Number of times this function referenced */
#endif
};
struct dll_table_s
{
struct dll_table_entry_s *dll_table;
int dll_table_length;
int dll_number;
BYTE *code_start; /* 32-bit address of DLL code */
BYTE *data_start; /* 32-bit address of DLL data */
BYTE *module_start; /* 32-bit address of the module data */
BYTE *module_end;
HMODULE hModule;
char * name; /* DLL name */
BYTE * code_start; /* 32-bit address of DLL code */
BYTE * data_start; /* 32-bit address of DLL data */
BYTE * module_start; /* 32-bit address of the module data */
BYTE * module_end;
BOOL used; /* use MS provided if FALSE */
HMODULE hModule; /* module created for this DLL */
};
struct dll_name_table_entry_s
{
char *dll_name;
struct dll_table_s *table;
int dll_is_used; /* use MS provided if set to zero */
};
extern struct dll_table_s KERNEL_table;
extern struct dll_table_s USER_table;
extern struct dll_table_s GDI_table;
extern struct dll_table_s WIN87EM_table;
extern struct dll_table_s MMSYSTEM_table;
extern struct dll_table_s SHELL_table;
extern struct dll_table_s SOUND_table;
extern struct dll_table_s KEYBOARD_table;
extern struct dll_table_s WINSOCK_table;
extern struct dll_table_s STRESS_table;
extern struct dll_table_s SYSTEM_table;
extern struct dll_table_s TOOLHELP_table;
extern struct dll_table_s MOUSE_table;
extern struct dll_table_s COMMDLG_table;
extern struct dll_table_s OLE2_table;
extern struct dll_table_s OLE2CONV_table;
extern struct dll_table_s OLE2DISP_table;
extern struct dll_table_s OLE2NLS_table;
extern struct dll_table_s OLE2PROX_table;
extern struct dll_table_s OLECLI_table;
extern struct dll_table_s OLESVR_table;
extern struct dll_table_s COMPOBJ_table;
extern struct dll_table_s STORAGE_table;
extern struct dll_table_s WINPROCS_table;
extern struct dll_table_s DDEML_table;
#define DECLARE_DLL(name) \
extern BYTE name##_Code_Start[]; \
extern BYTE name##_Data_Start[]; \
extern BYTE name##_Module_Start[]; \
extern BYTE name##_Module_End[];
DECLARE_DLL(KERNEL)
DECLARE_DLL(USER)
DECLARE_DLL(GDI)
DECLARE_DLL(WIN87EM)
DECLARE_DLL(MMSYSTEM)
DECLARE_DLL(SHELL)
DECLARE_DLL(SOUND)
DECLARE_DLL(KEYBOARD)
DECLARE_DLL(WINSOCK)
DECLARE_DLL(STRESS)
DECLARE_DLL(SYSTEM)
DECLARE_DLL(TOOLHELP)
DECLARE_DLL(MOUSE)
DECLARE_DLL(COMMDLG)
DECLARE_DLL(OLE2)
DECLARE_DLL(OLE2CONV)
DECLARE_DLL(OLE2DISP)
DECLARE_DLL(OLE2NLS)
DECLARE_DLL(OLE2PROX)
DECLARE_DLL(OLECLI)
DECLARE_DLL(OLESVR)
DECLARE_DLL(COMPOBJ)
DECLARE_DLL(STORAGE)
DECLARE_DLL(WINPROCS)
DECLARE_DLL(DDEML)
#define N_BUILTINS 25
#endif /* DLLS_H */
extern struct dll_table_s dll_builtin_table[];
#endif /* DLLS_H */
......@@ -32,6 +32,7 @@ extern void DOS_closedir(struct dosdirent *de);
extern void DOS_ExpandToFullPath(char *filename, int drive);
extern void DOS_ExpandToFullUnixPath(char *filename);
extern char *DOS_GetRedirectedDir(int drive);
extern void errno_to_doserr(void);
extern char WindowsPath[256];
......
#ifndef __WINE_IF1632_H
#define __WINE_IF1632_H
#include <wintypes.h>
extern int CallToInit16(unsigned long csip, unsigned long sssp,
unsigned short ds);
extern int CallTo16cx(unsigned long csip, unsigned long dscx);
extern int CallToDllEntry(unsigned long csip, unsigned long dscx, unsigned short di);
extern void winestat(void);
extern struct dll_table_s *FindDLLTable(char *dll_name);
extern int FindOrdinalFromName(struct dll_table_entry_s *dll_table, char *func_name);
extern int ReturnArg(int arg);
extern BOOL RELAY_Init(void);
#endif /* __WINE_IF1632_H */
......@@ -45,7 +45,7 @@ extern ldt_copy_entry ldt_copy[LDT_SIZE];
#define __AHSHIFT 3
#define __AHINCR (1 << __AHSHIFT)
#define SELECTOR_TO_ENTRY(sel) ((int)(sel) >> __AHSHIFT)
#define SELECTOR_TO_ENTRY(sel) (((int)(sel) & 0xffff) >> __AHSHIFT)
#define ENTRY_TO_SELECTOR(i) ((i) ? (((int)(i) << __AHSHIFT) | 7) : 0)
#define IS_LDT_ENTRY_FREE(i) (!(ldt_copy[(i)].base || ldt_copy[(i)].limit))
#define IS_SELECTOR_FREE(sel) (IS_LDT_ENTRY_FREE(SELECTOR_TO_ENTRY(sel)))
......
#ifndef __WINE_LIBRARY_H
#define __WINE_LIBRARY_H
extern HINSTANCE hInstMain;
extern HINSTANCE hSysRes;
extern struct w_files *GetFileInfo(unsigned short instance);
extern int IsDLLLoaded(char *name);
extern void InitDLL(struct w_files *wpnt);
extern void InitializeLoadedDLLs(struct w_files *wpnt);
extern HINSTANCE LoadImage(char *module, int filetype, int change_dir);
extern struct dll_name_table_entry_s dll_builtin_table[];
#endif /* __WINE_LIBRARY_H */
/*
* List Box definitions
* Listbox definitions
*/
typedef struct tagLISTSTRUCT {
DRAWITEMSTRUCT dis;
HANDLE hMem;
MEASUREITEMSTRUCT mis;
UINT itemState;
RECT itemRect;
HANDLE hData;
char *itemText;
char *itemText;
struct tagLISTSTRUCT *lpNext;
} LISTSTRUCT;
typedef LISTSTRUCT FAR* LPLISTSTRUCT;
} LISTSTRUCT, *LPLISTSTRUCT;
typedef struct tagHEADLIST {
UINT FirstVisible;
UINT ItemsCount;
short ItemsVisible;
short ColumnsVisible;
short ItemsPerColumn;
short ItemFocused;
short PrevFocused;
short StdItemHeight;
short ColumnsWidth;
short DrawCtlType;
void *lpFirst;
DWORD dwStyle;
HWND hWndLogicParent;
HFONT hFont;
BOOL bRedrawFlag;
typedef struct {
WORD FirstVisible;
WORD ItemsCount;
WORD ItemsVisible;
WORD ColumnsVisible;
WORD ItemsPerColumn;
short ItemFocused;
short PrevFocused;
WORD StdItemHeight;
WORD ColumnsWidth;
WORD DrawCtlType;
WORD CtlID;
LPLISTSTRUCT lpFirst;
DWORD dwStyle;
HWND hParent;
HFONT hFont;
BOOL bRedrawFlag;
WORD iNumStops;
LPINT TabStops;
HANDLE hDrawItemStruct;
/* MDESC *Heap; */
} HEADLIST;
typedef HEADLIST FAR* LPHEADLIST;
BOOL needMeasure;
/* MDESC *Heap; */
} HEADLIST,*LPHEADLIST;
/* shared code between listbox and combo controls */
extern void CreateListBoxStruct(HWND hwnd, WORD CtlType, LONG styles, HWND parent);
extern void DestroyListBoxStruct(LPHEADLIST lphl);
extern void ListBoxSendNotification(LPHEADLIST lphl,HWND hwnd, WORD code);
extern BOOL OWNER_DRAWN(LPHEADLIST lphl);
extern BOOL HasStrings(LPHEADLIST lphl);
extern LPLISTSTRUCT ListBoxGetItem(LPHEADLIST lphl, UINT uIndex);
extern int ListMaxFirstVisible(LPHEADLIST lphl);
extern int ListBoxScrollToFocus(LPHEADLIST lphl);
extern int ListBoxAddString(LPHEADLIST lphl, LPSTR newstr);
extern int ListBoxInsertString(LPHEADLIST lphl, UINT uIndex, LPSTR newstr);
extern int ListBoxGetText(LPHEADLIST lphl, UINT uIndex, LPSTR OutStr);
extern DWORD ListBoxGetItemData(LPHEADLIST lphl, UINT uIndex);
extern int ListBoxSetItemData(LPHEADLIST lphl, UINT uIndex, DWORD ItemData);
extern int ListBoxDeleteString(LPHEADLIST lphl, UINT uIndex);
extern int ListBoxFindString(LPHEADLIST lphl, UINT nFirst, SEGPTR MatchStr);
extern int ListBoxResetContent(LPHEADLIST lphl);
extern int ListBoxSetCurSel(LPHEADLIST lphl, WORD wIndex);
extern int ListBoxSetSel(LPHEADLIST lphl, WORD wIndex, WORD state);
extern int ListBoxGetSel(LPHEADLIST lphl, WORD wIndex);
extern int ListBoxDirectory(LPHEADLIST lphl, UINT attrib, LPSTR filespec);
extern int ListBoxGetItemRect(LPHEADLIST lphl, WORD wIndex, LPRECT rect);
extern int ListBoxSetItemHeight(LPHEADLIST lphl, WORD wIndex, long height);
extern int ListBoxFindNextMatch(LPHEADLIST lphl, WORD wChar);
extern void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC hdc,
LPLISTSTRUCT lpls, RECT *rect, WORD itemAction,
WORD itemState);
extern int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y);
extern void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls);
......@@ -232,11 +232,11 @@ typedef WAVEINCAPS FAR *LPWAVEINCAPS;
/* general format structure common to all formats */
typedef struct {
WORD wFormatTag; /* format type */
WORD nChannels; /* number of channels (i.e. mono, stereo, etc.) */
DWORD nSamplesPerSec; /* sample rate */
DWORD nAvgBytesPerSec; /* for buffer estimation */
WORD nBlockAlign; /* block size of data */
WORD wFormatTag; /* format type */
WORD nChannels; /* number of channels */
DWORD nSamplesPerSec WINE_PACKED; /* sample rate */
DWORD nAvgBytesPerSec WINE_PACKED; /* for buffer estimation */
WORD nBlockAlign; /* block size of data */
} WAVEFORMAT;
typedef WAVEFORMAT FAR *LPWAVEFORMAT;
......
......@@ -44,7 +44,7 @@ typedef struct
WORD truetype; /* Set to 2 if TrueType font */
BYTE os_flags; /* Operating system flags */
BYTE misc_flags; /* Misc. flags */
WORD reserved; /* Same value as import_table */
HANDLE dlls_to_init; /* List of DLLs to initialize */
HANDLE nrname_handle; /* Handle to non-resident name table in memory */
WORD min_swap_area; /* Min. swap area size */
WORD expected_version; /* Expected Windows version */
......@@ -71,6 +71,14 @@ typedef struct
WORD selector; /* Selector of segment in memory */
} SEGTABLEENTRY;
/* Parameters for LoadModule() */
typedef struct
{
HANDLE hEnvironment; /* Environment segment */
SEGPTR cmdLine; /* Command-line */
SEGPTR showCmd; /* Code for ShowWindow() */
SEGPTR reserved;
} LOADPARAMS;
#define NE_SEG_TABLE(pModule) \
((SEGTABLEENTRY *)((char *)(pModule) + (pModule)->seg_table))
......@@ -87,6 +95,11 @@ extern int MODULE_OpenFile( HMODULE hModule );
extern LPSTR MODULE_GetModuleName( HMODULE hModule );
extern WORD MODULE_GetOrdinal( HMODULE hModule, char *name );
extern DWORD MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal );
extern void MODULE_FixupPrologs( HMODULE hModule );
extern BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset );
extern LPSTR MODULE_GetEntryPointName( HMODULE hModule, WORD ordinal );
extern BOOL NE_LoadSegment( HMODULE hModule, WORD segnum );
extern void NE_FixupPrologs( HMODULE hModule );
extern void NE_InitializeDLLs( HMODULE hModule );
#endif /* _WINE_MODULE_H */
#ifndef __WINE_NE_IMAGE_H
#define __WINE_NE_IMAGE_H
extern int NE_FixupSegment(struct w_files *wpnt, int segment_num);
extern int NE_unloadImage(struct w_files *wpnt);
extern int NE_StartProgram( HMODULE hModule );
extern BOOL NE_InitDLL( HMODULE hModule );
extern HINSTANCE NE_LoadImage(struct w_files *wpnt);
#endif /* __WINE_NE_IMAGE_H */
......@@ -19,6 +19,7 @@ struct options
int debug;
int allowReadOnly; /* Opening a read only file will succeed even
if write access is requested */
int enhanced; /* Start Wine in enhanced mode */
};
extern struct options Options;
......
......@@ -7,4 +7,18 @@ extern void PE_InitDLL(struct w_files *wpnt);
extern HINSTANCE PE_LoadImage(struct w_files *wpnt);
extern void my_wcstombs(char * result, u_short * source, int len);
typedef struct _WIN32_function{
char *name;
void *definition;
} WIN32_function;
typedef struct _WIN32_builtin{
char *name;
WIN32_function *functions;
int size;
struct _WIN32_builtin *next;
} WIN32_builtin;
extern WIN32_builtin *WIN32_builtin_list;
#endif /* __WINE_PE_IMAGE_H */
......@@ -138,9 +138,10 @@ struct pe_segment_table
struct PE_Import_Directory
{
u_int Import_List;
u_int reserved[2];
u_int TimeDate;
u_int Forwarder;
u_int ModuleName;
u_int reserved1;
u_int Thunk_List;
};
struct pe_import_name
......
......@@ -8,8 +8,6 @@
#include <sys/types.h>
#include "neexe.h"
#include "msdos.h"
#include "windows.h"
#ifndef WINELIB
......@@ -26,20 +24,11 @@ extern void wine_debug(int signal, int * regs);
/* loader/wine.c */
extern void myerror(const char *s);
extern char *GetFilenameFromInstance(unsigned short instance);
extern HINSTANCE LoadImage(char *modulename, int filetype, int change_dir);
extern int _WinMain(int argc, char **argv);
extern void InitializeLoadedDLLs();
/* misc/spy.c */
extern void SpyInit(void);
/* controls/widget.c */
extern BOOL WIDGETS_Init(void);
#endif /* WINELIB */
#endif /* _WINE_PROTOTYPES_H */
......@@ -16,16 +16,8 @@ extern WORD SELECTOR_ReallocBlock( WORD sel, void *base, DWORD size,
enum seg_type type, BOOL is32bit,
BOOL readonly );
#include "dlls.h"
extern void CreateSelectors(void);
extern unsigned int GetEntryDLLName(char *dll_name, char *function,
WORD *sel, WORD *offset);
extern unsigned int GetEntryDLLOrdinal(char *dll_name, int ordinal,
WORD *sel, WORD *offset);
extern void InitSelectors(void);
extern WNDPROC GetWndProcEntry16( char *name );
#endif /* __WINE_SELECTORS_H */
......@@ -54,11 +54,17 @@ extern WORD IF1632_Saved16_sp;
/* Saved 32-bit stack */
extern DWORD IF1632_Saved32_esp;
extern SEGPTR IF1632_Stack32_base;
#define CURRENT_STACK16 \
((STACK16FRAME *)PTR_SEG_OFF_TO_LIN(IF1632_Saved16_ss,IF1632_Saved16_sp))
#define CURRENT_DS (CURRENT_STACK16->ds)
/* Make a segmented pointer from a pointer to a variable located */
/* on the 32-bit stack for the current task. */
#define MAKE_SEGPTR(ptr) \
((SEGPTR)IF1632_Stack32_base + \
((DWORD)(ptr) - (DWORD)PTR_SEG_TO_LIN(IF1632_Stack32_base)))
#endif /* WINE_STACKFRAME_H */
......@@ -58,13 +58,13 @@ typedef struct
BYTE unused1;
HGLOBAL hStack32; /* Handle to 32-bit stack */
WORD hSelf; /* Selector of this TDB */
WORD unused3;
HANDLE hPrevInstance; /* Previous instance of the module */
DWORD esp; /* 32-bit stack pointer */
WORD ctrlword8087; /* 80x87 control word */
WORD flags; /* Task flags */
WORD error_flags; /* Error handling flags */
WORD version; /* Expected Windows version */
HANDLE hInstance; /* Instance handle for this task */
HANDLE hInstance; /* Instance handle for this task */
HMODULE hModule; /* Module handle */
HANDLE hQueue; /* Selector of task message queue */
HTASK hParent; /* Selector of TDB of parent task */
......@@ -85,7 +85,7 @@ typedef struct
DWORD dta WINE_PACKED; /* Current DTA */
BYTE curdrive; /* Current drive */
BYTE curdir[65]; /* Current directory */
WORD unused5;
WORD nCmdShow; /* cmdShow parameter to WinMain */
HTASK hYieldTo; /* Next task to schedule */
DWORD dlls_to_init; /* Ptr to list of DLL to initialize */
HANDLE hCSAlias; /* Code segment alias for this TDB */
......@@ -108,6 +108,10 @@ typedef struct
#pragma pack(4)
#endif
extern HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance,
HANDLE hPrevInstance, HANDLE hEnvironment,
char *cmdLine, WORD cmdShow );
/* TASK_Reschedule() 16-bit entry point */
extern FARPROC RELAY_RescheduleProcAddr;
......
/*
* texts.h - String constants are read from Xresources/app-defaults
* (c) 1994 Jochen Hein ( Hein@Student.TU-Clausthal.de )
*/
/*
* Type-description for buttons
*/
typedef struct tButtonDesc {
char *Label; /* Label of the Button */
char Hotkey; /* Hotkey to press this Button */
} ButtonDesc;
typedef struct tButtonTexts {
ButtonDesc Yes;
ButtonDesc No;
ButtonDesc Ok;
ButtonDesc Cancel;
ButtonDesc Abort;
ButtonDesc Retry;
ButtonDesc Ignore;
} ButtonTexts;
......@@ -3,7 +3,7 @@
#ifndef WINDOWS_H
#define WINDOWS_H
#include <wintypes.h>
#include "wintypes.h"
#ifndef WINELIB
#pragma pack(1)
......@@ -48,8 +48,6 @@ typedef PAINTSTRUCT *LPPAINTSTRUCT;
/* Window classes */
typedef LONG (*WNDPROC)(HWND, UINT, WPARAM, LPARAM);
typedef struct {
WORD style;
WNDPROC lpfnWndProc WINE_PACKED;
......@@ -700,6 +698,10 @@ typedef struct
#define TT_AVAILABLE 0x0001
#define TT_ENABLED 0x0002
/* Get/SetSystemPaletteUse() values */
#define SYSPAL_STATIC 1
#define SYSPAL_NOSTATIC 2
typedef struct tagPALETTEENTRY
{
BYTE peRed, peGreen, peBlue, peFlags;
......@@ -1313,6 +1315,12 @@ typedef struct tagCOMSTAT
#define OBM_RGARROWI 32735
#define OBM_LFARROWI 32734
#define OBM_FOLDER 32733
#define OBM_FOLDER2 32732
#define OBM_FLOPPY 32731
#define OBM_HDISK 32730
#define OBM_CDROM 32729
#define OBM_OLD_CLOSE 32767
#define OBM_SIZE 32766
#define OBM_OLD_UPARROW 32765
......@@ -1346,6 +1354,9 @@ typedef struct tagCOMSTAT
#define OIC_QUES 32514
#define OIC_BANG 32515
#define OIC_NOTE 32516
#define OIC_PORTRAIT 32517
#define OIC_LANDSCAPE 32518
#define OIC_WINEICON 32519
/* Stock GDI objects for GetStockObject() */
......@@ -2131,6 +2142,8 @@ typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
#define GMEM_DDESHARE 0x2000
#define GMEM_NOTIFY 0x4000
#define GMEM_LOWER GMEM_NOT_BANKED
#define GMEM_DISCARDED 0x4000
#define GMEM_LOCKCOUNT 0x00ff
#define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
#define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
......@@ -2310,20 +2323,20 @@ typedef METAFILEPICT *LPMETAFILEPICT;
#define F(ret,name) ret name(void);
#define Fa(ret,name,t1,a1) ret name(t1 a1);
#define Fb(ret,name,t1,a1,t2,a2) ret name(t1 a1,t2 a2);
#define Fc(ret,name,t1,a1,t2,a2,t3,a3) ret name(t1 a1,t2 a2,t3 a3);
#define Fd(ret,name,t1,a1,t2,a2,t3,a3,t4,a4) ret name(t1 a1,t2 a2,t3 a3,t4 a4);
#define Fe(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) ret name( t1 a1,t2 a2,t3 a3,t4 a4,t5 a5);
#define Ff(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6);
#define Fg(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) ret name( t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7);
#define Fh(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8);
#define Fi(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9);
#define Fj(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10);
#define Fk(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11) ret name (t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11);
#define Fl(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12);
#define Fm(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12,t13,a13) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12,t13 a13);
#define Fn(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12,t13,a13,t14,a14) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12,t13 a13,t14 a14);
#define Fa(ret,name,t1,a1) ret name(t1);
#define Fb(ret,name,t1,a1,t2,a2) ret name(t1,t2);
#define Fc(ret,name,t1,a1,t2,a2,t3,a3) ret name(t1,t2,t3);
#define Fd(ret,name,t1,a1,t2,a2,t3,a3,t4,a4) ret name(t1,t2,t3,t4);
#define Fe(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5) ret name(t1,t2,t3,t4,t5);
#define Ff(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6) ret name(t1,t2,t3,t4,t5,t6);
#define Fg(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) ret name(t1,t2,t3,t4,t5,t6,t7);
#define Fh(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8) ret name(t1,t2,t3,t4,t5,t6,t7,t8);
#define Fi(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9) ret name(t1,t2,t3,t4,t5,t6,t7,t8,t9);
#define Fj(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10) ret name(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10);
#define Fk(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11) ret name(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11);
#define Fl(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12) ret name(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12);
#define Fm(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12,t13,a13) ret name(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13);
#define Fn(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12,t13,a13,t14,a14) ret name(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14);
int wsprintf(LPSTR a,LPSTR b,...);
......@@ -2459,7 +2472,7 @@ Fa(HANDLE,GetMetaFileBits,HANDLE,a)
Fa(HANDLE,GetModuleHandle,LPCSTR,a)
Fa(HANDLE,GetStockObject,int,a)
Fa(HANDLE,GetWindowTask,HWND,a)
Fa(HANDLE,LoadLibrary,LPSTR,a)
Fa(HANDLE,LoadLibrary,LPCSTR,a)
Fa(HANDLE,LocalFree,HANDLE,a)
Fa(HANDLE,LocalHandle,WORD,a)
Fa(HANDLE,SetMetaFileBits,HANDLE,a)
......@@ -2528,6 +2541,7 @@ Fa(WORD,GetPolyFillMode,HDC,a)
Fa(WORD,GetROP2,HDC,a)
Fa(WORD,GetRelAbs,HDC,a)
Fa(WORD,GetStretchBltMode,HDC,a)
Fa(WORD,GetSystemPaletteUse,HDC,a)
Fa(WORD,GetTextAlign,HDC,a)
Fa(WORD,GlobalDOSFree,WORD,a)
Fa(WORD,GlobalFlags,HGLOBAL,a)
......@@ -2644,7 +2658,7 @@ Fb(FARPROC,SetWindowsHook,short,a,FARPROC,b)
Fb(HANDLE,CopyMetaFile,HANDLE,a,LPSTR,b)
Fb(HANDLE,GetProp,HWND,a,SEGPTR,b)
Fb(HANDLE,LoadAccelerators,HANDLE,a,SEGPTR,b)
Fb(HANDLE,LoadModule,LPSTR,a,LPVOID,b)
Fb(HANDLE,LoadModule,LPCSTR,a,LPVOID,b)
Fb(HANDLE,LoadResource,HANDLE,a,HANDLE,b)
Fb(HANDLE,LocalAlloc,WORD,a,WORD,b)
Fb(HANDLE,RemoveProp,HWND,a,SEGPTR,b)
......@@ -2689,7 +2703,6 @@ Fb(WORD,GetCommEventMask,int,a,int,b)
Fb(WORD,GetMenuItemID,HMENU,a,int,b)
Fb(WORD,GetNearestPaletteIndex,HPALETTE,a,DWORD,b)
Fb(WORD,GetSystemDirectory,LPSTR,a,WORD,b)
Fb(WORD,GetSystemPaletteUse,HDC,a,WORD,b)
Fb(WORD,GetWindowWord,HWND,a,short,b)
Fb(WORD,GetWindowsDirectory,LPSTR,a,WORD,b)
Fb(WORD,IsDlgButtonChecked,HWND,a,WORD,b)
......@@ -2803,6 +2816,8 @@ Fc(INT,GetTextFace,HDC,a,INT,b,LPSTR,c)
Fc(INT,OpenFile,LPSTR,a,LPOFSTRUCT,b,WORD,c)
Fc(INT,_lread,INT,a,LPSTR,b,WORD,c)
Fc(INT,_lwrite,INT,a,LPSTR,b,WORD,c)
Fc(LONG,_hread,INT,a,LPSTR,b,LONG,c)
Fc(LONG,_hwrite,INT,a,LPSTR,b,LONG,c)
Fc(LONG,GetBitmapBits,HBITMAP,a,LONG,b,LPSTR,c)
Fc(LONG,SetBitmapBits,HBITMAP,a,LONG,b,LPSTR,c)
Fc(LONG,SetClassLong,HWND,a,short,b,LONG,c)
......@@ -2980,7 +2995,7 @@ Fi(BOOL,Chord,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,ySt
Fi(BOOL,GrayString,HDC,a,HBRUSH,b,FARPROC,gsprc,LPARAM,lParam,INT,cch,INT,x,INT,y,INT,cx,INT,cy)
Fi(BOOL,Pie,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
Fk(BOOL,StretchBlt,HDC,a,short,b,short,c,short,d,short,e,HDC,f,short,g,short,h,short,i,short,j,DWORD,k)
Fk(HWND,CreateWindow,LPSTR,szAppName,LPSTR,Label,DWORD,ol,short,x,short,y,short,w,short,h,HWND,d,HMENU,e,,HANDLE i,SEGPTR,g)
Fk(HWND,CreateWindow,LPSTR,a,LPSTR,b,DWORD,c,short,d,short,e,short,f,short,g,HWND,h,HMENU,i,HANDLE,j,SEGPTR,k)
Fl(HWND,CreateWindowEx,DWORD,a,LPSTR,b,LPSTR,c,DWORD,d,short,e,short,f,short,g,short,h,HWND,i,HMENU,j,HANDLE,k,SEGPTR,l)
Fl(int,SetDIBitsToDevice,HDC,a,short,b,short,c,WORD,d,WORD,e,WORD,f,WORD,g,WORD,h,WORD,i,LPSTR,j,LPBITMAPINFO,k,WORD,l)
Fm(int,StretchDIBits,HDC,a,WORD,b,WORD,c,WORD,d,WORD,e,WORD,f,WORD,g,WORD,h,WORD,i,LPSTR,j,LPBITMAPINFO,k,WORD,l,DWORD,m)
......
......@@ -36,7 +36,15 @@ struct sigcontext_struct {
#define WINE_CODE_SELECTOR 0x23
#endif /* linux */
#if defined(__NetBSD__) || defined(__FreeBSD__)
#ifdef __NetBSD__
#include <signal.h>
#define sigcontext_struct sigcontext
#define HZ 100
#define WINE_DATA_SELECTOR 0x1f
#define WINE_CODE_SELECTOR 0x17
#endif
#ifdef __FreeBSD__
#include <signal.h>
#define sigcontext_struct sigcontext
#define HZ 100
......
extern int WIN32_LastError;
#define ERROR_CALL_NOT_IMPLEMENTED 120
......@@ -25,8 +25,10 @@ typedef LONG *LPLONG;
typedef void *LPVOID;
#ifdef WINELIB
typedef long (*FARPROC)();
typedef LONG (*WNDPROC)(WORD,WORD,WORD,LONG);
#else
typedef SEGPTR FARPROC;
typedef SEGPTR WNDPROC;
#endif
typedef FARPROC DLGPROC;
typedef int CATCHBUF[9];
......@@ -69,9 +71,8 @@ DECLARE_HANDLE(LOCALHANDLE);
#define WINAPI PASCAL
#define CALLBACK PASCAL
#ifndef NULL
#define NULL (0)
#endif
#undef NULL
#define NULL 0
#ifdef WINELIB
#define WINE_PACKED
......@@ -85,6 +86,9 @@ DECLARE_HANDLE(LOCALHANDLE);
#define LOWORD(l) ((WORD)(DWORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define SLOWORD(l) ((INT)(LONG)(l))
#define SHIWORD(l) ((INT)((LONG)(l) >> 16))
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
......
......@@ -13,7 +13,6 @@ SRCS = \
pe_resource.c \
selector.c \
signal.c \
library.c \
resource.c \
task.c
......
......@@ -180,33 +180,19 @@ void LDT_Print()
}
#else /* WINELIB */
#ifdef linux
long buffer[2*LDT_SIZE];
ldt_entry content;
int n;
modify_ldt( 0, buffer, sizeof(buffer) );
for (i = 0; i < LDT_SIZE; i++)
{
LDT_BytesToEntry( &buffer[2*i], &content );
if (content.base || content.limit)
{
fprintf( stderr, "%04x: sel=%04x base=%08lx limit=%05lx %s type=%d\n",
i, ENTRY_TO_SELECTOR(i),
content.base, content.limit,
content.limit_in_pages ? "(pages)" : "(bytes)",
content.type );
}
}
#ifdef linux
n = modify_ldt( 0, buffer, sizeof(buffer) ) / 8;
#endif /* linux */
#if defined(__NetBSD__) || defined(__FreeBSD__)
long buffer[2*LDT_SIZE];
ldt_entry content;
i386_get_ldt( 0, (union descriptor *)buffer, LDT_SIZE );
for (i = 0; i < LDT_SIZE; i++)
n = i386_get_ldt( 0, (union descriptor *)buffer, LDT_SIZE );
#endif /* __NetBSD__ || __FreeBSD__ */
for (i = 0; i < n; i++)
{
LDT_BytesToEntry( buffer[2*i], &content );
LDT_BytesToEntry( &buffer[2*i], &content );
if (content.base || content.limit)
{
fprintf( stderr, "%04x: sel=%04x base=%08lx limit=%05lx %s type=%d\n",
......@@ -216,6 +202,5 @@ void LDT_Print()
content.type );
}
}
#endif /* __NetBSD__ || __FreeBSD__ */
#endif /* WINELIB */
}
/*
* Module & Library functions
static char Copyright[] = "Copyright 1993, 1994 Martin Ayotte, Robert J. Amstadt, Erik Bos";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "neexe.h"
#include "dlls.h"
#include "if1632.h"
#include "wineopts.h"
#include "arch.h"
#include "options.h"
#include "dos_fs.h"
#include "windows.h"
#include "task.h"
#include "toolhelp.h"
#include "selectors.h"
#include "prototypes.h"
#include "library.h"
#include "ne_image.h"
#include "pe_image.h"
#include "module.h"
#include "stddebug.h"
#include "debug.h"
struct w_files *wine_files = NULL;
static char *DLL_Extensions[] = { "dll", NULL };
static char *EXE_Extensions[] = { "exe", NULL };
#define IS_BUILTIN_DLL(handle) ((handle >> 8) == 0xff)
/**********************************************************************/
void ExtractDLLName(char *libname, char *temp)
{
int i;
strcpy(temp, libname);
if (strchr(temp, '\\') || strchr(temp, '/'))
for (i = strlen(temp) - 1; i ; i--)
if (temp[i] == '\\' || temp[i] == '/') {
strcpy(temp, temp + i + 1);
break;
}
for (i = strlen(temp) - 1; i ; i--)
if (temp[i] == '.') {
temp[i] = 0;
break;
}
}
struct w_files *GetFileInfo(unsigned short instance)
{
register struct w_files *w = wine_files;
while (w && w->hinstance != instance)
w = w->next;
return w;
}
/*
int IsDLLLoaded(char *name)
{
struct w_files *wpnt;
if(FindDLLTable(name))
return 1;
for(wpnt = wine_files; wpnt; wpnt = wpnt->next)
if(strcmp(wpnt->name, name) == 0 )
return 1;
return 0;
}
*/
void InitDLL(struct w_files *wpnt)
{
if (wpnt->ne)
NE_InitDLL(wpnt->hModule);
else
PE_InitDLL(wpnt);
}
void InitializeLoadedDLLs(struct w_files *wpnt)
{
static flagReadyToRun = 0;
struct w_files *final_wpnt;
dprintf_module(stddeb,"InitializeLoadedDLLs(%p)\n", wpnt);
if (wpnt == NULL)
{
flagReadyToRun = 1;
dprintf_module(stddeb,"Initializing DLLs\n");
}
if (!flagReadyToRun)
return;
#if 1
if (wpnt != NULL)
dprintf_module(stddeb,"Initializing %s\n", wpnt->name);
#endif
/*
* Initialize libraries
*/
if (!wpnt)
{
wpnt = wine_files;
final_wpnt = NULL;
}
else
{
final_wpnt = wpnt->next;
}
for( ; wpnt != final_wpnt; wpnt = wpnt->next)
InitDLL(wpnt);
}
/**********************************************************************
* LoadImage
* Load one executable into memory
*/
HINSTANCE LoadImage(char *module, int filetype, int change_dir)
{
HINSTANCE handle;
struct w_files *wpnt, *wpnt1;
char buffer[256], header[2], modulename[64], *fullname;
ExtractDLLName(module, modulename);
dprintf_module(stddeb,"LoadImage [%s]\n", module);
/* built-in one ? */
if (FindDLLTable(modulename)) {
return GetModuleHandle(modulename);
}
/* already loaded ? */
for (wpnt = wine_files ; wpnt ; wpnt = wpnt->next) {
if (strcasecmp(wpnt->name, modulename) == 0 && filetype == wpnt->type) {
return wpnt->hinstance;
}
}
/*
* search file
*/
fullname = DOS_FindFile(buffer, sizeof(buffer), module,
(filetype == EXE ? EXE_Extensions : DLL_Extensions),
WindowsPath);
if (fullname == NULL)
{
fprintf(stderr, "LoadImage: I can't find %s.dll | %s.exe !\n",
module, module);
return 2;
}
fullname = DOS_GetDosFileName(fullname);
dprintf_module(stddeb,"LoadImage: loading %s (%s)\n [%s]\n",
module, buffer, fullname);
if (change_dir && fullname)
{
char dirname[256];
char *p;
strcpy(dirname, fullname);
p = strrchr(dirname, '\\');
*p = '\0';
DOS_SetDefaultDrive(dirname[0] - 'A');
DOS_ChangeDir(dirname[0] - 'A', dirname + 2);
}
/* First allocate a spot to store the info we collect, and add it to
* our linked list if we could load the file.
*/
wpnt = (struct w_files *) malloc(sizeof(struct w_files));
/*
* Open file for reading.
*/
wpnt->fd = open(buffer, O_RDONLY);
if (wpnt->fd < 0)
return 2;
/*
* Establish header pointers.
*/
wpnt->filename = strdup(buffer);
wpnt->name = strdup(modulename);
wpnt->type = filetype;
wpnt->initialised = FALSE;
/* read mz header */
wpnt->mz_header = (struct mz_header_s *) malloc(sizeof(struct mz_header_s));;
lseek(wpnt->fd, 0, SEEK_SET);
if (read(wpnt->fd, wpnt->mz_header, sizeof(struct mz_header_s)) !=
sizeof(struct mz_header_s))
{
fprintf(stderr, "Unable to read MZ header from file '%s'\n", buffer);
exit(1);
}
/* This field is ignored according to "Windows Internals", p.242 */
#if 0
if (wpnt->mz_header->must_be_0x40 != 0x40)
myerror("This is not a Windows program");
#endif
/* read first two bytes to determine filetype */
lseek(wpnt->fd, wpnt->mz_header->ne_offset, SEEK_SET);
read(wpnt->fd, &header, sizeof(header));
handle = 0;
/*
* Stick this file into the list of loaded files so we don't try to reload
* it again if another module references this module. Do this before
* calling NE_LoadImage because we might get back here before NE_loadImage
* returns.
*/
if(wine_files == NULL)
wine_files = wpnt;
else {
wpnt1 = wine_files;
while(wpnt1->next)
wpnt1 = wpnt1->next;
wpnt1->next = wpnt;
}
wpnt->next = NULL;
if (header[0] == 'N' && header[1] == 'E')
handle = NE_LoadImage(wpnt);
if (header[0] == 'P' && header[1] == 'E')
handle = PE_LoadImage(wpnt);
wpnt->hinstance = handle;
if (handle > 32) {
return handle;
} else {
fprintf(stderr, "wine: (%s) unknown fileformat !\n", wpnt->filename);
/* Remove this module from the list of loaded modules */
if (wine_files == wpnt)
wine_files = NULL;
else
wpnt1->next = NULL;
close(wpnt->fd);
free(wpnt->filename);
free(wpnt->name);
free(wpnt);
return 14;
}
}
/**********************************************************************
* LoadLibrary [KERNEL.95]
*/
HANDLE LoadLibrary(LPSTR libname)
{
HANDLE h;
dprintf_module(stddeb,"LoadLibrary: (%08x) %s\n",(int)libname,libname);
if ((h = LoadImage(libname, DLL, 0)) < 32)
return h;
if (!IS_BUILTIN_DLL(h))
InitDLL(GetFileInfo(h));
return h;
}
/**********************************************************************
* FreeLibrary [KERNEL.96]
*/
void FreeLibrary(HANDLE hLib)
{
dprintf_module(stddeb,"FreeLibrary(%04X);\n", hLib);
/* built-in dll ? */
if (IS_BUILTIN_DLL(hLib) || hLib == 0 || hLib == hSysRes)
return;
/*
while (lpMod != NULL) {
if (lpMod->hInst == hLib) {
if (lpMod->Count == 1) {
wpnt = GetFileInfo(hLib);
if (wpnt->ne)
NE_UnloadImage(wpnt);
else
PE_UnloadImage(wpnt);
if (hLib != (HANDLE)NULL) GlobalFree(hLib);
if (lpMod->ModuleName != NULL) free(lpMod->ModuleName);
if (lpMod->FileName != NULL) free(lpMod->FileName);
GlobalFree(lpMod->hModule);
dprintf_module(stddeb,"FreeLibrary // freed !\n");
return;
}
lpMod->Count--;
dprintf_module(stddeb,"FreeLibrary // Count decremented !\n");
return;
}
lpMod = lpMod->lpNextModule;
}
*/
}
/***********************************************************************
* GetProcAddress (KERNEL.50)
*/
FARPROC GetProcAddress( HANDLE hModule, SEGPTR name )
{
WORD ordinal;
SEGPTR ret;
if (!hModule) hModule = GetCurrentTask();
hModule = GetExePtr( hModule );
if (HIWORD(name) != 0)
{
ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
dprintf_module( stddeb, "GetProcAddress: %04x '%s'\n",
hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
}
else
{
ordinal = LOWORD(name);
dprintf_module( stddeb, "GetProcAddress: %04x %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
dprintf_module( stddeb, "GetProcAddress: returning %08lx\n", ret );
return (FARPROC)ret;
}
......@@ -13,44 +13,23 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "neexe.h"
#include "dos_fs.h"
#include "dlls.h"
#include "library.h"
#include "windows.h"
#include "wineopts.h"
#include "wine.h"
#include "task.h"
#include "prototypes.h"
#include "options.h"
#include "if1632.h"
#include "ne_image.h"
#include "pe_image.h"
#include "stddebug.h"
#include "debug.h"
char **Argv;
int Argc;
HINSTANCE hSysRes, hInstMain;
unsigned short WIN_StackSize;
/**********************************************************************
* myerror
*/
void
myerror(const char *s)
{
if (s == NULL)
perror("wine");
else
fprintf(stderr, "wine: %s\n", s);
exit(1);
}
/***********************************************************************
* Main initialisation routine
*/
int MAIN_Init(void)
{
extern BOOL RELAY_Init(void);
int queueSize;
SpyInit();
......@@ -58,6 +37,9 @@ int MAIN_Init(void)
/* Initialize relay code */
if (!RELAY_Init()) return 0;
/* Initialize Win32 relay code */
if (!RELAY32_Init()) return 0;
/* Create built-in modules */
if (!MODULE_Init()) return 0;
......@@ -67,6 +49,12 @@ int MAIN_Init(void)
/* Initialize the DOS file system */
DOS_InitFS();
/* Create DOS environment */
CreateSelectors();
/* Initialize signal handling */
init_wine_signals();
/* Initialize communications */
COMM_Init();
......@@ -91,19 +79,12 @@ int MAIN_Init(void)
/* Create the DCEs */
DCE_Init();
/* Initialize built-in window classes */
if (!WIDGETS_Init()) return 0;
/* Initialize dialog manager */
if (!DIALOG_Init()) return 0;
/* Initialize menus */
if (!MENU_Init()) return 0;
/* Create desktop window */
if (!WIN_CreateDesktopWindow()) return 0;
if (!DESKTOP_Init()) return 0;
/* Create system message queue */
queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
......@@ -118,70 +99,20 @@ int MAIN_Init(void)
*/
int _WinMain(int argc, char **argv)
{
char *p, filename[256];
int i;
struct w_files *wpnt;
#ifdef WINESTAT
char * cp;
#endif
if (!MAIN_Init()) return 0;
Argc = argc - 1;
Argv = argv + 1;
if (strchr(Argv[0], '\\') || strchr(Argv[0],'/')) {
for (p = Argv[0] + strlen(Argv[0]); *p != '\\' && *p !='/'; p--)
/* NOTHING */;
strncpy(filename, Argv[0], p - Argv[0]);
filename[p - Argv[0]] = '\0';
strcat(WindowsPath, ";");
if (strchr(filename, '/'))
strcat(WindowsPath, DOS_GetDosFileName(filename));
else
strcat(WindowsPath, filename);
}
for (i = 0; i < Argc; i++)
for (i = 1; i < argc; i++)
{
if (WinExec( argv[i], SW_SHOWNORMAL ) < 32)
{
if ((hInstMain = LoadImage(Argv[i], EXE, 1)) < 32) {
fprintf(stderr, "wine: can't load %s!.\n", Argv[i]);
exit(1);
}
fprintf(stderr, "wine: can't exec '%s'.\n", argv[i]);
exit(1);
}
}
GetPrivateProfileString("wine", "SystemResources", "sysres.dll",
filename, sizeof(filename), WINE_INI);
hSysRes = LoadImage(filename, DLL, 0);
if (hSysRes < 32) {
fprintf(stderr, "wine: can't load %s!.\n", filename);
exit(1);
} else
dprintf_dll(stddeb,"System Resources Loaded // hSysRes='%04X'\n",
hSysRes);
#ifdef WINESTAT
cp = strrchr(argv[0], '/');
if(!cp) cp = argv[0];
else cp++;
if(strcmp(cp,"winestat") == 0) {
winestat();
exit(0);
};
#endif
/*
* Initialize signal handling.
*/
init_wine_signals();
wpnt = GetFileInfo(hInstMain);
if (Options.debug)
wine_debug(0, NULL);
if (Options.debug) wine_debug(0, NULL);
Yield(); /* Start the first task */
fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
......
......@@ -204,8 +204,10 @@ HRSRC NE_FindResource( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
pTypeInfo->count * sizeof(NE_NAMEINFO));
}
}
fprintf( stderr, "FindResource(%04x,%08lx,%08lx): Not found.\n",
hModule, typeId, resId );
fprintf( stderr, "FindResource('%*.*s',%08lx,%08lx): Not found.\n",
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, typeId, resId );
return 0;
}
......
......@@ -21,6 +21,8 @@
#define MAP_ANONYMOUS 0x20
struct w_files *wine_files = NULL;
unsigned int load_addr;
void my_wcstombs(char * result, u_short * source, int len)
......@@ -34,10 +36,15 @@ void my_wcstombs(char * result, u_short * source, int len)
};
}
char * xmmap(char * vaddr, unsigned int v_size, int prot, int flags,
int fd, unsigned int file_offset)
char * xmmap(char * vaddr, unsigned int v_size, unsigned int r_size,
int prot, int flags, int fd, unsigned int file_offset)
{
char * result;
/* .bss has no associated storage in the PE file */
if(r_size)
v_size=r_size;
else
flags |= MAP_ANON;
result = mmap(vaddr, v_size, prot, flags, fd, file_offset);
if((unsigned int) result != 0xffffffff) return result;
......@@ -79,9 +86,10 @@ void dump_exports(struct PE_Export_Directory * pe_exports)
}
}
void dump_imports(struct PE_Import_Directory *pe_imports)
void fixup_imports(struct PE_Import_Directory *pe_imports)
{
struct PE_Import_Directory * pe_imp;
int fixup_failed=0;
/* OK, now dump the import list */
printf("\nDumping imports list\n");
......@@ -90,7 +98,7 @@ void dump_imports(struct PE_Import_Directory *pe_imports)
{
char * Module;
struct pe_import_name * pe_name;
unsigned int * import_list;
unsigned int * import_list, *thunk_list;
char * c;
Module = ((char *) load_addr) + pe_imp->ModuleName;
......@@ -100,15 +108,32 @@ void dump_imports(struct PE_Import_Directory *pe_imports)
import_list = (unsigned int *)
(((unsigned int) load_addr) + pe_imp->Import_List);
thunk_list = (unsigned int *)
(((unsigned int) load_addr) + pe_imp->Thunk_List);
while(*import_list)
{
pe_name = (struct pe_import_name *) ((int) load_addr + *import_list);
if((unsigned)pe_name & 0x80000000)
{
fprintf(stderr,"Import by ordinal not supported\n");
exit(0);
}
printf("--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
*thunk_list=RELAY32_GetEntryPoint(Module,pe_name->Name,pe_name->Hint);
if(!*thunk_list)
{
fprintf(stderr,"No implementation for %s.%d\n",Module, pe_name->Hint);
fixup_failed=1;
}
import_list++;
thunk_list++;
}
pe_imp++;
};
if(fixup_failed)exit(1);
}
static void dump_table(struct w_files *wpnt)
......@@ -155,19 +180,28 @@ HINSTANCE PE_LoadImage(struct w_files *wpnt)
wpnt->pe->pe_header->coff.NumberOfSections);
load_addr = wpnt->pe->pe_header->opt_coff.BaseOfImage;
printf("Load addr is %x\n",load_addr);
dump_table(wpnt);
for(i=0; i < wpnt->pe->pe_header->coff.NumberOfSections; i++)
{
if(!load_addr) {
result = xmmap((char *)0, wpnt->pe->pe_seg[i].Size_Of_Raw_Data, 7,
result = xmmap((char *)0, wpnt->pe->pe_seg[i].Virtual_Size,
wpnt->pe->pe_seg[i].Size_Of_Raw_Data, 7,
MAP_PRIVATE, wpnt->fd, wpnt->pe->pe_seg[i].PointerToRawData);
load_addr = (unsigned int) result - wpnt->pe->pe_seg[i].Virtual_Address;
} else {
result = xmmap((char *) load_addr + wpnt->pe->pe_seg[i].Virtual_Address,
wpnt->pe->pe_seg[i].Virtual_Size,
wpnt->pe->pe_seg[i].Size_Of_Raw_Data, 7, MAP_PRIVATE | MAP_FIXED,
wpnt->fd, wpnt->pe->pe_seg[i].PointerToRawData);
}
if(result==-1){
fprintf(stderr,"Could not load section %x to desired address %x\n",
i, load_addr+wpnt->pe->pe_seg[i].Virtual_Address);
fprintf(stderr,"Need to implement relocations now\n");
exit(0);
}
if(strcmp(wpnt->pe->pe_seg[i].Name, ".idata") == 0)
wpnt->pe->pe_import = (struct PE_Import_Directory *) result;
......@@ -184,7 +218,7 @@ HINSTANCE PE_LoadImage(struct w_files *wpnt)
}
}
if(wpnt->pe->pe_import) dump_imports(wpnt->pe->pe_import);
if(wpnt->pe->pe_import) fixup_imports(wpnt->pe->pe_import);
if(wpnt->pe->pe_export) dump_exports(wpnt->pe->pe_export);
wpnt->hinstance = 0x8000;
......
......@@ -22,7 +22,6 @@
#include "dlls.h"
#include "module.h"
#include "resource.h"
#include "library.h"
#include "stddebug.h"
#include "debug.h"
......@@ -458,6 +457,17 @@ BOOL DestroyIcon(HICON hIcon)
GlobalFree(hIcon);
return TRUE;
}
/**********************************************************************
* DumpIcon [USER.459]
*/
DWORD DumpIcon(void* cursorIconInfo, WORD FAR *lpLen, LPSTR FAR *lpXorBits,
LPSTR FAR *lpAndMask)
{
dprintf_resource(stdnimp,"DumpIcon: Empty Stub!!!\n");
return 0;
}
/**********************************************************************
* LoadAccelerators [USER.177]
......
......@@ -34,7 +34,6 @@
#include "global.h"
#include "dlls.h"
#include "neexe.h"
#include "if1632.h"
#include "prototypes.h"
#include "module.h"
#include "stddebug.h"
......@@ -49,135 +48,18 @@ static HANDLE EnvironmentHandle = 0;
extern char WindowsPath[256];
extern char **Argv;
extern int Argc;
extern char **environ;
/**********************************************************************
* Check whether pseudo-functions like __0040H for direct memory
* access are referenced and return 1 if so.
* FIXME: Reading and writing to the returned selectors has no effect
* (e.g. reading from the Bios data segment (esp. clock!) )
*/
unsigned int GetMemoryReference( char *dll_name, char *function,
WORD *sel, WORD *offset )
{
static HANDLE memory_handles[ 10 ] = { 0,0,0,0,0,0,0,0,0,0 };
static char *memory_names[ 10 ] = { "segment 0xA000",
"segment 0xB000",
"segment 0xB800",
"Bios-Rom",
"segment 0xD000",
"segment 0x0000",
"segment 0xE000",
"segment 0xF000",
"segment 0xC000",
"Bios data segment" };
short nr;
if( strcasecmp( dll_name, "KERNEL" ) )
return 0;
if( HIWORD( function ) ) {
if( ( *function != '_' ) || ( *(function+1) != '_' ) )
return 0;
if( !strcasecmp( function, "__A000H" ) ) nr = 0;
else if( !strcasecmp( function, "__B000H" ) ) nr = 1;
else if( !strcasecmp( function, "__B800H" ) ) nr = 2;
else if( !strcasecmp( function, "__ROMBIOS" ) ) nr = 3;
else if( !strcasecmp( function, "__D000H" ) ) nr = 4;
else if( !strcasecmp( function, "__0000H" ) ) nr = 5;
else if( !strcasecmp( function, "__E000H" ) ) nr = 6;
else if( !strcasecmp( function, "__F000H" ) ) nr = 7;
else if( !strcasecmp( function, "__C000H" ) ) nr = 8;
else if( !strcasecmp( function, "__0040H" ) ) nr = 9;
else
return 0;
}
else {
switch( LOWORD( function ) ) {
case 174: nr = 0; break;
case 181: nr = 1; break;
case 182: nr = 2; break;
case 173: nr = 3; break;
case 179: nr = 4; break;
case 183: nr = 5; break;
case 190: nr = 6; break;
case 194: nr = 7; break;
case 195: nr = 8; break;
case 193: nr = 9; break;
default: return 0;
}
}
if( !memory_handles[ nr ] ) {
fprintf( stderr, "Warning: Direct access to %s!\n", memory_names[ nr ] );
memory_handles[ nr ] = GlobalAlloc( GMEM_FIXED, 65535 );
}
*sel = *offset = memory_handles[ nr ];
return 1;
}
unsigned int GetEntryDLLName( char * dll_name, char * function,
WORD* sel, WORD *offset )
{
HMODULE hModule;
struct dll_table_s *dll_table;
int ordinal, addr;
if( GetMemoryReference( dll_name, function, sel, offset ) )
return 0;
hModule = GetModuleHandle( dll_name );
ordinal = MODULE_GetOrdinal( hModule, function );
if (!ordinal) return 1;
addr = MODULE_GetEntryPoint( hModule, ordinal );
if (!addr) return 1;
#ifdef WINESTAT
if ((dll_table = FindDLLTable(dll_name)) != NULL)
{
dll_table->dll_table[ordinal].used++;
}
#endif
*offset = LOWORD(addr);
*sel = HIWORD(addr);
return 0;
}
unsigned int GetEntryDLLOrdinal( char * dll_name, int ordinal,
WORD *sel, WORD *offset )
{
HMODULE hModule;
struct dll_table_s *dll_table;
int addr;
if( GetMemoryReference( dll_name, (char*)ordinal, sel, offset ) )
return 0;
hModule = GetModuleHandle( dll_name );
addr = MODULE_GetEntryPoint( hModule, ordinal );
if (!addr) return 1;
#ifdef WINESTAT
if ((dll_table = FindDLLTable(dll_name)) != NULL)
dll_table->dll_table[ordinal].used++;
#endif
*offset = LOWORD(addr);
*sel = HIWORD(addr);
return 0;
}
WNDPROC GetWndProcEntry16( char *name )
{
WORD sel, offset;
WORD ordinal;
static HMODULE hModule = 0;
GetEntryDLLName( "WINPROCS", name, &sel, &offset );
return (WNDPROC) MAKELONG( offset, sel );
if (!hModule) hModule = GetModuleHandle( "WINPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
return MODULE_GetEntryPoint( hModule, ordinal );
}
......
......@@ -114,24 +114,26 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
if(signal == SIGTRAP) {
scp->sc_eip--;
goto oops;
};
if((scp->sc_cs & 7) != 7)
{
}
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
#ifdef __NetBSD__
/* set_es(0x1f); set_ds(0x1f); */
if(signal != SIGBUS && signal != SIGSEGV && signal != SIGTRAP)
exit(1);
#endif
#ifdef __FreeBSD__
/* set_es(0x27); set_ds(0x27); */
if(signal != SIGBUS && signal != SIGSEGV && signal != SIGTRAP)
exit(1);
if(scp->sc_cs == 0x1f)
{
#endif
if (scp->sc_cs == WINE_CODE_SELECTOR)
{
fprintf(stderr,
"Segmentation fault in Wine program (%x:%lx)."
" Please debug\n",
scp->sc_cs, scp->sc_eip);
goto oops;
};
}
/* Now take a look at the actual instruction where the program
bombed */
......
......@@ -20,10 +20,12 @@
#include "stddebug.h"
#include "debug.h"
/* Min. number of thunks allocated when creating a new segment */
#define MIN_THUNKS 32
#define MIN_THUNKS 32 /* Min. thunks allocated when creating a new segment */
#define STACK32_SIZE 0x10000 /* 32-bit stack size for each task */
/* 32-bit stack size for each task */
/* Must not be greater than 64k, or MAKE_SEGPTR won't work */
#define STACK32_SIZE 0x10000
static HTASK hFirstTask = 0;
......@@ -194,7 +196,6 @@ static void TASK_CallToStart(void)
TDB *pTask = (TDB *)GlobalLock( hCurrentTask );
NE_MODULE *pModule = (NE_MODULE *)GlobalLock( pTask->hModule );
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
extern unsigned short WIN_StackSize;
/* Registers at initialization must be:
* ax zero
......@@ -209,20 +210,17 @@ static void TASK_CallToStart(void)
* sp top of the stack
*/
WIN_StackSize = pModule->stack_size;
cs_reg = pSegTable[pModule->cs - 1].selector;
ip_reg = pModule->ip;
ds_reg = pSegTable[pModule->dgroup - 1].selector;
IF1632_Saved16_ss = pTask->ss;
IF1632_Saved16_sp = pTask->sp;
/* dprintf_task( stddeb, "Starting main program: cs:ip=%04x:%04x ds=%04x ss:sp=%04x:%04x\n",
dprintf_task( stddeb, "Starting main program: cs:ip=%04x:%04x ds=%04x ss:sp=%04x:%04x\n",
cs_reg, ip_reg, ds_reg,
IF1632_Saved16_ss, IF1632_Saved16_sp);
*/
CallTo16_regs_( (FARPROC)(cs_reg << 16 | ip_reg), ds_reg,
pTask->hPDB /*es*/, 0 /*bp*/, 0 /*ax*/,
WIN_StackSize /*bx*/, pModule->heap_size /*cx*/,
pModule->stack_size /*bx*/, pModule->heap_size /*cx*/,
0 /*dx*/, 0 /*si*/, ds_reg /*di*/ );
/* This should never return */
fprintf( stderr, "TASK_CallToStart: Main program returned!\n" );
......@@ -233,8 +231,8 @@ static void TASK_CallToStart(void)
/***********************************************************************
* TASK_CreateTask
*/
HTASK TASK_CreateTask( HMODULE hModule, HANDLE hEnvironment,
HTASK hTaskParent, char *cmdLine )
HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance,
HANDLE hEnvironment, char *cmdLine, WORD cmdShow )
{
HTASK hTask;
TDB *pTask;
......@@ -258,15 +256,17 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hEnvironment,
/* Fill the task structure */
pTask->nEvents = 1; /* So the task can be started */
pTask->hSelf = hTask;
pTask->flags = 0;
pTask->version = pModule->expected_version;
pTask->hInstance = NE_SEG_TABLE(pModule)[pModule->dgroup-1].selector,
pTask->hModule = hModule;
pTask->hParent = hTaskParent;
pTask->curdrive = 'C' - 'A' + 0x80;
pTask->magic = TDB_MAGIC;
pTask->nEvents = 1; /* So the task can be started */
pTask->hSelf = hTask;
pTask->flags = 0;
pTask->version = pModule->expected_version;
pTask->hInstance = hInstance;
pTask->hPrevInstance = hPrevInstance;
pTask->hModule = hModule;
pTask->hParent = hCurrentTask;
pTask->curdrive = 'C' - 'A' + 0x80;
pTask->magic = TDB_MAGIC;
pTask->nCmdShow = cmdShow;
strcpy( pTask->curdir, "WINDOWS" );
/* Create the thunks block */
......@@ -338,7 +338,7 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hEnvironment,
/* Create the 16-bit stack frame */
pTask->ss = pSegTable[pModule->ss - 1].selector;
pTask->ss = hInstance;
pTask->sp = (pModule->sp != 0) ? pModule->sp :
pSegTable[pModule->ss-1].minsize + pModule->stack_size;
stack16Top = (char *)PTR_SEG_OFF_TO_LIN( pTask->ss, pTask->sp );
......@@ -384,6 +384,10 @@ void TASK_DeleteTask( HTASK hTask )
if (!(pTask = (TDB *)GlobalLock( hTask ))) return;
/* Free the task module */
FreeModule( pTask->hModule );
/* Free all memory used by this task (including the 32-bit stack, */
/* the environment block and the thunk segments). */
......@@ -394,7 +398,9 @@ void TASK_DeleteTask( HTASK hTask )
GLOBAL_FreeBlock( pTask->hCSAlias );
GLOBAL_FreeBlock( pTask->hPDB );
GlobalFree( hTask ); /* Free the task structure */
/* Free the task structure itself */
GlobalFree( hTask );
}
......@@ -501,9 +507,42 @@ void TASK_Reschedule(void)
/* Switch to the new stack */
hCurrentTask = hTask;
IF1632_Saved16_ss = pNewTask->ss;
IF1632_Saved16_sp = pNewTask->sp;
IF1632_Saved32_esp = pNewTask->esp;
IF1632_Saved16_ss = pNewTask->ss;
IF1632_Saved16_sp = pNewTask->sp;
IF1632_Saved32_esp = pNewTask->esp;
IF1632_Stack32_base = WIN16_GlobalLock( pNewTask->hStack32 );
}
/***********************************************************************
* InitTask (KERNEL.91)
*/
void InitTask( struct sigcontext_struct context )
{
TDB *pTask;
NE_MODULE *pModule;
context.sc_eax = 0;
if (!(pTask = (TDB *)GlobalLock( hCurrentTask ))) return;
if (!(pModule = (NE_MODULE *)GlobalLock( pTask->hModule ))) return;
NE_InitializeDLLs( pTask->hModule );
/* Registers on return are:
* ax 1 if OK, 0 on error
* cx stack limit in bytes
* dx cmdShow parameter
* si instance handle of the previous instance
* di instance handle of the new task
* es:bx pointer to command-line inside PSP
*/
context.sc_eax = 1;
context.sc_ebx = 0x81;
context.sc_ecx = pModule->stack_size;
context.sc_edx = pTask->nCmdShow;
context.sc_esi = pTask->hPrevInstance;
context.sc_edi = pTask->hInstance;
context.sc_es = pTask->hPDB;
}
......@@ -650,7 +689,8 @@ HANDLE GetCodeHandle( FARPROC proc )
else
handle = GlobalHandle( HIWORD(proc) );
printf( "STUB: GetCodeHandle(%p) returning %04x\n", proc, handle );
printf( "STUB: GetCodeHandle(%08lx) returning %04x\n",
(DWORD)proc, handle );
return handle;
}
......
......@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include "windows.h"
#include "global.h"
#include "toolhelp.h"
#include "selectors.h"
#include "stackframe.h"
......@@ -17,7 +18,7 @@
typedef struct
{
DWORD base; /* Base address */
DWORD size; /* Size in bytes */
DWORD size; /* Size in bytes (0 indicates a free block) */
HGLOBAL handle; /* Handle for this block */
HGLOBAL hOwner; /* Owner of this block */
BYTE lockCount; /* Count of GlobalFix() calls */
......@@ -27,6 +28,7 @@ typedef struct
} GLOBALARENA;
/* Flags definitions */
#define GA_MOVEABLE 0x02 /* same as GMEM_MOVEABLE */
#define GA_DGROUP 0x04
#define GA_DISCARDABLE 0x08
......@@ -45,14 +47,16 @@ static int globalArenaSize = 0;
*/
static GLOBALARENA *GLOBAL_GetArena( WORD sel, WORD selcount )
{
if (((sel >> __AHSHIFT) + selcount) >= globalArenaSize)
if (((sel >> __AHSHIFT) + selcount) > globalArenaSize)
{
int newsize = ((sel >> __AHSHIFT) + selcount + 0xff) & ~0xff;
GLOBALARENA *pNewArena = realloc( pGlobalArena,
(globalArenaSize + 256) * sizeof(GLOBALARENA) );
newsize * sizeof(GLOBALARENA) );
if (!pNewArena) return 0;
pGlobalArena = pNewArena;
memset( pGlobalArena + globalArenaSize, 0, 256 * sizeof(GLOBALARENA) );
globalArenaSize += 256;
memset( pGlobalArena + globalArenaSize, 0,
(newsize - globalArenaSize) * sizeof(GLOBALARENA) );
globalArenaSize = newsize;
}
return pGlobalArena + (sel >> __AHSHIFT);
}
......@@ -91,7 +95,7 @@ HGLOBAL GLOBAL_CreateBlock( WORD flags, void *ptr, DWORD size,
pArena->hOwner = hOwner;
pArena->lockCount = 0;
pArena->pageLockCount = 0;
pArena->flags = flags & 0xff;
pArena->flags = flags & GA_MOVEABLE;
if (flags & GMEM_DISCARDABLE) pArena->flags |= GA_DISCARDABLE;
if (!isCode) pArena->flags |= GA_DGROUP;
pArena->selCount = selcount;
......@@ -188,19 +192,29 @@ HGLOBAL GlobalReAlloc( HGLOBAL handle, DWORD size, WORD flags )
if (!handle) return 0;
pArena = GET_ARENA_PTR( handle );
/* Discard the block if requested */
if ((size == 0) && (flags & GMEM_MOVEABLE))
{
if (!(pArena->flags & GA_MOVEABLE) ||
!(pArena->flags & GA_DISCARDABLE) ||
(pArena->lockCount > 0) || (pArena->pageLockCount > 0)) return 0;
free( (void *)pArena->base );
pArena->base = 0;
}
/* Fixup the size */
if (size >= 0x00ff0000-0x0f) return 0; /* No allocation > 16Mb-64Kb */
if (size == 0) size = 0x10;
else size = (size + 0x0f) & ~0x0f;
if (size > GLOBAL_MAX_ALLOC_SIZE - 0x20) return 0;
if (size == 0) size = 0x20;
else size = (size + 0x1f) & ~0x1f;
/* Change the flags */
if (flags & GMEM_MODIFY)
{
/* Change the flags, leaving GA_DGROUP alone */
pArena->flags = (pArena->flags & GA_DGROUP) |
(flags & ~GA_DGROUP);
pArena->flags = (pArena->flags & GA_DGROUP) | (flags & GA_MOVEABLE);
if (flags & GMEM_DISCARDABLE) pArena->flags |= GA_DISCARDABLE;
return handle;
}
......@@ -245,7 +259,7 @@ HGLOBAL GlobalReAlloc( HGLOBAL handle, DWORD size, WORD flags )
pNewArena->base = (DWORD)ptr;
pNewArena->size = GET_SEL_LIMIT(sel) + 1;
pNewArena->selCount = selcount;
pNewArena->handle = (pNewArena->flags & GMEM_MOVEABLE) ? sel - 1 : sel;
pNewArena->handle = (pNewArena->flags & GA_MOVEABLE) ? sel - 1 : sel;
if (selcount > 1) /* clear the next arena blocks */
memset( pNewArena + 1, 0, (selcount - 1) * sizeof(GLOBALARENA) );
......@@ -281,6 +295,7 @@ SEGPTR WIN16_GlobalLock( HGLOBAL handle )
dprintf_global( stddeb, "WIN16_GlobalLock(%04x) -> %08lx\n",
handle, MAKELONG( 0, GlobalHandleToSel(handle)) );
if (!handle) return 0;
if (!GET_ARENA_PTR(handle)->base) return (SEGPTR)0;
return (SEGPTR)MAKELONG( 0, GlobalHandleToSel(handle) );
}
......@@ -339,7 +354,8 @@ WORD GlobalFlags( HGLOBAL handle )
dprintf_global( stddeb, "GlobalFlags: %04x\n", handle );
pArena = GET_ARENA_PTR(handle);
return pArena->lockCount |
((pArena->flags & GA_DISCARDABLE) ? GMEM_DISCARDABLE : 0);
((pArena->flags & GA_DISCARDABLE) ? GMEM_DISCARDABLE : 0) |
((pArena->base == 0) ? GMEM_DISCARDED : 0);
}
......@@ -632,3 +648,14 @@ BOOL MemManInfo( MEMMANINFO *pInfo )
{
return TRUE;
}
/***********************************************************************
* GlobalAlloc32
* implements GlobalAlloc (KERNEL32.316)
* LocalAlloc (KERNEL32.372)
*/
void *GlobalAlloc32(int flags,int size)
{
dprintf_global(stddeb,"GlobalAlloc32(%x,%x)\n",flags,size);
return malloc(size);
}
......@@ -243,6 +243,11 @@ static void LOCAL_PrintHeap( WORD ds )
LOCALARENA *pArena = ARENA_PTR(ptr,arena);
printf( " %04x: prev=%04x next=%04x type=%d\n", arena,
pArena->prev & ~3, pArena->next, pArena->prev & 3 );
if (arena == pInfo->first)
{
printf( " size=%d free_prev=%04x free_next=%04x\n",
pArena->size, pArena->free_prev, pArena->free_next );
}
if ((pArena->prev & 3) == LOCAL_ARENA_FREE)
{
printf( " size=%d free_prev=%04x free_next=%04x\n",
......@@ -377,6 +382,7 @@ HLOCAL LOCAL_Alloc( WORD ds, WORD flags, WORD size )
/* Find a suitable free block */
if (!(pInfo = LOCAL_GetHeap( ds ))) {
dprintf_local( stddeb, "LocalAlloc: Heap not found\n");
LOCAL_PrintHeap(ds);
return 0;
}
......@@ -387,7 +393,8 @@ HLOCAL LOCAL_Alloc( WORD ds, WORD flags, WORD size )
for (;;)
{
if (arena == pArena->free_next) {
LOCAL_PrintHeap(ds);
fprintf(stderr, "Local heap full\n");
if (debugging_local) LOCAL_PrintHeap(ds);
return 0; /* not found */
}
arena = pArena->free_next;
......@@ -629,6 +636,8 @@ WORD LocalFlags( HLOCAL handle )
*/
WORD LocalCompact( WORD minfree )
{
dprintf_local( stddeb, "LocalCompact: %04x\n", minfree );
return 0;
}
......@@ -637,6 +646,8 @@ WORD LocalCompact( WORD minfree )
*/
FARPROC LocalNotify( FARPROC func )
{
dprintf_local( stddeb, "LocalNotify: %08lx\n", func );
return 0;
}
......@@ -645,6 +656,8 @@ FARPROC LocalNotify( FARPROC func )
*/
WORD LocalShrink( HLOCAL handle, WORD newsize )
{
dprintf_local( stddeb, "LocalShrink: %04x %04x\n", handle, newsize );
return 0;
}
......@@ -662,6 +675,7 @@ DWORD GetHeapSpaces( HMODULE module )
*/
void LocalCountFree()
{
dprintf_local( stddeb, "LocalCountFree:\n" );
}
......@@ -670,6 +684,7 @@ void LocalCountFree()
*/
WORD LocalHeapSize()
{
dprintf_local( stddeb, "LocalHeapSize:\n" );
return LOCAL_HeapSize( CURRENT_DS );
}
......@@ -679,6 +694,8 @@ WORD LocalHeapSize()
*/
WORD LocalHandleDelta( WORD delta )
{
dprintf_local( stddeb, "LocalHandleDelta: %04x\n", delta );
return 0;
}
......
......@@ -13,7 +13,7 @@
ldt_copy_entry ldt_copy[LDT_SIZE] = { {0,0}, };
#define FIRST_LDT_ENTRY_TO_ALLOC 4
#define FIRST_LDT_ENTRY_TO_ALLOC 6
/***********************************************************************
......
......@@ -14,12 +14,12 @@ SRCS = \
escape.c \
file.c \
keyboard.c \
kernel32.c \
lstr.c \
main.c \
ole2nls.c \
olecli.c \
olesvr.c \
message.c \
network.c \
profile.c \
rect.c \
......
......@@ -11,10 +11,7 @@
#include "prototypes.h"
#include "dlls.h"
#include "windows.h"
#include "if1632.h"
#include "callback.h"
#include "library.h"
#include "ne_image.h"
#include "stddebug.h"
#include "debug.h"
......@@ -33,88 +30,6 @@
#define HELP_MULTIKEY 0x0201
#define HELP_SETWINPOS 0x0203
typedef struct {
WORD wEnvSeg;
LPSTR lpCmdLine;
LPVOID lpCmdShow;
DWORD dwReserved;
} PARAMBLOCK;
typedef BOOL (CALLBACK * LPFNWINMAIN)(HANDLE, HANDLE, LPSTR, int);
/**********************************************************************
* LoadModule [KERNEL.45]
*/
HANDLE LoadModule(LPSTR modulefile, LPVOID lpParamBlk)
{
PARAMBLOCK *pblk = lpParamBlk;
WORD *lpCmdShow;
dprintf_exec(stddeb,"LoadModule '%s' %p\n", modulefile, lpParamBlk);
if (lpParamBlk == NULL) return 0;
lpCmdShow = (WORD *)pblk->lpCmdShow;
return WinExec(pblk->lpCmdLine, lpCmdShow[1]);
}
/**********************************************************************
* WinExec [KERNEL.166]
*/
WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow)
{
int c = 0;
int x, x2;
char *ArgV[20];
HINSTANCE hInst = 0;
HANDLE hTask = 0;
dprintf_exec(stddeb,"WinExec('%s', %04X)\n", lpCmdLine, nCmdShow);
/* ArgV[0] = "wine";
c = 1; */
for (x = x2 = 0; x < strlen(lpCmdLine) + 1; x++) {
if ((lpCmdLine[x] == ' ') || (lpCmdLine[x] == '\0')) {
ArgV[c] = (char *)malloc(x - x2 + 1);
strncpy(ArgV[c], &lpCmdLine[x2], x - x2);
ArgV[c][x - x2] = '\0';
c++; x2 = x + 1;
}
}
ArgV[c] = NULL;
for (c = 0; ArgV[c] != NULL; c++)
dprintf_exec(stddeb,"--> '%s' \n", ArgV[c]);
if ((hInst = LoadImage(ArgV[0], EXE, 1)) == (HINSTANCE) NULL ) {
fprintf(stderr, "wine: can't find %s!.\n", ArgV[0]);
}
#if 0
switch(fork()) {
case -1:
fprintf(stderr,"Can't 'fork' process !\n");
break;
case 0:
if ((hInst = LoadImage(ArgV[0], EXE, 1)) == (HINSTANCE) NULL ) {
fprintf(stderr, "wine: can't find %s!.\n", ArgV[0]);
fprintf(stderr,"Child process died !\n");
exit(1);
}
StartNewTask(hInst);
/* hTask = CreateNewTask(0);
dprintf_exec(stddeb,
"WinExec // New Task hTask=%04X !\n", hTask);
execvp(ArgV[0], ArgV); */
fprintf(stderr,"Child process died !\n");
exit(1);
default:
dprintf_exec(stddeb,
"WinExec (Main process stay alive) hTask=%04X !\n",
hTask);
break;
}
#endif
for (c = 0; ArgV[c] != NULL; c++) free(ArgV[c]);
return hTask;
}
/**********************************************************************
* ExitWindows [USER.7]
......
......@@ -42,13 +42,19 @@ INT _lopen (LPSTR lpPathName, INT iReadWrite)
{
int handle;
char *UnixFileName;
int mode = 0;
dprintf_file(stddeb, "_lopen: open('%s', %X);\n", lpPathName, iReadWrite);
if ((UnixFileName = DOS_GetUnixFileName(lpPathName)) == NULL)
return HFILE_ERROR;
iReadWrite &= 0x000F;
handle = open (UnixFileName, iReadWrite);
if( ( handle == -1 ) && Options.allowReadOnly )
switch(iReadWrite & 3)
{
case OF_READ: mode = O_RDONLY; break;
case OF_WRITE: mode = O_WRONLY; break;
case OF_READWRITE: mode = O_RDWR; break;
}
handle = open( UnixFileName, mode );
if (( handle == -1 ) && Options.allowReadOnly)
handle = open( UnixFileName, O_RDONLY );
dprintf_file(stddeb, "_lopen: open: %s (handle %d)\n", UnixFileName, handle);
......@@ -112,17 +118,14 @@ INT _lclose (INT hFile)
**************************************************************************/
INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
{
#ifdef WINELIB
dprintf_file(stdnimp, "OpenFile: not implemented\n");
#else
char filename[MAX_PATH+1];
int action;
struct stat s;
struct tm *now;
int res;
int verify_time;
char filename[MAX_PATH+1];
int action;
struct stat s;
struct tm *now;
int res, handle;
int verify_time;
dprintf_file(stddeb,"Openfile(%s,<struct>,%d) ",lpFileName,wStyle);
dprintf_file(stddeb,"Openfile(%s,<struct>,%d)\n",lpFileName,wStyle);
action = wStyle & 0xff00;
......@@ -131,31 +134,29 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
handle it first */
if (action & OF_CREATE)
{
int handle;
char *unixfilename;
{
char *unixfilename;
if (!(action & OF_REOPEN))
strcpy(ofs->szPathName, lpFileName);
ofs->cBytes = sizeof(OFSTRUCT);
ofs->fFixedDisk = FALSE;
ofs->nErrCode = 0;
*((int*)ofs->reserved) = 0;
if (!(action & OF_REOPEN)) strcpy(ofs->szPathName, lpFileName);
ofs->cBytes = sizeof(OFSTRUCT);
ofs->fFixedDisk = FALSE;
ofs->nErrCode = 0;
*((int*)ofs->reserved) = 0;
if ((unixfilename = DOS_GetUnixFileName (ofs->szPathName)) == NULL)
{
errno_to_doserr();
ofs->nErrCode = ExtendedError;
return -1;
}
handle = open (unixfilename, (wStyle & 0x0003) | O_CREAT, 0x666);
if (handle == -1)
{
errno_to_doserr();
ofs->nErrCode = ExtendedError;
}
return handle;
}
if ((unixfilename = DOS_GetUnixFileName (ofs->szPathName)) == NULL)
{
errno_to_doserr();
ofs->nErrCode = ExtendedError;
return -1;
}
handle = open (unixfilename, (wStyle & 0x0003) | O_CREAT, 0x666);
if (handle == -1)
{
errno_to_doserr();
ofs->nErrCode = ExtendedError;
}
return handle;
}
/* If path isn't given, try to find the file. */
......@@ -166,27 +167,53 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
index(lpFileName,':')))
while(1)
{
char temp[MAX_PATH+1];
char temp[MAX_PATH+1];
/* Try current directory */
strcpy (filename, lpFileName);
if ( (!stat(DOS_GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
break;
/* Try Windows directory */
GetWindowsDirectory (filename,MAX_PATH);
if ((!filename[0])||(filename[strlen(filename)-1]!='\\'))
strcat(filename, "\\");
strcat (filename, lpFileName);
if ( (!stat(DOS_GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
break;
/* Try Windows system directory */
GetSystemDirectory (filename,MAX_PATH);
if ((!filename[0])||(filename[strlen(filename)-1]!='\\'))
strcat(filename, "\\");
strcat (filename, lpFileName);
if ( (!stat(DOS_GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
break;
if (!DOS_FindFile(temp,MAX_PATH,lpFileName,NULL,WindowsPath))
{
/* Try the path of the current executable */
if (GetCurrentTask())
{
char *p;
GetModuleFileName( GetCurrentTask(), filename, MAX_PATH );
if ((p = strrchr( filename, '\\' )))
{
p[1] = '\0';
strcat( filename, lpFileName );
if ((!stat(DOS_GetUnixFileName(filename), &s)) &&
(S_ISREG(s.st_mode)) )
break;
}
}
/* Try all directories in path */
if (DOS_FindFile(temp,MAX_PATH,lpFileName,NULL,WindowsPath))
{
strcpy(filename, DOS_GetDosFileName(temp));
break;
}
}
strcpy (filename, lpFileName);
break;
}
......@@ -235,47 +262,15 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
if (action & OF_EXIST)
return 0;
/* Now we are actually going to open the file. According to Microsoft's
Knowledge Basis, this is done by calling int 21h, ax=3dh. */
#if 0
AX = 0x3d00;
AL = (AL & 0x0f) | (wStyle & 0x70); /* Handle OF_SHARE_xxx etc. */
AL = (AL & 0xf0) | (wStyle & 0x03); /* Handle OF_READ etc. */
DS = SELECTOROF(ofs->szPathName);
DX = OFFSETOF(ofs->szPathName);
OpenExistingFile (context);
if (EFL & 0x00000001) /* Cflag */
{
ofs->nErrCode = AL;
return -1;
}
return AX;
#endif
/* FIXME: Quick hack to get it to work without calling DOS --AJ */
if ((handle = _lopen( ofs->szPathName, wStyle )) == -1)
{
int mode, handle;
switch(wStyle & 3)
{
case 0: mode = O_RDONLY; break;
case 1: mode = O_WRONLY; break;
default: mode = O_RDWR; break;
}
if ((handle = open(DOS_GetUnixFileName(ofs->szPathName), mode)) == -1)
{
ofs->nErrCode = 2; /* not found */
return -1;
}
/* don't bother with locking for now */
return handle;
ofs->nErrCode = 2; /* not found */
return -1;
}
#endif /*WINELIB*/
return handle;
}
/**************************************************************************
SetHandleCount
......@@ -358,7 +353,8 @@ UINT GetDriveType(INT drive)
BYTE GetTempDrive(BYTE chDriveLetter)
{
dprintf_file(stddeb,"GetTempDrive (%d)\n",chDriveLetter);
return('C');
if (TempDirectory[1] == ':') return TempDirectory[0];
else return 'C';
}
/***************************************************************************
......@@ -437,14 +433,14 @@ WORD SetErrorMode(WORD x)
/***************************************************************************
_hread
***************************************************************************/
long _hread(int hf, void FAR *hpvBuffer, long cbBuffer)
LONG _hread(INT hf, LPSTR hpvBuffer, LONG cbBuffer)
{
return read(hf, hpvBuffer, cbBuffer);
}
/***************************************************************************
_hwrite
***************************************************************************/
long _hwrite(int hf, const void FAR *hpvBuffer, long cbBuffer)
LONG _hwrite(INT hf, const LPSTR hpvBuffer, LONG cbBuffer)
{
return write(hf, hpvBuffer, cbBuffer);
}
This diff is collapsed. Click to expand it.
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