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.
This commit is contained in:
Alexandre Julliard 1995-05-22 18:23:01 +00:00
parent 594997c900
commit 2787be8766
138 changed files with 7819 additions and 5435 deletions

View File

@ -1,14 +1,15 @@
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.

244
ChangeLog
View File

@ -1,3 +1,247 @@
----------------------------------------------------------------------
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)

View File

@ -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 \

7
README
View File

@ -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]

View File

@ -1,29 +0,0 @@
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.

View File

@ -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) );
}

File diff suppressed because it is too large Load Diff

View File

@ -113,31 +113,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
*

File diff suppressed because it is too large Load Diff

View File

@ -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 );

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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... */

View File

@ -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

View File

@ -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;
void load_entrypoints( HMODULE hModule )
{
char buffer[256];
unsigned char *cpnt, *name;
NE_MODULE *pModule;
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
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));
}
}

View File

@ -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

View File

@ -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 \

View File

@ -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]

View File

@ -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

View File

@ -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

View File

@ -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

366
if1632/gdi32.spec Normal file
View File

@ -0,0 +1,366 @@
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

View File

@ -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

620
if1632/kernel32.spec Normal file
View File

@ -0,0 +1,620 @@
name kernel32
base 1
0000 stub AddAtomA
0001 stub AddAtomW
0002 stub AddConsoleAliasA
0003 stub AddConsoleAliasW
0004 stub AllocConsole
0005 stub AreFileApisANSI
0006 stub BackupRead
0007 stub BackupSeek
0008 stub BackupWrite
0009 stub BaseAttachCompleteThunk
0010 stub BasepDebugDump
0011 stub Beep
0012 stub BeginUpdateResourceA
0013 stub BeginUpdateResourceW
0014 stub BuildCommDCBA
0015 stub BuildCommDCBAndTimeoutsA
0016 stub BuildCommDCBAndTimeoutsW
0017 stub BuildCommDCBW
0018 stub CallNamedPipeA
0019 stub CallNamedPipeW
0020 stub ClearCommBreak
0021 stub ClearCommError
0022 stub CloseConsoleHandle
0023 stub CloseHandle
0024 stub CloseProfileUserMapping
0025 stub CmdBatNotification
0026 stub CommConfigDialogA
0027 stub CommConfigDialogW
0028 stub CompareFileTime
0029 stub CompareStringA
0030 stub CompareStringW
0031 stub ConnectNamedPipe
0032 stub ConsoleMenuControl
0033 stub ConsoleSubst
0034 stub ContinueDebugEvent
0035 stub ConvertDefaultLocale
0036 stub CopyFileA
0037 stub CopyFileW
0038 stub CreateConsoleScreenBuffer
0039 stub CreateDirectoryA
0040 stub CreateDirectoryExA
0041 stub CreateDirectoryExW
0042 stub CreateDirectoryW
0043 stub CreateEventA
0044 stub CreateEventW
0045 stub CreateFileA
0046 stub CreateFileMappingA
0047 stub CreateFileMappingW
0048 stub CreateFileW
0049 stub CreateIoCompletionPort
0050 stub CreateMailslotA
0051 stub CreateMailslotW
0052 stub CreateMutexA
0053 stub CreateMutexW
0054 stub CreateNamedPipeA
0055 stub CreateNamedPipeW
0056 stub CreatePipe
0057 stub CreateProcessA
0058 stub CreateProcessW
0059 stub CreateRemoteThread
0060 stub CreateSemaphoreA
0061 stub CreateSemaphoreW
0062 stub CreateTapePartition
0063 stub CreateThread
0064 stub CreateVirtualBuffer
0065 stub DebugActiveProcess
0066 stub DebugBreak
0067 stub DefineDosDeviceA
0068 stub DefineDosDeviceW
0069 stub DeleteAtom
0070 stub DeleteCriticalSection
0071 stub DeleteFileA
0072 stub DeleteFileW
0073 stub DeviceIoControl
0074 stub DisableThreadLibraryCalls
0075 stub DisconnectNamedPipe
0076 stub DosDateTimeToFileTime
0077 stub DuplicateConsoleHandle
0078 stub DuplicateHandle
0079 stub EndUpdateResourceA
0080 stub EndUpdateResourceW
0081 stub EnterCriticalSection
0082 stub EnumCalendarInfoA
0083 stub EnumCalendarInfoW
0084 stub EnumDateFormatsA
0085 stub EnumDateFormatsW
0086 stub EnumResourceLanguagesA
0087 stub EnumResourceLanguagesW
0088 stub EnumResourceNamesA
0089 stub EnumResourceNamesW
0090 stub EnumResourceTypesA
0091 stub EnumResourceTypesW
0092 stub EnumSystemCodePagesA
0093 stub EnumSystemCodePagesW
0094 stub EnumSystemLocalesA
0095 stub EnumSystemLocalesW
0096 stub EnumTimeFormatsA
0097 stub EnumTimeFormatsW
0098 stub EraseTape
0099 stub EscapeCommFunction
0100 stub ExitProcess
0101 stub ExitThread
0102 stub ExitVDM
0103 stub ExpandEnvironmentStringsA
0104 stub ExpandEnvironmentStringsW
0105 stub ExpungeConsoleCommandHistoryA
0106 stub ExpungeConsoleCommandHistoryW
0107 stub ExtendVirtualBuffer
0108 stub FatalAppExitA
0109 stub FatalAppExitW
0110 stub FatalExit
0111 stub FileTimeToDosDateTime
0112 stub FileTimeToLocalFileTime
0113 stub FileTimeToSystemTime
0114 stub FillConsoleOutputAttribute
0115 stub FillConsoleOutputCharacterA
0116 stub FillConsoleOutputCharacterW
0117 stub FindAtomA
0118 stub FindAtomW
0119 stub FindClose
0120 stub FindCloseChangeNotification
0121 stub FindFirstChangeNotificationA
0122 stub FindFirstChangeNotificationW
0123 stub FindFirstFileA
0124 stub FindFirstFileW
0125 stub FindNextChangeNotification
0126 stub FindNextFileA
0127 stub FindNextFileW
0128 stub FindResourceA
0129 stub FindResourceExA
0130 stub FindResourceExW
0131 stub FindResourceW
0132 stub FlushConsoleInputBuffer
0133 stub FlushFileBuffers
0134 stub FlushInstructionCache
0135 stub FlushViewOfFile
0136 stub FoldStringA
0137 stub FoldStringW
0138 stub FormatMessageA
0139 stub FormatMessageW
0140 stub FreeConsole
0141 stub FreeEnvironmentStringsA
0142 stub FreeEnvironmentStringsW
0143 stub FreeLibrary
0144 stub FreeLibraryAndExitThread
0145 stub FreeResource
0146 stub FreeVirtualBuffer
0147 stub GenerateConsoleCtrlEvent
0148 stub GetACP
0149 stub GetAtomNameA
0150 stub GetAtomNameW
0151 stub GetBinaryType
0152 stub GetBinaryTypeA
0153 stub GetBinaryTypeW
0154 stub GetCPInfo
0155 stub GetCommConfig
0156 stub GetCommMask
0157 stub GetCommModemStatus
0158 stub GetCommProperties
0159 stub GetCommState
0160 stub GetCommTimeouts
0161 stdcall GetCommandLineA() GetCommandLineA
0162 stub GetCommandLineW
0163 stub GetCompressedFileSizeA
0164 stub GetCompressedFileSizeW
0165 stub GetComputerNameA
0166 stub GetComputerNameW
0167 stub GetConsoleAliasA
0168 stub GetConsoleAliasExesA
0169 stub GetConsoleAliasExesLengthA
0170 stub GetConsoleAliasExesLengthW
0171 stub GetConsoleAliasExesW
0172 stub GetConsoleAliasW
0173 stub GetConsoleAliasesA
0174 stub GetConsoleAliasesLengthA
0175 stub GetConsoleAliasesLengthW
0176 stub GetConsoleAliasesW
0177 stub GetConsoleCP
0178 stub GetConsoleCommandHistoryA
0179 stub GetConsoleCommandHistoryLengthA
0180 stub GetConsoleCommandHistoryLengthW
0181 stub GetConsoleCommandHistoryW
0182 stub GetConsoleCursorInfo
0183 stub GetConsoleDisplayMode
0184 stub GetConsoleFontInfo
0185 stub GetConsoleFontSize
0186 stub GetConsoleHardwareState
0187 stub GetConsoleInputWaitHandle
0188 stub GetConsoleMode
0189 stub GetConsoleOutputCP
0190 stub GetConsoleScreenBufferInfo
0191 stub GetConsoleTitleA
0192 stub GetConsoleTitleW
0193 stub GetCurrencyFormatA
0194 stub GetCurrencyFormatW
0195 stub GetCurrentConsoleFont
0196 stub GetCurrentDirectoryA
0197 stub GetCurrentDirectoryW
0198 stub GetCurrentProcess
0199 stub GetCurrentProcessId
0200 stub GetCurrentThread
0201 stdcall GetCurrentThreadId() GetCurrentThreadId
0202 stub GetDateFormatA
0203 stub GetDateFormatW
0204 stub GetDefaultCommConfigA
0205 stub GetDefaultCommConfigW
0206 stub GetDiskFreeSpaceA
0207 stub GetDiskFreeSpaceW
0208 stub GetDriveTypeA
0209 stub GetDriveTypeW
0210 stdcall GetEnvironmentStrings() GetEnvironmentStrings
0211 stub GetEnvironmentStringsA
0212 stub GetEnvironmentStringsW
0213 stub GetEnvironmentVariableA
0214 stub GetEnvironmentVariableW
0215 stub GetExitCodeProcess
0216 stub GetExitCodeThread
0217 stub GetFileAttributesA
0218 stub GetFileAttributesW
0219 stub GetFileInformationByHandle
0220 stub GetFileSize
0221 stub GetFileTime
0222 stub GetFileType
0223 stub GetFullPathNameA
0224 stub GetFullPathNameW
0225 stub GetHandleInformation
0226 stub GetLargestConsoleWindowSize
0227 stub GetLastError
0228 stub GetLocalTime
0229 stub GetLocaleInfoA
0230 stub GetLocaleInfoW
0231 stub GetLogicalDriveStringsA
0232 stub GetLogicalDriveStringsW
0233 stub GetLogicalDrives
0234 stub GetMailslotInfo
0235 return GetModuleFileNameA 12 0
0236 stub GetModuleFileNameW
0237 stdcall GetModuleHandleA(ptr) GetModuleHandle
0238 stub GetModuleHandleW
0239 stub GetNamedPipeHandleStateA
0240 stub GetNamedPipeHandleStateW
0241 stub GetNamedPipeInfo
0242 stub GetNextVDMCommand
0243 stub GetNumberFormatA
0244 stub GetNumberFormatW
0245 stub GetNumberOfConsoleFonts
0246 stub GetNumberOfConsoleInputEvents
0247 stub GetNumberOfConsoleMouseButtons
0248 stub GetOEMCP
0249 stub GetOverlappedResult
0250 stub GetPriorityClass
0251 stub GetPrivateProfileIntA
0252 stub GetPrivateProfileIntW
0253 stub GetPrivateProfileSectionA
0254 stub GetPrivateProfileSectionW
0255 stub GetPrivateProfileStringA
0256 stub GetPrivateProfileStringW
0257 stub GetProcAddress
0258 stub GetProcessAffinityMask
0259 return GetProcessHeap 0 0
0260 stub GetProcessHeaps
0261 stub GetProcessShutdownParameters
0262 stub GetProcessTimes
0263 stub GetProcessWorkingSetSize
0264 stub GetProfileIntA
0265 stub GetProfileIntW
0266 stub GetProfileSectionA
0267 stub GetProfileSectionW
0268 stub GetProfileStringA
0269 stub GetProfileStringW
0270 stub GetQueuedCompletionStatus
0271 stub GetShortPathNameA
0272 stub GetShortPathNameW
0273 return GetStartupInfoA 4 0
0274 stub GetStartupInfoW
0275 stdcall GetStdHandle(long) GetStdHandle
0276 stub GetStringTypeA
0277 stub GetStringTypeExA
0278 stub GetStringTypeExW
0279 stub GetStringTypeW
0280 stub GetSystemDefaultLCID
0281 stub GetSystemDefaultLangID
0282 stub GetSystemDirectoryA
0283 stub GetSystemDirectoryW
0284 stub GetSystemInfo
0285 stub GetSystemTime
0286 stub GetSystemTimeAdjustment
0287 stub GetTapeParameters
0288 stub GetTapePosition
0289 stub GetTapeStatus
0290 stub GetTempFileNameA
0291 stub GetTempFileNameW
0292 stub GetTempPathA
0293 stub GetTempPathW
0294 stdcall GetThreadContext(long ptr) GetThreadContext
0295 stub GetThreadLocale
0296 stub GetThreadPriority
0297 stub GetThreadSelectorEntry
0298 stub GetThreadTimes
0299 stub GetTickCount
0300 stub GetTimeFormatA
0301 stub GetTimeFormatW
0302 stub GetTimeZoneInformation
0303 stub GetUserDefaultLCID
0304 stub GetUserDefaultLangID
0305 stub GetVDMCurrentDirectories
#Use Win 3.1 GetVersion for now
0306 stdcall GetVersion() GetVersion
0307 stub GetVersionExA
0308 stub GetVersionExW
0309 stub GetVolumeInformationA
0310 stub GetVolumeInformationW
0311 stub GetWindowsDirectoryA
0312 stub GetWindowsDirectoryW
0313 stub GlobalAddAtomA
0314 stub GlobalAddAtomW
0315 stdcall GlobalAlloc(long long) GlobalAlloc32
0316 stub GlobalCompact
0317 stub GlobalDeleteAtom
0318 stub GlobalFindAtomA
0319 stub GlobalFindAtomW
0320 stub GlobalFix
0321 stub GlobalFlags
0322 stub GlobalFree
0323 stub GlobalGetAtomNameA
0324 stub GlobalGetAtomNameW
0325 stub GlobalHandle
0326 stub GlobalLock
0327 stub GlobalMemoryStatus
0328 stub GlobalReAlloc
0329 stub GlobalSize
0330 stub GlobalUnWire
0331 stub GlobalUnfix
0332 stub GlobalUnlock
0333 stub GlobalWire
0334 stub HeapAlloc
0335 stub HeapCompact
0336 stub HeapCreate
0337 stub HeapDestroy
0338 stub HeapFree
0339 stub HeapLock
0340 stub HeapReAlloc
0341 stub HeapSize
0342 stub HeapUnlock
0343 stub HeapValidate
0344 stub HeapWalk
0345 stub InitAtomTable
0346 stub InitializeCriticalSection
0347 stub InterlockedDecrement
0348 stub InterlockedExchange
0349 stub InterlockedIncrement
0350 stub InvalidateConsoleDIBits
0351 stub IsBadCodePtr
0352 stub IsBadHugeReadPtr
0353 stub IsBadHugeWritePtr
0354 stub IsBadReadPtr
0355 stub IsBadStringPtrA
0356 stub IsBadStringPtrW
0357 stub IsBadWritePtr
0358 stub IsDBCSLeadByte
0359 stub IsDBCSLeadByteEx
0360 stub IsValidCodePage
0361 stub IsValidLocale
0362 stub LCMapStringA
0363 stub LCMapStringW
0364 stub LeaveCriticalSection
0365 stub LoadLibraryA
0366 stub LoadLibraryExA
0367 stub LoadLibraryExW
0368 stub LoadLibraryW
0369 stub LoadModule
0370 stub LoadResource
0371 stdcall LocalAlloc(long long) GlobalAlloc32
0372 stub LocalCompact
0373 stub LocalFileTimeToFileTime
0374 stub LocalFlags
0375 stub LocalFree
0376 stub LocalHandle
0377 stub LocalLock
0378 stub LocalReAlloc
0379 stub LocalShrink
0380 stub LocalSize
0381 stub LocalUnlock
0382 stub LockFile
0383 stub LockFileEx
0384 stub LockResource
0385 stub MapViewOfFile
0386 stub MapViewOfFileEx
0387 stub MoveFileA
0388 stub MoveFileExA
0389 stub MoveFileExW
0390 stub MoveFileW
0391 stub MulDiv
0392 stub MultiByteToWideChar
0393 stub OpenConsoleW
0394 stub OpenEventA
0395 stub OpenEventW
0396 stub OpenFile
0397 stub OpenFileMappingA
0398 stub OpenFileMappingW
0399 stub OpenMutexA
0400 stub OpenMutexW
0401 stub OpenProcess
0402 stub OpenProfileUserMapping
0403 stub OpenSemaphoreA
0404 stub OpenSemaphoreW
0405 stub OutputDebugStringA
0406 stub OutputDebugStringW
0407 stub PeekConsoleInputA
0408 stub PeekConsoleInputW
0409 stub PeekNamedPipe
0410 stub PrepareTape
0411 stub PulseEvent
0412 stub PurgeComm
0413 stub QueryDosDeviceA
0414 stub QueryDosDeviceW
0415 stub QueryPerformanceCounter
0416 stub QueryPerformanceFrequency
0417 stub QueryWin31IniFilesMappedToRegistry
0418 stub RaiseException
0419 stub ReadConsoleA
0420 stub ReadConsoleInputA
0421 stub ReadConsoleInputW
0422 stub ReadConsoleOutputA
0423 stub ReadConsoleOutputAttribute
0424 stub ReadConsoleOutputCharacterA
0425 stub ReadConsoleOutputCharacterW
0426 stub ReadConsoleOutputW
0427 stub ReadConsoleW
0428 stub ReadFile
0429 stub ReadFileEx
0430 stub ReadProcessMemory
0431 stub RegisterConsoleVDM
0432 stub RegisterWaitForInputIdle
0433 stub RegisterWowBaseHandlers
0434 stub RegisterWowExec
0435 stub ReleaseMutex
0436 stub ReleaseSemaphore
0437 stub RemoveDirectoryA
0438 stub RemoveDirectoryW
0439 stub ResetEvent
0440 stub ResumeThread
0441 stub RtlFillMemory
0442 stub RtlMoveMemory
0443 stub RtlUnwind
0444 stub RtlZeroMemory
0445 stub ScrollConsoleScreenBufferA
0446 stub ScrollConsoleScreenBufferW
0447 stub SearchPathA
0448 stub SearchPathW
0449 stub SetCommBreak
0450 stub SetCommConfig
0451 stub SetCommMask
0452 stub SetCommState
0453 stub SetCommTimeouts
0454 stub SetComputerNameA
0455 stub SetComputerNameW
0456 stub SetConsoleActiveScreenBuffer
0457 stub SetConsoleCP
0458 stub SetConsoleCommandHistoryMode
0459 stub SetConsoleCtrlHandler
0460 stub SetConsoleCursor
0461 stub SetConsoleCursorInfo
0462 stub SetConsoleCursorPosition
0463 stub SetConsoleDisplayMode
0464 stub SetConsoleFont
0465 stub SetConsoleHardwareState
0466 stub SetConsoleKeyShortcuts
0467 stub SetConsoleMaximumWindowSize
0468 stub SetConsoleMenuClose
0469 stub SetConsoleMode
0470 stub SetConsoleNumberOfCommandsA
0471 stub SetConsoleNumberOfCommandsW
0472 stub SetConsoleOutputCP
0473 stub SetConsolePalette
0474 stub SetConsoleScreenBufferSize
0475 stub SetConsoleTextAttribute
0476 stub SetConsoleTitleA
0477 stub SetConsoleTitleW
0478 stub SetConsoleWindowInfo
0479 stub SetCurrentDirectoryA
0480 stub SetCurrentDirectoryW
0481 stub SetDefaultCommConfigA
0482 stub SetDefaultCommConfigW
0483 stub SetEndOfFile
0484 stub SetEnvironmentVariableA
0485 stub SetEnvironmentVariableW
0486 stub SetErrorMode
0487 stub SetEvent
0488 stub SetFileApisToANSI
0489 stub SetFileApisToOEM
0490 stub SetFileAttributesA
0491 stub SetFileAttributesW
0492 stub SetFilePointer
0493 stub SetFileTime
0494 stub SetHandleCount
0495 stub SetHandleInformation
0496 stub SetLastConsoleEventActive
0497 stub SetLastError
0498 stub SetLocalTime
0499 stub SetLocaleInfoA
0500 stub SetLocaleInfoW
0501 stub SetMailslotInfo
0502 stub SetNamedPipeHandleState
0503 stub SetPriorityClass
0504 stub SetProcessShutdownParameters
0505 stub SetProcessWorkingSetSize
0506 stub SetStdHandle
0507 stub SetSystemTime
0508 stub SetSystemTimeAdjustment
0509 stub SetTapeParameters
0510 stub SetTapePosition
0511 stub SetThreadAffinityMask
0512 stub SetThreadContext
0513 stub SetThreadLocale
0514 stub SetThreadPriority
0515 stub SetTimeZoneInformation
0516 stub SetUnhandledExceptionFilter
0517 stub SetVDMCurrentDirectories
0518 stub SetVolumeLabelA
0519 stub SetVolumeLabelW
0520 stub SetupComm
0521 stub ShowConsoleCursor
0522 stub SizeofResource
0523 stub Sleep
0524 stub SleepEx
0525 stub SuspendThread
0526 stub SystemTimeToFileTime
0527 stub SystemTimeToTzSpecificLocalTime
0528 stub TerminateProcess
0529 stub TerminateThread
0530 stub TlsAlloc
0531 stub TlsFree
0532 stub TlsGetValue
0533 stub TlsSetValue
0534 stub TransactNamedPipe
0535 stub TransmitCommChar
0536 stub TrimVirtualBuffer
0537 stub UnhandledExceptionFilter
0538 stub UnlockFile
0539 stub UnlockFileEx
0540 stub UnmapViewOfFile
0541 stub UpdateResourceA
0542 stub UpdateResourceW
0543 stub VDMConsoleOperation
0544 stub VDMOperationStarted
0545 stub VerLanguageNameA
0546 stub VerLanguageNameW
0547 stub VerifyConsoleIoHandle
0548 stub VirtualAlloc
0549 stub VirtualBufferExceptionHandler
0550 stub VirtualFree
0551 stub VirtualLock
0552 stub VirtualProtect
0553 stub VirtualProtectEx
0554 stub VirtualQuery
0555 stub VirtualQueryEx
0556 stub VirtualUnlock
0557 stub WaitCommEvent
0558 stub WaitForDebugEvent
0559 stub WaitForMultipleObjects
0560 stub WaitForMultipleObjectsEx
0561 stub WaitForSingleObject
0562 stub WaitForSingleObjectEx
0563 stub WaitNamedPipeA
0564 stub WaitNamedPipeW
0565 stub WideCharToMultiByte
0566 stub WinExec
0567 stub WriteConsoleA
0568 stub WriteConsoleInputA
0569 stub WriteConsoleInputVDMA
0570 stub WriteConsoleInputVDMW
0571 stub WriteConsoleInputW
0572 stub WriteConsoleOutputA
0573 stub WriteConsoleOutputAttribute
0574 stub WriteConsoleOutputCharacterA
0575 stub WriteConsoleOutputCharacterW
0576 stub WriteConsoleOutputW
0577 stub WriteConsoleW
0578 stub WriteFile
0579 stub WriteFileEx
0580 stub WritePrivateProfileSectionA
0581 stub WritePrivateProfileSectionW
0582 stub WritePrivateProfileStringA
0583 stub WritePrivateProfileStringW
0584 stub WriteProcessMemory
0585 stub WriteProfileSectionA
0586 stub WriteProfileSectionW
0587 stub WriteProfileStringA
0588 stub WriteProfileStringW
0589 stub WriteTapemark
0590 stub _hread
0591 stub _hwrite
0592 stub _lclose
0593 stub _lcreat
0594 stub _llseek
0595 stub _lopen
0596 stub _lread
0597 stub _lwrite
0598 stub lstrcat
0599 stub lstrcatA
0600 stub lstrcatW
0601 stub lstrcmp
0602 stub lstrcmpA
0603 stub lstrcmpW
0604 stub lstrcmpi
0605 stub lstrcmpiA
0606 stub lstrcmpiW
0607 stub lstrcpy
0608 stub lstrcpyA
0609 stub lstrcpyW
0610 stub lstrcpyn
0611 stub lstrcpynA
0612 stub lstrcpynW
0613 stub lstrlen
0614 stub lstrlenA
0615 stub lstrlenW

