Commit 46ea8b3f authored by Alexandre Julliard's avatar Alexandre Julliard

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).
parent c7c217b3
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.
......
----------------------------------------------------------------------
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>
* [files/drive.c]
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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 );
}
}
......
......@@ -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) );
......
......@@ -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;
......
......@@ -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);
......
......@@ -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.
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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"
......
......@@ -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;
......
......@@ -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;
}
......@@ -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 */
......
......@@ -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)
*/
......@@ -648,6 +746,18 @@ BOOL32 WINAPI PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts,
}
/**********************************************************************
* 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)
*/
BOOL16 WINAPI ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
......@@ -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;
}
......@@ -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;
......
......@@ -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 );
......
......@@ -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 */
......
......@@ -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() */
......@@ -583,6 +580,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
*
* Internal helper function for flood fill.
......
......@@ -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 */
......
......@@ -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... */
{
......
......@@ -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:
......
......@@ -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();
}
......@@ -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
......
......@@ -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
......
/*
* 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; }
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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) );
}
......
......@@ -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;
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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
......
......@@ -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",
......
......@@ -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)) || \
......
......@@ -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*);
......
......@@ -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 */
......@@ -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);
......
......@@ -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 );
......
......@@ -168,51 +168,6 @@ struct relocation_entry_s
#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.
*/
struct resource_nameinfo_s
......@@ -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.
*/
......
......@@ -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
......
#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
......@@ -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);
......
......@@ -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))
......
......@@ -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 );
......
......@@ -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__
......
#define WINE_RELEASE_INFO "Wine release 980413"
#define WINE_RELEASE_INFO "Wine release 980503"
......@@ -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
......
......@@ -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
{
......
......@@ -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 */
......@@ -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(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(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)
/* Misc. constants. */
......
......@@ -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 );
......
......@@ -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 \
......
......@@ -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;
}
}
......@@ -143,48 +96,9 @@ 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
*/
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 */
}
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:
......@@ -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);
}
......
......@@ -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",
......
......@@ -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) );
......
......@@ -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;
......
......@@ -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,
......
......@@ -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 ) );
}
......
......@@ -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;
}
......@@ -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))
......
......@@ -19,7 +19,6 @@ C_SRCS = \
lstr.c \
lzexpand.c \
main.c \
mpr.c \
network.c \
ntdll.c \
port.c \
......
......@@ -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");
......
......@@ -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;
......
......@@ -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;
}
......@@ -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);
}
/*********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment