Release 980503

Thu Apr 30 16:28:12 1998  James Juran <jrj120@psu.edu>

	* [scheduler/process.c]
	Implemented GetExitCodeProcess.  The code is a direct translation
	of GetExitCodeThread.

Mon Apr 27 22:20:25 1998  Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [loader/pe_image.c]
	Unload dummy module when PE_LoadLibraryEx32A fails with
	PE_LoadImage (makes Encarta 98 installer proceed).

	* [files/drive.c]
	Make GetDriveType16 return DRIVE_REMOVABLE for TYPE_CDROM.
	Make GetCurrentDirectory32 behave like the code does and not
	like the help describes.

	* [files/profile.c]
	Revoke recent change in PROFILE_GetSection and try better 
	handling of special case.

	* [include/windows.h]
	Change definition of ACCEL32.

	* [misc/commdlg.c]
	Replace the GetXXXFilename32 macros by normal code.
	Fix two reported bugs in my changes to commdlg.

	* [windows/win.c]
	Add a hook to catch bogus WM_SIZE messages by emitting a warning
	in the appropriate case.

	* [objects/bitmap.c]
	Reject unreasonbable large size arguments in
	CreateCompatibleBitmap32 and add an fixme for that situation.

Sun Apr 26 18:30:07 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [include/ldt.h] [debugger/*.c] [miscemu/instr.c]
	Added IS_SELECTOR_SYSTEM and IS_SELECTOR_32BIT macros.
	Make instruction emulation support system selectors.

	* [loader/*.c]
	Started moving NE specific functions to the new loader/ne
	directory.

	* [memory/environ.c]
	Enforce the 127 chars limit only when creating the environment of
	a Win16 process.

Sun Apr 26 12:22:23 1998  Andreas Mohr <100.30936@germany.net>

	* [files/file.c]
	Fixed an incredible typo in CopyFile32A that made it unusable
	since a rewrite in 970112 (!!).

	* [files/directory.c]
	Fixed GetTempPath32A/W to include trailing backslash.

	* [misc/ver.c]
	Make find_pe_resource "work" with corrupt files.

	* [misc/wsprintf.c]
	Altered WPRINTF_ParseFormatA/W to treat invalid format chars
	as normal output, too.

	* [msdos/dpmi.c]
	Implemented "Allocate/Free real mode callback" (0x0303/0x0304).
	Cross your fingers if you need to use it ;) (completely untested)
	Implemented "Call real mode proc with far return" (0x0301, tested).

	* [msdos/int21.c]
	Fixed ioctlGenericBlkDevReq/0x60.

	* [relay32/dplayx.spec] [relay32/builtin32.c] [relay32/Makefile.in]
	Added built-in DPLAYX.DLL. 

	* [windows/win.c]
	Fixed GetWindowWord()/GWW_HWNDPARENT to return the window's owner
	if it has no parent (SDK).

Sat Apr 25 15:09:53 1998  M.T.Fortescue  <mark@mtfhpc.demon.co.uk>

	* [debugger/db_disasm.c]
	Fixed disassemble bug for no-display option and 'lock',
	'repne' and 'repe' prefixes.

	* [debugger/registers.c]
	Added textual flag description output on 'info regs'.

Sat Apr 25 14:18:26 1998  Matthew Becker <mbecker@glasscity.net>

	* [*/*.c]
	Added stubs and/or documentation for the following functions: 
	LookupPrivilegeValue, OpenService, ControlService, RegGetKeySecurity, 
	StartService, SetComputerName, DeleteService, CloseServiceHandle, 
	OpenProcessToken, OpenSCManager, DeregisterEventSource, 
	WaitForDebugEvent, WaitForInputIdle, RegisterEventSource,
	SetDebugErrorLevel, SetConsoleCursorPosition, ChoosePixelFormat,
	SetPixelFormat, GetPixelFormat, DescribePixelFormat, SwapBuffers,
	PolyBezier, AbortPath, DestroyAcceleratorTable, HeapWalk,
	DdeInitialize, DdeUninitialize, DdeConnectList, DdeDisconnectList,
	DdeCreateStringHandle, DdePostAdvise, DdeGetData, DdeNameService,
	DdeGetLastError, WNetGetDirectoryType, EnumPrinters, RegFlushKey,
	RegGetKeySecurity, DllGetClassObject, DllCanUnloadNow, CreateBitmap,
	CreateCompatibleBitmap, CreateBitmapIndirect, GetBitmapBits,
	SetBitmapBits, LoadImage, CopyImage, LoadBitmap, DrawIcon,
	CreateDiscardableBitmap, SetDIBits, GetCharABCWidths, LoadTypeLib,
	SetConsoleCtrlHandler, CreateConsoleScreenBuffer, ReadConsoleInput,
	GetConsoleCursorInfo, SetConsoleCursorInfo, SetConsoleWindowInfo,
	SetConsoleTextAttribute, SetConsoleScreenBufferSize,
	FillConsoleOutputCharacter, FillConsoleOutputAttribute,
	CreateMailslot, GetMailslotInfo, GetCompressedFileSize,
	GetProcessWindowStation, GetThreadDesktop, SetDebugErrorLevel,
	WaitForDebugEvent, SetComputerName, CreateMDIWindow.

Thu Apr 23 23:54:04 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [include/windows.h] [objects/enhmetafile.c] [relay32/gdi32.spec]
	Implement CopyEnhMetaFile, Get/SetEnhMetaFileBits, other fixes.

	* [include/windows.h] [objects/metafile.c] [relay32/gdi32.spec]
	32-bit metafile fixes, implement EnumMetaFile32, GetMetaFileBitsEx.

	* [objects/font.c] [graphics/x11drv/xfont.c] [graphics/x11drv/text.c]
	Some rotated text support for X11R6 displays.

	* [win32/newfns.c] [ole/ole2nls.c]
	Moved GetNumberFormat32A.

Wed Apr 22 17:38:20 1998  David Lee Lambert <lamber45@egr.msu.edu>

	* [ole/ole2nls.c] [misc/network.c]
	Changed some function documentation to the new style.

	* [misc/network.c] [include/windows.h] [if1632/user.spec]
	  [relay32/mpr.spec] [misc/mpr.c]
	Added stubs for some Win32 network functions;  renamed some 
	16-bit ones with 32-bit counterparts,  as well as
	WNetGetDirectoryType;  moved the stubs in misc/mpr.c (three of
	them!) to misc/network.c.

	* [ole/compobj.c] [ole/storage.c] [ole/ole2disp.c] 
	  [ole/ole2nls.c] [ole/folders.c] [ole/moniker.c] [ole/ole2.c]
	  [graphics/fontengine.c] [graphics/ddraw.c] [graphics/env.c]
	  [graphics/driver.c] [graphics/escape.c]
	Changed fprintf's to proper debug-macros.

	* [include/winnls.h]
	Added some flags (for internal use).

	* [ole/ole2nls.c] 
	Added the Unicode core function, and worked out a way to hide
	the commonality of the core.

	* [relay32/kernel32.spec]
	Added support for GetDate/Time32A/W.

Wed Apr 22 09:16:03 1998  Gordon Chaffee  <chaffee@cs.berkeley.edu>

	* [win32/code_page.c]
	Fixed problem with MultiByteToWideChar that was introduced in
	last release.  Made MultiByteToWideChar more compatible with Win32.

	* [graphics/x11drv/graphics.c]
	Fixed problem with drawing arcs.

Tue Apr 21 11:24:58 1998  Constantine Sapuntzakis  <csapuntz@tma-1.lcs.mit.edu>

	*  [ole/ole2nls.c]
	Move stuff from 0x409 case to Lang_En. 

	*  [relay32/user32.spec] [windows/winpos.c]
	Added stubs for GetWindowRgn32 and SetWindowRgn32. Makes Office
	Paperclip happy.

Tue Apr 21 11:16:16 1998  Constantine Sapuntzakis  <csapuntz@tma-1.lcs.mit.edu>

	*  [loader/pe_image.c]
	If image is relocated, TLS addresses need to be adjusted.

	* [debugger/*.c]
	Generalized tests for 32-bit segments.

Tue Apr 21 02:04:59 1998  James Juran  <jrj120@psu.edu>
	
	* [misc/*.c] [miscemu/*.c] [msdos/*.c] [if1632/*.c] 
	  [include/*.h] [loader/*.c] [memory/*.c] [multimedia/*.c] 
	  [objects/*.c]
	Almost all fprintf statements converted to appropriate 
	debug messages.

	* [README]
	Updated "GETTING MORE INFORMATION" section to include WineHQ.

	* [documentation/debugger]
	Fixed typo.

	* [windows/defwnd.c]
	Added function documentation.

Sun Apr 19 16:30:58 1998  Marcus Meissner <marcus@mud.de>

	* [Make.rules.in]
	Added lint target (using lclint).

	* [relay32/oleaut32.spec][relay32/Makefile.in][ole/typelib.c]
	  [ole/ole2disp.c]
	Added oleaut32 spec, added some SysString functions.

	* [if1632/signal.c]
	Added printing of faultaddress in Linux (using CR2 debug register).

	* [configure.in]
	Added <sys/types.h> for statfs checks.

	* [loader/*.c][debugger/break.c][debugger/hash.c]
	Started to split win32/win16 module handling, preparing support
	for other binary formats (like ELF).

Sat Apr 18 10:07:41 1998  Rein Klazes <rklazes@casema.net>

	* [misc/registry.c]
	Fixed a bug that made RegQueryValuexxx returning
	incorrect registry values.

Fri Apr 17 22:59:22 1998  Alexander V. Lukyanov <lav@long.yar.ru>

	* [misc/lstr.c]
	FormatMessage32*: remove linefeed when nolinefeed set;
	check for target underflow.

Fri Apr 17 00:38:14 1998  Alexander V. Lukyanov <lav@long.yar.ru>

	* [misc/crtdll.c]
	Implement xlat_file_ptr for CRT stdin/stdout/stderr address
	translation.

Wed Apr 15 20:43:56 1998  Jim Peterson <jspeter@birch.ee.vt.edu>

	* [controls/menu.c]
	Added 'odaction' parameter to MENU_DrawMenuItem() and redirected
	WM_DRAWITEM messages to GetWindow(hwnd,GW_OWNER).

Tue Apr 14 16:17:55 1998  Berend Reitsma <berend@united-info.com>

	* [graphics/metafiledrv/init.c]	[graphics/painting.c] 
	  [graphics/win16drv/init.c] [graphics/x11drv/graphics.c]
	  [graphics/x11drv/init.c] [include/gdi.h] [include/x11drv.h]
	  [relay32/gdi32.spec]
	Added PolyPolyline routine.

	* [windows/winproc.c]
	Changed WINPROC_GetProc() to return proc instead of &(jmp proc).
This commit is contained in:
Alexandre Julliard 1998-05-03 19:01:20 +00:00
parent c7c217b31c
commit 46ea8b3f73
191 changed files with 7609 additions and 4284 deletions

View File

@ -1,14 +1,14 @@
This is release 980413 of Wine, the MS Windows emulator. This is still a
This is release 980503 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 correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-980413: (see ChangeLog for details)
- Flat thunks support.
- Many more autoconf checks for better portability.
- DIALOGEX resource support.
WHAT'S NEW with Wine-980503: (see ChangeLog for details)
- Module loading restructuration.
- Some rotated text support.
- Documentation for many more functions.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980413.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980413.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980413.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980413.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980503.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980503.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980503.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980503.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

256
ChangeLog
View File

@ -1,3 +1,259 @@
----------------------------------------------------------------------
Thu Apr 30 16:28:12 1998 James Juran <jrj120@psu.edu>
* [scheduler/process.c]
Implemented GetExitCodeProcess. The code is a direct translation
of GetExitCodeThread.
Mon Apr 27 22:20:25 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [loader/pe_image.c]
Unload dummy module when PE_LoadLibraryEx32A fails with
PE_LoadImage (makes Encarta 98 installer proceed).
* [files/drive.c]
Make GetDriveType16 return DRIVE_REMOVABLE for TYPE_CDROM.
Make GetCurrentDirectory32 behave like the code does and not
like the help describes.
* [files/profile.c]
Revoke recent change in PROFILE_GetSection and try better
handling of special case.
* [include/windows.h]
Change definition of ACCEL32.
* [misc/commdlg.c]
Replace the GetXXXFilename32 macros by normal code.
Fix two reported bugs in my changes to commdlg.
* [windows/win.c]
Add a hook to catch bogus WM_SIZE messages by emitting a warning
in the appropriate case.
* [objects/bitmap.c]
Reject unreasonbable large size arguments in
CreateCompatibleBitmap32 and add an fixme for that situation.
Sun Apr 26 18:30:07 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/ldt.h] [debugger/*.c] [miscemu/instr.c]
Added IS_SELECTOR_SYSTEM and IS_SELECTOR_32BIT macros.
Make instruction emulation support system selectors.
* [loader/*.c]
Started moving NE specific functions to the new loader/ne
directory.
* [memory/environ.c]
Enforce the 127 chars limit only when creating the environment of
a Win16 process.
Sun Apr 26 12:22:23 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed an incredible typo in CopyFile32A that made it unusable
since a rewrite in 970112 (!!).
* [files/directory.c]
Fixed GetTempPath32A/W to include trailing backslash.
* [misc/ver.c]
Make find_pe_resource "work" with corrupt files.
* [misc/wsprintf.c]
Altered WPRINTF_ParseFormatA/W to treat invalid format chars
as normal output, too.
* [msdos/dpmi.c]
Implemented "Allocate/Free real mode callback" (0x0303/0x0304).
Cross your fingers if you need to use it ;) (completely untested)
Implemented "Call real mode proc with far return" (0x0301, tested).
* [msdos/int21.c]
Fixed ioctlGenericBlkDevReq/0x60.
* [relay32/dplayx.spec] [relay32/builtin32.c] [relay32/Makefile.in]
Added built-in DPLAYX.DLL.
* [windows/win.c]
Fixed GetWindowWord()/GWW_HWNDPARENT to return the window's owner
if it has no parent (SDK).
Sat Apr 25 15:09:53 1998 M.T.Fortescue <mark@mtfhpc.demon.co.uk>
* [debugger/db_disasm.c]
Fixed disassemble bug for no-display option and 'lock',
'repne' and 'repe' prefixes.
* [debugger/registers.c]
Added textual flag description output on 'info regs'.
Sat Apr 25 14:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [*/*.c]
Added stubs and/or documentation for the following functions:
LookupPrivilegeValue, OpenService, ControlService, RegGetKeySecurity,
StartService, SetComputerName, DeleteService, CloseServiceHandle,
OpenProcessToken, OpenSCManager, DeregisterEventSource,
WaitForDebugEvent, WaitForInputIdle, RegisterEventSource,
SetDebugErrorLevel, SetConsoleCursorPosition, ChoosePixelFormat,
SetPixelFormat, GetPixelFormat, DescribePixelFormat, SwapBuffers,
PolyBezier, AbortPath, DestroyAcceleratorTable, HeapWalk,
DdeInitialize, DdeUninitialize, DdeConnectList, DdeDisconnectList,
DdeCreateStringHandle, DdePostAdvise, DdeGetData, DdeNameService,
DdeGetLastError, WNetGetDirectoryType, EnumPrinters, RegFlushKey,
RegGetKeySecurity, DllGetClassObject, DllCanUnloadNow, CreateBitmap,
CreateCompatibleBitmap, CreateBitmapIndirect, GetBitmapBits,
SetBitmapBits, LoadImage, CopyImage, LoadBitmap, DrawIcon,
CreateDiscardableBitmap, SetDIBits, GetCharABCWidths, LoadTypeLib,
SetConsoleCtrlHandler, CreateConsoleScreenBuffer, ReadConsoleInput,
GetConsoleCursorInfo, SetConsoleCursorInfo, SetConsoleWindowInfo,
SetConsoleTextAttribute, SetConsoleScreenBufferSize,
FillConsoleOutputCharacter, FillConsoleOutputAttribute,
CreateMailslot, GetMailslotInfo, GetCompressedFileSize,
GetProcessWindowStation, GetThreadDesktop, SetDebugErrorLevel,
WaitForDebugEvent, SetComputerName, CreateMDIWindow.
Thu Apr 23 23:54:04 1998 Douglas Ridgway <ridgway@winehq.com>
* [include/windows.h] [objects/enhmetafile.c] [relay32/gdi32.spec]
Implement CopyEnhMetaFile, Get/SetEnhMetaFileBits, other fixes.
* [include/windows.h] [objects/metafile.c] [relay32/gdi32.spec]
32-bit metafile fixes, implement EnumMetaFile32, GetMetaFileBitsEx.
* [objects/font.c] [graphics/x11drv/xfont.c] [graphics/x11drv/text.c]
Some rotated text support for X11R6 displays.
* [win32/newfns.c] [ole/ole2nls.c]
Moved GetNumberFormat32A.
Wed Apr 22 17:38:20 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [misc/network.c]
Changed some function documentation to the new style.
* [misc/network.c] [include/windows.h] [if1632/user.spec]
[relay32/mpr.spec] [misc/mpr.c]
Added stubs for some Win32 network functions; renamed some
16-bit ones with 32-bit counterparts, as well as
WNetGetDirectoryType; moved the stubs in misc/mpr.c (three of
them!) to misc/network.c.
* [ole/compobj.c] [ole/storage.c] [ole/ole2disp.c]
[ole/ole2nls.c] [ole/folders.c] [ole/moniker.c] [ole/ole2.c]
[graphics/fontengine.c] [graphics/ddraw.c] [graphics/env.c]
[graphics/driver.c] [graphics/escape.c]
Changed fprintf's to proper debug-macros.
* [include/winnls.h]
Added some flags (for internal use).
* [ole/ole2nls.c]
Added the Unicode core function, and worked out a way to hide
the commonality of the core.
* [relay32/kernel32.spec]
Added support for GetDate/Time32A/W.
Wed Apr 22 09:16:03 1998 Gordon Chaffee <chaffee@cs.berkeley.edu>
* [win32/code_page.c]
Fixed problem with MultiByteToWideChar that was introduced in
last release. Made MultiByteToWideChar more compatible with Win32.
* [graphics/x11drv/graphics.c]
Fixed problem with drawing arcs.
Tue Apr 21 11:24:58 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [ole/ole2nls.c]
Move stuff from 0x409 case to Lang_En.
* [relay32/user32.spec] [windows/winpos.c]
Added stubs for GetWindowRgn32 and SetWindowRgn32. Makes Office
Paperclip happy.
Tue Apr 21 11:16:16 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [loader/pe_image.c]
If image is relocated, TLS addresses need to be adjusted.
* [debugger/*.c]
Generalized tests for 32-bit segments.
Tue Apr 21 02:04:59 1998 James Juran <jrj120@psu.edu>
* [misc/*.c] [miscemu/*.c] [msdos/*.c] [if1632/*.c]
[include/*.h] [loader/*.c] [memory/*.c] [multimedia/*.c]
[objects/*.c]
Almost all fprintf statements converted to appropriate
debug messages.
* [README]
Updated "GETTING MORE INFORMATION" section to include WineHQ.
* [documentation/debugger]
Fixed typo.
* [windows/defwnd.c]
Added function documentation.
Sun Apr 19 16:30:58 1998 Marcus Meissner <marcus@mud.de>
* [Make.rules.in]
Added lint target (using lclint).
* [relay32/oleaut32.spec][relay32/Makefile.in][ole/typelib.c]
[ole/ole2disp.c]
Added oleaut32 spec, added some SysString functions.
* [if1632/signal.c]
Added printing of faultaddress in Linux (using CR2 debug register).
* [configure.in]
Added <sys/types.h> for statfs checks.
* [loader/*.c][debugger/break.c][debugger/hash.c]
Started to split win32/win16 module handling, preparing support
for other binary formats (like ELF).
Sat Apr 18 10:07:41 1998 Rein Klazes <rklazes@casema.net>
* [misc/registry.c]
Fixed a bug that made RegQueryValuexxx returning
incorrect registry values.
Fri Apr 17 22:59:22 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/lstr.c]
FormatMessage32*: remove linefeed when nolinefeed set;
check for target underflow.
Fri Apr 17 00:38:14 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/crtdll.c]
Implement xlat_file_ptr for CRT stdin/stdout/stderr address
translation.
Wed Apr 15 20:43:56 1998 Jim Peterson <jspeter@birch.ee.vt.edu>
* [controls/menu.c]
Added 'odaction' parameter to MENU_DrawMenuItem() and redirected
WM_DRAWITEM messages to GetWindow(hwnd,GW_OWNER).
Tue Apr 14 16:17:55 1998 Berend Reitsma <berend@united-info.com>
* [graphics/metafiledrv/init.c] [graphics/painting.c]
[graphics/win16drv/init.c] [graphics/x11drv/graphics.c]
[graphics/x11drv/init.c] [include/gdi.h] [include/x11drv.h]
[relay32/gdi32.spec]
Added PolyPolyline routine.
* [windows/winproc.c]
Changed WINPROC_GetProc() to return proc instead of &(jmp proc).
----------------------------------------------------------------------
Sun Apr 12 12:22:23 1997 Andreas Mohr <100.30936@germany.net>

View File

@ -37,6 +37,8 @@ AR = ar rc
RM = rm -f
MKDIR = mkdir
C2MAN = @C2MAN@
LINT = lclint
LINTFLAGS = +posixlib +gnuextensions +trytorecover
BUILD = $(TOPOBJDIR)/tools/build@PROGEXT@
MAKEDEP = $(TOPOBJDIR)/tools/makedep@PROGEXT@
WINERC = $(TOPOBJDIR)/rc/winerc@PROGEXT@
@ -114,6 +116,16 @@ $(MODULE).o: $(OBJS)
man: $(C_SRCS)
for i in $(C_SRCS); do $(C2MAN) -L -o$(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) $$i; done
# Rule for linting
lint:
for i in $(C_SRCS); do $(LINT) $(LINTFLAGS) -D__WINE__ $(OPTIONS) $(DIVINCL) $(X_CFLAGS) $$i; done
# Rule for html pages
html: $(C_SRCS)
for i in $(C_SRCS); do $(C2MAN) -L -o$(TOPOBJDIR)/documentation/html -Th -iwindows.h $(DIVINCL) $$i; done
# Misc. rules
depend:: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)

View File

@ -34,6 +34,7 @@ LIBSUBDIRS = \
ipc \
library \
loader \
loader/ne \
memory \
misc \
msdos \
@ -78,6 +79,7 @@ LIBOBJS = \
graphics/x11drv/x11drv.o \
ipc/ipc.o \
loader/loader.o \
loader/ne/ne.o \
memory/memory.o \
misc/misc.o \
msdos/msdos.o \
@ -149,6 +151,10 @@ manpages:
-$(MKDIR) $(TOPOBJDIR)/documentation/man3w
for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
htmlpages:
-$(MKDIR) $(TOPOBJDIR)/documentation/html
for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
clean::
for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
for i in include; do (cd $$i; $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc); done

19
README
View File

@ -83,10 +83,21 @@ UPDATE: Windows 95 components are known to cause more crashes compared
5. GETTING MORE INFORMATION
The best place to get help or to report bugs is the Usenet newsgroup
comp.emulators.ms-windows.wine. The Wine FAQ is posted there every
month. Also, you may want to browse old messages on www.dejanews.com
to check whether your problem is already fixed.
Usenet: The best place to get help or to report bugs is the Usenet newsgroup
comp.emulators.ms-windows.wine. The Wine FAQ is posted there every
month.
WWW: Please browse old messages on http://www.dejanews.com to check whether
your problem is already fixed before posting a bug report to the
newsgroup.
A great deal of information about Wine is available from WineHQ at
http://www.winehq.com. Untested patches against the current
release are available at http://www.winehq.com/patches.
FAQ: The Wine FAQ is located at http://home.pacbell.net/dagar/wine.html.
If you add something, or fix a bug, please send a patch ('diff -u'
format preferred) to julliard@lrc.epfl.ch for inclusion in the next

12
configure vendored
View File

@ -2820,6 +2820,7 @@ else
#line 2821 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -2841,7 +2842,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bavail=yes
else
@ -2865,7 +2866,7 @@ EOF
fi
echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
echo "configure:2869: checking "for statfs.f_bfree"" >&5
echo "configure:2870: checking "for statfs.f_bfree"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2874,9 +2875,10 @@ else
wine_cv_statfs_bfree=no
else
cat > conftest.$ac_ext <<EOF
#line 2878 "configure"
#line 2879 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -2898,7 +2900,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bfree=yes
else
@ -3043,6 +3045,7 @@ ipc/Makefile
library/Makefile
libtest/Makefile
loader/Makefile
loader/ne/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile
@ -3172,6 +3175,7 @@ ipc/Makefile
library/Makefile
libtest/Makefile
loader/Makefile
loader/ne/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile

View File

@ -227,6 +227,7 @@ AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
wine_cv_statfs_bavail=no
else
AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -257,6 +258,7 @@ AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
wine_cv_statfs_bfree=no
else
AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -303,6 +305,7 @@ ipc/Makefile
library/Makefile
libtest/Makefile
loader/Makefile
loader/ne/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile

View File

@ -817,7 +817,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
* Draw a single menu item.
*/
static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
UINT32 height, BOOL32 menuBar )
UINT32 height, BOOL32 menuBar, UINT32 odaction )
{
RECT32 rect;
@ -843,7 +843,6 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
{
DRAWITEMSTRUCT32 dis;
TRACE(menu, "Ownerdraw!\n" );
dis.CtlType = ODT_MENU;
dis.itemID = lpitem->wID;
dis.itemData = (DWORD)lpitem->text;
@ -851,11 +850,16 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
if (lpitem->fState & MF_CHECKED) dis.itemState |= ODS_CHECKED;
if (lpitem->fState & MF_GRAYED) dis.itemState |= ODS_GRAYED;
if (lpitem->fState & MF_HILITE) dis.itemState |= ODS_SELECTED;
dis.itemAction = ODA_DRAWENTIRE | ODA_SELECT | ODA_FOCUS;
dis.itemAction = odaction; /* ODA_DRAWENTIRE | ODA_SELECT | ODA_FOCUS; */
dis.hwndItem = hwnd;
dis.hDC = hdc;
dis.rcItem = lpitem->rect;
SendMessage32A( hwnd, WM_DRAWITEM, 0, (LPARAM)&dis );
TRACE(menu, "Ownerdraw: itemID=%d, itemState=%d, itemAction=%d, "
"hwndItem=%04x, hdc=%04x, rcItem={%d,%d,%d,%d}, rcItem=%p\n",dis.itemID,
dis.itemState, dis.itemAction, dis.hwndItem, dis.hDC,
dis.rcItem.left, dis.rcItem.top, dis.rcItem.right,
dis.rcItem.bottom, dis.rcItem );
SendMessage32A( GetWindow32(hwnd,GW_OWNER), WM_DRAWITEM, 0, (LPARAM)&dis );
return;
}
@ -1114,7 +1118,8 @@ static void MENU_DrawPopupMenu( HWND32 hwnd, HDC32 hdc, HMENU32 hmenu )
UINT32 u;
for (u = menu->nItems, item = menu->items; u > 0; u--, item++)
MENU_DrawMenuItem( hwnd, hdc, item, menu->Height, FALSE );
MENU_DrawMenuItem( hwnd, hdc, item, menu->Height, FALSE,
ODA_DRAWENTIRE );
}
} else SelectObject32( hdc, hPrevBrush );
@ -1156,7 +1161,8 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
if (lppop->nItems == 0) return SYSMETRICS_CYMENU;
for (i = 0; i < lppop->nItems; i++)
{
MENU_DrawMenuItem( hwnd, hDC, &lppop->items[i], lppop->Height, TRUE );
MENU_DrawMenuItem( hwnd, hDC, &lppop->items[i], lppop->Height, TRUE,
ODA_DRAWENTIRE );
}
return lppop->Height;
}
@ -1339,7 +1345,8 @@ static void MENU_SelectItem( HWND32 hwndOwner, HMENU32 hmenu, UINT32 wIndex,
{
lppop->items[lppop->FocusedItem].fState &= ~(MF_HILITE|MF_MOUSESELECT);
MENU_DrawMenuItem(lppop->hWnd,hdc,&lppop->items[lppop->FocusedItem],
lppop->Height, !(lppop->wFlags & MF_POPUP) );
lppop->Height, !(lppop->wFlags & MF_POPUP),
ODA_SELECT );
}
/* Highlight new item (if any) */
@ -1348,7 +1355,8 @@ static void MENU_SelectItem( HWND32 hwndOwner, HMENU32 hmenu, UINT32 wIndex,
{
lppop->items[lppop->FocusedItem].fState |= MF_HILITE;
MENU_DrawMenuItem( lppop->hWnd, hdc, &lppop->items[lppop->FocusedItem],
lppop->Height, !(lppop->wFlags & MF_POPUP) );
lppop->Height, !(lppop->wFlags & MF_POPUP),
ODA_SELECT );
if (sendMenuSelect)
{
MENUITEM *ip = &lppop->items[lppop->FocusedItem];
@ -1742,7 +1750,7 @@ static HMENU32 MENU_ShowSubPopup( HWND32 hwndOwner, HMENU32 hmenu,
if (menu->wFlags & MF_POPUP) hdc = GetDC32( menu->hWnd );
else hdc = GetDCEx32( menu->hWnd, 0, DCX_CACHE | DCX_WINDOW);
item->fState |= MF_HILITE;
MENU_DrawMenuItem( menu->hWnd, hdc, item, menu->Height, !(menu->wFlags & MF_POPUP) );
MENU_DrawMenuItem( menu->hWnd, hdc, item, menu->Height, !(menu->wFlags & MF_POPUP), ODA_DRAWENTIRE );
ReleaseDC32( menu->hWnd, hdc );
}
if (!item->rect.top && !item->rect.left && !item->rect.bottom && !item->rect.right)

View File

@ -339,37 +339,14 @@ void DEBUG_AddModuleBreakpoints(void)
NE_MODULE *pModule;
BOOL32 ok;
DBG_ADDR addr = { NULL, 0, 0 };
WINE_MODREF *wm;
for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry))
{
if (!(pModule = MODULE_GetPtr( entry.hModule ))) continue;
if (!(pModule = MODULE_GetPtr16( entry.hModule ))) continue;
if (pModule->flags & NE_FFLAGS_LIBMODULE) continue; /* Library */
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
{
PE_MODREF *pem = PROCESS_Current()->modref_list;
if (!pem)
{
addr.seg = 0;
addr.off = (DWORD)RVA_PTR( pModule->module32,
OptionalHeader.AddressOfEntryPoint);
}
else
{
while (pem)
{
if (pem->module == pModule->module32) break;
pem = pem->next;
}
if (!pem) continue;
addr.seg = 0;
addr.off = (DWORD)RVA_PTR( pem->module,
OptionalHeader.AddressOfEntryPoint);
}
fprintf( stderr, "Win32 task '%s': ", entry.szModule );
DEBUG_AddBreakpoint( &addr );
}
else /* NE module */
if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */
{
addr.seg = NE_SEG_TABLE(pModule)[pModule->cs-1].selector;
addr.off = pModule->ip;
@ -377,6 +354,12 @@ void DEBUG_AddModuleBreakpoints(void)
DEBUG_AddBreakpoint( &addr );
}
}
for (wm=PROCESS_Current()->modref_list;wm;wm=wm->next) {
addr.seg = 0;
addr.off =(DWORD)RVA_PTR(wm->module,OptionalHeader.AddressOfEntryPoint);
fprintf( stderr, "Win32 module '%s': ", wm->modname );
DEBUG_AddBreakpoint( &addr );
}
DEBUG_SetBreakpoints( TRUE ); /* Setup breakpoints */
}
@ -394,15 +377,14 @@ BOOL32 DEBUG_ShouldContinue( enum exec_mode mode, int * count )
DBG_ADDR cond_addr;
int bpnum;
struct list_id list;
WORD cs;
/* If not single-stepping, back up over the int3 instruction */
if (!(EFL_reg(&DEBUG_context) & STEP_FLAG)) EIP_reg(&DEBUG_context)--;
GET_CS(cs);
addr.seg = (CS_reg(&DEBUG_context) == cs) ? 0 : CS_reg(&DEBUG_context);
addr.seg = CS_reg(&DEBUG_context);
addr.off = EIP_reg(&DEBUG_context);
if (IS_SELECTOR_SYSTEM(addr.seg)) addr.seg = 0;
bpnum = DEBUG_FindBreakpoint( &addr );
breakpoints[0].enabled = 0; /* disable the step-over breakpoint */
@ -519,11 +501,10 @@ enum exec_mode DEBUG_RestartExecution( enum exec_mode mode, int count )
unsigned int * value;
enum exec_mode ret_mode;
BYTE *instr;
WORD cs;
GET_CS(cs);
addr.seg = (CS_reg(&DEBUG_context) == cs) ? 0 : CS_reg(&DEBUG_context);
addr.seg = CS_reg(&DEBUG_context);
addr.off = EIP_reg(&DEBUG_context);
if (IS_SELECTOR_SYSTEM(addr.seg)) addr.seg = 0;
/*
* This is the mode we will be running in after we finish. We would like

View File

@ -1009,8 +1009,6 @@ static void db_task_printsym(unsigned int addr, int size)
switch(size)
{
case BYTE:
fprintf(stderr, "0x%2.2x", addr & 0xff );
break;
case WORD:
fprintf(stderr, "0x%4.4x", addr & 0xffff );
break;
@ -1162,9 +1160,7 @@ void DEBUG_Disasm( DBG_ADDR *addr, int display )
* Set this so we get can supress the printout if we need to.
*/
db_display = display;
if (!addr->seg) db_disasm_16 = FALSE;
else db_disasm_16 = !(GET_SEL_FLAGS(addr->seg) & LDT_FLAGS_32BIT);
db_disasm_16 = !IS_SELECTOR_32BIT(addr->seg);
get_value_inc( inst, addr, 1, FALSE );
@ -1212,13 +1208,16 @@ void DEBUG_Disasm( DBG_ADDR *addr, int display )
seg = "%gs";
break;
case 0xf0:
fprintf(stderr,"lock ");
if( db_display )
fprintf(stderr,"lock ");
break;
case 0xf2:
fprintf(stderr,"repne ");
if( db_display )
fprintf(stderr,"repne ");
break;
case 0xf3:
fprintf(stderr,"repe "); /* XXX repe VS rep */
if( db_display )
fprintf(stderr,"repe "); /* XXX repe VS rep */
break;
default:
prefix = FALSE;

View File

@ -17,6 +17,7 @@
#include "win.h"
#include "winnt.h"
#include "debugger.h"
#include "neexe.h"
#include "expr.h"
@ -253,7 +254,7 @@ info_command:
| tINFO tCLASS expr_value tEOL { CLASS_DumpClass( (CLASS *)$3 );
DEBUG_FreeExprMem(); }
| tINFO tSHARE tEOL { DEBUG_InfoShare(); }
| tINFO tMODULE expr_value tEOL { MODULE_DumpModule( $3 );
| tINFO tMODULE expr_value tEOL { NE_DumpModule( $3 );
DEBUG_FreeExprMem(); }
| tINFO tQUEUE expr_value tEOL { QUEUE_DumpQueue( $3 );
DEBUG_FreeExprMem(); }
@ -270,7 +271,7 @@ info_command:
walk_command:
tWALK tCLASS tEOL { CLASS_WalkClasses(); }
| tWALK tMODULE tEOL { MODULE_WalkModules(); }
| tWALK tMODULE tEOL { NE_WalkModules(); }
| tWALK tQUEUE tEOL { QUEUE_WalkQueues(); }
| tWALK tWND tEOL { WIN_WalkWindows( 0, 0 ); }
| tWALK tWND tNUM tEOL { WIN_WalkWindows( $3, 0 ); }
@ -476,9 +477,7 @@ static void DEBUG_Main( int signal )
XUngrabServer( display );
XFlush( display );
if (!addr.seg) newmode = 32;
else newmode = (GET_SEL_FLAGS(addr.seg) & LDT_FLAGS_32BIT) ? 32 : 16;
newmode = IS_SELECTOR_32BIT(addr.seg) ? 32 : 16;
if (newmode != dbg_mode)
fprintf(stderr,"In %d bit mode.\n", dbg_mode = newmode);

View File

@ -103,12 +103,12 @@ void WIN_WalkWindows( HWND32 hwnd, int indent )
exit(0);
}
NE_MODULE *MODULE_GetPtr( HMODULE16 hModule )
NE_MODULE *MODULE_GetPtr16( HMODULE16 hModule )
{
exit(0);
}
FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
{
exit(0);
}

View File

@ -754,8 +754,7 @@ static void DEBUG_LoadEntryPoints16( HMODULE16 hModule, NE_MODULE *pModule,
{
cpnt += *cpnt + 1 + sizeof(WORD);
sprintf( buffer, "%s.%.*s", name, *cpnt, cpnt + 1 );
if ((address = MODULE_GetEntryPoint( hModule,
*(WORD *)(cpnt + *cpnt + 1) )))
if ((address = NE_GetEntryPoint(hModule, *(WORD *)(cpnt + *cpnt + 1))))
{
addr.seg = HIWORD(address);
addr.off = LOWORD(address);
@ -772,8 +771,7 @@ static void DEBUG_LoadEntryPoints16( HMODULE16 hModule, NE_MODULE *pModule,
{
cpnt += *cpnt + 1 + sizeof(WORD);
sprintf( buffer, "%s.%.*s", name, *cpnt, cpnt + 1 );
if ((address = MODULE_GetEntryPoint( hModule,
*(WORD *)(cpnt + *cpnt + 1) )))
if ((address = NE_GetEntryPoint(hModule, *(WORD *)(cpnt + *cpnt + 1))))
{
addr.seg = HIWORD(address);
addr.off = LOWORD(address);
@ -875,17 +873,20 @@ void DEBUG_LoadEntryPoints(void)
MODULEENTRY entry;
NE_MODULE *pModule;
BOOL32 ok;
WINE_MODREF *wm;
for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry))
{
if (!(pModule = MODULE_GetPtr( entry.hModule ))) continue;
if (!(pModule = MODULE_GetPtr16( entry.hModule ))) continue;
fprintf( stderr, " %s", entry.szModule );
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
DEBUG_LoadEntryPoints32( pModule->module32, entry.szModule );
else /* NE module */
if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */
DEBUG_LoadEntryPoints16( entry.hModule, pModule, entry.szModule );
}
for (wm=PROCESS_Current()->modref_list;wm;wm=wm->next) {
fprintf( stderr, " %s", wm->modname );
DEBUG_LoadEntryPoints32( wm->module, wm->modname );
}
}

View File

@ -192,6 +192,59 @@ void DEBUG_GetSigContext( SIGCONTEXT *sigcontext )
#endif
}
/***********************************************************************
* DEBUG_Flags
*
* Return Flag String.
*/
char *DEBUG_Flags( DWORD flag, char *buf )
{
char *pt;
strcpy( buf, " - 00 - - - " );
pt = buf + strlen( buf );
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000001 ) *pt = 'C'; /* Carry Falg */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000002 ) *pt = '1';
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000004 ) *pt = 'P'; /* Parity Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000008 ) *pt = '-';
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000010 ) *pt = 'A'; /* Auxiliary Carry Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000020 ) *pt = '-';
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000040 ) *pt = 'Z'; /* Zero Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000080 ) *pt = 'S'; /* Sign Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000100 ) *pt = 'T'; /* Trap/Trace Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000200 ) *pt = 'I'; /* Interupt Enable Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000400 ) *pt = 'D'; /* Direction Indicator */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00000800 ) *pt = 'O'; /* Overflow Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00001000 ) *pt = '1'; /* I/O Privilage Level */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00002000 ) *pt = '1'; /* I/O Privilage Level */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00004000 ) *pt = 'N'; /* Nested Task Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00008000 ) *pt = '-';
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00010000 ) *pt = 'R'; /* Resume Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00020000 ) *pt = 'V'; /* Vritual Mode Flag */
if ( buf >= pt-- ) return( buf );
if ( flag & 0x00040000 ) *pt = 'a'; /* Alignment Check Flag */
if ( buf >= pt-- ) return( buf );
return( buf );
}
/***********************************************************************
* DEBUG_InfoRegisters
@ -200,6 +253,8 @@ void DEBUG_GetSigContext( SIGCONTEXT *sigcontext )
*/
void DEBUG_InfoRegisters(void)
{
char flag[33];
fprintf(stderr,"Register dump:\n");
/* First get the segment registers out of the way */
@ -209,9 +264,10 @@ void DEBUG_InfoRegisters(void)
(WORD)FS_reg(&DEBUG_context), (WORD)GS_reg(&DEBUG_context) );
if (dbg_mode == 16)
{
fprintf( stderr,"\n IP:%04x SP:%04x BP:%04x FLAGS:%04x\n",
fprintf( stderr,"\n IP:%04x SP:%04x BP:%04x FLAGS:%04x(%s)\n",
IP_reg(&DEBUG_context), SP_reg(&DEBUG_context),
BP_reg(&DEBUG_context), FL_reg(&DEBUG_context) );
BP_reg(&DEBUG_context), FL_reg(&DEBUG_context),
DEBUG_Flags(FL_reg(&DEBUG_context), flag));
fprintf( stderr," AX:%04x BX:%04x CX:%04x DX:%04x SI:%04x DI:%04x\n",
AX_reg(&DEBUG_context), BX_reg(&DEBUG_context),
CX_reg(&DEBUG_context), DX_reg(&DEBUG_context),
@ -219,9 +275,10 @@ void DEBUG_InfoRegisters(void)
}
else /* 32-bit mode */
{
fprintf( stderr, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx\n",
fprintf( stderr, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n",
EIP_reg(&DEBUG_context), ESP_reg(&DEBUG_context),
EBP_reg(&DEBUG_context), EFL_reg(&DEBUG_context) );
EBP_reg(&DEBUG_context), EFL_reg(&DEBUG_context),
DEBUG_Flags(EFL_reg(&DEBUG_context), flag));
fprintf( stderr, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
EAX_reg(&DEBUG_context), EBX_reg(&DEBUG_context),
ECX_reg(&DEBUG_context), EDX_reg(&DEBUG_context) );

View File

@ -492,10 +492,9 @@ DEBUG_Disassemble(const DBG_ADDR *xstart,const DBG_ADDR *xend,int offset)
last = DEBUG_LastDisassemble;
if (!last.seg && !last.off)
{
WORD cs;
GET_CS(cs);
last.seg = (CS_reg(&DEBUG_context) == cs) ? 0 : CS_reg(&DEBUG_context);
last.seg = CS_reg(&DEBUG_context);
last.off = EIP_reg(&DEBUG_context);
if (IS_SELECTOR_SYSTEM(last.seg)) last.seg = 0;
}
for (i=0;i<offset;i++)
if (!_disassemble(&last)) break;

View File

@ -51,24 +51,16 @@ typedef struct
*/
void DEBUG_InfoStack(void)
{
DBG_ADDR addr;
WORD ss;
DBG_ADDR addr = { NULL, SS_reg(&DEBUG_context), ESP_reg(&DEBUG_context) };
fprintf(stderr,"Stack dump:\n");
GET_SS(ss);
if ((SS_reg(&DEBUG_context) == ss) ||
(GET_SEL_FLAGS(SS_reg(&DEBUG_context)) & LDT_FLAGS_32BIT))
if (IS_SELECTOR_32BIT(addr.seg))
{ /* 32-bit mode */
addr.seg = 0;
addr.off = ESP_reg(&DEBUG_context);
addr.type = NULL;
DEBUG_ExamineMemory( &addr, 24, 'x' );
}
else /* 16-bit mode */
{
addr.seg = SS_reg(&DEBUG_context);
addr.off = SP_reg(&DEBUG_context);
addr.type = NULL;
addr.off &= 0xffff;
DEBUG_ExamineMemory( &addr, 24, 'w' );
}
fprintf(stderr,"\n");
@ -84,11 +76,9 @@ void DEBUG_BackTrace(void)
{
DBG_ADDR addr;
int frameno = 0;
WORD ss;
fprintf(stderr,"Backtrace:\n");
GET_SS(ss);
if (SS_reg(&DEBUG_context) == ss) /* 32-bit mode */
if (IS_SELECTOR_SYSTEM(SS_reg(&DEBUG_context))) /* system stack */
{
nframe = 1;
if (frames) free( frames );
@ -163,15 +153,13 @@ void DEBUG_BackTrace(void)
*/
void DEBUG_SilentBackTrace(void)
{
WORD ss;
DBG_ADDR addr;
int frameno = 0;
nframe = 1;
if (frames) free( frames );
frames = (struct bt_info *) xmalloc( sizeof(struct bt_info) );
GET_SS(ss);
if (SS_reg(&DEBUG_context) == ss) /* 32-bit mode */
if (IS_SELECTOR_SYSTEM(SS_reg(&DEBUG_context))) /* system stack */
{
addr.seg = 0;
addr.off = EIP_reg(&DEBUG_context);

View File

@ -119,8 +119,8 @@ Program reports an error with a Messagebox
Since the failure happens usually directly before setting up the Messagebox
you can start wine with "-debug" added to the commandline, set a breakpoint
at "MessageBox32A" (called by win16 and win32 programs) and proceed with
"continue". With "-debugmsg +all" Wine will now stop directly directly
before setting up the Messagebox. Proceed as explained above.
"continue". With "-debugmsg +all" Wine will now stop directly before
setting up the Messagebox. Proceed as explained above.
You can also run wine using "wine -debugmsg +relay program.exe 2>&1|less -i"
and in less search for messagebox.

View File

@ -71,9 +71,8 @@ comm, commdlg, crtdll, cursor, dc, dde, dialog, dll, dosfs, driver, edit,
env, event, exec, file, fixup, font, gdi, global, graphics, heap, hook,
icon, int, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi,
menu, message, metafile, midi, mmio, mmsys, mmtime, module, msg, nonclient,
ole, palette, profile, prop, reg, region, relay, resource, scroll, selector,
sem, sendmsg, shm, stress, string, syscolor, task, text, timer, toolhelp,
ver, vxd, win, win32, winsock.
ole, palette, profile, prop, reg, region, relay, resource, scroll, segment,
selector,sem, sendmsg, shm, stress, string, syscolor, task, text, timer, toolhelp,ver, vxd, win, win32, winsock.
.TP
.I -depth n
Change the depth to use for multiple-depth screens

View File

@ -129,7 +129,13 @@ UINT32 WINAPI GetTempPath32A( UINT32 count, LPSTR path )
UINT32 ret;
if (!(ret = GetEnvironmentVariable32A( "TMP", path, count )))
if (!(ret = GetEnvironmentVariable32A( "TEMP", path, count )))
ret = GetCurrentDirectory32A( count, path );
if (!(ret = GetCurrentDirectory32A( count, path )))
return 0;
if ((ret < count - 1) && (path[ret-1] != '\\'))
{
path[ret++] = '\\';
path[ret] = '\0';
}
return ret;
}
@ -144,7 +150,13 @@ UINT32 WINAPI GetTempPath32W( UINT32 count, LPWSTR path )
UINT32 ret;
if (!(ret = GetEnvironmentVariable32W( tmp, path, count )))
if (!(ret = GetEnvironmentVariable32W( temp, path, count )))
ret = GetCurrentDirectory32W( count, path );
if (!(ret = GetCurrentDirectory32W( count, path )))
return 0;
if ((ret < count - 1) && (path[ret-1] != '\\'))
{
path[ret++] = '\\';
path[ret] = '\0';
}
return ret;
}

View File

@ -745,7 +745,7 @@ UINT16 WINAPI GetDriveType16( UINT16 drive )
{
case TYPE_FLOPPY: return DRIVE_REMOVABLE;
case TYPE_HD: return DRIVE_FIXED;
case TYPE_CDROM: return DRIVE_REMOTE;
case TYPE_CDROM: return DRIVE_REMOVABLE;
case TYPE_NETWORK: return DRIVE_REMOTE;
case TYPE_INVALID:
default: return DRIVE_CANNOTDETERMINE;
@ -801,16 +801,22 @@ UINT16 WINAPI GetCurrentDirectory16( UINT16 buflen, LPSTR buf )
* GetCurrentDirectory32A (KERNEL32.196)
*
* Returns "X:\\path\\etc\\".
*
* Despite the API description, return required length including the
* terminating null when buffer too small. This is the real behaviour.
*/
UINT32 WINAPI GetCurrentDirectory32A( UINT32 buflen, LPSTR buf )
{
char *pref = "A:\\";
UINT32 ret;
const char *s = DRIVE_GetDosCwd( DRIVE_GetCurrentDrive() );
assert(s);
lstrcpyn32A( buf, pref, MIN( 4, buflen ) );
ret = strlen(s) + 3; /* length of WHOLE current directory */
if (ret >= buflen) return ret + 1;
lstrcpyn32A( buf, "A:\\", MIN( 4, buflen ) );
if (buflen) buf[0] += DRIVE_GetCurrentDrive();
if (buflen > 3) lstrcpyn32A( buf + 3, s, buflen - 3 );
return strlen(s) + 3; /* length of WHOLE current directory */
return ret;
}

View File

@ -632,10 +632,7 @@ UINT16 WINAPI GetTempFileName16( BYTE drive, LPCSTR prefix, UINT16 unique,
if (drive & TF_FORCEDRIVE)
sprintf(temppath,"%c:", drive & ~TF_FORCEDRIVE );
else
{
GetTempPath32A( 132, temppath );
strcat( temppath, "\\" );
}
return (UINT16)GetTempFileName32A( temppath, prefix, unique, buffer );
}
@ -1611,7 +1608,7 @@ BOOL32 WINAPI CopyFile32A( LPCSTR source, LPCSTR dest, BOOL32 fail_if_exists )
CloseHandle( h1 );
return FALSE;
}
while ((count = _lread32( h2, buffer, sizeof(buffer) )) > 0)
while ((count = _lread32( h1, buffer, sizeof(buffer) )) > 0)
{
char *p = buffer;
while (count > 0)

View File

@ -477,15 +477,18 @@ static INT32 PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name,
PROFILE_CopyEntry( buffer, key->name, len - 1, handle_env );
len -= strlen(buffer) + 1;
buffer += strlen(buffer) + 1;
if (key->value)
{
buffer[-1] = '=';
PROFILE_CopyEntry(buffer, key->value, len - 1, handle_env);
len -= strlen(buffer) + 1;
buffer += strlen(buffer) + 1;
}
}
*buffer = '\0';
if (len < 1)
/*If either lpszSection or lpszKey is NULL and the supplied
destination buffer is too small to hold all the strings,
the last string is truncated and followed by two null characters.
In this case, the return value is equal to cchReturnBuffer
minus two. */
{
buffer[-1] = '\0';
return oldlen - 2;
}
return oldlen - len + 1;
}
section = section->next;

View File

@ -94,7 +94,7 @@ DirectDrawEnumerate32A(LPDDENUMCALLBACK32A ddenumproc,LPVOID data) {
HRESULT WINAPI
DSoundHelp(DWORD x,DWORD y,DWORD z) {
fprintf(stderr,"DSoundHelp(0x%08lx,0x%08lx,0x%08lx),stub!\n",x,y,z);
FIXME(ddraw,"(0x%08lx,0x%08lx,0x%08lx),stub!\n",x,y,z);
return 0;
}
@ -122,8 +122,12 @@ static void _dump_DDBLTFX(DWORD flagmask) {
FE(DDBLTFX_ZBUFFERBASEDEST)
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask)
fprintf(stderr,"%s ",flags[i].name);
if (flags[i].mask & flagmask) {
DUMP("%s ",flags[i].name);
};
DUMP("\n");
}
static void _dump_DDBLTFAST(DWORD flagmask) {
@ -140,7 +144,8 @@ static void _dump_DDBLTFAST(DWORD flagmask) {
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask)
fprintf(stderr,"%s ",flags[i].name);
DUMP("%s ",i,flags[i].name);
DUMP("\n");
}
static void _dump_DDBLT(DWORD flagmask) {
@ -179,7 +184,7 @@ static void _dump_DDBLT(DWORD flagmask) {
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask)
fprintf(stderr,"%s ",flags[i].name);
DUMP("%s ",i,flags[i].name);
}
static void _dump_DDSCAPS(DWORD flagmask) {
@ -222,7 +227,8 @@ static void _dump_DDSCAPS(DWORD flagmask) {
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask)
fprintf(stderr,"%s ",flags[i].name);
DUMP("%s ",flags[i].name);
DUMP("\n");
}
static void _dump_DDCAPS(DWORD flagmask) {
@ -267,7 +273,8 @@ static void _dump_DDCAPS(DWORD flagmask) {
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask)
fprintf(stderr,"%s ",flags[i].name);
DUMP("%s ",flags[i].name);
DUMP("\n");
}
static void _dump_DDSD(DWORD flagmask) {
@ -295,7 +302,8 @@ static void _dump_DDSD(DWORD flagmask) {
};
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask)
fprintf(stderr,"%s ",flags[i].name);
DUMP("%s ",i,flags[i].name);
DUMP("\n");
}
static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) {
@ -325,7 +333,7 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) {
pf->xy.dwRGBAlphaBitMask= 0;
return 0;
}
fprintf(stderr,"_getpixelformat:oops?\n");
FIXME(ddraw,"_getpixelformat:oops?\n");
return DDERR_GENERIC;
}
@ -458,15 +466,15 @@ static HRESULT WINAPI IDirectDrawSurface_Blt(
return 0;
}
if (dwFlags) {
fprintf(stderr,"IDirectDrawSurface(%p)->Blt(%p,%p,%p,%08lx,%p),stub!\n",
FIXME(ddraw,"(%p)->(%p,%p,%p,%08lx,%p),stub!\n",
this,rdst,src,rsrc,dwFlags,lpbltfx
);
if (rdst) fprintf(stderr," destrect :%dx%d-%dx%d\n",rdst->left,rdst->top,rdst->right,rdst->bottom);
if (rsrc) fprintf(stderr," srcrect :%dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
fprintf(stderr,"\tflags: ");_dump_DDBLT(dwFlags);fprintf(stderr,"\n");
if (rdst) TRACE(ddraw," destrect :%dx%d-%dx%d\n",rdst->left,rdst->top,rdst->right,rdst->bottom);
if (rsrc) TRACE(ddraw," srcrect :%dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
TRACE(ddraw,"\tflags: ");_dump_DDBLT(dwFlags);fprintf(stderr,"\n");
}
if (dwFlags & DDBLT_DDFX) {
fprintf(stderr," blitfx: ");_dump_DDBLTFX(lpbltfx->dwDDFX);fprintf(stderr,"\n");
TRACE(ddraw," blitfx: \n");_dump_DDBLTFX(lpbltfx->dwDDFX);
}
return 0;
}
@ -476,11 +484,11 @@ static HRESULT WINAPI IDirectDrawSurface_BltFast(
) {
int i,bpp;
if (TRACE_ON(ddraw)) {
fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n",
FIXME(ddraw,"(%p)->(%ld,%ld,%p,%p,%08lx),stub!\n",
this,dstx,dsty,src,rsrc,trans
);
fprintf(stderr," trans:");_dump_DDBLTFAST(trans);fprintf(stderr,"\n");
fprintf(stderr," srcrect: %dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
TRACE(ddraw," trans:");_dump_DDBLTFAST(trans);fprintf(stderr,"\n");
TRACE(ddraw," srcrect: %dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
}
bpp = this->s.ddraw->d.depth/8;
for (i=0;i<rsrc->bottom-rsrc->top;i++) {
@ -495,7 +503,7 @@ static HRESULT WINAPI IDirectDrawSurface_BltFast(
static HRESULT WINAPI IDirectDrawSurface_BltBatch(
LPDIRECTDRAWSURFACE this,LPDDBLTBATCH ddbltbatch,DWORD x,DWORD y
) {
fprintf(stderr,"IDirectDrawSurface(%p)->BltBatch(%p,%08lx,%08lx),stub!\n",
TRACE(ddraw,"(%p)->BltBatch(%p,%08lx,%08lx),stub!\n",
this,ddbltbatch,x,y
);
return 0;
@ -560,12 +568,11 @@ static HRESULT WINAPI IDirectDrawSurface_GetAttachedSurface(
TRACE(ddraw, "(%p)->GetAttachedSurface(%p,%p)\n",
this, lpddsd, lpdsf);
if (TRACE_ON(ddraw)) {
fprintf(stderr," caps ");
TRACE(ddraw," caps ");
_dump_DDSCAPS(lpddsd->dwCaps);
fprintf(stderr,"\n");
}
if (!(lpddsd->dwCaps & DDSCAPS_BACKBUFFER)) {
fprintf(stderr,"IDirectDrawSurface::GetAttachedSurface():whoops, can only handle backbuffers for now\n");
FIXME(ddraw,"whoops, can only handle backbuffers for now\n");
return E_FAIL;
}
/* FIXME: should handle more than one backbuffer */
@ -586,7 +593,7 @@ static HRESULT WINAPI IDirectDrawSurface_GetPixelFormat(
}
static HRESULT WINAPI IDirectDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE this,DWORD dwFlags) {
fprintf(stderr,"IDirectDrawSurface(%p)->GetBltStatus(0x%08lx),stub!\n",
FIXME(ddraw,"(%p)->(0x%08lx),stub!\n",
this,dwFlags
);
return 0;
@ -595,7 +602,7 @@ static HRESULT WINAPI IDirectDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE this,D
static HRESULT WINAPI IDirectDrawSurface_GetOverlayPosition(
LPDIRECTDRAWSURFACE this,LPLONG x1,LPLONG x2
) {
fprintf(stderr,"IDirectDrawSurface(%p)->GetOverlayPosition(%p,%p),stub!\n",
FIXME(ddraw,"(%p)->(%p,%p),stub!\n",
this,x1,x2
);
return 0;
@ -604,20 +611,20 @@ static HRESULT WINAPI IDirectDrawSurface_GetOverlayPosition(
static HRESULT WINAPI IDirectDrawSurface_SetClipper(
LPDIRECTDRAWSURFACE this,LPDIRECTDRAWCLIPPER clipper
) {
fprintf(stderr,"IDirectDrawSurface(%p)->SetClipper(%p),stub!\n",this,clipper);
FIXME(ddraw,"(%p)->(%p),stub!\n",this,clipper);
return 0;
}
static HRESULT WINAPI IDirectDrawSurface_AddAttachedSurface(
LPDIRECTDRAWSURFACE this,LPDIRECTDRAWSURFACE surf
) {
fprintf(stderr,"IDirectDrawSurface(%p)->AddAttachedSurface(%p),stub!\n",this,surf);
FIXME(ddraw,"(%p)->(%p),stub!\n",this,surf);
this->s.backbuffer = surf;
return 0;
}
static HRESULT WINAPI IDirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE this,HDC32* lphdc) {
fprintf(stderr,"IDirectDrawSurface(%p)->GetDC(%p),stub!\n",this,lphdc);
FIXME(ddraw,"(%p)->GetDC(%p),stub!\n",this,lphdc);
return 0;
}
@ -625,7 +632,7 @@ static HRESULT WINAPI IDirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE this
char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
TRACE(ddraw,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
TRACE(ddraw,"(%p)->(%s,%p)\n",this,xrefiid,obj);
/* thats version 3 (DirectX 5) */
if ( !memcmp(&IID_IDirectDrawSurface3,refiid,sizeof(IID_IDirectDrawSurface3))) {
@ -647,7 +654,7 @@ static HRESULT WINAPI IDirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE this
*obj = this;
return 0;
}
fprintf(stderr,"IDirectDrawSurface(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
WARN(ddraw,"(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
return OLE_E_ENUM_NOMORE;
}
@ -738,7 +745,7 @@ static HRESULT WINAPI IDirectDrawSurface2_GetAttachedSurface(
}
static HRESULT WINAPI IDirectDrawSurface2_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE2 this,LPVOID context,LPDDENUMSURFACESCALLBACK esfcb) {
fprintf(stderr,"IDirectDrawSurface(%p)->EnumAttachedSurfaces(%p,%p),stub!\n",this,context,esfcb);
FIXME(ddraw,"(%p)->(%p,%p),stub!\n",this,context,esfcb);
return 0;
}
@ -876,7 +883,7 @@ static HRESULT WINAPI IDirectDrawSurface3_Unlock(
}
static HRESULT WINAPI IDirectDrawSurface3_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE3 this,LPVOID context,LPDDENUMSURFACESCALLBACK esfcb) {
fprintf(stderr,"IDirectDrawSurface3(%p)->EnumAttachedSurfaces(%p,%p),stub!\n",this,context,esfcb);
FIXME(ddraw,"(%p)->(%p,%p),stub!\n",this,context,esfcb);
return 0;
}
@ -942,7 +949,7 @@ static struct IDirectDrawSurface3_VTable dds3vt = {
static HRESULT WINAPI IDirectDrawClipper_SetHwnd(
LPDIRECTDRAWCLIPPER this,DWORD x,HWND32 hwnd
) {
fprintf(stderr,"IDirectDrawClipper(%p)->SetHwnd(0x%08lx,0x%08lx),stub!\n",this,x,(DWORD)hwnd);
FIXME(ddraw,"(%p)->SetHwnd(0x%08lx,0x%08lx),stub!\n",this,x,(DWORD)hwnd);
return 0;
}
@ -974,7 +981,7 @@ static HRESULT WINAPI IDirectDrawPalette_GetEntries(
) {
int i;
fprintf(stderr,"IDirectDrawPalette(%p)->GetEntries(%08lx,%ld,%ld,%p),stub!\n",
FIXME(ddraw,"(%p)->GetEntries(%08lx,%ld,%ld,%p),stub!\n",
this,x,start,end,palent
);
for (i=start;i<end;i++) {
@ -995,7 +1002,7 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
this,x,start,end,palent
);
if (!this->cm) /* should not happen */ {
fprintf(stderr,"no colormap in SetEntries???\n");
ERR(ddraw,"no colormap in SetEntries???\n");
return DDERR_GENERIC;
}
/* FIXME: free colorcells instead of freeing whole map */
@ -1093,7 +1100,7 @@ static HRESULT WINAPI IDirect3D2_EnumDevices(
) {
D3DDEVICEDESC d1,d2;
fprintf(stderr,"IDirect3D2(%p)->EnumDevices(%p,%p),stub!\n",this,cb,context);
FIXME(ddraw,"(%p)->(%p,%p),stub!\n",this,cb,context);
d1.dwSize = sizeof(d1);
d1.dwFlags = 0;
@ -1123,10 +1130,10 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
) {
int i;
TRACE(ddraw, "(%p)->CreateSurface(%p,%p,%p)\n",
TRACE(ddraw, "(%p)->(%p,%p,%p)\n",
this,lpddsd,lpdsf,lpunk);
if (TRACE_ON(ddraw)) {
fprintf(stderr,"[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight);
DUMP("[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight);
_dump_DDSD(lpddsd->dwFlags);
fprintf(stderr,"caps ");
_dump_DDSCAPS(lpddsd->ddsCaps.dwCaps);
@ -1170,7 +1177,7 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
LPDIRECTDRAWSURFACE back;
if (lpddsd->dwBackBufferCount>1)
fprintf(stderr,"urks, wants to have more than one backbuffer (%ld)!\n",lpddsd->dwBackBufferCount);
FIXME(ddraw,"urks, wants to have more than one backbuffer (%ld)!\n",lpddsd->dwBackBufferCount);
(*lpdsf)->s.backbuffer = back = (LPDIRECTDRAWSURFACE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawSurface));
this->lpvtbl->fnAddRef(this);
@ -1198,7 +1205,7 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
static HRESULT WINAPI IDirectDraw_DuplicateSurface(
LPDIRECTDRAW this,LPDIRECTDRAWSURFACE src,LPDIRECTDRAWSURFACE *dst
) {
fprintf(stderr,"(%p)->DuplicateSurface(%p,%p)\n",this,src,dst);
FIXME(ddraw,"(%p)->(%p,%p) simply copies\n",this,src,dst);
*dst = src; /* FIXME */
return 0;
}
@ -1222,7 +1229,7 @@ static HRESULT WINAPI IDirectDraw_SetCooperativeLevel(
FE(DDSCL_CREATEDEVICEWINDOW)
};
TRACE(ddraw,"(%p)->SetCooperativeLevel(%08lx,%08lx)\n",
TRACE(ddraw,"(%p)->(%08lx,%08lx)\n",
this,(DWORD)hwnd,cooplevel
);
if(TRACE_ON(ddraw)){
@ -1243,7 +1250,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
int i,*depths,depcount;
char buf[200];
TRACE(ddraw, "(%p)->SetDisplayMode(%ld,%ld,%ld)\n",
TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n",
this, width, height, depth);
depths = TSXListDepths(display,DefaultScreen(display),&depcount);
@ -1252,13 +1259,11 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
break;
TSXFree(depths);
if (i==depcount) {/* not found */
sprintf(buf,"SetDisplayMode(w=%ld,h=%ld,d=%ld), unsupported depth!",width,height,depth);
MessageBox32A(0,buf,"WINE DirectDraw",MB_OK|MB_ICONSTOP);
ERR(ddraw,"(w=%ld,h=%ld,d=%ld), unsupported depth!\n",width,height,depth);
return DDERR_UNSUPPORTEDMODE;
}
if (this->d.fb_width < width) {
sprintf(buf,"SetDisplayMode(w=%ld,h=%ld,d=%ld), width %ld exceeds framebuffer width %ld",width,height,depth,width,this->d.fb_width);
MessageBox32A(0,buf,"WINE DirectDraw",MB_OK|MB_ICONSTOP);
ERR(ddraw,"SetDisplayMode(w=%ld,h=%ld,d=%ld), width %ld exceeds framebuffer width %ld\n",width,height,depth,width,this->d.fb_width);
return DDERR_UNSUPPORTEDMODE;
}
this->d.width = width;
@ -1286,7 +1291,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
static HRESULT WINAPI IDirectDraw_GetCaps(
LPDIRECTDRAW this,LPDDCAPS caps1,LPDDCAPS caps2
) {
TRACE(ddraw,"(%p)->GetCaps(%p,%p)\n",this,caps1,caps2);
TRACE(ddraw,"(%p)->(%p,%p)\n",this,caps1,caps2);
caps1->dwVidMemTotal = this->d.fb_memsize;
caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED); /* we can do anything */
caps1->ddsCaps.dwCaps = 0xffffffff; /* we can do anything */
@ -1301,7 +1306,7 @@ static HRESULT WINAPI IDirectDraw_GetCaps(
static HRESULT WINAPI IDirectDraw_CreateClipper(
LPDIRECTDRAW this,DWORD x,LPDIRECTDRAWCLIPPER *lpddclip,LPUNKNOWN lpunk
) {
fprintf(stderr,"(%p)->CreateClipper(%08lx,%p,%p),stub!\n",
FIXME(ddraw,"(%p)->(%08lx,%p,%p),stub!\n",
this,x,lpddclip,lpunk
);
*lpddclip = (LPDIRECTDRAWCLIPPER)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawClipper));
@ -1313,7 +1318,7 @@ static HRESULT WINAPI IDirectDraw_CreateClipper(
static HRESULT WINAPI IDirectDraw_CreatePalette(
LPDIRECTDRAW this,DWORD x,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk
) {
TRACE(ddraw,"(%p)->CreatePalette(%08lx,%p,%p,%p)\n",
TRACE(ddraw,"(%p)->(%08lx,%p,%p,%p)\n",
this,x,palent,lpddpal,lpunk
);
*lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette));
@ -1329,7 +1334,7 @@ static HRESULT WINAPI IDirectDraw_CreatePalette(
}
static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
TRACE(ddraw, "(%p)->RestoreDisplayMode()\n",
TRACE(ddraw, "(%p)->()\n",
this);
Sleep(1000);
XF86DGADirectVideo(display,DefaultScreen(display),0);
@ -1343,7 +1348,7 @@ static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
static HRESULT WINAPI IDirectDraw_WaitForVerticalBlank(
LPDIRECTDRAW this,DWORD x,HANDLE32 h
) {
TRACE(ddraw,"(%p)->WaitForVerticalBlank(0x%08lx,0x%08x)\n",this,x,h);
TRACE(ddraw,"(%p)->(0x%08lx,0x%08x)\n",this,x,h);
return 0;
}
@ -1369,7 +1374,7 @@ static HRESULT WINAPI IDirectDraw_QueryInterface(
char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
TRACE(ddraw,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
TRACE(ddraw,"(%p)->(%s,%p)\n",this,xrefiid,obj);
if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
*obj = this;
this->lpvtbl->fnAddRef(this);
@ -1408,14 +1413,14 @@ static HRESULT WINAPI IDirectDraw_QueryInterface(
*obj = d3d;
return 0;
}
fprintf(stderr,"(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
WARN(ddraw,"(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
return OLE_E_ENUM_NOMORE;
}
static HRESULT WINAPI IDirectDraw_GetVerticalBlankStatus(
LPDIRECTDRAW this,BOOL32 *status
) {
TRACE(ddraw,"(%p)->GetVerticalBlankSatus(%p)\n",this,status);
TRACE(ddraw,"(%p)->(%p)\n",this,status);
*status = TRUE;
return 0;
}
@ -1425,7 +1430,7 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes(
) {
DDSURFACEDESC ddsfd;
TRACE(ddraw,"(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
TRACE(ddraw,"(%p)->(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
_getpixelformat(this,&(ddsfd.ddpfPixelFormat));
@ -1460,7 +1465,7 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes(
static HRESULT WINAPI IDirectDraw_GetDisplayMode(
LPDIRECTDRAW this,LPDDSURFACEDESC lpddsfd
) {
TRACE(ddraw,"(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
TRACE(ddraw,"(%p)->(%p)\n",this,lpddsfd);
lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS;
lpddsfd->dwHeight = screenHeight;
lpddsfd->dwWidth = screenWidth;
@ -1473,14 +1478,14 @@ static HRESULT WINAPI IDirectDraw_GetDisplayMode(
}
static HRESULT WINAPI IDirectDraw_FlipToGDISurface(LPDIRECTDRAW this) {
fprintf(stderr,"(%p)->FlipToGDISurface()\n",this);
TRACE(ddraw,"(%p)->()\n",this);
return DD_OK;
}
static HRESULT WINAPI IDirectDraw_GetMonitorFrequency(
LPDIRECTDRAW this,LPDWORD freq
) {
fprintf(stderr,"(%p)->GetMonitorFrequency(%p)\n",this,freq);
FIXME(ddraw,"(%p)->(%p) returns 60 Hz always\n",this,freq);
*freq = 60*100; /* 60 Hz */
return 0;
}
@ -1563,7 +1568,7 @@ static HRESULT WINAPI IDirectDraw2_CreatePalette(
static HRESULT WINAPI IDirectDraw2_SetDisplayMode(
LPDIRECTDRAW2 this,DWORD width,DWORD height,DWORD depth,DWORD xx,DWORD yy
) {
TRACE(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx)\n",
TRACE(ddraw,"(%p)->(%ld,%ld,%ld,%08lx,%08lx)\n",
this, width, height, depth, xx, yy);
return IDirectDraw_SetDisplayMode((LPDIRECTDRAW)this,width,height,depth);
@ -1576,7 +1581,7 @@ static HRESULT WINAPI IDirectDraw2_RestoreDisplayMode(LPDIRECTDRAW2 this) {
static HRESULT WINAPI IDirectDraw2_EnumSurfaces(
LPDIRECTDRAW2 this,DWORD x,LPDDSURFACEDESC ddsfd,LPVOID context,LPDDENUMSURFACESCALLBACK ddsfcb
) {
fprintf(stderr,"IDirectDraw2(%p)->EnumSurfaces(0x%08lx,%p,%p,%p),stub!\n",this,x,ddsfd,context,ddsfcb);
FIXME(ddraw,"(%p)->(0x%08lx,%p,%p,%p),stub!\n",this,x,ddsfd,context,ddsfcb);
return 0;
}
@ -1595,7 +1600,7 @@ static HRESULT WINAPI IDirectDraw2_GetDisplayMode(
static HRESULT WINAPI IDirectDraw2_GetAvailableVidMem(
LPDIRECTDRAW2 this,LPDDSCAPS ddscaps,LPDWORD total,LPDWORD free
) {
fprintf(stderr,"IDirectDraw2(%p)->GetAvailableVidMem(%p,%p,%p)\n",
TRACE(ddraw,"(%p)->(%p,%p,%p)\n",
this,ddscaps,total,free
);
if (total) *total = this->d.fb_memsize * 1024;
@ -1666,6 +1671,7 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
TRACE(ddraw,"(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter);
if (getuid()) {
MSG("Must be root to use XF86DGA!\n");
MessageBox32A(0,"Using the XF86DGA extension requires the program to be run using UID 0.","WINE DirectDraw",MB_OK|MB_ICONSTOP);
return E_UNEXPECTED;
}
@ -1673,14 +1679,14 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
(*lplpDD)->lpvtbl = &ddvt;
(*lplpDD)->ref = 1;
if (!XF86DGAQueryExtension(display,&evbase,&evret)) {
fprintf(stderr,"No XF86DGA detected.\n");
MSG("Wine DirectDraw: No XF86DGA detected.\n");
return 0;
}
XF86DGAQueryVersion(display,&major,&minor);
TRACE(ddraw,"XF86DGA is version %d.%d\n",major,minor);
XF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags);
if (!(flags & XF86DGADirectPresent))
fprintf(stderr,"direct video is NOT ENABLED.\n");
MSG("direct video is NOT ENABLED.\n");
XF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize);
TRACE(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n",
addr,width,banksize,memsize

View File

@ -7,6 +7,7 @@
#include <stdio.h>
#include "gdi.h"
#include "heap.h"
#include "debug.h"
typedef struct tagGRAPHICS_DRIVER
{
@ -36,7 +37,7 @@ BOOL32 DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs )
/* No name -> it's the generic driver */
if (genericDriver)
{
fprintf( stderr, "DRIVER_RegisterDriver: already a generic driver\n" );
WARN(driver, " already a generic driver\n" );
HeapFree( SystemHeap, 0, driver );
return FALSE;
}

View File

@ -5,18 +5,18 @@
*
* Copyright 1997 Marcus Meissner
*/
#include <windows.h>
#include <stdio.h>
#include "windows.h"
#include "gdi.h"
#include "debug.h"
#include <config.h>
#include <gdi.h>
#include <debug.h>
/***********************************************************************
* GetEnvironment (GDI.134)
*/
INT16 WINAPI GetEnvironment(LPCSTR lpPortName, LPDEVMODE16 lpdev, UINT16 nMaxSiz)
{
fprintf(stddeb, "GetEnvironment('%s','%p',%d),\n",
lpPortName, lpdev, nMaxSiz);
FIXME(gdi, "('%s','%p',%d),stub\n", lpPortName, lpdev, nMaxSiz);
return 0;
}
@ -25,9 +25,9 @@ INT16 WINAPI GetEnvironment(LPCSTR lpPortName, LPDEVMODE16 lpdev, UINT16 nMaxSiz
*/
INT16 WINAPI SetEnvironment(LPCSTR lpPortName, LPDEVMODE16 lpdev, UINT16 nCount)
{
fprintf(stddeb, "SetEnvironment('%s', '%p', %d) !\n",
lpPortName, lpdev, nCount);
fprintf(stderr,
FIXME(gdi, "('%s', '%p', %d) stub!\n", lpPortName, lpdev, nCount);
if (TRACE_ON(gdi)) DUMP(
"\tdevmode:\n"
"\tname = %s\n"
"\tdmSpecVersion = %d\n"

View File

@ -10,6 +10,8 @@
#include "heap.h"
#include "ldt.h"
#include "dc.h"
#include <debug.h>
INT16 WINAPI Escape16( HDC16 hdc, INT16 nEscape, INT16 cbInput,
SEGPTR lpszInData, SEGPTR lpvOutData )
@ -77,7 +79,7 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
switch(nEscape) {
case QUERYESCSUPPORT:
if (ret)
fprintf(stderr,"target DC implements Escape %d\n",nEscape);
TRACE(driver,"target DC implements Escape %d\n",nEscape);
SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
break;
case GETSCALINGFACTOR:
@ -115,7 +117,7 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
}
INT32 WINAPI ExtEscape32(HDC32 hdc,INT32 nEscape,INT32 cbInput,LPCSTR x,INT32 cbOutput,LPSTR out) {
fprintf(stderr,"ExtEscape32(0x%04x,0x%x,%d,%s,%d,%p),stub!\n",
FIXME(driver,"(0x%04x,0x%x,%d,%s,%d,%p),stub!\n",
hdc,nEscape,cbInput,x,cbOutput,out
);
return 1;

View File

@ -2,28 +2,38 @@
* True Type font engine support
*
* Copyright 1996 John Harvey
* Copyright 1998 David Lee Lambert
*
*/
#include "windows.h"
#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
#include <debug.h>
#include "font.h"
/* GDI 300 */
WORD WINAPI EngineEnumerateFont(LPSTR fontname, FARPROC16 proc, DWORD data )
/* ****************************************************************
* EngineEnumerateFont [GDI.300]
*/
WORD WINAPI
EngineEnumerateFont(LPSTR fontname, FARPROC16 proc, DWORD data )
{
fprintf(stderr,"EngineEnumerateFont(%s,%p,%lx),stub\n",fontname,proc,data);
FIXME(font,"(%s,%p,%lx),stub\n",fontname,proc,data);
return 0;
}
/* GDI 301 */
/* ****************************************************************
* EngineDeleteFont [GDI.301]
*/
WORD WINAPI EngineDeleteFont(LPFONTINFO16 lpFontInfo)
{
WORD handle;
/* untested, don't know if it works.
We seem to access some structure that is located after the
FONTINFO. The FONTINFO docu says that there may follow some char-width
table or font bitmap or vector info.
FONTINFO. The FONTINFO documentation says that there may
follow some char-width table or font bitmap or vector info.
I think it is some kind of font bitmap that begins at offset 0x52,
as FONTINFO goes up to 0x51.
If this is correct, everything should be implemented correctly.
@ -39,46 +49,63 @@ WORD WINAPI EngineDeleteFont(LPFONTINFO16 lpFontInfo)
return 1;
}
/* GDI 302 */
/* ****************************************************************
* EngineRealizeFont [GDI.302]
*/
WORD WINAPI EngineRealizeFont(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
{
fprintf(stderr,"EngineRealizeFont(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
FIXME(font,"(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
return 0;
}
/* GDI 303 */
/* ****************************************************************
* EngineGetCharWidth [GDI.303]
*/
WORD WINAPI EngineGetCharWidth(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
{
int i;
for (i = firstChar; i <= lastChar; i++)
FIXME(font, " returns font's average width for range %d to %d\n", firstChar, lastChar);
*buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
return 1;
}
/* GDI 304 */
/* ****************************************************************
* EngineSetFontContext [GDI.304]
*/
WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
{
FIXME(font, "stub?\n");
return 0;
}
/* GDI 305 */
/* ****************************************************************
* EngineGetGlyphBMP [GDI.305]
*/
WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
{
FIXME(font, "stub?\n");
return 0;
}
/* GDI 306 */
/* ****************************************************************
* EngineMakeFontDir [GDI.306]
*/
DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
{
FIXME(font, " stub! (always fails)\n");
return -1; /* error */
}
/* GDI 314 */
/* ****************************************************************
* EngineExtTextOut [GDI.314]
*/
WORD WINAPI EngineExtTextOut()
{
FIXME(font, "stub!\n");
return 0;
}

View File

@ -43,6 +43,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_PatBlt, /* pPatBlt */
MFDRV_Pie, /* pPie */
MFDRV_PolyPolygon, /* pPolyPolygon */
NULL, /* pPolyPolyline */
MFDRV_Polygon, /* pPolygon */
MFDRV_Polyline, /* pPolyline */
NULL, /* pRealizePalette */

View File

@ -368,7 +368,7 @@ COLORREF WINAPI SetPixel32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
}
/***********************************************************************
* SetPixel32 (GDI32.329)
* SetPixelV32 (GDI32.329)
*/
BOOL32 WINAPI SetPixelV32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
{
@ -407,6 +407,104 @@ COLORREF WINAPI GetPixel32( HDC32 hdc, INT32 x, INT32 y )
}
/******************************************************************************
* ChoosePixelFormat [GDI32.13]
* Matches a pixel format to given format
*
* PARAMS
* hdc [I] Device context to search for best pixel match
* ppfd [I] Pixel format for which a match is sought
*
* RETURNS
* Success: Pixel format index closest to given format
* Failure: 0
*/
INT32 WINAPI ChoosePixelFormat( HDC32 hdc, PIXELFORMATDESCRIPTOR *ppfd )
{
FIXME(gdi, "(%d,%p): stub\n",hdc,ppfd);
ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR);
ppfd->nVersion = 1;
return 1;
}
/******************************************************************************
* SetPixelFormat [GDI32.328]
* Sets pixel format of device context
*
* PARAMS
* hdc [I] Device context to search for best pixel match
* iPixelFormat [I] Pixel format index
* ppfd [I] Pixel format for which a match is sought
*
* RETURNS STD
*/
BOOL32 WINAPI SetPixelFormat( HDC32 hdc, int iPixelFormat,
PIXELFORMATDESCRIPTOR * ppfd)
{
FIXME(gdi, "(%d,%d,%p): stub\n",hdc,iPixelFormat,ppfd);
return TRUE;
}
/******************************************************************************
* GetPixelFormat [GDI32.212]
* Gets index of pixel format of DC
*
* PARAMETERS
* hdc [I] Device context whose pixel format index is sought
*
* RETURNS
* Success: Currently selected pixel format
* Failure: 0
*/
int WINAPI GetPixelFormat( HDC32 hdc )
{
FIXME(gdi, "(%d): stub\n",hdc);
return 1;
}
/******************************************************************************
* DescribePixelFormat [GDI32.71]
* Gets info about pixel format from DC
*
* PARAMS
* hdc [I] Device context
* iPixelFormat [I] Pixel format selector
* nBytes [I] Size of buffer
* ppfd [O] Pointer to structure to receive pixel format data
*
* RETURNS
* Success: Maximum pixel format index of the device context
* Failure: 0
*/
int WINAPI DescribePixelFormat( HDC32 hdc, int iPixelFormat, UINT32 nBytes,
LPPIXELFORMATDESCRIPTOR ppfd )
{
FIXME(gdi, "(%d,%d,%d,%p): stub\n",hdc,iPixelFormat,nBytes,ppfd);
ppfd->nSize = nBytes;
ppfd->nVersion = 1;
return 3;
}
/******************************************************************************
* SwapBuffers [GDI32.354]
* Exchanges front and back buffers of window
*
* PARAMS
* hdc [I] Device context whose buffers get swapped
*
* RETURNS STD
*/
BOOL32 WINAPI SwapBuffers( HDC32 hdc )
{
FIXME(gdi, "(%d): stub\n",hdc);
return TRUE;
}
/***********************************************************************
* PaintRgn16 (GDI.43)
*/
@ -647,6 +745,18 @@ BOOL32 WINAPI PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts,
dc->funcs->pPolyPolygon(dc,pt,counts,polygons);
}
/**********************************************************************
* PolyPolyline32 (GDI32.272)
*/
BOOL32 WINAPI PolyPolyline32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts,
UINT32 polylines )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolyPolyline &&
dc->funcs->pPolyPolyline(dc,pt,counts,polylines);
}
/**********************************************************************
* ExtFloodFill16 (GDI.372)
*/
@ -935,3 +1045,31 @@ BOOL16 WINAPI DrawState16(HDC16 hdc, HBRUSH16 hbr,
{
return PAINTING_DrawState32(hdc, hbr, (DRAWSTATEPROC32)func, ldata, wdata, x, y, cx, cy, flags, FALSE, FALSE);
}
/******************************************************************************
* PolyBezier16 [GDI.502]
*/
BOOL16 WINAPI PolyBezier16( HDC16 hDc, LPPOINT16 lppt, INT16 cPoints )
{
FIXME(gdi, "(%x,%p,%d): stub\n",hDc,lppt,cPoints);
return TRUE;
}
/******************************************************************************
* PolyBezier32 [GDI32.268]
* Draws one or more Bezier curves
*
* PARAMS
* hDc [I] Handle to device context
* lppt [I] Pointer to endpoints and control points
* cPoints [I] Count of endpoints and control points
*
* RETURNS STD
*/
BOOL32 WINAPI PolyBezier32( HDC32 hDc, LPPOINT32 lppt, DWORD cPoints )
{
FIXME(gdi, "(%x,%p,%ld): stub\n",hDc,lppt,cPoints);
return TRUE;
}

View File

@ -157,11 +157,19 @@ BOOL16 WINAPI AbortPath16(HDC16 hdc)
}
/***********************************************************************
* AbortPath32 (GDI32.1)
/******************************************************************************
* AbortPath32 [GDI32.1]
* Closes and discards paths from device context
*
* NOTES
* Check that SetLastError is being called correctly
*
* PARAMS
* hdc [I] Handle to device context
*
* RETURNS STD
*/
BOOL32 WINAPI AbortPath32(HDC32 hdc)
/* FIXME: Check that SetLastError is being called correctly */
BOOL32 WINAPI AbortPath32( HDC32 hdc )
{
GdiPath *pPath;

View File

@ -181,8 +181,7 @@ BOOL32 WIN16DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
WEPFC wepfc = {proc, lp};
/* EnumDFontCallback is GDI.158 */
FARPROC16 pfnCallback = MODULE_GetEntryPoint( GetModuleHandle16("GDI"),
158 );
FARPROC16 pfnCallback = NE_GetEntryPoint( GetModuleHandle16("GDI"), 158 );
wRet = PRTDRV_EnumDFonts(physDev->segptrPDEVICE, plf->lfFaceName[0] ?
plf->lfFaceName : NULL , pfnCallback , &wepfc );

View File

@ -76,6 +76,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
WIN16DRV_PatBlt, /* pPatBlt */
NULL, /* pPie */
NULL, /* pPolyPolygon */
NULL, /* pPolyPolyline */
WIN16DRV_Polygon, /* pPolygon */
WIN16DRV_Polyline, /* pPolyline */
NULL, /* pRealizePalette */

View File

@ -90,6 +90,7 @@ X11DRV_DrawArc( DC *dc, INT32 left, INT32 top, INT32 right,
ystart = YLPTODP( dc, ystart );
xend = XLPTODP( dc, xend );
yend = YLPTODP( dc, yend );
if ((left == right) || (top == bottom)) return FALSE;
if (left > right) { tmp=left; left=right; right=tmp; }
@ -113,11 +114,7 @@ X11DRV_DrawArc( DC *dc, INT32 left, INT32 top, INT32 right,
end_angle = - PI;
istart_angle = (INT32)(start_angle * 180 * 64 / PI);
idiff_angle = (INT32)((end_angle - start_angle) * 180 * 64 / PI );
if (idiff_angle < 0)
{
istart_angle+= idiff_angle;
idiff_angle = abs(idiff_angle);
}
if (idiff_angle <= 0) idiff_angle += 360 * 64;
/* Fill arc with brush if Chord() or Pie() */
@ -582,6 +579,38 @@ X11DRV_PolyPolygon( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons)
}
/**********************************************************************
* X11DRV_PolyPolyline
*/
BOOL32
X11DRV_PolyPolyline( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polylines )
{
if (DC_SetupGCForPen ( dc ))
{
int i, j, max = 0;
XPoint *points;
for (i = 0; i < polylines; i++) if (counts[i] > max) max = counts[i];
points = (XPoint *) xmalloc( sizeof(XPoint) * (max+1) );
for (i = 0; i < polylines; i++)
{
for (j = 0; j < counts[i]; j++)
{
points[j].x = dc->w.DCOrgX + XLPTODP( dc, pt->x );
points[j].y = dc->w.DCOrgY + YLPTODP( dc, pt->y );
pt++;
}
points[j] = points[0];
TSXDrawLines( display, dc->u.x.drawable, dc->u.x.gc,
points, j + 1, CoordModeOrigin );
}
free( points );
}
return TRUE;
}
/**********************************************************************
* X11DRV_InternalFloodFill
*

View File

@ -47,6 +47,7 @@ static const DC_FUNCTIONS X11DRV_Funcs =
X11DRV_PatBlt, /* pPatBlt */
X11DRV_Pie, /* pPie */
X11DRV_PolyPolygon, /* pPolyPolygon */
X11DRV_PolyPolyline, /* pPolyPolyline */
X11DRV_Polygon, /* pPolygon */
X11DRV_Polyline, /* pPolyline */
NULL, /* pRealizePalette */

View File

@ -8,6 +8,7 @@
#include "ts_xlib.h"
#include <X11/Xatom.h>
#include "windows.h"
#include <math.h>
#include "dc.h"
#include "gdi.h"
/*#include "callback.h"*/
@ -17,7 +18,7 @@
#include "debug.h"
#define SWAP_INT(a,b) { int t = a; a = b; b = t; }
#define IROUND(x) (int)((x)>0? (x)+0.5 : (x) - 0.5)
/***********************************************************************
* X11DRV_ExtTextOut
@ -186,8 +187,35 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
TSXSetForeground( display, dc->u.x.gc, dc->w.textPixel );
if (!dc->w.charExtra && !dc->w.breakExtra && !lpDx)
{
if (!pfo->lf.lfOrientation) /* angled baseline? */
{
TSXDrawString( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x, dc->w.DCOrgY + y, str, count );
}
else
{
/* have to render character by character. */
double offset = 0.0;
int i;
/* tenths of degrees to radians */
double theta = M_PI*pfo->lf.lfOrientation/1800.;
/* components of pointsize matrix */
double xc = pfo->fi->lfd_decipoints*cos(theta)/10.;
double yc = pfo->fi->lfd_decipoints*sin(theta)/10.;
for(i=0; i<count; i++) {
int char_metric_offset = (unsigned char) str[i]
- font->min_char_or_byte2;
int x_i = IROUND((double) (dc->w.DCOrgX + x) + offset*xc/1000. );
int y_i = IROUND((double) (dc->w.DCOrgY + y) - offset*yc/1000. );
TSXDrawString( display, dc->u.x.drawable, dc->u.x.gc,
x_i, y_i, &str[i], 1);
offset += (double) (font->per_char ?
font->per_char[char_metric_offset].attributes:
font->min_bounds.attributes);
}
}
}
else /* Now the fun begins... */
{

View File

@ -18,6 +18,7 @@
#include <fcntl.h>
#include "ts_xlib.h"
#include <X11/Xatom.h>
#include <math.h>
#include "heap.h"
#include "options.h"
#include "x11font.h"
@ -383,6 +384,7 @@ static int LFD_InitFontInfo( fontInfo* fi, LPSTR lpstr )
return TRUE;
}
/*************************************************************************
* LFD_ComposeLFD
*/
@ -392,6 +394,7 @@ static BOOL32 LFD_ComposeLFD( fontObject* fo,
int h, w, ch, enc_ch, point = 0;
char* lpch;
const char* lpEncoding = NULL;
char h_string[64], point_string[64];
lstrcpy32A( lpLFD, fo->fr->resource );
@ -448,6 +451,23 @@ static BOOL32 LFD_ComposeLFD( fontObject* fo,
if( fo->fi->fi_flags & FI_SCALABLE ) /* adjust h/w ratio */
point = h * 72 * 10 / fo->fi->lfd_resolution;
/* handle rotated fonts */
if (fo->lf.lfEscapement) {
/* escapement is in tenths of degrees, theta is in radians */
double theta = M_PI*fo->lf.lfEscapement/1800.;
double h_matrix[4] = {h*cos(theta), h*sin(theta), -h*sin(theta), h*cos(theta)};
double point_matrix[4] = {point*cos(theta), point*sin(theta), -point*sin(theta), point*cos(theta)};
char *s;
sprintf(h_string, "[%+f%+f%+f%+f]", h_matrix[0], h_matrix[1], h_matrix[2], h_matrix[3]);
sprintf(point_string, "[%+f%+f%+f%+f]", point_matrix[0], point_matrix[1], point_matrix[2], point_matrix[3]);
while (s = strchr(h_string, '-')) *s='~';
while (s = strchr(point_string, '-')) *s='~';
} else {
sprintf(h_string, "%d", h);
sprintf(point_string, "%d", point);
}
/* spacing and width */
if( fo->fi->fi_flags & FI_FIXEDPITCH )
@ -496,20 +516,21 @@ static BOOL32 LFD_ComposeLFD( fontObject* fo,
case 0:
if( point )
{
sprintf( lpch, "%i-%i-%i-%c-%c-*-%s%c", h, point,
sprintf( lpch, "%s-%s-%i-%c-%c-*-%s%c", h_string,
point_string,
fo->fi->lfd_resolution, ch, w, lpEncoding, enc_ch );
break;
}
/* fall through */
case 1:
sprintf( lpch, "%i-*-%i-%c-%c-*-%s%c", h,
sprintf( lpch, "%s-*-%i-%c-%c-*-%s%c", h_string,
fo->fi->lfd_resolution, ch, w, lpEncoding, enc_ch );
break;
case 2:
sprintf( lpch, "%i-*-%i-%c-*-*-%s%c",
h, fo->fi->lfd_resolution, ch, lpEncoding, enc_ch );
sprintf( lpch, "%s-*-%i-%c-*-*-%s%c",
h_string, fo->fi->lfd_resolution, ch, lpEncoding, enc_ch );
break;
case 3:

View File

@ -170,7 +170,7 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
if (pModule->heap_size)
LocalInit( pSegTable->selector, pSegTable->minsize, minsize );
MODULE_RegisterModule( pModule );
NE_RegisterModule( pModule );
return hModule;
}
@ -197,27 +197,42 @@ BOOL32 BUILTIN_Init(void)
/* Set the USER and GDI heap selectors */
pModule = MODULE_GetPtr( GetModuleHandle16( "USER" ));
pModule = MODULE_GetPtr16( GetModuleHandle16( "USER" ));
USER_HeapSel = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
pModule = MODULE_GetPtr( GetModuleHandle16( "GDI" ));
pModule = MODULE_GetPtr16( GetModuleHandle16( "GDI" ));
GDI_HeapSel = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
hModule = GetModuleHandle16( "KERNEL" );
MODULE_SetEntryPoint( hModule, 178, GetWinFlags() );
NE_SetEntryPoint( hModule, 178, GetWinFlags() );
/* Initialize the real-mode selector entry points */
DOSMEM_InitExports( hModule );
#define SET_ENTRY_POINT( num, addr ) \
NE_SetEntryPoint( hModule, (num), GLOBAL_CreateBlock( GMEM_FIXED, \
DOSMEM_MapDosToLinear(addr), 0x10000, hModule, \
FALSE, FALSE, FALSE, NULL ))
SET_ENTRY_POINT( 183, 0x00000 ); /* KERNEL.183: __0000H */
SET_ENTRY_POINT( 174, 0xa0000 ); /* KERNEL.174: __A000H */
SET_ENTRY_POINT( 181, 0xb0000 ); /* KERNEL.181: __B000H */
SET_ENTRY_POINT( 182, 0xb8000 ); /* KERNEL.182: __B800H */
SET_ENTRY_POINT( 195, 0xc0000 ); /* KERNEL.195: __C000H */
SET_ENTRY_POINT( 179, 0xd0000 ); /* KERNEL.179: __D000H */
SET_ENTRY_POINT( 190, 0xe0000 ); /* KERNEL.190: __E000H */
SET_ENTRY_POINT( 173, 0xf0000 ); /* KERNEL.173: __ROMBIOS */
SET_ENTRY_POINT( 194, 0xf0000 ); /* KERNEL.194: __F000H */
NE_SetEntryPoint( hModule, 193, DOSMEM_BiosSeg ); /* KERNEL.193: __0040H */
#undef SET_ENTRY_POINT
/* Set interrupt vectors from entry points in WPROCS.DLL */
hModule = GetModuleHandle16( "WPROCS" );
for (vector = 0; vector < 256; vector++)
{
FARPROC16 proc = MODULE_GetEntryPoint( hModule,
FIRST_INTERRUPT_ORDINAL+vector);
FARPROC16 proc = NE_GetEntryPoint( hModule,
FIRST_INTERRUPT_ORDINAL + vector );
assert(proc);
INT_SetHandler( vector, proc );
}
@ -266,7 +281,7 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
register BYTE *p;
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( FarGetOwner( GlobalHandle16(cs) ))))
if (!(pModule = MODULE_GetPtr16( FarGetOwner( GlobalHandle16(cs) ))))
return NULL;
/* Search for the ordinal */
@ -299,7 +314,7 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
}
break;
case 0xff: /* moveable (should not happen in built-in modules) */
fprintf( stderr, "Built-in module has moveable entry\n" );
TRACE( relay, "Built-in module has moveable entry\n" );
ordinal += *p;
p += 2 + *p * 6;
break;
@ -396,14 +411,14 @@ void BUILTIN_PrintDLLs(void)
int i;
BUILTIN16_DLL *dll;
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available Win16 DLLs:\n");
MSG("Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
MSG("Available Win16 DLLs:\n");
for (i = 0, dll = BuiltinDLLs; dll->descr; dll++)
{
if (!(dll->flags & DLL_FLAG_ALWAYS_USED))
fprintf( stderr, "%-9s%c", dll->descr->name,
MSG("%-9s%c", dll->descr->name,
((++i) % 8) ? ' ' : '\n' );
}
fprintf(stderr,"\n");
MSG("\n");
BUILTIN32_PrintDLLs();
}

View File

@ -12,10 +12,10 @@ type win16
12 pascal16 ReplaceText(segptr) ReplaceText16
13 pascal FindTextDlgProc(word word word long) FindTextDlgProc16
14 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc16
15 pascal16 ChooseFont(ptr) ChooseFont
16 pascal16 FormatCharDlgProc(word word word long) FormatCharDlgProc
18 pascal16 FontStyleEnumProc(ptr ptr word long) FontStyleEnumProc
19 pascal16 FontFamilyEnumProc(ptr ptr word long) FontFamilyEnumProc
15 pascal16 ChooseFont(ptr) ChooseFont16
16 pascal16 FormatCharDlgProc(word word word long) FormatCharDlgProc16
18 pascal16 FontStyleEnumProc(ptr ptr word long) FontStyleEnumProc16
19 pascal16 FontFamilyEnumProc(ptr ptr word long) FontFamilyEnumProc16
20 pascal16 PrintDlg(segptr) PrintDlg16
21 pascal PrintDlgProc(word word word long) PrintDlgProc
22 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc

View File

@ -3,9 +3,9 @@ type win16
2 pascal16 DdeInitialize(ptr segptr long long) DdeInitialize16
3 pascal16 DdeUninitialize(long) DdeUninitialize16
4 pascal DdeConnectList(long word word word ptr) DdeConnectList
4 pascal DdeConnectList(long word word word ptr) DdeConnectList16
5 pascal DdeQueryNextServer(word word) DdeQueryNextServer
6 pascal DdeDisconnectList(word) DdeDisconnectList
6 pascal DdeDisconnectList(word) DdeDisconnectList16
7 pascal DdeConnect(long long long ptr) DdeConnect16
8 pascal16 DdeDisconnect(long) DdeDisconnect16
9 stub DdeQueryConvInfo #(word long ptr) DdeQueryConvInfo
@ -13,10 +13,10 @@ type win16
11 pascal DdeClientTransaction(ptr long long long s_word s_word long ptr)
DdeClientTransaction16
12 pascal DdeAbandonTransaction(long word long) DdeAbandonTransaction
13 pascal DdePostAdvise(long word word) DdePostAdvise
13 pascal DdePostAdvise(long word word) DdePostAdvise16
14 pascal DdeCreateDataHandle(long ptr long long word word word) DdeCreateDataHandle
15 pascal DdeAddData(word ptr long long) DdeAddData
16 pascal DdeGetData(word ptr long long) DdeGetData
16 pascal DdeGetData(word ptr long long) DdeGetData16
17 pascal DdeAccessData(word ptr) DdeAccessData
18 pascal DdeUnaccessData(word) DdeUnaccessData
19 pascal16 DdeFreeDataHandle(long) DdeFreeDataHandle16

View File

@ -1,51 +1,57 @@
/*
* Dummy function definitions
*/
#include <stdio.h>
#include "wintypes.h"
long WINAPI stub_GDI_379(void) { fprintf(stderr, "Warning: GDI_379:STARTPAGE unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_380(void) { fprintf(stderr, "Warning: GDI_380:ENDPAGE unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_381(HDC16 hdc, SEGPTR proc) { fprintf(stderr, "Warning: GDI_381:SETABORTPROC unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_382(void) { fprintf(stderr, "Warning: GDI_382:ABORTPROC unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_530(void) { fprintf(stderr, "Warning: GDI_530: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_531(void) { fprintf(stderr, "Warning: GDI_531: unimplemented stub\n"); return 0; }
#include "debug.h"
long WINAPI stub_GDI_379(void) { FIXME(relay, "STARTPAGE: stub\n"); return 1; }
long WINAPI stub_GDI_380(void) { FIXME(relay, "ENDPAGE: stub\n"); return 1; }
long WINAPI stub_GDI_381(HDC16 hdc, SEGPTR proc) { FIXME(relay, "SETABORTPROC: stub\n"); return 1; }
long WINAPI stub_GDI_382(void) { FIXME(relay, "ABORTPROC: stub\n"); return 1; }
long WINAPI stub_GDI_530(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_531(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_532(LPINT16 buffer, INT16 xx) {
fprintf(stderr, "STUB GDI_532(%p, %hd)\n",buffer,xx);
FIXME(relay, "(%p, %hd): stub\n",buffer,xx);
return 0;
}
long WINAPI stub_GDI_536(void) { fprintf(stderr, "Warning: GDI_536: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_538(void) { fprintf(stderr, "Warning: GDI_538: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_540(void) { fprintf(stderr, "Warning: GDI_540: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_543(void) { fprintf(stderr, "Warning: GDI_543: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_555(void) { fprintf(stderr, "Warning: GDI_555: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_560(void) { fprintf(stderr, "Warning: GDI_560: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_561(void) { fprintf(stderr, "Warning: GDI_561: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_564(void) { fprintf(stderr, "Warning: GDI_564: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_565(void) { fprintf(stderr, "Warning: GDI_565: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_566(void) { fprintf(stderr, "Warning: GDI_566: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_571(void) { fprintf(stderr, "Warning: GDI_571: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_572(void) { fprintf(stderr, "Warning: GDI_572: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_573(void) { fprintf(stderr, "Warning: GDI_573: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_556(void) { fprintf(stderr, "Warning: GDI_556: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_558(void) { fprintf(stderr, "Warning: GDI_558: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_569(void) { fprintf(stderr, "Warning: GDI_569: unimplemented stub\n"); return 0; }
long WINAPI stub_KERNEL_450(void) { fprintf(stderr, "Warning: KERNEL_450: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_489(void) { fprintf(stderr, "Warning: USER_489: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_490(void) { fprintf(stderr, "Warning: USER_490: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_492(void) { fprintf(stderr, "Warning: USER_492: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_496(void) { fprintf(stderr, "Warning: USER_496: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_902(void) { fprintf(stderr, "Warning: USER_902: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_905(void) { fprintf(stderr, "Warning: USER_905: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_906(void) { fprintf(stderr, "Warning: USER_906: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_907(void) { fprintf(stderr, "Warning: USER_907: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_909(void) { fprintf(stderr, "Warning: USER_909: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_910(void) { fprintf(stderr, "Warning: USER_910: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_911(void) { fprintf(stderr, "Warning: USER_911: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_912(void) { fprintf(stderr, "Warning: USER_912: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_913(void) { fprintf(stderr, "Warning: USER_913: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_914(void) { fprintf(stderr, "Warning: USER_914: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_915(void) { fprintf(stderr, "Warning: USER_915: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_916(void) { fprintf(stderr, "Warning: USER_916: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_918(void) { fprintf(stderr, "Warning: USER_918: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_919(void) { fprintf(stderr, "Warning: USER_919: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_920(void) { fprintf(stderr, "Warning: USER_920: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_922(void) { fprintf(stderr, "Warning: USER_922: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_923(void) { fprintf(stderr, "Warning: USER_923: unimplemented stub\n"); return 0; }
long WINAPI stub_KERNEL_700(void) { fprintf(stderr, "Warning: KERNEL_700: unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_536(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_538(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_540(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_543(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_555(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_560(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_561(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_564(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_565(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_566(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_571(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_572(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_573(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_556(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_558(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_GDI_569(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_KERNEL_450(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_489(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_490(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_492(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_496(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_902(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_905(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_906(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_907(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_909(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_910(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_911(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_912(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_913(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_914(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_915(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_916(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_918(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_919(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_920(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_922(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_USER_923(void) { FIXME(relay, "stub\n"); return 0; }
long WINAPI stub_KERNEL_700(void) { FIXME(relay, "stub\n"); return 1; }

View File

@ -326,7 +326,7 @@ file gdi.exe
498 stub GetEnhMetafileDescription
499 stub GetEnhMetafileHeader
501 stub GetEnhMetafilePaletteEntries
502 stub PolyBezier
502 pascal16 PolyBezier(word ptr word) PolyBezier16
503 stub PolyBezierTo
504 stub PlayEnhMetafileRecord
505 stub SetEnhMetafileBits

View File

@ -63,7 +63,7 @@ file krnl386.exe
63 pascal16 FreeResource(word) FreeResource16
64 pascal16 AccessResource(word word) AccessResource16
65 pascal SizeofResource(word word) SizeofResource16
66 pascal16 AllocResource(word word long) AllocResource16
66 pascal16 AllocResource(word word long) AllocResource
67 pascal SetResourceHandler(word segstr segptr) THUNK_SetResourceHandler
68 pascal16 InitAtomTable(word) InitAtomTable16
69 pascal16 FindAtom(segstr) FindAtom16

View File

@ -2,12 +2,12 @@ name ole2disp
type win16
1 stub DLLGETCLASSOBJECT
2 pascal SysAllocString(str) SysAllocString
3 pascal SysReallocString(ptr str) SysReAllocString
4 pascal SysAllocStringLen(str word) SysAllocStringLen
5 pascal SysReAllocStringLen(ptr str word) SysReAllocStringLen
6 pascal SysFreeString(segstr) SysFreeString
7 pascal SysStringLen(segstr) SysStringLen
2 pascal SysAllocString(str) SysAllocString16
3 pascal SysReallocString(ptr str) SysReAllocString16
4 pascal SysAllocStringLen(str word) SysAllocStringLen16
5 pascal SysReAllocStringLen(ptr str word) SysReAllocStringLen16
6 pascal SysFreeString(segstr) SysFreeString16
7 pascal SysStringLen(segstr) SysStringLen16
8 stub VARIANTINIT
9 stub VARIANTCLEAR
10 stub VARIANTCOPY

View File

@ -16,11 +16,6 @@
#include "debugstr.h"
#include "debug.h"
#if 0
/* Make make_debug think these were really used */
TRACE(relay, "test - dummy");
#endif
/***********************************************************************
* RELAY_Init
@ -228,7 +223,7 @@ void RELAY_Unimplemented16(void)
{
WORD ordinal;
STACK16FRAME *frame = CURRENT_STACK16;
fprintf(stderr,"No handler for Win16 routine %s (called from %04x:%04x)\n",
MSG("No handler for Win16 routine %s (called from %04x:%04x)\n",
BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal),
frame->cs, frame->ip );
TASK_KillCurrentTask(1);
@ -366,22 +361,21 @@ void WINAPI Throw( CONTEXT *context )
IP_reg(context) = lpbuf[0];
CS_reg(context) = lpbuf[1];
SP_reg(context) = lpbuf[2] + 4 * sizeof(WORD) + sizeof(WORD) /*extra arg*/;
SP_reg(context) = lpbuf[2] + 4 * sizeof(WORD) - sizeof(WORD) /*extra arg*/;
BP_reg(context) = lpbuf[3];
SI_reg(context) = lpbuf[4];
DI_reg(context) = lpbuf[5];
DS_reg(context) = lpbuf[6];
if (lpbuf[8] != SS_reg(context))
fprintf( stderr, "Switching stack segment with Throw() not supported; expect crash now\n" );
ERR(relay, "Switching stack segment with Throw() not supported; expect crash now\n" );
if (TRACE_ON(relay)) /* Make sure we have a valid entry point address */
{
static FARPROC16 entryPoint = NULL;
if (!entryPoint) /* Get entry point for Throw() */
entryPoint = MODULE_GetEntryPoint( GetModuleHandle16("KERNEL"),
56 );
entryPoint = NE_GetEntryPoint( GetModuleHandle16("KERNEL"), 56 );
pFrame->entry_cs = SELECTOROF(entryPoint);
pFrame->entry_ip = OFFSETOF(entryPoint);
}
@ -452,7 +446,7 @@ static DWORD RELAY_CallProc32W(int Ex)
break;
default:
/* FIXME: should go up to 32 arguments */
fprintf(stderr,"CallProc32W: unsupported number of arguments %ld, please report.\n",nrofargs);
ERR(relay,"Unsupported number of arguments %ld, please report.\n",nrofargs);
ret = 0;
break;
}

View File

@ -22,6 +22,7 @@
#include "sig_context.h"
#include "miscemu.h"
#include "thread.h"
#include "debug.h"
extern void SIGNAL_SetHandler( int sig, void (*func)(), int flags );
@ -61,20 +62,21 @@ static HANDLER_DEF(SIGNAL_trap)
*/
static HANDLER_DEF(SIGNAL_fault)
{
WORD cs;
GET_CS(cs);
HANDLER_INIT();
if (CS_sig(HANDLER_CONTEXT) == cs)
if (INSTR_EmulateInstruction( HANDLER_CONTEXT )) return;
if (IS_SELECTOR_SYSTEM(CS_sig(HANDLER_CONTEXT)))
{
fprintf( stderr, "Segmentation fault in 32-bit code (0x%08lx).\n",
EIP_sig(HANDLER_CONTEXT) );
MSG("Segmentation fault in 32-bit code (0x%08lx).\n",
EIP_sig(HANDLER_CONTEXT) );
}
else
{
if (INSTR_EmulateInstruction( HANDLER_CONTEXT )) return;
fprintf( stderr, "Segmentation fault in 16-bit code (%04x:%04lx).\n",
(WORD)CS_sig(HANDLER_CONTEXT), EIP_sig(HANDLER_CONTEXT) );
MSG("Segmentation fault in 16-bit code (%04x:%04lx).\n",
(WORD)CS_sig(HANDLER_CONTEXT), EIP_sig(HANDLER_CONTEXT) );
}
#ifdef CR2_sig
fprintf(stderr,"Fault address is 0x%08lx\n",CR2_sig(HANDLER_CONTEXT));
#endif
wine_debug( signal, HANDLER_CONTEXT );
}
@ -158,17 +160,17 @@ static void SIGNAL_GetSigContext( SIGCONTEXT *sigcontext,
*/
void SIGNAL_InfoRegisters( CONTEXT *context )
{
fprintf( stderr," CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x",
MSG(" CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x",
(WORD)CS_reg(context), (WORD)SS_reg(context),
(WORD)DS_reg(context), (WORD)ES_reg(context),
(WORD)FS_reg(context), (WORD)GS_reg(context) );
fprintf( stderr, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx\n",
MSG( "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx\n",
EIP_reg(context), ESP_reg(context),
EBP_reg(context), EFL_reg(context) );
fprintf( stderr, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
MSG( " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
EAX_reg(context), EBX_reg(context),
ECX_reg(context), EDX_reg(context) );
fprintf( stderr, " ESI:%08lx EDI:%08lx\n",
MSG( " ESI:%08lx EDI:%08lx\n",
ESI_reg(context), EDI_reg(context) );
}

View File

@ -492,7 +492,7 @@ BOOL16 WINAPI THUNK_SetDCHook( HDC16 hdc, FARPROC16 proc, DWORD dwHookData )
THUNK *thunk, *oldThunk;
if (!defDCHookProc) /* Get DCHook Win16 entry point */
defDCHookProc = MODULE_GetEntryPoint( GetModuleHandle16("USER"), 362 );
defDCHookProc = NE_GetEntryPoint( GetModuleHandle16("USER"), 362 );
if (proc != defDCHookProc)
{
@ -521,8 +521,7 @@ DWORD WINAPI THUNK_GetDCHook( HDC16 hdc, FARPROC16 *phookProc )
if (thunk == (THUNK *)DCHook)
{
if (!defDCHookProc) /* Get DCHook Win16 entry point */
defDCHookProc = MODULE_GetEntryPoint(GetModuleHandle16("USER"),
362 );
defDCHookProc = NE_GetEntryPoint(GetModuleHandle16("USER"),362);
*phookProc = defDCHookProc;
}
else *phookProc = thunk->proc;
@ -541,7 +540,7 @@ FARPROC16 WINAPI THUNK_SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
THUNK *thunk = NULL;
if( !defSignalProc16 )
defSignalProc16 = MODULE_GetEntryPoint(GetModuleHandle16("USER"), 314 );
defSignalProc16 = NE_GetEntryPoint(GetModuleHandle16("USER"), 314 );
if( proc == defSignalProc16 )
thunk = (THUNK*)SetTaskSignalProc( hTask, (FARPROC16)&USER_SignalProc );
@ -569,9 +568,6 @@ FARPROC16 WINAPI THUNK_SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
*/
FARPROC16 WINAPI THUNK_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC16 proc )
{
/* loader/ne_resource.c */
extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16);
static FARPROC16 defDIBIconLoader16 = NULL;
static FARPROC16 defDIBCursorLoader16 = NULL;
static FARPROC16 defResourceLoader16 = NULL;
@ -581,8 +577,8 @@ FARPROC16 WINAPI THUNK_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FAR
if( !defResourceLoader16 )
{
HMODULE16 hUser = GetModuleHandle16("USER");
defDIBIconLoader16 = MODULE_GetEntryPoint( hUser, 357 );
defDIBCursorLoader16 = MODULE_GetEntryPoint( hUser, 356 );
defDIBIconLoader16 = NE_GetEntryPoint( hUser, 357 );
defDIBCursorLoader16 = NE_GetEntryPoint( hUser, 356 );
defResourceLoader16 = MODULE_GetWndProcEntry16( "DefResourceHandler" );
}
@ -703,7 +699,7 @@ static BOOL32 WINAPI THUNK_WOWCallback16Ex(
);
break;
default:
fprintf(stderr,"CALLBACK_CallWOWCallback16Ex(), %ld arguments not supported.!n",cbArgs);
ERR(thunk,"%ld arguments not supported.\n",cbArgs);
if (dwFlags == WCB16_CDECL)
HeapFree(GetProcessHeap(),0,args);
return FALSE;

View File

@ -2,7 +2,7 @@ name typelib
type win16
2 stub CREATETYPELIB
3 stub LOADTYPELIB
3 pascal LoadTypeLib(ptr ptr) LoadTypeLib
4 stub LHASHVALOFNAMESYS
5 stub _IID_ICREATETYPEINFO
6 stub _IID_ICREATETYPELIB
@ -11,5 +11,5 @@ type win16
9 stub _IID_ITYPELIB
10 stub REGISTERTYPELIB
11 stub LOADREGTYPELIB
14 pascal QueryPathOfRegTypeLib(ptr word word word ptr) QueryPathOfRegTypeLib
14 pascal QueryPathOfRegTypeLib(ptr word word word ptr) QueryPathOfRegTypeLib16
15 pascal OABuildVersion() OABuildVersion

View File

@ -462,7 +462,7 @@ file user.exe
514 pascal16 WNetDeviceMode(word) WNetDeviceMode
515 pascal16 WNetBrowseDialog(word word ptr) WNetBrowseDialog
516 pascal16 WNetGetUser(ptr ptr ptr) WNetGetUser
517 pascal16 WNetAddConnection(ptr ptr ptr) WNetAddConnection
517 pascal16 WNetAddConnection(ptr ptr ptr) WNetAddConnection16
518 pascal16 WNetCancelConnection(ptr word) WNetCancelConnection
519 pascal16 WNetGetError(ptr) WNetGetError
520 pascal16 WNetGetErrorText(word ptr ptr) WNetGetErrorText
@ -475,7 +475,7 @@ file user.exe
527 pascal16 WNetConnectionDialog(word word) WNetConnectionDialog
528 pascal16 WNetViewQueueDialog(word ptr) WNetViewQueueDialog
529 pascal16 WNetPropertyDialog(word word ptr word) WNetPropertyDialog
530 pascal16 WNetGetDirectoryType(ptr ptr) WNetGetDirectoryType
530 pascal16 WNetGetDirectoryType(ptr ptr) WNetGetDirectoryType16
531 pascal16 WNetDirectoryNotify(word ptr word) WNetDirectoryNotify
532 pascal16 WNetGetPropertyText(word word word ptr word) WNetGetPropertyText
533 stub WNetInitialize

View File

@ -9,10 +9,10 @@ type win16
19 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc
20 pascal PrintDlgProc(word word word long) PrintDlgProc
24 pascal16 TASK_Reschedule() TASK_Reschedule
27 pascal EntryAddrProc(word word) EntryAddrProc
28 pascal MyAlloc(word word word) MODULE_AllocateSegment
27 pascal EntryAddrProc(word word) NE_GetEntryPoint
28 pascal MyAlloc(word word word) NE_AllocateSegment
29 pascal DefResourceHandler(word word word) NE_DefResourceHandler
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc16
# Interrupt vectors 0-255 are ordinals 100-355
# The 'word' parameter are the flags pushed on the stack by the interrupt

View File

@ -228,7 +228,7 @@ typedef struct
short nSizeMin WINE_PACKED; /* minimum pt size allowed & */
short nSizeMax WINE_PACKED; /* max pt size allowed if */
/* CF_LIMITSIZE is used */
} CHOOSEFONT, *LPCHOOSEFONT;
} CHOOSEFONT16, *LPCHOOSEFONT16;
typedef struct
{
@ -248,7 +248,30 @@ typedef struct
UINT16 ___MISSING_ALIGNMENT__;
INT32 nSizeMin;
INT32 nSizeMax;
} CHOOSEFONT32A, *PCHOOSEFONT32A;
} CHOOSEFONT32A, *LPCHOOSEFONT32A;
typedef struct
{
UINT32 lStructSize;
HWND32 hwndOwner;
HDC32 hDC;
LPLOGFONT32W lpLogFont;
INT32 iPointSize;
UINT32 Flags;
COLORREF rgbColors;
LPARAM lCustData;
WNDPROC32 lpfnHook;
LPCWSTR lpTemplateName;
HINSTANCE32 hInstance;
LPWSTR lpszStyle;
UINT16 nFontType;
UINT16 ___MISSING_ALIGNMENT__;
INT32 nSizeMin;
INT32 nSizeMax;
} CHOOSEFONT32W, *LPCHOOSEFONT32W;
DECL_WINELIB_TYPE_AW(CHOOSEFONT);
DECL_WINELIB_TYPE_AW(LPCHOOSEFONT);
#pragma pack(4)
@ -264,6 +287,7 @@ typedef struct
#define CF_EFFECTS 0x00000100L
#define CF_APPLY 0x00000200L
#define CF_ANSIONLY 0x00000400L
#define CF_SCRIPTSONLY CF_ANSIONLY
#define CF_NOVECTORFONTS 0x00000800L
#define CF_NOOEMFONTS CF_NOVECTORFONTS
#define CF_NOSIMULATIONS 0x00001000L
@ -276,6 +300,9 @@ typedef struct
#define CF_NOFACESEL 0x00080000L
#define CF_NOSTYLESEL 0x00100000L
#define CF_NOSIZESEL 0x00200000L
#define CF_SELECTSCRIPT 0x00400000L
#define CF_NOSCRIPTSEL 0x00800000L
#define CF_NOVERTFONTS 0x01000000L
#define SIMULATED_FONTTYPE 0x8000
#define PRINTER_FONTTYPE 0x4000
@ -285,6 +312,8 @@ typedef struct
#define REGULAR_FONTTYPE 0x0400
#define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
#define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101)
#define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102)
#define LBSELCHSTRING "commdlg_LBSelChangedNotify"
#define SHAREVISTRING "commdlg_ShareViolation"
@ -446,7 +475,10 @@ HWND16 WINAPI ReplaceText16( SEGPTR find);
HWND32 WINAPI ReplaceText32A( LPFINDREPLACE32A lpFind);
HWND32 WINAPI ReplaceText32W( LPFINDREPLACE32W lpFind);
#define ReplaceText WINELIB_NAME_AW(ReplaceText)
BOOL16 WINAPI ChooseFont(LPCHOOSEFONT lpChFont);
BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16);
BOOL32 WINAPI ChooseFont32A(LPCHOOSEFONT32A);
BOOL32 WINAPI ChooseFont32W(LPCHOOSEFONT32W);
#define ChooseFont WINELIB_NAME_AW(ChooseFont)
LRESULT WINAPI FileOpenDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FileSaveDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI ColorDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
@ -460,8 +492,10 @@ LRESULT WINAPI ReplaceTextDlgProc32W(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam,
#define ReplaceTextProc WINELIB_NAME_AW(ReplaceTextDlgProc)
LRESULT WINAPI PrintDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI PrintSetupDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FormatCharDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FormatCharDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
LRESULT WINAPI FormatCharDlgProc32A(HWND32,UINT32,WPARAM32,LPARAM);
LRESULT WINAPI FormatCharDlgProc32W(HWND32,UINT32,WPARAM32,LPARAM);
#define FormatCharDlgProc LIBWINE_NAME_AW(FormatCharDlgProc)
#ifdef __cplusplus
}
#endif

View File

@ -51,9 +51,13 @@ UINT32 WINAPI DdeInitialize32W(LPDWORD,PFNCALLBACK32,DWORD,DWORD);
BOOL16 WINAPI DdeUninitialize16(DWORD);
BOOL32 WINAPI DdeUninitialize32(DWORD);
#define DdeUninitialize WINELIB_NAME(DdeUninitialize)
HCONVLIST WINAPI DdeConnectList(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT16);
HCONVLIST WINAPI DdeConnectList16(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT16);
HCONVLIST WINAPI DdeConnectList32(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT32);
#define DdeConnectList WINELIB_NAME(DdeConnectList)
HCONV WINAPI DdeQueryNextServer(HCONVLIST, HCONV);
BOOL16 WINAPI DdeDisconnectList(HCONVLIST);
BOOL16 WINAPI DdeDisconnectList16(HCONVLIST);
BOOL32 WINAPI DdeDisconnectList32(HCONVLIST);
#define DdeDisConnectList WINELIB_NAME(DdeDisconnectList)
HCONV WINAPI DdeConnect16(DWORD,HSZ,HSZ,LPCONVCONTEXT16);
HCONV WINAPI DdeConnect32(DWORD,HSZ,HSZ,LPCONVCONTEXT32);
#define DdeConnect WINELIB_NAME(DdeConnect)
@ -82,7 +86,9 @@ HDDEDATA WINAPI DdeClientTransaction32(LPBYTE,DWORD,HCONV,HSZ,UINT32,
UINT32,DWORD,LPDWORD);
#define DdeClientTransaction WINELIB_NAME(DdeClientTransaction)
BOOL16 WINAPI DdeAbandonTransaction(DWORD,HCONV,DWORD);
BOOL16 WINAPI DdePostAdvise(DWORD,HSZ,HSZ);
BOOL16 WINAPI DdePostAdvise16(DWORD,HSZ,HSZ);
BOOL32 WINAPI DdePostAdvise32(DWORD,HSZ,HSZ);
#define DdePostAdvise WINELIB_NAME(DdePostAdvise)
HDDEDATA WINAPI DdeAddData(HDDEDATA,LPBYTE,DWORD,DWORD);
DWORD WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
LPBYTE WINAPI DdeAccessData(HDDEDATA,LPDWORD);

View File

@ -31,87 +31,90 @@
#define dbch_dialog 23
#define dbch_dll 24
#define dbch_dosfs 25
#define dbch_driver 26
#define dbch_dsound 27
#define dbch_edit 28
#define dbch_event 29
#define dbch_exec 30
#define dbch_file 31
#define dbch_fixup 32
#define dbch_font 33
#define dbch_gdi 34
#define dbch_global 35
#define dbch_graphics 36
#define dbch_heap 37
#define dbch_hook 38
#define dbch_icon 39
#define dbch_imagelist 40
#define dbch_int 41
#define dbch_int21 42
#define dbch_int31 43
#define dbch_key 44
#define dbch_keyboard 45
#define dbch_ldt 46
#define dbch_listbox 47
#define dbch_local 48
#define dbch_mci 49
#define dbch_mcianim 50
#define dbch_mciwave 51
#define dbch_mdi 52
#define dbch_menu 53
#define dbch_message 54
#define dbch_metafile 55
#define dbch_midi 56
#define dbch_mmaux 57
#define dbch_mmio 58
#define dbch_mmsys 59
#define dbch_mmtime 60
#define dbch_module 61
#define dbch_mpr 62
#define dbch_msg 63
#define dbch_nonclient 64
#define dbch_ntdll 65
#define dbch_ole 66
#define dbch_palette 67
#define dbch_print 68
#define dbch_profile 69
#define dbch_progress 70
#define dbch_prop 71
#define dbch_reg 72
#define dbch_region 73
#define dbch_relay 74
#define dbch_resource 75
#define dbch_scroll 76
#define dbch_security 77
#define dbch_selector 78
#define dbch_sem 79
#define dbch_sendmsg 80
#define dbch_shell 81
#define dbch_shm 82
#define dbch_sound 83
#define dbch_static 84
#define dbch_stress 85
#define dbch_string 86
#define dbch_task 87
#define dbch_text 88
#define dbch_thread 89
#define dbch_thunk 90
#define dbch_timer 91
#define dbch_toolhelp 92
#define dbch_tweak 93
#define dbch_uitools 94
#define dbch_updown 95
#define dbch_ver 96
#define dbch_virtual 97
#define dbch_vxd 98
#define dbch_win 99
#define dbch_win16drv 100
#define dbch_win32 101
#define dbch_wing 102
#define dbch_winsock 103
#define dbch_wnet 104
#define dbch_x11 105
#define dbch_x11drv 106
#define dbch_dosmem 26
#define dbch_driver 27
#define dbch_dsound 28
#define dbch_edit 29
#define dbch_event 30
#define dbch_exec 31
#define dbch_file 32
#define dbch_fixup 33
#define dbch_font 34
#define dbch_gdi 35
#define dbch_global 36
#define dbch_graphics 37
#define dbch_heap 38
#define dbch_hook 39
#define dbch_icon 40
#define dbch_imagelist 41
#define dbch_int 42
#define dbch_int21 43
#define dbch_int31 44
#define dbch_key 45
#define dbch_keyboard 46
#define dbch_ldt 47
#define dbch_listbox 48
#define dbch_local 49
#define dbch_mci 50
#define dbch_mcianim 51
#define dbch_mciwave 52
#define dbch_mdi 53
#define dbch_menu 54
#define dbch_message 55
#define dbch_metafile 56
#define dbch_midi 57
#define dbch_mmaux 58
#define dbch_mmio 59
#define dbch_mmsys 60
#define dbch_mmtime 61
#define dbch_module 62
#define dbch_mpr 63
#define dbch_msg 64
#define dbch_nonclient 65
#define dbch_ntdll 66
#define dbch_ole 67
#define dbch_palette 68
#define dbch_print 69
#define dbch_profile 70
#define dbch_progress 71
#define dbch_prop 72
#define dbch_reg 73
#define dbch_region 74
#define dbch_relay 75
#define dbch_resource 76
#define dbch_scroll 77
#define dbch_security 78
#define dbch_segment 79
#define dbch_selector 80
#define dbch_sem 81
#define dbch_sendmsg 82
#define dbch_shell 83
#define dbch_shm 84
#define dbch_sound 85
#define dbch_static 86
#define dbch_stress 87
#define dbch_string 88
#define dbch_system 89
#define dbch_task 90
#define dbch_text 91
#define dbch_thread 92
#define dbch_thunk 93
#define dbch_timer 94
#define dbch_toolhelp 95
#define dbch_tweak 96
#define dbch_uitools 97
#define dbch_updown 98
#define dbch_ver 99
#define dbch_virtual 100
#define dbch_vxd 101
#define dbch_win 102
#define dbch_win16drv 103
#define dbch_win32 104
#define dbch_wing 105
#define dbch_winsock 106
#define dbch_wnet 107
#define dbch_x11 108
#define dbch_x11drv 109
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_err 1

View File

@ -4,7 +4,7 @@
#include "debugtools.h"
#endif
#define DEBUG_CHANNEL_COUNT 107
#define DEBUG_CHANNEL_COUNT 110
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
@ -114,6 +114,9 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
};
const char* debug_ch_name[] = {
"accel",
@ -142,6 +145,7 @@ const char* debug_ch_name[] = {
"dialog",
"dll",
"dosfs",
"dosmem",
"driver",
"dsound",
"edit",
@ -194,6 +198,7 @@ const char* debug_ch_name[] = {
"resource",
"scroll",
"security",
"segment",
"selector",
"sem",
"sendmsg",
@ -203,6 +208,7 @@ const char* debug_ch_name[] = {
"static",
"stress",
"string",
"system",
"task",
"text",
"thread",

View File

@ -85,14 +85,13 @@ struct wine_locals {
typedef struct wine_locals WineLocals;
#define DBG_FIX_ADDR_SEG(addr,default) \
{ WORD cs, ds; GET_CS(cs); GET_DS(ds); \
#define DBG_FIX_ADDR_SEG(addr,default) { \
if ((addr)->seg == 0xffffffff) (addr)->seg = (default); \
if (((addr)->seg == cs) || (addr)->seg == ds) (addr)->seg = 0; }
if (IS_SELECTOR_SYSTEM((addr)->seg)) (addr)->seg = 0; }
#define DBG_ADDR_TO_LIN(addr) \
((addr)->seg ? (char *)PTR_SEG_OFF_TO_LIN((addr)->seg,(addr)->off) \
: (char *)(addr)->off)
(IS_SELECTOR_SYSTEM((addr)->seg) ? (char *)(addr)->off \
: (char *)PTR_SEG_OFF_TO_LIN((addr)->seg,(addr)->off))
#define DBG_CHECK_READ_PTR(addr,len) \
(!DEBUG_IsBadReadPtr((addr),(len)) || \

View File

@ -198,6 +198,7 @@ typedef struct tagDC_FUNCS
BOOL32 (*pPatBlt)(DC*,INT32,INT32,INT32,INT32,DWORD);
BOOL32 (*pPie)(DC*,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
BOOL32 (*pPolyPolygon)(DC*,LPPOINT32,LPINT32,UINT32);
BOOL32 (*pPolyPolyline)(DC*,LPPOINT32,LPINT32,UINT32);
BOOL32 (*pPolygon)(DC*,LPPOINT32,INT32);
BOOL32 (*pPolyline)(DC*,LPPOINT32,INT32);
UINT32 (*pRealizePalette)(DC*);

View File

@ -59,13 +59,13 @@ extern ldt_copy_entry ldt_copy[LDT_SIZE];
/* Convert a segmented ptr (16:16) to a linear (32) pointer */
#define PTR_SEG_OFF_TO_LIN(seg,off) \
((void*)(GET_SEL_BASE(seg) + (unsigned int)(off)))
((void*)(GET_SEL_BASE(seg) + (unsigned int)(off)))
#define PTR_SEG_TO_LIN(ptr) \
(__winelib ? (void*)(ptr) : PTR_SEG_OFF_TO_LIN(SELECTOROF(ptr),OFFSETOF(ptr)))
PTR_SEG_OFF_TO_LIN(SELECTOROF(ptr),OFFSETOF(ptr))
#define PTR_SEG_OFF_TO_SEGPTR(seg,off) \
(__winelib ? (SEGPTR)PTR_SEG_OFF_TO_LIN(seg,off) : (SEGPTR)MAKELONG(off,seg))
((SEGPTR)MAKELONG(off,seg))
#define PTR_SEG_OFF_TO_HUGEPTR(seg,off) \
(PTR_SEG_OFF_TO_SEGPTR( (seg) + (HIWORD(off) << __AHSHIFT), LOWORD(off) ))
PTR_SEG_OFF_TO_SEGPTR( (seg) + (HIWORD(off) << __AHSHIFT), LOWORD(off) )
extern unsigned char ldt_flags_copy[LDT_SIZE];
@ -78,4 +78,12 @@ extern unsigned char ldt_flags_copy[LDT_SIZE];
#define GET_SEL_FLAGS(sel) (ldt_flags_copy[SELECTOR_TO_ENTRY(sel)])
#define FIRST_LDT_ENTRY_TO_ALLOC 17
/* Determine if sel is a system selector (i.e. not managed by Wine) */
#define IS_SELECTOR_SYSTEM(sel) \
(!((sel) & 4) || (SELECTOR_TO_ENTRY(sel) < FIRST_LDT_ENTRY_TO_ALLOC))
#define IS_SELECTOR_32BIT(sel) \
(IS_SELECTOR_SYSTEM(sel) || (GET_SEL_FLAGS(sel) & LDT_FLAGS_32BIT))
#endif /* __WINE_LDT_H */

View File

@ -15,7 +15,6 @@ extern HANDLE16 DOSMEM_BiosSeg;
extern DWORD DOSMEM_CollateTable;
extern BOOL32 DOSMEM_Init(void);
extern void DOSMEM_InitExports(HMODULE16);
extern void DOSMEM_Tick(void);
extern WORD DOSMEM_AllocSelector(WORD);
extern LPVOID DOSMEM_GetBlock(UINT32 size, UINT16* p);

View File

@ -101,6 +101,25 @@ typedef struct
#pragma pack(4)
/* internal representation of 32bit modules. per process. */
typedef enum { MODULE32_PE=1, MODULE32_ELF, /* ... */ } MODULE32_TYPE;
typedef struct _wine_modref
{
struct _wine_modref *next;
MODULE32_TYPE type;
union {
PE_MODREF pe;
/* ELF_MODREF elf; */
} binfmt;
HMODULE32 module;
char *modname;
char *fullname;
char *shortname;
char *unixname;
} WINE_MODREF;
/* Resource types */
typedef struct resource_typeinfo_s NE_TYPEINFO;
typedef struct resource_nameinfo_s NE_NAMEINFO;
@ -114,32 +133,48 @@ typedef struct resource_nameinfo_s NE_NAMEINFO;
#define NE_MODULE_NAME(pModule) \
(((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
#define NE_WIN32_MODULE(pModule) \
((((pModule)->flags & NE_FFLAGS_WIN32) ? \
((NE_WIN32_EXTRAINFO *)((pModule) + 1))->module32 : 0))
/* module.c */
extern NE_MODULE *MODULE_GetPtr( HMODULE32 hModule );
extern NE_MODULE *MODULE_GetPtr16( HMODULE16 hModule );
extern NE_MODULE *MODULE_GetPtr32( HMODULE32 hModule );
extern HMODULE16 MODULE_HANDLEtoHMODULE16( HANDLE32 handle );
extern HMODULE32 MODULE_HANDLEtoHMODULE32( HANDLE32 handle );
extern void MODULE_DumpModule( HMODULE32 hmodule );
extern void MODULE_WalkModules(void);
extern int MODULE_OpenFile( HMODULE32 hModule );
extern LPSTR MODULE_GetModuleName( HMODULE32 hModule );
extern void MODULE_RegisterModule( NE_MODULE *pModule );
extern HMODULE32 MODULE_FindModule( LPCSTR path );
extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, BOOL32 lib_only );
extern HINSTANCE16 MODULE_GetInstance( HMODULE32 hModule );
extern FARPROC32 MODULE_GetProcAddress32( struct _PDB32*pdb,HMODULE32 hModule,LPCSTR function );
extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule );
extern HMODULE32 MODULE_FindModule16( LPCSTR path );
extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path );
extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, HINSTANCE16 *prev,
BOOL32 lib_only );
extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, UINT16 uFlags, LPCSTR cmd_line,
LPCSTR env, UINT32 show_cmd );
extern WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name );
extern FARPROC16 MODULE_GetEntryPoint( HMODULE32 hModule, WORD ordinal );
extern BOOL16 MODULE_SetEntryPoint( HMODULE32 hModule, WORD ordinal,
WORD offset );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPSTR name );
typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16,HMODULE16,HRSRC16);
/* loader/ne/module.c */
extern void NE_DumpModule( HMODULE16 hModule );
extern void NE_WalkModules(void);
extern void NE_RegisterModule( NE_MODULE *pModule );
extern WORD NE_GetOrdinal( HMODULE16 hModule, const char *name );
extern FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset );
extern HINSTANCE16 NE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, UINT16 flags,
LPCSTR cmd_line, LPCSTR env,
UINT32 show_cmd );
/* loader/ne/resource.c */
extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16);
extern BOOL32 NE_InitResourceHandler( HMODULE16 hModule );
/* loader/ne/segment.c */
extern BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum );
extern BOOL32 NE_LoadAllSegments( NE_MODULE *pModule );
extern void NE_FixupPrologs( NE_MODULE *pModule );
extern void NE_InitializeDLLs( HMODULE16 hModule );
extern BOOL32 NE_CreateSegments( HMODULE16 hModule );
/* builtin.c */
extern BOOL32 BUILTIN_Init(void);
extern HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force );
@ -149,13 +184,6 @@ extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay,
extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
extern void BUILTIN_PrintDLLs(void);
/* ne_image.c */
extern BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum );
extern BOOL32 NE_LoadAllSegments( NE_MODULE *pModule );
extern BOOL32 NE_LoadDLLs( NE_MODULE *pModule );
extern void NE_FixupPrologs( NE_MODULE *pModule );
extern void NE_InitializeDLLs( HMODULE16 hModule );
/* relay32/builtin.c */
extern HMODULE32 BUILTIN32_LoadModule( LPCSTR name, BOOL32 force,
struct _PDB32 *process );

View File

@ -167,51 +167,6 @@ struct relocation_entry_s
#define NE_RELTYPE_OSFIXUP 3
#define NE_RELFLAG_ADDITIVE 4
/*
* DOS PSP
*/
struct dos_psp_s
{
unsigned short pspInt20;
unsigned short pspNextParagraph;
unsigned char pspReserved1;
unsigned char pspDispatcher[5];
unsigned short pspTerminateVector[2];
unsigned short pspControlCVector[2];
unsigned short pspCritErrorVector[2];
unsigned short pspReserved2[11];
unsigned short pspEnvironment;
unsigned short pspReserved3[23];
unsigned char pspFCB_1[16];
unsigned char pspFCB_2[16];
unsigned char pspReserved4[4];
unsigned char pspCommandTailCount;
unsigned char pspCommandTail[128];
};
/*
* Entry table structures.
*/
struct entry_tab_header_s
{
unsigned char n_entries;
unsigned char seg_number;
};
struct entry_tab_movable_s
{
unsigned char flags;
unsigned char int3f[2];
unsigned char seg_number;
unsigned short offset;
};
struct entry_tab_fixed_s
{
unsigned char flags;
unsigned char offset[2];
};
/*
* Resource table structures.
*/
@ -229,7 +184,7 @@ struct resource_typeinfo_s
{
unsigned short type_id; /* Type identifier */
unsigned short count; /* Number of resources of this type */
DWORD resloader; /* SetResourceHandler() */
FARPROC16 resloader; /* SetResourceHandler() */
/*
* Name info array.
*/

View File

@ -7,24 +7,29 @@
#include "windows.h"
typedef CHAR OLECHAR16;
typedef LPSTR LPOLESTR16;
typedef LPCSTR LPCOLESTR16;
typedef WCHAR OLECHAR32;
typedef LPWSTR LPOLESTR32;
typedef LPCWSTR LPCOLESTR32;
typedef CHAR OLECHAR16;
typedef OLECHAR16 *BSTR16;
typedef BSTR16 *LPBSTR16;
typedef LPSTR LPOLESTR16;
typedef LPCSTR LPCOLESTR16;
typedef WCHAR OLECHAR32;
typedef OLECHAR32 *BSTR32;
typedef BSTR32 *LPBSTR32;
typedef LPWSTR LPOLESTR32;
typedef LPCWSTR LPCOLESTR32;
DECL_WINELIB_TYPE(OLECHAR);
DECL_WINELIB_TYPE(LPOLESTR);
DECL_WINELIB_TYPE(LPCOLESTR);
DECL_WINELIB_TYPE(BSTR);
DECL_WINELIB_TYPE(LPBSTR);
#define OLESTR16(x) x
#define OLESTR32(x) L##x
#define OLESTR32(x) L##x /* probably wrong */
#define OLESTR WINELIB_NAME(OLESTR)
typedef unsigned short VARTYPE;
typedef LONG DISPID;
/* object types */
#define OT_LINK 1
#define OT_EMBEDDED 2

14
include/oleauto.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef __WINE_OLEAUTO_H
#define __WINE_OLEAUTO_H
BSTR16 SysAllocString16(LPOLESTR16);
BSTR32 SysAllocString32(LPOLESTR32);
#define SysAllocString WINELIB_NAME(SysAllocString)
INT16 SysReAllocString16(LPBSTR16,LPOLESTR16);
INT32 SysReAllocString32(LPBSTR32,LPOLESTR32);
#define SysReAllocString WINELIB_NAME(SysReAllocString)
VOID SysFreeString16(BSTR16);
VOID SysFreeString32(BSTR32);
#define SysFreeString WINELIB_NAME(SysFreeString)
#endif

View File

@ -9,9 +9,7 @@
/* modreference used for attached processes
* all section are calculated here, relocations etc.
*/
struct pe_modref {
struct pe_modref *next;
HMODULE32 module;
typedef struct {
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
LPIMAGE_EXPORT_DIRECTORY pe_export;
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
@ -21,16 +19,16 @@ struct pe_modref {
#define PE_MODREF_NO_DLL_CALLS 0x00000002
#define PE_MODREF_RELOCS_DONE 0x00000004
#define PE_MODREF_TLS_ALLOCED 0x00000008
#define PE_MODREF_INTERNAL 0x00000010
int tlsindex;
};
} PE_MODREF;
struct _PDB32;
typedef struct pe_modref PE_MODREF;
struct _wine_modref;
extern int PE_unloadImage(HMODULE32 hModule);
extern FARPROC32 PE_FindExportedFunction( struct _PDB32 *process,
HMODULE32 hModule, LPCSTR funcName);
extern FARPROC32 PE_FindExportedFunction(
struct _PDB32 *process,struct _wine_modref *wm, LPCSTR funcName
);
extern void my_wcstombs(char * result, u_short * source, int len);
extern BOOL32 PE_EnumResourceTypes32A(HMODULE32,ENUMRESTYPEPROC32A,LONG);
extern BOOL32 PE_EnumResourceTypes32W(HMODULE32,ENUMRESTYPEPROC32W,LONG);
@ -38,10 +36,10 @@ extern BOOL32 PE_EnumResourceNames32A(HMODULE32,LPCSTR,ENUMRESNAMEPROC32A,LONG);
extern BOOL32 PE_EnumResourceNames32W(HMODULE32,LPCWSTR,ENUMRESNAMEPROC32W,LONG);
extern BOOL32 PE_EnumResourceLanguages32A(HMODULE32,LPCSTR,LPCSTR,ENUMRESLANGPROC32A,LONG);
extern BOOL32 PE_EnumResourceLanguages32W(HMODULE32,LPCWSTR,LPCWSTR,ENUMRESLANGPROC32W,LONG);
extern HRSRC32 PE_FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource32(HINSTANCE32,HRSRC32);
extern HRSRC32 PE_FindResourceEx32W(struct _wine_modref*,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource32(HMODULE32,HRSRC32);
extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,struct _PDB32*,HFILE32,DWORD);
extern HGLOBAL32 PE_LoadResource32(HINSTANCE32,HRSRC32);
extern HGLOBAL32 PE_LoadResource32(struct _wine_modref *wm,HRSRC32);
extern HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs,
LPCSTR cmd_line, LPCSTR env, UINT16 showCmd);

View File

@ -10,8 +10,8 @@
#include "windows.h"
#include "winbase.h"
#include "winnt.h"
#include "module.h"
#include "k32obj.h"
#include "pe_image.h"
struct _NE_MODULE;
@ -77,7 +77,7 @@ typedef struct _PDB32
ENVDB *env_db; /* 40 Environment database */
HANDLE_TABLE *handle_table; /* 44 Handle table */
struct _PDB32 *parent; /* 48 Parent process */
PE_MODREF *modref_list; /* 4c MODREF list */
WINE_MODREF *modref_list; /* 4c MODREF list */
void *thread_list; /* 50 List of threads */
void *debuggee_CB; /* 54 Debuggee context block */
void *local_heap_free; /* 58 Head of local heap free list */
@ -88,7 +88,7 @@ typedef struct _PDB32
DWORD tls_bits[2]; /* 88 TLS in-use bits */
DWORD process_dword; /* 90 Unknown */
struct _PDB32 *group; /* 94 Process group */
PE_MODREF *exe_modref; /* 98 MODREF for the process EXE */
WINE_MODREF *exe_modref; /* 98 MODREF for the process EXE */
LPTOP_LEVEL_EXCEPTION_FILTER top_filter; /* 9c Top exception filter */
DWORD priority; /* a0 Priority level */
HANDLE32 heap_list; /* a4 Head of process heap list */
@ -103,6 +103,12 @@ typedef struct _PDB32
LCID locale; /* c4 Locale to be queried by GetThreadLocale (NT) */
} PDB32;
/* Process flags */
#define PDB32_WIN16_PROC 0x0008 /* Win16 process */
#define PDB32_DOS_PROC 0x0010 /* Dos process */
#define PDB32_CONSOLE_PROC 0x0020 /* Console process */
#define PDB32_FILE_APIS_OEM 0x0040 /* File APIs are OEM */
/* PDB <-> Process id conversion macros */
#define PROCESS_OBFUSCATOR ((DWORD)0xdeadbeef)
#define PROCESS_ID_TO_PDB(id) ((PDB32 *)((id) ^ PROCESS_OBFUSCATOR))

View File

@ -45,22 +45,6 @@ extern void LIBRES_RegisterResources(const struct resource* const * Res);
#undef HAVE_WINE_CONSTRUCTOR
#endif
typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16, HMODULE16, HRSRC16 );
/* FIXME: convert all NE_ functions to accept NE_MODULE pointer instead
* of redundant hModule (which is always verified prior to calling these).
*/
extern int NE_AccessResource( HMODULE16 hModule, HRSRC16 hRsrc );
extern BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle );
extern HRSRC16 NE_FindResource(HMODULE16 hModule, SEGPTR typeId, SEGPTR resId);
extern DWORD NE_SizeofResource( HMODULE16 hModule, HRSRC16 hRsrc );
extern SEGPTR NE_LockResource( HMODULE16 hModule, HGLOBAL16 handle );
extern HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size );
extern HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc );
extern BOOL32 NE_InitResourceHandler( HMODULE16 hModule );
extern FARPROC32 NE_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC32 handler);
extern HGLOBAL16 SYSRES_LoadResource( SYSTEM_RESOURCE id );
extern void SYSRES_FreeResource( HGLOBAL16 handle );
extern LPCVOID SYSRES_GetResPtr( SYSTEM_RESOURCE id );

View File

@ -120,9 +120,10 @@ typedef struct _CONTEXT /* Note 1 */
#define SS_sig(context) ((context)->sc_ss)
#ifdef linux
/* fs and gs are not supported on *BSD. Hopefully we won't need them. */
/* fs and gs are not supported on *BSD. */
#define FS_sig(context) ((context)->sc_fs)
#define GS_sig(context) ((context)->sc_gs)
#define CR2_sig(context) ((context)->cr2)
#endif
#ifndef __FreeBSD__

View File

@ -1 +1 @@
#define WINE_RELEASE_INFO "Wine release 980413"
#define WINE_RELEASE_INFO "Wine release 980503"

View File

@ -160,7 +160,7 @@ typedef struct {
WCHAR szCSDVersion[128];
} OSVERSIONINFO32W;
DECL_WINELIB_TYPE_AW(OSVERSIONINFO);
DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1

View File

@ -31,11 +31,13 @@ typedef BOOL32 HANDLER_ROUTINE(WORD);
#define BACKGROUND_RED 0x0040 /* background color contains red. */
#define BACKGROUND_INTENSITY 0x0080 /* background color is intensified. */
/*
typedef struct tagCOORD
{
INT16 x;
INT16 y;
} COORD,*LPCOORD;
*/
typedef struct tagSMALL_RECT
{

View File

@ -24,8 +24,8 @@ typedef struct
INT32 cy;
} SIZE32, *LPSIZE32;
DECL_WINELIB_TYPE(SIZE);
DECL_WINELIB_TYPE(LPSIZE);
DECL_WINELIB_TYPE(SIZE)
DECL_WINELIB_TYPE(LPSIZE)
#define CONV_SIZE16TO32(s16,s32) \
((s32)->cx = (INT32)(s16)->cx, (s32)->cy = (INT32)(s16)->cy)
@ -46,8 +46,8 @@ typedef struct
INT32 y;
} POINT32, *LPPOINT32;
DECL_WINELIB_TYPE(POINT);
DECL_WINELIB_TYPE(LPPOINT);
DECL_WINELIB_TYPE(POINT)
DECL_WINELIB_TYPE(LPPOINT)
#define CONV_POINT16TO32(p16,p32) \
((p32)->x = (INT32)(p16)->x, (p32)->y = (INT32)(p16)->y)
@ -75,8 +75,8 @@ typedef struct
INT32 bottom;
} RECT32, *LPRECT32;
DECL_WINELIB_TYPE(RECT);
DECL_WINELIB_TYPE(LPRECT);
DECL_WINELIB_TYPE(RECT)
DECL_WINELIB_TYPE(LPRECT)
#define CONV_RECT16TO32(r16,r32) \
((r32)->left = (INT32)(r16)->left, (r32)->top = (INT32)(r16)->top, \
@ -85,6 +85,13 @@ DECL_WINELIB_TYPE(LPRECT);
((r16)->left = (INT16)(r32)->left, (r16)->top = (INT16)(r32)->top, \
(r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom)
typedef struct tagCOORD {
INT16 x;
INT16 y;
} COORD, *LPCOORD;
typedef struct
{
WORD wFirst;
@ -99,8 +106,8 @@ typedef struct
INT32 iKernAmount;
} KERNINGPAIR32, *LPKERNINGPAIR32;
DECL_WINELIB_TYPE(KERNINGPAIR);
DECL_WINELIB_TYPE(LPKERNINGPAIR);
DECL_WINELIB_TYPE(KERNINGPAIR)
DECL_WINELIB_TYPE(LPKERNINGPAIR)
typedef struct
{
@ -122,10 +129,39 @@ typedef struct
BYTE rgbReserved[32];
} PAINTSTRUCT32, *LPPAINTSTRUCT32;
DECL_WINELIB_TYPE(PAINTSTRUCT);
DECL_WINELIB_TYPE(LPPAINTSTRUCT);
DECL_WINELIB_TYPE(PAINTSTRUCT)
DECL_WINELIB_TYPE(LPPAINTSTRUCT)
typedef struct tagPIXELFORMATDESCRIPTOR {
WORD nSize;
WORD nVersion;
DWORD dwFlags;
BYTE iPixelType;
BYTE cColorBits;
BYTE cRedBits;
BYTE cRedShift;
BYTE cGreenBits;
BYTE cGreenShift;
BYTE cBlueBits;
BYTE cBlueShift;
BYTE cAlphaBits;
BYTE cAlphaShift;
BYTE cAccumBits;
BYTE cAccumRedBits;
BYTE cAccumGreenBits;
BYTE cAccumBlueBits;
BYTE cAccumAlphaBits;
BYTE cDepthBits;
BYTE cStencilBits;
BYTE cAuxBuffers;
BYTE iLayerType;
BYTE bReserved;
DWORD dwLayerMask;
DWORD dwVisibleMask;
DWORD dwDamageMask;
} PIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
/* Windows */
typedef struct
@ -176,8 +212,8 @@ typedef struct
DWORD dwExStyle;
} CREATESTRUCT32W, *LPCREATESTRUCT32W;
DECL_WINELIB_TYPE_AW(CREATESTRUCT);
DECL_WINELIB_TYPE_AW(LPCREATESTRUCT);
DECL_WINELIB_TYPE_AW(CREATESTRUCT)
DECL_WINELIB_TYPE_AW(LPCREATESTRUCT)
typedef struct
{
@ -191,8 +227,8 @@ typedef struct
UINT32 idFirstChild;
} CLIENTCREATESTRUCT32, *LPCLIENTCREATESTRUCT32;
DECL_WINELIB_TYPE(CLIENTCREATESTRUCT);
DECL_WINELIB_TYPE(LPCLIENTCREATESTRUCT);
DECL_WINELIB_TYPE(CLIENTCREATESTRUCT)
DECL_WINELIB_TYPE(LPCLIENTCREATESTRUCT)
typedef struct
{
@ -233,8 +269,8 @@ typedef struct
LPARAM lParam;
} MDICREATESTRUCT32W, *LPMDICREATESTRUCT32W;
DECL_WINELIB_TYPE_AW(MDICREATESTRUCT);
DECL_WINELIB_TYPE_AW(LPMDICREATESTRUCT);
DECL_WINELIB_TYPE_AW(MDICREATESTRUCT)
DECL_WINELIB_TYPE_AW(LPMDICREATESTRUCT)
#define MDITILE_VERTICAL 0x0000
#define MDITILE_HORIZONTAL 0x0001
@ -289,7 +325,7 @@ typedef struct
POINT32 ptMaxTrackSize;
} MINMAXINFO32;
DECL_WINELIB_TYPE(MINMAXINFO);
DECL_WINELIB_TYPE(MINMAXINFO)
/* RedrawWindow() flags */
#define RDW_INVALIDATE 0x0001
@ -334,7 +370,7 @@ typedef struct
UINT32 flags;
} WINDOWPOS32;
DECL_WINELIB_TYPE(WINDOWPOS);
DECL_WINELIB_TYPE(WINDOWPOS)
/* SetWindowPlacement() struct */
typedef struct
@ -357,8 +393,8 @@ typedef struct
RECT32 rcNormalPosition WINE_PACKED;
} WINDOWPLACEMENT32, *LPWINDOWPLACEMENT32;
DECL_WINELIB_TYPE(WINDOWPLACEMENT);
DECL_WINELIB_TYPE(LPWINDOWPLACEMENT);
DECL_WINELIB_TYPE(WINDOWPLACEMENT)
DECL_WINELIB_TYPE(LPWINDOWPLACEMENT)
/* WINDOWPLACEMENT flags */
#define WPF_SETMINPOSITION 0x0001
@ -388,8 +424,8 @@ typedef struct
WINDOWPOS32 *lppos;
} NCCALCSIZE_PARAMS32, *LPNCCALCSIZE_PARAMS32;
DECL_WINELIB_TYPE(NCCALCSIZE_PARAMS);
DECL_WINELIB_TYPE(LPNCCALCSIZE_PARAMS);
DECL_WINELIB_TYPE(NCCALCSIZE_PARAMS)
DECL_WINELIB_TYPE(LPNCCALCSIZE_PARAMS)
/* WM_NCCALCSIZE return flags */
#define WVR_ALIGNTOP 0x0010
@ -489,8 +525,8 @@ typedef struct
LPCWSTR lpszClassName;
} WNDCLASS32W, *LPWNDCLASS32W;
DECL_WINELIB_TYPE_AW(WNDCLASS);
DECL_WINELIB_TYPE_AW(LPWNDCLASS);
DECL_WINELIB_TYPE_AW(WNDCLASS)
DECL_WINELIB_TYPE_AW(LPWNDCLASS)
typedef struct
{
@ -540,8 +576,8 @@ typedef struct
HICON32 hIconSm;
} WNDCLASSEX32W, *LPWNDCLASSEX32W;
DECL_WINELIB_TYPE_AW(WNDCLASSEX);
DECL_WINELIB_TYPE_AW(LPWNDCLASSEX);
DECL_WINELIB_TYPE_AW(WNDCLASSEX)
DECL_WINELIB_TYPE_AW(LPWNDCLASSEX)
#define CS_VREDRAW 0x0001
#define CS_HREDRAW 0x0002
@ -645,8 +681,8 @@ typedef struct
HWND32 hwnd;
} EVENTMSG32, *LPEVENTMSG32;
DECL_WINELIB_TYPE(EVENTMSG);
DECL_WINELIB_TYPE(LPEVENTMSG);
DECL_WINELIB_TYPE(EVENTMSG)
DECL_WINELIB_TYPE(LPEVENTMSG)
/* Mouse hook structure */
@ -666,8 +702,8 @@ typedef struct
DWORD dwExtraInfo;
} MOUSEHOOKSTRUCT32, *LPMOUSEHOOKSTRUCT32;
DECL_WINELIB_TYPE(MOUSEHOOKSTRUCT);
DECL_WINELIB_TYPE(LPMOUSEHOOKSTRUCT);
DECL_WINELIB_TYPE(MOUSEHOOKSTRUCT)
DECL_WINELIB_TYPE(LPMOUSEHOOKSTRUCT)
/* Hardware hook structure */
@ -687,8 +723,8 @@ typedef struct
LPARAM lParam;
} HARDWAREHOOKSTRUCT32, *LPHARDWAREHOOKSTRUCT32;
DECL_WINELIB_TYPE(HARDWAREHOOKSTRUCT);
DECL_WINELIB_TYPE(LPHARDWAREHOOKSTRUCT);
DECL_WINELIB_TYPE(HARDWAREHOOKSTRUCT)
DECL_WINELIB_TYPE(LPHARDWAREHOOKSTRUCT)
/* CBT hook values */
#define HCBT_MOVESIZE 0
@ -722,8 +758,8 @@ typedef struct
HWND32 hwndInsertAfter;
} CBT_CREATEWND32W, *LPCBT_CREATEWND32W;
DECL_WINELIB_TYPE_AW(CBT_CREATEWND);
DECL_WINELIB_TYPE_AW(LPCBT_CREATEWND);
DECL_WINELIB_TYPE_AW(CBT_CREATEWND)
DECL_WINELIB_TYPE_AW(LPCBT_CREATEWND)
typedef struct
{
@ -737,8 +773,8 @@ typedef struct
HWND32 hWndActive;
} CBTACTIVATESTRUCT32, *LPCBTACTIVATESTRUCT32;
DECL_WINELIB_TYPE(CBTACTIVATESTRUCT);
DECL_WINELIB_TYPE(LPCBTACTIVATESTRUCT);
DECL_WINELIB_TYPE(CBTACTIVATESTRUCT)
DECL_WINELIB_TYPE(LPCBTACTIVATESTRUCT)
/* Shell hook values */
#define HSHELL_WINDOWCREATED 1
@ -765,8 +801,94 @@ typedef struct
INT32 code;
} DEBUGHOOKINFO32, *LPDEBUGHOOKINFO32;
DECL_WINELIB_TYPE(DEBUGHOOKINFO);
DECL_WINELIB_TYPE(LPDEBUGHOOKINFO);
DECL_WINELIB_TYPE(DEBUGHOOKINFO)
DECL_WINELIB_TYPE(LPDEBUGHOOKINFO)
typedef DWORD (CALLBACK *LPTHREAD_START_ROUTINE)(LPVOID);
/* This is also defined in winnt.h */
/* typedef struct _EXCEPTION_RECORD {
DWORD ExceptionCode;
DWORD ExceptionFlags;
struct _EXCEPTION_RECORD *ExceptionRecord;
LPVOID ExceptionAddress;
DWORD NumberParameters;
DWORD ExceptionInformation[15];
} EXCEPTION_RECORD; */
typedef struct _EXCEPTION_DEBUG_INFO {
/* EXCEPTION_RECORD ExceptionRecord; */
DWORD dwFirstChange;
} EXCEPTION_DEBUG_INFO;
typedef struct _CREATE_THREAD_DEBUG_INFO {
HANDLE32 hThread;
LPVOID lpThreadLocalBase;
LPTHREAD_START_ROUTINE lpStartAddress;
} CREATE_THREAD_DEBUG_INFO;
typedef struct _CREATE_PROCESS_DEBUG_INFO {
HANDLE32 hFile;
HANDLE32 hProcess;
HANDLE32 hThread;
LPVOID lpBaseOfImage;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
LPVOID lpThreadLocalBase;
LPTHREAD_START_ROUTINE lpStartAddress;
LPVOID lpImageName;
WORD fUnicode;
} CREATE_PROCESS_DEBUG_INFO;
typedef struct _EXIT_THREAD_DEBUG_INFO {
DWORD dwExitCode;
} EXIT_THREAD_DEBUG_INFO;
typedef struct _EXIT_PROCESS_DEBUG_INFO {
DWORD dwExitCode;
} EXIT_PROCESS_DEBUG_INFO;
typedef struct _LOAD_DLL_DEBUG_INFO {
HANDLE32 hFile;
LPVOID lpBaseOfDll;
DWORD dwDebugInfoFileOffset;
DWORD nDebugInfoSize;
LPVOID lpImageName;
WORD fUnicode;
} LOAD_DLL_DEBUG_INFO;
typedef struct _UNLOAD_DLL_DEBUG_INFO {
LPVOID lpBaseOfDll;
} UNLOAD_DLL_DEBUG_INFO;
typedef struct _OUTPUT_DEBUG_STRING_INFO {
LPSTR lpDebugStringData;
WORD fUnicode;
WORD nDebugStringLength;
} OUTPUT_DEBUG_STRING_INFO;
typedef struct _RIP_INFO {
DWORD dwError;
DWORD dwType;
} RIP_INFO;
typedef struct _DEBUG_EVENT {
DWORD dwDebugEventCode;
DWORD dwProcessId;
DWORD dwThreadId;
union {
EXCEPTION_DEBUG_INFO Exception;
CREATE_THREAD_DEBUG_INFO CreateThread;
CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
EXIT_THREAD_DEBUG_INFO ExitThread;
EXIT_PROCESS_DEBUG_INFO ExitProcess;
LOAD_DLL_DEBUG_INFO LoadDll;
UNLOAD_DLL_DEBUG_INFO UnloadDll;
OUTPUT_DEBUG_STRING_INFO DebugString;
RIP_INFO RipInfo;
} u;
} DEBUG_EVENT, *LPDEBUG_EVENT;
/***** Dialogs *****/
@ -841,8 +963,8 @@ typedef struct
POINT32 pt;
} MSG32, *LPMSG32;
DECL_WINELIB_TYPE(MSG);
DECL_WINELIB_TYPE(LPMSG);
DECL_WINELIB_TYPE(MSG)
DECL_WINELIB_TYPE(LPMSG)
/* Raster operations */
@ -966,8 +1088,8 @@ typedef struct
LPVOID bmBits WINE_PACKED;
} BITMAP32, *LPBITMAP32;
DECL_WINELIB_TYPE(BITMAP);
DECL_WINELIB_TYPE(LPBITMAP);
DECL_WINELIB_TYPE(BITMAP)
DECL_WINELIB_TYPE(LPBITMAP)
/* Brushes */
@ -985,8 +1107,8 @@ typedef struct
INT32 lbHatch;
} LOGBRUSH32, *LPLOGBRUSH32;
DECL_WINELIB_TYPE(LOGBRUSH);
DECL_WINELIB_TYPE(LPLOGBRUSH);
DECL_WINELIB_TYPE(LOGBRUSH)
DECL_WINELIB_TYPE(LPLOGBRUSH)
/* Brush styles */
#define BS_SOLID 0
@ -1072,8 +1194,8 @@ typedef struct
WCHAR lfFaceName[LF_FACESIZE];
} LOGFONT32W, *LPLOGFONT32W;
DECL_WINELIB_TYPE_AW(LOGFONT);
DECL_WINELIB_TYPE_AW(LPLOGFONT);
DECL_WINELIB_TYPE_AW(LOGFONT)
DECL_WINELIB_TYPE_AW(LPLOGFONT)
typedef struct
{
@ -1120,9 +1242,9 @@ typedef struct
WCHAR elfScript[LF_FACESIZE] WINE_PACKED;
} ENUMLOGFONTEX32W,*LPENUMLOGFONTEX32W;
DECL_WINELIB_TYPE_AW(ENUMLOGFONT);
DECL_WINELIB_TYPE_AW(LPENUMLOGFONT);
DECL_WINELIB_TYPE_AW(LPENUMLOGFONTEX);
DECL_WINELIB_TYPE_AW(ENUMLOGFONT)
DECL_WINELIB_TYPE_AW(LPENUMLOGFONT)
DECL_WINELIB_TYPE_AW(LPENUMLOGFONTEX)
typedef struct
{
@ -1341,8 +1463,8 @@ typedef struct
BYTE tmCharSet;
} TEXTMETRIC32W, *LPTEXTMETRIC32W;
DECL_WINELIB_TYPE_AW(TEXTMETRIC);
DECL_WINELIB_TYPE_AW(LPTEXTMETRIC);
DECL_WINELIB_TYPE_AW(TEXTMETRIC)
DECL_WINELIB_TYPE_AW(LPTEXTMETRIC)
/* ntmFlags field flags */
#define NTM_REGULAR 0x00000040L
@ -1433,8 +1555,8 @@ typedef struct
UINT32 ntmAvgWidth;
} NEWTEXTMETRIC32W, *LPNEWTEXTMETRIC32W;
DECL_WINELIB_TYPE_AW(NEWTEXTMETRIC);
DECL_WINELIB_TYPE_AW(LPNEWTEXTMETRIC);
DECL_WINELIB_TYPE_AW(NEWTEXTMETRIC)
DECL_WINELIB_TYPE_AW(LPNEWTEXTMETRIC)
typedef struct
{
@ -1454,8 +1576,8 @@ typedef struct
FONTSIGNATURE ntmeFontSignature;
} NEWTEXTMETRICEX32W,*LPNEWTEXTMETRICEX32W;
DECL_WINELIB_TYPE_AW(NEWTEXTMETRICEX);
DECL_WINELIB_TYPE_AW(LPNEWTEXTMETRICEX);
DECL_WINELIB_TYPE_AW(NEWTEXTMETRICEX)
DECL_WINELIB_TYPE_AW(LPNEWTEXTMETRICEX)
typedef INT16 (CALLBACK *FONTENUMPROC16)(SEGPTR,SEGPTR,UINT16,LPARAM);
@ -1463,12 +1585,12 @@ typedef INT32 (CALLBACK *FONTENUMPROC32A)(LPENUMLOGFONT32A,LPNEWTEXTMETRIC32A,
UINT32,LPARAM);
typedef INT32 (CALLBACK *FONTENUMPROC32W)(LPENUMLOGFONT32W,LPNEWTEXTMETRIC32W,
UINT32,LPARAM);
DECL_WINELIB_TYPE_AW(FONTENUMPROC);
DECL_WINELIB_TYPE_AW(FONTENUMPROC)
typedef INT16 (CALLBACK *FONTENUMPROCEX16)(SEGPTR,SEGPTR,UINT16,LPARAM);
typedef INT32 (CALLBACK *FONTENUMPROCEX32A)(LPENUMLOGFONTEX32A,LPNEWTEXTMETRICEX32A,UINT32,LPARAM);
typedef INT32 (CALLBACK *FONTENUMPROCEX32W)(LPENUMLOGFONTEX32W,LPNEWTEXTMETRICEX32W,UINT32,LPARAM);
DECL_WINELIB_TYPE_AW(FONTENUMPROCEX);
DECL_WINELIB_TYPE_AW(FONTENUMPROCEX)
/* tmPitchAndFamily bits */
#define TMPF_FIXED_PITCH 1 /* means variable pitch */
@ -1509,8 +1631,8 @@ typedef struct
INT16 gmCellIncY;
} GLYPHMETRICS32, *LPGLYPHMETRICS32;
DECL_WINELIB_TYPE(GLYPHMETRICS);
DECL_WINELIB_TYPE(LPGLYPHMETRICS);
DECL_WINELIB_TYPE(GLYPHMETRICS)
DECL_WINELIB_TYPE(LPGLYPHMETRICS)
#define GGO_METRICS 0
#define GGO_BITMAP 1
@ -1545,8 +1667,8 @@ typedef struct
INT32 abcC;
} ABC32, *LPABC32;
DECL_WINELIB_TYPE(ABC);
DECL_WINELIB_TYPE(LPABC);
DECL_WINELIB_TYPE(ABC)
DECL_WINELIB_TYPE(LPABC)
/* Rasterizer status */
typedef struct
@ -1596,8 +1718,8 @@ typedef struct
COLORREF lopnColor WINE_PACKED;
} LOGPEN32, *LPLOGPEN32;
DECL_WINELIB_TYPE(LOGPEN);
DECL_WINELIB_TYPE(LPLOGPEN);
DECL_WINELIB_TYPE(LOGPEN)
DECL_WINELIB_TYPE(LPLOGPEN)
#define PS_SOLID 0x00000000
#define PS_DASH 0x00000001
@ -2000,11 +2122,10 @@ typedef struct
BYTE pad0;
WORD key;
WORD cmd;
WORD pad1;
} ACCEL32, *LPACCEL32;
DECL_WINELIB_TYPE(ACCEL);
DECL_WINELIB_TYPE(LPACCEL);
DECL_WINELIB_TYPE(ACCEL)
DECL_WINELIB_TYPE(LPACCEL)
/* modifiers for RegisterHotKey */
#define MOD_ALT 0x0001
@ -2100,6 +2221,9 @@ typedef struct
BOOL32 bInheritHandle;
} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef DWORD SECURITY_INFORMATION;
/* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
typedef struct
{
@ -2136,8 +2260,8 @@ typedef struct
WCHAR cAlternateFileName[14];
} WIN32_FIND_DATA32W, *LPWIN32_FIND_DATA32W;
DECL_WINELIB_TYPE_AW(WIN32_FIND_DATA);
DECL_WINELIB_TYPE_AW(LPWIN32_FIND_DATA);
DECL_WINELIB_TYPE_AW(WIN32_FIND_DATA)
DECL_WINELIB_TYPE_AW(LPWIN32_FIND_DATA)
#define INVALID_HANDLE_VALUE16 ((HANDLE16) -1)
#define INVALID_HANDLE_VALUE32 ((HANDLE32) -1)
@ -2302,8 +2426,8 @@ typedef struct tagDCB32
char EvtChar;
} DCB32, *LPDCB32;
DECL_WINELIB_TYPE(DCB);
DECL_WINELIB_TYPE(LPDCB);
DECL_WINELIB_TYPE(DCB)
DECL_WINELIB_TYPE(LPDCB)
#define RTS_CONTROL_DISABLE 0
#define RTS_CONTROL_ENABLE 1
@ -3164,8 +3288,8 @@ typedef struct {
UINT32 cch;
} MENUITEMINFO32W, *LPMENUITEMINFO32W;
DECL_WINELIB_TYPE_AW(MENUITEMINFO);
DECL_WINELIB_TYPE_AW(LPMENUITEMINFO);
DECL_WINELIB_TYPE_AW(MENUITEMINFO)
DECL_WINELIB_TYPE_AW(LPMENUITEMINFO)
/* Field specifiers for MENUITEMINFO[AW] type. */
#define MIIM_STATE 0x00000001
@ -3323,7 +3447,7 @@ DECL_WINELIB_TYPE_AW(LPMENUITEMINFO);
/* DrawState defines ... */
typedef BOOL16 (CALLBACK *DRAWSTATEPROC16)(HDC16,LPARAM,WPARAM16,INT16,INT16);
typedef BOOL32 (CALLBACK *DRAWSTATEPROC32)(HDC32,LPARAM,WPARAM32,INT32,INT32);
DECL_WINELIB_TYPE(DRAWSTATEPROC);
DECL_WINELIB_TYPE(DRAWSTATEPROC)
/* Image type */
#define DST_COMPLEX 0x0000
@ -4069,9 +4193,9 @@ typedef struct
DWORD itemData WINE_PACKED;
} DRAWITEMSTRUCT32, *PDRAWITEMSTRUCT32, *LPDRAWITEMSTRUCT32;
DECL_WINELIB_TYPE(DRAWITEMSTRUCT);
DECL_WINELIB_TYPE(PDRAWITEMSTRUCT);
DECL_WINELIB_TYPE(LPDRAWITEMSTRUCT);
DECL_WINELIB_TYPE(DRAWITEMSTRUCT)
DECL_WINELIB_TYPE(PDRAWITEMSTRUCT)
DECL_WINELIB_TYPE(LPDRAWITEMSTRUCT)
typedef struct
{
@ -4093,9 +4217,9 @@ typedef struct
DWORD itemData;
} MEASUREITEMSTRUCT32, *PMEASUREITEMSTRUCT32, *LPMEASUREITEMSTRUCT32;
DECL_WINELIB_TYPE(MEASUREITEMSTRUCT);
DECL_WINELIB_TYPE(PMEASUREITEMSTRUCT);
DECL_WINELIB_TYPE(LPMEASUREITEMSTRUCT);
DECL_WINELIB_TYPE(MEASUREITEMSTRUCT)
DECL_WINELIB_TYPE(PMEASUREITEMSTRUCT)
DECL_WINELIB_TYPE(LPMEASUREITEMSTRUCT)
typedef struct
{
@ -4115,8 +4239,8 @@ typedef struct
DWORD itemData;
} DELETEITEMSTRUCT32, *LPDELETEITEMSTRUCT32;
DECL_WINELIB_TYPE(DELETEITEMSTRUCT);
DECL_WINELIB_TYPE(LPDELETEITEMSTRUCT);
DECL_WINELIB_TYPE(DELETEITEMSTRUCT)
DECL_WINELIB_TYPE(LPDELETEITEMSTRUCT)
typedef struct
{
@ -4141,8 +4265,8 @@ typedef struct
DWORD dwLocaleId;
} COMPAREITEMSTRUCT32, *LPCOMPAREITEMSTRUCT32;
DECL_WINELIB_TYPE(COMPAREITEMSTRUCT);
DECL_WINELIB_TYPE(LPCOMPAREITEMSTRUCT);
DECL_WINELIB_TYPE(COMPAREITEMSTRUCT)
DECL_WINELIB_TYPE(LPCOMPAREITEMSTRUCT)
/* WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags */
#define KF_EXTENDED 0x0100
@ -4431,8 +4555,8 @@ typedef struct
HGDIOBJ32 objectHandle[1];
} HANDLETABLE32, *LPHANDLETABLE32;
DECL_WINELIB_TYPE(HANDLETABLE);
DECL_WINELIB_TYPE(LPHANDLETABLE);
DECL_WINELIB_TYPE(HANDLETABLE)
DECL_WINELIB_TYPE(LPHANDLETABLE)
/* Clipboard metafile picture structure */
typedef struct
@ -4451,8 +4575,8 @@ typedef struct
HMETAFILE32 hMF;
} METAFILEPICT32, *LPMETAFILEPICT32;
DECL_WINELIB_TYPE(METAFILEPICT);
DECL_WINELIB_TYPE(LPMETAFILEPICT);
DECL_WINELIB_TYPE(METAFILEPICT)
DECL_WINELIB_TYPE(LPMETAFILEPICT)
/* Metafile functions */
#define META_SETBKCOLOR 0x0201
@ -4539,7 +4663,7 @@ typedef INT16 (CALLBACK *MFENUMPROC16)(HDC16,HANDLETABLE16*,METARECORD*,
INT16,LPARAM);
typedef INT32 (CALLBACK *MFENUMPROC32)(HDC32,HANDLETABLE32*,METARECORD*,
INT32,LPARAM);
DECL_WINELIB_TYPE(MFENUMPROC);
DECL_WINELIB_TYPE(MFENUMPROC)
/* enhanced metafile structures and functions */
@ -4916,8 +5040,8 @@ typedef struct {
HANDLE32 hStdError;
} STARTUPINFO32W, *LPSTARTUPINFO32W;
DECL_WINELIB_TYPE_AW(STARTUPINFO);
DECL_WINELIB_TYPE_AW(LPSTARTUPINFO);
DECL_WINELIB_TYPE_AW(STARTUPINFO)
DECL_WINELIB_TYPE_AW(LPSTARTUPINFO)
typedef struct {
HANDLE32 hProcess;
@ -5172,8 +5296,8 @@ typedef struct
DWORD dmReserved2;
} DEVMODE32W, *LPDEVMODE32W;
DECL_WINELIB_TYPE_AW(DEVMODE);
DECL_WINELIB_TYPE_AW(LPDEVMODE);
DECL_WINELIB_TYPE_AW(DEVMODE)
DECL_WINELIB_TYPE_AW(LPDEVMODE)
typedef struct _PRINTER_DEFAULTS32A {
LPSTR pDatatype;
@ -5187,8 +5311,8 @@ typedef struct _PRINTER_DEFAULTS32W {
ACCESS_MASK DesiredAccess;
} PRINTER_DEFAULTS32W, *LPPRINTER_DEFAULTS32W;
DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS);
DECL_WINELIB_TYPE_AW(LPPRINTER_DEFAULTS);
DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS)
DECL_WINELIB_TYPE_AW(LPPRINTER_DEFAULTS)
typedef struct _SYSTEM_POWER_STATUS
{
@ -5267,14 +5391,13 @@ typedef struct _MEMORY_BASIC_INFORMATION
DWORD Type;
} MEMORY_BASIC_INFORMATION,*LPMEMORY_BASIC_INFORMATION;
typedef DWORD (CALLBACK *LPTHREAD_START_ROUTINE)(LPVOID);
typedef BOOL32 (CALLBACK *CODEPAGE_ENUMPROC32A)(LPSTR);
typedef BOOL32 (CALLBACK *CODEPAGE_ENUMPROC32W)(LPWSTR);
DECL_WINELIB_TYPE_AW(CODEPAGE_ENUMPROC);
DECL_WINELIB_TYPE_AW(CODEPAGE_ENUMPROC)
typedef BOOL32 (CALLBACK *LOCALE_ENUMPROC32A)(LPSTR);
typedef BOOL32 (CALLBACK *LOCALE_ENUMPROC32W)(LPWSTR);
DECL_WINELIB_TYPE_AW(LOCALE_ENUMPROC);
DECL_WINELIB_TYPE_AW(LOCALE_ENUMPROC)
typedef struct tagSYSTEM_INFO
{
@ -5313,7 +5436,7 @@ typedef struct tagSYSTEM_INFO
/* service main function prototype */
typedef VOID (CALLBACK *LPSERVICE_MAIN_FUNCTION32A)(DWORD,LPSTR);
typedef VOID (CALLBACK *LPSERVICE_MAIN_FUNCTION32W)(DWORD,LPWSTR);
DECL_WINELIB_TYPE_AW(LPSERVICE_MAIN_FUNCTION);
DECL_WINELIB_TYPE_AW(LPSERVICE_MAIN_FUNCTION)
/* service start table */
typedef struct
@ -5328,8 +5451,20 @@ typedef struct
LPSERVICE_MAIN_FUNCTION32W lpServiceProc;
} *LPSERVICE_TABLE_ENTRY32W, SERVICE_TABLE_ENTRY32W;
DECL_WINELIB_TYPE_AW(SERVICE_TABLE_ENTRY);
DECL_WINELIB_TYPE_AW(LPSERVICE_TABLE_ENTRY);
DECL_WINELIB_TYPE_AW(SERVICE_TABLE_ENTRY)
DECL_WINELIB_TYPE_AW(LPSERVICE_TABLE_ENTRY)
/* Used by: ControlService */
typedef struct _SERVICE_STATUS {
DWORD dwServiceType;
DWORD dwCurrentState;
DWORD dwControlsAccepted;
DWORD dwWin32ExitCode;
DWORD dwServiceSpecificExitCode;
DWORD dwCheckPoint;
DWORD dwWaitHint;
} SERVICE_STATUS, *LPSERVICE_STATUS;
/* {G,S}etPriorityClass */
#define NORMAL_PRIORITY_CLASS 0x00000020
@ -5440,9 +5575,9 @@ typedef BOOL32 (CALLBACK *ENUMRESNAMEPROC32W)(HMODULE32,LPCWSTR,LPWSTR,LONG);
typedef BOOL32 (CALLBACK *ENUMRESLANGPROC32A)(HMODULE32,LPCSTR,LPCSTR,WORD,LONG);
typedef BOOL32 (CALLBACK *ENUMRESLANGPROC32W)(HMODULE32,LPCWSTR,LPCWSTR,WORD,LONG);
DECL_WINELIB_TYPE_AW(ENUMRESTYPEPROC);
DECL_WINELIB_TYPE_AW(ENUMRESNAMEPROC);
DECL_WINELIB_TYPE_AW(ENUMRESLANGPROC);
DECL_WINELIB_TYPE_AW(ENUMRESTYPEPROC)
DECL_WINELIB_TYPE_AW(ENUMRESNAMEPROC)
DECL_WINELIB_TYPE_AW(ENUMRESLANGPROC)
/* Character Type Flags */
#define CT_CTYPE1 0x00000001 /* usual ctype */
@ -5519,8 +5654,8 @@ typedef struct
DWORD fwType;
} DOCINFO32W, *LPDOCINFO32W;
DECL_WINELIB_TYPE_AW(DOCINFO);
DECL_WINELIB_TYPE_AW(LPDOCINFO);
DECL_WINELIB_TYPE_AW(DOCINFO)
DECL_WINELIB_TYPE_AW(LPDOCINFO)
typedef struct {
DWORD dwScope;
@ -5544,8 +5679,8 @@ typedef struct {
LPWSTR lpProvider;
} NETRESOURCE32W,*LPNETRESOURCE32W;
DECL_WINELIB_TYPE_AW(NETRESOURCE);
DECL_WINELIB_TYPE_AW(LPNETRESOURCE);
DECL_WINELIB_TYPE_AW(NETRESOURCE)
DECL_WINELIB_TYPE_AW(LPNETRESOURCE)
typedef struct {
DWORD cbStructure;
@ -5609,8 +5744,8 @@ typedef struct {
LOGFONT32W lfMessageFont;
} NONCLIENTMETRICS32W,*LPNONCLIENTMETRICS32W;
DECL_WINELIB_TYPE_AW(NONCLIENTMETRICS);
DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS);
DECL_WINELIB_TYPE_AW(NONCLIENTMETRICS)
DECL_WINELIB_TYPE_AW(LPNONCLIENTMETRICS)
typedef struct tagANIMATIONINFO
{
@ -5731,8 +5866,8 @@ typedef struct
DWORD dwLanguageId;
} MSGBOXPARAMS32W,*LPMSGBOXPARAMS32W;
DECL_WINELIB_TYPE_AW(MSGBOXPARAMS);
DECL_WINELIB_TYPE_AW(LPMSGBOXPARAMS);
DECL_WINELIB_TYPE_AW(MSGBOXPARAMS)
DECL_WINELIB_TYPE_AW(LPMSGBOXPARAMS)
/* for WOWHandle{16,32} */
typedef enum _WOW_HANDLE_TYPE { /* WOW */
@ -5759,13 +5894,35 @@ typedef enum _WOW_HANDLE_TYPE { /* WOW */
#define WCB16_PASCAL 0x0
#define WCB16_CDECL 0x1
typedef struct _numberfmt32a {
UINT32 NumDigits;
UINT32 LeadingZero;
UINT32 Grouping;
LPCSTR lpDecimalSep;
LPCSTR lpThousandSep;
UINT32 NegativeOrder;
} NUMBERFMT32A;
typedef struct _numberfmt32w {
UINT32 NumDigits;
UINT32 LeadingZero;
UINT32 Grouping;
LPCWSTR lpDecimalSep;
LPCWSTR lpThousandSep;
UINT32 NegativeOrder;
} NUMBERFMT32W;
#pragma pack(4)
/* Declarations for functions that exist only in Win16 */
#ifndef WINELIB
#ifdef __WINE__
WORD WINAPI AllocCStoDSAlias(WORD);
WORD WINAPI AllocDStoCSAlias(WORD);
HGLOBAL16 WINAPI AllocResource(HINSTANCE16,HRSRC16,DWORD);
WORD WINAPI AllocSelector(WORD);
WORD WINAPI AllocSelectorArray(WORD);
VOID WINAPI CalcChildScroll(HWND16,WORD);
@ -5916,7 +6073,7 @@ BOOL16 WINAPI WaitEvent(HTASK16);
INT16 WINAPI WriteComm(INT16,LPSTR,INT16);
VOID WINAPI WriteOutProfiles(VOID);
VOID WINAPI hmemcpy(LPVOID,LPCVOID,LONG);
#endif /* WINELIB */
#endif /* __WINE__ */
/* Declarations for functions that exist only in Win32 */
@ -5925,15 +6082,18 @@ BOOL32 WINAPI AreFileApisANSI(void);
BOOL32 WINAPI Beep(DWORD,DWORD);
BOOL32 WINAPI ClearCommError(INT32,LPDWORD,LPCOMSTAT);
BOOL32 WINAPI CloseHandle(HANDLE32);
BOOL32 WINAPI CloseServiceHandle(HANDLE32);
INT32 WINAPI CopyAcceleratorTable32A(HACCEL32,LPACCEL32,INT32);
INT32 WINAPI CopyAcceleratorTable32W(HACCEL32,LPACCEL32,INT32);
#define CopyAcceleratorTable WINELIB_NAME_AW(CopyAcceleratorTable)
HENHMETAFILE32 WINAPI CopyEnhMetaFile32A(HENHMETAFILE32,LPCSTR);
HENHMETAFILE32 WINAPI CopyEnhMetaFile32W(HENHMETAFILE32,LPCWSTR);
#define CopyEnhMetaFile WINELIB_NAME_AW(CopyEnhMetaFile)
BOOL32 WINAPI CopyFile32A(LPCSTR,LPCSTR,BOOL32);
BOOL32 WINAPI CopyFile32W(LPCWSTR,LPCWSTR,BOOL32);
#define CopyFile WINELIB_NAME_AW(CopyFile)
INT32 WINAPI CompareFileTime(LPFILETIME,LPFILETIME);
BOOL32 WINAPI ControlService(HANDLE32,DWORD,LPSERVICE_STATUS);
HANDLE32 WINAPI CreateEvent32A(LPSECURITY_ATTRIBUTES,BOOL32,BOOL32,LPCSTR);
HANDLE32 WINAPI CreateEvent32W(LPSECURITY_ATTRIBUTES,BOOL32,BOOL32,LPCWSTR);
#define CreateEvent WINELIB_NAME_AW(CreateEvent)
@ -5957,6 +6117,8 @@ HANDLE32 WINAPI CreateSemaphore32W(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
#define CreateSemaphore WINELIB_NAME_AW(CreateSemaphore)
HANDLE32 WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
BOOL32 WINAPI DeleteEnhMetaFile(HENHMETAFILE32);
BOOL32 WINAPI DeleteService(HANDLE32);
BOOL32 WINAPI DeregisterEventSource(HANDLE32);
BOOL32 WINAPI DestroyAcceleratorTable(HACCEL32);
BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32);
BOOL32 WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
@ -5994,8 +6156,8 @@ HRGN32 WINAPI ExtCreateRegion(LPXFORM,DWORD,LPRGNDATA);
BOOL32 WINAPI FileTimeToDosDateTime(const FILETIME*,LPWORD,LPWORD);
BOOL32 WINAPI FileTimeToLocalFileTime(const FILETIME*,LPFILETIME);
BOOL32 WINAPI FileTimeToSystemTime(const FILETIME*,LPSYSTEMTIME);
HRSRC32 WINAPI FindResourceEx32A(HINSTANCE32,LPCSTR,LPCSTR,WORD);
HRSRC32 WINAPI FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
HRSRC32 WINAPI FindResourceEx32A(HMODULE32,LPCSTR,LPCSTR,WORD);
HRSRC32 WINAPI FindResourceEx32W(HMODULE32,LPCWSTR,LPCWSTR,WORD);
#define FindResourceEx WINELIB_NAME_AW(FindResourceEx)
BOOL32 WINAPI FlushConsoleInputBuffer(HANDLE32);
BOOL32 WINAPI FlushFileBuffers(HFILE32);
@ -6033,6 +6195,7 @@ BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32);
HENHMETAFILE32 WINAPI GetEnhMetaFile32A(LPCSTR);
HENHMETAFILE32 WINAPI GetEnhMetaFile32W(LPCWSTR);
#define GetEnhMetaFile WINELIB_NAME_AW(GetEnhMetaFile)
UINT32 WINAPI GetEnhMetaFileBits(HENHMETAFILE32,UINT32,LPBYTE);
UINT32 WINAPI GetEnhMetaFileHeader(HENHMETAFILE32,UINT32,LPENHMETAHEADER);
LPSTR WINAPI GetEnvironmentStrings32A(void);
LPWSTR WINAPI GetEnvironmentStrings32W(void);
@ -6055,6 +6218,7 @@ DWORD WINAPI GetLogicalDrives(void);
BOOL32 WINAPI GetMenuItemInfo32A(HMENU32,UINT32,BOOL32,MENUITEMINFO32A*);
BOOL32 WINAPI GetMenuItemInfo32W(HMENU32,UINT32,BOOL32,MENUITEMINFO32W*);
#define GetMenuItemInfo WINELIB_NAME_AW(GetMenuItemInfo)
UINT32 WINAPI GetMetaFileBitsEx(HMETAFILE32,UINT32,LPVOID);
BOOL32 WINAPI GetNumberOfConsoleInputEvents(HANDLE32,LPDWORD);
BOOL32 WINAPI GetNumberOfConsoleMouseButtons(LPDWORD);
DWORD WINAPI GetObjectType(HANDLE32);
@ -6112,6 +6276,9 @@ BOOL32 WINAPI IsWindowUnicode(HWND32);
BOOL32 WINAPI IsValidLocale(DWORD,DWORD);
BOOL32 WINAPI LocalFileTimeToFileTime(const FILETIME*,LPFILETIME);
BOOL32 WINAPI LockFile(HFILE32,DWORD,DWORD,DWORD,DWORD);
BOOL32 WINAPI LookupPrivilegeValue32A(LPCSTR,LPCSTR,LPVOID);
BOOL32 WINAPI LookupPrivilegeValue32W(LPCWSTR,LPCWSTR,LPVOID);
#define LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue)
SEGPTR WINAPI MapLS(LPVOID);
LPVOID WINAPI MapSL(SEGPTR);
LPVOID WINAPI MapViewOfFile(HANDLE32,DWORD,DWORD,DWORD,DWORD);
@ -6138,9 +6305,16 @@ HANDLE32 WINAPI OpenMutex32A(DWORD,BOOL32,LPCSTR);
HANDLE32 WINAPI OpenMutex32W(DWORD,BOOL32,LPCWSTR);
#define OpenMutex WINELIB_NAME_AW(OpenMutex)
HANDLE32 WINAPI OpenProcess(DWORD,BOOL32,DWORD);
BOOL32 WINAPI OpenProcessToken(HANDLE32,DWORD,HANDLE32*);
HANDLE32 WINAPI OpenSCManager32A(LPCSTR,LPCSTR,DWORD);
HANDLE32 WINAPI OpenSCManager32W(LPCWSTR,LPCWSTR,DWORD);
#define OpenSCManager WINELIB_NAME_AW(OpenSCManager)
HANDLE32 WINAPI OpenSemaphore32A(DWORD,BOOL32,LPCSTR);
HANDLE32 WINAPI OpenSemaphore32W(DWORD,BOOL32,LPCWSTR);
#define OpenSemaphore WINELIB_NAME_AW(OpenSemaphore)
HANDLE32 WINAPI OpenService32A(HANDLE32,LPCSTR,DWORD);
HANDLE32 WINAPI OpenService32W(HANDLE32,LPCWSTR,DWORD);
#define OpenService WINELIB_NAME_AW(OpenService)
BOOL32 WINAPI PlayEnhMetaFile(HDC32,HENHMETAFILE32,const RECT32*);
BOOL32 WINAPI PlayEnhMetaFileRecord(HDC32,LPHANDLETABLE32,const ENHMETARECORD*,UINT32);
BOOL32 WINAPI PulseEvent(HANDLE32);
@ -6162,6 +6336,10 @@ DWORD WINAPI RegEnumKeyEx32A(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPSTR,
DWORD WINAPI RegEnumKeyEx32W(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPWSTR,
LPDWORD,LPFILETIME);
#define RegEnumKeyEx WINELIB_NAME_AW(RegEnumKeyEx)
LONG WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,LPVOID,LPDWORD);
HANDLE32 WINAPI RegisterEventSource32A(LPCSTR,LPCSTR);
HANDLE32 WINAPI RegisterEventSource32W(LPCWSTR,LPCWSTR);
#define RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
DWORD WINAPI RegOpenKeyEx32W(HKEY,LPCWSTR,DWORD,REGSAM,LPHKEY);
DWORD WINAPI RegOpenKeyEx32A(HKEY,LPCSTR,DWORD,REGSAM,LPHKEY);
#define RegOpenKeyEx WINELIB_NAME_AW(RegOpenKeyEx)
@ -6183,11 +6361,17 @@ DWORD WINAPI SearchPath32W(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
BOOL32 WINAPI SetBrushOrgEx(HDC32,INT32,INT32,LPPOINT32);
BOOL32 WINAPI SetCommMask(INT32,DWORD);
BOOL32 WINAPI SetCommTimeouts(INT32,LPCOMMTIMEOUTS);
BOOL32 WINAPI SetComputerName32A(LPCSTR);
BOOL32 WINAPI SetComputerName32W(LPCWSTR);
#define SetComputerName WINELIB_NAME_AW(SetComputerName)
BOOL32 WINAPI SetConsoleCursorPosition(HANDLE32,COORD);
BOOL32 WINAPI SetConsoleMode(HANDLE32,DWORD);
BOOL32 WINAPI SetConsoleTitle32A(LPCSTR);
BOOL32 WINAPI SetConsoleTitle32W(LPCWSTR);
#define SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle)
VOID WINAPI SetDebugErrorLevel(DWORD);
BOOL32 WINAPI SetEndOfFile(HFILE32);
HENHMETAFILE32 WINAPI SetEnhMetaFileBits(UINT32,const BYTE *);
BOOL32 WINAPI SetEnvironmentVariable32A(LPCSTR,LPCSTR);
BOOL32 WINAPI SetEnvironmentVariable32W(LPCWSTR,LPCWSTR);
#define SetEnvironmentVariable WINELIB_NAME_AW(SetEnvironmentVariable)
@ -6213,6 +6397,9 @@ BOOL32 WINAPI SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION);
BOOL32 WINAPI SetWindowContextHelpId(HWND32,DWORD);
BOOL32 WINAPI SetWorldTransform(HDC32,const XFORM*);
VOID WINAPI Sleep(DWORD);
BOOL32 WINAPI StartService32A(HANDLE32,DWORD,LPCSTR*);
BOOL32 WINAPI StartService32W(HANDLE32,DWORD,LPCWSTR*);
#define StartService WINELIB_NAME_AW(StartService)
BOOL32 WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
BOOL32 WINAPI TrackPopupMenuEx(HMENU32,UINT32,INT32,INT32,HWND32,
LPTPMPARAMS);
@ -6231,10 +6418,18 @@ BOOL32 WINAPI VirtualProtectEx(HANDLE32,LPVOID,DWORD,DWORD,LPDWORD);
DWORD WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
DWORD WINAPI VirtualQueryEx(HANDLE32,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
BOOL32 WINAPI VirtualUnlock(LPVOID,DWORD);
BOOL32 WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
DWORD WINAPI WaitForInputIdle(HANDLE32,DWORD);
DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE32*,BOOL32,DWORD);
DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE32*,BOOL32,DWORD,BOOL32);
DWORD WINAPI WaitForSingleObject(HANDLE32,DWORD);
DWORD WINAPI WaitForSingleObjectEx(HANDLE32,DWORD,BOOL32);
UINT32 WINAPI WNetAddConnection2_32A(LPNETRESOURCE32A,LPCSTR,LPCSTR,DWORD);
UINT32 WINAPI WNetAddConnection2_32W(LPNETRESOURCE32W,LPCWSTR,LPCWSTR,DWORD);
#define WNetAddConnection2 WINELIB_NAME_AW(WNetAddConnection2_)
UINT32 WINAPI WNetAddConnection3_32A(HWND32,LPNETRESOURCE32A,LPCSTR,LPCSTR,DWORD);
UINT32 WINAPI WNetAddConnection3_32W(HWND32,LPNETRESOURCE32W,LPCWSTR,LPCWSTR,DWORD);
#define WNetAddConnection3 WINELIB_NAME_AW(WNetAddConnection3_)
SEGPTR WINAPI WOWGlobalAllocLock16(DWORD,DWORD,HGLOBAL16*);
DWORD WINAPI WOWCallback16(FARPROC16,DWORD);
BOOL32 WINAPI WOWCallback16Ex(FARPROC16,DWORD,DWORD,LPVOID,LPDWORD);
@ -6283,7 +6478,7 @@ LRESULT WINAPI AboutDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
LRESULT WINAPI AboutDlgProc32(HWND32,UINT32,WPARAM32,LPARAM);
#define AboutDlgProc WINELIB_NAME(AboutDlgProc)
INT16 WINAPI AccessResource16(HINSTANCE16,HRSRC16);
INT32 WINAPI AccessResource32(HINSTANCE32,HRSRC32);
INT32 WINAPI AccessResource32(HMODULE32,HRSRC32);
#define AccessResource WINELIB_NAME(AccessResource)
ATOM WINAPI AddAtom16(SEGPTR);
ATOM WINAPI AddAtom32A(LPCSTR);
@ -6299,9 +6494,6 @@ BOOL32 WINAPI AdjustWindowRect32(LPRECT32,DWORD,BOOL32);
BOOL16 WINAPI AdjustWindowRectEx16(LPRECT16,DWORD,BOOL16,DWORD);
BOOL32 WINAPI AdjustWindowRectEx32(LPRECT32,DWORD,BOOL32,DWORD);
#define AdjustWindowRectEx WINELIB_NAME(AdjustWindowRectEx)
HGLOBAL16 WINAPI AllocResource16(HINSTANCE16,HRSRC16,DWORD);
HGLOBAL32 WINAPI AllocResource32(HINSTANCE32,HRSRC32,DWORD);
#define AllocResource WINELIB_NAME(AllocResource)
void WINAPI AnimatePalette16(HPALETTE16,UINT16,UINT16,LPPALETTEENTRY);
BOOL32 WINAPI AnimatePalette32(HPALETTE32,UINT32,UINT32,LPPALETTEENTRY);
#define AnimatePalette WINELIB_NAME(AnimatePalette)
@ -6435,6 +6627,7 @@ BOOL32 WINAPI CheckRadioButton32(HWND32,UINT32,UINT32,UINT32);
HWND16 WINAPI ChildWindowFromPoint16(HWND16,POINT16);
HWND32 WINAPI ChildWindowFromPoint32(HWND32,POINT32);
#define ChildWindowFromPoint WINELIB_NAME(ChildWindowFromPoint)
INT32 ChoosePixelFormat(HDC32,PIXELFORMATDESCRIPTOR*);
BOOL16 WINAPI Chord16(HDC16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,INT16);
BOOL32 WINAPI Chord32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
#define Chord WINELIB_NAME(Chord)
@ -6696,6 +6889,8 @@ BOOL32 WINAPI DeleteMetaFile32(HMETAFILE32);
BOOL16 WINAPI DeleteObject16(HGDIOBJ16);
BOOL32 WINAPI DeleteObject32(HGDIOBJ32);
#define DeleteObject WINELIB_NAME(DeleteObject)
INT32 WINAPI DescribePixelFormat(HDC32,int,UINT32,
LPPIXELFORMATDESCRIPTOR);
VOID WINAPI DestroyCaret16(void);
BOOL32 WINAPI DestroyCaret32(void);
#define DestroyCaret WINELIB_NAME(DestroyCaret)
@ -6924,8 +7119,8 @@ BOOL32 WINAPI FindNextFile32A(HANDLE32,LPWIN32_FIND_DATA32A);
BOOL32 WINAPI FindNextFile32W(HANDLE32,LPWIN32_FIND_DATA32W);
#define FindNextFile WINELIB_NAME_AW(FindNextFile)
HRSRC16 WINAPI FindResource16(HINSTANCE16,SEGPTR,SEGPTR);
HRSRC32 WINAPI FindResource32A(HINSTANCE32,LPCSTR,LPCSTR);
HRSRC32 WINAPI FindResource32W(HINSTANCE32,LPCWSTR,LPCWSTR);
HRSRC32 WINAPI FindResource32A(HMODULE32,LPCSTR,LPCSTR);
HRSRC32 WINAPI FindResource32W(HMODULE32,LPCWSTR,LPCWSTR);
#define FindResource WINELIB_NAME_AW(FindResource)
HWND16 WINAPI FindWindow16(SEGPTR,LPCSTR);
HWND32 WINAPI FindWindow32A(LPCSTR,LPCSTR);
@ -7246,6 +7441,7 @@ INT32 WINAPI GetPath32(HDC32,LPPOINT32,LPBYTE,INT32);
COLORREF WINAPI GetPixel16(HDC16,INT16,INT16);
COLORREF WINAPI GetPixel32(HDC32,INT32,INT32);
#define GetPixel WINELIB_NAME(GetPixel)
INT32 WINAPI GetPixelFormat(HDC32);
INT16 WINAPI GetPolyFillMode16(HDC16);
INT32 WINAPI GetPolyFillMode32(HDC32);
#define GetPolyFillMode WINELIB_NAME(GetPolyFillMode)
@ -7682,7 +7878,7 @@ HINSTANCE16 WINAPI LoadModule16(LPCSTR,LPVOID);
DWORD WINAPI LoadModule32(LPCSTR,LPVOID);
#define LoadModule WINELIB_NAME(LoadModule)
HGLOBAL16 WINAPI LoadResource16(HINSTANCE16,HRSRC16);
HGLOBAL32 WINAPI LoadResource32(HINSTANCE32,HRSRC32);
HGLOBAL32 WINAPI LoadResource32(HMODULE32,HRSRC32);
#define LoadResource WINELIB_NAME(LoadResource)
INT16 WINAPI LoadString16(HINSTANCE16,UINT16,LPSTR,INT16);
INT32 WINAPI LoadString32A(HINSTANCE32,UINT32,LPSTR,INT32);
@ -7852,6 +8048,9 @@ BOOL32 WINAPI PlayMetaFile32(HDC32,HMETAFILE32);
VOID WINAPI PlayMetaFileRecord16(HDC16,LPHANDLETABLE16,LPMETARECORD,UINT16);
BOOL32 WINAPI PlayMetaFileRecord32(HDC32,LPHANDLETABLE32,LPMETARECORD,UINT32);
#define PlayMetaFileRecord WINELIB_NAME(PlayMetaFileRecord)
BOOL16 WINAPI PolyBezier16(HDC16,LPPOINT16,INT16);
BOOL32 WINAPI PolyBezier32(HDC32,LPPOINT32,DWORD);
#define PolyBezier WINELIB_NAME(PolyBezier)
BOOL16 WINAPI PolyPolygon16(HDC16,LPPOINT16,LPINT16,UINT16);
BOOL32 WINAPI PolyPolygon32(HDC32,LPPOINT32,LPINT32,UINT32);
#define PolyPolygon WINELIB_NAME(PolyPolygon)
@ -8166,6 +8365,7 @@ HWND32 WINAPI SetParent32(HWND32,HWND32);
COLORREF WINAPI SetPixel16(HDC16,INT16,INT16,COLORREF);
COLORREF WINAPI SetPixel32(HDC32,INT32,INT32,COLORREF);
#define SetPixel WINELIB_NAME(SetPixel)
BOOL32 WINAPI SetPixelFormat(HDC32,int,PIXELFORMATDESCRIPTOR*);
INT16 WINAPI SetPolyFillMode16(HDC16,INT16);
INT32 WINAPI SetPolyFillMode32(HDC32,INT32);
#define SetPolyFillMode WINELIB_NAME(SetPolyFillMode)
@ -8340,6 +8540,7 @@ INT32 WINAPI StretchDIBits32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,
BOOL16 WINAPI SubtractRect16(LPRECT16,const RECT16*,const RECT16*);
BOOL32 WINAPI SubtractRect32(LPRECT32,const RECT32*,const RECT32*);
#define SubtractRect WINELIB_NAME(SubtractRect)
BOOL32 WINAPI SwapBuffers(HDC32);
BOOL16 WINAPI SwapMouseButton16(BOOL16);
BOOL32 WINAPI SwapMouseButton32(BOOL32);
#define SwapMouseButton WINELIB_NAME(SwapMouseButton)
@ -8485,6 +8686,10 @@ BOOL16 WINAPI WinHelp16(HWND16,LPCSTR,UINT16,DWORD);
BOOL32 WINAPI WinHelp32A(HWND32,LPCSTR,UINT32,DWORD);
BOOL32 WINAPI WinHelp32W(HWND32,LPCWSTR,UINT32,DWORD);
#define WinHelp WINELIB_NAME_AW(WinHelp)
UINT16 WNetAddConnection16(LPSTR,LPSTR,LPSTR);
UINT32 WNetAddConnection32A(LPSTR,LPSTR,LPSTR);
UINT32 WNetAddConnection32W(LPWSTR,LPWSTR,LPWSTR);
#define WNetAddConnection WINELIB_NAME_AW(WNetAddConnection)
INT16 WINAPIV wsnprintf16(LPSTR,UINT16,LPCSTR,...);
INT32 WINAPIV wsnprintf32A(LPSTR,UINT32,LPCSTR,...);
INT32 WINAPIV wsnprintf32W(LPWSTR,UINT32,LPCWSTR,...);
@ -8530,8 +8735,8 @@ UINT32 WINAPI _lwrite32(HFILE32,LPCSTR,UINT32);
HPEN16 WINAPI GetSysColorPen16(INT16);
HPEN32 WINAPI GetSysColorPen32(INT32);
INT32 WINAPI LoadMessage32A(HINSTANCE32,UINT32,WORD,LPSTR,INT32);
INT32 WINAPI LoadMessage32W(HINSTANCE32,UINT32,WORD,LPWSTR,INT32);
INT32 WINAPI LoadMessage32A(HMODULE32,UINT32,WORD,LPSTR,INT32);
INT32 WINAPI LoadMessage32W(HMODULE32,UINT32,WORD,LPWSTR,INT32);
SEGPTR WINAPI WIN16_GlobalLock16(HGLOBAL16);
SEGPTR WINAPI WIN16_LockResource(HGLOBAL16);
LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG);

View File

@ -5,6 +5,8 @@
#define LOCALE_NOUSEROVERRIDE 0x80000000
#define LOCALE_USE_CP_ACP 0x40000000
#define LOCALE_LOCALEINFOFLAGSMASK 0xC0000000
/* When adding new defines, don't forget to add an entry to the
* locale2id map in misc/ole2nls.c
*/
@ -205,6 +207,14 @@
#define DATE_LONGDATE 0x00000002 /* use long date picture */
#define DATE_USE_ALT_CALENDAR 0x00000004 /* use alternate calendar */
/* alt. calendar support is broken anyway */
#define TIME_NOSECONDS 0x00000002 /* show no seconds */
#define TIME_NOMINUTESORSECONDS 0x0000001 /* show no minutes either */
/* internal flags for GetDateFormat system */
#define DATE_DATEVARSONLY 0x00000100 /* only date stuff: yMdg */
#define TIME_TIMEVARSONLY 0x00000200 /* only time stuff: hHmst */
/* use this in a WineLib program if you really want all types */
#define LOCALE_TIMEDATEBOTH 0x00000300 /* full set */
#endif /* __WINE_WINNLS_H */

View File

@ -9,38 +9,31 @@
#ifdef __WINE__
# include "config.h"
# undef WINELIB
# undef UNICODE
#else /* __WINE__ */
# ifndef WINELIB
# define WINELIB
# endif
#endif /* __WINE__ */
/* Macros to map Winelib names to the correct implementation name */
/* depending on WINELIB and UNICODE macros. */
/* Note that WINELIB is purely Win32. */
/* depending on __WINE__ and UNICODE macros. */
/* Note that Winelib is purely Win32. */
#ifdef __WINE__
# define WINELIB_NAME(func) this is a syntax error
# define WINELIB_NAME_AW(func) this is a syntax error
#else /* __WINE__ */
# ifdef WINELIB
# define WINELIB_NAME(func) func##32
# ifdef UNICODE
# define WINELIB_NAME_AW(func) func##32W
# else
# define WINELIB_NAME_AW(func) func##32A
# endif /* UNICODE */
# endif /* WINELIB */
# define WINELIB_NAME(func) func##32
# ifdef UNICODE
# define WINELIB_NAME_AW(func) func##32W
# else
# define WINELIB_NAME_AW(func) func##32A
# endif /* UNICODE */
#endif /* __WINE__ */
#ifdef __WINE__
# define DECL_WINELIB_TYPE(type) /* nothing */
# define DECL_WINELIB_TYPE_AW(type) /* nothing */
#else /* __WINE__ */
# define DECL_WINELIB_TYPE(type) typedef WINELIB_NAME(type) type
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type
# define DECL_WINELIB_TYPE(type) typedef WINELIB_NAME(type) type;
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
#endif /* __WINE__ */
@ -180,105 +173,105 @@ DECLARE_HANDLE(HKL);
typedef LRESULT (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef LRESULT (CALLBACK *DLGPROC32)(HWND32,UINT32,WPARAM32,LPARAM);
DECL_WINELIB_TYPE(DLGPROC);
DECL_WINELIB_TYPE(DLGPROC)
typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
typedef LRESULT (CALLBACK *DRIVERPROC32)(DWORD,HDRVR32,UINT32,LPARAM,LPARAM);
DECL_WINELIB_TYPE(DRIVERPROC);
DECL_WINELIB_TYPE(DRIVERPROC)
typedef INT16 (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
typedef INT32 (CALLBACK *EDITWORDBREAKPROC32A)(LPSTR,INT32,INT32,INT32);
typedef INT32 (CALLBACK *EDITWORDBREAKPROC32W)(LPWSTR,INT32,INT32,INT32);
DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC);
DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
typedef LRESULT (CALLBACK *FARPROC16)();
typedef LRESULT (CALLBACK *FARPROC32)();
DECL_WINELIB_TYPE(FARPROC);
DECL_WINELIB_TYPE(FARPROC)
typedef INT16 (CALLBACK *GOBJENUMPROC16)(SEGPTR,LPARAM);
typedef INT32 (CALLBACK *GOBJENUMPROC32)(LPVOID,LPARAM);
DECL_WINELIB_TYPE(GOBJENUMPROC);
DECL_WINELIB_TYPE(GOBJENUMPROC)
typedef BOOL16 (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
typedef BOOL32 (CALLBACK *GRAYSTRINGPROC32)(HDC32,LPARAM,INT32);
DECL_WINELIB_TYPE(GRAYSTRINGPROC);
DECL_WINELIB_TYPE(GRAYSTRINGPROC)
typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM);
typedef LRESULT (CALLBACK *HOOKPROC32)(INT32,WPARAM32,LPARAM);
DECL_WINELIB_TYPE(HOOKPROC);
DECL_WINELIB_TYPE(HOOKPROC)
typedef VOID (CALLBACK *LINEDDAPROC16)(INT16,INT16,LPARAM);
typedef VOID (CALLBACK *LINEDDAPROC32)(INT32,INT32,LPARAM);
DECL_WINELIB_TYPE(LINEDDAPROC);
DECL_WINELIB_TYPE(LINEDDAPROC)
typedef BOOL16 (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
typedef BOOL32 (CALLBACK *PROPENUMPROC32A)(HWND32,LPCSTR,HANDLE32);
typedef BOOL32 (CALLBACK *PROPENUMPROC32W)(HWND32,LPCWSTR,HANDLE32);
DECL_WINELIB_TYPE_AW(PROPENUMPROC);
DECL_WINELIB_TYPE_AW(PROPENUMPROC)
typedef BOOL32 (CALLBACK *PROPENUMPROCEX32A)(HWND32,LPCSTR,HANDLE32,LPARAM);
typedef BOOL32 (CALLBACK *PROPENUMPROCEX32W)(HWND32,LPCWSTR,HANDLE32,LPARAM);
DECL_WINELIB_TYPE_AW(PROPENUMPROCEX);
DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
typedef VOID (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
typedef VOID (CALLBACK *TIMERPROC32)(HWND32,UINT32,UINT32,DWORD);
DECL_WINELIB_TYPE(TIMERPROC);
DECL_WINELIB_TYPE(TIMERPROC)
typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM);
typedef LRESULT (CALLBACK *WNDENUMPROC32)(HWND32,LPARAM);
DECL_WINELIB_TYPE(WNDENUMPROC);
DECL_WINELIB_TYPE(WNDENUMPROC)
typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef LRESULT (CALLBACK *WNDPROC32)(HWND32,UINT32,WPARAM32,LPARAM);
DECL_WINELIB_TYPE(WNDPROC);
DECL_WINELIB_TYPE(WNDPROC)
/* TCHAR data types definitions for Winelib. */
/* These types are _not_ defined for the emulator, because they */
/* depend on the UNICODE macro that only exists in user's code. */
#ifndef __WINE__
# if defined(WINELIB32) && defined(UNICODE)
# ifdef UNICODE
typedef WCHAR TCHAR;
typedef LPWSTR LPTSTR;
typedef LPCWSTR LPCTSTR;
# else /* WINELIB32 && UNICODE */
# else /* UNICODE */
typedef CHAR TCHAR;
typedef LPSTR LPTSTR;
typedef LPCSTR LPCTSTR;
# endif /* WINELIB32 && UNICODE */
# endif /* UNICODE */
#endif /* __WINE__ */
/* Data types specific to the library. These do _not_ exist in the emulator. */
DECL_WINELIB_TYPE(INT);
DECL_WINELIB_TYPE(LPINT);
DECL_WINELIB_TYPE(LPUINT);
DECL_WINELIB_TYPE(UINT);
DECL_WINELIB_TYPE(BOOL);
DECL_WINELIB_TYPE(WPARAM);
DECL_WINELIB_TYPE(INT)
DECL_WINELIB_TYPE(LPINT)
DECL_WINELIB_TYPE(LPUINT)
DECL_WINELIB_TYPE(UINT)
DECL_WINELIB_TYPE(BOOL)
DECL_WINELIB_TYPE(WPARAM)
DECL_WINELIB_TYPE(HACCEL);
DECL_WINELIB_TYPE(HANDLE);
DECL_WINELIB_TYPE(HBITMAP);
DECL_WINELIB_TYPE(HBRUSH);
DECL_WINELIB_TYPE(HCURSOR);
DECL_WINELIB_TYPE(HDC);
DECL_WINELIB_TYPE(HDROP);
DECL_WINELIB_TYPE(HDRVR);
DECL_WINELIB_TYPE(HDWP);
DECL_WINELIB_TYPE(HENHMETAFILE);
DECL_WINELIB_TYPE(HFILE);
DECL_WINELIB_TYPE(HFONT);
DECL_WINELIB_TYPE(HGDIOBJ);
DECL_WINELIB_TYPE(HGLOBAL);
DECL_WINELIB_TYPE(HICON);
DECL_WINELIB_TYPE(HINSTANCE);
DECL_WINELIB_TYPE(HLOCAL);
DECL_WINELIB_TYPE(HMENU);
DECL_WINELIB_TYPE(HMETAFILE);
DECL_WINELIB_TYPE(HMIDI);
DECL_WINELIB_TYPE(HMIDIIN);
DECL_WINELIB_TYPE(HMIDIOUT);
DECL_WINELIB_TYPE(HMMIO);
DECL_WINELIB_TYPE(HMODULE);
DECL_WINELIB_TYPE(HPALETTE);
DECL_WINELIB_TYPE(HPEN);
DECL_WINELIB_TYPE(HQUEUE);
DECL_WINELIB_TYPE(HRGN);
DECL_WINELIB_TYPE(HRSRC);
DECL_WINELIB_TYPE(HTASK);
DECL_WINELIB_TYPE(HWAVE);
DECL_WINELIB_TYPE(HWAVEIN);
DECL_WINELIB_TYPE(HWAVEOUT);
DECL_WINELIB_TYPE(HWND);
DECL_WINELIB_TYPE(HACCEL)
DECL_WINELIB_TYPE(HANDLE)
DECL_WINELIB_TYPE(HBITMAP)
DECL_WINELIB_TYPE(HBRUSH)
DECL_WINELIB_TYPE(HCURSOR)
DECL_WINELIB_TYPE(HDC)
DECL_WINELIB_TYPE(HDROP)
DECL_WINELIB_TYPE(HDRVR)
DECL_WINELIB_TYPE(HDWP)
DECL_WINELIB_TYPE(HENHMETAFILE)
DECL_WINELIB_TYPE(HFILE)
DECL_WINELIB_TYPE(HFONT)
DECL_WINELIB_TYPE(HGDIOBJ)
DECL_WINELIB_TYPE(HGLOBAL)
DECL_WINELIB_TYPE(HICON)
DECL_WINELIB_TYPE(HINSTANCE)
DECL_WINELIB_TYPE(HLOCAL)
DECL_WINELIB_TYPE(HMENU)
DECL_WINELIB_TYPE(HMETAFILE)
DECL_WINELIB_TYPE(HMIDI)
DECL_WINELIB_TYPE(HMIDIIN)
DECL_WINELIB_TYPE(HMIDIOUT)
DECL_WINELIB_TYPE(HMMIO)
DECL_WINELIB_TYPE(HMODULE)
DECL_WINELIB_TYPE(HPALETTE)
DECL_WINELIB_TYPE(HPEN)
DECL_WINELIB_TYPE(HQUEUE)
DECL_WINELIB_TYPE(HRGN)
DECL_WINELIB_TYPE(HRSRC)
DECL_WINELIB_TYPE(HTASK)
DECL_WINELIB_TYPE(HWAVE)
DECL_WINELIB_TYPE(HWAVEIN)
DECL_WINELIB_TYPE(HWAVEOUT)
DECL_WINELIB_TYPE(HWND)
/* Misc. constants. */

View File

@ -94,6 +94,8 @@ extern BOOL32 X11DRV_Polyline( struct tagDC *dc,const LPPOINT32 pt,INT32 count);
extern BOOL32 X11DRV_Polygon( struct tagDC *dc, LPPOINT32 pt, INT32 count );
extern BOOL32 X11DRV_PolyPolygon( struct tagDC *dc, LPPOINT32 pt,
LPINT32 counts, UINT32 polygons);
extern BOOL32 X11DRV_PolyPolyline( struct tagDC *dc, LPPOINT32 pt,
LPINT32 counts, UINT32 polylines);
extern HGDIOBJ32 X11DRV_SelectObject( struct tagDC *dc, HGDIOBJ32 handle );

View File

@ -9,8 +9,6 @@ C_SRCS = \
libres.c \
main.c \
module.c \
ne_image.c \
ne_resource.c \
pe_image.c \
pe_resource.c \
resource.c \

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "debug.h"
#include "libres.h"
#include "heap.h"
#include "windows.h"
@ -31,57 +32,9 @@ void LIBRES_RegisterResources(const struct resource* const * Res)
}
/**********************************************************************
* LIBRES_FindResource16
* LIBRES_FindResource
*/
HRSRC32 LIBRES_FindResource16( HINSTANCE32 hModule, LPCSTR name, LPCSTR type )
{
int nameid=0,typeid;
ResListE* ResBlock;
const struct resource* const * Res;
if(HIWORD(name))
{
if(*name=='#')
{
nameid=atoi(name+1);
name=NULL;
}
}
else
{
nameid=LOWORD(name);
name=NULL;
}
if(HIWORD(type))
{
if(*type=='#')
typeid=atoi(type+1);
else
{
fprintf(stderr,"LIBRES_FindResource16(*,*,type=string)");
return 0;
}
}
else
typeid=LOWORD(type);
for(ResBlock=ResourceList; ResBlock; ResBlock=ResBlock->next)
for(Res=ResBlock->Resources; *Res; Res++)
if(name)
{
if((*Res)->type==typeid && !lstrcmpi32A((*Res)->name,name))
return (HRSRC32)*Res;
}
else
if((*Res)->type==typeid && (*Res)->id==nameid)
return (HRSRC32)*Res;
return 0;
}
/**********************************************************************
* LIBRES_FindResource32
*/
HRSRC32 LIBRES_FindResource32( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type )
HRSRC32 LIBRES_FindResource( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type )
{
int nameid=0,typeid;
ResListE* ResBlock;
@ -112,7 +65,7 @@ HRSRC32 LIBRES_FindResource32( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type )
}
else
{
fprintf(stderr,"LIBRES_FindResource32(*,*,type=string)");
TRACE(resource, "(*,*,type=string): Returning 0\n");
return 0;
}
}
@ -142,34 +95,6 @@ HGLOBAL32 LIBRES_LoadResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
}
/**********************************************************************
* LIBRES_LockResource
*/
LPVOID LIBRES_LockResource( HGLOBAL32 handle )
{
return (LPVOID)handle;
}
/**********************************************************************
* LIBRES_FreeResource
*/
BOOL32 LIBRES_FreeResource( HGLOBAL32 handle )
{
return 0; /* Obsolete in Win32 */
}
/**********************************************************************
* LIBRES_AccessResource
*/
INT32 LIBRES_AccessResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
fprintf(stderr,"LIBRES_AccessResource()");
return -1; /* Obsolete in Win32 */
}
/**********************************************************************
* LIBRES_SizeofResource
*/
@ -177,14 +102,3 @@ DWORD LIBRES_SizeofResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
return (DWORD)(((struct resource*)hRsrc)->size);
}
/**********************************************************************
* LIBRES_AllocResource
*/
HGLOBAL32 LIBRES_AllocResource( HINSTANCE32 hModule, HRSRC32 hRsrc, DWORD size)
{
fprintf(stderr,"LIBRES_AllocResource()");
return 0; /* Obsolete in Win32 */
}

File diff suppressed because it is too large Load Diff

17
loader/ne/Makefile.in Normal file
View File

@ -0,0 +1,17 @@
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ne
C_SRCS = \
module.c \
resource.c \
segment.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:

736
loader/ne/module.c Normal file
View File

@ -0,0 +1,736 @@
/*
* NE modules
*
* Copyright 1995 Alexandre Julliard
*/
#include <assert.h>
#include <stdlib.h>
#include "module.h"
#include "ldt.h"
#include "heap.h"
#include "global.h"
#include "process.h"
#include "debug.h"
HMODULE16 hFirstModule = 0;
/***********************************************************************
* NE_DumpModule
*/
void NE_DumpModule( HMODULE16 hModule )
{
int i, ordinal;
SEGTABLEENTRY *pSeg;
BYTE *pstr;
WORD *pword;
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( hModule )))
{
fprintf( stderr, "**** %04x is not a module handle\n", hModule );
return;
}
/* Dump the module info */
DUMP( "---\n" );
DUMP( "Module %04x:\n", hModule );
DUMP( "count=%d flags=%04x heap=%d stack=%d\n",
pModule->count, pModule->flags,
pModule->heap_size, pModule->stack_size );
DUMP( "cs:ip=%04x:%04x ss:sp=%04x:%04x ds=%04x nb seg=%d modrefs=%d\n",
pModule->cs, pModule->ip, pModule->ss, pModule->sp, pModule->dgroup,
pModule->seg_count, pModule->modref_count );
DUMP( "os_flags=%d swap_area=%d version=%04x\n",
pModule->os_flags, pModule->min_swap_area,
pModule->expected_version );
if (pModule->flags & NE_FFLAGS_WIN32)
DUMP( "PE module=%08x\n", pModule->module32 );
/* Dump the file info */
DUMP( "---\n" );
DUMP( "Filename: '%s'\n", NE_MODULE_NAME(pModule) );
/* Dump the segment table */
DUMP( "---\n" );
DUMP( "Segment table:\n" );
pSeg = NE_SEG_TABLE( pModule );
for (i = 0; i < pModule->seg_count; i++, pSeg++)
DUMP( "%02x: pos=%d size=%d flags=%04x minsize=%d sel=%04x\n",
i + 1, pSeg->filepos, pSeg->size, pSeg->flags,
pSeg->minsize, pSeg->selector );
/* Dump the resource table */
DUMP( "---\n" );
DUMP( "Resource table:\n" );
if (pModule->res_table)
{
pword = (WORD *)((BYTE *)pModule + pModule->res_table);
DUMP( "Alignment: %d\n", *pword++ );
while (*pword)
{
struct resource_typeinfo_s *ptr = (struct resource_typeinfo_s *)pword;
struct resource_nameinfo_s *pname = (struct resource_nameinfo_s *)(ptr + 1);
DUMP( "id=%04x count=%d\n", ptr->type_id, ptr->count );
for (i = 0; i < ptr->count; i++, pname++)
DUMP( "offset=%d len=%d id=%04x\n",
pname->offset, pname->length, pname->id );
pword = (WORD *)pname;
}
}
else DUMP( "None\n" );
/* Dump the resident name table */
DUMP( "---\n" );
DUMP( "Resident-name table:\n" );
pstr = (char *)pModule + pModule->name_table;
while (*pstr)
{
DUMP( "%*.*s: %d\n", *pstr, *pstr, pstr + 1,
*(WORD *)(pstr + *pstr + 1) );
pstr += *pstr + 1 + sizeof(WORD);
}
/* Dump the module reference table */
DUMP( "---\n" );
DUMP( "Module ref table:\n" );
if (pModule->modref_table)
{
pword = (WORD *)((BYTE *)pModule + pModule->modref_table);
for (i = 0; i < pModule->modref_count; i++, pword++)
{
DUMP( "%d: %04x -> '%s'\n", i, *pword,
MODULE_GetModuleName(*pword));
}
}
else DUMP( "None\n" );
/* Dump the entry table */
DUMP( "---\n" );
DUMP( "Entry table:\n" );
pstr = (char *)pModule + pModule->entry_table;
ordinal = 1;
while (*pstr)
{
DUMP( "Bundle %d-%d: %02x\n", ordinal, ordinal + *pstr - 1, pstr[1]);
if (!pstr[1])
{
ordinal += *pstr;
pstr += 2;
}
else if ((BYTE)pstr[1] == 0xff) /* moveable */
{
i = *pstr;
pstr += 2;
while (i--)
{
DUMP( "%d: %02x:%04x (moveable)\n",
ordinal++, pstr[3], *(WORD *)(pstr + 4) );
pstr += 6;
}
}
else /* fixed */
{
i = *pstr;
pstr += 2;
while (i--)
{
DUMP( "%d: %04x (fixed)\n",
ordinal++, *(WORD *)(pstr + 1) );
pstr += 3;
}
}
}
/* Dump the non-resident names table */
DUMP( "---\n" );
DUMP( "Non-resident names table:\n" );
if (pModule->nrname_handle)
{
pstr = (char *)GlobalLock16( pModule->nrname_handle );
while (*pstr)
{
DUMP( "%*.*s: %d\n", *pstr, *pstr, pstr + 1,
*(WORD *)(pstr + *pstr + 1) );
pstr += *pstr + 1 + sizeof(WORD);
}
}
DUMP( "\n" );
}
/***********************************************************************
* NE_WalkModules
*
* Walk the module list and print the modules.
*/
void NE_WalkModules(void)
{
HMODULE16 hModule = hFirstModule;
fprintf( stderr, "Module Flags Name\n" );
while (hModule)
{
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!pModule)
{
fprintf( stderr, "**** Bad module %04x in list\n", hModule );
return;
}
fprintf( stderr, " %04x %04x %.*s\n", hModule, pModule->flags,
*((char *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1 );
hModule = pModule->next;
}
}
/**********************************************************************
* NE_RegisterModule
*/
void NE_RegisterModule( NE_MODULE *pModule )
{
pModule->next = hFirstModule;
hFirstModule = pModule->self;
}
/***********************************************************************
* NE_GetOrdinal
*
* Lookup the ordinal for a given name.
*/
WORD NE_GetOrdinal( HMODULE16 hModule, const char *name )
{
unsigned char buffer[256], *cpnt;
BYTE len;
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0;
assert( !(pModule->flags & NE_FFLAGS_WIN32) );
TRACE( module, "(%04x,'%s')\n", hModule, name );
/* First handle names of the form '#xxxx' */
if (name[0] == '#') return atoi( name + 1 );
/* Now copy and uppercase the string */
strcpy( buffer, name );
CharUpper32A( buffer );
len = strlen( buffer );
/* First search the resident names */
cpnt = (char *)pModule + pModule->name_table;
/* Skip the first entry (module name) */
cpnt += *cpnt + 1 + sizeof(WORD);
while (*cpnt)
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
TRACE(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
cpnt += *cpnt + 1 + sizeof(WORD);
}
/* Now search the non-resident names table */
if (!pModule->nrname_handle) return 0; /* No non-resident table */
cpnt = (char *)GlobalLock16( pModule->nrname_handle );
/* Skip the first entry (module description string) */
cpnt += *cpnt + 1 + sizeof(WORD);
while (*cpnt)
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
TRACE(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
cpnt += *cpnt + 1 + sizeof(WORD);
}
return 0;
}
/***********************************************************************
* NE_GetEntryPoint (WPROCS.27)
*
* Return the entry point for a given ordinal.
*/
FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
BYTE *p;
WORD sel, offset;
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0;
assert( !(pModule->flags & NE_FFLAGS_WIN32) );
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 0;
switch(p[1])
{
case 0: /* unused */
return 0;
case 0xff: /* moveable */
p += 2 + 6 * (ordinal - curOrdinal);
sel = p[3];
offset = *(WORD *)(p + 4);
break;
default: /* fixed */
sel = p[1];
p += 2 + 3 * (ordinal - curOrdinal);
offset = *(WORD *)(p + 1);
break;
}
if (sel == 0xfe) sel = 0xffff; /* constant entry */
else sel = (WORD)(DWORD)NE_SEG_TABLE(pModule)[sel-1].selector;
return (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( sel, offset );
}
/***********************************************************************
* NE_SetEntryPoint
*
* Change the value of an entry point. Use with caution!
* It can only change the offset value, not the selector.
*/
BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
BYTE *p;
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE;
assert( !(pModule->flags & NE_FFLAGS_WIN32) );
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;
}
/***********************************************************************
* NE_LoadExeHeader
*/
static HMODULE16 NE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
IMAGE_DOS_HEADER mz_header;
IMAGE_OS2_HEADER ne_header;
int size;
HMODULE16 hModule;
NE_MODULE *pModule;
BYTE *pData;
char *buffer, *fastload = NULL;
int fastload_offset = 0, fastload_length = 0;
/* Read a block from either the file or the fast-load area. */
#define READ(offset,size,buffer) \
((fastload && ((offset) >= fastload_offset) && \
((offset)+(size) <= fastload_offset+fastload_length)) ? \
(memcpy( buffer, fastload+(offset)-fastload_offset, (size) ), TRUE) : \
(_llseek32( hFile, (offset), SEEK_SET), \
_lread32( hFile, (buffer), (size) ) == (size)))
_llseek32( hFile, 0, SEEK_SET );
if ((_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
(mz_header.e_magic != IMAGE_DOS_SIGNATURE))
return (HMODULE16)11; /* invalid exe */
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET );
if (_lread32( hFile, &ne_header, sizeof(ne_header) ) != sizeof(ne_header))
return (HMODULE16)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_NT_SIGNATURE) return (HMODULE16)21; /* win32 exe */
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return (HMODULE16)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_OS2_SIGNATURE_LX) {
fprintf(stderr, "Sorry, this is an OS/2 linear executable (LX) file !\n");
return (HMODULE16)12;
}
/* We now have a valid NE header */
size = sizeof(NE_MODULE) +
/* loaded file info */
sizeof(OFSTRUCT)-sizeof(ofs->szPathName)+strlen(ofs->szPathName)+1+
/* segment table */
ne_header.n_segment_tab * sizeof(SEGTABLEENTRY) +
/* resource table */
ne_header.rname_tab_offset - ne_header.resource_tab_offset +
/* resident names table */
ne_header.moduleref_tab_offset - ne_header.rname_tab_offset +
/* module ref table */
ne_header.n_mod_ref_tab * sizeof(WORD) +
/* imported names table */
ne_header.entry_tab_offset - ne_header.iname_tab_offset +
/* entry table length */
ne_header.entry_tab_length;
hModule = GlobalAlloc16( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
if (!hModule) return (HMODULE16)11; /* invalid exe */
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
memcpy( pModule, &ne_header, sizeof(ne_header) );
pModule->count = 0;
pModule->module32 = 0;
pModule->self = hModule;
pModule->self_loading_sel = 0;
pData = (BYTE *)(pModule + 1);
/* Clear internal Wine flags in case they are set in the EXE file */
pModule->flags &= ~(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32|NE_FFLAGS_IMPLICIT);
/* Read the fast-load area */
if (ne_header.additional_flags & NE_AFLAGS_FASTLOAD)
{
fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count;
fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
TRACE(module, "Using fast-load area offset=%x len=%d\n",
fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
{
_llseek32( hFile, fastload_offset, SEEK_SET);
if (_lread32(hFile, fastload, fastload_length) != fastload_length)
{
HeapFree( SystemHeap, 0, fastload );
fprintf(stderr, "Error reading fast-load area !\n");
fastload = NULL;
}
}
}
/* Store the filename information */
pModule->fileinfo = (int)pData - (int)pModule;
size = sizeof(OFSTRUCT)-sizeof(ofs->szPathName)+strlen(ofs->szPathName)+1;
memcpy( pData, ofs, size );
((OFSTRUCT *)pData)->cBytes = size - 1;
pData += size;
/* Get the segment table */
pModule->seg_table = (int)pData - (int)pModule;
buffer = HeapAlloc( SystemHeap, 0, ne_header.n_segment_tab *
sizeof(struct ne_segment_table_entry_s));
if (buffer)
{
int i;
struct ne_segment_table_entry_s *pSeg;
if (!READ( mz_header.e_lfanew + ne_header.segment_tab_offset,
ne_header.n_segment_tab * sizeof(struct ne_segment_table_entry_s),
buffer ))
{
HeapFree( SystemHeap, 0, buffer );
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
pSeg = (struct ne_segment_table_entry_s *)buffer;
for (i = ne_header.n_segment_tab; i > 0; i--, pSeg++)
{
memcpy( pData, pSeg, sizeof(*pSeg) );
pData += sizeof(SEGTABLEENTRY);
}
HeapFree( SystemHeap, 0, buffer );
}
else
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
/* Get the resource table */
if (ne_header.resource_tab_offset < ne_header.rname_tab_offset)
{
pModule->res_table = (int)pData - (int)pModule;
if (!READ(mz_header.e_lfanew + ne_header.resource_tab_offset,
ne_header.rname_tab_offset - ne_header.resource_tab_offset,
pData )) return (HMODULE16)11; /* invalid exe */
pData += ne_header.rname_tab_offset - ne_header.resource_tab_offset;
NE_InitResourceHandler( hModule );
}
else pModule->res_table = 0; /* No resource table */
/* Get the resident names table */
pModule->name_table = (int)pData - (int)pModule;
if (!READ( mz_header.e_lfanew + ne_header.rname_tab_offset,
ne_header.moduleref_tab_offset - ne_header.rname_tab_offset,
pData ))
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
pData += ne_header.moduleref_tab_offset - ne_header.rname_tab_offset;
/* Get the module references table */
if (ne_header.n_mod_ref_tab > 0)
{
pModule->modref_table = (int)pData - (int)pModule;
if (!READ( mz_header.e_lfanew + ne_header.moduleref_tab_offset,
ne_header.n_mod_ref_tab * sizeof(WORD),
pData ))
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
pData += ne_header.n_mod_ref_tab * sizeof(WORD);
}
else pModule->modref_table = 0; /* No module references */
/* Get the imported names table */
pModule->import_table = (int)pData - (int)pModule;
if (!READ( mz_header.e_lfanew + ne_header.iname_tab_offset,
ne_header.entry_tab_offset - ne_header.iname_tab_offset,
pData ))
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
pData += ne_header.entry_tab_offset - ne_header.iname_tab_offset;
/* Get the entry table */
pModule->entry_table = (int)pData - (int)pModule;
if (!READ( mz_header.e_lfanew + ne_header.entry_tab_offset,
ne_header.entry_tab_length,
pData ))
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
pData += ne_header.entry_tab_length;
/* Free the fast-load area */
#undef READ
if (fastload) HeapFree( SystemHeap, 0, fastload );
/* Get the non-resident names table */
if (ne_header.nrname_tab_length)
{
pModule->nrname_handle = GLOBAL_Alloc( 0, ne_header.nrname_tab_length,
hModule, FALSE, FALSE, FALSE );
if (!pModule->nrname_handle)
{
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
buffer = GlobalLock16( pModule->nrname_handle );
_llseek32( hFile, ne_header.nrname_tab_offset, SEEK_SET );
if (_lread32( hFile, buffer, ne_header.nrname_tab_length )
!= ne_header.nrname_tab_length)
{
GlobalFree16( pModule->nrname_handle );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
}
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(HMODULE16),
hModule, FALSE, FALSE, FALSE );
if (!pModule->dlls_to_init)
{
if (pModule->nrname_handle) GlobalFree16( pModule->nrname_handle );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
}
}
else pModule->dlls_to_init = 0;
NE_RegisterModule( pModule );
return hModule;
}
/***********************************************************************
* NE_LoadDLLs
*
* Load all DLLs implicitly linked to a module.
*/
static BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
{
int i;
WORD *pModRef = (WORD *)((char *)pModule + pModule->modref_table);
WORD *pDLLs = (WORD *)GlobalLock16( 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" );
TRACE(module, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule16( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
/* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT,
NULL, NULL, 0 )) == 2)
{
/* file not found */
char *p;
/* Try with prepending the path of the current module */
GetModuleFileName16( pModule->self, buffer, sizeof(buffer) );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT, NULL, NULL, 0);
}
if (hDLL < 32)
{
/* FIXME: cleanup what was done */
fprintf( stderr, "Could not load '%s' required by '%.*s', error = %d\n",
buffer, *((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, hDLL );
return FALSE;
}
*pModRef = GetExePtr( hDLL );
*pDLLs++ = *pModRef;
}
else /* Increment the reference count of the DLL */
{
NE_MODULE *pOldDLL = MODULE_GetPtr16( *pModRef );
if (pOldDLL) pOldDLL->count++;
}
}
return TRUE;
}
/**********************************************************************
* NE_LoadModule
*
* Implementation of LoadModule().
*
* cmd_line must contain the whole command-line, including argv[0] (and
* without a preceding length byte).
* If cmd_line is NULL, the module is loaded as a library even if it is a .exe
*/
HINSTANCE16 NE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, UINT16 flags,
LPCSTR cmd_line, LPCSTR env, UINT32 show_cmd )
{
HMODULE16 hModule;
HINSTANCE16 hInstance;
NE_MODULE *pModule;
/* Create the module structure */
if ((hModule = NE_LoadExeHeader( hFile, ofs )) < 32) return hModule;
pModule = MODULE_GetPtr16( hModule );
pModule->flags |= flags; /* stamp implicitly loaded modules */
/* Allocate the segments for this module */
NE_CreateSegments( hModule );
hInstance = MODULE_CreateInstance( hModule, NULL, (cmd_line == NULL) );
/* Load the referenced DLLs */
if (!NE_LoadDLLs( pModule ))
return 2; /* File not found (FIXME: free everything) */
/* Load the segments */
NE_LoadAllSegments( pModule );
/* Fixup the functions prologs */
NE_FixupPrologs( pModule );
/* Make sure the usage count is 1 on the first loading of */
/* the module, even if it contains circular DLL references */
pModule->count = 1;
/* Call initialization rountines for all loaded DLLs. Note that
* when we load implicitly linked DLLs this will be done by InitTask().
*/
if ((pModule->flags & (NE_FFLAGS_LIBMODULE | NE_FFLAGS_IMPLICIT)) ==
NE_FFLAGS_LIBMODULE)
NE_InitializeDLLs( hModule );
/* Create a task for this instance */
if (cmd_line && !(pModule->flags & NE_FFLAGS_LIBMODULE))
{
PDB32 *pdb;
pModule->flags |= NE_FFLAGS_GUI;
pdb = PROCESS_Create( pModule, cmd_line, env, hInstance, 0, show_cmd );
if (pdb && (GetNumTasks() > 1)) Yield16();
}
return hInstance;
}

View File

@ -1,10 +1,12 @@
/*
* NE resource functions
*
* Copyright 1993 Robert J. Amstadt
* Copyright 1995 Alexandre Julliard
* 1997 Alex Korobka
* Copyright 1997 Alex Korobka
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -20,7 +22,7 @@
#include "resource.h"
#include "debug.h"
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
(pTypeInfo)->count * sizeof(NE_NAMEINFO)))
/***********************************************************************
@ -181,7 +183,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
HRSRC16 hRsrc )
{
int fd;
NE_MODULE* pModule = MODULE_GetPtr( hModule );
NE_MODULE* pModule = MODULE_GetPtr16( hModule );
if ( pModule && (fd = MODULE_OpenFile( hModule )) >= 0)
{
HGLOBAL16 handle;
@ -194,7 +196,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
if( hMemObj )
handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 );
else
handle = NE_AllocResource( hModule, hRsrc, 0 );
handle = AllocResource( hModule, hRsrc, 0 );
if( handle )
{
@ -213,95 +215,131 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
*/
BOOL32 NE_InitResourceHandler( HMODULE16 hModule )
{
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
pTypeInfo->resloader = (DWORD)&NE_DefResourceHandler;
pTypeInfo->resloader = (FARPROC16)&NE_DefResourceHandler;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
return TRUE;
}
/***********************************************************************
* NE_SetResourceHandler
*/
FARPROC32 NE_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId,
FARPROC32 resourceHandler )
{
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
FARPROC32 prevHandler = NULL;
do
/**********************************************************************
* SetResourceHandler (KERNEL.43)
*/
FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR typeId,
FARPROC16 resourceHandler )
{
FARPROC16 prevHandler = NULL;
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
if (!pModule || !pModule->res_table) return NULL;
TRACE( resource, "module=%04x type=%s\n",
hModule, debugres_a(PTR_SEG_TO_LIN(typeId)) );
for (;;)
{
pTypeInfo = NE_FindTypeSection( pModule, pTypeInfo, typeId );
if( pTypeInfo )
{
prevHandler = (FARPROC32)pTypeInfo->resloader;
pTypeInfo->resloader = (DWORD)resourceHandler;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
} while( pTypeInfo );
if (!(pTypeInfo = NE_FindTypeSection( pModule, pTypeInfo, typeId )))
break;
prevHandler = pTypeInfo->resloader;
pTypeInfo->resloader = resourceHandler;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
return prevHandler;
}
/***********************************************************************
* NE_FindResource
/**********************************************************************
* FindResource16 (KERNEL.60)
*/
HRSRC16 NE_FindResource( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId )
HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
{
NE_TYPEINFO *pTypeInfo;
HRSRC16 hRsrc;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!pModule || !pModule->res_table) return 0;
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
if (HIWORD(typeId) || HIWORD(resId))
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
TRACE( resource, "module=%04x name=%s type=%s\n",
hModule, debugres_a(PTR_SEG_TO_LIN(name)),
debugres_a(PTR_SEG_TO_LIN(type)) );
if (HIWORD(name)) /* Check for '#xxx' name */
{
DWORD id = NE_FindNameTableId( pModule, typeId, resId );
char *ptr = PTR_SEG_TO_LIN( name );
if (ptr[0] == '#')
if (!(name = (SEGPTR)atoi( ptr + 1 )))
{
WARN(resource, "Incorrect resource name: %s\n", ptr);
return 0;
}
}
if (HIWORD(type)) /* Check for '#xxx' type */
{
char *ptr = PTR_SEG_TO_LIN( type );
if (ptr[0] == '#')
if (!(type = (SEGPTR)atoi( ptr + 1 )))
{
WARN(resource, "Incorrect resource type: %s\n", ptr);
return 0;
}
}
if (HIWORD(type) || HIWORD(name))
{
DWORD id = NE_FindNameTableId( pModule, type, name );
if (id) /* found */
{
typeId = LOWORD(id);
resId = HIWORD(id);
type = LOWORD(id);
name = HIWORD(id);
}
}
do
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
for (;;)
{
pTypeInfo = NE_FindTypeSection( pModule, pTypeInfo, typeId );
if( pTypeInfo )
{
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
if( hRsrc )
{
TRACE(resource, " Found id %08lx\n", resId );
return hRsrc;
}
TRACE(resource, " Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
} while( pTypeInfo );
if (!(pTypeInfo = NE_FindTypeSection( pModule, pTypeInfo, type )))
break;
if ((hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, name)))
{
TRACE(resource, " Found id %08lx\n", name );
return hRsrc;
}
TRACE(resource, " Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
WARN(resource, "failed!\n");
return 0;
}
/***********************************************************************
* NE_AllocResource
/**********************************************************************
* AllocResource (KERNEL.66)
*/
HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size )
HGLOBAL16 WINAPI AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
{
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
if (!pModule || !pModule->res_table) return 0;
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return 0;
TRACE( resource, "module=%04x res=%04x size=%ld\n", hModule, hRsrc, size );
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
if (size < (DWORD)pNameInfo->length << sizeShift)
@ -310,55 +348,84 @@ HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size )
}
/***********************************************************************
* NE_AccessResource
/**********************************************************************
* DirectResAlloc (KERNEL.168)
*
* Check Schulman, p. 232 for details
*/
int NE_AccessResource( HMODULE16 hModule, HRSRC16 hRsrc )
HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
UINT16 wSize )
{
TRACE(resource,"(%04x,%04x,%04x)\n",
hInstance, wType, wSize );
if (!(hInstance = GetExePtr( hInstance ))) return 0;
if(wType != 0x10) /* 0x10 is the only observed value, passed from
CreateCursorIndirect. */
fprintf(stderr, "DirectResAlloc: wType = %x\n", wType);
return GLOBAL_Alloc(GMEM_MOVEABLE, wSize, hInstance, FALSE, FALSE, FALSE);
}
/**********************************************************************
* AccessResource16 (KERNEL.64)
*/
INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{
NE_NAMEINFO *pNameInfo=NULL;
HFILE32 fd;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
if (!pModule || !pModule->res_table) return -1;
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return -1;
TRACE(resource, "module=%04x res=%04x\n", hModule, hRsrc );
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
if ((fd = _lopen32( NE_MODULE_NAME(pModule), OF_READ )) != -1)
{
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO *pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
_llseek32( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET );
}
return fd;
}
/***********************************************************************
* NE_SizeofResource
/**********************************************************************
* SizeofResource16 (KERNEL.65)
*/
DWORD NE_SizeofResource( HMODULE16 hModule, HRSRC16 hRsrc )
DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!pModule || !pModule->res_table) return 0;
TRACE(resource, "module=%04x res=%04x\n", hModule, hRsrc );
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
return (DWORD)pNameInfo->length << sizeShift;
}
/***********************************************************************
* NE_LoadResource
/**********************************************************************
* LoadResource16 (KERNEL.61)
*/
HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc )
HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_TYPEINFO *pTypeInfo;
NE_NAMEINFO *pNameInfo = NULL;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
int d;
TRACE( resource, "module=%04x res=%04x\n", hModule, hRsrc );
if (!hRsrc || !pModule || !pModule->res_table) return 0;
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
/* First, verify hRsrc (just an offset from pModule to the needed pNameInfo) */
d = pModule->res_table + 2;
@ -383,7 +450,7 @@ HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc )
if (pNameInfo)
{
RESOURCEHANDLER16 __r16loader;
RESOURCEHANDLER16 loader;
if (pNameInfo->handle
&& !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
{
@ -394,16 +461,16 @@ HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc )
else
{
if (pTypeInfo->resloader)
__r16loader = (RESOURCEHANDLER16)pTypeInfo->resloader;
loader = (RESOURCEHANDLER16)pTypeInfo->resloader;
else /* this is really bad */
{
fprintf( stderr, "[%04x]: Missing resource handler!!!...\n", hModule);
__r16loader = NE_DefResourceHandler;
loader = NE_DefResourceHandler;
}
/* Finally call resource loader */
if ((pNameInfo->handle = __r16loader(pNameInfo->handle, hModule, hRsrc)))
if ((pNameInfo->handle = loader(pNameInfo->handle, hModule, hRsrc)))
{
pNameInfo->usage++;
pNameInfo->flags |= NE_SEGFLAGS_LOADED;
@ -415,28 +482,46 @@ HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc )
}
/***********************************************************************
* NE_LockResource
/**********************************************************************
* LockResource16 (KERNEL.62)
*/
SEGPTR NE_LockResource( HMODULE16 hModule, HGLOBAL16 handle )
/* 16-bit version */
SEGPTR WINAPI WIN16_LockResource16( HGLOBAL16 handle )
{
TRACE( resource, "handle=%04x\n", handle );
if (!handle) return (SEGPTR)0;
/* May need to reload the resource if discarded */
return (SEGPTR)WIN16_GlobalLock16( handle );
}
/* Winelib 16-bit version */
LPVOID WINAPI LockResource16( HGLOBAL16 handle )
{
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
/***********************************************************************
* NE_FreeResource
return (LPVOID)PTR_SEG_TO_LIN( WIN16_LockResource16( handle ) );
}
/**********************************************************************
* FreeResource16 (KERNEL.63)
*/
BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle )
BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
{
NE_TYPEINFO *pTypeInfo;
NE_NAMEINFO *pNameInfo;
WORD count;
HMODULE16 hModule = GetExePtr( handle );
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
NE_MODULE *pModule = MODULE_GetPtr( hModule );
if (!handle || !pModule || !pModule->res_table) return handle;
TRACE(resource, "handle=%04x\n", handle );
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
while (pTypeInfo->type_id)
{

View File

@ -1,10 +1,11 @@
/*
* NE modules
* NE segment loading
*
* Copyright 1993 Robert J. Amstadt
* Copyright 1995 Alexandre Julliard
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@ -160,8 +161,11 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
read( fd, &count, sizeof(count) );
if (!count) return TRUE;
TRACE(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
TRACE(fixup, "Fixups for %.*s, segment %d, selector %04x\n",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
segnum, pSeg->selector );
TRACE(segment, "Fixups for %.*s, segment %d, selector %04x\n",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
segnum, pSeg->selector );
@ -194,10 +198,10 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RELTYPE_ORDINAL:
module = pModuleTable[rep->target1-1];
ordinal = rep->target2;
address = MODULE_GetEntryPoint( module, ordinal );
address = NE_GetEntryPoint( module, ordinal );
if (!address)
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
NE_MODULE *pTarget = MODULE_GetPtr16( module );
if (!pTarget)
fprintf( stderr, "Module not found: %04x, reference %d of module %*.*s\n",
module, rep->target1,
@ -212,7 +216,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
}
if (TRACE_ON(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
NE_MODULE *pTarget = MODULE_GetPtr16( module );
TRACE( fixup, "%d: %.*s.%d=%04x:%04x %s\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
@ -227,20 +231,19 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
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 );
ordinal = NE_GetOrdinal( module, func_name );
address = NE_GetEntryPoint( module, ordinal );
if (ERR_ON(fixup) && !address)
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
NE_MODULE *pTarget = MODULE_GetPtr16( module );
ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
}
if (TRACE_ON(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
NE_MODULE *pTarget = MODULE_GetPtr16( module );
TRACE( fixup, "%d: %.*s.%s=%04x:%04x %s\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
@ -252,7 +255,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RELTYPE_INTERNAL:
if ((rep->target1 & 0xff) == 0xff)
{
address = MODULE_GetEntryPoint( pModule->self, rep->target2 );
address = NE_GetEntryPoint( pModule->self, rep->target2 );
}
else
{
@ -310,6 +313,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
ERR(fixup,"Additive selector to %04x.Please report\n",*sp);
else
*sp = HIWORD(address);
break;
default:
goto unknown;
}
@ -383,9 +387,9 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
if (!NE_LoadSegment( pModule, 1 )) return FALSE;
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(pSegTable->selector, 0);
selfloadheader->EntryAddrProc = MODULE_GetEntryPoint(hselfload,27);
selfloadheader->MyAlloc = MODULE_GetEntryPoint(hselfload,28);
selfloadheader->SetOwner = MODULE_GetEntryPoint(GetModuleHandle16("KERNEL"),403);
selfloadheader->EntryAddrProc = NE_GetEntryPoint(hselfload,27);
selfloadheader->MyAlloc = NE_GetEntryPoint(hselfload,28);
selfloadheader->SetOwner = NE_GetEntryPoint(GetModuleHandle16("KERNEL"),403);
pModule->self_loading_sel = GlobalHandleToSel(GLOBAL_Alloc(GMEM_ZEROINIT, 0xFF00, pModule->self, FALSE, FALSE, FALSE));
oldstack = thdb->cur_stack;
thdb->cur_stack = PTR_SEG_OFF_TO_SEGPTR(pModule->self_loading_sel,
@ -419,63 +423,6 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
}
/***********************************************************************
* NE_LoadDLLs
*/
BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
{
int i;
WORD *pModRef = (WORD *)((char *)pModule + pModule->modref_table);
WORD *pDLLs = (WORD *)GlobalLock16( 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" );
TRACE(module, "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. */
HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT,
NULL, NULL, 0 )) == 2)
{
/* file not found */
char *p;
/* Try with prepending the path of the current module */
GetModuleFileName16( pModule->self, buffer, sizeof(buffer) );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT, NULL, NULL, 0);
}
if (hDLL < 32)
{
/* FIXME: cleanup what was done */
fprintf( stderr, "Could not load '%s' required by '%.*s', error = %d\n",
buffer, *((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, hDLL );
return FALSE;
}
*pModRef = MODULE_HANDLEtoHMODULE16( hDLL );
*pDLLs++ = *pModRef;
}
else /* Increment the reference count of the DLL */
{
NE_MODULE *pOldDLL = MODULE_GetPtr( *pModRef );
if (pOldDLL) pOldDLL->count++;
}
}
return TRUE;
}
/***********************************************************************
* NE_FixupPrologs
*
@ -589,7 +536,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
* es:si command line (always 0)
*/
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE;
pSegTable = NE_SEG_TABLE( pModule );
if (!(pModule->flags & NE_FFLAGS_LIBMODULE) ||
@ -666,7 +613,7 @@ void NE_InitializeDLLs( HMODULE16 hModule )
NE_MODULE *pModule;
HMODULE16 *pDLL;
if (!(pModule = MODULE_GetPtr( hModule ))) return;
if (!(pModule = MODULE_GetPtr16( hModule ))) return;
if (pModule->flags & NE_FFLAGS_WIN32) return;
if (pModule->dlls_to_init)
@ -694,3 +641,72 @@ void WINAPI PatchCodeHandle(HANDLE16 hSel)
{
fprintf(stderr,"PatchCodeHandle(%04x),stub!\n",hSel);
}
/***********************************************************************
* NE_Ne2MemFlags
*
* This function translates NE segment flags to GlobalAlloc flags
*/
static WORD NE_Ne2MemFlags(WORD flags)
{
WORD memflags = 0;
#if 0
if (flags & NE_SEGFLAGS_DISCARDABLE)
memflags |= GMEM_DISCARDABLE;
if (flags & NE_SEGFLAGS_MOVEABLE ||
( ! (flags & NE_SEGFLAGS_DATA) &&
! (flags & NE_SEGFLAGS_LOADED) &&
! (flags & NE_SEGFLAGS_ALLOCATED)
)
)
memflags |= GMEM_MOVEABLE;
memflags |= GMEM_ZEROINIT;
#else
memflags = GMEM_ZEROINIT | GMEM_FIXED;
return memflags;
#endif
}
/***********************************************************************
* NE_AllocateSegment (WPROCS.26)
*/
DWORD WINAPI NE_AllocateSegment( WORD wFlags, WORD wSize, WORD wElem )
{
WORD size = wSize << wElem;
HANDLE16 hMem = GlobalAlloc16( NE_Ne2MemFlags(wFlags), size);
return MAKELONG( hMem, GlobalHandleToSel(hMem) );
}
/***********************************************************************
* NE_CreateSegments
*/
BOOL32 NE_CreateSegments( HMODULE16 hModule )
{
SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
int i, minsize;
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE;
assert( !(pModule->flags & NE_FFLAGS_WIN32) );
pSegment = NE_SEG_TABLE( pModule );
for (i = 1; i <= pModule->seg_count; i++, pSegment++)
{
minsize = pSegment->minsize ? pSegment->minsize : 0x10000;
if (i == pModule->ss) minsize += pModule->stack_size;
/* The DGROUP is allocated by MODULE_CreateInstance */
if (i == pModule->dgroup) continue;
pSegment->selector = GLOBAL_Alloc( NE_Ne2MemFlags(pSegment->flags),
minsize, hModule,
!(pSegment->flags & NE_SEGFLAGS_DATA),
FALSE,
FALSE /*pSegment->flags & NE_SEGFLAGS_READONLY*/ );
if (!pSegment->selector) return FALSE;
}
pModule->dgroup_entry = pModule->dgroup ? pModule->seg_table +
(pModule->dgroup - 1) * sizeof(SEGTABLEENTRY) : 0;
return TRUE;
}

View File

@ -49,6 +49,7 @@
#include "winbase.h"
#include "callback.h"
#include "file.h"
#include "heap.h"
#include "neexe.h"
#include "peexe.h"
#include "process.h"
@ -59,11 +60,13 @@
#include "task.h"
#include "debug.h"
static void PE_InitDLL(PE_MODREF* modref, DWORD type, LPVOID lpReserved);
static void PE_InitDLL(WINE_MODREF *wm, DWORD type, LPVOID lpReserved);
/* convert PE image VirtualAddress to Real Address */
#define RVA(x) ((unsigned int)load_addr+(unsigned int)(x))
#define AdjustPtr(ptr,delta) ((char *)(ptr) + (delta))
void dump_exports( HMODULE32 hModule )
{
char *Module;
@ -116,44 +119,40 @@ void dump_exports( HMODULE32 hModule )
* If it is a ordinal:
* - use ordinal-pe_export->Base as offset into the functionlist
*/
FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
LPCSTR funcName)
FARPROC32 PE_FindExportedFunction(
PDB32 *process, /* [in] process context */
WINE_MODREF *wm, /* [in] WINE modreference */
LPCSTR funcName ) /* [in] function name */
{
IMAGE_EXPORT_DIRECTORY *exports;
unsigned load_addr;
u_short * ordinal;
u_long * function;
u_char ** name, *ename;
int i;
PE_MODREF *pem;
PE_MODREF *pem = &(wm->binfmt.pe);
IMAGE_EXPORT_DIRECTORY *exports = pem->pe_export;
unsigned int load_addr = wm->module;
u_long rva_start, rva_end, addr;
char * forward;
pem = process->modref_list;
while (pem && (pem->module != hModule))
pem=pem->next;
if (!pem) {
fprintf(stderr,"No MODREF found for PE_MODULE %08x in process %p\n",hModule,process);
return NULL;
}
load_addr = hModule;
exports = pem->pe_export;
if (HIWORD(funcName))
TRACE(win32,"(%s)\n",funcName);
else
TRACE(win32,"(%d)\n",(int)funcName);
if (!exports) {
fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem);
/* Not a fatal problem, some apps do
* GetProcAddress(0,"RegisterPenApp") which triggers this
* case.
*/
WARN(win32,"Module %08x(%s)/MODREF %p doesn't have a exports table.\n",wm->module,wm->modname,pem);
return NULL;
}
ordinal = (u_short*) RVA(exports->AddressOfNameOrdinals);
function= (u_long*) RVA(exports->AddressOfFunctions);
name = (u_char **) RVA(exports->AddressOfNames);
forward = NULL;
rva_start = PE_HEADER(hModule)->OptionalHeader
rva_start = PE_HEADER(wm->module)->OptionalHeader
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
rva_end = rva_start + PE_HEADER(hModule)->OptionalHeader
rva_end = rva_start + PE_HEADER(wm->module)->OptionalHeader
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
if (HIWORD(funcName)) {
@ -188,23 +187,30 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
HMODULE32 hMod;
char module[256];
char *end = strchr(forward, '.');
if (!end) return NULL;
assert(end-forward<256);
strncpy(module, forward, (end - forward));
module[end-forward] = 0;
hMod = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(module) );
return PE_FindExportedFunction( process, hMod, end + 1);
hMod = MODULE_FindModule32(process,module);
assert(hMod);
return MODULE_GetProcAddress32( process, hMod, end + 1);
}
return NULL;
}
DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
{
IMAGE_IMPORT_DESCRIPTOR *pe_imp;
WINE_MODREF *xwm;
PE_MODREF *pem;
int fixup_failed = 0;
unsigned int load_addr = pem->module;
unsigned int load_addr = wm->module;
int i;
char *modname;
assert(wm->type==MODULE32_PE);
pem = &(wm->binfmt.pe);
if (pem->pe_export)
modname = (char*) RVA(pem->pe_export->Name);
else
@ -229,10 +235,8 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
/* FIXME: should terminate on 0 Characteristics */
for (i = 0, pe_imp = pem->pe_import; pe_imp->Name; pe_imp++) {
HMODULE32 res;
PE_MODREF *xpem,**ypem;
char *name = (char *) RVA(pe_imp->Name);
WINE_MODREF **ywm;
char *name = (char *) RVA(pe_imp->Name);
/* don't use MODULE_Load, Win32 creates new task differently */
res = PE_LoadLibraryEx32A( name, process, 0, 0 );
@ -240,7 +244,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
char buffer[1024];
/* Try with prepending the path of the current module */
if (GetModuleFileName32A( pem->module, buffer, sizeof (buffer))) {
if (GetModuleFileName32A( wm->module, buffer, sizeof (buffer))) {
char *p;
if (!(p = strrchr (buffer, '\\')))
@ -251,36 +255,35 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
ERR(win32,"cannot find the module just loaded!\n");
}
if (res <= (HMODULE32) 32) {
fprintf (stderr, "Module %s not found\n", name);
WARN (module, "Module %s not found\n", name);
return res;
}
res = MODULE_HANDLEtoHMODULE32(res);
xpem = pem->next;
while (xpem) {
if (xpem->module == res)
xwm = wm->next;
while (xwm) {
if (xwm->module == res)
break;
xpem = xpem->next;
xwm = xwm->next;
}
if (xpem) {
if (xwm) {
/* It has been loaded *BEFORE* us, so we have to initialize
* it before us. We cannot just link in the xpem before pem,
* since xpem might reference more dlls which would be in the
* it before us. We cannot just link in the xwm before wm,
* since xwm might reference more dlls which would be in the
* wrong order after that.
* Instead we link in pem right AFTER xpem, which should keep
* Instead we link in wm right AFTER xwm, which should keep
* the correct order. (I am not 100% sure about that.)
*/
/* unlink pem from chain */
ypem = &(process->modref_list);
while (*ypem) {
if ((*ypem)==pem)
/* unlink wm from chain */
ywm = &(process->modref_list);
while (*ywm) {
if ((*ywm)==wm)
break;
ypem = &((*ypem)->next);
ywm = &((*ywm)->next);
}
*ypem = pem->next;
*ywm = wm->next;
/* link pem directly AFTER xpem */
pem->next = xpem->next;
xpem->next = pem;
/* link wm directly AFTER xwm */
wm->next = xwm->next;
xwm->next = wm;
}
i++;
@ -293,7 +296,8 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
HMODULE32 hImpModule;
Module = (char *) RVA(pe_imp->Name);
hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) );
hImpModule = MODULE_FindModule32(process,Module);
assert(hImpModule); /* we have imported it, so it MUST be there */
TRACE(win32, "%s\n", Module);
/* FIXME: forwarder entries ... */
@ -308,20 +312,22 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
TRACE(win32, "--- Ordinal %s,%d\n", Module, ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR)ordinal);
thunk_list->u1.Function=(LPDWORD)MODULE_GetProcAddress32(
process, hImpModule, (LPCSTR)ordinal
);
if (!thunk_list->u1.Function) {
fprintf(stderr,"No implementation for %s.%d, setting to NULL\n",
WARN(win32,"No implementation for %s.%d, setting to NULL\n",
Module, ordinal);
/* fixup_failed=1; */
}
} else { /* import by name */
pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
TRACE(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name);
thunk_list->u1.Function=(LPDWORD)MODULE_GetProcAddress32(
process, hImpModule, pe_name->Name
);
if (!thunk_list->u1.Function) {
fprintf(stderr,"No implementation for %s.%d(%s), setting to NULL\n",
WARN(win32,"No implementation for %s.%d(%s), setting to NULL\n",
Module,pe_name->Hint,pe_name->Name);
/* fixup_failed=1; */
}
@ -338,10 +344,11 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal);
TRACE(win32,"--- Ordinal %s.%d\n",Module,ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR) ordinal);
thunk_list->u1.Function=(LPDWORD)MODULE_GetProcAddress32(
process, hImpModule, (LPCSTR) ordinal
);
if (!thunk_list->u1.Function) {
fprintf(stderr, "No implementation for %s.%d, setting to NULL\n",
WARN(win32, "No implementation for %s.%d, setting to NULL\n",
Module,ordinal);
/* fixup_failed=1; */
}
@ -349,10 +356,11 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
TRACE(win32,"--- %s %s.%d\n",
pe_name->Name,Module,pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name );
thunk_list->u1.Function=(LPDWORD)MODULE_GetProcAddress32(
process, hImpModule, pe_name->Name
);
if (!thunk_list->u1.Function) {
fprintf(stderr, "No implementation for %s.%d, setting to NULL\n",
WARN(win32, "No implementation for %s.%d, setting to NULL\n",
Module, pe_name->Hint);
/* fixup_failed=1; */
}
@ -392,10 +400,12 @@ static int calc_vma_size( HMODULE32 hModule )
return vma_size;
}
static void do_relocations(PE_MODREF *pem)
static void do_relocations(WINE_MODREF *wm)
{
int delta = pem->module - PE_HEADER(pem->module)->OptionalHeader.ImageBase;
unsigned int load_addr= pem->module;
PE_MODREF *pem = &(wm->binfmt.pe);
int delta = wm->module - PE_HEADER(wm->module)->OptionalHeader.ImageBase;
unsigned int load_addr= wm->module;
IMAGE_BASE_RELOCATION *r = pem->pe_reloc;
int hdelta = (delta >> 16) & 0xFFFF;
int ldelta = delta & 0xFFFF;
@ -438,13 +448,13 @@ static void do_relocations(PE_MODREF *pem)
#endif
break;
case IMAGE_REL_BASED_HIGHADJ:
fprintf(stderr, "Don't know what to do with IMAGE_REL_BASED_HIGHADJ\n");
WARN(win32, "Don't know what to do with IMAGE_REL_BASED_HIGHADJ\n");
break;
case IMAGE_REL_BASED_MIPS_JMPADDR:
fprintf(stderr, "Is this a MIPS machine ???\n");
WARN(win32, "Is this a MIPS machine ???\n");
break;
default:
fprintf(stderr, "Unknown fixup type\n");
WARN(win32, "Unknown fixup type\n");
break;
}
}
@ -476,7 +486,7 @@ static HMODULE32 PE_LoadImage( HFILE32 hFile )
0, 0, NULL );
if (!mapping)
{
fprintf( stderr, "PE_LoadImage: CreateFileMapping error %ld\n",
WARN( win32, "CreateFileMapping error %ld\n",
GetLastError() );
return 0;
}
@ -484,34 +494,33 @@ static HMODULE32 PE_LoadImage( HFILE32 hFile )
CloseHandle( mapping );
if (!hModule)
{
fprintf( stderr, "PE_LoadImage: MapViewOfFile error %ld\n",
WARN( win32, "PE_LoadImage: MapViewOfFile error %ld\n",
GetLastError() );
return 0;
}
if (PE_HEADER(hModule)->Signature != IMAGE_NT_SIGNATURE)
{
fprintf(stderr,"image doesn't have PE signature, but 0x%08lx\n",
WARN(win32,"image doesn't have PE signature, but 0x%08lx\n",
PE_HEADER(hModule)->Signature );
goto error;
}
if (PE_HEADER(hModule)->FileHeader.Machine != IMAGE_FILE_MACHINE_I386)
{
fprintf(stderr,"trying to load PE image for unsupported architecture (");
MSG("Trying to load PE image for unsupported architecture (");
switch (PE_HEADER(hModule)->FileHeader.Machine)
{
case IMAGE_FILE_MACHINE_UNKNOWN: fprintf(stderr,"Unknown"); break;
case IMAGE_FILE_MACHINE_I860: fprintf(stderr,"I860"); break;
case IMAGE_FILE_MACHINE_R3000: fprintf(stderr,"R3000"); break;
case IMAGE_FILE_MACHINE_R4000: fprintf(stderr,"R4000"); break;
case IMAGE_FILE_MACHINE_R10000: fprintf(stderr,"R10000"); break;
case IMAGE_FILE_MACHINE_ALPHA: fprintf(stderr,"Alpha"); break;
case IMAGE_FILE_MACHINE_POWERPC: fprintf(stderr,"PowerPC"); break;
default: fprintf(stderr,"Unknown-%04x",
case IMAGE_FILE_MACHINE_UNKNOWN: MSG("Unknown\n"); break;
case IMAGE_FILE_MACHINE_I860: MSG("I860\n"); break;
case IMAGE_FILE_MACHINE_R3000: MSG("R3000\n"); break;
case IMAGE_FILE_MACHINE_R4000: MSG("R4000\n"); break;
case IMAGE_FILE_MACHINE_R10000: MSG("R10000\n"); break;
case IMAGE_FILE_MACHINE_ALPHA: MSG("Alpha\n"); break;
case IMAGE_FILE_MACHINE_POWERPC: MSG("PowerPC\n"); break;
default: MSG("Unknown-%04x\n",
PE_HEADER(hModule)->FileHeader.Machine); break;
}
fprintf(stderr,")\n");
goto error;
}
return hModule;
@ -527,6 +536,7 @@ error:
static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
OFSTRUCT *ofs, DWORD flags )
{
WINE_MODREF *wm;
PE_MODREF *pem;
int i, result;
DWORD load_addr;
@ -539,17 +549,21 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hModule;
IMAGE_NT_HEADERS *nt_header = PE_HEADER(hModule);
pem = (PE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,
sizeof(*pem));
wm = (WINE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,
sizeof(*wm));
wm->type= MODULE32_PE;
pem = &(wm->binfmt.pe);
/* NOTE: fixup_imports takes care of the correct order */
pem->next = process->modref_list;
process->modref_list = pem;
wm->next = process->modref_list;
process->modref_list = wm;
if (!(nt_header->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
if (process->exe_modref)
fprintf(stderr,"overwriting old exe_modref... arrgh\n");
process->exe_modref = pem;
WARN(win32,"overwriting old exe_modref... arrgh\n");
process->exe_modref = wm;
}
load_addr = nt_header->OptionalHeader.ImageBase;
@ -566,10 +580,13 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
/* *phModule is the module32 entry in the NE_MODULE. We need to
* change it here, since it can get referenced by fixup_imports()
*/
pem->module = *phModule = (HMODULE32)load_addr;
wm->module = *phModule = (HMODULE32)load_addr;
TRACE(win32, "Load addr is really %lx, range %x\n",
load_addr, vma_size);
TRACE(segment, "Loading %s at %lx, range %x\n",
ofs->szPathName, load_addr, vma_size );
/* Store the NT header at the load addr
* (FIXME: should really use mmap)
@ -620,7 +637,7 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
if(dir.Size)
{
if(pem->pe_export && (int)pem->pe_export!=RVA(dir.VirtualAddress))
fprintf(stderr,"wrong export directory??\n");
WARN(win32,"wrong export directory??\n");
/* always trust the directory */
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) RVA(dir.VirtualAddress);
}
@ -630,7 +647,7 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
{
/*
if(pem->pe_import && (int)pem->pe_import!=RVA(dir.VirtualAddress))
fprintf(stderr,"wrong import directory??\n");
WARN(win32,"wrong import directory??\n");
*/
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) RVA(dir.VirtualAddress);
}
@ -639,7 +656,7 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
if(dir.Size)
{
if(pem->pe_resource && (int)pem->pe_resource!=RVA(dir.VirtualAddress))
fprintf(stderr,"wrong resource directory??\n");
WARN(win32,"wrong resource directory??\n");
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) RVA(dir.VirtualAddress);
}
@ -655,7 +672,7 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
if(dir.Size)
{
if(pem->pe_reloc && (int)pem->pe_reloc!= RVA(dir.VirtualAddress))
fprintf(stderr,"wrong relocation list??\n");
WARN(win32,"wrong relocation list??\n");
pem->pe_reloc = (void *) RVA(dir.VirtualAddress);
}
@ -685,20 +702,33 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
if(nt_header->OptionalHeader.DataDirectory[15].Size)
FIXME(win32,"Unknown directory 15 ignored\n");
if(pem->pe_reloc) do_relocations(pem);
if(pem->pe_export) dump_exports(pem->module);
if(pem->pe_reloc) do_relocations(wm);
if(pem->pe_export) {
dump_exports(wm->module);
wm->modname = HEAP_strdupA(process->heap,0,(char*)RVA(pem->pe_export->Name));
} else {
/* try to find out the name from the OFSTRUCT */
char *s;
modname = s = ofs->szPathName;
while ((s=strchr(modname,'\\')))
modname = s+1;
if ((s=strchr(modname,'.')))
*s='\0';
wm->modname = HEAP_strdupA(process->heap,0,modname);
}
if(pem->pe_import) {
if (fixup_imports(process,pem)) {
PE_MODREF **xpem;
if (fixup_imports(process,wm)) {
WINE_MODREF **xwm;
/* remove entry from modref chain */
xpem = &(process->modref_list);
while (*xpem) {
if (*xpem==pem) {
*xpem = pem->next;
xwm = &(process->modref_list);
while (*xwm) {
if (*xwm==wm) {
*xwm = wm->next;
break;
}
xpem = &((*xpem)->next);
xwm = &((*xwm)->next);
}
/* FIXME: there are several more dangling references
* left. Including dlls loaded by this dll before the
@ -710,17 +740,6 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
}
}
if (pem->pe_export)
modname = (char*)RVA(pem->pe_export->Name);
else {
char *s;
modname = s = ofs->szPathName;
while ((s=strchr(modname,'\\')))
modname = s+1;
if ((s=strchr(modname,'.')))
*s='\0';
}
/* Now that we got everything at the right address,
* we can unmap the previous module */
UnmapViewOfFile( (LPVOID)hModule );
@ -738,71 +757,52 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
OFSTRUCT ofs;
HMODULE32 hModule;
NE_MODULE *pModule;
PE_MODREF *pem;
WINE_MODREF *wm;
if ((hModule = MODULE_FindModule( name ))) {
/* the .DLL is either loaded or internal */
hModule = MODULE_HANDLEtoHMODULE32(hModule);
if (!HIWORD(hModule)) /* internal (or bad) */
return hModule;
/* check if this module is already mapped */
pem = process->modref_list;
pModule = MODULE_GetPtr(hModule);
while (pem) {
if (pem->module == hModule) {
if ((hModule = MODULE_FindModule32( process, name ))) {
pModule = MODULE_GetPtr32(hModule);
for (wm= process->modref_list;wm;wm=wm->next)
if (wm->module == hModule) {
pModule->count++;
return hModule;
}
pem = pem->next;
}
if (pModule->flags & NE_FFLAGS_BUILTIN) {
IMAGE_DOS_HEADER *dh;
IMAGE_NT_HEADERS *nh;
IMAGE_SECTION_HEADER *sh;
/* we only come here if we already have 'loaded' the
* internal dll but in another process. Just create
* a PE_MODREF and return.
*/
pem = (PE_MODREF*)HeapAlloc(process->heap,
HEAP_ZERO_MEMORY,sizeof(*pem));
pem->module = hModule;
dh = (IMAGE_DOS_HEADER*)pem->module;
nh = (IMAGE_NT_HEADERS*)(dh+1);
sh = (IMAGE_SECTION_HEADER*)(nh+1);
pem->pe_export = (IMAGE_EXPORT_DIRECTORY*)(sh+2);
pem->next = process->modref_list;
process->modref_list = pem;
return hModule;
}
} else {
/* try to load builtin, enabled modules first */
if ((hModule = BUILTIN32_LoadModule( name, FALSE, process )))
return MODULE_HANDLEtoHMODULE32( hModule );
/* try to open the specified file */
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
/* Now try the built-in even if disabled */
if ((hModule = BUILTIN32_LoadModule( name, TRUE, process ))) {
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return MODULE_HANDLEtoHMODULE32( hModule );
}
return 1;
}
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) {
_lclose32(hFile);
return hModule;
}
pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = PE_LoadImage( hFile );
CloseHandle( hFile );
if (pModule->module32 < 32) return 21;
/* Since MODULE_FindModule32 uses the modref chain too, the
* module MUST have been found above. If not, something has gone
* terribly wrong.
*/
assert(0);
}
/* recurse */
/* try to load builtin, enabled modules first */
if ((hModule = BUILTIN32_LoadModule( name, FALSE, process )))
return hModule;
/* try to load the specified dll/exe */
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
/* Now try the built-in even if disabled */
if ((hModule = BUILTIN32_LoadModule( name, TRUE, process ))) {
fprintf( stderr, "Warning: could not load external DLL '%s', using built-in module.\n", name );
return hModule;
}
return 1;
}
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) {
_lclose32(hFile);
return hModule;
}
pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = PE_LoadImage( hFile );
CloseHandle( hFile );
if (pModule->module32 < 32)
{
FreeLibrary32( hModule);
return 21; /* FIXME: probably 0 */
}
/* (possible) recursion */
if (!PE_MapImage( &(pModule->module32), process, &ofs,flags)) {
/* should free this module and the already referenced ones */
/* FIXME: should free this module and its referenced ones */
return 0;
}
return pModule->module32;
@ -829,7 +829,7 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LPCSTR cmd_line,
pModule->module32 = hModule32 = PE_LoadImage( hFile );
if (hModule32 < 32) return 21;
hInstance = MODULE_CreateInstance( hModule16, (cmd_line == NULL) );
hInstance = MODULE_CreateInstance( hModule16, NULL, (cmd_line == NULL) );
if (cmd_line &&
!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
@ -848,9 +848,12 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LPCSTR cmd_line,
return hInstance;
}
/*********************************************************************
* PE_UnloadImage [internal]
*/
int PE_UnloadImage( HMODULE32 hModule )
{
fprintf(stderr,"PEunloadImage() called!\n");
FIXME(win32,"stub.\n");
/* free resources, image, unmap */
return 1;
}
@ -860,10 +863,12 @@ int PE_UnloadImage( HMODULE32 hModule )
* DLL_PROCESS_ATTACH. Only new created threads do DLL_THREAD_ATTACH
* (SDK)
*/
static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
static void PE_InitDLL(WINE_MODREF *wm, DWORD type,LPVOID lpReserved)
{
if (wm->type!=MODULE32_PE)
return;
if (type==DLL_PROCESS_ATTACH)
pem->flags |= PE_MODREF_PROCESS_ATTACHED;
wm->binfmt.pe.flags |= PE_MODREF_PROCESS_ATTACHED;
/* DLL_ATTACH_PROCESS:
* lpreserved is NULL for dynamic loads, not-NULL for static loads
@ -873,14 +878,14 @@ static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
*/
/* Is this a library? And has it got an entrypoint? */
if ((PE_HEADER(pem->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
(PE_HEADER(pem->module)->OptionalHeader.AddressOfEntryPoint)
if ((PE_HEADER(wm->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
(PE_HEADER(wm->module)->OptionalHeader.AddressOfEntryPoint)
) {
FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module,
FARPROC32 entry = (FARPROC32)RVA_PTR( wm->module,
OptionalHeader.AddressOfEntryPoint );
TRACE(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
entry, pem->module, type, lpReserved );
entry( pem->module, type, lpReserved );
entry, wm->module, type, lpReserved );
entry( wm->module, type, lpReserved );
}
}
@ -889,57 +894,70 @@ static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
* LoadLibrary) ... but it won't matter)
*/
void PE_InitializeDLLs(PDB32 *process,DWORD type,LPVOID lpReserved) {
PE_MODREF *pem;
WINE_MODREF *wm;
pem = process->modref_list;
while (pem) {
if (pem->flags & PE_MODREF_NO_DLL_CALLS) {
pem = pem->next;
for (wm = process->modref_list;wm;wm=wm->next) {
PE_MODREF *pem = NULL;
if (wm->type!=MODULE32_PE)
continue;
pem = &(wm->binfmt.pe);
if (pem->flags & PE_MODREF_NO_DLL_CALLS)
continue;
}
if (type==DLL_PROCESS_ATTACH) {
if (pem->flags & PE_MODREF_PROCESS_ATTACHED) {
pem = pem->next;
if (pem->flags & PE_MODREF_PROCESS_ATTACHED)
continue;
}
}
PE_InitDLL( pem, type, lpReserved );
pem = pem->next;
PE_InitDLL( wm, type, lpReserved );
}
}
void PE_InitTls(THDB *thdb)
{
/* FIXME: tls callbacks ??? */
WINE_MODREF *wm;
PE_MODREF *pem;
IMAGE_NT_HEADERS *peh;
DWORD size,datasize;
LPVOID mem;
LPIMAGE_TLS_DIRECTORY pdir;
PDB32 *pdb = thdb->process;
pem = pdb->modref_list;
while (pem) {
peh = PE_HEADER(pem->module);
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress) {
pem = pem->next;
int delta;
for (wm = pdb->modref_list;wm;wm=wm->next) {
if (wm->type!=MODULE32_PE)
continue;
}
pdir = (LPVOID)(pem->module + peh->OptionalHeader.
pem = &(wm->binfmt.pe);
peh = PE_HEADER(wm->module);
delta = wm->module - peh->OptionalHeader.ImageBase;
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress)
continue;
pdir = (LPVOID)(wm->module + peh->OptionalHeader.
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);
if (!(pem->flags & PE_MODREF_TLS_ALLOCED)) {
pem->tlsindex = THREAD_TlsAlloc(thdb);
*(pdir->AddressOfIndex)=pem->tlsindex;
*(LPDWORD)AdjustPtr(pdir->AddressOfIndex,delta)
=pem->tlsindex;
}
pem->flags |= PE_MODREF_TLS_ALLOCED;
datasize= pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
size = datasize + pdir->SizeOfZeroFill;
mem=VirtualAlloc(0,size,MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE);
memcpy(mem,(LPVOID) pdir->StartAddressOfRawData, datasize);
memcpy(mem,
AdjustPtr(pdir->StartAddressOfRawData,delta),
datasize);
/* don't use TlsSetValue, we are in the wrong thread */
if (pdir->AddressOfCallBacks) {
LPIMAGE_TLS_CALLBACK *cbs =
(LPIMAGE_TLS_CALLBACK *)
AdjustPtr(pdir->AddressOfCallBacks, delta);
if (*cbs) {
FIXME(win32, "TLS Callbacks aren't going to be called\n");
}
}
thdb->tls_array[pem->tlsindex] = mem;
pem=pem->next;
}
}
@ -949,13 +967,10 @@ void PE_InitTls(THDB *thdb)
*/
BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32 hModule)
{
PDB32 *process = PROCESS_Current();
PE_MODREF *pem = process->modref_list;
WINE_MODREF *wm;
while (pem) {
if (pem->module == hModule)
pem->flags|=PE_MODREF_NO_DLL_CALLS;
pem = pem->next;
}
for (wm=PROCESS_Current()->modref_list;wm;wm=wm->next)
if ((wm->module == hModule) && (wm->type==MODULE32_PE))
wm->binfmt.pe.flags|=PE_MODREF_NO_DLL_CALLS;
return TRUE;
}

View File

@ -31,18 +31,13 @@
*/
static PE_MODREF*
HMODULE32toPE_MODREF(HMODULE32 hmod) {
NE_MODULE *pModule;
WINE_MODREF *wm;
PDB32 *pdb = PROCESS_Current();
PE_MODREF *pem;
if (!hmod) hmod = GetTaskDS(); /* FIXME: correct? */
hmod = MODULE_HANDLEtoHMODULE32( hmod );
if (!hmod) return NULL;
if (!(pModule = MODULE_GetPtr( hmod ))) return 0;
pem = pdb->modref_list;
while (pem && pem->module != hmod)
pem=pem->next;
return pem;
wm = MODULE32_LookupHMODULE( pdb, hmod );
if (!wm || wm->type!=MODULE32_PE)
return NULL;
return &(wm->binfmt.pe);
}
/**********************************************************************
@ -106,12 +101,12 @@ LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY resdirptr,
* PE_FindResourceEx32W
*/
HANDLE32 PE_FindResourceEx32W(
HINSTANCE32 hModule,LPCWSTR name,LPCWSTR type,WORD lang
WINE_MODREF *wm,LPCWSTR name,LPCWSTR type,WORD lang
) {
LPIMAGE_RESOURCE_DIRECTORY resdirptr;
DWORD root;
HANDLE32 result;
PE_MODREF *pem = HMODULE32toPE_MODREF(hModule);
PE_MODREF *pem = &(wm->binfmt.pe);
if (!pem || !pem->pe_resource)
return 0;
@ -133,15 +128,11 @@ HANDLE32 PE_FindResourceEx32W(
/**********************************************************************
* PE_LoadResource32
*/
HANDLE32 PE_LoadResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
HANDLE32 PE_LoadResource32( WINE_MODREF *wm, HANDLE32 hRsrc )
{
PE_MODREF *pem = HMODULE32toPE_MODREF(hModule);
if (!pem || !pem->pe_resource)
if (!hRsrc || !wm || wm->type!=MODULE32_PE)
return 0;
if (!hRsrc)
return 0;
return (HANDLE32) (pem->module + ((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
return (HANDLE32) (wm->module + ((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
}

View File

@ -5,6 +5,7 @@
* Copyright 1995 Alexandre Julliard
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -18,6 +19,7 @@
#include "heap.h"
#include "neexe.h"
#include "task.h"
#include "process.h"
#include "module.h"
#include "resource.h"
#include "debug.h"
@ -26,65 +28,11 @@
extern WORD WINE_LanguageId;
/* error message when 16-bit resource function is called for Win32 module */
static const char* NEWin32FailureString = "fails with Win32 module\n";
/* error message when 32-bit resource function is called for Win16 module */
static const char* PEWin16FailureString = "fails with Win16 module\n";
/**********************************************************************
* FindResource16 (KERNEL.60)
*/
HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
{
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
if (HIWORD(name)) /* Check for '#xxx' name */
{
char *ptr = PTR_SEG_TO_LIN( name );
if (ptr[0] == '#')
if (!(name = (SEGPTR)atoi( ptr + 1 ))) {
WARN(resource, "Incorrect resource name: %s\n", ptr);
return 0;
}
}
if (HIWORD(type)) /* Check for '#xxx' type */
{
char *ptr = PTR_SEG_TO_LIN( type );
if (ptr[0] == '#')
if (!(type = (SEGPTR)atoi( ptr + 1 ))){
WARN(resource, "Incorrect resource type: %s\n", ptr);
return 0;
}
}
TRACE(resource, "module=%04x name=%s type=%s\n",
hModule, debugres_a(PTR_SEG_TO_LIN(name)),
debugres_a(PTR_SEG_TO_LIN(type)) );
if ((pModule = MODULE_GetPtr( hModule )))
{
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"FindResource16: %s", NEWin32FailureString);
else
return NE_FindResource( hModule, type, name );
}
else return LIBRES_FindResource16( hModule,
(LPCSTR)PTR_SEG_TO_LIN(name),
(LPCSTR)PTR_SEG_TO_LIN(type) );
}
return 0;
}
/**********************************************************************
* FindResource32A (KERNEL32.128)
*/
HANDLE32 WINAPI FindResource32A( HINSTANCE32 hModule, LPCSTR name, LPCSTR type)
HANDLE32 WINAPI FindResource32A( HMODULE32 hModule, LPCSTR name, LPCSTR type)
{
return FindResourceEx32A(hModule,name,type,WINE_LanguageId);
}
@ -92,9 +40,9 @@ HANDLE32 WINAPI FindResource32A( HINSTANCE32 hModule, LPCSTR name, LPCSTR type)
/**********************************************************************
* FindResourceEx32A (KERNEL32.129)
*/
HANDLE32 WINAPI FindResourceEx32A( HINSTANCE32 hModule, LPCSTR name,
LPCSTR type, WORD lang )
{
HANDLE32 WINAPI FindResourceEx32A( HMODULE32 hModule, LPCSTR name, LPCSTR type,
WORD lang
) {
LPWSTR xname,xtype;
HANDLE32 ret;
@ -116,27 +64,34 @@ HANDLE32 WINAPI FindResourceEx32A( HINSTANCE32 hModule, LPCSTR name,
/**********************************************************************
* FindResourceEx32W (KERNEL32.130)
*/
HRSRC32 WINAPI FindResourceEx32W( HINSTANCE32 hModule, LPCWSTR name,
HRSRC32 WINAPI FindResourceEx32W( HMODULE32 hModule, LPCWSTR name,
LPCWSTR type, WORD lang )
{
if (!__winelib)
{
NE_MODULE *pModule;
WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule);
HRSRC32 hrsrc;
if (!hModule) hModule = GetTaskDS();
hModule = MODULE_HANDLEtoHMODULE32( hModule );
TRACE(resource, "module=%08x "
"type=%s%p name=%s%p\n", hModule,
(HIWORD(type))? "" : "#", type,
(HIWORD(name))? "" : "#", name);
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0;
return PE_FindResourceEx32W(hModule,name,type,lang);
TRACE(resource, "module=%08x "
"type=%s%p name=%s%p\n", wm->module,
(HIWORD(type))? "" : "#", type,
(HIWORD(name))? "" : "#", name);
if (__winelib) {
hrsrc = LIBRES_FindResource( hModule, name, type );
if (hrsrc)
return hrsrc;
}
else return LIBRES_FindResource32( hModule, name, type );
if (wm) {
switch (wm->type) {
case MODULE32_PE:
return PE_FindResourceEx32W(wm,name,type,lang);
default:
ERR(module,"unknown module type %d\n",wm->type);
break;
}
}
return (HRSRC32)0;
}
/**********************************************************************
* FindResource32W (KERNEL32.131)
*/
@ -146,99 +101,36 @@ HRSRC32 WINAPI FindResource32W(HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type)
}
/**********************************************************************
* LoadResource16 (KERNEL.61)
*/
HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if ((pModule = MODULE_GetPtr( hModule )))
{
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"LoadResource16: %s", NEWin32FailureString);
else
return NE_LoadResource( hModule, hRsrc );
}
else return LIBRES_LoadResource( hModule, hRsrc );
}
return 0;
}
/**********************************************************************
* LoadResource32 (KERNEL32.370)
* 'loads' a resource. The current implementation just returns a pointer
* into the already mapped image.
* RETURNS
* pointer into the mapped resource of the passed module
*/
HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
HGLOBAL32 WINAPI LoadResource32(
HINSTANCE32 hModule, /* [in] module handle */
HRSRC32 hRsrc ) /* [in] resource handle */
{
if (!__winelib)
{
NE_MODULE *pModule;
WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule);
if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32))
{
fprintf(stderr,"LoadResource32: %s", PEWin16FailureString );
return 0; /* FIXME? */
}
return PE_LoadResource32(hModule,hRsrc);
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) {
ERR(resource,"hRsrc is 0, return 0.\n");
return 0;
}
else return LIBRES_LoadResource( hModule, hRsrc );
}
/**********************************************************************
* LockResource (KERNEL.62)
*/
/* 16-bit version */
SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16 handle)
{
HMODULE16 hModule;
NE_MODULE *pModule;
TRACE(resource, "handle=%04x\n", handle );
if (!handle) return (SEGPTR)0;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"LockResource16: %s", NEWin32FailureString);
return 0;
}
return NE_LockResource( hModule, handle );
}
/* Winelib 16-bit version */
LPVOID WINAPI LockResource16( HGLOBAL16 handle )
{
if (!__winelib)
{
HMODULE16 hModule;
NE_MODULE *pModule;
TRACE(resource, "handle=%04x\n", handle );
if (!handle) return NULL;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"LockResource16: %s", NEWin32FailureString);
return 0;
}
return (LPSTR)PTR_SEG_TO_LIN( NE_LockResource( hModule, handle ) );
}
else return LIBRES_LockResource( handle );
if (wm)
switch (wm->type) {
case MODULE32_PE:
return PE_LoadResource32(wm,hRsrc);
default:
ERR(resource,"unknown module type %d\n",wm->type);
break;
}
if (__winelib)
return LIBRES_LoadResource( hModule, hRsrc );
return 0;
}
@ -251,30 +143,6 @@ LPVOID WINAPI LockResource32( HGLOBAL32 handle )
}
/**********************************************************************
* FreeResource16 (KERNEL.63)
*/
BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
{
if (!__winelib)
{
HMODULE16 hModule;
NE_MODULE *pModule;
TRACE(resource, "handle=%04x\n", handle );
if (!handle) return FALSE;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"FreeResource16: %s", NEWin32FailureString);
return 0;
}
return NE_FreeResource( hModule, handle );
}
else return LIBRES_FreeResource( handle );
}
/**********************************************************************
* FreeResource32 (KERNEL32.145)
*/
@ -285,126 +153,42 @@ BOOL32 WINAPI FreeResource32( HGLOBAL32 handle )
}
/**********************************************************************
* AccessResource16 (KERNEL.64)
*/
INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"AccessResource16: %s", NEWin32FailureString);
return 0;
}
return NE_AccessResource( hModule, hRsrc );
}
else return LIBRES_AccessResource( hModule, hRsrc );
}
/**********************************************************************
* AccessResource32 (KERNEL32.64)
*/
INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
INT32 WINAPI AccessResource32( HMODULE32 hModule, HRSRC32 hRsrc )
{
hModule = MODULE_HANDLEtoHMODULE32( hModule );
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
fprintf(stderr,"AccessResource32: not implemented\n");
FIXME(resource,"(module=%08x res=%08x),not implemented\n", hModule, hRsrc);
return 0;
}
/**********************************************************************
* SizeofResource16 (KERNEL.65)
*/
DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"SizeOfResource16: %s", NEWin32FailureString);
return 0;
}
return NE_SizeofResource( hModule, hRsrc );
}
else return LIBRES_SizeofResource( hModule, hRsrc );
}
/**********************************************************************
* SizeofResource32 (KERNEL32.522)
*/
DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
hModule = MODULE_HANDLEtoHMODULE32( hModule );
TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc );
if (!__winelib) return PE_SizeofResource32(hModule,hRsrc);
else
{
fprintf(stderr,"SizeofResource32: not implemented\n");
return 0;
}
}
WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule);
/**********************************************************************
* AllocResource16 (KERNEL.66)
*/
HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
{
NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule );
TRACE(resource, "module=%04x res=%04x size=%ld\n",
hModule, hRsrc, size );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
TRACE(resource, "module=%08x res=%08x\n", hModule, hRsrc );
if (wm)
switch (wm->type)
{
fprintf(stderr,"AllocResource16: %s", NEWin32FailureString);
return 0;
}
return NE_AllocResource( hModule, hRsrc, size );
}
else return LIBRES_AllocResource( hModule, hRsrc, size );
}
/**********************************************************************
* DirectResAlloc (KERNEL.168)
*
* Check Schulman, p. 232 for details
*/
HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
UINT16 wSize )
{
TRACE(resource,"(%04x,%04x,%04x)\n",
hInstance, wType, wSize );
hInstance = MODULE_HANDLEtoHMODULE16(hInstance);
if(!hInstance)return 0;
if(wType != 0x10) /* 0x10 is the only observed value, passed from
CreateCursorIndirect. */
fprintf(stderr, "DirectResAlloc: wType = %x\n", wType);
return GLOBAL_Alloc(GMEM_MOVEABLE, wSize, hInstance, FALSE, FALSE, FALSE);
case MODULE32_PE:
{
DWORD ret;
ret = PE_SizeofResource32(hModule,hRsrc);
if (ret)
return ret;
break;
}
default:
ERR(module,"unknown module type %d\n",wm->type);
break;
}
if (__winelib)
fprintf(stderr,"SizeofResource32: not implemented for WINELIB\n");
return 0;
}
@ -576,14 +360,22 @@ HACCEL32 WINAPI CreateAcceleratorTable32A(LPACCEL32 lpaccel, INT32 cEntries)
return hAccel;
}
/**********************************************************************
* DestroyAcceleratorTable (USER32.130)
/******************************************************************************
* DestroyAcceleratorTable [USER32.130]
* Destroys an accelerator table
*
* By mortene@pvv.org 980321
* NOTES
* By mortene@pvv.org 980321
*
* PARAMS
* handle [I] Handle to accelerator table
*
* RETURNS STD
*/
BOOL32 WINAPI DestroyAcceleratorTable( HACCEL32 handle )
{
FIXME(accel, "stub (handle 0x%x)\n", handle);
FIXME(accel, "(0x%x): stub\n", handle);
/* Weird.. I thought this should work. According to the API
@ -647,8 +439,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
buffer[0] = '\0';
return 0;
}
fprintf(stderr,"LoadString // I dont know why , but caller give buflen=%d *p=%d !\n", buflen, *p);
fprintf(stderr,"LoadString // and try to obtain string '%s'\n", p + 1);
WARN(resource,"Dont know why caller give buflen=%d *p=%d trying to obtain string '%s'\n", buflen, *p, p + 1);
}
FreeResource16( hmem );
@ -698,8 +489,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
return 0;
}
#if 0
fprintf(stderr,"LoadString // I dont know why , but caller give buflen=%d *p=%d !\n", buflen, *p);
fprintf(stderr,"LoadString // and try to obtain string '%s'\n", p + 1);
WARN(resource,"Dont know why caller give buflen=%d *p=%d trying to obtain string '%s'\n", buflen, *p, p + 1);
#endif
}
@ -757,7 +547,7 @@ INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
/**********************************************************************
* LoadMessage32A (internal)
*/
INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
INT32 LoadMessage32A( HMODULE32 instance, UINT32 id, WORD lang,
LPSTR buffer, INT32 buflen )
{
HGLOBAL32 hmem;
@ -824,7 +614,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
/**********************************************************************
* LoadMessage32W (internal)
*/
INT32 LoadMessage32W( HINSTANCE32 instance, UINT32 id, WORD lang,
INT32 LoadMessage32W( HMODULE32 instance, UINT32 id, WORD lang,
LPWSTR buffer, INT32 buflen )
{
INT32 retval;
@ -844,36 +634,13 @@ INT32 LoadMessage32W( HINSTANCE32 instance, UINT32 id, WORD lang,
}
/**********************************************************************
* SetResourceHandler (KERNEL.43)
*/
FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR s,
FARPROC16 resourceHandler )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule );
TRACE(resource, "module=%04x type=%s\n",
hModule, debugres_a(PTR_SEG_TO_LIN(s)) );
if ((pModule = MODULE_GetPtr( hModule )))
{
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"SetResourceHandler: %s\n", NEWin32FailureString);
else if (pModule->res_table)
return NE_SetResourceHandler( hModule, s, resourceHandler );
}
return NULL;
}
/**********************************************************************
* EnumResourceTypesA (KERNEL32.90)
*/
BOOL32 WINAPI EnumResourceTypes32A( HMODULE32 hmodule,ENUMRESTYPEPROC32A lpfun,
LONG lParam)
{
/* FIXME: move WINE_MODREF stuff here */
return PE_EnumResourceTypes32A(hmodule,lpfun,lParam);
}
@ -883,6 +650,7 @@ BOOL32 WINAPI EnumResourceTypes32A( HMODULE32 hmodule,ENUMRESTYPEPROC32A lpfun,
BOOL32 WINAPI EnumResourceTypes32W( HMODULE32 hmodule,ENUMRESTYPEPROC32W lpfun,
LONG lParam)
{
/* FIXME: move WINE_MODREF stuff here */
return PE_EnumResourceTypes32W(hmodule,lpfun,lParam);
}
@ -892,6 +660,7 @@ BOOL32 WINAPI EnumResourceTypes32W( HMODULE32 hmodule,ENUMRESTYPEPROC32W lpfun,
BOOL32 WINAPI EnumResourceNames32A( HMODULE32 hmodule, LPCSTR type,
ENUMRESNAMEPROC32A lpfun, LONG lParam )
{
/* FIXME: move WINE_MODREF stuff here */
return PE_EnumResourceNames32A(hmodule,type,lpfun,lParam);
}
/**********************************************************************
@ -900,6 +669,7 @@ BOOL32 WINAPI EnumResourceNames32A( HMODULE32 hmodule, LPCSTR type,
BOOL32 WINAPI EnumResourceNames32W( HMODULE32 hmodule, LPCWSTR type,
ENUMRESNAMEPROC32W lpfun, LONG lParam )
{
/* FIXME: move WINE_MODREF stuff here */
return PE_EnumResourceNames32W(hmodule,type,lpfun,lParam);
}
@ -910,6 +680,7 @@ BOOL32 WINAPI EnumResourceLanguages32A( HMODULE32 hmodule, LPCSTR type,
LPCSTR name, ENUMRESLANGPROC32A lpfun,
LONG lParam)
{
/* FIXME: move WINE_MODREF stuff here */
return PE_EnumResourceLanguages32A(hmodule,type,name,lpfun,lParam);
}
/**********************************************************************
@ -919,5 +690,6 @@ BOOL32 WINAPI EnumResourceLanguages32W( HMODULE32 hmodule, LPCWSTR type,
LPCWSTR name, ENUMRESLANGPROC32W lpfun,
LONG lParam)
{
/* FIXME: move WINE_MODREF stuff here */
return PE_EnumResourceLanguages32W(hmodule,type,name,lpfun,lParam);
}

View File

@ -208,7 +208,7 @@ static void TASK_CallToStart(void)
{
int exit_code = 1;
TDB *pTask = (TDB *)GlobalLock16( hCurrentTask );
NE_MODULE *pModule = MODULE_GetPtr( pTask->hModule );
NE_MODULE *pModule = MODULE_GetPtr16( pTask->hModule );
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
SET_CUR_THREAD( pTask->thdb );
@ -262,7 +262,7 @@ static void TASK_CallToStart(void)
Callbacks->CallRegisterShortProc( &context, 0 );
/* This should never return */
fprintf( stderr, "TASK_CallToStart: Main program returned!\n" );
ERR( task, "Main program returned! (should never happen)\n" );
TASK_KillCurrentTask( 1 );
}
}
@ -331,7 +331,7 @@ HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
pTask->pdb.int20 = 0x20cd;
pTask->pdb.dispatcher[0] = 0x9a; /* ljmp */
PUT_DWORD(&pTask->pdb.dispatcher[1], (DWORD)MODULE_GetEntryPoint(
PUT_DWORD(&pTask->pdb.dispatcher[1], (DWORD)NE_GetEntryPoint(
GetModuleHandle16("KERNEL"), 102 )); /* KERNEL.102 is DOS3Call() */
pTask->pdb.savedint22 = INT_GetHandler( 0x22 );
pTask->pdb.savedint23 = INT_GetHandler( 0x23 );
@ -509,7 +509,7 @@ void TASK_KillCurrentTask( INT16 exitCode )
/* We should never return from this Yield() */
fprintf(stderr,"Return of the living dead %04x!!!\n", hCurrentTask);
ERR(task,"Return of the living dead %04x!!!\n", hCurrentTask);
exit(1);
}
@ -660,7 +660,7 @@ void WINAPI InitTask( CONTEXT *context )
if (context) EAX_reg(context) = 0;
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pModule = MODULE_GetPtr( pTask->hModule ))) return;
if (!(pModule = MODULE_GetPtr16( pTask->hModule ))) return;
/* This is a hack to install task USER signal handler before
* implicitly loaded DLLs are initialized (see windows/user.c) */
@ -681,7 +681,6 @@ void WINAPI InitTask( CONTEXT *context )
* es:bx pointer to command-line inside PSP
*/
EAX_reg(context) = 1;
EBX_reg(context) = pTask->pdb.cmdLine[0] ? 0x81 : 0x80;
if (!pTask->pdb.cmdLine[0]) EBX_reg(context) = 0x80;
else
@ -857,7 +856,6 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
SEGPTR thunkaddr;
if (!hInstance) return 0;
if (__winelib) return func; /* func can be called directly in Winelib */
thunkaddr = TASK_AllocThunk( hCurrentTask );
if (!thunkaddr) return (FARPROC16)0;
thunk = PTR_SEG_TO_LIN( thunkaddr );
@ -868,7 +866,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) ||
((lfunc[0]==0x1e) && (lfunc[1]==0x58))
) {
fprintf(stderr,"FIXME: MakeProcInstance16 thunk would be useless for %p, overwriting with nop;nop;\n", func );
FIXME(task,"thunk would be useless for %p, overwriting with nop;nop;\n", func );
lfunc[0]=0x90; /* nop */
lfunc[1]=0x90; /* nop */
}
@ -888,7 +886,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
void WINAPI FreeProcInstance16( FARPROC16 func )
{
TRACE(task, "(%08lx)\n", (DWORD)func );
if (!__winelib) TASK_FreeThunk( hCurrentTask, (SEGPTR)func );
TASK_FreeThunk( hCurrentTask, (SEGPTR)func );
}
@ -900,8 +898,6 @@ HANDLE16 WINAPI GetCodeHandle( FARPROC16 proc )
HANDLE16 handle;
BYTE *thunk = (BYTE *)PTR_SEG_TO_LIN( proc );
if (__winelib) return 0;
/* Return the code segment containing 'proc'. */
/* Not sure if this is really correct (shouldn't matter that much). */
@ -1015,7 +1011,7 @@ void WINAPI SwitchStackBack(void)
return;
if (!pData->old_ss_sp)
{
fprintf( stderr, "SwitchStackBack: no previous SwitchStackTo\n" );
WARN( task, "No previous SwitchStackTo\n" );
return;
}
TRACE(task, "restoring stack %04x:%04x\n",

View File

@ -28,8 +28,8 @@
static const char ENV_program_name[] = "C:\\WINDOWS\\SYSTEM\\KRNL386.EXE";
/* Maximum length of an environment string (including NULL) */
#define MAX_STR_LEN 128
/* Maximum length of a Win16 environment string (including NULL) */
#define MAX_WIN16_LEN 128
/* Extra bytes to reserve at the end of an environment */
#define EXTRA_ENV_SIZE (sizeof(BYTE) + sizeof(WORD) + sizeof(ENV_program_name))
@ -68,29 +68,23 @@ BOOL32 ENV_BuildEnvironment( PDB32 *pdb )
{
extern char **environ;
LPSTR p, *e;
int size, len;
int size;
/* Compute the total size of the Unix environment */
size = EXTRA_ENV_SIZE;
for (e = environ; *e; e++)
{
len = strlen(*e) + 1;
size += MIN( len, MAX_STR_LEN );
}
for (e = environ; *e; e++) size += strlen(*e) + 1;
/* Now allocate the environment */
if (!(p = HeapAlloc( SystemHeap, 0, size ))) return FALSE;
pdb->env_db->environ = p;
pdb->env_db->env_sel = SELECTOR_AllocBlock( p, 0x10000, SEGMENT_DATA,
FALSE, FALSE );
/* And fill it with the Unix environment */
for (e = environ; *e; e++)
{
lstrcpyn32A( p, *e, MAX_STR_LEN );
strcpy( p, *e );
p += strlen(p) + 1;
}
@ -110,16 +104,24 @@ BOOL32 ENV_BuildEnvironment( PDB32 *pdb )
BOOL32 ENV_InheritEnvironment( PDB32 *pdb, LPCSTR env )
{
DWORD size;
LPCSTR p;
LPCSTR src;
LPSTR dst;
/* FIXME: should lock the parent environment */
if (!env) env = pdb->parent->env_db->environ;
/* Compute the environment size */
p = env;
while (*p) p += strlen(p) + 1;
size = (p - env);
src = env;
size = EXTRA_ENV_SIZE;
while (*src)
{
int len = strlen(src) + 1;
src += len;
if ((len > MAX_WIN16_LEN) && (pdb->flags & PDB32_WIN16_PROC))
len = MAX_WIN16_LEN;
size += len;
}
/* Copy the environment */
@ -129,8 +131,18 @@ BOOL32 ENV_InheritEnvironment( PDB32 *pdb, LPCSTR env )
pdb->env_db->env_sel = SELECTOR_AllocBlock( pdb->env_db->environ,
0x10000, SEGMENT_DATA,
FALSE, FALSE );
memcpy( pdb->env_db->environ, env, size );
FILL_EXTRA_ENV( pdb->env_db->environ + size );
src = env;
dst = pdb->env_db->environ;
while (*src)
{
if (pdb->flags & PDB32_WIN16_PROC)
lstrcpyn32A( dst, src, MAX_WIN16_LEN );
else
strcpy( dst, src );
src += strlen(src) + 1;
dst += strlen(dst) + 1;
}
FILL_EXTRA_ENV( dst );
return TRUE;
}
@ -314,7 +326,8 @@ BOOL32 WINAPI SetEnvironmentVariable32A( LPCSTR name, LPCSTR value )
}
if (!(new_env = HeapReAlloc( pdb->heap, 0, env, old_size + len )))
goto done;
SELECTOR_MoveBlock( pdb->env_db->env_sel, new_env );
if (pdb->env_db->env_sel)
SELECTOR_MoveBlock( pdb->env_db->env_sel, new_env );
p = new_env + (p - env);
if (len > 0) memmove( p + len, p, old_size - (p - new_env) );

View File

@ -418,7 +418,7 @@ HGLOBAL16 WINAPI GlobalFree16(
void *ptr;
if (!VALID_HANDLE(handle)) {
fprintf(stderr," Invalid handle 0x%04x passed to GlobalFree16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalFree16!\n",handle);
return 0;
}
ptr = (void *)GET_ARENA_PTR(handle)->base;
@ -452,7 +452,7 @@ SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle )
#endif /* CONFIG_IPC */
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to WIN16_GlobalLock16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to WIN16_GlobalLock16!\n",handle);
return (SEGPTR)0;
}
if (!GET_ARENA_PTR(handle)->base) return (SEGPTR)0;
@ -501,7 +501,7 @@ BOOL16 WINAPI GlobalUnlock16(
) {
GLOBALARENA *pArena = GET_ARENA_PTR(handle);
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnlock16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalUnlock16!\n",handle);
return 0;
}
TRACE(global, "%04x\n", handle );
@ -541,7 +541,7 @@ DWORD WINAPI GlobalHandle16(
) {
TRACE(global, "%04x\n", sel );
if (!VALID_HANDLE(sel)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandle16!\n",sel);
WARN(global,"Invalid handle 0x%04x passed to GlobalHandle16!\n",sel);
return 0;
}
return MAKELONG( GET_ARENA_PTR(sel)->handle, GlobalHandleToSel(sel) );
@ -578,7 +578,7 @@ UINT16 WINAPI GlobalFlags16(
TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFlags16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalFlags16!\n",handle);
return 0;
}
pArena = GET_ARENA_PTR(handle);
@ -596,7 +596,7 @@ HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle )
TRACE(global, "%04x\n", handle );
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to LockSegment16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to LockSegment16!\n",handle);
return 0;
}
GET_ARENA_PTR(handle)->lockCount++;
@ -612,7 +612,7 @@ void WINAPI UnlockSegment16( HGLOBAL16 handle )
TRACE(global, "%04x\n", handle );
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to UnlockSegment16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to UnlockSegment16!\n",handle);
return;
}
GET_ARENA_PTR(handle)->lockCount--;
@ -759,7 +759,7 @@ WORD WINAPI GlobalPageLock( HGLOBAL16 handle )
{
TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageLock!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalPageLock!\n",handle);
return 0;
}
return ++(GET_ARENA_PTR(handle)->pageLockCount);
@ -773,7 +773,7 @@ WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle )
{
TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageUnlock!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalPageUnlock!\n",handle);
return 0;
}
return --(GET_ARENA_PTR(handle)->pageLockCount);
@ -787,7 +787,7 @@ void WINAPI GlobalFix16( HGLOBAL16 handle )
{
TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFix16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalFix16!\n",handle);
return;
}
GET_ARENA_PTR(handle)->lockCount++;
@ -801,7 +801,7 @@ void WINAPI GlobalUnfix16( HGLOBAL16 handle )
{
TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnfix16!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalUnfix16!\n",handle);
return;
}
GET_ARENA_PTR(handle)->lockCount--;
@ -814,7 +814,7 @@ void WINAPI GlobalUnfix16( HGLOBAL16 handle )
void WINAPI FarSetOwner( HGLOBAL16 handle, HANDLE16 hOwner )
{
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to FarSetOwner!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to FarSetOwner!\n",handle);
return;
}
GET_ARENA_PTR(handle)->hOwner = hOwner;
@ -827,7 +827,7 @@ void WINAPI FarSetOwner( HGLOBAL16 handle, HANDLE16 hOwner )
HANDLE16 WINAPI FarGetOwner( HGLOBAL16 handle )
{
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to FarGetOwner!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to FarGetOwner!\n",handle);
return 0;
}
return GET_ARENA_PTR(handle)->hOwner;
@ -845,12 +845,12 @@ WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle )
if (is_dde_handle(handle)) return DDE_GlobalHandleToSel(handle);
#endif
if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandleToSel!\n",handle);
WARN(global,"Invalid handle 0x%04x passed to GlobalHandleToSel!\n",handle);
return 0;
}
if (!(handle & 7))
{
fprintf( stderr, "Program attempted invalid selector conversion\n" );
WARN(global, "Program attempted invalid selector conversion\n" );
return handle - 1;
}
return handle | 7;

View File

@ -188,7 +188,7 @@ static HEAP *HEAP_GetPtr(
HEAP *heapPtr = (HEAP *)heap;
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
{
fprintf( stderr, "Invalid heap %08x!\n", heap );
WARN(heap, "Invalid heap %08x!\n", heap );
SetLastError( ERROR_INVALID_HANDLE );
return NULL;
}
@ -258,7 +258,7 @@ static BOOL32 HEAP_Commit( SUBHEAP *subheap, void *ptr )
size - subheap->commitSize, MEM_COMMIT,
PAGE_EXECUTE_READWRITE))
{
fprintf( stderr, "HEAP_Commit: could not commit %08lx bytes at %08lx for heap %08lx\n",
WARN(heap, "Could not commit %08lx bytes at %08lx for heap %08lx\n",
size - subheap->commitSize,
(DWORD)((char *)subheap + subheap->commitSize),
(DWORD)subheap->heap );
@ -282,7 +282,7 @@ static BOOL32 HEAP_Decommit( SUBHEAP *subheap, void *ptr )
if (!VirtualFree( (char *)subheap + size,
subheap->commitSize - size, MEM_DECOMMIT ))
{
fprintf( stderr, "HEAP_Decommit: could not decommit %08lx bytes at %08lx for heap %08lx\n",
WARN(heap, "Could not decommit %08lx bytes at %08lx for heap %08lx\n",
subheap->commitSize - size,
(DWORD)((char *)subheap + size),
(DWORD)subheap->heap );
@ -458,13 +458,13 @@ static SUBHEAP *HEAP_CreateSubHeap( DWORD flags, DWORD commitSize,
if (!(subheap = VirtualAlloc( NULL, totalSize,
MEM_RESERVE, PAGE_EXECUTE_READWRITE )))
{
fprintf( stderr, "HEAP_CreateSubHeap: could not VirtualAlloc %08lx bytes\n",
WARN(heap, "Could not VirtualAlloc %08lx bytes\n",
totalSize );
return NULL;
}
if (!VirtualAlloc(subheap, commitSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE))
{
fprintf( stderr, "HEAP_CreateSubHeap: could not commit %08lx bytes for sub-heap %08lx\n",
WARN(heap, "Could not commit %08lx bytes for sub-heap %08lx\n",
commitSize, (DWORD)subheap );
VirtualFree( subheap, 0, MEM_RELEASE );
return NULL;
@ -479,7 +479,7 @@ static SUBHEAP *HEAP_CreateSubHeap( DWORD flags, DWORD commitSize,
(flags & HEAP_WINE_CODESEG) != 0, FALSE );
if (!selector)
{
fprintf( stderr, "HEAP_CreateSubHeap: could not allocate selector\n" );
WARN(heap, "Could not allocate selector\n" );
VirtualFree( subheap, 0, MEM_RELEASE );
return NULL;
}
@ -534,7 +534,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, DWORD size,
if (!(heap->flags & HEAP_GROWABLE))
{
fprintf( stderr, "HEAP_FindFreeBlock: Not enough space in heap %08lx for %08lx bytes\n",
WARN(heap, "Not enough space in heap %08lx for %08lx bytes\n",
(DWORD)heap, size );
return NULL;
}
@ -586,7 +586,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
/* Check magic number */
if (pArena->magic != ARENA_FREE_MAGIC)
{
fprintf( stderr, "Heap %08lx: invalid free arena magic for %08lx\n",
WARN(heap, "Heap %08lx: invalid free arena magic for %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena );
return FALSE;
}
@ -594,20 +594,20 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
if (!(pArena->size & ARENA_FLAG_FREE) ||
(pArena->size & ARENA_FLAG_PREV_FREE))
{
fprintf( stderr, "Heap %08lx: bad flags %lx for free arena %08lx\n",
WARN(heap, "Heap %08lx: bad flags %lx for free arena %08lx\n",
(DWORD)subheap->heap, pArena->size & ~ARENA_SIZE_MASK, (DWORD)pArena );
}
/* Check arena size */
if ((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK) > heapEnd)
{
fprintf( stderr, "Heap %08lx: bad size %08lx for free arena %08lx\n",
WARN(heap, "Heap %08lx: bad size %08lx for free arena %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena->size & ARENA_SIZE_MASK, (DWORD)pArena );
return FALSE;
}
/* Check that next pointer is valid */
if (!HEAP_IsValidArenaPtr( subheap->heap, pArena->next ))
{
fprintf( stderr, "Heap %08lx: bad next ptr %08lx for arena %08lx\n",
WARN(heap, "Heap %08lx: bad next ptr %08lx for arena %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena->next, (DWORD)pArena );
return FALSE;
}
@ -615,14 +615,14 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
if (!(pArena->next->size & ARENA_FLAG_FREE) ||
(pArena->next->magic != ARENA_FREE_MAGIC))
{
fprintf( stderr, "Heap %08lx: next arena %08lx invalid for %08lx\n",
WARN(heap, "Heap %08lx: next arena %08lx invalid for %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena->next, (DWORD)pArena );
return FALSE;
}
/* Check that prev pointer is valid */
if (!HEAP_IsValidArenaPtr( subheap->heap, pArena->prev ))
{
fprintf( stderr, "Heap %08lx: bad prev ptr %08lx for arena %08lx\n",
WARN(heap, "Heap %08lx: bad prev ptr %08lx for arena %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena->prev, (DWORD)pArena );
return FALSE;
}
@ -630,7 +630,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
if (!(pArena->prev->size & ARENA_FLAG_FREE) ||
(pArena->prev->magic != ARENA_FREE_MAGIC))
{
fprintf( stderr, "Heap %08lx: prev arena %08lx invalid for %08lx\n",
WARN(heap, "Heap %08lx: prev arena %08lx invalid for %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena->prev, (DWORD)pArena );
return FALSE;
}
@ -640,7 +640,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
if (!(*(DWORD *)((char *)(pArena + 1) +
(pArena->size & ARENA_SIZE_MASK)) & ARENA_FLAG_PREV_FREE))
{
fprintf( stderr, "Heap %08lx: free arena %08lx next block has no PREV_FREE flag\n",
WARN(heap, "Heap %08lx: free arena %08lx next block has no PREV_FREE flag\n",
(DWORD)subheap->heap, (DWORD)pArena );
return FALSE;
}
@ -648,7 +648,7 @@ static BOOL32 HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena )
if (*((ARENA_FREE **)((char *)(pArena + 1) +
(pArena->size & ARENA_SIZE_MASK)) - 1) != pArena)
{
fprintf( stderr, "Heap %08lx: arena %08lx has wrong back ptr %08lx\n",
WARN(heap, "Heap %08lx: arena %08lx has wrong back ptr %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena,
*((DWORD *)((char *)(pArena+1)+ (pArena->size & ARENA_SIZE_MASK)) - 1));
return FALSE;
@ -668,20 +668,20 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
/* Check magic number */
if (pArena->magic != ARENA_INUSE_MAGIC)
{
fprintf( stderr, "Heap %08lx: invalid in-use arena magic for %08lx\n",
WARN(heap, "Heap %08lx: invalid in-use arena magic for %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena );
return FALSE;
}
/* Check size flags */
if (pArena->size & ARENA_FLAG_FREE)
{
fprintf( stderr, "Heap %08lx: bad flags %lx for in-use arena %08lx\n",
WARN(heap, "Heap %08lx: bad flags %lx for in-use arena %08lx\n",
(DWORD)subheap->heap, pArena->size & ~ARENA_SIZE_MASK, (DWORD)pArena );
}
/* Check arena size */
if ((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK) > heapEnd)
{
fprintf( stderr, "Heap %08lx: bad size %08lx for in-use arena %08lx\n",
WARN(heap, "Heap %08lx: bad size %08lx for in-use arena %08lx\n",
(DWORD)subheap->heap, (DWORD)pArena->size & ARENA_SIZE_MASK, (DWORD)pArena );
return FALSE;
}
@ -689,7 +689,7 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
if (((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK) < heapEnd) &&
(*(DWORD *)((char *)(pArena + 1) + (pArena->size & ARENA_SIZE_MASK)) & ARENA_FLAG_PREV_FREE))
{
fprintf( stderr, "Heap %08lx: in-use arena %08lx next block has PREV_FREE flag\n",
WARN(heap, "Heap %08lx: in-use arena %08lx next block has PREV_FREE flag\n",
(DWORD)subheap->heap, (DWORD)pArena );
return FALSE;
}
@ -700,7 +700,7 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
/* Check prev pointer */
if (!HEAP_IsValidArenaPtr( subheap->heap, pPrev ))
{
fprintf(stderr, "Heap %08lx: bad back ptr %08lx for arena %08lx\n",
WARN(heap, "Heap %08lx: bad back ptr %08lx for arena %08lx\n",
(DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena );
return FALSE;
}
@ -708,14 +708,14 @@ static BOOL32 HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
if (!(pPrev->size & ARENA_FLAG_FREE) ||
(pPrev->magic != ARENA_FREE_MAGIC))
{
fprintf( stderr, "Heap %08lx: prev arena %08lx invalid for in-use %08lx\n",
WARN(heap, "Heap %08lx: prev arena %08lx invalid for in-use %08lx\n",
(DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena );
return FALSE;
}
/* Check that prev arena is really the previous block */
if ((char *)(pPrev + 1) + (pPrev->size & ARENA_SIZE_MASK) != (char *)pArena)
{
fprintf( stderr, "Heap %08lx: prev arena %08lx is not prev for in-use %08lx\n",
WARN(heap, "Heap %08lx: prev arena %08lx is not prev for in-use %08lx\n",
(DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena );
return FALSE;
}
@ -775,7 +775,7 @@ SEGPTR HEAP_GetSegptr( HANDLE32 heap, DWORD flags, LPCVOID ptr )
flags |= heapPtr->flags;
if (!(flags & HEAP_WINE_SEGPTR))
{
fprintf( stderr, "HEAP_GetSegptr: heap %08x is not a SEGPTR heap\n",
WARN(heap, "Heap %08x is not a SEGPTR heap\n",
heap );
return 0;
}
@ -785,7 +785,7 @@ SEGPTR HEAP_GetSegptr( HANDLE32 heap, DWORD flags, LPCVOID ptr )
if (!(subheap = HEAP_FindSubHeap( heapPtr, ptr )))
{
fprintf( stderr, "HEAP_GetSegptr: %p is not inside heap %08x\n",
WARN(heap, "%p is not inside heap %08x\n",
ptr, heap );
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
return 0;
@ -1229,7 +1229,7 @@ BOOL32 WINAPI HeapValidate(
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
{
fprintf( stderr, "Invalid heap %08x!\n", heap );
WARN(heap, "Invalid heap %08x!\n", heap );
return FALSE;
}
@ -1240,7 +1240,7 @@ BOOL32 WINAPI HeapValidate(
((char *)block < (char *)subheap + subheap->headerSize
+ sizeof(ARENA_INUSE)))
{
fprintf( stderr, "Heap %08lx: block %08lx is not inside heap\n",
WARN(heap, "Heap %08lx: block %08lx is not inside heap\n",
(DWORD)heap, (DWORD)block );
return FALSE;
}
@ -1284,7 +1284,7 @@ BOOL32 WINAPI HeapWalk(
HANDLE32 heap, /* [in] Handle to heap to enumerate */
LPPROCESS_HEAP_ENTRY *entry /* [out] Pointer to structure of enumeration info */
) {
fprintf( stderr, "HeapWalk(%08x): not implemented\n", heap );
FIXME(heap, "(%08x): stub.\n", heap );
return FALSE;
}
@ -1299,7 +1299,7 @@ LPVOID HEAP_xalloc( HANDLE32 heap, DWORD flags, DWORD size )
LPVOID p = HeapAlloc( heap, flags, size );
if (!p)
{
fprintf( stderr, "Virtual memory exhausted.\n" );
MSG("Virtual memory exhausted.\n" );
exit(1);
}
return p;

View File

@ -182,7 +182,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
{
if (ldt_info.base_addr >= 0xc0000000)
{
fprintf( stderr, "LDT_SetEntry: invalid base addr %08lx\n",
WARN(ldt, "Invalid base addr %08lx\n",
ldt_info.base_addr );
return -1;
}
@ -212,8 +212,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
if (ret < 0)
{
perror("i386_set_ldt");
fprintf(stderr,
"Did you reconfigure the kernel with \"options USER_LDT\"?\n");
MSG("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
exit(1);
}
}
@ -287,7 +286,7 @@ void LDT_Print( int start, int length )
flags[1] = (ldt_flags_copy[i] & LDT_FLAGS_READONLY) ? '-' : 'w';
flags[2] = '-';
}
fprintf(stderr,"%04x: sel=%04x base=%08lx limit=%08lx %d-bit %c%c%c\n",
TRACE(ldt,"%04x: sel=%04x base=%08lx limit=%08lx %d-bit %c%c%c\n",
i, ENTRY_TO_SELECTOR(i),
ldt_copy[i].base, ldt_copy[i].limit,
ldt_flags_copy[i] & LDT_FLAGS_32BIT ? 32 : 16,

View File

@ -334,7 +334,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
/* cleared before use, so we can test for double initialization. */
if (LOCAL_GetHeap(selector))
{
fprintf( stderr, "LocalInit: Heap %04x initialized twice.\n", selector);
WARN(local, "Heap %04x initialized twice.\n", selector);
LOCAL_PrintHeap(selector);
}
}
@ -342,7 +342,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
if (start == 0) {
/* Check if the segment is the DGROUP of a module */
if ((pModule = MODULE_GetPtr( selector )))
if ((pModule = MODULE_GetPtr16( selector )))
{
SEGTABLEENTRY *pSeg = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1;
if (pModule->dgroup && (pSeg->selector == selector)) {
@ -441,7 +441,7 @@ static void LOCAL_GrowHeap( HANDLE16 ds )
ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
pHeapInfo = LOCAL_GetHeap( ds );
if (pHeapInfo == NULL) {
fprintf( stderr, "Local_GrowHeap: heap not found\n" );
WARN(local, "Heap not found\n" );
return;
}
end = GlobalSize16( hseg );
@ -496,7 +496,7 @@ static HLOCAL16 LOCAL_FreeArena( WORD ds, WORD arena )
if ((pArena->prev & 3) == LOCAL_ARENA_FREE)
{
/* shouldn't happen */
fprintf( stderr, "LocalFreeArena: Trying to free block %04x twice!\n",
WARN(local, "Trying to free block %04x twice!\n",
arena );
LOCAL_PrintHeap( ds );
return arena;
@ -619,7 +619,7 @@ static WORD LOCAL_GetFreeSpace(WORD ds, WORD countdiscard)
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "LOCAL_GetFreeSpace: Local heap not found\n" );
WARN(local, "Local heap not found\n" );
LOCAL_PrintHeap(ds);
return 0;
}
@ -654,7 +654,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "Local_Compact: Local heap not found\n" );
WARN(local, "Local heap not found\n" );
LOCAL_PrintHeap(ds);
return 0;
}
@ -773,7 +773,7 @@ static HLOCAL16 LOCAL_FindFreeBlock( HANDLE16 ds, WORD size )
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "Local_FindFreeBlock: Local heap not found\n" );
WARN(local, "Local heap not found\n" );
LOCAL_PrintHeap(ds);
return 0;
}
@ -805,7 +805,7 @@ static HLOCAL16 LOCAL_GetBlock( HANDLE16 ds, WORD size, WORD flags )
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "Local_GetBlock: Local heap not found\n");
WARN(local, "Local heap not found\n");
LOCAL_PrintHeap(ds);
return 0;
}
@ -868,7 +868,7 @@ static BOOL16 LOCAL_NewHTable( HANDLE16 ds )
TRACE(local, "Local_NewHTable\n" );
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "Local heap not found\n");
WARN(local, "Local heap not found\n");
LOCAL_PrintHeap(ds);
return FALSE;
}
@ -877,9 +877,9 @@ static BOOL16 LOCAL_NewHTable( HANDLE16 ds )
+ 2 * sizeof(WORD), LMEM_FIXED )))
return FALSE;
if (!(ptr = PTR_SEG_OFF_TO_LIN( ds, 0 )))
fprintf(stderr, "LOCAL_NewHTable: ptr == NULL after GetBlock.\n");
WARN(local, "ptr == NULL after GetBlock.\n");
if (!(pInfo = LOCAL_GetHeap( ds )))
fprintf(stderr,"LOCAL_NewHTable: pInfo == NULL after GetBlock.\n");
WARN(local,"pInfo == NULL after GetBlock.\n");
/* Fill the entry table */
@ -907,7 +907,7 @@ static HLOCAL16 LOCAL_GetNewHandleEntry( HANDLE16 ds )
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "LOCAL_GetNewHandleEntry: Local heap not found\n");
WARN(local, "Local heap not found\n");
LOCAL_PrintHeap(ds);
return 0;
}
@ -970,7 +970,7 @@ static void LOCAL_FreeHandleEntry( HANDLE16 ds, HLOCAL16 handle )
}
if (!*pTable)
{
fprintf(stderr, "LOCAL_FreeHandleEntry: invalid entry %04x\n", handle);
WARN(local, "Invalid entry %04x\n", handle);
LOCAL_PrintHeap( ds );
return;
}
@ -1007,7 +1007,7 @@ HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle )
TRACE(local, "%04x ds=%04x\n", handle, ds );
if (!handle) { fprintf( stderr, "LOCAL_Free: handle is 0.\n" ); return 0; }
if (!handle) { WARN(local, "Handle is 0.\n" ); return 0; }
if (HANDLE_FIXED( handle ))
{
if (!LOCAL_FreeArena( ds, ARENA_HEADER( handle ) )) return 0; /* OK */
@ -1057,7 +1057,7 @@ HLOCAL16 LOCAL_Alloc( HANDLE16 ds, WORD flags, WORD size )
hmem = 0;
if (!(handle = LOCAL_GetNewHandleEntry( ds )))
{
fprintf( stderr, "LocalAlloc: couldn't get handle\n");
WARN(local, "Couldn't get handle.\n");
if(hmem)
LOCAL_FreeArena( ds, ARENA_HEADER(hmem) );
return 0;
@ -1120,8 +1120,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
{
HLOCAL16 hl;
if(pEntry->addr)
fprintf(stderr,
"LOCAL_ReAlloc: Dicarded block has non-zero addr.\n");
WARN(local,"Dicarded block has non-zero addr.\n");
TRACE(local, "ReAllocating discarded block\n");
if(size <= 4) size = 5;
if (!(hl = LOCAL_GetBlock( ds, size + sizeof(HLOCAL16), flags)))
@ -1136,12 +1135,12 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
}
if (((blockhandle = pEntry->addr) & 3) != 2)
{
fprintf( stderr, "Local_ReAlloc(%04x,%04x): invalid handle\n",
WARN(local, "(%04x,%04x): invalid handle\n",
ds, handle );
return 0;
}
if(*((HLOCAL16 *)(ptr + blockhandle) - 1) != handle) {
fprintf(stderr, "Local_ReAlloc: Back ptr to handle is invalid\n");
WARN(local, "Back ptr to handle is invalid\n");
return 0;
}
}
@ -1261,7 +1260,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
{
if (!(hmem = LOCAL_GetBlock( ds, oldsize, flags )))
{
fprintf( stderr, "LocalRealloc: can't restore saved block\n" );
WARN(local, "Can't restore saved block\n" );
HeapFree( GetProcessHeap(), 0, buffer );
return 0;
}
@ -1283,7 +1282,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
pEntry->addr = hmem + sizeof(HLOCAL16);
/* Back ptr should still be correct */
if(*(HLOCAL16 *)(ptr + hmem) != handle)
fprintf(stderr, "Local_ReAlloc: back ptr is invalid.\n");
WARN(local, "back ptr is invalid.\n");
hmem = handle;
}
if (size == oldsize) hmem = 0; /* Realloc failed */
@ -1423,7 +1422,7 @@ WORD LOCAL_CountFree( HANDLE16 ds )
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "LOCAL_Handle(%04x): Local heap not found\n", ds );
WARN(local, "(%04x): Local heap not found\n", ds );
LOCAL_PrintHeap( ds );
return 0;
}
@ -1456,7 +1455,7 @@ HLOCAL16 LOCAL_Handle( HANDLE16 ds, WORD addr )
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "LOCAL_Handle(%04x): Local heap not found\n", ds );
WARN(local, "(%04x): Local heap not found\n", ds );
LOCAL_PrintHeap( ds );
return 0;
}
@ -1602,7 +1601,7 @@ DWORD WINAPI GetHeapSpaces( HMODULE16 module )
NE_MODULE *pModule;
WORD ds;
if (!(pModule = MODULE_GetPtr( module ))) return 0;
if (!(pModule = MODULE_GetPtr16( module ))) return 0;
ds = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
return MAKELONG( LOCAL_CountFree( ds ), LOCAL_HeapSize( ds ) );
}

View File

@ -13,9 +13,6 @@
#include "debug.h"
#define FIRST_LDT_ENTRY_TO_ALLOC 17
/***********************************************************************
* AllocSelectorArray (KERNEL.206)
*/
@ -179,7 +176,7 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
GET_FS(fs);
if ((fs >= sel) && (fs < nextsel))
{
fprintf( stderr, "SELECTOR_FreeBlock: freeing %%fs selector (%04x), not good.\n", fs );
WARN(selector, "Freeing %%fs selector (%04x), not good.\n", fs );
SET_FS( 0 );
}
GET_GS(gs);
@ -788,6 +785,5 @@ LPVOID WINAPI UTSelectorOffsetToLinear(SEGPTR sptr)
*/
SEGPTR WINAPI UTLinearToSelectorOffset(LPVOID lptr)
{
fprintf( stderr, "UTLinearToSelectorOffset(%p): stub\n", lptr );
return (SEGPTR)lptr;
}

View File

@ -84,7 +84,7 @@ static const BYTE VIRTUAL_Win32Flags[16] =
static FILE_VIEW *VIRTUAL_FirstView;
#ifdef __i386___
#ifdef __i386__
/* These are always the same on an i386, and it will be faster this way */
# define page_mask 0xfff
# define page_shift 12
@ -552,7 +552,7 @@ LPVOID WINAPI VirtualAlloc(
/* FIXME: MEM_TOP_DOWN allocates the largest possible address.
* Is there _ANY_ way to do it with UNIX mmap()?
*/
fprintf(stderr,"VirtualAlloc:MEM_TOP_DOWN ignored\n");
WARN(virtual,"MEM_TOP_DOWN ignored\n");
type &= ~MEM_TOP_DOWN;
}
/* Compute the protection flags */
@ -795,7 +795,7 @@ BOOL32 WINAPI VirtualProtectEx(
if (pdb == PROCESS_Current())
ret = VirtualProtect( addr, size, new_prot, old_prot );
else
fprintf(stderr,"Unsupported: VirtualProtectEx on other process\n");
ERR(virtual,"Unsupported on other process\n");
K32OBJ_DecCount( &pdb->header );
}
return ret;
@ -892,7 +892,7 @@ DWORD WINAPI VirtualQueryEx(
if (pdb == PROCESS_Current())
ret = VirtualQuery( addr, info, len );
else
fprintf(stderr,"Unsupported: VirtualQueryEx on other process\n");
ERR(virtual,"Unsupported on other process\n");
K32OBJ_DecCount( &pdb->header );
}
return ret;
@ -1288,7 +1288,7 @@ LPVOID WINAPI MapViewOfFileEx(
return NULL;
if (mapping->size_high || offset_high)
fprintf( stderr, "MapViewOfFileEx: offsets larger than 4Gb not supported\n");
ERR(virtual, "Offsets larger than 4Gb not supported\n");
if ((offset_low >= mapping->size_low) ||
(count > mapping->size_low - offset_low))

View File

@ -19,7 +19,6 @@ C_SRCS = \
lstr.c \
lzexpand.c \
main.c \
mpr.c \
network.c \
ntdll.c \
port.c \

View File

@ -307,7 +307,7 @@ ASPI_ExecScsiCmd16(SRB_ExecSCSICmd16 *prb, SEGPTR segptr_prb)
if (status < 0 || status != in_len) {
int myerror = errno;
fprintf(stderr, "not enough bytes written to scsi device bytes=%d .. %d\n", in_len, status);
WARN(aspi, "Not enough bytes written to scsi device bytes=%d .. %d\n", in_len, status);
if (status < 0) {
if (myerror == ENOMEM) {
fprintf(stderr, "ASPI: Linux generic scsi driver\n You probably need to re-compile your kernel with a larger SG_BIG_BUFF value (sg.h)\n Suggest 130560\n");

View File

@ -6,6 +6,7 @@
#include <assert.h>
#include <stdio.h>
#include "debug.h"
#include "windows.h"
#include "callback.h"
#include "task.h"
@ -27,7 +28,7 @@ static LRESULT WINAPI CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
*/
static LONG WINAPI CALLBACK_CallRegisterProc( CONTEXT *context, INT32 offset)
{
fprintf( stderr, "Cannot call a register proc in Winelib\n" );
ERR(relay, "Cannot call a register proc in Winelib\n" );
assert( FALSE );
return 0;
}
@ -208,7 +209,7 @@ static BOOL32 WINAPI CALLBACK_CallWOWCallback16Ex(
);
break;
default:
fprintf(stderr,"CALLBACK_CallWOWCallback16Ex(), %ld arguments not supported.!n",cbArgs);
WARN(relay,"(%ld) arguments not supported.\n",cbArgs);
if (dwFlags == WCB16_CDECL)
HeapFree(GetProcessHeap(),0,args);
return FALSE;

View File

@ -77,10 +77,10 @@ void COMM_Init(void)
}
stat(temp, &st);
if (!S_ISCHR(st.st_mode))
fprintf(stderr,"comm: can't use `%s' as %s !\n", temp, option);
WARN(comm,"Can't use `%s' as %s !\n", temp, option);
else
if ((COM[x].devicename = malloc(strlen(temp)+1)) == NULL)
fprintf(stderr,"comm: can't malloc for device info!\n");
WARN(comm,"Can't malloc for device info!\n");
else {
COM[x].fd = 0;
strcpy(COM[x].devicename, temp);
@ -99,10 +99,10 @@ void COMM_Init(void)
else {
stat(temp, &st);
if (!S_ISCHR(st.st_mode))
fprintf(stderr,"comm: can't use `%s' as %s !\n", temp, option);
WARN(comm,"Can't use `%s' as %s !\n", temp, option);
else
if ((LPT[x].devicename = malloc(strlen(temp)+1)) == NULL)
fprintf(stderr,"comm: can't malloc for device info!\n");
WARN(comm,"Can't malloc for device info!\n");
else {
LPT[x].fd = 0;
strcpy(LPT[x].devicename, temp);
@ -177,7 +177,7 @@ BOOL16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb)
if (port-- == 0) {
fprintf(stderr, "comm: BUG ! COM0 can't exists!.\n");
ERR(comm, "BUG ! COM0 can't exists!.\n");
commerror = IE_BADID;
}
@ -229,7 +229,7 @@ BOOL16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb)
lpdcb->Parity = ODDPARITY;
break;
default:
fprintf(stderr,"comm: unknown parity `%c'!\n", *ptr);
WARN(comm,"Unknown parity `%c'!\n", *ptr);
return -1;
}
@ -247,7 +247,7 @@ BOOL16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb)
lpdcb->StopBits = TWOSTOPBITS;
break;
default:
fprintf(stderr,"comm: unknown # of stopbits `%c'!\n", *ptr);
WARN(comm,"Unknown # of stopbits `%c'!\n", *ptr);
return -1;
}
}
@ -278,7 +278,7 @@ BOOL32 WINAPI BuildCommDCBAndTimeouts32A(LPCSTR device, LPDCB32 lpdcb,
if (!lstrncmpi32A(device,"COM",3)) {
port=device[3]-'0';
if (port--==0) {
fprintf(stderr,"comm:BUG! COM0 can't exists!.\n");
ERR(comm,"BUG! COM0 can't exists!.\n");
return FALSE;
}
if (!ValidCOMPort(port))
@ -346,19 +346,19 @@ BOOL32 WINAPI BuildCommDCBAndTimeouts32A(LPCSTR device, LPDCB32 lpdcb,
flag=0;
if (!strncmp("baud=",ptr,5)) {
if (!sscanf(ptr+5,"%ld",&x))
fprintf(stderr,"BuildCommDCB32A:Couldn't parse %s\n",ptr);
WARN(comm,"Couldn't parse %s\n",ptr);
lpdcb->BaudRate = x;
flag=1;
}
if (!strncmp("stop=",ptr,5)) {
if (!sscanf(ptr+5,"%ld",&x))
fprintf(stderr,"BuildCommDCB32A:Couldn't parse %s\n",ptr);
WARN(comm,"Couldn't parse %s\n",ptr);
lpdcb->StopBits = x;
flag=1;
}
if (!strncmp("data=",ptr,5)) {
if (!sscanf(ptr+5,"%ld",&x))
fprintf(stderr,"BuildCommDCB32A:Couldn't parse %s\n",ptr);
WARN(comm,"Couldn't parse %s\n",ptr);
lpdcb->ByteSize = x;
flag=1;
}
@ -382,7 +382,7 @@ BOOL32 WINAPI BuildCommDCBAndTimeouts32A(LPCSTR device, LPDCB32 lpdcb,
flag=1;
}
if (!flag)
fprintf(stderr,"BuildCommDCB32A: Unhandled specifier '%s', please report.\n",ptr);
ERR(comm,"Unhandled specifier '%s', please report.\n",ptr);
ptr=strtok(NULL," ");
}
if (lpdcb->BaudRate==110)
@ -428,7 +428,7 @@ INT16 WINAPI OpenComm(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
port = device[3] - '0';
if (port-- == 0) {
fprintf(stderr, "comm: BUG ! COM0 doesn't exist !\n");
ERR(comm, "BUG ! COM0 doesn't exist !\n");
commerror = IE_BADID;
}
@ -636,8 +636,7 @@ LONG WINAPI EscapeCommFunction16(UINT16 fd,UINT16 nFunction)
break;
default:
fprintf(stderr,
"EscapeCommFunction fd: %d, unknown function: %d\n",
WARN(comm,"(fd=%d,nFunction=%d): Unknown function\n",
fd, nFunction);
break;
}
@ -709,8 +708,7 @@ BOOL32 WINAPI EscapeCommFunction32(INT32 fd,UINT32 nFunction)
ptr->suspended = 0;
break;
default:
fprintf(stderr,
"EscapeCommFunction32 fd: %d, unknown function: %d\n",
WARN(comm,"(fd=%d,nFunction=%d): Unknown function\n",
fd, nFunction);
break;
}
@ -737,8 +735,7 @@ INT16 WINAPI FlushComm(INT16 fd,INT16 fnQueue)
break;
case 1: queue = TCIFLUSH;
break;
default:fprintf(stderr,
"FlushComm fd: %d, UNKNOWN queue: %d\n",
default:WARN(comm,"(fd=%d,fnQueue=%d):Unknown queue\n",
fd, fnQueue);
return -1;
}
@ -774,11 +771,11 @@ INT16 WINAPI GetCommError(INT16 fd,LPCOMSTAT lpStat)
lpStat->status = 0;
rc = ioctl(fd, TIOCOUTQ, &cnt);
if (rc) fprintf(stderr, "Error !\n");
if (rc) WARN(comm, "Error !\n");
lpStat->cbOutQue = cnt;
rc = ioctl(fd, TIOCINQ, &cnt);
if (rc) fprintf(stderr, "Error !\n");
if (rc) WARN(comm, "Error !\n");
lpStat->cbInQue = cnt;
TRACE(comm, "fd %d, error %d, lpStat %d %d %d\n",
@ -1727,9 +1724,7 @@ INT16 WINAPI WriteComm(INT16 fd, LPSTR lpvBuf, INT16 cbWrite)
*/
BOOL32 WINAPI GetCommTimeouts(INT32 fd,LPCOMMTIMEOUTS lptimeouts)
{
fprintf(stderr,"GetCommTimeouts(%x,%p), empty stub.\n",
fd,lptimeouts
);
FIXME(comm,"(%x,%p):stub.\n",fd,lptimeouts);
return TRUE;
}
@ -1737,9 +1732,7 @@ BOOL32 WINAPI GetCommTimeouts(INT32 fd,LPCOMMTIMEOUTS lptimeouts)
* SetCommTimeouts (KERNEL32.453)
*/
BOOL32 WINAPI SetCommTimeouts(INT32 fd,LPCOMMTIMEOUTS lptimeouts) {
fprintf(stderr,"SetCommTimeouts(%x,%p), empty stub.\n",
fd,lptimeouts
);
FIXME(comm,"(%x,%p):stub.\n",fd,lptimeouts);
return TRUE;
}
@ -1749,7 +1742,7 @@ BOOL32 WINAPI SetCommTimeouts(INT32 fd,LPCOMMTIMEOUTS lptimeouts) {
BOOL16 WINAPI EnableCommNotification( INT16 fd, HWND16 hwnd,
INT16 cbWriteNotify, INT16 cbOutQueue )
{
fprintf(stderr, "EnableCommNotification(%d, %x, %d, %d), empty stub.\n", fd, hwnd, cbWriteNotify, cbOutQueue);
FIXME(comm, "(%d, %x, %d, %d):stub.\n", fd, hwnd, cbWriteNotify, cbOutQueue);
return TRUE;
}

File diff suppressed because it is too large Load Diff

View File

@ -67,6 +67,8 @@ UINT32 CRTDLL_winmajor_dll; /* CRTDLL.329 */
UINT32 CRTDLL_winminor_dll; /* CRTDLL.330 */
UINT32 CRTDLL_winver_dll; /* CRTDLL.331 */
BYTE CRTDLL_iob[32*3]; /* FIXME */
typedef VOID (*new_handler_type)(VOID);
static new_handler_type new_handler;
@ -177,6 +179,21 @@ DWORD __cdecl CRTDLL__fdopen(INT32 handle, LPCSTR mode)
return (DWORD)file;
}
static FILE *xlat_file_ptr(void *ptr)
{
unsigned long dif;
/* CRT sizeof(FILE) == 32 */
dif = ((char *)ptr - (char *)CRTDLL_iob) / 32;
switch(dif)
{
case 0: return stdin;
case 1: return stdout;
case 2: return stderr;
}
return (FILE*)ptr;
}
/*******************************************************************
* _global_unwind2 (CRTDLL.129)
*/
@ -246,9 +263,10 @@ DWORD __cdecl CRTDLL_fopen(LPCSTR path, LPCSTR mode)
/*********************************************************************
* fread (CRTDLL.377)
*/
DWORD __cdecl CRTDLL_fread(LPVOID ptr, INT32 size, INT32 nmemb, LPVOID file)
DWORD __cdecl CRTDLL_fread(LPVOID ptr, INT32 size, INT32 nmemb, LPVOID vfile)
{
size_t ret=1;
FILE *file=xlat_file_ptr(vfile);
#if 0
int i=0;
void *temp=ptr;
@ -293,7 +311,7 @@ LONG __cdecl CRTDLL_fseek(LPVOID stream, LONG offset, INT32 whence)
{
long ret;
ret=fseek(stream,offset,whence);
ret=fseek(xlat_file_ptr(stream),offset,whence);
TRACE(crtdll, "file %p to 0x%08lx pos %s\n",
stream,offset,(whence==SEEK_SET)?"SEEK_SET":
(whence==SEEK_CUR)?"SEEK_CUR":
@ -311,7 +329,7 @@ LONG __cdecl CRTDLL_ftell(LPVOID stream)
{
long ret;
ret=ftell(stream);
ret=ftell(xlat_file_ptr(stream));
TRACE(crtdll, "file %p at 0x%08lx\n",
stream,ret);
return ret;
@ -320,9 +338,10 @@ LONG __cdecl CRTDLL_ftell(LPVOID stream)
/*********************************************************************
* fwrite (CRTDLL.386)
*/
DWORD __cdecl CRTDLL_fwrite(LPVOID ptr, INT32 size, INT32 nmemb, LPVOID file)
DWORD __cdecl CRTDLL_fwrite(LPVOID ptr, INT32 size, INT32 nmemb, LPVOID vfile)
{
size_t ret;
FILE *file=xlat_file_ptr(vfile);
ret=fwrite(ptr,size,nmemb,file);
TRACE(crtdll, "0x%08x items of size %d from %p to file %p\n",
@ -342,7 +361,7 @@ INT32 __cdecl CRTDLL_setbuf(LPVOID file, LPSTR buf)
/* this doesn't work:"void value not ignored as it ought to be"
return setbuf(file,buf);
*/
setbuf(file,buf);
setbuf(xlat_file_ptr(file),buf);
return 0;
}
@ -393,7 +412,7 @@ INT32 __cdecl CRTDLL_fprintf( FILE *file, LPSTR format, ... )
INT32 res;
va_start( valist, format );
res = vfprintf( file, format, valist );
res = vfprintf( xlat_file_ptr(file), format, valist );
va_end( valist );
return res;
}
@ -403,7 +422,7 @@ INT32 __cdecl CRTDLL_fprintf( FILE *file, LPSTR format, ... )
*/
INT32 __cdecl CRTDLL_vfprintf( FILE *file, LPSTR format, va_list args )
{
return vfprintf( file, format, args );
return vfprintf( xlat_file_ptr(file), format, args );
}
/*********************************************************************
@ -511,7 +530,7 @@ INT32 __cdecl CRTDLL_fflush(LPVOID stream)
{
int ret;
ret = fflush(stream);
ret = fflush(xlat_file_ptr(stream));
TRACE(crtdll,"%p returnd %d\n",stream,ret);
if(ret)
WARN(crtdll, " Failed!\n");
@ -559,7 +578,7 @@ void __cdecl CRTDLL_putchar( INT32 x )
INT32 __cdecl CRTDLL_fputc( INT32 c, FILE *stream )
{
TRACE(crtdll, "%c to file %p\n",c,stream);
return fputc(c,stream);
return fputc(c,xlat_file_ptr(stream));
}
@ -569,7 +588,7 @@ INT32 __cdecl CRTDLL_fputc( INT32 c, FILE *stream )
INT32 __cdecl CRTDLL_fputs( LPCSTR s, FILE *stream )
{
TRACE(crtdll, "%s to file %p\n",s,stream);
return fputs(s,stream);
return fputs(s,xlat_file_ptr(stream));
}
@ -589,14 +608,14 @@ INT32 __cdecl CRTDLL_puts(LPCSTR s)
INT32 __cdecl CRTDLL_putc(INT32 c, FILE *stream)
{
TRACE(crtdll, " %c to file %p\n",c,stream);
return fputc(c,stream);
return fputc(c,xlat_file_ptr(stream));
}
/*********************************************************************
* fgetc (CRTDLL.366)
*/
INT32 __cdecl CRTDLL_fgetc( FILE *stream )
{
int ret= fgetc(stream);
int ret= fgetc(xlat_file_ptr(stream));
TRACE(crtdll, "got %d\n",ret);
return ret;
}
@ -607,7 +626,7 @@ INT32 __cdecl CRTDLL_fgetc( FILE *stream )
*/
INT32 __cdecl CRTDLL_getc( FILE *stream )
{
int ret= fgetc(stream);
int ret= fgetc(xlat_file_ptr(stream));
TRACE(crtdll, "got %d\n",ret);
return ret;
}
@ -646,7 +665,7 @@ CHAR* __cdecl CRTDLL_fgets(LPSTR s,INT32 size, LPVOID stream)
char * ret;
char * control_M;
ret=fgets(s, size,stream);
ret=fgets(s, size,xlat_file_ptr(stream));
/*FIXME: Control with CRTDLL_setmode */
control_M= strrchr(s,'\r');
/*delete CR if we read a DOS File */
@ -937,10 +956,13 @@ LPSTR __cdecl CRTDLL__strdup(LPSTR ptr)
*/
INT32 __cdecl CRTDLL_fclose( FILE *stream )
{
int unix_handle=fileno(stream);
int unix_handle;
HFILE32 dos_handle=1;
HFILE32 ret=EOF;
stream=xlat_file_ptr(stream);
unix_handle=fileno(stream);
if (unix_handle<4) ret= fclose(stream);
else {
while(FILE_GetUnixHandle(dos_handle) != unix_handle) dos_handle++;
@ -1090,7 +1112,7 @@ INT32 __cdecl CRTDLL_feof( FILE *stream )
{
int ret;
ret=feof(stream);
ret=feof(xlat_file_ptr(stream));
TRACE(crtdll,"(%p) %s\n",stream,(ret)?"true":"false");
return ret;
}
@ -1686,7 +1708,7 @@ typedef VOID (*sig_handler_type)(VOID);
*/
VOID __cdecl CRTDLL_signal(int sig, sig_handler_type ptr)
{
FIXME(crtdll, "(%d %p): STUB!\n", sig, ptr);
FIXME(crtdll, "(%d %p):stub.\n", sig, ptr);
}
/*********************************************************************

View File

@ -11,40 +11,52 @@
#include "ddeml.h"
#include "debug.h"
/* FIXME: What are these values? */
#define DMLERR_NO_ERROR 0
static LONG DDE_current_handle;
/*****************************************************************
/******************************************************************************
* DdeInitialize16 (DDEML.2)
*/
UINT16 WINAPI DdeInitialize16( LPDWORD pidInst, PFNCALLBACK16 pfnCallback,
DWORD afCmd, DWORD ulRes)
{
FIXME( ddeml, "empty stub\n" );
return 0;
return (UINT16)DdeInitialize32A(pidInst,(PFNCALLBACK32)pfnCallback,
afCmd, ulRes);
}
/*****************************************************************
/******************************************************************************
* DdeInitialize32A (USER32.106)
*/
UINT32 WINAPI DdeInitialize32A( LPDWORD pidInst, PFNCALLBACK32 pfnCallback,
DWORD afCmd, DWORD ulRes )
{
FIXME( ddeml, "empty stub\n" );
return 0;
return DdeInitialize32W(pidInst,pfnCallback,afCmd,ulRes);
}
/*****************************************************************
* DdeInitialize32W (USER32.107)
/******************************************************************************
* DdeInitialize32W [USER32.107]
* Registers an application with the DDEML
*
* PARAMS
* pidInst [I] Pointer to instance identifier
* pfnCallback [I] Pointer to callback function
* afCmd [I] Set of command and filter flags
* ulRes [I] Reserved
*
* RETURNS
* Success: DMLERR_NO_ERROR
* Failure: DMLERR_DLL_USAGE, DMLERR_INVALIDPARAMETER, DMLERR_SYS_ERROR
*/
UINT32 WINAPI DdeInitialize32W( LPDWORD pidInst, PFNCALLBACK32 pfnCallback,
DWORD afCmd, DWORD ulRes )
{
FIXME( ddeml, "empty stub\n" );
return 0;
FIXME(ddeml, "(%p,%p,%ld,%ld): stub\n",pidInst,pfnCallback,afCmd,ulRes);
return DMLERR_NO_ERROR;
}
@ -58,24 +70,56 @@ BOOL16 WINAPI DdeUninitialize16( DWORD idInst )
/*****************************************************************
* DdeUninitialize32 (USER32.119)
* DdeUninitialize32 [USER32.119] Frees DDEML resources
*
* PARAMS
* idInst [I] Instance identifier
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL32 WINAPI DdeUninitialize32( DWORD idInst )
{
FIXME( ddeml, "empty stub\n" );
FIXME(ddeml, "(%ld): stub\n", idInst);
return TRUE;
}
/*****************************************************************
* DdeConnectList (DDEML.4)
* DdeConnectList16 [DDEML.4]
*/
HCONVLIST WINAPI DdeConnectList( DWORD idInst, HSZ hszService, HSZ hszTopic,
HCONVLIST hConvList, LPCONVCONTEXT16 pCC )
HCONVLIST WINAPI DdeConnectList16( DWORD idInst, HSZ hszService, HSZ hszTopic,
HCONVLIST hConvList, LPCONVCONTEXT16 pCC )
{
FIXME( ddeml, "empty stub\n" );
return 0;
return DdeConnectList32(idInst, hszService, hszTopic, hConvList,
(LPCONVCONTEXT32)pCC);
}
/******************************************************************************
* DdeConnectList32 [USER32.93] Establishes conversation with DDE servers
*
* PARAMS
* idInst [I] Instance identifier
* hszService [I] Handle to service name string
* hszTopic [I] Handle to topic name string
* hConvList [I] Handle to conversation list
* pCC [I] Pointer to structure with context data
*
* RETURNS
* Success: Handle to new conversation list
* Failure: 0
*/
HCONVLIST WINAPI DdeConnectList32( DWORD idInst, HSZ hszService, HSZ hszTopic,
HCONVLIST hConvList, LPCONVCONTEXT32 pCC )
{
FIXME(ddeml, "(%ld,%ld,%ld,%ld,%p): stub\n", idInst, hszService, hszTopic,
hConvList,pCC);
return 1;
}
/*****************************************************************
* DdeQueryNextServer (DDEML.5)
*/
@ -88,12 +132,27 @@ HCONV WINAPI DdeQueryNextServer( HCONVLIST hConvList, HCONV hConvPrev )
/*****************************************************************
* DdeDisconnectList (DDEML.6)
*/
BOOL16 WINAPI DdeDisconnectList( HCONVLIST hConvList )
BOOL16 WINAPI DdeDisconnectList16( HCONVLIST hConvList )
{
FIXME( ddeml, "empty stub\n" );
return 0;
return (BOOL16)DdeDisconnectList32(hConvList);
}
/******************************************************************************
* DdeDisconnectList32 [USER32.98] Destroys list and terminates conversations
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL32 WINAPI DdeDisconnectList32(
HCONVLIST hConvList) /* [in] Handle to conversation list */
{
FIXME(ddeml, "(%ld): stub\n", hConvList);
return TRUE;
}
/*****************************************************************
* DdeConnect16 (DDEML.7)
*/
@ -111,7 +170,7 @@ HCONV WINAPI DdeConnect16( DWORD idInst, HSZ hszService, HSZ hszTopic,
HCONV WINAPI DdeConnect32( DWORD idInst, HSZ hszService, HSZ hszTopic,
LPCONVCONTEXT32 pCC )
{
FIXME( ddeml, "empty stub\n" );
FIXME( ddeml, "(...): stub\n");
return 0;
}
@ -172,22 +231,29 @@ HSZ WINAPI DdeCreateStringHandle16( DWORD idInst, LPCSTR str, INT16 codepage )
/*****************************************************************
* DdeCreateStringHandle32A (USER32.95)
* DdeCreateStringHandle32A [USER32.95]
*/
HSZ WINAPI DdeCreateStringHandle32A( DWORD idInst, LPCSTR psz, INT32 codepage )
{
FIXME( ddeml, "empty stub\n" );
FIXME(ddeml, "(...): stub\n" );
DDE_current_handle++;
return DDE_current_handle;
}
/*****************************************************************
* DdeCreateStringHandle32W (USER32.96)
/******************************************************************************
* DdeCreateStringHandle32W [USER32.96] Creates handle to identify string
*
* RETURNS
* Success: String handle
* Failure: 0
*/
HSZ WINAPI DdeCreateStringHandle32W( DWORD idInst, LPCWSTR psz, INT32 codepage)
HSZ WINAPI DdeCreateStringHandle32W(
DWORD idInst, /* [in] Instance identifier */
LPCWSTR psz, /* [in] Pointer to string */
INT32 codepage) /* [in] Code page identifier */
{
FIXME( ddeml, "empty stub\n" );
FIXME(ddeml, "(%ld,%s,%d): stub\n",idInst,debugstr_w(psz),codepage);
DDE_current_handle++;
return DDE_current_handle;
}
@ -285,15 +351,33 @@ BOOL16 WINAPI DdeAbandonTransaction( DWORD idInst, HCONV hConv,
return 0;
}
/*****************************************************************
* DdePostAdvise (DDEML.13)
* DdePostAdvise16 [DDEML.13]
*/
BOOL16 WINAPI DdePostAdvise( DWORD idInst, HSZ hszTopic, HSZ hszItem )
BOOL16 WINAPI DdePostAdvise16( DWORD idInst, HSZ hszTopic, HSZ hszItem )
{
FIXME( ddeml, "empty stub\n" );
return 0;
return (BOOL16)DdePostAdvise32(idInst, hszTopic, hszItem);
}
/******************************************************************************
* DdePostAdvise32 [USER32.110] Send transaction to DDE callback function.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL32 WINAPI DdePostAdvise32(
DWORD idInst, /* [in] Instance identifier */
HSZ hszTopic, /* [in] Handle to topic name string */
HSZ hszItem) /* [in] Handle to item name string */
{
FIXME(ddeml, "(%ld,%ld,%ld): stub\n",idInst,hszTopic,hszItem);
return TRUE;
}
/*****************************************************************
* DdeAddData (DDEML.15)
*/
@ -304,16 +388,37 @@ HDDEDATA WINAPI DdeAddData( HDDEDATA hData, LPBYTE pSrc, DWORD cb,
return 0;
}
/*****************************************************************
* DdeGetData (DDEML.16)
/******************************************************************************
* DdeGetData32 [USER32.102] Copies data from DDE object ot local buffer
*
* RETURNS
* Size of memory object associated with handle
*/
DWORD WINAPI DdeGetData( HDDEDATA hData, LPBYTE pDst, DWORD cbMax,
DWORD cbOff )
DWORD WINAPI DdeGetData32(
HDDEDATA hData, /* [in] Handle to DDE object */
LPBYTE pDst, /* [in] Pointer to destination buffer */
DWORD cbMax, /* [in] Amount of data to copy */
DWORD cbOff) /* [in] Offset to beginning of data */
{
FIXME( ddeml, "empty stub\n" );
return 0;
FIXME(ddeml, "(%ld,%p,%ld,%ld): stub\n",hData,pDst,cbMax,cbOff);
return cbMax;
}
/*****************************************************************
* DdeGetData16 [DDEML.16]
*/
DWORD WINAPI DdeGetData16(
HDDEDATA hData,
LPBYTE pDst,
DWORD cbMax,
DWORD cbOff)
{
return DdeGetData32(hData, pDst, cbMax, cbOff);
}
/*****************************************************************
* DdeAccessData (DDEML.17)
*/
@ -351,14 +456,24 @@ HDDEDATA WINAPI DdeNameService16( DWORD idInst, HSZ hsz1, HSZ hsz2,
}
/*****************************************************************
* DdeNameService32 (USER32.109)
/******************************************************************************
* DdeNameService32 [USER32.109] {Un}registers service name of DDE server
*
* PARAMS
* idInst [I] Instance identifier
* hsz1 [I] Handle to service name string
* hsz2 [I] Reserved
* afCmd [I] Service name flags
*
* RETURNS
* Success: Non-zero
* Failure: 0
*/
HDDEDATA WINAPI DdeNameService32( DWORD idInst, HSZ hsz1, HSZ hsz2,
UINT32 afCmd )
UINT32 afCmd )
{
FIXME( ddeml, "empty stub\n" );
return 0;
FIXME(ddeml, "(%ld,%ld,%ld,%d): stub\n",idInst,hsz1,hsz2,afCmd);
return 1;
}
@ -371,15 +486,22 @@ UINT16 WINAPI DdeGetLastError16( DWORD idInst )
}
/*****************************************************************
* DdeGetLastError32 (USER32.103)
/******************************************************************************
* DdeGetLastError32 [USER32.103] Gets most recent error code
*
* PARAMS
* idInst [I] Instance identifier
*
* RETURNS
* Last error code
*/
UINT32 WINAPI DdeGetLastError32( DWORD idInst )
{
FIXME( ddeml, "empty stub\n" );
FIXME(ddeml, "(%ld): stub\n",idInst);
return 0;
}
/*****************************************************************
* DdeCmpStringHandles (DDEML.36)
*/

View File

@ -140,8 +140,7 @@ static const char *GetParamErrorString(UINT16 uErr) {
*/
VOID WINAPI LogError(UINT16 uErr, LPVOID lpvInfo)
{
fprintf(stddeb, "LogError(%s, %p)\n",
GetErrorString(uErr), lpvInfo);
MSG("(%s, %p)\n", GetErrorString(uErr), lpvInfo);
}
@ -153,6 +152,5 @@ void WINAPI LogParamError(UINT16 uErr, FARPROC16 lpfn, LPVOID lpvParam)
/* FIXME: is it possible to get the module name/function
* from the lpfn param?
*/
fprintf(stddeb, "LogParamError(%s, %p, %p)\n",
GetParamErrorString(uErr), lpfn, lpvParam);
MSG("(%s, %p, %p)\n", GetParamErrorString(uErr), lpfn, lpvParam);
}

View File

@ -1452,9 +1452,9 @@ BOOL32 WINAPI ImageList_Remove (
/* create new bitmap(s) */
cxNew = (himl->cCurImage + himl->cGrow - 1) * himl->cx;
fprintf (stderr, " - Number of images: %d / %d (Old/New)\n",
TRACE(imagelist, " - Number of images: %d / %d (Old/New)\n",
himl->cCurImage, himl->cCurImage - 1);
fprintf (stderr, " - Max. number of images: %d / %d (Old/New)\n",
TRACE(imagelist, " - Max. number of images: %d / %d (Old/New)\n",
himl->cMaxImage, himl->cCurImage + himl->cGrow - 1);
hbmNewImage =

View File

@ -159,7 +159,7 @@ void WINAPI OutputDebugString16( LPCSTR str )
*p = '\0';
if ((p > buffer) && (p[-1] == '\n')) p[1] = '\0'; /* Remove trailing \n */
module = MODULE_GetModuleName( GetCurrentTask() );
fprintf( stderr, "OutputDebugString: %s says '%s'\n",
TRACE(resource, "%s says '%s'\n",
module ? module : "???", buffer );
HeapFree( GetProcessHeap(), 0, buffer );
}
@ -646,8 +646,18 @@ DWORD WINAPI FormatMessage32A(
}
*t='\0';
}
if (!nolinefeed && t[-1]!='\n')
ADD_TO_T('\n');
if (nolinefeed) {
/* remove linefeed */
if(t>target && t[-1]=='\n') {
*--t=0;
if(t>target && t[-1]=='\r')
*--t=0;
}
} else {
/* add linefeed */
if(t==target || t[-1]!='\n')
ADD_TO_T('\n'); /* FIXME: perhaps add \r too? */
}
talloced = strlen(target)+1;
if (nSize && talloced<nSize) {
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
@ -816,8 +826,18 @@ DWORD WINAPI FormatMessage32W(
}
*t='\0';
}
if (!nolinefeed && t[-1]!='\n')
ADD_TO_T('\n');
if (nolinefeed) {
/* remove linefeed */
if(t>target && t[-1]=='\n') {
*--t=0;
if(t>target && t[-1]=='\r')
*--t=0;
}
} else {
/* add linefeed */
if(t==target || t[-1]!='\n')
ADD_TO_T('\n'); /* FIXME: perhaps add \r too? */
}
talloced = strlen(target)+1;
if (nSize && talloced<nSize)
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);

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