View File

@ -1,7 +1,7 @@
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

View File

@ -1,31 +1,14 @@
/*
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 */

112
if1632/relay32.c Normal file
View File

@ -0,0 +1,112 @@
/*
* 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;
}

View File

@ -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

87
if1632/shell32.spec Normal file
View File

@ -0,0 +1,87 @@
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

View File

@ -1,13 +1,13 @@
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

View File

@ -1,4 +1,13 @@
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

View File

@ -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

591
if1632/user32.spec Normal file
View File

@ -0,0 +1,591 @@
name user32
base 1
0000 stub ActivateKeyboardLayout
0001 stub AdjustWindowRect
0002 stub AdjustWindowRectEx
0003 stub AnyPopup
0004 stub AppendMenuA
0005 stub AppendMenuW
0006 stub ArrangeIconicWindows
0007 stub AttachThreadInput
0008 stub BeginDeferWindowPos
0009 stub BeginPaint
0010 stub BringWindowToTop
0011 stub BroadcastSystemMessage
0012 stub CalcChildScroll
0013 stub CallMsgFilter
0014 stub CallMsgFilterA
0015 stub CallMsgFilterW
0016 stub CallNextHookEx
0017 stub CallWindowProcA
0018 stub CallWindowProcW
0019 stub CascadeChildWindows
0020 stub CascadeWindows
0021 stub ChangeClipboardChain
0022 stub ChangeMenuA
0023 stub ChangeMenuW
0024 stub CharLowerA
0025 stub CharLowerBuffA
0026 stub CharLowerBuffW
0027 stub CharLowerW
0028 stub CharNextA
0029 stub CharNextExA
0030 stub CharNextExW
0031 stub CharNextW
0032 stub CharPrevA
0033 stub CharPrevExA
0034 stub CharPrevExW
0035 stub CharPrevW
0036 stub CharToOemA
0037 stub CharToOemBuffA
0038 stub CharToOemBuffW
0039 stub CharToOemW
0040 stub CharUpperA
0041 stub CharUpperBuffA
0042 stub CharUpperBuffW
0043 stub CharUpperW
0044 stub CheckDlgButton
0045 stub CheckMenuItem
0046 stub CheckMenuRadioItem
0047 stub CheckRadioButton
0048 stub ChildWindowFromPoint
0049 stub ChildWindowFromPointEx
0050 stub ClientThreadConnect
0051 stub ClientToScreen
0052 stub ClipCursor
0053 stub CloseClipboard
0054 stub CloseDesktop
0055 stub CloseWindow
0056 stub CloseWindowStation
0057 stub CopyAcceleratorTableA
0058 stub CopyAcceleratorTableW
0059 stub CopyIcon
0060 stub CopyImage
0061 stub CopyRect
0062 stub CountClipboardFormats
0063 stub CreateAcceleratorTableA
0064 stub CreateAcceleratorTableW
0065 stub CreateCaret
0066 stub CreateCursor
0067 stub CreateDesktopA
0068 stub CreateDesktopW
0069 stub CreateDialogIndirectParamA
0070 stub CreateDialogIndirectParamAorW
0071 stub CreateDialogIndirectParamW
0072 stub CreateDialogParamA
0073 stub CreateDialogParamW
0074 stub CreateIcon
0075 stub CreateIconFromResource
0076 stub CreateIconFromResourceEx
0077 stub CreateIconIndirect
0078 stub CreateMDIWindowA
0079 stub CreateMDIWindowW
0080 stub CreateMenu
0081 stub CreatePopupMenu
0082 stub CreateWindowExA
0083 stub CreateWindowExW
0084 stub CreateWindowStationA
0085 stub CreateWindowStationW
0086 stub DdeAbandonTransaction
0087 stub DdeAccessData
0088 stub DdeAddData
0089 stub DdeClientTransaction
0090 stub DdeCmpStringHandles
0091 stub DdeConnect
0092 stub DdeConnectList
0093 stub DdeCreateDataHandle
0094 stub DdeCreateStringHandleA
0095 stub DdeCreateStringHandleW
0096 stub DdeDisconnect
0097 stub DdeDisconnectList
0098 stub DdeEnableCallback
0099 stub DdeFreeDataHandle
0100 stub DdeFreeStringHandle
0101 stub DdeGetData
0102 stub DdeGetLastError
0103 stub DdeGetQualityOfService
0104 stub DdeImpersonateClient
0105 stub DdeInitializeA
0106 stub DdeInitializeW
0107 stub DdeKeepStringHandle
0108 stub DdeNameService
0109 stub DdePostAdvise
0110 stub DdeQueryConvInfo
0111 stub DdeQueryNextServer
0112 stub DdeQueryStringA
0113 stub DdeQueryStringW
0114 stub DdeReconnect
0115 stub DdeSetQualityOfService
0116 stub DdeSetUserHandle
0117 stub DdeUnaccessData
0118 stub DdeUninitialize
0119 stub DefDlgProcA
0120 stub DefDlgProcW
0121 stub DefFrameProcA
0122 stub DefFrameProcW
0123 stub DefMDIChildProcA
0124 stub DefMDIChildProcW
0125 stub DefWindowProcA
0126 stub DefWindowProcW
0127 stub DeferWindowPos
0128 stub DeleteMenu
0129 stub DestroyAcceleratorTable
0130 stub DestroyCaret
0131 stub DestroyCursor
0132 stub DestroyIcon
0133 stub DestroyMenu
0134 stub DestroyWindow
0135 stub DialogBoxIndirectParamA
0136 stub DialogBoxIndirectParamAorW
0137 stub DialogBoxIndirectParamW
0138 stub DialogBoxParamA
0139 stub DialogBoxParamW
0140 stub DispatchMessageA
0141 stub DispatchMessageW
0142 stub DlgDirListA
0143 stub DlgDirListComboBoxA
0144 stub DlgDirListComboBoxW
0145 stub DlgDirListW
0146 stub DlgDirSelectComboBoxExA
0147 stub DlgDirSelectComboBoxExW
0148 stub DlgDirSelectExA
0149 stub DlgDirSelectExW
0150 stub DragDetect
0151 stub DragObject
0152 stub DrawAnimatedRects
0153 stub DrawCaption
0154 stub DrawEdge
0155 stub DrawFocusRect
0156 stub DrawFrame
0157 stub DrawFrameControl
0158 stub DrawIcon
0159 stub DrawIconEx
0160 stub DrawMenuBar
0161 stub DrawStateA
0162 stub DrawStateW
0163 stub DrawTextA
0164 stub DrawTextExA
0165 stub DrawTextExW
0166 stub DrawTextW
0167 stub EditWndProc
0168 stub EmptyClipboard
0169 stub EnableMenuItem
0170 stub EnableScrollBar
0171 stub EnableWindow
0172 stub EndDeferWindowPos
0173 stub EndDialog
0174 stub EndMenu
0175 stub EndPaint
0176 stub EndTask
0177 stub EnumChildWindows
0178 stub EnumClipboardFormats
0179 stub EnumDesktopsA
0180 stub EnumDesktopsW
0181 stub EnumDisplayDeviceModesA
0182 stub EnumDisplayDeviceModesW
0183 stub EnumDisplayDevicesA
0184 stub EnumDisplayDevicesW
0185 stub EnumPropsA
0186 stub EnumPropsExA
0187 stub EnumPropsExW
0188 stub EnumPropsW
0189 stub EnumThreadWindows
0190 stub EnumWindowStationsA
0191 stub EnumWindowStationsW
0192 stub EnumWindows
0193 stub EqualRect
0194 stub ExcludeUpdateRgn
0195 stub ExitWindowsEx
0196 stub FillRect
0197 stub FindWindowA
0198 stub FindWindowExA
0199 stub FindWindowExW
0200 stub FindWindowW
0201 stub FlashWindow
0202 stub FrameRect
0203 stub FreeDDElParam
0204 stub GetActiveWindow
0205 stub GetAppCompatFlags
0206 stub GetAsyncKeyState
0207 stub GetCapture
0208 stub GetCaretBlinkTime
0209 stub GetCaretPos
0210 stub GetClassInfoA
0211 stub GetClassInfoExA
0212 stub GetClassInfoExW
0213 stub GetClassInfoW
0214 stub GetClassLongA
0215 stub GetClassLongW
0216 stub GetClassNameA
0217 stub GetClassNameW
0218 stub GetClassWord
0219 stub GetClientRect
0220 stub GetClipCursor
0221 stub GetClipboardData
0222 stub GetClipboardFormatNameA
0223 stub GetClipboardFormatNameW
0224 stub GetClipboardOwner
0225 stub GetClipboardViewer
0226 stub GetCursor
0227 stub GetCursorInfo
0228 stub GetCursorPos
0229 stub GetDC
0230 stub GetDCEx
0231 stub GetDesktopWindow
0232 stub GetDialogBaseUnits
0233 stub GetDlgCtrlID
0234 stub GetDlgItem
0235 stub GetDlgItemInt
0236 stub GetDlgItemTextA
0237 stub GetDlgItemTextW
0238 stub GetDoubleClickTime
0239 stub GetFocus
0240 stub GetForegroundWindow
0241 stub GetIconInfo
0242 stub GetInputDesktop
0243 stub GetInputState
0244 stub GetInternalWindowPos
0245 stub GetKBCodePage
0246 stub GetKeyNameTextA
0247 stub GetKeyNameTextW
0248 stub GetKeyState
0249 stub GetKeyboardLayout
0250 stub GetKeyboardLayoutList
0251 stub GetKeyboardLayoutNameA
0252 stub GetKeyboardLayoutNameW
0253 stub GetKeyboardState
0254 stub GetKeyboardType
0255 stub GetLastActivePopup
0256 stub GetMenu
0257 stub GetMenuCheckMarkDimensions
0258 stub GetMenuContextHelpId
0259 stub GetMenuDefaultItem
0260 stub GetMenuIndex
0261 stub GetMenuItemCount
0262 stub GetMenuItemID
0263 stub GetMenuItemInfoA
0264 stub GetMenuItemInfoW
0265 stub GetMenuItemRect
0266 stub GetMenuState
0267 stub GetMenuStringA
0268 stub GetMenuStringW
0269 stub GetMessageA
0270 stub GetMessageExtraInfo
0271 stub GetMessagePos
0272 stub GetMessageTime
0273 stub GetMessageW
0274 stub GetNextDlgGroupItem
0275 stub GetNextDlgTabItem
0276 stub GetOpenClipboardWindow
0277 stub GetParent
0278 stub GetPriorityClipboardFormat
0279 stub GetProcessWindowStation
0280 stub GetPropA
0281 stub GetPropW
0282 stub GetQueueStatus
0283 stub GetScrollInfo
0284 stub GetScrollPos
0285 stub GetScrollRange
0286 stub GetShellWindow
0287 stub GetSubMenu
0288 stub GetSysColor
0289 stub GetSysColorBrush
0290 stub GetSystemMenu
0291 stub GetSystemMetrics
0292 stub GetTabbedTextExtentA
0293 stub GetTabbedTextExtentW
0294 stub GetThreadDesktop
0295 stub GetTopWindow
0296 stub GetUpdateRect
0297 stub GetUpdateRgn
0298 stub GetUserObjectInformationA
0299 stub GetUserObjectInformationW
0300 stub GetUserObjectSecurity
0301 stub GetWindow
0302 stub GetWindowContextHelpId
0303 stub GetWindowDC
0304 stub GetWindowLongA
0305 stub GetWindowLongW
0306 stub GetWindowPlacement
0307 stub GetWindowRect
0308 stub GetWindowTextA
0309 stub GetWindowTextLengthA
0310 stub GetWindowTextLengthW
0311 stub GetWindowTextW
0312 stub GetWindowThreadProcessId
0313 stub GetWindowWord
0314 stub GrayStringA
0315 stub GrayStringW
0316 stub HideCaret
0317 stub HiliteMenuItem
0318 stub ImpersonateDdeClientWindow
0319 stub InSendMessage
0320 stub InflateRect
0321 stub InsertMenuA
0322 stub InsertMenuItemA
0323 stub InsertMenuItemW
0324 stub InsertMenuW
0325 stub InternalGetWindowText
0326 stub IntersectRect
0327 stub InvalidateRect
0328 stub InvalidateRgn
0329 stub InvertRect
0330 stub IsCharAlphaA
0331 stub IsCharAlphaNumericA
0332 stub IsCharAlphaNumericW
0333 stub IsCharAlphaW
0334 stub IsCharLowerA
0335 stub IsCharLowerW
0336 stub IsCharUpperA
0337 stub IsCharUpperW
0338 stub IsChild
0339 stub IsClipboardFormatAvailable
0340 stub IsDialogMessage
0341 stub IsDialogMessageA
0342 stub IsDialogMessageW
0343 stub IsDlgButtonChecked
0344 stub IsIconic
0345 stub IsMenu
0346 stub IsRectEmpty
0347 stub IsWindow
0348 stub IsWindowEnabled
0349 stub IsWindowUnicode
0350 stub IsWindowVisible
0351 stub IsZoomed
0352 stub KillSystemTimer
0353 stub KillTimer
0354 stub LoadAcceleratorsA
0355 stub LoadAcceleratorsW
0356 stub LoadBitmapA
0357 stub LoadBitmapW
0358 stub LoadCursorA
0359 stub LoadCursorFromFileA
0360 stub LoadCursorFromFileW
0361 stub LoadCursorW
0362 stub LoadIconA
0363 stub LoadIconW
0364 stub LoadImageA
0365 stub LoadImageW
0366 stub LoadKeyboardLayoutA
0367 stub LoadKeyboardLayoutW
0368 stub LoadLocalFonts
0369 stub LoadMenuA
0370 stub LoadMenuIndirectA
0371 stub LoadMenuIndirectW
0372 stub LoadMenuW
0373 stub LoadRemoteFonts
0374 stub LoadStringA
0375 stub LoadStringW
0376 stub LockWindowStation
0377 stub LockWindowUpdate
0378 stub LookupIconIdFromDirectory
0379 stub LookupIconIdFromDirectoryEx
0380 stub MBToWCSEx
0381 stub MapDialogRect
0382 stub MapVirtualKeyA
0383 stub MapVirtualKeyExA
0384 stub MapVirtualKeyW
0385 stub MapWindowPoints
0386 stub MenuItemFromPoint
0387 stub MenuWindowProcA
0388 stub MenuWindowProcW
0389 stub MessageBeep
0390 stdcall MessageBoxA(long ptr ptr long) MessageBox
0391 stub MessageBoxExA
0392 stub MessageBoxExW
0393 stub MessageBoxIndirectA
0394 stub MessageBoxIndirectW
0395 stub MessageBoxW
0396 stub ModifyMenuA
0397 stub ModifyMenuW
0398 stub MoveWindow
0399 stub MsgWaitForMultipleObjects
0400 stub OemKeyScan
0401 stub OemToCharA
0402 stub OemToCharBuffA
0403 stub OemToCharBuffW
0404 stub OemToCharW
0405 stub OffsetRect
0406 stub OpenClipboard
0407 stub OpenDesktopA
0408 stub OpenDesktopW
0409 stub OpenIcon
0410 stub OpenInputDesktop
0411 stub OpenWindowStationA
0412 stub OpenWindowStationW
0413 stub PackDDElParam
0414 stub PaintDesktop
0415 stub PeekMessageA
0416 stub PeekMessageW
0417 stub PlaySoundEvent
0418 stub PostMessageA
0419 stub PostMessageW
0420 stub PostQuitMessage
0421 stub PostThreadMessageA
0422 stub PostThreadMessageW
0423 stub PtInRect
0424 stub QuerySendMessage
0425 stub RedrawWindow
0426 stub RegisterClassA
0427 stub RegisterClassExA
0428 stub RegisterClassExW
0429 stub RegisterClassW
0430 stub RegisterClipboardFormatA
0431 stub RegisterClipboardFormatW
0432 stub RegisterHotKey
0433 stub RegisterLogonProcess
0434 stub RegisterSystemThread
0435 stub RegisterTasklist
0436 stub RegisterWindowMessageA
0437 stub RegisterWindowMessageW
0438 stub ReleaseCapture
0439 stub ReleaseDC
0440 stub RemoveMenu
0441 stub RemovePropA
0442 stub RemovePropW
0443 stub ReplyMessage
0444 stub ResetDisplay
0445 stub ReuseDDElParam
0446 stub ScreenToClient
0447 stub ScrollChildren
0448 stub ScrollDC
0449 stub ScrollWindow
0450 stub ScrollWindowEx
0451 stub SendDlgItemMessageA
0452 stub SendDlgItemMessageW
0453 stub SendMessageA
0454 stub SendMessageCallbackA
0455 stub SendMessageCallbackW
0456 stub SendMessageTimeoutA
0457 stub SendMessageTimeoutW
0458 stub SendMessageW
0459 stub SendNotifyMessageA
0460 stub SendNotifyMessageW
0461 stub ServerSetFunctionPointers
0462 stub SetActiveWindow
0463 stub SetCapture
0464 stub SetCaretBlinkTime
0465 stub SetCaretPos
0466 stub SetClassLongA
0467 stub SetClassLongW
0468 stub SetClassWord
0469 stub SetClipboardData
0470 stub SetClipboardViewer
0471 stub SetCursor
0472 stub SetCursorContents
0473 stub SetCursorPos
0474 stub SetDebugErrorLevel
0475 stub SetDeskWallpaper
0476 stub SetDlgItemInt
0477 stub SetDlgItemTextA
0478 stub SetDlgItemTextW
0479 stub SetDoubleClickTime
0480 stub SetFocus
0481 stub SetForegroundWindow
0482 stub SetInternalWindowPos
0483 stub SetKeyboardState
0484 stub SetLastErrorEx
0485 stub SetLogonNotifyWindow
0486 stub SetMenu
0487 stub SetMenuContextHelpId
0488 stub SetMenuDefaultItem
0489 stub SetMenuItemBitmaps
0490 stub SetMenuItemInfoA
0491 stub SetMenuItemInfoW
0492 stub SetMessageExtraInfo
0493 stub SetMessageQueue
0494 stub SetParent
0495 stub SetProcessWindowStation
0496 stub SetPropA
0497 stub SetPropW
0498 stub SetRect
0499 stub SetRectEmpty
0500 stub SetScrollInfo
0501 stub SetScrollPos
0502 stub SetScrollRange
0503 stub SetShellWindow
0504 stub SetSysColors
0505 stub SetSysColorsTemp
0506 stub SetSystemCursor
0507 stub SetSystemMenu
0508 stub SetSystemTimer
0509 stub SetThreadDesktop
0510 stub SetTimer
0511 stub SetUserObjectInformationA
0512 stub SetUserObjectInformationW
0513 stub SetUserObjectSecurity
0514 stub SetWindowContextHelpId
0515 stub SetWindowFullScreenState
0516 stub SetWindowLongA
0517 stub SetWindowLongW
0518 stub SetWindowPlacement
0519 stub SetWindowPos
0520 stub SetWindowStationUser
0521 stub SetWindowTextA
0522 stub SetWindowTextW
0523 stub SetWindowWord
0524 stub SetWindowsHookA
0525 stub SetWindowsHookExA
0526 stub SetWindowsHookExW
0527 stub SetWindowsHookW
0528 stub ShowCaret
0529 stub ShowCursor
0530 stub ShowOwnedPopups
0531 stub ShowScrollBar
0532 stub ShowStartGlass
0533 stub ShowWindow
0534 stub ShowWindowAsync
0535 stub SubtractRect
0536 stub SwapMouseButton
0537 stub SwitchDesktop
0538 stub SwitchToThisWindow
0539 stub SystemParametersInfoA
0540 stub SystemParametersInfoW
0541 stub TabbedTextOutA
0542 stub TabbedTextOutW
0543 stub TileChildWindows
0544 stub TileWindows
0545 stub ToAscii
0546 stub ToAsciiEx
0547 stub ToUnicode
0548 stub TrackPopupMenu
0549 stub TrackPopupMenuEx
0550 stub TranslateAccelerator
0551 stub TranslateAcceleratorA
0552 stub TranslateAcceleratorW
0553 stub TranslateCharsetInfo
0554 stub TranslateMDISysAccel
0555 stub TranslateMessage
0556 stub UnhookWindowsHook
0557 stub UnhookWindowsHookEx
0558 stub UnionRect
0559 stub UnloadKeyboardLayout
0560 stub UnlockWindowStation
0561 stub UnpackDDElParam
0562 stub UnregisterClassA
0563 stub UnregisterClassW
0564 stub UnregisterHotKey
0565 stub UpdatePerUserSystemParameters
0566 stub UpdateWindow
0567 stub UserClientDllInitialize
0568 stub UserRealizePalette
0569 stub UserRegisterWowHandlers
0570 stub ValidateRect
0571 stub ValidateRgn
0572 stub VkKeyScanA
0573 stub VkKeyScanExA
0574 stub VkKeyScanExW
0575 stub VkKeyScanW
0576 stub WaitForInputIdle
0577 stub WaitMessage
0578 stub WinHelpA
0579 stub WinHelpW
0580 stub WindowFromDC
0581 stub WindowFromPoint
0582 stub keybd_event
0583 stub mouse_event
0584 stub wsprintfA
0585 stub wsprintfW
0586 stub wvsprintfA
0587 stub wvsprintfW

View File

@ -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

25
if1632/winprocs32.spec Normal file
View File

@ -0,0 +1,25 @@
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

23
include/bitmaps/obm_cdrom Normal file
View File

@ -0,0 +1,23 @@
/* 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. ",
" .................. ",
" ",
" "};

23
include/bitmaps/obm_drive Normal file
View File

@ -0,0 +1,23 @@
/* 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. ",
" .................. ",
" ",
" "};

View File

@ -0,0 +1,22 @@
/* 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. ",
" .............. ",
" ",
" "};

View File

@ -0,0 +1,21 @@
/* 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. ",
" ............. ",
" "};

View File

@ -0,0 +1,23 @@
/* 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. ",
" .................. ",
" ",
" "};

View File

@ -0,0 +1,41 @@
/* 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 ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@ -0,0 +1,41 @@
/* 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 "};

View File

@ -0,0 +1,43 @@
/* 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 "};

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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 */
};
#define DECLARE_DLL(name) \
extern BYTE name##_Code_Start[]; \
extern BYTE name##_Data_Start[]; \
extern BYTE name##_Module_Start[]; \
extern BYTE name##_Module_End[];
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;
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
extern struct dll_table_s dll_builtin_table[];
#endif /* DLLS_H */

View File

@ -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];

View File

@ -1,17 +0,0 @@
#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 */

View File

@ -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)))

View File

@ -1,14 +0,0 @@
#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 */

View File

@ -1,39 +1,70 @@
/*
* 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);

View File

@ -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;

View File

@ -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 */

View File

@ -1,10 +0,0 @@
#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 */

View File

@ -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;

View File

@ -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 */

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -1,26 +0,0 @@
/*
* 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;

View File

@ -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)

View File

@ -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

2
include/winerror.h Normal file
View File

@ -0,0 +1,2 @@
extern int WIN32_LastError;
#define ERROR_CALL_NOT_IMPLEMENTED 120

View File

@ -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)))

View File

@ -13,7 +13,6 @@ SRCS = \
pe_resource.c \
selector.c \
signal.c \
library.c \
resource.c \
task.c

View File

@ -180,12 +180,17 @@ 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++)
#ifdef linux
n = modify_ldt( 0, buffer, sizeof(buffer) ) / 8;
#endif /* linux */
#if defined(__NetBSD__) || defined(__FreeBSD__)
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 );
if (content.base || content.limit)
@ -197,25 +202,5 @@ void LDT_Print()
content.type );
}
}
#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++)
{
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 );
}
}
#endif /* __NetBSD__ || __FreeBSD__ */
#endif /* WINELIB */
}

View File

@ -1,351 +0,0 @@
/*
* 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;
}

View File

@ -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" );

View File

@ -12,20 +12,19 @@
#include <unistd.h>
#include "windows.h"
#include "dlls.h"
#include "dos_fs.h"
#include "global.h"
#include "ldt.h"
#include "module.h"
#include "neexe.h"
#include "stackframe.h"
#include "task.h"
#include "toolhelp.h"
#include "stddebug.h"
/* #define DEBUG_MODULE */
#include "debug.h"
extern BYTE KERNEL_Module_Start[], KERNEL_Module_End[];
extern struct dll_name_table_entry_s dll_builtin_table[];
static HMODULE hFirstModule = 0;
@ -36,18 +35,20 @@ static HMODULE hFirstModule = 0;
*/
BOOL MODULE_Init(void)
{
extern void load_entrypoints( HMODULE );
HMODULE hModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
struct dll_table_s *table;
char *dosmem;
int i;
/* Create the built-in modules */
for (i = 0; i < N_BUILTINS; i++)
for (i = 0, table = dll_builtin_table; i < N_BUILTINS; i++, table++)
{
if (!dll_builtin_table[i].dll_is_used) continue;
table = dll_builtin_table[i].table;
if (!table->used) continue;
hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, table->module_start,
table->module_end - table->module_start,
@ -58,7 +59,7 @@ BOOL MODULE_Init(void)
table->hModule = hModule;
dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n",
dll_builtin_table[i].dll_name, hModule );
table->name, hModule );
/* Allocate the code segment */
@ -81,7 +82,51 @@ BOOL MODULE_Init(void)
pModule->next = hFirstModule;
hFirstModule = hModule;
load_entrypoints( hModule );
}
/* Initialize some KERNEL exported values */
if (!(hModule = GetModuleHandle( "KERNEL" ))) return TRUE;
/* KERNEL.178: __WINFLAGS */
MODULE_SetEntryPoint( hModule, 178, GetWinFlags() );
/* Allocate 7 64k segments for 0000, A000, B000, C000, D000, E000, F000. */
dosmem = malloc( 0x70000 );
MODULE_SetEntryPoint( hModule, 183, /* KERNEL.183: __0000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 193, /* KERNEL.193: __0040H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x400,
0x100, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 174, /* KERNEL.174: __A000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x10000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 181, /* KERNEL.181: __B000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x20000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 182, /* KERNEL.182: __B800H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x28000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 195, /* KERNEL.195: __C000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x30000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 179, /* KERNEL.179: __D000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x40000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 190, /* KERNEL.190: __E000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x50000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 173, /* KERNEL.173: __ROMBIOS */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x60000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
MODULE_SetEntryPoint( hModule, 194, /* KERNEL.194: __F000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem + 0x60000,
0x10000, hModule, FALSE, FALSE, FALSE ) );
return TRUE;
}
@ -237,7 +282,7 @@ int MODULE_OpenFile( HMODULE hModule )
close( cachedfd );
hCachedModule = hModule;
name = ((LOADEDFILEINFO*)((char*)pModule + pModule->fileinfo))->filename;
cachedfd = open( name /* DOS_GetUnixFileName( name ) */, O_RDONLY );
cachedfd = open( DOS_GetUnixFileName( name ), O_RDONLY );
dprintf_module( stddeb, "MODULE_OpenFile: opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
@ -263,7 +308,9 @@ BOOL MODULE_CreateSegments( HMODULE hModule )
{
/* FIXME: this is needed because heap growing is not implemented */
pModule->heap_size = 0x10000 - minsize;
/* For tasks, the DGROUP is allocated by MODULE_MakeNewInstance */
minsize = 0x10000;
if (!(pModule->flags & NE_FFLAGS_LIBMODULE)) continue;
}
pSegment->selector = GLOBAL_Alloc( GMEM_ZEROINIT | GMEM_FIXED,
minsize, hModule,
@ -282,7 +329,7 @@ BOOL MODULE_CreateSegments( HMODULE hModule )
/***********************************************************************
* MODULE_LoadExeHeader
*/
HMODULE MODULE_LoadExeHeader( int fd, char *filename )
HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
{
struct mz_header_s mz_header;
struct ne_header_s ne_header;
@ -316,7 +363,7 @@ HMODULE MODULE_LoadExeHeader( int fd, char *filename )
size = sizeof(NE_MODULE) +
/* loaded file info */
sizeof(LOADEDFILEINFO) + strlen(filename) +
sizeof(LOADEDFILEINFO) + strlen(ofs->szPathName) +
/* segment table */
ne_header.n_segment_tab * sizeof(SEGTABLEENTRY) +
/* resource table */
@ -335,6 +382,7 @@ HMODULE MODULE_LoadExeHeader( int fd, char *filename )
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock( hModule );
memcpy( pModule, &ne_header, sizeof(NE_MODULE) );
pModule->count = 0;
pData = (BYTE *)(pModule + 1);
/* Read the fast-load area */
@ -359,12 +407,12 @@ HMODULE MODULE_LoadExeHeader( int fd, char *filename )
/* Store the filename information */
pModule->fileinfo = (int)pData - (int)pModule;
((LOADEDFILEINFO*)pData)->length = sizeof(LOADEDFILEINFO)+strlen(filename);
((LOADEDFILEINFO*)pData)->length = sizeof(LOADEDFILEINFO)+strlen(ofs->szPathName);
((LOADEDFILEINFO*)pData)->fixed_media = TRUE;
((LOADEDFILEINFO*)pData)->error = 0;
((LOADEDFILEINFO*)pData)->date = 0;
((LOADEDFILEINFO*)pData)->time = 0;
strcpy( ((LOADEDFILEINFO*)pData)->filename, filename );
strcpy( ((LOADEDFILEINFO*)pData)->filename, ofs->szPathName );
pData += ((LOADEDFILEINFO*)pData)->length--;
/* Get the segment table */
@ -451,6 +499,17 @@ HMODULE MODULE_LoadExeHeader( int fd, char *filename )
}
else pModule->nrname_handle = 0;
/* Allocate a segment for the implicitly-loaded DLLs */
if (pModule->modref_count)
{
pModule->dlls_to_init = GLOBAL_Alloc(GMEM_ZEROINIT,
(pModule->modref_count+1)*sizeof(HMODULE),
hModule, FALSE, FALSE, FALSE );
if (!pModule->dlls_to_init) return 11; /* invalid exe */
}
else pModule->dlls_to_init = 0;
if (debugging_module) MODULE_PrintModule( hModule );
pModule->next = hFirstModule;
hFirstModule = hModule;
@ -458,6 +517,62 @@ HMODULE MODULE_LoadExeHeader( int fd, char *filename )
}
/***********************************************************************
* MODULE_MakeNewInstance
*
* Create a new instance of the specified module.
*/
HINSTANCE MODULE_MakeNewInstance( HMODULE hModule, LOADPARAMS *params )
{
NE_MODULE *pModule;
SEGTABLEENTRY *pSegment;
HINSTANCE hNewInstance, hPrevInstance;
int minsize;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
if (!pModule->dgroup) return hModule; /* No DGROUP -> return the module */
pSegment = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1;
hPrevInstance = pSegment->selector;
/* Don't create a new instance if it's a library */
if (pModule->flags & NE_FFLAGS_LIBMODULE) return hPrevInstance;
if (params == (LOADPARAMS*)-1) return hPrevInstance;
/* Allocate the new data segment */
minsize = pSegment->minsize ? pSegment->minsize : 0x10000;
if (pModule->ss == pModule->dgroup) minsize += pModule->stack_size;
minsize += pModule->heap_size;
hNewInstance = GLOBAL_Alloc( GMEM_ZEROINIT | GMEM_FIXED,
minsize, hModule, FALSE, FALSE, FALSE );
if (!hNewInstance) return 0;
pSegment->selector = hNewInstance;
NE_LoadSegment( hModule, pModule->dgroup );
/* Create a new task for this instance */
if (!TASK_CreateTask( hModule, hNewInstance, hPrevInstance,
params->hEnvironment,
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
*((WORD *)PTR_SEG_TO_LIN(params->showCmd)+1) ))
{
GlobalFree( hNewInstance );
return 0;
}
/* Initialize the local heap */
if (pModule->heap_size)
{
WORD heapstart = pSegment->minsize;
if (pModule->ss == pModule->dgroup) heapstart += pModule->stack_size;
LocalInit( hNewInstance, heapstart, heapstart + pModule->heap_size );
}
return hNewInstance;
}
/***********************************************************************
* MODULE_GetOrdinal
*
@ -538,8 +653,6 @@ DWORD MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal )
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
dprintf_module( stddeb, "MODULE_GetEntryPoint(%04x,%d)\n",
hModule, ordinal );
p = (BYTE *)pModule + pModule->entry_table;
while (*p && (curOrdinal + *p <= ordinal))
{
@ -552,16 +665,11 @@ DWORD MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal )
default: p += 2 + *p * 3; break; /* fixed */
}
}
if (!*p)
{
dprintf_module( stddeb, " Not found (last=%d)\n", curOrdinal-1 );
return 0;
}
if (!*p) return 0;
switch(p[1])
{
case 0: /* unused */
dprintf_module( stddeb, " Found, but entry is unused\n" );
return 0;
case 0xff: /* moveable */
p += 2 + 6 * (ordinal - curOrdinal);
@ -575,14 +683,93 @@ DWORD MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal )
break;
}
dprintf_module( stddeb, " Found, logical addr = %04x:%04x\n",
sel, offset );
if (sel == 0xfe) sel = 0xffff; /* constant entry */
else sel = NE_SEG_TABLE(pModule)[sel-1].selector;
return MAKELONG( offset, sel );
}
/***********************************************************************
* MODULE_SetEntryPoint
*
* Change the value of an entry point. Use with caution!
* It can only change the offset value, not the selector.
*/
BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
BYTE *p;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return FALSE;
p = (BYTE *)pModule + pModule->entry_table;
while (*p && (curOrdinal + *p <= ordinal))
{
/* Skipping this bundle */
curOrdinal += *p;
switch(p[1])
{
case 0: p += 2; break; /* unused */
case 0xff: p += 2 + *p * 6; break; /* moveable */
default: p += 2 + *p * 3; break; /* fixed */
}
}
if (!*p) return FALSE;
switch(p[1])
{
case 0: /* unused */
return FALSE;
case 0xff: /* moveable */
p += 2 + 6 * (ordinal - curOrdinal);
*(WORD *)(p + 4) = offset;
break;
default: /* fixed */
p += 2 + 3 * (ordinal - curOrdinal);
*(WORD *)(p + 1) = offset;
break;
}
return TRUE;
}
/***********************************************************************
* MODULE_GetEntryPointName
*
* Return the entry point name for a given ordinal.
* Used only by relay debugging.
* Warning: returned pointer is to a Pascal-type string.
*/
LPSTR MODULE_GetEntryPointName( HMODULE hModule, WORD ordinal )
{
register char *cpnt;
NE_MODULE *pModule;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
/* First search the resident names */
cpnt = (char *)pModule + pModule->name_table;
while (*cpnt)
{
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD *)(cpnt + *cpnt + 1) == ordinal) return cpnt;
}
/* Now search the non-resident names table */
if (!pModule->nrname_handle) return 0; /* No non-resident table */
cpnt = (char *)GlobalLock( pModule->nrname_handle );
while (*cpnt)
{
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD *)(cpnt + *cpnt + 1) == ordinal) return cpnt;
}
return NULL;
}
/***********************************************************************
* MODULE_GetModuleName
*/
@ -601,11 +788,209 @@ LPSTR MODULE_GetModuleName( HMODULE hModule )
}
/**********************************************************************
* MODULE_FindModule
*
* Find a module from a path name.
*/
HMODULE MODULE_FindModule( LPCSTR path )
{
HMODULE hModule = hFirstModule;
LPCSTR filename, dotptr, modulepath, modulename;
BYTE len, *name_table;
if (!(filename = strrchr( path, '\\' ))) filename = path;
if ((dotptr = strrchr( filename, '.' )) != NULL)
len = (BYTE)(dotptr - filename);
else len = strlen( filename );
while(hModule)
{
NE_MODULE *pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule) break;
modulepath = ((LOADEDFILEINFO*)((char*)pModule + pModule->fileinfo))->filename;
if (!(modulename = strrchr( modulepath, '\\' )))
modulename = modulepath;
if (!strcasecmp( modulename, filename )) return hModule;
name_table = (BYTE *)pModule + pModule->name_table;
if ((*name_table == len) && !strncasecmp(filename, name_table+1, len))
return hModule;
hModule = pModule->next;
}
return 0;
}
/**********************************************************************
* MODULE_FreeModule
*
* Remove a module from memory.
*/
static void MODULE_FreeModule( HMODULE hModule )
{
HMODULE *hPrevModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegment;
WORD *pModRef;
int i;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return;
/* FIXME: should call the exit code for the library here */
/* Remove it from the linked list */
hPrevModule = &hFirstModule;
while (*hPrevModule && (*hPrevModule != hModule))
{
hPrevModule = &((NE_MODULE *)GlobalLock( *hPrevModule ))->next;
}
if (*hPrevModule) *hPrevModule = pModule->next;
/* Free all the segments */
pSegment = NE_SEG_TABLE( pModule );
for (i = 1; i <= pModule->seg_count; i++, pSegment++)
{
GlobalFree( pSegment->selector );
}
/* Free the referenced modules */
pModRef = NE_MODULE_TABLE( pModule );
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
FreeModule( *pModRef );
}
/* Free the module storage */
if (pModule->nrname_handle) GlobalFree( pModule->nrname_handle );
if (pModule->dlls_to_init) GlobalFree( pModule->dlls_to_init );
GlobalFree( hModule );
}
/**********************************************************************
* LoadModule (KERNEL.45)
*/
HINSTANCE MODULE_LoadModule( LPCSTR name, LPVOID paramBlock )
HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
{
HMODULE hModule;
HANDLE hInstance;
NE_MODULE *pModule;
WORD *pModRef, *pDLLs;
int i, fd;
hModule = MODULE_FindModule( name );
if (!hModule) /* We have to load the module */
{
OFSTRUCT ofs;
if (strchr( name, '/' )) name = DOS_GetDosFileName( name );
if ((fd = OpenFile( name, &ofs, OF_READ )) == -1)
return 2; /* File not found */
/* Create the module structure */
if ((hModule = MODULE_LoadExeHeader( fd, &ofs )) < 32)
{
close( fd );
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
name, hModule );
return hModule;
}
pModule = (NE_MODULE *)GlobalLock( hModule );
/* Allocate the segments for this module */
MODULE_CreateSegments( hModule );
/* Load the referenced DLLs */
pModRef = (WORD *)((char *)pModule + pModule->modref_table);
pDLLs = (WORD *)GlobalLock( pModule->dlls_to_init );
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
char buffer[256];
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" );
dprintf_module( stddeb, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
/* its handle in the list of DLLs to initialize. */
HMODULE hDLL;
if ((hDLL = LoadModule( buffer, (LPVOID)-1 )) == 2) /* file not found */
{
char *p;
/* Try with prepending the path of the current module */
GetModuleFileName( hModule, buffer, 256 );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = LoadModule( buffer, (LPVOID)-1 );
}
if (hDLL < 32)
{
fprintf( stderr, "Could not load '%s' required by '%s', error = %d\n",
buffer, name, hDLL );
return 2; /* file not found */
}
*pModRef = GetExePtr( hDLL );
*pDLLs++ = *pModRef;
}
else /* Increment the reference count of the DLL */
{
NE_MODULE *pOldDLL = (NE_MODULE *)GlobalLock( *pModRef );
if (pOldDLL) pOldDLL->count++;
}
}
/* Load the segments (except the DGROUP) */
for (i = 1; i <= pModule->seg_count; i++)
if (i != pModule->dgroup) NE_LoadSegment( hModule, i );
/* Create an instance for this module */
hInstance = MODULE_MakeNewInstance( hModule, (LOADPARAMS*)paramBlock );
/* Fixup the functions prologs */
NE_FixupPrologs( hModule );
/* Make sure the usage count is 1 on the first loading of */
/* the module, even if it contains circular DLL references */
pModule->count = 1;
}
else
{
pModule = (NE_MODULE *)GlobalLock( hModule );
hInstance = MODULE_MakeNewInstance( hModule, (LOADPARAMS*)paramBlock );
pModule->count++;
}
return hInstance;
}
/**********************************************************************
* FreeModule (KERNEL.46)
*/
BOOL FreeModule( HANDLE hModule )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return FALSE;
if (--pModule->count == 0) MODULE_FreeModule( hModule );
return TRUE;
}
@ -614,21 +999,15 @@ HINSTANCE MODULE_LoadModule( LPCSTR name, LPVOID paramBlock )
*/
HMODULE GetModuleHandle( LPCSTR name )
{
char buffer[16];
BYTE len;
HMODULE hModule;
BYTE len = strlen(name);
HMODULE hModule = hFirstModule;
strncpy( buffer, name, 15 );
buffer[15] = '\0';
len = strlen(buffer);
AnsiUpper( buffer );
hModule = hFirstModule;
while( hModule )
{
NE_MODULE *pModule = (NE_MODULE *)GlobalLock( hModule );
char *pname = (char *)pModule + pModule->name_table;
if (((BYTE)*pname == len) && !memcmp( pname+1, buffer, len )) break;
if (((BYTE)*pname == len) && !strncasecmp( pname+1, name, len ))
break;
hModule = pModule->next;
}
dprintf_module( stddeb, "GetModuleHandle('%s'): returning %04x\n",
@ -669,6 +1048,122 @@ int GetModuleFileName( HANDLE hModule, LPSTR lpFileName, short nSize )
}
/***********************************************************************
* LoadLibrary (KERNEL.95)
*/
HANDLE LoadLibrary( LPCSTR libname )
{
HANDLE handle;
dprintf_module( stddeb, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
handle = LoadModule( libname, (LPVOID)-1 );
if (handle == 2) /* file not found */
{
char buffer[256];
strcpy( buffer, libname );
strcat( buffer, ".dll" );
handle = LoadModule( buffer, (LPVOID)-1 );
}
if (handle >= 32) NE_InitializeDLLs( handle );
return handle;
}
/***********************************************************************
* FreeLibrary (KERNEL.96)
*/
void FreeLibrary( HANDLE handle )
{
dprintf_module( stddeb,"FreeLibrary: %04x\n", handle );
FreeModule( handle );
}
/***********************************************************************
* WinExec (KERNEL.166)
*/
HANDLE WinExec( LPSTR lpCmdLine, WORD nCmdShow )
{
LOADPARAMS params;
HLOCAL cmdShowHandle, cmdLineHandle;
HANDLE handle;
WORD *cmdShowPtr;
char *p, *cmdline, filename[256];
if (!(cmdShowHandle = GlobalAlloc( 0, 2 * sizeof(WORD) ))) return 0;
if (!(cmdLineHandle = GlobalAlloc( 0, 256 ))) return 0;
/* Store nCmdShow */
cmdShowPtr = (WORD *)GlobalLock( cmdShowHandle );
cmdShowPtr[0] = 2;
cmdShowPtr[1] = nCmdShow;
/* Build the filename and command-line */
cmdline = (char *)GlobalLock( cmdLineHandle );
strncpy( filename, lpCmdLine, 256 );
filename[255] = '\0';
for (p = filename; *p && (*p != ' ') && (*p != '\t'); p++);
if (*p)
{
strncpy( cmdline, p + 1, 128 );
cmdline[127] = '\0';
}
else cmdline[0] = '\0';
*p = '\0';
/* Now load the executable file */
params.hEnvironment = SELECTOROF( GetDOSEnvironment() );
params.cmdLine = WIN16_GlobalLock( cmdLineHandle );
params.showCmd = WIN16_GlobalLock( cmdShowHandle );
params.reserved = 0;
handle = LoadModule( filename, &params );
if (handle == 2) /* file not found */
{
strcat( filename, ".exe" );
handle = LoadModule( filename, &params );
}
GlobalFree( cmdShowHandle );
GlobalFree( cmdLineHandle );
return handle;
}
/***********************************************************************
* 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;
}
/**********************************************************************
* ModuleFirst (TOOLHELP.59)
*/

View File

@ -18,12 +18,8 @@
#include "dlls.h"
#include "windows.h"
#include "arch.h"
#include "library.h"
#include "if1632.h"
#include "selectors.h"
#include "callback.h"
#include "ne_image.h"
#include "prototypes.h"
#include "module.h"
#include "stackframe.h"
#include "stddebug.h"
@ -33,7 +29,7 @@
/***********************************************************************
* NE_LoadSegment
*/
static BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
{
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable, *pSeg;
@ -42,9 +38,9 @@ static BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
DWORD address;
int fd;
struct relocation_entry_s *rep, *reloc_entries;
char *dll_name, *func_name;
BYTE *func_name;
char buffer[100], buffer2[100];
char buffer[100];
int ordinal, additive;
unsigned short *sp;
@ -66,6 +62,12 @@ static BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
read( fd, &count, sizeof(count) );
if (!count) return TRUE;
dprintf_fixup( stddeb, "Fixups for %*.*s, segment %d, selector %04x\n",
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
segnum, pSeg->selector );
reloc_entries = (struct relocation_entry_s *)malloc(count * sizeof(struct relocation_entry_s));
if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) !=
count * sizeof(struct relocation_entry_s))
@ -93,42 +95,62 @@ static BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
{
case NE_RELTYPE_ORDINAL:
module = pModuleTable[rep->target1-1];
dll_name = (char *)pModule + pModule->import_table + module;
memcpy( buffer, dll_name+1, *dll_name );
buffer[*dll_name] = '\0';
dll_name = buffer;
module = GetModuleHandle( dll_name );
ordinal = rep->target2;
address = MODULE_GetEntryPoint( module, ordinal );
if (!address) fprintf( stderr, "Warning: no handler for %s.%d, setting to 0:0\n",
dll_name, ordinal );
dprintf_fixup(stddeb,"%d: %s.%d: %04x:%04x\n", i + 1,
dll_name, ordinal, HIWORD(address), LOWORD(address) );
if (!address)
{
NE_MODULE *pTarget = (NE_MODULE *)GlobalLock( module );
if (!pTarget)
fprintf( stderr, "Module not found: %04x, reference %d of module %*.*s\n",
module, rep->target1,
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1 );
else
fprintf( stderr, "Warning: no handler for %*.*s.%d, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
ordinal );
}
if (debugging_fixup)
{
NE_MODULE *pTarget = (NE_MODULE *)GlobalLock( module );
fprintf( stddeb,"%d: %*.*s.%d=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
ordinal, HIWORD(address), LOWORD(address) );
}
break;
case NE_RELTYPE_NAME:
module = pModuleTable[rep->target1-1];
dll_name = (char *)pModule + pModule->import_table + module;
memcpy( buffer, dll_name+1, *dll_name );
buffer[*dll_name] = '\0';
dll_name = buffer;
module = GetModuleHandle( dll_name );
func_name = (char *)pModule + pModule->import_table + rep->target2;
memcpy( buffer2, func_name+1, *func_name );
buffer2[*func_name] = '\0';
func_name = buffer2;
memcpy( buffer, func_name+1, *func_name );
buffer[*func_name] = '\0';
func_name = buffer;
ordinal = MODULE_GetOrdinal( module, func_name );
address = MODULE_GetEntryPoint( module, ordinal );
if (!address) fprintf( stderr, "Warning: no handler for %s.%s, setting to 0:0\n",
dll_name, func_name );
dprintf_fixup(stddeb,"%d: %s.%s: %04x:%04x\n", i + 1,
dll_name, func_name, HIWORD(address), LOWORD(address) );
if (!address)
{
NE_MODULE *pTarget = (NE_MODULE *)GlobalLock( module );
fprintf( stderr, "Warning: no handler for %*.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
}
if (debugging_fixup)
{
NE_MODULE *pTarget = (NE_MODULE *)GlobalLock( module );
fprintf( stddeb,"%d: %*.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address) );
}
break;
case NE_RELTYPE_INTERNAL:
@ -173,17 +195,6 @@ static BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
return FALSE;
}
/* I'm not sure why a DLL entry point fixup could be additive.
Old code used to ignore additive if the target is a built-in
DLL. This doesn't seem to work for __AHSHIFT */
#if 0
if (additive && FindDLLTable(dll_name) != NULL)
dprintf_fixup(stddeb,"Additive for builtin???\n"
"%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, "
"TARGET %04x %04x\n",
i+1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2);
#endif
offset = rep->offset;
switch (rep->address_type)
@ -263,7 +274,7 @@ static BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
*
* Fixup the exported functions prologs.
*/
static void NE_FixupPrologs( HMODULE hModule )
void NE_FixupPrologs( HMODULE hModule )
{
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
@ -333,15 +344,12 @@ static void NE_FixupPrologs( HMODULE hModule )
}
int NE_unloadImage(struct w_files *wpnt)
{
dprintf_fixup(stdnimp, "NEunloadImage() called!\n");
/* free resources, image */
return 1;
}
BOOL NE_InitDLL( HMODULE hModule )
/***********************************************************************
* NE_InitDLL
*
* Call the DLL initialization code
*/
static BOOL NE_InitDLL( HMODULE hModule )
{
int cs_reg, ds_reg, ip_reg, cx_reg, di_reg, bp_reg;
NE_MODULE *pModule;
@ -383,7 +391,7 @@ BOOL NE_InitDLL( HMODULE hModule )
cs_reg = pSegTable[pModule->cs-1].selector;
ip_reg = pModule->ip;
di_reg = ds_reg ? ds_reg : hModule;
bp_reg = IF1632_Saved16_sp + (&((STACK16FRAME*)1)->bp - 1);
bp_reg = IF1632_Saved16_sp + ((WORD)&((STACK16FRAME*)1)->bp - 1);
pModule->cs = 0; /* Don't initialize it twice */
dprintf_dll( stddeb, "Calling LibMain, cs:ip=%04x:%04x ds=%04x di=%04x cx=%04x\n",
@ -394,92 +402,23 @@ BOOL NE_InitDLL( HMODULE hModule )
}
/**********************************************************************
* NE_LoadImage
* Load one NE format executable into memory
/***********************************************************************
* NE_InitializeDLLs
*
* Initialize the loaded DLLs.
*/
HINSTANCE NE_LoadImage(struct w_files *wpnt)
void NE_InitializeDLLs( HMODULE hModule )
{
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
WORD *pModRef;
unsigned int read_size, status, segment;
int i;
char cmdLine[256];
extern int Argc;
extern char **Argv;
WORD *pDLL;
wpnt->ne = malloc(sizeof(struct ne_data));
wpnt->ne->ne_header = malloc(sizeof(struct ne_header_s));
lseek(wpnt->fd, wpnt->mz_header->ne_offset, SEEK_SET);
if (read(wpnt->fd, wpnt->ne->ne_header, sizeof(struct ne_header_s))
!= sizeof(struct ne_header_s))
myerror("Unable to read NE header from file");
wpnt->hModule = MODULE_LoadExeHeader( wpnt->fd, wpnt->filename );
pModule = (NE_MODULE *)GlobalLock( wpnt->hModule );
pSegTable = NE_SEG_TABLE(pModule);
/* Create the module segments */
MODULE_CreateSegments( wpnt->hModule );
#ifndef WINELIB
/*
* Create segment selectors.
*/
CreateSelectors();
if (pModule->dgroup)
wpnt->hinstance = NE_SEG_TABLE(pModule)[pModule->dgroup-1].selector;
else
wpnt->hinstance = wpnt->hModule;
#endif
/* Create a task for this module */
cmdLine[0] = '\0';
for (i = 1; i < Argc; i++)
pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule->dlls_to_init) return;
for (pDLL = (WORD *)GlobalLock( pModule->dlls_to_init ); *pDLL; pDLL++)
{
strcat( cmdLine, Argv[i] );
strcat( cmdLine, " " );
NE_InitDLL( *pDLL );
NE_InitializeDLLs( *pDLL );
}
if (!(pModule->flags & NE_FFLAGS_LIBMODULE))
TASK_CreateTask( wpnt->hModule, SELECTOROF( GetDOSEnvironment() ),
GetCurrentTask(), cmdLine );
/*
* Now load any DLLs that this module refers to.
*/
pModRef = (WORD *)((char *)pModule + pModule->modref_table);
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
char buffer[80];
char *pstr = (char *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr );
buffer[*pstr] = '\0';
dprintf_module( stddeb, "Loading '%s'\n", buffer );
LoadImage( buffer, DLL, 0 );
}
/* fixup references */
for (i = 1; i <= pModule->seg_count; i++)
NE_LoadSegment( wpnt->hModule, i );
NE_FixupPrologs( wpnt->hModule );
InitializeLoadedDLLs(wpnt);
/* Initialize the local heap */
if (pModule->dgroup)
{
int start = pSegTable[pModule->dgroup-1].minsize;
if (pModule->ss == pModule->dgroup) start += pModule->stack_size;
LocalInit( pSegTable[pModule->dgroup-1].selector,
start, start + pModule->heap_size );
}
return(wpnt->hinstance);
GlobalFree( pModule->dlls_to_init );
pModule->dlls_to_init = 0;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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]

View File

@ -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 );
}

View File

@ -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 */

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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
/***********************************************************************

View File

@ -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 \

View File

@ -11,10 +11,10 @@
#include "win.h"
#include "user.h"
#include "message.h"
#include "library.h"
#include "commdlg.h"
#include "dlgs.h"
#include "selectors.h"
#include "../rc/sysres.h"
#define OPENFILEDLG2 11
#define SAVEFILEDLG2 12
@ -57,17 +57,47 @@ static BOOL COMMDLG_IsPathName(LPSTR str)
*/
static BOOL FileDlg_Init()
{
if (!hFolder) hFolder = LoadBitmap(hSysRes, MAKEINTRESOURCE(OBM_FOLDER));
if (!hFolder2) hFolder2 = LoadBitmap(hSysRes, MAKEINTRESOURCE(OBM_FOLDER2));
if (!hFloppy) hFloppy = LoadBitmap(hSysRes, MAKEINTRESOURCE(OBM_FLOPPY));
if (!hHDisk) hHDisk = LoadBitmap(hSysRes, MAKEINTRESOURCE(OBM_HDISK));
if (!hCDRom) hCDRom = LoadBitmap(hSysRes, MAKEINTRESOURCE(OBM_CDROM));
if (!hFolder) hFolder = LoadBitmap(0, MAKEINTRESOURCE(OBM_FOLDER));
if (!hFolder2) hFolder2 = LoadBitmap(0, MAKEINTRESOURCE(OBM_FOLDER2));
if (!hFloppy) hFloppy = LoadBitmap(0, MAKEINTRESOURCE(OBM_FLOPPY));
if (!hHDisk) hHDisk = LoadBitmap(0, MAKEINTRESOURCE(OBM_HDISK));
if (!hCDRom) hCDRom = LoadBitmap(0, MAKEINTRESOURCE(OBM_CDROM));
if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
hHDisk == 0 || hCDRom == 0)
fprintf(stderr, "FileDlg_Init // Error loading bitmaps !");
return TRUE;
}
/***********************************************************************
* OpenDlg_FixDirName [internal]
*/
void OpenDlg_FixDirName(LPSTR dirname)
{
char temp[512];
char* strp1;
char* strp2;
strp1=dirname;
if( dirname[1] != ':'){
temp[0]=(char)((char)DOS_GetDefaultDrive()+'A');
temp[1]=':';
temp[2]='\\';
temp[3]= '\0';
strcat(temp, DOS_GetCurrentDir(DOS_GetDefaultDrive()));
if(dirname[0]=='.' && dirname[1]=='.') {
strp2 = strrchr(temp, '\\');
if (strp2 != NULL){
*strp2='\0';
strp1+=2;
}
}
strcat(temp, "\\");
strcat(temp, strp1);
strcpy(dirname, temp);
}
}
/***********************************************************************
* OpenDlg_ScanDir [internal]
*/
@ -77,13 +107,14 @@ static BOOL OpenDlg_ScanDir(HWND hWnd, LPSTR newPath)
static LPSTR str = NULL;
static SEGPTR str16 = 0;
LPSTR strp;
OpenDlg_FixDirName(newPath);
if (str == NULL) {
hStr = GlobalAlloc(0,512);
str = GlobalLock(hStr);
str16 = WIN16_GlobalLock(hStr);
}
strcpy(str,newPath);
DlgDirList(hWnd, str, lst1, 0, 0x0000);
strp = strrchr(str,'\\');
@ -96,37 +127,27 @@ static BOOL OpenDlg_ScanDir(HWND hWnd, LPSTR newPath)
} else strp++;
strcpy(str,strp);
SendDlgItemMessage(hWnd,edt1,WM_SETTEXT, 0, str16);
strcpy(str,newPath);
*strp = 0;
strcat(str,"*.*");
strcpy(str,"*.*");
DlgDirList(hWnd, str, lst2, stc1, 0x8010);
return TRUE;
}
/***********************************************************************
* OpenDlg_GetFileType [internal]
*/
LPSTR OpenDlg_GetFileType(LPCSTR types, WORD index)
static LPSTR OpenDlg_GetFileType(LPCSTR types, WORD index)
{
int n;
int i = 1;
LPSTR ptr = (LPSTR) types;
if (ptr == NULL) return NULL;
while((n = strlen(ptr)) != 0) {
#ifdef DEBUG_OPENDLG
printf("OpenDlg_GetFileType // file type '%s' !\n", ptr);
#endif
ptr += ++n;
#ifdef DEBUG_OPENDLG
printf("OpenDlg_GetFileType // file spec '%s' !\n", ptr);
#endif
if (i++ == index) return ptr;
n = strlen(ptr);
ptr += ++n;
}
}
return NULL;
}
@ -135,45 +156,45 @@ LPSTR OpenDlg_GetFileType(LPCSTR types, WORD index)
*/
BOOL GetOpenFileName(LPOPENFILENAME lpofn)
{
HANDLE hDlgTmpl;
HANDLE hResInfo;
HINSTANCE hInst;
WND *wndPtr;
BOOL bRet;
if (lpofn == NULL) return FALSE;
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) {
hDlgTmpl = lpofn->hInstance;
} else {
if (lpofn->Flags & OFN_ENABLETEMPLATE) {
hInst = lpofn->hInstance;
hResInfo = FindResource(hInst,
lpofn->lpTemplateName, RT_DIALOG);
} else {
hInst = hSysRes;
hResInfo = FindResource(hInst, MAKEINTRESOURCE(OPENFILEDLG2), RT_DIALOG);
}
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
printf("GetOpenFileName // apres FindResource hResInfo=%04X!\n", hResInfo);
hDlgTmpl = LoadResource(hInst, hResInfo);
}
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
printf("GetOpenFileName // apres LoadResource hDlgTmpl=%04X!\n", hDlgTmpl);
wndPtr = WIN_FindWndPtr(lpofn->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpofn->hwndOwner,
GetWndProcEntry16("FileOpenDlgProc"),
(DWORD)lpofn);
printf("GetOpenFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
HANDLE hDlgTmpl;
HANDLE hResInfo;
HINSTANCE hInst;
BOOL bRet;
LPCSTR dlgTemplate;
if (lpofn == NULL) return FALSE;
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) {
dlgTemplate = GlobalLock(lpofn->hInstance);
if (!dlgTemplate) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
} else {
if (lpofn->Flags & OFN_ENABLETEMPLATE) {
hInst = lpofn->hInstance;
hResInfo = FindResource(hInst, lpofn->lpTemplateName, RT_DIALOG);
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
hDlgTmpl = LoadResource(hInst, hResInfo);
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
dlgTemplate = GlobalLock(hDlgTmpl);
} else {
dlgTemplate = sysres_DIALOG_3;
}
}
hInst = GetWindowWord(lpofn->hwndOwner, GWW_HINSTANCE);
bRet = DialogBoxIndirectParamPtr(hInst, dlgTemplate, lpofn->hwndOwner,
GetWndProcEntry16("FileOpenDlgProc"),
(DWORD)lpofn);
printf("GetOpenFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
@ -182,42 +203,44 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
*/
BOOL GetSaveFileName(LPOPENFILENAME lpofn)
{
HANDLE hDlgTmpl;
HANDLE hResInfo;
HINSTANCE hInst;
WND *wndPtr;
BOOL bRet;
if (lpofn == NULL) return FALSE;
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) {
hDlgTmpl = lpofn->hInstance;
} else {
if (lpofn->Flags & OFN_ENABLETEMPLATE) {
hInst = lpofn->hInstance;
hResInfo = FindResource(hInst, lpofn->lpTemplateName,
RT_DIALOG);
} else {
hInst = hSysRes;
hResInfo = FindResource(hInst, MAKEINTRESOURCE(SAVEFILEDLG2), RT_DIALOG);
}
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
hDlgTmpl = LoadResource(hInst, hResInfo);
}
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
wndPtr = WIN_FindWndPtr(lpofn->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpofn->hwndOwner,
GetWndProcEntry16("FileSaveDlgProc"),
(DWORD)lpofn );
printf("GetSaveFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
HANDLE hDlgTmpl;
HANDLE hResInfo;
HINSTANCE hInst;
BOOL bRet;
LPCSTR dlgTemplate;
if (lpofn == NULL) return FALSE;
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) {
dlgTemplate = GlobalLock(lpofn->hInstance);
if (!dlgTemplate) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
} else {
if (lpofn->Flags & OFN_ENABLETEMPLATE) {
hInst = lpofn->hInstance;
hResInfo = FindResource(hInst, lpofn->lpTemplateName, RT_DIALOG);
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
hDlgTmpl = LoadResource(hInst, hResInfo);
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
dlgTemplate = GlobalLock(hDlgTmpl);
} else {
dlgTemplate = sysres_DIALOG_4; /* SAVEFILEDIALOG */
}
}
hInst = GetWindowWord(lpofn->hwndOwner, GWW_HINSTANCE);
bRet = DialogBoxIndirectParamPtr(hInst, dlgTemplate, lpofn->hwndOwner,
GetWndProcEntry16("FileSaveDlgProc"),
(DWORD)lpofn);
printf("GetSaveFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
@ -228,13 +251,10 @@ BOOL ChooseColor(LPCHOOSECOLOR lpChCol)
{
WND *wndPtr;
BOOL bRet;
wndPtr = WIN_FindWndPtr(lpChCol->hwndOwner);
bRet = DialogBoxParam( wndPtr->hInstance,
MAKEINTRESOURCE(COLORDLG),
lpChCol->hwndOwner,
GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol);
bRet = DialogBoxIndirectParamPtr(wndPtr->hInstance, sysres_DIALOG_8,
lpChCol->hwndOwner, GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol);
return bRet;
}
@ -459,13 +479,11 @@ BOOL FileOpenDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
#endif
break;
case IDOK:
SendDlgItemMessage(hWnd, edt1, WM_GETTEXT, 0, str16);
printf("OK: str %s\n",str);
SendDlgItemMessage(hWnd, edt1, WM_GETTEXT, 511, str16);
if (COMMDLG_IsPathName(str)) {
OpenDlg_ScanDir(hWnd, str);
} else {
ShowWindow(hWnd, SW_HIDE);
printf("FileOpenDlgProc // IDOK str='%s'\n", str);
strcpy(PTR_SEG_TO_LIN(lpofn->lpstrFile), str);
lpofn->nFileOffset = 0;
lpofn->nFileExtension = strlen(PTR_SEG_TO_LIN(lpofn->lpstrFile)) - 3;
@ -723,7 +741,7 @@ BOOL FileSaveDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
#endif
break;
case IDOK:
SendDlgItemMessage(hWnd, edt1, WM_GETTEXT, 0, str16);
SendDlgItemMessage(hWnd, edt1, WM_GETTEXT, 511, str16);
if (COMMDLG_IsPathName(str)) {
OpenDlg_ScanDir(hWnd, str);
} else {
@ -797,26 +815,16 @@ BOOL ColorDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
*/
BOOL FindText(LPFINDREPLACE lpFind)
{
HANDLE hDlgTmpl;
HANDLE hResInfo;
WND *wndPtr;
BOOL bRet;
hResInfo = FindResource(hSysRes, MAKEINTRESOURCE(FINDDLG), RT_DIALOG);
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
hDlgTmpl = LoadResource(hSysRes, hResInfo);
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
wndPtr = WIN_FindWndPtr(lpFind->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpFind->hwndOwner,
GetWndProcEntry16("FindTextDlgProc"),
(DWORD)lpFind);
return bRet;
WND *wndPtr;
BOOL bRet;
LPCSTR lpTemplate;
lpTemplate = sysres_DIALOG_9;
wndPtr = WIN_FindWndPtr(lpFind->hwndOwner);
bRet = DialogBoxIndirectParamPtr(wndPtr->hInstance, lpTemplate,
lpFind->hwndOwner, GetWndProcEntry16("FindTextDlgProc"),
(DWORD)lpFind);
return bRet;
}
@ -825,26 +833,16 @@ BOOL FindText(LPFINDREPLACE lpFind)
*/
BOOL ReplaceText(LPFINDREPLACE lpFind)
{
HANDLE hDlgTmpl;
HANDLE hResInfo;
WND *wndPtr;
BOOL bRet;
hResInfo = FindResource(hSysRes, MAKEINTRESOURCE(REPLACEDLG), RT_DIALOG);
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
hDlgTmpl = LoadResource(hSysRes, hResInfo);
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
wndPtr = WIN_FindWndPtr(lpFind->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpFind->hwndOwner,
GetWndProcEntry16("ReplaceTextDlgProc"),
(DWORD)lpFind);
return bRet;
WND *wndPtr;
BOOL bRet;
LPCSTR lpTemplate;
lpTemplate = sysres_DIALOG_10;
wndPtr = WIN_FindWndPtr(lpFind->hwndOwner);
bRet = DialogBoxIndirectParamPtr(wndPtr->hInstance, lpTemplate,
lpFind->hwndOwner, GetWndProcEntry16("ReplaceTextDlgProc"),
(DWORD)lpFind);
return bRet;
}
@ -853,24 +851,24 @@ BOOL ReplaceText(LPFINDREPLACE lpFind)
*/
BOOL FindTextDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("FindTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
switch (wMsg) {
case WM_INITDIALOG:
printf("FindTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
}
@ -879,24 +877,24 @@ BOOL FindTextDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
*/
BOOL ReplaceTextDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("ReplaceTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
switch (wMsg) {
case WM_INITDIALOG:
printf("ReplaceTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
}
@ -905,36 +903,26 @@ BOOL ReplaceTextDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
*/
BOOL PrintDlg(LPPRINTDLG lpPrint)
{
HANDLE hDlgTmpl;
HANDLE hResInfo;
WND *wndPtr;
BOOL bRet;
printf("PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags);
if (lpPrint->Flags & PD_PRINTSETUP)
hResInfo = FindResource(hSysRes, MAKEINTRESOURCE(PRINTSETUPDLG), RT_DIALOG);
else
hResInfo = FindResource(hSysRes, MAKEINTRESOURCE(PRINTDLG), RT_DIALOG);
if (hResInfo == 0) {
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
}
hDlgTmpl = LoadResource(hSysRes, hResInfo);
if (hDlgTmpl == 0) {
CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE;
}
wndPtr = WIN_FindWndPtr(lpPrint->hwndOwner);
if (lpPrint->Flags & PD_PRINTSETUP)
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpPrint->hwndOwner,
GetWndProcEntry16("PrintSetupDlgProc"),
(DWORD)lpPrint);
else
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpPrint->hwndOwner,
GetWndProcEntry16("PrintDlgProc"),
(DWORD)lpPrint);
return bRet;
WND *wndPtr;
BOOL bRet;
LPCSTR lpTemplate;
printf("PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags);
if (lpPrint->Flags & PD_PRINTSETUP) {
lpTemplate = sysres_DIALOG_6;
} else {
lpTemplate = sysres_DIALOG_5;
}
wndPtr = WIN_FindWndPtr(lpPrint->hwndOwner);
if (lpPrint->Flags & PD_PRINTSETUP)
bRet = DialogBoxIndirectParamPtr(wndPtr->hInstance, lpTemplate,
lpPrint->hwndOwner, GetWndProcEntry16("PrintSetupDlgProc"),
(DWORD)lpPrint);
else
bRet = DialogBoxIndirectParamPtr(wndPtr->hInstance, lpTemplate,
lpPrint->hwndOwner, GetWndProcEntry16("PrintDlgProc"),
(DWORD)lpPrint);
return bRet;
}
@ -943,24 +931,24 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
*/
BOOL PrintDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
switch (wMsg) {
case WM_INITDIALOG:
printf("PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
}
@ -969,24 +957,24 @@ BOOL PrintDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
*/
BOOL PrintSetupDlgProc(HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
printf("PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
switch (wMsg) {
case WM_INITDIALOG:
printf("PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return(TRUE);
case IDCANCEL:
EndDialog(hWnd, FALSE);
return(TRUE);
}
return(FALSE);
}
return FALSE;
}
@ -1004,7 +992,7 @@ DWORD CommDlgExtendError(void)
*/
int GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
{
int i, len;
int i, len;
printf("GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
if (lpFile == NULL || lpTitle == NULL) return -1;
len = strlen(lpFile);
@ -1015,13 +1003,11 @@ int GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
len--;
if (lpFile[len] == '/' || lpFile[len] == '\\' || lpFile[len] == ':') return -1;
for (i = len; i >= 0; i--) {
if (lpFile[i] == '/' ||
lpFile[i] == '\\' ||
lpFile[i] == ':') {
i++;
break;
}
}
if (lpFile[i] == '/' || lpFile[i] == '\\' || lpFile[i] == ':') {
i++;
break;
}
}
printf("\n---> '%s' ", &lpFile[i]);
len = min(cbBuf, strlen(&lpFile[i]) + 1);
strncpy(lpTitle, &lpFile[i], len + 1);

View File

@ -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]

View File

@ -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 */
if ((handle = _lopen( ofs->szPathName, wStyle )) == -1)
{
ofs->nErrCode = AL;
return -1;
}
return AX;
#endif
/* FIXME: Quick hack to get it to work without calling DOS --AJ */
{
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);
}

61
misc/kernel32.c Normal file
View File

@ -0,0 +1,61 @@
/*
* Win32 kernel functions
*
* Copyright 1995 Martin von Loewis
*/
/* This file contains only wrappers to existing Wine functions or trivial
stubs. 'Real' implementations go into context specific files */
#include "windows.h"
#include "winerror.h"
int WIN32_LastError;
/***********************************************************************
* GetCommandLineA (KERNEL32.161)
*/
LPSTR GetCommandLineA(void)
{
return 0;
}
/***********************************************************************
* GetCurrentThreadId (KERNEL32.200)
*/
int GetCurrentThreadId(void)
{
return getpid();
}
/***********************************************************************
* GetEnvironmentStrings (KERNEL32.210)
*/
LPSTR GetEnvironmentStrings(void)
{
return 0;
}
/***********************************************************************
* GetStdHandle (KERNEL32.276)
*/
HANDLE GetStdHandle(DWORD nStdHandle)
{
switch(nStdHandle)
{
case -10/*STD_INPUT_HANDLE*/:return 0;
case -11/*STD_OUTPUT_HANDLE*/:return 1;
case -12/*STD_ERROR_HANDLE*/:return 2;
}
return -1;
}
/***********************************************************************
* GetThreadContext (KERNEL32.294)
*/
BOOL GetThreadContext(HANDLE hThread, void *lpContext)
{
return FALSE;
}

View File

@ -1,13 +1,13 @@
/*
static char Copyright[] = "Copyright Yngvi Sigurjonsson (yngvi@hafro.is), 1993";
*/
* String functions
*
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "ldt.h"
#include "windows.h"
@ -17,6 +17,44 @@ static char Copyright[] = "Copyright Yngvi Sigurjonsson (yngvi@hafro.is), 1993"
#define ToUpper(c) toupper(c)
#define ToLower(c) tolower(c)
static const BYTE Oem2Ansi[256] =
"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\244"
"\020\021\022\023\266\247\026\027\030\031\032\033\034\035\036\037"
"\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057"
"\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077"
"\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117"
"\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137"
"\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157"
"\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177"
"\307\374\351\342\344\340\345\347\352\353\350\357\356\354\304\305"
"\311\346\306\364\366\362\373\371\377\326\334\242\243\245\120\203"
"\341\355\363\372\361\321\252\272\277\137\254\275\274\241\253\273"
"\137\137\137\246\246\246\246\053\053\246\246\053\053\053\053\053"
"\053\055\055\053\055\053\246\246\053\053\055\055\246\055\053\055"
"\055\055\055\053\053\053\053\053\053\053\053\137\137\246\137\137"
"\137\337\137\266\137\137\265\137\137\137\137\137\137\137\137\137"
"\137\261\137\137\137\137\367\137\260\225\267\137\156\262\137\137";
static const BYTE Ansi2Oem[256] =
"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017"
"\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
"\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057"
"\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077"
"\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117"
"\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137"
"\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157"
"\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177"
"\200\201\054\237\054\137\375\374\210\045\123\074\117\215\216\217"
"\220\140\047\042\042\371\055\137\230\231\163\076\157\235\236\131"
"\040\255\233\234\017\235\335\025\042\143\246\256\252\055\162\137"
"\370\361\375\063\047\346\024\372\054\061\247\257\254\253\137\250"
"\101\101\101\101\216\217\222\200\105\220\105\105\111\111\111\111"
"\104\245\117\117\117\117\231\170\117\125\125\125\232\131\137\341"
"\205\240\203\141\204\206\221\207\212\202\210\211\215\241\214\213"
"\144\244\225\242\223\157\224\366\157\227\243\226\201\171\137\230";
/* Funny to divide them between user and kernel. */
/* KERNEL.89 */
@ -191,36 +229,10 @@ SEGPTR AnsiPrev( SEGPTR start, SEGPTR current)
return (current==start)?start:current-1;
}
BYTE Oem2Ansi[256], Ansi2Oem[256];
void InitOemAnsiTranslations(void)
{
static int inited=0; /* should called called in some init function*/
int transfile,i;
if(inited) return;
if((transfile=open("oem2ansi.trl",O_RDONLY))){
read(transfile,Oem2Ansi,256);
close(transfile);
}
else { /* sets up passive translations if it does not find the file */
for(i=0;i<256;i++) /* Needs some fixing */
Oem2Ansi[i]=i;
}
if((transfile=open("ansi2oem.trl",O_RDONLY))){
read(transfile,Ansi2Oem,256);
close(transfile);
}
else { /* sets up passive translations if it does not find the file */
for(i=0;i<256;i++) /* Needs some fixing */
Ansi2Oem[i]=i;
}
inited=1;
}
/* AnsiToOem Keyboard.5 */
INT AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr) /* why is this int ??? */
{
InitOemAnsiTranslations(); /* should called called in some init function*/
while(*lpAnsiStr){
*lpOemStr++=Ansi2Oem[(unsigned char)(*lpAnsiStr++)];
}
@ -231,7 +243,6 @@ INT AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr) /* why is this int ??? */
/* OemToAnsi Keyboard.6 */
BOOL OemToAnsi(LPSTR lpOemStr, LPSTR lpAnsiStr) /* why is this BOOL ???? */
{
InitOemAnsiTranslations(); /* should called called in some init function*/
while(*lpOemStr){
*lpAnsiStr++=Oem2Ansi[(unsigned char)(*lpOemStr++)];
}
@ -243,7 +254,6 @@ BOOL OemToAnsi(LPSTR lpOemStr, LPSTR lpAnsiStr) /* why is this BOOL ???? */
void AnsiToOemBuff(LPSTR lpAnsiStr, LPSTR lpOemStr, INT nLength)
{
int i;
InitOemAnsiTranslations(); /* should called called in some init function*/
for(i=0;i<nLength;i++)
lpOemStr[i]=Ansi2Oem[(unsigned char)(lpAnsiStr[i])];
}
@ -252,7 +262,6 @@ void AnsiToOemBuff(LPSTR lpAnsiStr, LPSTR lpOemStr, INT nLength)
void OemToAnsiBuff(LPSTR lpOemStr, LPSTR lpAnsiStr, INT nLength)
{
int i;
InitOemAnsiTranslations(); /* should called called in some init function*/
for(i=0;i<nLength;i++)
lpAnsiStr[i]=Oem2Ansi[(unsigned char)(lpOemStr[i])];
}

View File

@ -25,17 +25,12 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include "options.h"
#include "desktop.h"
#include "prototypes.h"
#include "texts.h"
#include "library.h"
#include "dlls.h"
#include "if1632.h"
#define DEBUG_DEFINE_VARIABLES
#include "stddebug.h"
#include "debug.h"
extern ButtonTexts ButtonText;
static const char people[] = "Wine is available thanks to the work of "\
const char people[] = "Wine is available thanks to the work of "\
"Bob Amstadt, Dag Asheim, Martin Ayotte, Ross Biro, Erik Bos, Fons Botman, "\
"John Brezak, Andrew Bulhak, John Burton, Paul Falstad, Olaf Flebbe, "\
"Peter Galbavy, Cameron Heide, Jeffrey Hsu, Miguel de Icaza, "\
@ -50,13 +45,12 @@ static const char people[] = "Wine is available thanks to the work of "\
#define WINE_CLASS "Wine" /* Class name for resources */
typedef struct tagENVENTRY {
LPSTR Name;
LPSTR Value;
WORD wSize;
struct tagENVENTRY *Prev;
struct tagENVENTRY *Next;
} ENVENTRY;
typedef ENVENTRY *LPENVENTRY;
LPSTR Name;
LPSTR Value;
WORD wSize;
struct tagENVENTRY *Prev;
struct tagENVENTRY *Next;
} ENVENTRY, *LPENVENTRY;
LPENVENTRY lpEnvList = NULL;
@ -77,7 +71,8 @@ struct options Options =
FALSE, /* backing store */
SW_SHOWNORMAL, /* cmdShow */
FALSE,
FALSE /* AllowReadOnly */
FALSE, /* AllowReadOnly */
FALSE /* Enhanced mode */
};
@ -95,7 +90,8 @@ static XrmOptionDescRec optionsTable[] =
{ "-debug", ".debug", XrmoptionNoArg, (caddr_t)"on" },
{ "-debugmsg", ".debugmsg", XrmoptionSepArg, (caddr_t)NULL },
{ "-dll", ".dll", XrmoptionSepArg, (caddr_t)NULL },
{ "-allowreadonly", ".allowreadonly", XrmoptionNoArg, (caddr_t)"on" }
{ "-allowreadonly", ".allowreadonly", XrmoptionNoArg, (caddr_t)"on" },
{ "-enhanced", ".enhanced", XrmoptionNoArg, (caddr_t)"off"}
};
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
@ -114,10 +110,10 @@ static XrmOptionDescRec optionsTable[] =
" -synchronous Turn on synchronous display mode\n" \
" -backingstore Turn on backing store\n" \
" -spy file Turn on message spying to the specified file\n" \
" -relaydbg Obsolete. Use -debugmsg +relay instead\n" \
" -debugmsg name Turn debugging-messages on or off\n" \
" -dll name Enable or disable built-in DLLs\n" \
" -allowreadonly Read only files may be opened in write mode\n"
" -allowreadonly Read only files may be opened in write mode\n" \
" -enhanced Start wine in enhanced mode\n"
@ -178,53 +174,6 @@ static int MAIN_GetResource( XrmDatabase db, char *name, XrmValue *value )
}
/***********************************************************************
* MAIN_GetButtonText
*
* Fetch the value of resource 'name' using the correct instance name.
* 'name' must begin with '.' or '*'
*
* The address of the string got from the XResoure is stored in Button.Label.
* The corresponding hotkey is taken from this string.
*/
static void MAIN_GetButtonText( XrmDatabase db, char *name, ButtonDesc *Button)
{
XrmValue value;
char *i;
if (MAIN_GetResource( db, name, &value))
{
Button->Label = value.addr;
i = strchr(Button->Label,'&');
if ( i == NULL )
Button->Hotkey = '\0';
else if ( i++ == '\0' )
Button->Hotkey = '\0';
else
Button->Hotkey = *i;
}
Button->Hotkey = toupper(Button->Hotkey);
}
/***********************************************************************
* MAIN_GetAllButtonTexts
*
* Read all Button-labels from X11-resources if they exist.
*/
static void MAIN_GetAllButtonTexts(XrmDatabase db)
{
MAIN_GetButtonText(db, ".YesLabel", &ButtonText.Yes);
MAIN_GetButtonText(db, ".NoLabel", &ButtonText.No);
MAIN_GetButtonText(db, ".OkLabel", &ButtonText.Ok);
MAIN_GetButtonText(db, ".CancelLabel", &ButtonText.Cancel);
MAIN_GetButtonText(db, ".AbortLabel", &ButtonText.Abort);
MAIN_GetButtonText(db, ".RetryLabel", &ButtonText.Retry);
MAIN_GetButtonText(db, ".IgnoreLabel", &ButtonText.Ignore);
MAIN_GetButtonText(db, ".CancelLabel", &ButtonText.Cancel);
}
/***********************************************************************
* ParseDebugOptions
*
@ -294,9 +243,9 @@ static BOOL MAIN_ParseDLLOptions(char *options)
l=strchr(options,',')-options;
else l=strlen(options);
for (i=0;i<N_BUILTINS;i++)
if (!strncasecmp(options+1,dll_builtin_table[i].dll_name,l-1))
if (!strncasecmp(options+1,dll_builtin_table[i].name,l-1))
{
dll_builtin_table[i].dll_is_used=(*options=='+');
dll_builtin_table[i].used = (*options=='+');
break;
}
if (i==N_BUILTINS)
@ -360,6 +309,8 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
Options.debug = TRUE;
if (MAIN_GetResource( db, ".allowreadonly", &value ))
Options.allowReadOnly = TRUE;
if (MAIN_GetResource( db, ".enhanced", &value ))
Options.enhanced = TRUE;
if (MAIN_GetResource( db, ".spy", &value))
Options.spyFilename = value.addr;
if (MAIN_GetResource( db, ".depth", &value))
@ -403,14 +354,11 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs\n");
for(i=0;i<N_BUILTINS;i++)
fprintf(stderr,"%-9s%c",dll_builtin_table[i].dll_name,
fprintf(stderr,"%-9s%c",dll_builtin_table[i].name,
(((i+2)%8==0)?'\n':' '));
fprintf(stderr,"\n\n");
exit(1);
}
/* MAIN_GetAllButtonTexts(db); */
}
@ -531,6 +479,9 @@ int main( int argc, char *argv[] )
int depth_count, i;
int *depth_list;
setbuf(stdout,NULL);
setbuf(stderr,NULL);
setlocale(LC_CTYPE,"");
XrmInitialize();
@ -607,7 +558,10 @@ LONG GetVersion(void)
*/
LONG GetWinFlags(void)
{
return (WF_STANDARD | WF_CPU286 | WF_PMODE | WF_80x87);
if (Options.enhanced)
return (WF_STANDARD | WF_ENHANCED | WF_CPU286 | WF_PMODE | WF_80x87);
else
return (WF_STANDARD | WF_CPU286 | WF_PMODE | WF_80x87);
}
/***********************************************************************

View File

@ -1,476 +0,0 @@
/*
* 'Wine' MessageBox function handling
*
* Copyright 1993 Martin Ayotte
*
static char Copyright[] = "Copyright Martin Ayotte, 1993";
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include "library.h"
#include "win.h"
#include "texts.h"
#include "user.h"
#include "selectors.h"
#include "stddebug.h"
/* #define DEBUG_MSGBOX */
#include "debug.h"
/*
* Defaults for button-texts
*/
ButtonTexts ButtonText = { /* FIXME: Norwegian Translation missing */
#if #LANG(De)
{ "&Ja", 'J' },
{ "&Nein", 'N' },
{ "&Ok", 'O' },
{ "&Abbruch",'A' },
{ "&Abbruch",'A' },
{ "&Wiederholen", 'W' },
{ "&Ignorieren", 'I' }
#else
{ "&Yes", 'Y' },
{ "&No", 'N' },
{ "&Ok", 'O' },
{ "&Cancel", 'C' },
{ "&Abort", 'A' },
{ "&Retry", 'R' },
{ "&Ignore", 'I' }
#endif
};
extern HBITMAP hUpArrow;
typedef struct tagMSGBOX {
LPSTR Title;
LPSTR Str;
WORD wType;
WORD wRetVal;
BOOL ActiveFlg;
HWND hWndYes;
HWND hWndNo;
HWND hWndCancel;
HICON hIcon;
RECT rectIcon;
RECT rectStr;
} MSGBOX;
typedef MSGBOX FAR* LPMSGBOX;
LONG SystemMessageBoxProc(HWND hwnd, WORD message, WORD wParam, LONG lParam);
/**************************************************************************
* MessageBox [USER.1]
*/
int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
{
HWND hDlg, hWndOld;
WND *wndPtr;
WNDCLASS wndClass;
MSG* msg;
LPMSGBOX lpmb;
HANDLE hClassName, hMsg;
DWORD dwStyle;
HINSTANCE hInst;
int nRet;
if (title == NULL)
title = "Error";
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
hInst = hSysRes;
dprintf_msgbox(stddeb,"MessageBox(NULL, str='%s', title='%s', %04X)\n",
str, title, type);
}
else {
hInst = wndPtr->hInstance;
dprintf_msgbox(stddeb,"MessageBox(%04X, str='%s', title='%s', %04X)\n",
hWnd, str, title, type);
}
lpmb = (LPMSGBOX) malloc(sizeof(MSGBOX));
memset(lpmb, 0, sizeof(MSGBOX));
/* lpmb->Title = title;*/
lpmb->Title = (LPSTR) malloc(strlen(title) + 1);
strcpy(lpmb->Title, title);
/* lpmb->Str = str;*/
if (str && *str)
{
lpmb->Str = (LPSTR) malloc(strlen(str) + 1);
strcpy(lpmb->Str, str);
}
else
{
lpmb->Str = (LPSTR) malloc(8);
strcpy(lpmb->Str, "Message");
}
lpmb->wType = type;
lpmb->ActiveFlg = TRUE;
wndClass.style = CS_HREDRAW | CS_VREDRAW ;
wndClass.lpfnWndProc = GetWndProcEntry16("SystemMessageBoxProc");
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = 4;
wndClass.hInstance = hInst;
wndClass.hIcon = (HICON)NULL;
wndClass.hCursor = LoadCursor((HANDLE)NULL, IDC_ARROW);
wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName = NULL;
hClassName = USER_HEAP_ALLOC( 20 );
strcpy( USER_HEAP_LIN_ADDR( hClassName ), "MESSAGEBOX" );
hMsg = USER_HEAP_ALLOC( sizeof(MSG) );
msg = (MSG *) USER_HEAP_LIN_ADDR( hMsg );
wndClass.lpszClassName = (LPSTR)USER_HEAP_SEG_ADDR( hClassName );
dprintf_msgbox(stddeb, "MessageBox // before RegisterClass, '%s' '%s' !\n", str, title);
if (!RegisterClass(&wndClass)) {
printf("Unable to Register class 'MESSAGEBOX' !\n");
if (lpmb != NULL) free(lpmb);
return 0;
}
USER_HEAP_FREE( hClassName );
dwStyle = WS_POPUP | WS_DLGFRAME | WS_VISIBLE;
if ((type & (MB_SYSTEMMODAL | MB_TASKMODAL)) == 0) dwStyle |= WS_CAPTION;
hWndOld = GetFocus();
hDlg = CreateWindow("MESSAGEBOX", lpmb->Title, dwStyle, 100, 150, 400, 160,
(HWND)NULL, (HMENU)NULL, hInst, (SEGPTR)lpmb);
if (hDlg == 0) {
printf("Unable to create 'MESSAGEBOX' window !\n");
if (lpmb != NULL) free(lpmb);
return 0;
}
dprintf_msgbox(stddeb, "MessageBox // before Msg Loop !\n");
while(TRUE) {
if (!lpmb->ActiveFlg) break;
if (!GetMessage( USER_HEAP_SEG_ADDR(hMsg),
(HWND)NULL, 0, 0)) break;
TranslateMessage(msg);
if ((type & (MB_SYSTEMMODAL | MB_TASKMODAL)) != 0 &&
msg->hwnd != hDlg) {
switch(msg->message) {
case WM_KEYDOWN:
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
MessageBeep(0);
break;
}
}
DispatchMessage(msg);
}
USER_HEAP_FREE(hMsg);
SetFocus(hWndOld);
nRet = lpmb->wRetVal;
if (lpmb != NULL) free(lpmb);
if (!UnregisterClass("MESSAGEBOX", hInst)) return 0;
dprintf_msgbox(stddeb, "MessageBox return %04X !\n", nRet);
return(nRet);
}
LPMSGBOX MsgBoxGetStorageHeader(HWND hwnd)
{
WND *wndPtr;
LPMSGBOX lpmb;
wndPtr = WIN_FindWndPtr(hwnd);
if (wndPtr == 0) {
printf("Bad Window handle on MessageBox !\n");
return 0;
}
lpmb = *((LPMSGBOX *)wndPtr->wExtra);
return lpmb;
}
LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
{
WND *wndPtr;
CREATESTRUCT *createStruct;
PAINTSTRUCT ps;
HDC hDC;
DWORD OldTextColor;
RECT rect;
LPMSGBOX lpmb;
switch(message) {
case WM_CREATE:
dprintf_msgbox(stddeb, "MessageBox WM_CREATE hWnd=%04X !\n", hWnd);
wndPtr = WIN_FindWndPtr(hWnd);
createStruct = (CREATESTRUCT *)PTR_SEG_TO_LIN(lParam);
lpmb = (LPMSGBOX)createStruct->lpCreateParams;
if (lpmb == NULL) break;
*((LPMSGBOX *)wndPtr->wExtra) = lpmb;
dprintf_msgbox(stddeb, "MessageBox WM_CREATE title='%s' str='%s' !\n",
lpmb->Title, lpmb->Str);
GetClientRect(hWnd, &rect);
CopyRect(&lpmb->rectStr, &rect);
lpmb->rectStr.bottom -= 32;
switch(lpmb->wType & MB_TYPEMASK) {
case MB_OK :
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Ok.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 30, rect.bottom - 25,
60, 18, hWnd, IDOK, wndPtr->hInstance, 0L);
break;
case MB_OKCANCEL :
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Ok.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 65, rect.bottom - 25,
60, 18, hWnd, IDOK, wndPtr->hInstance, 0L);
lpmb->hWndCancel = CreateWindow("BUTTON", ButtonText.Cancel.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 5, rect.bottom - 25,
60, 18, hWnd, IDCANCEL, wndPtr->hInstance, 0L);
break;
case MB_ABORTRETRYIGNORE :
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Retry.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 100, rect.bottom - 25,
60, 18, hWnd, IDRETRY, wndPtr->hInstance, 0L);
lpmb->hWndNo = CreateWindow("BUTTON", ButtonText.Ignore.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 30, rect.bottom - 25,
60, 18, hWnd, IDIGNORE, wndPtr->hInstance, 0L);
lpmb->hWndCancel = CreateWindow("BUTTON", ButtonText.Abort.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 40, rect.bottom - 25,
60, 18, hWnd, IDABORT, wndPtr->hInstance, 0L);
break;
case MB_YESNO :
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Yes.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 65, rect.bottom - 25,
60, 18, hWnd, IDYES, wndPtr->hInstance, 0L);
lpmb->hWndNo = CreateWindow("BUTTON", ButtonText.No.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 5, rect.bottom - 25,
60, 18, hWnd, IDNO, wndPtr->hInstance, 0L);
break;
case MB_YESNOCANCEL :
lpmb->hWndYes = CreateWindow("BUTTON", ButtonText.Yes.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 100, rect.bottom - 25,
60, 18, hWnd, IDYES, wndPtr->hInstance, 0L);
lpmb->hWndNo = CreateWindow("BUTTON", ButtonText.No.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 - 30, rect.bottom - 25,
60, 18, hWnd, IDNO, wndPtr->hInstance, 0L);
lpmb->hWndCancel = CreateWindow("BUTTON", ButtonText.Cancel.Label,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
rect.right / 2 + 40, rect.bottom - 25,
60, 18, hWnd, IDCANCEL, wndPtr->hInstance, 0L);
break;
}
switch(lpmb->wType & MB_ICONMASK) {
case MB_ICONEXCLAMATION:
printf("MsgBox LoadIcon Exclamation !\n");
lpmb->hIcon = LoadIcon((HINSTANCE)NULL, IDI_EXCLAMATION);
break;
case MB_ICONQUESTION:
printf("MsgBox LoadIcon Question !\n");
lpmb->hIcon = LoadIcon((HINSTANCE)NULL, IDI_QUESTION);
break;
case MB_ICONASTERISK:
printf("MsgBox LoadIcon Asterisk !\n");
lpmb->hIcon = LoadIcon((HINSTANCE)NULL, IDI_ASTERISK);
break;
case MB_ICONHAND:
printf("MsgBox LoadIcon Hand !\n");
lpmb->hIcon = LoadIcon((HINSTANCE)NULL, IDI_HAND);
break;
}
if (lpmb->hIcon != (HICON)NULL) {
SetRect(&lpmb->rectIcon, 16,
lpmb->rectStr.bottom / 2 - 16, 48,
lpmb->rectStr.bottom / 2 + 16);
lpmb->rectStr.left += 64;
}
break;
case WM_SHOWWINDOW:
dprintf_msgbox(stddeb, "MessageBox WM_SHOWWINDOW hWnd=%04X !\n", hWnd);
if (!(wParam == 0 && lParam == 0L)) {
InvalidateRect(hWnd, NULL, TRUE);
}
break;
case WM_PAINT:
dprintf_msgbox(stddeb, "MessageBox WM_PAINT hWnd=%04X !\n", hWnd);
lpmb = MsgBoxGetStorageHeader(hWnd);
if (lpmb == NULL) break;
if (!lpmb->ActiveFlg) break;
hDC = BeginPaint(hWnd, &ps);
if (hDC == 0) {
printf("MessageBox WM_PAINT // BeginPaint returned BAD hDC !\n");
break;
}
GetClientRect(hWnd, &rect);
FillRect(hDC, &rect, GetStockObject(WHITE_BRUSH));
CopyRect(&rect, &lpmb->rectStr);
OldTextColor = SetTextColor(hDC, 0x00000000);
if (lpmb->hIcon)
DrawIcon(hDC, lpmb->rectIcon.left,
lpmb->rectIcon.top, lpmb->hIcon);
DrawText(hDC, lpmb->Str, -1, &rect,
DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_WORDBREAK);
rect.top = lpmb->rectStr.bottom / 2 - rect.bottom / 2;
rect.bottom = lpmb->rectStr.bottom / 2 + rect.bottom / 2;
DrawText(hDC, lpmb->Str, -1, &rect, DT_LEFT | DT_VCENTER | DT_WORDBREAK);
SetTextColor(hDC, OldTextColor);
EndPaint(hWnd, &ps);
dprintf_msgbox(stddeb, "MessageBox End of WM_PAINT !\n");
break;
case WM_DESTROY:
dprintf_msgbox(stddeb, "MessageBox WM_DESTROY !\n");
ReleaseCapture();
lpmb = MsgBoxGetStorageHeader(hWnd);
if (lpmb == NULL) break;
if (lpmb->hIcon) DestroyIcon(lpmb->hIcon);
if (lpmb->hWndYes) DestroyWindow(lpmb->hWndYes);
if (lpmb->hWndNo) DestroyWindow(lpmb->hWndNo);
if (lpmb->hWndCancel) DestroyWindow(lpmb->hWndCancel);
dprintf_msgbox(stddeb, "MessageBox WM_DESTROY end !\n");
lpmb->ActiveFlg = FALSE;
break;
case WM_COMMAND:
lpmb = MsgBoxGetStorageHeader(hWnd);
if (lpmb == NULL) break;
if (wParam < IDOK || wParam > IDNO) return(0);
lpmb->wRetVal = wParam;
dprintf_msgbox(stddeb, "MessageBox sending WM_CLOSE !\n");
PostMessage(hWnd, WM_CLOSE, 0, 0L);
break;
case WM_CHAR:
lpmb = MsgBoxGetStorageHeader(hWnd);
/* if (wParam >= 'a' || wParam <= 'z') wParam -= 'a' - 'A'; */
wParam = toupper(wParam);
if (wParam == ButtonText.Yes.Hotkey)
lpmb->wRetVal = IDYES;
else if (wParam == ButtonText.Ok.Hotkey)
lpmb->wRetVal = IDOK;
else if (wParam == ButtonText.Retry.Hotkey)
lpmb->wRetVal = IDRETRY;
else if (wParam == ButtonText.Abort.Hotkey)
lpmb->wRetVal = IDABORT;
else if (wParam == ButtonText.No.Hotkey)
lpmb->wRetVal = IDNO;
else if (wParam == ButtonText.Ignore.Hotkey)
lpmb->wRetVal = IDIGNORE;
else if ((wParam == ButtonText.Ok.Hotkey) || (wParam == VK_ESCAPE))
lpmb->wRetVal = IDCANCEL;
else
return 0;
if (lpmb == NULL) break;
ShowWindow(hWnd, SW_HIDE);
PostMessage(hWnd, WM_CLOSE, 0, 0L);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam );
}
return(0);
}
/*************************************************************************
* "About Wine..." Dialog Box
*/
BOOL FAR PASCAL AboutWine_Proc(HWND hDlg, WORD msg, WORD wParam, LONG lParam)
{
HDC hDC;
HDC hMemDC;
PAINTSTRUCT ps;
RECT rect;
BITMAP bm;
OFSTRUCT ofstruct;
HBITMAP hbmpOld;
static LPSTR ptr;
static char str[256];
static HBITMAP hBitMap = 0;
static BOOL CreditMode;
static HANDLE hFile = 0;
switch (msg) {
case WM_INITDIALOG:
CreditMode = FALSE;
strcpy(str, "WINELOGO");
hBitMap = LoadBitmap((HINSTANCE)NULL, (LPSTR)str);
strcpy(str, "LICENSE");
printf("str = '%s'\n", str);
hFile = OpenFile((LPSTR)str, &ofstruct, OF_READ);
ptr = (LPSTR)malloc(2048);
lseek(hFile, 0L, SEEK_SET);
_lread(hFile, ptr, 2000L);
close(hFile);
return TRUE;
case WM_PAINT:
hDC = BeginPaint(hDlg, &ps);
GetClientRect(hDlg, &rect);
if (CreditMode) {
FillRect(hDC, &rect, GetStockObject(WHITE_BRUSH));
InflateRect(&rect, -8, -8);
DrawText(hDC, ptr, -1, &rect, DT_LEFT | DT_WORDBREAK);
EndPaint(hDlg, &ps);
return TRUE;
}
FillRect(hDC, &rect, GetStockObject(GRAY_BRUSH));
InflateRect(&rect, -3, -3);
FrameRect(hDC, &rect, GetStockObject(BLACK_BRUSH));
InflateRect(&rect, -10, -10);
hMemDC = CreateCompatibleDC(hDC);
hbmpOld = SelectObject(hMemDC, hBitMap);
GetObject(hBitMap, sizeof(BITMAP), (LPSTR)&bm);
BitBlt(hDC, rect.left, rect.top, bm.bmWidth, bm.bmHeight,
hMemDC, 0, 0, SRCCOPY);
SelectObject( hMemDC, hbmpOld );
DeleteDC(hMemDC);
EndPaint(hDlg, &ps);
return TRUE;
case WM_COMMAND:
switch (wParam)
{
case IDYES:
if (!CreditMode) {
SetWindowPos(hDlg, (HWND)NULL, 0, 0, 640, 480,
SWP_NOMOVE | SWP_NOZORDER);
}
else {
SetWindowPos(hDlg, (HWND)NULL, 0, 0, 320, 250,
SWP_NOMOVE | SWP_NOZORDER);
}
CreditMode = !CreditMode;
ShowWindow(GetDlgItem(hDlg, IDYES), CreditMode ? SW_HIDE : SW_SHOW);
ShowWindow(GetDlgItem(hDlg, IDOK), CreditMode ? SW_HIDE : SW_SHOW);
InvalidateRect(hDlg, (LPRECT)NULL, TRUE);
UpdateWindow(hDlg);
return TRUE;
case IDCANCEL:
case IDOK:
if (hBitMap != 0 ) DeleteObject(hBitMap);
if (ptr != NULL) free(ptr);
EndDialog(hDlg, TRUE);
return TRUE;
default:
return TRUE;
}
}
return FALSE;
}
/**************************************************************************
* FatalAppExit [USER.137]
*/
void FatalAppExit(WORD wAction, LPSTR str)
{
MessageBox((HWND)NULL, str, NULL, MB_SYSTEMMODAL | MB_OK);
exit(1);
}

View File

@ -106,7 +106,7 @@ static TSecHeader *load (char *filename)
state = FirstBrace;
while ((c = getc (f)) != EOF){
while ((c = fgetc (f)) != EOF){
if (c == '\r') /* Ignore Carriage Return */
continue;
@ -188,7 +188,7 @@ static TSecHeader *load (char *filename)
} /* switch */
} /* while ((c = getc (f)) != EOF) */
} /* while ((c = fgetc (f)) != EOF) */
return SecHeader;
}

View File

@ -6,11 +6,12 @@
#include <string.h>
#include <unistd.h>
#include "windows.h"
#include "library.h"
#include "shell.h"
#include "neexe.h"
#include "selectors.h"
#include "../rc/sysres.h"
#include "dlgs.h"
#include "dialog.h"
#include "stddebug.h"
/* #define DEBUG_REG */
#include "debug.h"
@ -312,7 +313,7 @@ LONG RegEnumKey(HKEY hKey, DWORD dwSubKey, LPSTR lpBuf, DWORD dwSize)
*/
void DragAcceptFiles(HWND hWnd, BOOL b)
{
dprintf_reg(stdnimp, "DragAcceptFiles : Empty Stub !!!\n");
fprintf(stdnimp, "DragAcceptFiles : Empty Stub !!!\n");
}
@ -321,7 +322,7 @@ void DragAcceptFiles(HWND hWnd, BOOL b)
*/
void DragQueryFile(HDROP h, UINT u, LPSTR u2, UINT u3)
{
dprintf_reg(stdnimp, "DragQueryFile : Empty Stub !!!\n");
fprintf(stdnimp, "DragQueryFile : Empty Stub !!!\n");
}
@ -331,8 +332,7 @@ void DragQueryFile(HDROP h, UINT u, LPSTR u2, UINT u3)
*/
void DragFinish(HDROP h)
{
dprintf_reg(stdnimp, "DragFinish : Empty Stub !!!\n");
fprintf(stdnimp, "DragFinish : Empty Stub !!!\n");
}
@ -341,7 +341,7 @@ void DragFinish(HDROP h)
*/
BOOL DragQueryPoint(HDROP h, POINT FAR *p)
{
dprintf_reg(stdnimp, "DragQueryPoinyt : Empty Stub !!!\n");
fprintf(stdnimp, "DragQueryPoint : Empty Stub !!!\n");
return FALSE;
}
@ -351,12 +351,14 @@ BOOL DragQueryPoint(HDROP h, POINT FAR *p)
*/
HINSTANCE ShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, int iShowCmd)
{
dprintf_reg(stdnimp, "ShellExecute // hWnd=%04X\n", hWnd);
dprintf_reg(stdnimp, "ShellExecute // lpOperation='%s'\n", lpOperation);
dprintf_reg(stdnimp, "ShellExecute // lpFile='%s'\n", lpFile);
dprintf_reg(stdnimp, "ShellExecute // lpParameters='%s'\n", lpParameters);
dprintf_reg(stdnimp, "ShellExecute // lpDirectory='%s'\n", lpDirectory);
dprintf_reg(stdnimp, "ShellExecute // iShowCmd=%04X\n", iShowCmd);
fprintf(stdnimp, "ShellExecute: empty stub\n");
return 2;
fprintf(stdnimp, "ShellExecute // hWnd=%04X\n", hWnd);
fprintf(stdnimp, "ShellExecute // lpOperation='%s'\n", lpOperation);
fprintf(stdnimp, "ShellExecute // lpFile='%s'\n", lpFile);
fprintf(stdnimp, "ShellExecute // lpParameters='%s'\n", lpParameters);
fprintf(stdnimp, "ShellExecute // lpDirectory='%s'\n", lpDirectory);
fprintf(stdnimp, "ShellExecute // iShowCmd=%04X\n", iShowCmd);
return 2; /* file not found */
}
@ -366,58 +368,57 @@ HINSTANCE ShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpPa
*/
HINSTANCE FindExecutable(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult)
{
dprintf_reg(stdnimp, "FindExecutable : Empty Stub !!!\n");
fprintf(stdnimp, "FindExecutable : Empty Stub !!!\n");
return 0;
}
char AppName[256], AppMisc[256];
INT AboutDlgProc(HWND hWnd, WORD msg, WORD wParam, LONG lParam);
/*************************************************************************
* ShellAbout [SHELL.22]
*/
INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
{
/* fprintf(stderr, "ShellAbout ! (%s, %s)\n", szApp, szOtherStuff);*/
if (szApp)
strcpy(AppName, szApp);
else
*AppName = 0;
if (szOtherStuff)
strcpy(AppMisc, szOtherStuff);
else
*AppMisc = 0;
return DialogBoxIndirectPtr( GetWindowWord(hWnd, GWW_HINSTANCE),
sysres_DIALOG_SHELL_ABOUT_MSGBOX,
hWnd, GetWndProcEntry16("AboutDlgProc"));
}
static char AppName[512], AppMisc[512];
/*************************************************************************
* AboutDlgProc [SHELL.33]
*/
INT AboutDlgProc(HWND hWnd, WORD msg, WORD wParam, LONG lParam)
{
char temp[256];
switch(msg) {
case WM_INITDIALOG:
SendDlgItemMessage(hWnd,stc1,STM_SETICON,LOWORD(lParam),0);
SetWindowText(hWnd, AppName);
SetWindowText(GetDlgItem(hWnd,100), AppMisc);
return 1;
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return TRUE;
}
break;
}
return FALSE;
}
switch(msg) {
case WM_INITDIALOG:
sprintf(temp, "About %s", AppName);
SetWindowText(hWnd, temp);
SetWindowText(GetDlgItem(hWnd,100), AppMisc );
break;
case WM_COMMAND:
switch (wParam) {
case IDOK:
EndDialog(hWnd, TRUE);
return TRUE;
}
}
return FALSE;
/*************************************************************************
* ShellAbout [SHELL.22]
*/
INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
{
if (szApp) {
sprintf(AppName, "About %s", szApp);
} else {
*AppName = 0;
}
if (szOtherStuff) {
strcpy(AppMisc, szOtherStuff);
} else {
*AppMisc = 0;
}
if (!hIcon) {
hIcon = LoadIcon(0,MAKEINTRESOURCE(OIC_WINEICON));
}
return DialogBoxIndirectParamPtr(GetWindowWord(hWnd, GWW_HINSTANCE),
sysres_DIALOG_SHELL_ABOUT_MSGBOX,
hWnd, GetWndProcEntry16("AboutDlgProc"),
hIcon);
}
/*************************************************************************
@ -425,24 +426,23 @@ INT AboutDlgProc(HWND hWnd, WORD msg, WORD wParam, LONG lParam)
*/
HICON ExtractIcon(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex)
{
int count;
HICON hIcon = 0;
HINSTANCE hInst2 = hInst;
dprintf_reg(stddeb, "ExtractIcon(%04X, '%s', %d\n",
hInst, lpszExeFileName, nIconIndex);
if (lpszExeFileName != NULL) {
hInst2 = LoadLibrary(lpszExeFileName);
}
}
if (hInst2 != 0 && nIconIndex == (UINT)-1) {
#if 0
count = GetRsrcCount(hInst2, NE_RSCTYPE_GROUP_ICON);
dprintf_reg(stddeb, "ExtractIcon // '%s' has %d icons !\n", lpszExeFileName, count);
return (HICON)count;
#endif
}
}
if (hInst2 != hInst && hInst2 != 0) {
FreeLibrary(hInst2);
}
}
return hIcon;
}
@ -452,8 +452,20 @@ HICON ExtractIcon(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex)
*/
HICON ExtractAssociatedIcon(HINSTANCE hInst,LPSTR lpIconPath, LPWORD lpiIcon)
{
dprintf_reg(stdnimp, "ExtractAssociatedIcon : Empty Stub !!!\n");
return 0;
dprintf_reg(stdnimp, "ExtractAssociatedIcon : Empty Stub !!!\n");
return 0;
}
/*************************************************************************
* DoEnvironmentSubst [SHELL.37]
* I couldn't find any reference, so even the number of bytes on the
* stack might be wrong
*/
WORD DoEnvironmentSubst(LPSTR a,WORD b,WORD c)
{
printf(stderr, "DoEnvironmentSubst: Unknown argument count\n");
dprintf_reg(stdnimp, "DoEnvironmentSubst %x %x %x\n",a,b,c);
return 0;
}
/*************************************************************************

View File

@ -156,10 +156,12 @@ const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
"WM_INITMENU", /* 0x0116 */
"WM_INITMENUPOPUP", /* 0x0117 */
"WM_SYSTIMER", /* 0x0118 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
"WM_MENUSELECT", /* 0x011f */
/* 0x0120 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"WM_MENUCHAR", /* 0x0120 */
"WM_ENTERIDLE", /* 0x0121 */
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x0130 */
@ -227,16 +229,23 @@ const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
NULL, NULL, NULL, NULL, NULL, NULL,
"WM_PARENTNOTIFY", /* 0x0210 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"WM_ENTERMENULOOP", /* 0x0211 */
"WM_EXITMENULOOP", /* 0x0212 */
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x0220 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"WM_MDICREATE", /* 0x0220 */
"WM_MDIDESTROY", /* 0x0221 */
"WM_MDIACTIVATE", /* 0x0222 */
"WM_MDIRESTORE", /* 0x0223 */
"WM_MDINEXT", /* 0x0224 */
"WM_MDIMAXIMIZE", /* 0x0225 */
"WM_MDITILE", /* 0x0226 */
"WM_MDICASCADE", /* 0x0227 */
"WM_MDIICONARRANGE", /* 0x0228 */
"WM_MDIGETACTIVE", /* 0x0229 */
NULL, /* 0x0230 */
"WM_MDISETMENU", /* 0x0230 */
"WM_ENTERSIZEMOVE", /* 0x0231 */
"WM_EXITSIZEMOVE" /* 0x0232 */
};

View File

@ -92,16 +92,27 @@ BOOL USER_HeapInit(void)
*/
int USER_InitApp(int hInstance)
{
extern BOOL WIDGETS_Init(void);
static int firstTask = 1;
int queueSize;
if (firstTask)
{
/* Perform global initialisations that need a task context */
/* Initialize built-in window classes */
if (!WIDGETS_Init()) return 0;
/* Create desktop window */
if (!WIN_CreateDesktopWindow()) return 0;
firstTask = 0;
}
/* Create task message queue */
queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
if (!SetMessageQueue( queueSize )) return 0;
#ifndef WINELIB
/* Initialize DLLs */
InitializeLoadedDLLs(NULL);
#endif
return 1;
}

View File

@ -36,6 +36,9 @@ struct ipc_packet {
WORD wMsg;
LONG lParam;
};
#pragma pack(1)
#define IPC_PACKET_SIZE (sizeof(struct ipc_packet) - sizeof(long))
#define MTYPE 0xb0b0eb05
#define WINE_PACKED __attribute__ ((packed))
@ -82,6 +85,8 @@ struct WinSockHeap {
};
static struct WinSockHeap *heap;
#pragma pack(4)
#define dump_sockaddr(a) \
fprintf(stderr, "sockaddr_in: family %d, address %s, port %d\n", \
((struct sockaddr_in *)a)->sin_family, \

View File

@ -15,8 +15,7 @@ SRCS = \
int2a.c \
int2f.c \
int31.c \
ioports.c \
kernel.c
ioports.c
OBJS = $(SRCS:.c=.o)

View File

@ -291,6 +291,8 @@ static void ReadFile(struct sigcontext_struct *context)
Error (InvalidHandle, EL_Unknown, EC_Unknown);
AX = InvalidHandle;
SetCflag;
dprintf_int(stddeb,
"int21: read (%d, void *, 0x%x) = EBADF\n", BX, CX);
return;
}
@ -300,9 +302,14 @@ static void ReadFile(struct sigcontext_struct *context)
Error (0,0,0);
AX = 1;
ResetCflag;
dprintf_int(stddeb,
"int21: read (%d, void *, 0x%x) = EOF\n", BX, CX);
return;
} else {
size = read(BX, ptr, CX);
dprintf_int(stddeb,
"int21: read (%d, void *, 0x%x) = 0x%x\n",
BX, CX, size);
if (size == -1) {
errno_to_doserr();
AL = ExtendedError;
@ -372,6 +379,10 @@ static void SeekFile(struct sigcontext_struct *context)
break;
}
status = lseek(BX, (CX << 16) + DX, fileoffset);
dprintf_int (stddeb, "int21: seek (%d, 0x%x, %d) = 0x%lx\n",
BX, (CX << 16) + DX, AL, status);
if (status == -1) {
errno_to_doserr();
AL = ExtendedError; SetCflag;
@ -386,6 +397,9 @@ static void SeekFile(struct sigcontext_struct *context)
static void ioctlGetDeviceInfo(struct sigcontext_struct *context)
{
dprintf_int (stddeb, "int21: ioctl (%d, GetDeviceInfo)\n", BX);
switch (BX) {
case 0:
case 1:
@ -467,7 +481,7 @@ static void GetSystemDate(struct sigcontext_struct *context)
ltime = time(NULL);
now = localtime(&ltime);
CX = now->tm_year + 1900;
CX = now->tm_year + 1900 - 1980;
DX = ((now->tm_mon + 1) << 8) | now->tm_mday;
AX = now->tm_wday;
}
@ -537,6 +551,8 @@ void OpenExistingFile(struct sigcontext_struct *context)
O_RDONLY );
if( handle == -1 )
{
dprintf_int (stddeb, "int21: open (%s, %d) = -1\n",
DOS_GetUnixFileName(PTR_SEG_OFF_TO_LIN(DS,DX)), mode);
errno_to_doserr();
AL = ExtendedError;
SetCflag;
@ -544,6 +560,9 @@ void OpenExistingFile(struct sigcontext_struct *context)
}
}
dprintf_int (stddeb, "int21: open (%s, %d) = %d\n",
DOS_GetUnixFileName(PTR_SEG_OFF_TO_LIN(DS,DX)), mode, handle);
switch (AX & 0x0070)
{
case 0x00: /* compatability mode */
@ -602,6 +621,8 @@ void OpenExistingFile(struct sigcontext_struct *context)
static void CloseFile(struct sigcontext_struct *context)
{
dprintf_int (stddeb, "int21: close (%d)\n", BX);
if (close(BX) == -1) {
errno_to_doserr();
AL = ExtendedError;
@ -1166,12 +1187,16 @@ static void GetFileAttribute (struct sigcontext_struct * context)
if ((S_IWRITE & s.st_mode) != S_IWRITE)
cx|=0x01;
dprintf_int (stddeb, "int21: GetFileAttributes (%s) = 0x%x\n",
filename, cx);
ECX = (ECX & 0xffff0000) | cx;
ResetCflag;
Error (0,0,0);
}
extern void LOCAL_PrintHeap (WORD ds);
/************************************************************************/
@ -1282,6 +1307,7 @@ int do_int21(struct sigcontext_struct * context)
{
TDB *pTask = (TDB *)GlobalLock( GetCurrentTask() );
pTask->dta = MAKELONG( DX, DS );
dprintf_int(stddeb, "int21: Set DTA: %08lx\n", pTask->dta);
}
break;
@ -1701,6 +1727,10 @@ int do_int21(struct sigcontext_struct * context)
return 1;
}
}
dprintf_int(stddeb,"ret21: AX %04x, BX %04x, CX %04x, DX %04x, "
"SI %04x, DI %04x, DS %04x, ES %04x EFL %08lx\n",
AX, BX, CX, DX, SI, DI, DS, ES, EFL);
return 1;
}

View File

@ -6,6 +6,7 @@
#include "ldt.h"
#include "wine.h"
#include "miscemu.h"
#include "dos_fs.h"
#include "stddebug.h"
/* #define DEBUG_INT */
#include "debug.h"

View File

@ -5,6 +5,7 @@
#include "ldt.h"
#include "wine.h"
#include "miscemu.h"
#include "dos_fs.h"
#include "stddebug.h"
/* #define DEBUG_INT */
#include "debug.h"

View File

@ -1,28 +0,0 @@
/*
static char RCSId[] = "$Id: kernel.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include "prototypes.h"
#include "options.h"
#include "wine.h"
#include "stddebug.h"
#include "debug.h"
extern unsigned short WIN_StackSize;
/**********************************************************************
* KERNEL_InitTask
*/
void KERNEL_InitTask( struct sigcontext_struct context )
{
context.sc_eax = 1;
context.sc_ebx = 0x81;
context.sc_ecx = WIN_StackSize;
context.sc_edx = Options.cmdShow;
context.sc_edi = 0;
context.sc_edi = context.sc_ds;
}

Some files were not shown because too many files have changed in this diff Show More