Release 951003

Sun Oct  1 15:48:34 1995  Alexandre Julliard  <julliard@sunsite.unc>

	* [controls/menu.c]
	Fixed GetMenuString() for non-string items.

	* [debugger/*.c]
	First attempt to check validity of pointers before memory
	accesses. For now only segmented pointers are checked.

	* [debugger/dbg.y] [memory/ldt.c]
	Added possibility to dump only one segment with 'info segment'.

	* [include/bitmaps/ocr_*]
	Added all OEM cursors as XPM bitmaps.

	* [include/cursoricon.h] [objects/cursoricon.c]
	Rewrote all cursor and icon management to use the same memory
 	layout as Windows, and to factor common code between icons and
	cursors. Implemented icon directory lookup to find the best
	matching icon (i.e. the color one).
  	Implemented CopyCursor() and DumpIcon().

	* [loader/module.c]
	For disabled built-in modules, we now try to load the Windows DLL
	first, and if this fails we fall back to using the built-in module
	anyway.

	* [memory/global.c]
	Fixed GlobalHandle() to return the correct selector in the high
	word even if we are passed a handle in the first place.

	* [miscemu/instr.c]
	Take into account the size of the operand and of the stack segment
	when incrementing the stack pointer.
	Avoid referencing FS_reg and GS_reg on *BSD.

	* [objects/dib.c]
	All DIB functions now accept a BITMAPCOREHEADER format bitmap.
	Monochrome DIBs are created as monochrome bitmap iff they are
	black and white.

	* [objects/oembitmap.c]
	Added support for OEM cursors, changed OBM_LoadIcon to use the new
	icon memory layout.

	* [rc/sysres_Fr.rc]
	Added French [Fr] language support.

	* [win32/environment.c]
	Fixed GetCommandLineA() to use current PDB.

	* [windows/event.c] [windows/winpos.c]
	Simulate a mouse motion event upon SetWindowPos() to force the
	cursor to be set correctly.

Sat Sep 30 17:49:32  Cameron Heide  (heide@ee.ualberta.ca)

	* [win32/*]
        New Win32 kernel functions: GetACP, GetCPInfo,
 	GetEnvironmentVariableA, GetFileType, GetLastError, GetOEMCP,
 	GetStartupInfoA, GetTimeZoneInformation, SetEnvironmentVariable,
 	SetFilePointer, SetLastError, VirtualAlloc, VirtualFree,
 	WriteFile.  Completed implementations of GetCommandLineA.

	* [include/kernel32.h]
        New file.

	* [loader/main.c]
        Call initialization function for Win32 data (doesn't currently do
 	anything).

	* [misc/main.c]
	Implemented GetEnvironmentVariableA, SetEnvironmentVariableA.

Sat Sep 30 00:26:56 1995  Niels de Carpentier  <niels@cindy.et.tudelft.nl>

	* [windows/winpos.c][miscemu/emulate.c][loader/module.c]
	  [misc/commdlg.c]
	Misc. bug fixes

Fri Sep 29 16:16:13 1995  Jim Peterson <jspeter@birch.ee.vt.edu>

	* [*/*]
	For Winelib, explicit casts have been placed where warnings were
 	usually generated.
	printf formats which give the format for printing a handle as
 	"%04x" or something similar have been changed to use the NPFMT
 	macro defined in include/wintypes.h.  Some times, explicit casts
 	were also necessary.
     	Parameter, field, and variable declarations have been made more
 	exact, such as converting 'WORD wParam' to 'WPARAM wParam' or
 	'WORD hFont' to 'HFONT hFont'.
     	Any call of the form GetWindowWord(hwnd,GWW_HINSTANCE) has been
 	replaced with a call to WIN_GetWindowInstance(hwnd).

	* [controls/combo.c]
	Added WINELIB32 support in CLBoxGetCombo().

	* [include/dialog.h]
	Commented out the '#ifndef WINELIB' around the '#pragma pack(1)'.
	winelib needs the packing as well (e.g. when accessing resources
	like sysres_DIALOG_SHELL_ABOUT_MSGBOX).

	* [include/windows.h]
	Got rid of the F[a-k] macros, which were cluttering up the global
	namespace.

	* [include/windows.h] [windows/defwnd.c]
	Added Win32 messages WM_CTLCOLOR*.

	* [include/wintypes.h]
	Put in preprocessor '#define WINELIB32' if appropriate and changed
	the types of some typedefs (WPARAM, HANDLE) based on this.
	
	* [loader/module.c] [toolkit/miscstubs.c]
	Added #ifdef'd portion in LoadModule to handle loading a WINElib
	module (already loaded, just init values).  '#ifdef'ed out the
	definition for GetWndProcEntry16 and added a new version to
	toolkit/miscstubs.c.

	* [misc/shell.c]
	Adjusted the lengths of AppName and AppMisc from 512,512 to 128,906.
	Same amount of total storage, but much more reasonable.  Also, changed
	calls to strcpy() in ShellAbout() to calls to strncpy() instead.
	This was a difficult bug to track down, but the AppMisc field was
	being initialized with the contributers text, which was much larger
	than 512 characters.

	* [toolkit/atom.c]
	New file for atom-handling functions.  Copied from memory/atom.c and
	then heavily modified.  Right now, it's just a linked list of atoms.
	Consider it as a hash table with just one entry.  It's easily changed
	later.

	* [toolkit/heap.c]
	Commented out the heap functions with a "#ifdef WINELIB16" and put in
	a Win32 version (which is basically a modified copy).

	* [toolkit/sup.c] [toolkit/miscstubs.c]
	Moved the stuff I put in toolkit/sup.c into toolkit/miscstubs.c and
	added quite a few more stubs.

	* [toolkit/winmain.c]
	Rearranged startup code in _WinMain.  I think this will work.

	* [toolkit/Makefile.in]
	Added targets for 'hello' and 'hello2' in case anyone cares to try
	out the sample programs.

Wed Sep 27 23:13:43 1995  Anand Kumria <akumria@ozemail.com.au>
	
	* [miscemu/int2f.c] [miscemu/vxd.c] [if1632/winprocs.spec]
	First attempt at support for some VxDs. Comm, Shell and Pagefile.

Tue Sep 26 21:34:45 1995  Hans de Graaff  <graaff@twi72.twi.tudelft.nl>

	* [misc/dos_fs.c]
	DOS_SimplifyPath: Also remove "/./" from path. (Happens when
 	starting applications like 'wine ./excel.exe')

Sat Sep 23 23:32:40 1995  Morten Welinder  <terra@diku.dk>

	* [configure.in]
	Avoid relative path for wine.ini.

	* [rc/sysres_Da.rc]
	Support for Danish [Da] language.

	* [misc/main.c] [miscemu/cpu.c]
	Return the processor we're running on correctly.

	* [miscemu/int2f.c]
	Minor stuff in int 0x2f, function 0x16.

Sat Sep 23 1995 17:58:04  Marcus Meissner  <msmeissn@faui01.informatik.uni-erlangen.de>

	* [misc/shell.c] [misc/main.c]
	Implement saving and loading of the registry database (needed for
	OLE). Very experimental. Fixed ShellExecute().
	
	* [miscemu/int21.c]
	EEXIST is not a critical error condition for mkdir().

Fri Sep 22 01:33:34 1995  Alex Korobka  <alex@phm6.pharm.sunysb.edu>

	* [include/shell.h] [misc/shell.c]
	Implemented 4 drag/drop functions with documented functionality.

        * [multimedia/time.c]
        "Fixed" MMSysTimeCallback kludge so Excel5 loads up without crashing.

	* [*/*] 
        Added new files, more message definitions, structures, debug info,
 	etc.  Rewrote message logging functions to produce output similar
 	to WinSight.  Check out -debugmsg +message option.

	* [misc/file.c]
        Fixed GetDriveType return value.  

        * [windows/message.c] 
        Hooks are invoked in normal order.

        * [miscemu/*]
        Added some functions and interrupts.

        * [misc/shell.c]
        Implemented Drag... functions.

Thu Sep 21 23:50:12 1995  Jukka Iivonen <iivonen@cc.helsinki.fi>

	* [rc/sysres_Fi.rc] [rc/sysres.rc]
	First attempt at Finnish [Fi] language support.
This commit is contained in:
Alexandre Julliard 1995-10-03 17:06:08 +00:00
parent ff8331ea68
commit af0bae5873
214 changed files with 7354 additions and 3868 deletions

View File

@ -1,15 +1,15 @@
This is release 950918 of Wine the MS Windows emulator. This is still a
This is release 951003 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "wine-new@amscons.com". Please don't forget
to include a ChangeLog entry. I'll make a new release every other week.
WHAT'S NEW with Wine-950918: (see ChangeLog for details)
- Support for self-loading modules.
- Win32 support should begin to work again.
- Cursor fixes.
- New configure script should be useable now.
WHAT'S NEW with Wine-951003: (see ChangeLog for details)
- New cursor handling.
- French, Danish and Finnish language support.
- Lots of Winelib improvements.
- Preliminary VxD support.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -18,11 +18,11 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-950918.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-950918.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-950918.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-950918.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-950918.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-951003.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-951003.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-951003.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-951003.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-951003.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
@ -36,7 +36,7 @@ reading for new developers.
Wine is available thanks to the work of Bob Amstadt, Dag Asheim,
Martin Ayotte, Ross Biro, Erik Bos, Fons Botman, John Brezak,
Andrew Bulhak, John Burton, Paul Falstad, Olaf Flebbe, Peter Galbavy,
Ramon Garcia, Hans de Graaf, Charles M. Hannum, Cameron Heide,
Ramon Garcia, Hans de Graaff, Charles M. Hannum, Cameron Heide,
Jochen Hoenicke, Jeffrey Hsu, Miguel de Icaza, Alexandre Julliard,
Jon Konrath, Scott A. Laird, Martin von Loewis, Kenneth MacDonald,
Peter MacDonald, William Magro, Marcus Meissner, Graham Menhennitt,

1
BUGS
View File

@ -1,4 +1,5 @@
- EBP and ESP are sometimes corrupted while running 16-bit code.
- Message flow is not correct for multiple tasks, some messages are not supported.
- Dialog Boxes created by WM_CREATE handler aren't visible
- MDI does not send WM_GETMINMAX message.
- InitializeLoadedDLLs() can't init LZEXPAND.DLL. (cs:ip => 0:0)

214
ChangeLog
View File

@ -1,4 +1,218 @@
----------------------------------------------------------------------
Sun Oct 1 15:48:34 1995 Alexandre Julliard <julliard@sunsite.unc>
* [controls/menu.c]
Fixed GetMenuString() for non-string items.
* [debugger/*.c]
First attempt to check validity of pointers before memory
accesses. For now only segmented pointers are checked.
* [debugger/dbg.y] [memory/ldt.c]
Added possibility to dump only one segment with 'info segment'.
* [include/bitmaps/ocr_*]
Added all OEM cursors as XPM bitmaps.
* [include/cursoricon.h] [objects/cursoricon.c]
Rewrote all cursor and icon management to use the same memory
layout as Windows, and to factor common code between icons and
cursors. Implemented icon directory lookup to find the best
matching icon (i.e. the color one).
Implemented CopyCursor() and DumpIcon().
* [loader/module.c]
For disabled built-in modules, we now try to load the Windows DLL
first, and if this fails we fall back to using the built-in module
anyway.
* [memory/global.c]
Fixed GlobalHandle() to return the correct selector in the high
word even if we are passed a handle in the first place.
* [miscemu/instr.c]
Take into account the size of the operand and of the stack segment
when incrementing the stack pointer.
Avoid referencing FS_reg and GS_reg on *BSD.
* [objects/dib.c]
All DIB functions now accept a BITMAPCOREHEADER format bitmap.
Monochrome DIBs are created as monochrome bitmap iff they are
black and white.
* [objects/oembitmap.c]
Added support for OEM cursors, changed OBM_LoadIcon to use the new
icon memory layout.
* [rc/sysres_Fr.rc]
Added French [Fr] language support.
* [win32/environment.c]
Fixed GetCommandLineA() to use current PDB.
* [windows/event.c] [windows/winpos.c]
Simulate a mouse motion event upon SetWindowPos() to force the
cursor to be set correctly.
Sat Sep 30 17:49:32 Cameron Heide (heide@ee.ualberta.ca)
* [win32/*]
New Win32 kernel functions: GetACP, GetCPInfo,
GetEnvironmentVariableA, GetFileType, GetLastError, GetOEMCP,
GetStartupInfoA, GetTimeZoneInformation, SetEnvironmentVariable,
SetFilePointer, SetLastError, VirtualAlloc, VirtualFree,
WriteFile. Completed implementations of GetCommandLineA.
* [include/kernel32.h]
New file.
* [loader/main.c]
Call initialization function for Win32 data (doesn't currently do
anything).
* [misc/main.c]
Implemented GetEnvironmentVariableA, SetEnvironmentVariableA.
Sat Sep 30 00:26:56 1995 Niels de Carpentier <niels@cindy.et.tudelft.nl>
* [windows/winpos.c][miscemu/emulate.c][loader/module.c]
[misc/commdlg.c]
Misc. bug fixes
Fri Sep 29 16:16:13 1995 Jim Peterson <jspeter@birch.ee.vt.edu>
* [*/*]
For Winelib, explicit casts have been placed where warnings were
usually generated.
printf formats which give the format for printing a handle as
"%04x" or something similar have been changed to use the NPFMT
macro defined in include/wintypes.h. Some times, explicit casts
were also necessary.
Parameter, field, and variable declarations have been made more
exact, such as converting 'WORD wParam' to 'WPARAM wParam' or
'WORD hFont' to 'HFONT hFont'.
Any call of the form GetWindowWord(hwnd,GWW_HINSTANCE) has been
replaced with a call to WIN_GetWindowInstance(hwnd).
* [controls/combo.c]
Added WINELIB32 support in CLBoxGetCombo().
* [include/dialog.h]
Commented out the '#ifndef WINELIB' around the '#pragma pack(1)'.
winelib needs the packing as well (e.g. when accessing resources
like sysres_DIALOG_SHELL_ABOUT_MSGBOX).
* [include/windows.h]
Got rid of the F[a-k] macros, which were cluttering up the global
namespace.
* [include/windows.h] [windows/defwnd.c]
Added Win32 messages WM_CTLCOLOR*.
* [include/wintypes.h]
Put in preprocessor '#define WINELIB32' if appropriate and changed
the types of some typedefs (WPARAM, HANDLE) based on this.
* [loader/module.c] [toolkit/miscstubs.c]
Added #ifdef'd portion in LoadModule to handle loading a WINElib
module (already loaded, just init values). '#ifdef'ed out the
definition for GetWndProcEntry16 and added a new version to
toolkit/miscstubs.c.
* [misc/shell.c]
Adjusted the lengths of AppName and AppMisc from 512,512 to 128,906.
Same amount of total storage, but much more reasonable. Also, changed
calls to strcpy() in ShellAbout() to calls to strncpy() instead.
This was a difficult bug to track down, but the AppMisc field was
being initialized with the contributers text, which was much larger
than 512 characters.
* [toolkit/atom.c]
New file for atom-handling functions. Copied from memory/atom.c and
then heavily modified. Right now, it's just a linked list of atoms.
Consider it as a hash table with just one entry. It's easily changed
later.
* [toolkit/heap.c]
Commented out the heap functions with a "#ifdef WINELIB16" and put in
a Win32 version (which is basically a modified copy).
* [toolkit/sup.c] [toolkit/miscstubs.c]
Moved the stuff I put in toolkit/sup.c into toolkit/miscstubs.c and
added quite a few more stubs.
* [toolkit/winmain.c]
Rearranged startup code in _WinMain. I think this will work.
* [toolkit/Makefile.in]
Added targets for 'hello' and 'hello2' in case anyone cares to try
out the sample programs.
Wed Sep 27 23:13:43 1995 Anand Kumria <akumria@ozemail.com.au>
* [miscemu/int2f.c] [miscemu/vxd.c] [if1632/winprocs.spec]
First attempt at support for some VxDs. Comm, Shell and Pagefile.
Tue Sep 26 21:34:45 1995 Hans de Graaff <graaff@twi72.twi.tudelft.nl>
* [misc/dos_fs.c]
DOS_SimplifyPath: Also remove "/./" from path. (Happens when
starting applications like 'wine ./excel.exe')
Sat Sep 23 23:32:40 1995 Morten Welinder <terra@diku.dk>
* [configure.in]
Avoid relative path for wine.ini.
* [rc/sysres_Da.rc]
Support for Danish [Da] language.
* [misc/main.c] [miscemu/cpu.c]
Return the processor we're running on correctly.
* [miscemu/int2f.c]
Minor stuff in int 0x2f, function 0x16.
Sat Sep 23 1995 17:58:04 Marcus Meissner <msmeissn@faui01.informatik.uni-erlangen.de>
* [misc/shell.c] [misc/main.c]
Implement saving and loading of the registry database (needed for
OLE). Very experimental. Fixed ShellExecute().
* [miscemu/int21.c]
EEXIST is not a critical error condition for mkdir().
Fri Sep 22 01:33:34 1995 Alex Korobka <alex@phm6.pharm.sunysb.edu>
* [include/shell.h] [misc/shell.c]
Implemented 4 drag/drop functions with documented functionality.
* [multimedia/time.c]
"Fixed" MMSysTimeCallback kludge so Excel5 loads up without crashing.
* [*/*]
Added new files, more message definitions, structures, debug info,
etc. Rewrote message logging functions to produce output similar
to WinSight. Check out -debugmsg +message option.
* [misc/file.c]
Fixed GetDriveType return value.
* [windows/message.c]
Hooks are invoked in normal order.
* [miscemu/*]
Added some functions and interrupts.
* [misc/shell.c]
Implemented Drag... functions.
Thu Sep 21 23:50:12 1995 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [rc/sysres_Fi.rc] [rc/sysres.rc]
First attempt at Finnish [Fi] language support.
----------------------------------------------------------------------------
Sun Sep 17 16:47:49 1995 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in] [*/Makefile.in] [Make.rules.in]

View File

@ -1,221 +0,0 @@
#! /bin/sh
#
# Configure script for wine
: ${EDITOR:=vi}
: ${PAGER:=more}
WINELIB=''
LANGUAGE=not_matching
ALLDEFINES=''
# Ask question 'str' and set 'var' to reply (defaulting to 'def' on CR)
prompt ()
{
str="$1"
var="$2"
def="$3"
eval $var='$def'
echo
echo -n "$str [$def]? "
input=`head -1` # When using read, user must double all backslashes
if [ -n "$input" ]
then
eval $var='$input'
fi
}
echo
echo Read the RELEASE-NOTES for an explanation of the various flags
echo
echo -n 'Build Wine as emulator or library (E/L) [E]? '
read input
if [ "$input" = 'l' -o "$input" = 'L' ]
then
WINELIB='#define WINELIB -DWINELIB'
ALLDEFINES="$ALLDEFINES -DWINELIB"
fi
LANGS=`echo En rc/sysres_*.rc | sed -e 's/rc\/sysres_//g' -e 's/\.rc//g' -e 's/ /\//g;'`
while expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev/null
do
prompt "Language ($LANGS)" LANGUAGE En
if expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev/null
then
echo "\"$LANGUAGE\" is not a supported language."
fi
done
ALLDEFINES="$ALLDEFINES -ALANG\($LANGUAGE\)"
prompt "Inter-process communication" CONFIG_IPC N
if [ CONFIG_IPC = 'Y' -o $CONFIG_IPC = 'y' ]
then
ALLDEFINES="$ALLDEFINES -DCONFIG_IPC"
fi
prompt "Malloc debugging" MALLOC_DEBUGGING N
if [ MALLOC_DEBUGGING = 'Y' -o $MALLOC_DEBUGGING = 'y' ]
then
MALLOC_DEBUGGING="#define MALLOC_DEBUGGING"
ALLDEFINES="$ALLDEFINES -DMALLOC_DEBUGGING"
else
MALLOC_DEBUGGING=''
fi
prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
if [ -r $WINE_CONFIGFILE ]
then
DEFAULT_ANS=N
else
DEFAULT_ANS=Y
fi
echo
echo -n "Do you want to make a config file now (Y/N) [$DEFAULT_ANS]? "
read input
if [ "$input" = '' ]
then
input="$DEFAULT_ANS"
fi
if [ "$input" = 'y' -o "$input" = 'Y' ]
then
if [ -r $WINE_CONFIGFILE ]
then
echo "Backing up the old file to ${WINE_CONFIGFILE}.old."
if cp $WINE_CONFIGFILE ${WINE_CONFIGFILE}.old
then :
else
echo "Error while creating backup file. Fix it and run Configure again"
exit 1
fi
fi
CF_A=`mount | awk '/^\/dev\/fd/ {print $3;exit} END {print "/a"}'`
prompt "Which directory do you want to use as A:" CF_A $CF_A
CF_C=`awk '{if ($3=="msdos") {print $2;exit}} END {print "/c"}' /etc/fstab`
prompt "Which directory do you want to use as C:" CF_C $CF_C
prompt "Where is the Windows directory" CF_Windows 'c:\windows'
prompt "Where is the System directory" CF_System 'c:\windows\system'
if [ -r "$CF_C/autoexec.bat" ]
then
CF_Temp=`tr A-Z a-z < "$CF_C/autoexec.batX" | sed -n 's/^ *set *temp= *\(c:.*[a-z]\).*/\1/p'`
fi
if [ -z "$CF_Temp" ]
then
CF_Temp='c:\temp'
fi
prompt "Where should Windows apps store temp files" CF_Temp $CF_Temp
prompt "Which path should be used to find progs/DLL's" CF_Path "$CF_Windows;$CF_System"
prompt "Where is COM1" CF_Com1 '/dev/cua0'
prompt "Where is COM2" CF_Com2 '/dev/cua1'
prompt "Where is LPT1" CF_Lpt1 '/dev/lp0'
echo
sed -n -e 's/^ *\"\(WM_[A-Z0-9]*\)\".*/\1/p' < misc/spy.c | \
sort | pr -ta4w83 | sed '1 i\
Here is the list of messages:\
\
' | $PAGER
prompt "Exclude which messages from the log" CF_Exclude 'WM_SIZE;WM_TIMER'
cat > $WINE_CONFIGFILE << EOF
[drives]
A=$CF_A
C=$CF_C
[wine]
Windows=$CF_Windows
System=$CF_System
Temp=$CF_Temp
Path=$CF_Path
SystemResources=$CF_SystemResources
[fonts]
system=*-helvetica
mssansserif=*-helvetica
msserif=*-times
fixedsys=*-fixed
arial=*-helvetica
helv=*-helvetica
roman=*-times
default=*-*
[serialports]
Com1=$CF_Com1
Com2=$CF_Com2
[parallelports]
Lpt1=$CF_Lpt1
[spy]
Exclude=$CF_Exclude
EOF
echo
sed '1 i\
The config file '"$WINE_CONFIGFILE"' now looks like this:\
\
' < $WINE_CONFIGFILE | $PAGER
echo
echo -n "Do you want to edit it using $EDITOR (Y/N) [N]? "
read input
if [ "$input" = 'y' -o "$input" = 'Y' ]
then
$EDITOR $WINE_CONFIGFILE
fi
else
if [ ! -r $WINE_CONFIGFILE ]
then
echo 'Ok, remember to make it yourself later.'
fi
fi
cat > autoconf.h << EOF
/* autoconf.h generated automatically. Run Configure. */
$WINELIB
$MALLOC_DEBUGGING
#define WINE_INI_GLOBAL "$WINE_CONFIGFILE"
#define AutoDefines $ALLDEFINES
EOF
echo
echo "Creating Makefiles. This may take a while."
if xmkmf -a
then :
else cat << EOF
WARNING: The exit status of the command 'xmkmf -a' indicates an error.
Maybe the Wine directory is incomplete, or Imake (see 'man xmkmf imake')
is incorrectly configured? In the latter case, it might be easiest to
reinstall X11 to get a new copy of Imake.
EOF
fi
if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
then
cat << EOF
WARNING: You have some files named '*.rej', which usually indicates
rejected patch files. Maybe you tried to upgrade Wine with 'patch',
and that some of the patches failed? If something doesn't work, this
might be the reason. See 'man patch' (especially the '-p' option).
List of "*.rej" files:
EOF
find . -name "*.rej" -print
fi
if [ -f ./Makefile ]
then
echo
echo "Configure finished. Do 'make' to compile Wine."
else
echo
echo "*** There was a problem with 'imake': the main Makefile has not be created."
fi

View File

@ -57,13 +57,6 @@ files contain tables used by relay.c to translate arguments and transfer
control to the proper handler. The format of the *.spec files is
documented in the file "tools/build-spec.txt".
REGISTER FUNCTIONS:
Some functions are defined as type "register" in the DLL specification files.
In order to return values in the registers to the WIN16 program, the handler
function must exit by calling ReturnFromRegisterFunc(). Look at the function
DOS3Call() for an example of how this works.
DEBUG MESSAGES:
To display a message only during debugging, you normally write something

119
Imakefile
View File

@ -1,119 +0,0 @@
#include "autoconf.h"
#include "Wine.tmpl"
#if defined(i386FreeBsd) || defined(FreeBSDArchitecture)
MAKE = gmake
#endif
DEFINES = AutoDefines -DUSE_READLINE
/*
* This is the second try at using Imakefiles. There are probably many
* problems and things I haven't even considered. I do not have a fixed
* Linux system to test them on, but thanks to Thomas Michlmayr
* <tmichl@cosy.sbg.ac.at> for use of one of his boxes.
*
* SEE BELOW ABOUT DEBUGGING AND LINUX
*
* Peter Galbavy, 31st Jan 1994: peter@wonderland.org
*/
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'MAKE=$(MAKE)'\
'DEFINES=$(DEFINES)' 'LD=$(LD)' 'ASFLAGS=$(ASFLAGS)'
COMMONSUBDIRS = \
controls \
rc \
ipc \
loader \
misc \
multimedia \
objects \
windows
EMUSUBDIRS = \
tools \
debugger \
if1632 \
memory \
miscemu
LIBSUBDIRS = \
toolkit
WINEDIR = $(LIBDIR)/wine
COMMONOBJS = \
controls/controls.o \
ipc/ipc.o \
loader/loader.o \
misc/misc.o \
multimedia/multimedia.o \
objects/objects.o \
rc/rc.o \
windows/windows.o
EMUOBJS = \
debugger/debugger.o \
if1632/if1632.o \
memory/memory.o \
miscemu/miscemu.o
LIBOBJS = \
toolkit/toolkit.o
#ifndef WINELIB
SUBDIRS = $(COMMONSUBDIRS) $(EMUSUBDIRS)
OBJS = $(EMUOBJS) $(COMMONOBJS)
#else
SUBDIRS = $(COMMONSUBDIRS) $(LIBSUBDIRS)
OBJS = $(LIBOBJS) $(COMMONOBJS)
#endif
#ifdef i386BsdArchitecture
SYSLIBS = -ll -lm -li386 -lgnumalloc
#endif
#if defined(i386FreeBsd) || defined(FreeBSDArchitecture)
SYSLIBS = -ll -lm -lgnumalloc
#endif
#ifdef LinuxArchitecture
SYSLIBS = -lm -lg
#endif
/* You may need to add the full path of your libXpm here */
XPM_LIB = -lXpm
#ifdef MALLOC_DEBUGGING
MALLOCLIB = -lmcheck
#else
MALLOCLIB =
#endif
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#ifndef WINELIB
NormalProgramTarget(wine,$(OBJS),$(DEPXLIB),$(XPM_LIB) $(XLIB),$(MALLOCLIB) $(SYSLIBS))
AllTarget(wine.sym)
#else
NormalLibraryTarget(wine,$(OBJS))
#endif
wine.sym: wine
nm wine|grep -v _compiled|sort >wine.sym
clean::
$(RM) wine.sym
depend::
install::
etags::
etags `find . -name '*.[chS]' -print`
distclean: clean
echo "/* autoconf.h generated automatically. Run Configure */" >autoconf.h
echo "#error You must run Configure before you can build the makefiles." >>autoconf.h
$(RM) config.* `find . -name Makefile -print`

View File

@ -10,7 +10,7 @@ YACC = @YACC@
LEX = @LEX@
LEXLIB = @LEXLIB@
DIVINCL = -I$(TOPSRC)/include
ALLCFLAGS = $(CFLAGS) $(DEFS) $(LANG) $(X_CFLAGS) $(DIVINCL) $(EXTRA_DEFS)
ALLCFLAGS = $(CFLAGS) $(DEFS) -ALANG\($(LANG)\) $(X_CFLAGS) $(DIVINCL) $(EXTRA_DEFS)
LDCOMBINE = ld -r
RM = rm -f
@SET_MAKE@

View File

@ -28,12 +28,12 @@ RM = rm -f
MAIN_TARGET = @MAIN_TARGET@
COMMONSUBDIRS = rc controls ipc loader misc multimedia objects windows
COMMONSUBDIRS = rc controls ipc loader misc multimedia objects win32 windows
EMUSUBDIRS = tools debugger debugger/readline if1632 memory miscemu
LIBSUBDIRS = toolkit
ALLSUBDIRS = $(COMMONSUBDIRS) $(EMUSUBDIRS) $(LIBSUBDIRS)
COMMONOBJS = \
@ -44,6 +44,7 @@ COMMONOBJS = \
multimedia/multimedia.o \
objects/objects.o \
rc/rc.o \
win32/win32.o \
windows/windows.o
EMUOBJS = \
@ -90,5 +91,5 @@ distclean:
langclean:
for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) langclean); done
$(RM) wine wine.sym winelib.a
dummy:

15
README
View File

@ -22,7 +22,7 @@ it are probably available on the ftp site where you got Wine. They can
also be found on ftp.x.org and all its mirror sites.
To build Wine, first do a "./configure" and then a "make depend; make".
The executable "wine" will be built. "wine" will load and run 16-bit
The executable "wine" will be built. "wine" will load and run 16-bit
Windows executables.
To upgrade to a new release by using a patch file, first cd to the
@ -104,20 +104,15 @@ Used to specify the devices which are used as lpt1 - lpt8.
* [spy]
format: file = <filename or CON when logging to stdout>
format: exclude = <message names and/or EXCLUDEALL separated by commas >
default: none
used to specify the file which will be used as logfile.
Used to specify which messages will be excluded from the message logging.
format: exclude = <message names separated by semicolons>
format: include = <message names and/or INCLUDEALL separated by commas >
default: none
Used to specify which messages will be excluded from the logfile.
format: include = <message names separated by semicolons>
default: none
Used to specify which messages will be included in the logfile.
Used to specify which messages will be included in the message logging.
4. RUNNING PROGRAMS

View File

@ -319,8 +319,8 @@ Main configuration file for wine.
Changes in Wine, since the beginning (most recent changes first)
.TP
.I configure
Shell script to automatically generate Makefiles. Usually followed by make
(or gmake on *BSD systems) to compile wine.
Shell script to automatically generate Makefiles. Usually followed by
make to compile wine.
.TP
.I Wine newsgroup
Subscribe to comp.emulators.ms-windows.wine

12
configure vendored
View File

@ -15,7 +15,7 @@ ac_default_prefix=/usr/local
ac_help="$ac_help
--with-library build Wine as a library instead of an emulator"
ac_help="$ac_help
--with-language=LANG change the default language (LANG=En/De/No/Es)"
--with-language=LANG change the language (LANG=En/De/Fr/Es/No/Fi/Da)"
ac_help="$ac_help
--with-ipc use inter-process communication for DDE"
ac_help="$ac_help
@ -431,9 +431,9 @@ fi
# Check whether --with-language or --without-language was given.
withval="$with_language"
if test -n "$withval"; then
LANG="-ALANG\($withval\)"
LANG="$withval"
else
LANG="-ALANG\(En\)"
LANG=En
fi
@ -1556,7 +1556,7 @@ fi
if test -z "${top_srcdir}"; then
TOP_SRCDIR="."
TOP_SRCDIR=`pwd`
else
TOP_SRCDIR="${top_srcdir}"
fi
@ -1689,7 +1689,7 @@ done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Make.rules controls/Makefile ipc/Makefile loader/Makefile memory/Makefile misc/Makefile miscemu/Makefile multimedia/Makefile objects/Makefile windows/Makefile rc/Makefile debugger/Makefile debugger/readline/Makefile tools/Makefile if1632/Makefile toolkit/Makefile Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
trap 'rm -fr `echo "Make.rules controls/Makefile ipc/Makefile loader/Makefile memory/Makefile misc/Makefile miscemu/Makefile multimedia/Makefile objects/Makefile win32/Makefile windows/Makefile rc/Makefile debugger/Makefile debugger/readline/Makefile tools/Makefile if1632/Makefile toolkit/Makefile Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
@ -1726,7 +1726,7 @@ CEOF
EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Make.rules controls/Makefile ipc/Makefile loader/Makefile memory/Makefile misc/Makefile miscemu/Makefile multimedia/Makefile objects/Makefile windows/Makefile rc/Makefile debugger/Makefile debugger/readline/Makefile tools/Makefile if1632/Makefile toolkit/Makefile Makefile"}
CONFIG_FILES=\${CONFIG_FILES-"Make.rules controls/Makefile ipc/Makefile loader/Makefile memory/Makefile misc/Makefile miscemu/Makefile multimedia/Makefile objects/Makefile win32/Makefile windows/Makefile rc/Makefile debugger/Makefile debugger/readline/Makefile tools/Makefile if1632/Makefile toolkit/Makefile Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

View File

@ -16,9 +16,9 @@ AC_ARG_WITH(library,
AC_SUBST(MAIN_TARGET)
AC_ARG_WITH(language,
[ --with-language=LANG change the default language (LANG=En/De/No/Es)],
[LANG="-ALANG\($withval\)"],
[LANG="-ALANG\(En\)"],)
[ --with-language=LANG change the language (LANG=En/De/Fr/Es/No/Fi/Da)],
[LANG="$withval"],
[LANG=En],)
AC_SUBST(LANG)
AC_ARG_WITH(ipc,
@ -45,7 +45,7 @@ AC_C_CONST()
AC_TYPE_SIZE_T()
if test -z "${top_srcdir}"; then
TOP_SRCDIR="."
TOP_SRCDIR=`pwd`
else
TOP_SRCDIR="${top_srcdir}"
fi
@ -77,7 +77,7 @@ AC_DEFINE_UNQUOTED(WINE_INI_GLOBAL,$WINE_INI_GLOBAL)
MAKE_RULES=$TOP_SRCDIR/Make.rules
AC_SUBST_FILE(MAKE_RULES)
AC_OUTPUT(Make.rules controls/Makefile ipc/Makefile loader/Makefile memory/Makefile misc/Makefile miscemu/Makefile multimedia/Makefile objects/Makefile windows/Makefile rc/Makefile debugger/Makefile debugger/readline/Makefile tools/Makefile if1632/Makefile toolkit/Makefile Makefile)
AC_OUTPUT(Make.rules controls/Makefile ipc/Makefile loader/Makefile memory/Makefile misc/Makefile miscemu/Makefile multimedia/Makefile objects/Makefile win32/Makefile windows/Makefile rc/Makefile debugger/Makefile debugger/readline/Makefile tools/Makefile if1632/Makefile toolkit/Makefile Makefile)
echo
echo "Configure finished. Do 'make depend; make' to compile Wine."

View File

@ -1,23 +0,0 @@
#include "../Wine.tmpl"
MODULE = controls
SRCS = \
button.c \
combo.c \
desktop.c \
edit.c \
listbox.c \
menu.c \
scroll.c \
static.c \
widgets.c
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
install::

View File

@ -68,7 +68,7 @@ static HBITMAP hbitmapCheckBoxes = 0;
static WORD checkBoxWidth = 0, checkBoxHeight = 0;
LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
LRESULT ButtonWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT rect;
LONG lResult = 0;
@ -156,8 +156,14 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
((infoPtr->state & 3) + 1), 0 );
break;
}
#ifdef WINELIB32
SendMessage( GetParent(hWnd), WM_COMMAND,
MAKEWPARAM(wndPtr->wIDmenu,BN_CLICKED),
(LPARAM) hWnd );
#else
SendMessage( GetParent(hWnd), WM_COMMAND,
wndPtr->wIDmenu, MAKELPARAM(hWnd,BN_CLICKED));
#endif
}
break;
@ -182,13 +188,13 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
return 0;
case WM_SETFONT:
infoPtr->hFont = wParam;
infoPtr->hFont = (HFONT) wParam;
if (lParam)
PAINT_BUTTON( hWnd, style, ODA_DRAWENTIRE );
break;
case WM_GETFONT:
return infoPtr->hFont;
return (LONG) infoPtr->hFont;
case WM_SETFOCUS:
infoPtr->state |= BUTTON_HASFOCUS;
@ -269,8 +275,13 @@ static void PB_Paint( HWND hButton, HDC hDC, WORD action )
/* Send WM_CTLCOLOR to allow changing the font (the colors are fixed) */
if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
#ifdef WINELIB32
SendMessage( GetParent(hButton), WM_CTLCOLORBTN,
(WPARAM)hDC, (LPARAM)hButton );
#else
SendMessage( GetParent(hButton), WM_CTLCOLOR, (WORD)hDC,
MAKELPARAM(hButton, CTLCOLOR_BTN) );
#endif
hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowFrame);
hOldBrush = (HBRUSH)SelectObject(hDC, sysColorObjects.hbrushBtnFace);
SetBkMode(hDC, TRANSPARENT);
@ -302,7 +313,7 @@ static void PB_Paint( HWND hButton, HDC hDC, WORD action )
else GRAPH_DrawReliefRect( hDC, &rc, 2, 2, FALSE );
/* draw button label, if any: */
text = USER_HEAP_LIN_ADDR( wndPtr->hText );
text = (char*) USER_HEAP_LIN_ADDR( wndPtr->hText );
if (text[0])
{
SetTextColor( hDC, (wndPtr->dwStyle & WS_DISABLED) ?
@ -347,13 +358,18 @@ static void CB_Paint( HWND hWnd, HDC hDC, WORD action )
GetClientRect(hWnd, &rc);
if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
#ifdef WINELIB32 /* JBP: Different in Win32 */
hBrush = (HBRUSH) SendMessage(GetParent(hWnd), WM_CTLCOLORBTN, (WPARAM)hDC,
(LPARAM)hWnd);
#else
hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
MAKELPARAM(hWnd, CTLCOLOR_BTN));
#endif
if (action == ODA_DRAWENTIRE) FillRect(hDC, &rc, hBrush);
GetTextMetrics(hDC, &tm);
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
text = USER_HEAP_LIN_ADDR( wndPtr->hText );
text = (char*) USER_HEAP_LIN_ADDR( wndPtr->hText );
textlen = strlen( text );
/* Draw the check-box bitmap */
@ -421,8 +437,12 @@ static void GB_Paint( HWND hWnd, HDC hDC, WORD action )
if (action != ODA_DRAWENTIRE) return;
if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
#ifdef WINELIB32
SendMessage( GetParent(hWnd), WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hWnd );
#else
SendMessage( GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
MAKELPARAM(hWnd, CTLCOLOR_BTN));
#endif
SelectObject( hDC, sysColorObjects.hpenWindowFrame );
GetClientRect(hWnd, &rc);
@ -433,7 +453,7 @@ static void GB_Paint( HWND hWnd, HDC hDC, WORD action )
LineTo( hDC, rc.left, rc.bottom-1 );
LineTo( hDC, rc.left, rc.top+2 );
text = USER_HEAP_LIN_ADDR( wndPtr->hText );
text = (char*) USER_HEAP_LIN_ADDR( wndPtr->hText );
GetTextExtentPoint(hDC, text, strlen(text), &size);
rc.left += 10;
rc.right = rc.left + size.cx + 1;
@ -460,8 +480,13 @@ static void UB_Paint( HWND hWnd, HDC hDC, WORD action )
GetClientRect(hWnd, &rc);
if (infoPtr->hFont) SelectObject( hDC, infoPtr->hFont );
#ifdef WINELIB32
hBrush = (HBRUSH) SendMessage(GetParent(hWnd), WM_CTLCOLORBTN, (WPARAM)hDC,
(LPARAM)hWnd);
#else
hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
MAKELPARAM(hWnd, CTLCOLOR_BTN));
#endif
FillRect(hDC, &rc, hBrush);
if ((action == ODA_FOCUS) ||
@ -491,5 +516,5 @@ static void OB_Paint( HWND hWnd, HDC hDC, WORD action )
dis.hDC = hDC;
GetClientRect( hWnd, &dis.rcItem );
dis.itemData = 0;
SendMessage(GetParent(hWnd), WM_DRAWITEM, 1, MAKE_SEGPTR(&dis) );
SendMessage(GetParent(hWnd), WM_DRAWITEM, 1, (LPARAM) MAKE_SEGPTR(&dis) );
}

View File

@ -131,7 +131,7 @@ static LONG CBCreate(HWND hwnd, WORD wParam, LONG lParam)
lphc->hWndEdit = CreateWindow(MAKE_SEGPTR(editName), (SEGPTR)0,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | SS_LEFT,
0, 0, rect.right, lphl->StdItemHeight,
hwnd, 1, GetWindowWord(hwnd,GWW_HINSTANCE), 0L);
hwnd, (HMENU)1, WIN_GetWindowInstance(hwnd), 0L);
break;
case CBS_DROPDOWN: /* edit control, dropdown listbox */
dprintf_combo(stddeb,"CBS_DROPDOWN\n");
@ -145,7 +145,7 @@ static LONG CBCreate(HWND hwnd, WORD wParam, LONG lParam)
lphc->hWndEdit = CreateWindow(MAKE_SEGPTR(editName), (SEGPTR)0,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | SS_LEFT,
0, 0, lphc->RectButton.left, lphl->StdItemHeight,
hwnd, 1, GetWindowWord(hwnd,GWW_HINSTANCE), 0L);
hwnd, (HMENU)1, WIN_GetWindowInstance(hwnd), 0L);
break;
case CBS_DROPDOWNLIST: /* static control, downdown listbox */
dprintf_combo(stddeb,"CBS_DROPDOWNLIST\n");
@ -167,10 +167,10 @@ static LONG CBCreate(HWND hwnd, WORD wParam, LONG lParam)
lboxrect.left, lboxrect.top,
lboxrect.right - lboxrect.left,
lboxrect.bottom - lboxrect.top,
0, 0, GetWindowWord(hwnd,GWW_HINSTANCE),
(SEGPTR)MAKELONG(hwnd, hwnd));
0, 0, WIN_GetWindowInstance(hwnd),
(SEGPTR)hwnd );
ShowWindow(lphc->hWndLBox, SW_HIDE);
dprintf_combo(stddeb,"Combo Creation LBox=%X!\n", lphc->hWndLBox);
dprintf_combo(stddeb,"Combo Creation LBox="NPFMT"!\n", lphc->hWndLBox);
return 0;
}
@ -220,8 +220,13 @@ static LONG CBPaint(HWND hwnd, WORD wParam, LONG lParam)
hOldFont = SelectObject(hdc, lphl->hFont);
#ifdef WINELIB32
hBrush = (HBRUSH) SendMessage(lphl->hParent, WM_CTLCOLORLISTBOX, (WPARAM)hdc,
(LPARAM)hwnd);
#else
hBrush = SendMessage(lphl->hParent, WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
#endif
if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
GetClientRect(hwnd, &rect);
@ -512,14 +517,14 @@ static LONG CBSetRedraw(HWND hwnd, WORD wParam, LONG lParam)
/***********************************************************************
* CBSetFont
*/
static LONG CBSetFont(HWND hwnd, WORD wParam, LONG lParam)
static LONG CBSetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
LPHEADLIST lphl = ComboGetListHeader(hwnd);
if (wParam == 0)
lphl->hFont = GetStockObject(SYSTEM_FONT);
else
lphl->hFont = wParam;
lphl->hFont = (HFONT)wParam;
return 0;
}
@ -588,7 +593,7 @@ static LONG CBShowDropDown(HWND hwnd, WORD wParam, LONG lParam)
/***********************************************************************
* ComboWndProc
*/
LONG ComboBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
LRESULT ComboBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_NCCREATE: return CBNCCreate(hwnd, wParam, lParam);
@ -629,7 +634,11 @@ LONG ComboBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
HWND CLBoxGetCombo(HWND hwnd)
{
return GetWindowWord(hwnd,0);
#ifdef WINELIB32
return (HWND)GetWindowLong(hwnd,0);
#else
return (HWND)GetWindowWord(hwnd,0);
#endif
}
LPHEADLIST CLBoxGetListHeader(HWND hwnd)
@ -735,8 +744,13 @@ static LONG CBLPaint( HWND hwnd, WORD wParam, LONG lParam )
}
hOldFont = SelectObject(hdc, lphl->hFont);
#ifdef WINELIB32
hBrush = (HBRUSH) SendMessage(lphl->hParent, WM_CTLCOLORLISTBOX, (WPARAM)hdc,
(LPARAM)hwnd);
#else
hBrush = SendMessage(lphl->hParent, WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
#endif
if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
@ -835,10 +849,16 @@ static LONG CBLLButtonUp( HWND hwnd, WORD wParam, LONG lParam )
if (GetCapture() == hwnd) ReleaseCapture();
if (lphl->PrevFocused != lphl->ItemFocused) {
SendMessage(CLBoxGetCombo(hwnd),CB_SETCURSEL,lphl->ItemFocused,0);
ListBoxSendNotification(lphl, CLBoxGetCombo(hwnd), CBN_SELCHANGE);
}
if(!lphl)
{
fprintf(stdnimp,"CBLLButtonUp: CLBoxGetListHeader returned NULL!\n");
}
else if (lphl->PrevFocused != lphl->ItemFocused)
{
SendMessage(CLBoxGetCombo(hwnd),CB_SETCURSEL,lphl->ItemFocused,0);
ListBoxSendNotification(lphl, CLBoxGetCombo(hwnd), CBN_SELCHANGE);
}
SendMessage(CLBoxGetCombo(hwnd),CB_SHOWDROPDOWN,0,0);
return 0;
@ -938,7 +958,7 @@ static LONG CBLVScroll( HWND hwnd, WORD wParam, LONG lParam )
/***********************************************************************
* ComboLBoxWndProc
*/
LONG ComboLBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
LRESULT ComboLBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_CREATE: return CBLCreate(hwnd, wParam, lParam);
@ -961,7 +981,7 @@ LONG ComboLBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
*/
BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, int nIDLBox)
{
fprintf(stdnimp,"DlgDirSelectComboBox(%04X, '%s', %d) \n",
fprintf(stdnimp,"DlgDirSelectComboBox("NPFMT", '%s', %d) \n",
hDlg, lpStr, nIDLBox);
return TRUE;
}
@ -976,8 +996,8 @@ int DlgDirListComboBox(HWND hDlg, SEGPTR PathSpec,
HWND hWnd;
int ret;
LPSTR lpPathSpec = PTR_SEG_TO_LIN(PathSpec);
dprintf_combo(stddeb,"DlgDirListComboBox(%04X, '%s', %d, %d, %04X) \n",
dprintf_combo(stddeb,"DlgDirListComboBox("NPFMT", '%s', %d, %d, %04X) \n",
hDlg, lpPathSpec, nIDLBox, nIDStat, wType);
if (nIDLBox) {
LPHEADLIST lphl;
@ -1003,13 +1023,13 @@ int DlgDirListComboBox(HWND hDlg, SEGPTR PathSpec,
temp[1] = 'A'+drive;
temp[2] = ':';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
USER_HEAP_SEG_ADDR(hTemp) + 1 );
(LPARAM)(USER_HEAP_SEG_ADDR(hTemp) + 1) );
} else {
temp[0] = 'A'+drive;
temp[1] = ':';
temp[2] = '\\';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
USER_HEAP_SEG_ADDR(hTemp) );
(LPARAM)USER_HEAP_SEG_ADDR(hTemp) );
}
USER_HEAP_FREE( hTemp );
}

View File

@ -118,7 +118,7 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
*
* Window procedure for the desktop window.
*/
LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam )
LRESULT DesktopWndProc ( HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam )
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;

View File

@ -20,9 +20,16 @@
#include "debug.h"
#ifdef WINELIB32
#define NOTIFY_PARENT(hWndCntrl, wNotifyCode) \
SendMessage(GetParent(hWndCntrl), WM_COMMAND, \
MAKEWPARAM(GetDlgCtrlID(hWndCntrl),wNotifyCode), \
(LPARAM)hWndCntrl );
#else
#define NOTIFY_PARENT(hWndCntrl, wNotifyCode) \
SendMessage(GetParent(hWndCntrl), WM_COMMAND, \
GetDlgCtrlID(hWndCntrl), MAKELPARAM(hWndCntrl, wNotifyCode));
#endif
#define MAXTEXTLEN 30000 /* maximum text buffer length */
#define EDITLEN 1024 /* starting length for multi-line control */
@ -95,12 +102,12 @@ static int ButtonCol; /* col in text buffer when button pressed */
*
* Allocate the specified number of bytes on the specified local heap.
*/
static unsigned int EDIT_HeapAlloc(HWND hwnd, int bytes, WORD flags)
static HLOCAL EDIT_HeapAlloc(HWND hwnd, int bytes, WORD flags)
{
unsigned int ret;
HLOCAL ret;
ret = LOCAL_Alloc( GetWindowWord(hwnd,GWW_HINSTANCE), flags, bytes );
if (ret == 0)
ret = LOCAL_Alloc( WIN_GetWindowInstance(hwnd), flags, bytes );
if (!ret)
printf("EDIT_HeapAlloc: Out of heap-memory\n");
return ret;
}
@ -110,10 +117,10 @@ static unsigned int EDIT_HeapAlloc(HWND hwnd, int bytes, WORD flags)
*
* Return the address of the memory pointed to by the handle.
*/
static void *EDIT_HeapLock(HWND hwnd, unsigned int handle)
static void *EDIT_HeapLock(HWND hwnd, HANDLE handle)
{
WORD hinstance = GetWindowWord( hwnd, GWW_HINSTANCE );
WORD offs;
HINSTANCE hinstance = WIN_GetWindowInstance( hwnd );
HANDLE offs;
if (handle == 0) return 0;
offs = LOCAL_Lock( hinstance, handle );
@ -123,10 +130,10 @@ static void *EDIT_HeapLock(HWND hwnd, unsigned int handle)
/*********************************************************************
* EDIT_HeapUnlock
*/
static void EDIT_HeapUnlock(HWND hwnd, unsigned int handle)
static void EDIT_HeapUnlock(HWND hwnd, HANDLE handle)
{
if (handle == 0) return;
LOCAL_Unlock( GetWindowWord( hwnd, GWW_HINSTANCE ), handle );
LOCAL_Unlock( WIN_GetWindowInstance( hwnd ), handle );
}
/*********************************************************************
@ -134,9 +141,9 @@ static void EDIT_HeapUnlock(HWND hwnd, unsigned int handle)
*
* Reallocate the memory pointed to by the handle.
*/
static unsigned int EDIT_HeapReAlloc(HWND hwnd, unsigned int handle, int bytes)
static HLOCAL EDIT_HeapReAlloc(HWND hwnd, HANDLE handle, int bytes)
{
return LOCAL_ReAlloc( GetWindowWord(hwnd,GWW_HINSTANCE), handle, bytes,
return LOCAL_ReAlloc( WIN_GetWindowInstance(hwnd), handle, bytes,
LMEM_FIXED );
}
@ -146,9 +153,9 @@ static unsigned int EDIT_HeapReAlloc(HWND hwnd, unsigned int handle, int bytes)
*
* Frees the memory pointed to by the handle.
*/
static void EDIT_HeapFree(HWND hwnd, unsigned int handle)
static void EDIT_HeapFree(HWND hwnd, HANDLE handle)
{
LOCAL_Free( GetWindowWord(hwnd,GWW_HINSTANCE), handle );
LOCAL_Free( WIN_GetWindowInstance(hwnd), handle );
}
@ -157,9 +164,9 @@ static void EDIT_HeapFree(HWND hwnd, unsigned int handle)
*
* Return the size of the given object on the local heap.
*/
static unsigned int EDIT_HeapSize(HWND hwnd, unsigned int handle)
static unsigned int EDIT_HeapSize(HWND hwnd, HANDLE handle)
{
return LOCAL_Size( GetWindowWord(hwnd,GWW_HINSTANCE), handle );
return LOCAL_Size( WIN_GetWindowInstance(hwnd), handle );
}
/********************************************************************
@ -470,8 +477,12 @@ static void EDIT_WriteText(HWND hwnd, char *lp, int off, int len, int row,
else
oldfont = 0; /* -Wall does not see the use of if */
SendMessage(GetParent(hwnd), WM_CTLCOLOR, (WORD)hdc,
#ifdef WINELIB32
SendMessage(GetParent(hwnd), WM_CTLCOLOREDIT, (WPARAM)hdc, (LPARAM)hwnd);
#else
SendMessage(GetParent(hwnd), WM_CTLCOLOR, (WPARAM)hdc,
MAKELPARAM(hwnd, CTLCOLOR_EDIT));
#endif
if (reverse)
{
@ -1840,13 +1851,13 @@ static LONG EDIT_UndoMsg(HWND hwnd)
/*********************************************************************
* EM_SETHANDLE message function
*/
static void EDIT_SetHandleMsg(HWND hwnd, WORD wParam)
static void EDIT_SetHandleMsg(HWND hwnd, WPARAM wParam)
{
EDITSTATE *es = EDIT_GetEditState(hwnd);
if (IsMultiLine(hwnd))
{
es->hText = wParam;
es->hText = (HANDLE)wParam;
es->textlen = EDIT_HeapSize(hwnd, es->hText);
es->wlines = 0;
es->wtop = es->wleft = 0;
@ -1856,8 +1867,8 @@ static void EDIT_SetHandleMsg(HWND hwnd, WORD wParam)
es->textwidth = 0;
es->SelBegLine = es->SelBegCol = 0;
es->SelEndLine = es->SelEndCol = 0;
dprintf_edit(stddeb, "EDIT_SetHandleMsg: handle %04x, textlen=%d\n",
wParam, es->textlen);
dprintf_edit(stddeb, "EDIT_SetHandleMsg: handle %04lx, textlen=%d\n",
(DWORD)wParam, es->textlen);
EDIT_BuildTextPointers(hwnd);
es->PaintBkgd = TRUE;
@ -2107,14 +2118,14 @@ static void EDIT_SetSelMsg(HWND hwnd, WORD wParam, LONG lParam)
/*********************************************************************
* WM_SETFONT
*/
static void EDIT_WM_SetFont(HWND hwnd, WORD wParam, LONG lParam)
static void EDIT_WM_SetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
TEXTMETRIC tm;
HFONT oldfont;
EDITSTATE *es = EDIT_GetEditState(hwnd);
es->hFont = wParam;
es->hFont = (HANDLE)wParam;
hdc = GetDC(hwnd);
oldfont = (HFONT)SelectObject(hdc, (HANDLE)es->hFont);
GetCharWidth(hdc, 0, 255, es->CharWidths);
@ -2174,7 +2185,7 @@ static void EDIT_WM_Paint(HWND hwnd)
rc.right, rc.bottom);
if (es->PaintBkgd)
FillWindow(GetParent(hwnd), hwnd, hdc, CTLCOLOR_EDIT);
FillWindow(GetParent(hwnd), hwnd, hdc, (HBRUSH)CTLCOLOR_EDIT);
for (y = (rc.top / es->txtht); y <= (rc.bottom / es->txtht); y++)
{
@ -2607,7 +2618,7 @@ static LONG EDIT_WM_SetText(HWND hwnd, LONG lParam)
/*********************************************************************
* EditWndProc()
*/
LONG EditWndProc(HWND hwnd, WORD uMsg, WORD wParam, LONG lParam)
LRESULT EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LONG lResult = 0;
char *textPtr;
@ -2616,7 +2627,7 @@ LONG EditWndProc(HWND hwnd, WORD uMsg, WORD wParam, LONG lParam)
switch (uMsg) {
case EM_CANUNDO:
lResult = es->hDeletedText;
lResult = (LONG)es->hDeletedText;
break;
case EM_EMPTYUNDOBUFFER:
@ -2636,7 +2647,7 @@ LONG EditWndProc(HWND hwnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case EM_GETHANDLE:
lResult = es->hText;
lResult = (LONG)es->hText;
break;
case EM_GETLINE:

View File

@ -118,8 +118,13 @@ static LPHEADLIST ListBoxGetStorageHeader(HWND hwnd)
void ListBoxSendNotification(LPHEADLIST lphl, HWND hwnd, WORD code)
{
if (lphl->dwStyle & LBS_NOTIFY)
#ifdef WINELIB32
SendMessage(lphl->hParent, WM_COMMAND,
MAKEWPARAM(lphl->CtlID,code), (LPARAM)hwnd);
#else
SendMessage(lphl->hParent, WM_COMMAND,
lphl->CtlID, MAKELONG(hwnd, code));
#endif
}
@ -274,7 +279,7 @@ void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls)
*lpmeasure = lpls->mis;
lpmeasure->itemHeight = lphl->StdItemHeight;
SendMessage(lphl->hParent, WM_MEASUREITEM, 0, USER_HEAP_SEG_ADDR(hTemp));
SendMessage(lphl->hParent, WM_MEASUREITEM, 0, (LPARAM)USER_HEAP_SEG_ADDR(hTemp));
if (lphl->dwStyle & LBS_OWNERDRAWFIXED) {
lphl->StdItemHeight = lpmeasure->itemHeight;
@ -898,8 +903,14 @@ static LONG LBRButtonUp(HWND hwnd, WORD wParam, LONG lParam)
{
LPHEADLIST lphl = ListBoxGetStorageHeader(hwnd);
#ifdef WINELIB32
SendMessage(lphl->hParent, WM_COMMAND,
MAKEWPARAM(GetWindowWord(hwnd,GWW_ID),LBN_DBLCLK),
(LPARAM)hwnd);
#else
SendMessage(lphl->hParent, WM_COMMAND, GetWindowWord(hwnd,GWW_ID),
MAKELONG(hwnd, LBN_DBLCLK));
#endif
return 0;
}
@ -1060,7 +1071,8 @@ static LONG LBSetRedraw(HWND hwnd, WORD wParam, LONG lParam)
{
LPHEADLIST lphl = ListBoxGetStorageHeader(hwnd);
dprintf_listbox(stddeb,"ListBox WM_SETREDRAW hWnd=%04X w=%04X !\n", hwnd, wParam);
dprintf_listbox(stddeb,"ListBox WM_SETREDRAW hWnd="NPFMT" w=%04X !\n",
hwnd, wParam);
lphl->bRedrawFlag = wParam;
return 0;
@ -1069,14 +1081,14 @@ static LONG LBSetRedraw(HWND hwnd, WORD wParam, LONG lParam)
/***********************************************************************
* LBSetFont
*/
static LONG LBSetFont(HWND hwnd, WORD wParam, LONG lParam)
static LONG LBSetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
LPHEADLIST lphl = ListBoxGetStorageHeader(hwnd);
if (wParam == 0)
lphl->hFont = GetStockObject(SYSTEM_FONT);
else
lphl->hFont = wParam;
lphl->hFont = (HFONT) wParam;
return 0;
}
@ -1105,8 +1117,13 @@ static LONG LBPaint(HWND hwnd, WORD wParam, LONG lParam)
hOldFont = SelectObject(hdc, lphl->hFont);
#ifdef WINELIB32
hBrush = (HBRUSH) SendMessage(lphl->hParent, WM_CTLCOLORLISTBOX, (WPARAM)hdc,
(LPARAM)hwnd);
#else
hBrush = SendMessage(lphl->hParent, WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
#endif
if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
@ -1638,7 +1655,7 @@ static LONG LBSetItemHeight(HWND hwnd, WORD wParam, LONG lParam)
/***********************************************************************
* ListBoxWndProc
*/
LONG ListBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
LRESULT ListBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_CREATE: return LBCreate(hwnd, wParam, lParam);
@ -1702,7 +1719,7 @@ BOOL DlgDirSelect(HWND hDlg, LPSTR lpStr, int nIDLBox)
LPHEADLIST lphl;
char s[130];
dprintf_listbox( stddeb, "DlgDirSelect(%04X, '%s', %d) \n", hDlg, lpStr,
dprintf_listbox( stddeb, "DlgDirSelect("NPFMT", '%s', %d) \n", hDlg, lpStr,
nIDLBox );
hwnd = GetDlgItem(hDlg, nIDLBox);
@ -1743,7 +1760,7 @@ int DlgDirList(HWND hDlg, LPSTR lpPathSpec,
HWND hWnd;
int ret;
dprintf_listbox(stddeb,"DlgDirList(%04X, '%s', %d, %d, %04X) \n",
dprintf_listbox(stddeb,"DlgDirList("NPFMT", '%s', %d, %d, %04X) \n",
hDlg, lpPathSpec, nIDLBox, nIDStat, wType);
if (nIDLBox) {
LPHEADLIST lphl;
@ -1767,13 +1784,13 @@ int DlgDirList(HWND hDlg, LPSTR lpPathSpec,
temp[1] = 'A'+drive;
temp[2] = ':';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
USER_HEAP_SEG_ADDR(hTemp) + 1 );
(LPARAM)(USER_HEAP_SEG_ADDR(hTemp) + 1) );
} else {
temp[0] = 'A'+drive;
temp[1] = ':';
temp[2] = '\\';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
USER_HEAP_SEG_ADDR(hTemp) );
(LPARAM)USER_HEAP_SEG_ADDR(hTemp) );
}
USER_HEAP_FREE( hTemp );
}

View File

@ -225,8 +225,13 @@ static WORD MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, WORD key )
if (p && (p[1] != '&') && (toupper(p[1]) == key)) return i;
}
}
#ifdef WINELIB32
menuchar = SendMessage( hwndOwner, WM_MENUCHAR,
MAKEWPARAM(key,menu->wFlags), (LPARAM)hmenu );
#else
menuchar = SendMessage( hwndOwner, WM_MENUCHAR, key,
MAKELONG( menu->wFlags, hmenu ) );
#endif
if (HIWORD(menuchar) == 2) return LOWORD(menuchar);
if (HIWORD(menuchar) == 1) return -2;
return -1;
@ -252,7 +257,7 @@ static void MENU_CalcItemSize( HDC hdc, LPMENUITEM lpitem, HWND hwndOwner,
static LPMEASUREITEMSTRUCT mistruct=NULL;
if (mistruct == NULL) {
mistrh = GlobalAlloc(0,sizeof(MEASUREITEMSTRUCT));
mistrsegp = WIN16_GlobalLock(mistrh);
mistrsegp = (SEGPTR)WIN16_GlobalLock(mistrh);
mistruct = PTR_SEG_TO_LIN(mistrsegp);
}
mistruct->CtlType = ODT_MENU;
@ -455,7 +460,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HDC hdc, LPMENUITEM lpitem,
static LPDRAWITEMSTRUCT distruct=NULL;
if (distruct == NULL) {
distrh = GlobalAlloc(0,sizeof(DRAWITEMSTRUCT));
distrsegp = WIN16_GlobalLock(distrh);
distrsegp = (SEGPTR)WIN16_GlobalLock(distrh);
distruct = PTR_SEG_TO_LIN(distrsegp);
}
dprintf_menu(stddeb,"DrawMenuItem: Ownerdraw!\n");
@ -630,7 +635,7 @@ WORD MENU_DrawMenuBar(HDC hDC, LPRECT lprect, HWND hwnd, BOOL suppress_draw)
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( wndPtr->wIDmenu );
if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU;
dprintf_menu(stddeb,"MENU_DrawMenuBar(%04X, %p, %p); !\n",
dprintf_menu(stddeb,"MENU_DrawMenuBar("NPFMT", %p, %p); !\n",
hDC, lprect, lppop);
if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
lprect->bottom = lprect->top + lppop->Height;
@ -667,7 +672,7 @@ static BOOL MENU_ShowPopup(HWND hwndOwner, HMENU hmenu, WORD id, int x, int y)
item[menu->FocusedItem].item_flags &= ~(MF_HILITE | MF_MOUSESELECT);
menu->FocusedItem = NO_SELECTED_ITEM;
}
SendMessage( hwndOwner, WM_INITMENUPOPUP, hmenu,
SendMessage( hwndOwner, WM_INITMENUPOPUP, (WPARAM)hmenu,
MAKELONG( id, (menu->wFlags & MF_SYSMENU) ? 1 : 0 ));
MENU_PopupMenuCalcSize( menu, hwndOwner );
if (!menu->hWnd)
@ -735,22 +740,43 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, WORD wIndex )
if (lppop->FocusedItem == SYSMENU_SELECTED)
{
NC_DrawSysButton( lppop->hWnd, hdc, TRUE );
#ifdef WINELIB32
SendMessage( hwndOwner, WM_MENUSELECT,
MAKEWPARAM( GetSystemMenu( lppop->hWnd, FALSE ),
lppop->wFlags | MF_MOUSESELECT ),
(LPARAM)hmenu );
#else
SendMessage( hwndOwner, WM_MENUSELECT,
GetSystemMenu( lppop->hWnd, FALSE ),
MAKELONG( lppop->wFlags | MF_MOUSESELECT, hmenu ) );
#endif
}
else
{
items[lppop->FocusedItem].item_flags |= MF_HILITE;
MENU_DrawMenuItem( lppop->hWnd, hdc, &items[lppop->FocusedItem], lppop->Height,
!(lppop->wFlags & MF_POPUP) );
#ifdef WINELIB32
SendMessage( hwndOwner, WM_MENUSELECT,
MAKEWPARAM( items[lppop->FocusedItem].item_id,
items[lppop->FocusedItem].item_flags |
MF_MOUSESELECT ),
(LPARAM) hmenu );
#else
SendMessage( hwndOwner, WM_MENUSELECT,
items[lppop->FocusedItem].item_id,
MAKELONG( items[lppop->FocusedItem].item_flags | MF_MOUSESELECT, hmenu));
#endif
}
}
#ifdef WINELIB32
else SendMessage( hwndOwner, WM_MENUSELECT,
MAKEWPARAM( hmenu, lppop->wFlags | MF_MOUSESELECT),
(LPARAM)hmenu );
#else
else SendMessage( hwndOwner, WM_MENUSELECT, hmenu,
MAKELONG( lppop->wFlags | MF_MOUSESELECT, hmenu ) );
#endif
ReleaseDC( lppop->hWnd, hdc );
}
@ -858,7 +884,7 @@ static HMENU MENU_GetSubPopup( HMENU hmenu )
item = ((MENUITEM *)USER_HEAP_LIN_ADDR(menu->hItems)) + menu->FocusedItem;
if (!(item->item_flags & MF_POPUP) || !(item->item_flags & MF_MOUSESELECT))
return 0;
return item->item_id;
return (HMENU)item->item_id;
}
@ -885,7 +911,7 @@ static void MENU_HideSubPopups( HWND hwndOwner, HMENU hmenu )
if (!(item->item_flags & MF_POPUP) ||
!(item->item_flags & MF_MOUSESELECT)) return;
item->item_flags &= ~MF_MOUSESELECT;
hsubmenu = item->item_id;
hsubmenu = (HMENU)item->item_id;
}
submenu = (POPUPMENU *) USER_HEAP_LIN_ADDR( hsubmenu );
MENU_HideSubPopups( hwndOwner, hsubmenu );
@ -1089,7 +1115,7 @@ static BOOL MENU_ButtonUp( HWND hwndOwner, HMENU hmenu, HMENU *hmenuCurrent,
{
return MENU_ExecFocusedItem( hwndOwner, hmenu, hmenuCurrent );
}
hsubmenu = item->item_id;
hsubmenu = (HMENU)item->item_id;
}
/* Select first item of sub-popup */
MENU_SelectItem( hwndOwner, hsubmenu, NO_SELECTED_ITEM );
@ -1448,15 +1474,20 @@ BOOL TrackPopupMenu( HMENU hMenu, WORD wFlags, short x, short y,
/***********************************************************************
* PopupMenuWndProc
*/
LONG PopupMenuWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_CREATE:
{
CREATESTRUCT *createStruct = (CREATESTRUCT*)PTR_SEG_TO_LIN(lParam);
#ifdef WINELIB32
HMENU hmenu = (HMENU) (createStruct->lpCreateParams);
SetWindowLong( hwnd, 0, hmenu );
#else
HMENU hmenu = (HMENU) ((int)createStruct->lpCreateParams & 0xffff);
SetWindowWord( hwnd, 0, hmenu );
#endif
return 0;
}
@ -1468,7 +1499,12 @@ LONG PopupMenuWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
PAINTSTRUCT ps;
BeginPaint( hwnd, &ps );
MENU_DrawPopupMenu( hwnd, ps.hdc,
(HMENU)GetWindowWord( hwnd, 0 ) );
#ifdef WINELIB32
(HMENU)GetWindowLong( hwnd, 0 )
#else
(HMENU)GetWindowWord( hwnd, 0 )
#endif
);
EndPaint( hwnd, &ps );
return 0;
}
@ -1508,7 +1544,7 @@ WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth, int orgX, int orgY )
BOOL ChangeMenu(HMENU hMenu, WORD nPos, LPSTR lpNewItem,
WORD wItemID, WORD wFlags)
{
dprintf_menu(stddeb,"ChangeMenu(%04X, %X, '%s', %X, %X)\n",
dprintf_menu(stddeb,"ChangeMenu: menu="NPFMT" pos=%d ptr=%p item=%04x flags=%04x\n",
hMenu, nPos, lpNewItem, wItemID, wFlags);
if (wFlags & MF_APPEND) {
return AppendMenu(hMenu, wFlags & ~MF_APPEND, wItemID, lpNewItem);
@ -1535,7 +1571,7 @@ BOOL ChangeMenu(HMENU hMenu, WORD nPos, LPSTR lpNewItem,
BOOL CheckMenuItem(HMENU hMenu, WORD wItemID, WORD wFlags)
{
LPMENUITEM lpitem;
dprintf_menu(stddeb,"CheckMenuItem (%04X, %04X, %04X) !\n",
dprintf_menu(stddeb,"CheckMenuItem ("NPFMT", %04X, %04X) !\n",
hMenu, wItemID, wFlags);
if (!(lpitem = MENU_FindItem(&hMenu, &wItemID, wFlags))) return FALSE;
if (wFlags & MF_CHECKED) lpitem->item_flags |= MF_CHECKED;
@ -1550,7 +1586,7 @@ BOOL CheckMenuItem(HMENU hMenu, WORD wItemID, WORD wFlags)
BOOL EnableMenuItem(HMENU hMenu, WORD wItemID, WORD wFlags)
{
LPMENUITEM lpitem;
dprintf_menu(stddeb,"EnableMenuItem (%04X, %04X, %04X) !\n",
dprintf_menu(stddeb,"EnableMenuItem ("NPFMT", %04X, %04X) !\n",
hMenu, wItemID, wFlags);
if (!(lpitem = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return FALSE;
@ -1571,29 +1607,25 @@ BOOL EnableMenuItem(HMENU hMenu, WORD wItemID, WORD wFlags)
}
/**********************************************************************
* GetMenuString [USER.161]
/*******************************************************************
* GetMenuString (USER.161)
*/
int GetMenuString(HMENU hMenu, WORD wItemID,
LPSTR str, short nMaxSiz, WORD wFlags)
int GetMenuString( HMENU hMenu, WORD wItemID,
LPSTR str, short nMaxSiz, WORD wFlags )
{
LPMENUITEM lpitem;
int maxsiz;
dprintf_menu(stddeb,"GetMenuString(%04X, %04X, %p, %d, %04X);\n",
hMenu, wItemID, str, nMaxSiz, wFlags);
if (str == NULL) return FALSE;
lpitem = MENU_FindItem( &hMenu, &wItemID, wFlags );
if (lpitem != NULL) {
if (lpitem->item_text != NULL) {
maxsiz = min(nMaxSiz - 1, strlen(lpitem->item_text));
strncpy(str, lpitem->item_text, maxsiz + 1);
}
else
maxsiz = 0;
dprintf_menu(stddeb,"GetMenuString // Found !\n");
return maxsiz;
}
return 0;
LPMENUITEM lpitem;
dprintf_menu( stddeb, "GetMenuString: menu="NPFMT" item=%04x ptr=%p len=%d flags=%04x\n",
hMenu, wItemID, str, nMaxSiz, wFlags );
if (!str || !nMaxSiz) return 0;
str[0] = '\0';
if (!(lpitem = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
if (!lpitem->item_text || !IS_STRING_ITEM(lpitem->item_flags)) return 0;
nMaxSiz = min( nMaxSiz-1, strlen(lpitem->item_text) );
strncpy( str, lpitem->item_text, nMaxSiz );
str[nMaxSiz] = '\0';
dprintf_menu( stddeb, "GetMenuString: returning '%s'\n", str );
return nMaxSiz;
}
@ -1604,7 +1636,7 @@ BOOL HiliteMenuItem(HWND hWnd, HMENU hMenu, WORD wItemID, WORD wHilite)
{
LPPOPUPMENU menu;
LPMENUITEM lpitem;
dprintf_menu(stddeb,"HiliteMenuItem(%04X, %04X, %04X, %04X);\n",
dprintf_menu(stddeb,"HiliteMenuItem("NPFMT", "NPFMT", %04X, %04X);\n",
hWnd, hMenu, wItemID, wHilite);
if (!(lpitem = MENU_FindItem( &hMenu, &wItemID, wHilite ))) return FALSE;
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@ -1621,7 +1653,7 @@ BOOL HiliteMenuItem(HWND hWnd, HMENU hMenu, WORD wItemID, WORD wHilite)
WORD GetMenuState(HMENU hMenu, WORD wItemID, WORD wFlags)
{
LPMENUITEM lpitem;
dprintf_menu(stddeb,"GetMenuState(%04X, %04X, %04X);\n",
dprintf_menu(stddeb,"GetMenuState("NPFMT", %04X, %04X);\n",
hMenu, wItemID, wFlags);
if (!(lpitem = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1;
if (lpitem->item_flags & MF_POPUP)
@ -1640,10 +1672,10 @@ WORD GetMenuState(HMENU hMenu, WORD wItemID, WORD wFlags)
WORD GetMenuItemCount(HMENU hMenu)
{
LPPOPUPMENU menu;
dprintf_menu(stddeb,"GetMenuItemCount(%04X);\n", hMenu);
dprintf_menu(stddeb,"GetMenuItemCount("NPFMT");\n", hMenu);
menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (menu == NULL) return (WORD)-1;
dprintf_menu(stddeb,"GetMenuItemCount(%04X) return %d \n",
dprintf_menu(stddeb,"GetMenuItemCount("NPFMT") return %d \n",
hMenu, menu->nItems);
return menu->nItems;
}
@ -1657,7 +1689,7 @@ WORD GetMenuItemID(HMENU hMenu, int nPos)
LPPOPUPMENU menu;
MENUITEM *item;
dprintf_menu(stddeb,"GetMenuItemID(%04X, %d);\n", hMenu, nPos);
dprintf_menu(stddeb,"GetMenuItemID("NPFMT", %d);\n", hMenu, nPos);
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return -1;
if ((nPos < 0) || (nPos >= menu->nItems)) return -1;
item = (MENUITEM *) USER_HEAP_LIN_ADDR( menu->hItems );
@ -1677,13 +1709,13 @@ BOOL InsertMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewIt
if (IS_STRING_ITEM(wFlags))
{
dprintf_menu(stddeb,"InsertMenu (%04X, %04X, %04X, %04X, '%s') !\n",
dprintf_menu(stddeb,"InsertMenu ("NPFMT", %04X, %04X, %04X, '%s') !\n",
hMenu, nPos, wFlags, wItemID,
lpNewItem ? lpNewItem : "(null)");
if (!lpNewItem) return FALSE;
}
else
dprintf_menu(stddeb,"InsertMenu (%04X, %04X, %04X, %04X, %p) !\n",
dprintf_menu(stddeb,"InsertMenu ("NPFMT", %04X, %04X, %04X, %p) !\n",
hMenu, nPos, wFlags, wItemID, lpNewItem);
/* Find where to insert new item */
@ -1695,7 +1727,7 @@ BOOL InsertMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewIt
Some programs specify the menu length to do that */
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu)))
{
dprintf_menu(stddeb,"InsertMenu: %04X not a menu handle\n", hMenu);
dprintf_menu(stddeb,"InsertMenu: "NPFMT" not a menu handle\n", hMenu);
return FALSE;
}
nPos = menu->nItems;
@ -1709,7 +1741,7 @@ BOOL InsertMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewIt
}
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu)))
{
dprintf_menu(stddeb,"InsertMenu: %04X not a menu handle\n", hMenu);
dprintf_menu(stddeb,"InsertMenu: "NPFMT" not a menu handle\n", hMenu);
return FALSE;
}
}
@ -1783,7 +1815,7 @@ BOOL RemoveMenu(HMENU hMenu, WORD nPos, WORD wFlags)
{
LPPOPUPMENU menu;
LPMENUITEM lpitem;
dprintf_menu(stddeb,"RemoveMenu (%04X, %04X, %04X) !\n",
dprintf_menu(stddeb,"RemoveMenu ("NPFMT", %04X, %04X) !\n",
hMenu, nPos, wFlags);
if (!(lpitem = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@ -1833,12 +1865,12 @@ BOOL ModifyMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewIt
LPMENUITEM lpitem;
if (IS_STRING_ITEM(wFlags))
{
dprintf_menu(stddeb,"ModifyMenu (%04X, %04X, %04X, %04X, '%s') !\n",
dprintf_menu(stddeb,"ModifyMenu ("NPFMT", %04X, %04X, %04X, '%s') !\n",
hMenu, nPos, wFlags, wItemID, lpNewItem ? lpNewItem : "(null)");
if (!lpNewItem) return FALSE;
}
else
dprintf_menu(stddeb,"ModifyMenu (%04X, %04X, %04X, %04X, %p) !\n",
dprintf_menu(stddeb,"ModifyMenu ("NPFMT", %04X, %04X, %04X, %p) !\n",
hMenu, nPos, wFlags, wItemID, lpNewItem);
if (!(lpitem = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
@ -1890,8 +1922,8 @@ BOOL SetMenuItemBitmaps(HMENU hMenu, WORD nPos, WORD wFlags,
HBITMAP hNewCheck, HBITMAP hNewUnCheck)
{
LPMENUITEM lpitem;
dprintf_menu(stddeb,"SetMenuItemBitmaps (%04X, %04X, %04X, %04X, %08X) !\n",
hMenu, nPos, wFlags, hNewCheck, hNewUnCheck);
dprintf_menu(stddeb,"SetMenuItemBitmaps ("NPFMT", %04X, %04X, "NPFMT", %08lX) !\n",
hMenu, nPos, wFlags, hNewCheck, (DWORD)hNewUnCheck);
if (!(lpitem = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
if (!hNewCheck && !hNewUnCheck)
@ -1932,7 +1964,7 @@ HMENU CreateMenu()
menu->hWnd = 0;
menu->hItems = 0;
menu->FocusedItem = NO_SELECTED_ITEM;
dprintf_menu(stddeb,"CreateMenu // return %04X\n", hMenu);
dprintf_menu(stddeb,"CreateMenu // return "NPFMT"\n", hMenu);
return hMenu;
}
@ -1943,7 +1975,7 @@ HMENU CreateMenu()
BOOL DestroyMenu(HMENU hMenu)
{
LPPOPUPMENU lppop;
dprintf_menu(stddeb,"DestroyMenu (%04X) !\n", hMenu);
dprintf_menu(stddeb,"DestroyMenu ("NPFMT") !\n", hMenu);
if (hMenu == 0) return FALSE;
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (!lppop || (lppop->wMagic != MENU_MAGIC)) return FALSE;
@ -1963,7 +1995,7 @@ BOOL DestroyMenu(HMENU hMenu)
USER_HEAP_FREE( lppop->hItems );
}
USER_HEAP_FREE( hMenu );
dprintf_menu(stddeb,"DestroyMenu (%04X) // End !\n", hMenu);
dprintf_menu(stddeb,"DestroyMenu ("NPFMT") // End !\n", hMenu);
return TRUE;
}
@ -2012,18 +2044,18 @@ BOOL SetMenu(HWND hWnd, HMENU hMenu)
LPPOPUPMENU lpmenu;
WND * wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
fprintf(stderr,"SetMenu(%04X, %04X) // Bad window handle !\n",
fprintf(stderr,"SetMenu("NPFMT", "NPFMT") // Bad window handle !\n",
hWnd, hMenu);
return FALSE;
}
dprintf_menu(stddeb,"SetMenu(%04X, %04X);\n", hWnd, hMenu);
dprintf_menu(stddeb,"SetMenu("NPFMT", "NPFMT");\n", hWnd, hMenu);
if (GetCapture() == hWnd) ReleaseCapture();
wndPtr->wIDmenu = hMenu;
if (hMenu != 0)
{
lpmenu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (lpmenu == NULL) {
fprintf(stderr,"SetMenu(%04X, %04X) // Bad menu handle !\n",
fprintf(stderr,"SetMenu("NPFMT", "NPFMT") // Bad menu handle !\n",
hWnd, hMenu);
return FALSE;
}
@ -2045,7 +2077,7 @@ HMENU GetSubMenu(HMENU hMenu, short nPos)
{
LPPOPUPMENU lppop;
LPMENUITEM lpitem;
dprintf_menu(stddeb,"GetSubMenu (%04X, %04X) !\n", hMenu, nPos);
dprintf_menu(stddeb,"GetSubMenu ("NPFMT", %04X) !\n", hMenu, nPos);
if (!(lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return 0;
if ((WORD)nPos >= lppop->nItems) return 0;
lpitem = (MENUITEM *) USER_HEAP_LIN_ADDR( lppop->hItems );
@ -2061,7 +2093,7 @@ void DrawMenuBar(HWND hWnd)
{
WND *wndPtr;
LPPOPUPMENU lppop;
dprintf_menu(stddeb,"DrawMenuBar (%04X)\n", hWnd);
dprintf_menu(stddeb,"DrawMenuBar ("NPFMT")\n", hWnd);
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr != NULL && (wndPtr->dwStyle & WS_CHILD) == 0 &&
wndPtr->wIDmenu != 0) {
@ -2109,11 +2141,11 @@ HMENU LoadMenu( HINSTANCE instance, SEGPTR name )
if (HIWORD(name))
{
char *str = (char *)PTR_SEG_TO_LIN( name );
dprintf_menu( stddeb, "LoadMenu(%04x,'%s')\n", instance, str );
dprintf_menu( stddeb, "LoadMenu("NPFMT",'%s')\n", instance, str );
if (str[0] == '#') name = (SEGPTR)atoi( str + 1 );
}
else
dprintf_resource(stddeb,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name));
dprintf_resource(stddeb,"LoadMenu("NPFMT",%04x)\n",instance,LOWORD(name));
if (!name) return 0;
@ -2157,7 +2189,7 @@ HMENU CopySysMenu()
}
menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hMenu);
menu->wFlags |= MF_SYSMENU|MF_POPUP;
dprintf_menu(stddeb,"CopySysMenu hMenu=%04X !\n", hMenu);
dprintf_menu(stddeb,"CopySysMenu hMenu="NPFMT" !\n", hMenu);
return hMenu;
}

View File

@ -353,8 +353,14 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
{
if (nBar == SB_CTL) /* Only scrollbar controls send WM_CTLCOLOR */
{
#ifdef WINELIB32
HBRUSH hbrush = (HBRUSH)SendMessage( GetParent(hwnd),
WM_CTLCOLORSCROLLBAR,
(WPARAM)hdc, (LPARAM)hwnd );
#else
HBRUSH hbrush = SendMessage( GetParent(hwnd), WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_SCROLLBAR) );
#endif
SelectObject( hdc, hbrush );
}
else SelectObject( hdc, sysColorObjects.hbrushScrollbar );
@ -506,9 +512,15 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WORD wParam )
default:
return;
}
#ifdef WINELIB32
SendMessage( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)msg, (LPARAM)hwnd );
#else
SendMessage( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, MAKELONG( 0, hwnd ));
#endif
}
@ -580,7 +592,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
return; /* Should never happen */
}
dprintf_scroll( stddeb, "ScrollBar Event: hwnd=%x bar=%d msg=%x pt=%d,%d hit=%d\n",
dprintf_scroll( stddeb, "ScrollBar Event: hwnd="NPFMT" bar=%d msg=%x pt=%d,%d hit=%d\n",
hwnd, nBar, msg, pt.x, pt.y, hittest );
switch(trackHitTest)
@ -598,8 +610,13 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)SB_LINEUP, (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, MAKELONG( 0, hwndCtl ));
#endif
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
@ -616,8 +633,13 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)SB_PAGEUP, (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEUP, MAKELONG( 0, hwndCtl ));
#endif
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
@ -645,8 +667,13 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
lastMousePos = pos;
val = SCROLL_GetThumbVal( infoPtr, &rect, vertical,
trackThumbPos + lastMousePos - lastClickPos );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM(SB_THUMBTRACK,val), (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_THUMBTRACK, MAKELONG( val, hwndCtl ));
#endif
}
}
break;
@ -662,8 +689,13 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)SB_PAGEDOWN, (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEDOWN, MAKELONG( 0, hwndCtl ));
#endif
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
@ -679,8 +711,13 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)SB_LINEDOWN, (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEDOWN, MAKELONG( 0, hwndCtl ));
#endif
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
@ -693,12 +730,22 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
{
UINT val = SCROLL_GetThumbVal( infoPtr, &rect, vertical,
trackThumbPos + lastMousePos - lastClickPos );
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM(SB_THUMBPOSITION,val), (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_THUMBPOSITION, MAKELONG( val, hwndCtl ) );
#endif
}
else
#ifdef WINELIB32
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
(WPARAM)SB_ENDSCROLL, (LPARAM)hwndCtl );
#else
SendMessage( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_ENDSCROLL, MAKELONG( 0, hwndCtl ) );
#endif
trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */
}
@ -746,7 +793,7 @@ LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
}
}
if (!hUpArrow) SCROLL_LoadBitmaps();
dprintf_scroll( stddeb, "ScrollBar creation, hwnd=%d\n", hwnd );
dprintf_scroll( stddeb, "ScrollBar creation, hwnd="NPFMT"\n", hwnd );
return 0;
case WM_LBUTTONDOWN:
@ -822,7 +869,7 @@ void SetScrollRange(HWND hwnd, int nBar, int MinVal, int MaxVal, BOOL bRedraw)
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return;
dprintf_scroll( stddeb,"SetScrollRange hwnd=%x bar=%d min=%d max=%d\n",
dprintf_scroll( stddeb,"SetScrollRange hwnd="NPFMT" bar=%d min=%d max=%d\n",
hwnd, nBar, MinVal, MaxVal );
/* Invalid range -> range is set to (0,0) */
@ -860,7 +907,7 @@ void ShowScrollBar( HWND hwnd, WORD wBar, BOOL fShow )
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return;
dprintf_scroll( stddeb, "ShowScrollBar: hwnd=%x bar=%d on=%d\n", hwnd, wBar, fShow );
dprintf_scroll( stddeb, "ShowScrollBar: hwnd="NPFMT" bar=%d on=%d\n", hwnd, wBar, fShow );
switch(wBar)
{
@ -926,7 +973,7 @@ BOOL EnableScrollBar( HWND hwnd, INT nBar, UINT flags )
HDC hdc;
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
dprintf_scroll( stddeb, "EnableScrollBar: %x %d %d\n", hwnd, nBar, flags );
dprintf_scroll( stddeb, "EnableScrollBar: "NPFMT" %d %d\n", hwnd, nBar, flags );
flags &= ESB_DISABLE_BOTH;
if (infoPtr->flags == flags) return FALSE;
infoPtr->flags = flags;

View File

@ -11,7 +11,6 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1993";
#include "win.h"
#include "user.h"
#include "static.h"
#include "icon.h"
extern void DEFWND_SetText( HWND hwnd, LPSTR text ); /* windows/defwnd.c */
@ -60,9 +59,8 @@ static void STATIC_SetIcon( HWND hwnd, HICON hicon )
infoPtr->hIcon = hicon;
if (hicon)
{
ICONALLOC *icon = (ICONALLOC *) GlobalLock( hicon );
SetWindowPos( hwnd, 0, 0, 0,
icon->descriptor.Width, icon->descriptor.Height,
CURSORICONINFO *info = (CURSORICONINFO *) GlobalLock( hicon );
SetWindowPos( hwnd, 0, 0, 0, info->nWidth, info->nHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
GlobalUnlock( hicon );
}
@ -72,7 +70,7 @@ static void STATIC_SetIcon( HWND hwnd, HICON hicon )
/***********************************************************************
* StaticWndProc
*/
LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LONG lResult = 0;
WND *wndPtr = WIN_FindWndPtr(hWnd);
@ -144,7 +142,7 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
case WM_SETFONT:
if (style == SS_ICON) return 0;
infoPtr->hFont = wParam;
infoPtr->hFont = (HFONT)wParam;
if (LOWORD(lParam))
{
InvalidateRect( hWnd, NULL, FALSE );
@ -153,7 +151,7 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_GETFONT:
return infoPtr->hFont;
return (LONG)infoPtr->hFont;
case WM_NCHITTEST:
return HTTRANSPARENT;
@ -162,10 +160,10 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
return DLGC_STATIC;
case STM_GETICON:
return infoPtr->hIcon;
return (LONG)infoPtr->hIcon;
case STM_SETICON:
STATIC_SetIcon( hWnd, wParam );
STATIC_SetIcon( hWnd, (HICON)wParam );
InvalidateRect( hWnd, NULL, FALSE );
UpdateWindow( hWnd );
return 0;
@ -223,8 +221,13 @@ static void PaintTextfn( HWND hwnd, HDC hdc )
wFormat |= DT_NOPREFIX;
if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont );
#ifdef WINELIB32
hBrush = (HBRUSH)SendMessage( wndPtr->hwndParent, WM_CTLCOLORSTATIC,
(WPARAM)hdc, (LPARAM)hwnd );
#else
hBrush = SendMessage( wndPtr->hwndParent, WM_CTLCOLOR, (WORD)hdc,
MAKELONG(hwnd, CTLCOLOR_STATIC));
#endif
if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH);
FillRect(hdc, &rc, hBrush);
if (text)
@ -281,8 +284,13 @@ static void PaintIconfn( HWND hwnd, HDC hdc )
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect(hwnd, &rc);
#ifdef WINELIB32
hbrush = (HBRUSH)SendMessage( wndPtr->hwndParent, WM_CTLCOLORSTATIC,
(WPARAM)hdc, (LPARAM)hwnd );
#else
hbrush = SendMessage( wndPtr->hwndParent, WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_STATIC));
#endif
FillRect( hdc, &rc, hbrush );
if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon );
}

View File

@ -63,7 +63,7 @@ BOOL WIDGETS_Init(void)
DWORD WineProc,Win16Proc,Win32Proc;
/* currently, there is no way to get the 'real' pointer at run time */
WineProc=0;
Win16Proc = GetWndProcEntry16( (char *)class->lpfnWndProc );
Win16Proc = (DWORD)GetWndProcEntry16( (char *)class->lpfnWndProc );
Win32Proc = (DWORD)RELAY32_GetEntryPoint(
"WINPROCS32",(char *)class->lpfnWndProc, 0);
/* Register the alias so we don't pass Win16 pointers to Win32 apps */

View File

@ -1,54 +0,0 @@
#include "../Wine.tmpl"
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'MAKE=$(MAKE)'\
'LD=$(LD)'
MODULE = debugger
SUBDIRS = readline
DEFINES = -DUSE_READLINE
SRCS = \
break.c \
db_disasm.c \
dbg.tab.c \
hash.c \
info.c \
lex.yy.c \
memory.c \
registers.c \
stack.c
SUBDIRS_OBJS = readline/readline.o
OBJS = $(SRCS:.c=.o) $(SUBDIRS_OBJS)
/*
* All the SUBDIR stuff
*/
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
/*
* The main act
*/
WineRelocatableTarget($(MODULE),,$(OBJS))
depend:: dbg.tab.c dbg.tab.h lex.yy.c
DependTarget()
includes::
install::
clean::
$(RM) lex.yy.c dbg.tab* y.tab.c
dbg.tab.c dbg.tab.h: dbg.y
$(YACC) -b dbg -d dbg.y
lex.yy.c: debug.l
$(LEX) -I debug.l

View File

@ -142,8 +142,15 @@ void DEBUG_SetBreakpoints( BOOL set )
for (i = 0; i < MAX_BREAKPOINTS; i++)
{
if (breakpoints[i].in_use && breakpoints[i].enabled)
DEBUG_SetOpcode( &breakpoints[i].addr,
set ? INT3 : breakpoints[i].opcode );
{
if (DEBUG_IsBadWritePtr( &breakpoints[i].addr, 1 ))
{
fprintf( stderr, "Invalid address for breakpoint %d, disabling it\n", i );
breakpoints[i].enabled = FALSE;
}
else DEBUG_SetOpcode( &breakpoints[i].addr,
set ? INT3 : breakpoints[i].opcode );
}
}
}
@ -193,6 +200,7 @@ void DEBUG_AddBreakpoint( const DBG_ADDR *address )
return;
}
}
if (!DBG_CHECK_READ_PTR( &addr, 1 )) return;
p = DBG_ADDR_TO_LIN( &addr );
breakpoints[num].addr = addr;
breakpoints[num].addrlen = !addr.seg ? 32 :

View File

@ -51,7 +51,6 @@ int yyerror(char *);
| input line { issue_prompt(); }
line: '\n'
| infocmd '\n'
| error '\n' { yyerrok; }
| QUIT '\n' { exit(0); }
| HELP '\n' { DEBUG_Help(); }
@ -72,6 +71,7 @@ int yyerror(char *);
}
| DELETE BREAK NUM '\n' { DEBUG_DelBreakpoint( $3 ); }
| BACKTRACE '\n' { DEBUG_BackTrace(); }
| infocmd
| x_command
| print_command
| deposit_command
@ -113,10 +113,11 @@ x_command:
| '(' expr ')' { $$ = $2; }
| '*' addr { $$ = DEBUG_ReadMemory( &$2 ); }
infocmd: INFO REGS { DEBUG_InfoRegisters(); }
| INFO STACK { DEBUG_InfoStack(); }
| INFO BREAK { DEBUG_InfoBreakpoints(); }
| INFO SEGMENTS { LDT_Print(); }
infocmd: INFO REGS '\n' { DEBUG_InfoRegisters(); }
| INFO STACK '\n' { DEBUG_InfoStack(); }
| INFO BREAK '\n' { DEBUG_InfoBreakpoints(); }
| INFO SEGMENTS '\n' { LDT_Print( 0, -1 ); }
| INFO SEGMENTS expr '\n' { LDT_Print( SELECTOR_TO_ENTRY($3), 1 ); }
%%
@ -162,9 +163,9 @@ void wine_debug( int signal, struct sigcontext_struct *regs )
{
DBG_ADDR addr;
addr.seg = (CS_reg(DEBUG_context) == WINE_CODE_SELECTOR) ?
0 : CS_reg(DEBUG_context);
addr.seg = CS_reg(DEBUG_context);
addr.off = EIP_reg(DEBUG_context);
DBG_FIX_ADDR_SEG( &addr, 0 );
if (!addr.seg) newmode = 32;
else newmode = (GET_SEL_FLAGS(addr.seg) & LDT_FLAGS_32BIT) ? 32 : 16;
@ -175,13 +176,22 @@ void wine_debug( int signal, struct sigcontext_struct *regs )
/* Show where we crashed */
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
DEBUG_Disasm( &addr );
fprintf(stderr,"\n");
instr_len = addr.off - EIP_reg(DEBUG_context);
issue_prompt();
yyparse();
flush_symbols();
if (DBG_CHECK_READ_PTR( &addr, 1 ))
{
DEBUG_Disasm( &addr );
fprintf(stderr,"\n");
instr_len = addr.off - EIP_reg(DEBUG_context);
}
do
{
issue_prompt();
yyparse();
flush_symbols();
addr.seg = CS_reg(DEBUG_context);
addr.off = EIP_reg(DEBUG_context);
DBG_FIX_ADDR_SEG( &addr, 0 );
} while (!DBG_CHECK_READ_PTR( &addr, 1 ));
}
DEBUG_RestartExecution( regs, dbg_exec_mode, instr_len );

View File

@ -73,7 +73,7 @@ $cs { yylval.reg = REG_CS; return REG; }
$ss { yylval.reg = REG_SS; return REG; }
info|inf|in { return INFO; }
segments|segm { return SEGMENTS; }
segments|segment|segm|seg|se { return SEGMENTS; }
break|brea|bre|br|b { return BREAK; }
enable|enabl|enab|ena { return ENABLE;}
disable|disabl|disab|disa|dis { return DISABLE; }

View File

@ -10,6 +10,40 @@
#include "debugger.h"
/***********************************************************************
* DEBUG_IsBadReadPtr
*
* Check if we are allowed to read memory at 'address'.
*/
BOOL DEBUG_IsBadReadPtr( const DBG_ADDR *address, int size )
{
if (address->seg) /* segmented addr */
return IsBadReadPtr( (SEGPTR)MAKELONG( (WORD)address->off,
(WORD)address->seg ), size );
/* FIXME: should check if resulting linear addr is readable */
else /* linear address */
return FALSE; /* FIXME: should do some checks here */
}
/***********************************************************************
* DEBUG_IsBadWritePtr
*
* Check if we are allowed to write memory at 'address'.
*/
BOOL DEBUG_IsBadWritePtr( const DBG_ADDR *address, int size )
{
if (address->seg) /* segmented addr */
/* Note: we use IsBadReadPtr here because we are */
/* always allowed to write to read-only segments */
return IsBadReadPtr( (SEGPTR)MAKELONG( (WORD)address->off,
(WORD)address->seg ), size );
/* FIXME: should check if resulting linear addr is writable */
else /* linear address */
return FALSE; /* FIXME: should do some checks here */
}
/***********************************************************************
* DEBUG_ReadMemory
*
@ -20,6 +54,7 @@ int DEBUG_ReadMemory( const DBG_ADDR *address )
DBG_ADDR addr = *address;
DBG_FIX_ADDR_SEG( &addr, DS_reg(DEBUG_context) );
if (!DBG_CHECK_READ_PTR( &addr, sizeof(int) )) return 0;
return *(int *)DBG_ADDR_TO_LIN( &addr );
}
@ -34,6 +69,7 @@ void DEBUG_WriteMemory( const DBG_ADDR *address, int value )
DBG_ADDR addr = *address;
DBG_FIX_ADDR_SEG( &addr, DS_reg(DEBUG_context) );
if (!DBG_CHECK_WRITE_PTR( &addr, sizeof(int) )) return;
*(int *)DBG_ADDR_TO_LIN( &addr ) = value;
}
@ -57,7 +93,7 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
if (format != 'i' && count > 1)
{
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
fprintf(stderr,": ");
}
pnt = DBG_ADDR_TO_LIN( &addr );
@ -66,7 +102,13 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
{
case 's':
if (count == 1) count = 256;
while(*pnt && count--) fputc( *pnt++, stderr );
while (count--)
{
if (!DBG_CHECK_READ_PTR( &addr, sizeof(char) )) return;
if (!*pnt) break;
addr.off++;
fputc( *pnt++, stderr );
}
fprintf(stderr,"\n");
return;
@ -74,7 +116,8 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
while (count--)
{
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
fprintf(stderr,": ");
if (!DBG_CHECK_READ_PTR( &addr, 1 )) return;
DEBUG_Disasm( &addr );
fprintf(stderr,"\n");
}
@ -83,13 +126,15 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
dump = (unsigned int *)pnt;
for(i=0; i<count; i++)
{
fprintf(stderr," %8.8x", *dump++);
addr.off += 4;
if ((i % 8) == 7) {
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
};
if (!DBG_CHECK_READ_PTR( &addr, sizeof(int) )) return;
fprintf(stderr," %8.8x", *dump++);
addr.off += sizeof(int);
if ((i % 8) == 7)
{
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
}
}
fprintf(stderr,"\n");
return;
@ -98,13 +143,15 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
dump = (unsigned int *)pnt;
for(i=0; i<count; i++)
{
fprintf(stderr," %d", *dump++);
addr.off += 4;
if ((i % 8) == 7) {
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
};
if (!DBG_CHECK_READ_PTR( &addr, sizeof(int) )) return;
fprintf(stderr," %d", *dump++);
addr.off += sizeof(int);
if ((i % 8) == 7)
{
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
}
}
fprintf(stderr,"\n");
return;
@ -113,13 +160,15 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
wdump = (unsigned short *)pnt;
for(i=0; i<count; i++)
{
fprintf(stderr," %04x", *wdump++);
addr.off += 2;
if ((i % 8) == 7) {
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
};
if (!DBG_CHECK_READ_PTR( &addr, sizeof(short) )) return;
fprintf(stderr," %04x", *wdump++);
addr.off += sizeof(short);
if ((i % 8) == 7)
{
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
}
}
fprintf(stderr,"\n");
return;
@ -127,17 +176,20 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
case 'c':
for(i=0; i<count; i++)
{
if(*pnt < 0x20) {
fprintf(stderr," ");
pnt++;
} else
fprintf(stderr," %c", *pnt++);
addr.off++;
if ((i % 32) == 31) {
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
};
if (!DBG_CHECK_READ_PTR( &addr, sizeof(char) )) return;
if(*pnt < 0x20)
{
fprintf(stderr," ");
pnt++;
}
else fprintf(stderr," %c", *pnt++);
addr.off++;
if ((i % 32) == 31)
{
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
}
}
fprintf(stderr,"\n");
return;
@ -145,13 +197,15 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
case 'b':
for(i=0; i<count; i++)
{
fprintf(stderr," %02x", (*pnt++) & 0xff);
addr.off++;
if ((i % 16) == 15) {
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
};
if (!DBG_CHECK_READ_PTR( &addr, sizeof(char) )) return;
fprintf(stderr," %02x", (*pnt++) & 0xff);
addr.off++;
if ((i % 16) == 15)
{
fprintf(stderr,"\n");
DEBUG_PrintAddress( &addr, dbg_mode );
fprintf(stderr,": ");
}
}
fprintf(stderr,"\n");
return;

View File

@ -1,18 +0,0 @@
#include "../../Wine.tmpl"
MODULE = readline
EXTRA_DEFINES= -DANSI_ARROWS -DHAVE_TCGETATTR -DHIDE
SRCS = \
editline.c \
sysunix.c
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
install::

View File

@ -62,40 +62,46 @@ void DEBUG_BackTrace(void)
DBG_ADDR addr;
int frameno = 0;
fprintf(stderr,"Backtrace:\n");
if (SS_reg(DEBUG_context) == WINE_DATA_SELECTOR) /* 32-bit mode */
{
FRAME32 *frame = (FRAME32 *)EBP_reg(DEBUG_context);
addr.seg = 0;
while (frame->ip)
{
fprintf(stderr,"%d ",frameno++);
addr.off = frame->ip;
DEBUG_PrintAddress( &addr, 32 );
fprintf( stderr, "\n" );
frame = (FRAME32 *)frame->bp;
}
}
else /* 16-bit mode */
{
FRAME16 *frame = (FRAME16 *)PTR_SEG_OFF_TO_LIN( SS_reg(DEBUG_context),
BP_reg(DEBUG_context) & ~1 );
WORD cs = CS_reg(DEBUG_context);
if (GET_SEL_FLAGS(SS_reg(DEBUG_context)) & LDT_FLAGS_32BIT)
fprintf(stderr,"Backtrace:\n");
if (SS_reg(DEBUG_context) == WINE_DATA_SELECTOR) /* 32-bit mode */
{
addr.seg = 0;
addr.off = EBP_reg(DEBUG_context);
for (;;)
{
FRAME32 *frame = (FRAME32 *)addr.off;
if (!DBG_CHECK_READ_PTR( &addr, sizeof(FRAME32) )) return;
if (!frame->ip) break;
fprintf(stderr,"%d ",frameno++);
addr.off = frame->ip;
DEBUG_PrintAddress( &addr, 32 );
fprintf( stderr, "\n" );
addr.off = frame->bp;
}
}
else /* 16-bit mode */
{
WORD ss = SS_reg(DEBUG_context), cs = CS_reg(DEBUG_context);
if (GET_SEL_FLAGS(ss) & LDT_FLAGS_32BIT)
{
fprintf( stderr, "Not implemented: 32-bit backtrace on a different stack segment.\n" );
return;
}
while (frame->bp)
addr.seg = SS_reg(DEBUG_context);
addr.off = BP_reg(DEBUG_context) & ~1;
for (;;)
{
FRAME16 *frame = (FRAME16 *)DBG_ADDR_TO_LIN(&addr);
if (!DBG_CHECK_READ_PTR( &addr, sizeof(FRAME16) )) return;
if (!frame->bp) break;
if (frame->bp & 1) cs = frame->cs;
fprintf( stderr,"%d ", frameno++ );
addr.seg = cs;
addr.off = frame->ip;
DEBUG_PrintAddress( &addr, 16 );
fprintf( stderr, "\n" );
frame = (FRAME16 *)PTR_SEG_OFF_TO_LIN( SS_reg(DEBUG_context),
frame->bp & ~1 );
addr.seg = ss;
addr.off = frame->bp & ~1;
}
}
fprintf( stderr, "\n" );

View File

@ -1,120 +0,0 @@
#include "../autoconf.h"
#include "../Wine.tmpl"
MODULE = if1632
SRCS = \
callback.c \
relay.c \
relay32.c
#ifdef WINELIB
CALLOBJS =
DLLS16 =
DLLS32 =
#else
CALLOBJS = \
call16.o \
call32.o
DLLS16 = \
commdlg.spec \
compobj.spec \
ddeml.spec \
gdi.spec \
kernel.spec \
keyboard.spec \
mmsystem.spec \
mouse.spec \
ole2.spec \
ole2conv.spec \
ole2disp.spec \
ole2nls.spec \
ole2prox.spec \
olecli.spec \
olesvr.spec \
shell.spec \
sound.spec \
storage.spec \
stress.spec \
system.spec \
toolhelp.spec \
user.spec \
win87em.spec \
winprocs.spec \
winsock.spec
DLLS32 = \
advapi32.spec \
comdlg32.spec \
gdi32.spec \
kernel32.spec \
shell32.spec \
user32.spec \
winprocs32.spec
#endif
OBJS = $(SRCS:.c=.o) $(CALLOBJS) $(DLLS16:.spec=.o) $(DLLS32:.spec=.o)
BUILD = $(TOP)/tools/build
#define MakeDll16FromSpec(name) @@\
name.S : name.spec $(BUILD) @@\
$(BUILD) -spec16 name.spec > name.S @@\
#define MakeDll32FromSpec(name) @@\
name.c : name.spec $(BUILD) @@\
$(BUILD) -spec32 name.spec > name.c @@\
/*
* If you add a new spec file, copy one of these lines
*/
MakeDll16FromSpec(commdlg)
MakeDll16FromSpec(compobj)
MakeDll16FromSpec(ddeml)
MakeDll16FromSpec(gdi)
MakeDll16FromSpec(kernel)
MakeDll16FromSpec(keyboard)
MakeDll16FromSpec(shell)
MakeDll16FromSpec(mmsystem)
MakeDll16FromSpec(mouse)
MakeDll16FromSpec(ole2)
MakeDll16FromSpec(ole2conv)
MakeDll16FromSpec(ole2disp)
MakeDll16FromSpec(ole2nls)
MakeDll16FromSpec(ole2prox)
MakeDll16FromSpec(olecli)
MakeDll16FromSpec(olesvr)
MakeDll16FromSpec(sound)
MakeDll16FromSpec(storage)
MakeDll16FromSpec(stress)
MakeDll16FromSpec(system)
MakeDll16FromSpec(toolhelp)
MakeDll16FromSpec(user)
MakeDll16FromSpec(win87em)
MakeDll16FromSpec(winprocs)
MakeDll16FromSpec(winsock)
MakeDll32FromSpec(gdi32)
MakeDll32FromSpec(kernel32)
MakeDll32FromSpec(shell32)
MakeDll32FromSpec(user32)
MakeDll32FromSpec(winprocs32)
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
#ifndef WINELIB
call32.S: $(BUILD) $(DLLS16:.spec=.S)
$(BUILD) -call32 `cat $(DLLS16:.spec=.S) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S
call16.S: $(BUILD) $(TOP)/include/callback.h
$(BUILD) -call16 `cat $(TOP)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > call16.S
#endif /* WINELIB */
includes::
install::
clean::
$(RM) $(DLLS16:.spec=.S) $(DLLS32:.spec=.c) call32.S call16.S

View File

@ -26,7 +26,6 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
SpyMessage(hwnd, message, wParam, lParam);
/* check if we have something better than 16 bit relays */
if(!ALIAS_UseAliases || !(a=ALIAS_LookupAlias((DWORD)func)) ||

View File

@ -254,7 +254,7 @@ id 3
374 pascal16 GetSystemPaletteUse(word) GetSystemPaletteUse
375 pascal16 GetSystemPaletteEntries(word word word ptr)
GetSystemPaletteEntries
376 stub ResetDC
376 pascal16 ResetDC(word ptr) ResetDC
377 stub STARTDOC
378 stub ENDDOC
379 stub STARTPAGE

View File

@ -149,13 +149,13 @@ base 1
0145 stub FreeResource
0146 stub FreeVirtualBuffer
0147 stub GenerateConsoleCtrlEvent
0148 stub GetACP
0148 stdcall GetACP() GetACP
0149 stub GetAtomNameA
0150 stub GetAtomNameW
0151 stub GetBinaryType
0152 stub GetBinaryTypeA
0153 stub GetBinaryTypeW
0154 stub GetCPInfo
0154 stdcall GetCPInfo(long ptr) GetCPInfo
0155 stub GetCommConfig
0156 stub GetCommMask
0157 stub GetCommModemStatus
@ -214,7 +214,7 @@ base 1
0210 stdcall GetEnvironmentStrings() GetEnvironmentStrings
0211 stub GetEnvironmentStringsA
0212 stub GetEnvironmentStringsW
0213 stub GetEnvironmentVariableA
0213 stdcall GetEnvironmentVariableA(ptr ptr long) GetEnvironmentVariableA
0214 stub GetEnvironmentVariableW
0215 stub GetExitCodeProcess
0216 stub GetExitCodeThread
@ -223,12 +223,12 @@ base 1
0219 stub GetFileInformationByHandle
0220 stub GetFileSize
0221 stub GetFileTime
0222 stub GetFileType
0222 stdcall GetFileType(long) GetFileType
0223 stub GetFullPathNameA
0224 stub GetFullPathNameW
0225 stub GetHandleInformation
0226 stub GetLargestConsoleWindowSize
0227 stub GetLastError
0227 stdcall GetLastError() GetLastError
0228 stub GetLocalTime
0229 stub GetLocaleInfoA
0230 stub GetLocaleInfoW
@ -236,7 +236,7 @@ base 1
0232 stub GetLogicalDriveStringsW
0233 stub GetLogicalDrives
0234 stub GetMailslotInfo
0235 return GetModuleFileNameA 12 0
0235 stdcall GetModuleFileNameA(long ptr long) GetModuleFileNameA
0236 stub GetModuleFileNameW
0237 stdcall GetModuleHandleA(ptr) GetModuleHandle
0238 stub GetModuleHandleW
@ -249,7 +249,7 @@ base 1
0245 stub GetNumberOfConsoleFonts
0246 stub GetNumberOfConsoleInputEvents
0247 stub GetNumberOfConsoleMouseButtons
0248 stub GetOEMCP
0248 stdcall GetOEMCP() GetOEMCP
0249 stub GetOverlappedResult
0250 stub GetPriorityClass
0251 stub GetPrivateProfileIntA
@ -274,7 +274,7 @@ base 1
0270 stub GetQueuedCompletionStatus
0271 stub GetShortPathNameA
0272 stub GetShortPathNameW
0273 return GetStartupInfoA 4 0
0273 stdcall GetStartupInfoA(ptr) GetStartupInfoA
0274 stub GetStartupInfoW
0275 stdcall GetStdHandle(long) GetStdHandle
0276 stub GetStringTypeA
@ -300,10 +300,10 @@ base 1
0296 stub GetThreadPriority
0297 stub GetThreadSelectorEntry
0298 stub GetThreadTimes
0299 stub GetTickCount
0299 stdcall GetTickCount() GetTickCount
0300 stub GetTimeFormatA
0301 stub GetTimeFormatW
0302 stub GetTimeZoneInformation
0302 stdcall GetTimeZoneInformation(ptr) GetTimeZoneInformation
0303 stub GetUserDefaultLCID
0304 stub GetUserDefaultLangID
0305 stub GetVDMCurrentDirectories
@ -486,7 +486,7 @@ base 1
0481 stub SetDefaultCommConfigA
0482 stub SetDefaultCommConfigW
0483 stub SetEndOfFile
0484 stub SetEnvironmentVariableA
0484 stdcall SetEnvironmentVariableA(ptr ptr) SetEnvironmentVariableA
0485 stub SetEnvironmentVariableW
0486 stub SetErrorMode
0487 stub SetEvent
@ -494,12 +494,12 @@ base 1
0489 stub SetFileApisToOEM
0490 stub SetFileAttributesA
0491 stub SetFileAttributesW
0492 stub SetFilePointer
0492 stdcall SetFilePointer(long long ptr long) SetFilePointer
0493 stub SetFileTime
0494 stub SetHandleCount
0495 stub SetHandleInformation
0496 stub SetLastConsoleEventActive
0497 stub SetLastError
0497 stdcall SetLastError(long) SetLastError
0498 stub SetLocalTime
0499 stub SetLocaleInfoA
0500 stub SetLocaleInfoW
@ -550,9 +550,9 @@ base 1
0545 stub VerLanguageNameA
0546 stub VerLanguageNameW
0547 stub VerifyConsoleIoHandle
0548 stub VirtualAlloc
0548 stdcall VirtualAlloc(ptr long long long) VirtualAlloc
0549 stub VirtualBufferExceptionHandler
0550 stub VirtualFree
0550 stdcall VirtualFree(ptr long long) VirtualFree
0551 stub VirtualLock
0552 stub VirtualProtect
0553 stub VirtualProtectEx
@ -580,7 +580,7 @@ base 1
0575 stub WriteConsoleOutputCharacterW
0576 stub WriteConsoleOutputW
0577 stub WriteConsoleW
0578 stub WriteFile
0578 stdcall WriteFile(long ptr long ptr ptr) WriteFile
0579 stub WriteFileEx
0580 stub WritePrivateProfileSectionA
0581 stub WritePrivateProfileSectionW

View File

@ -31,6 +31,8 @@ id 10
210 pascal MIDIOUTRESET(word) midiOutReset
211 pascal MIDIOUTGETVOLUME(word segptr) midiOutGetVolume
212 pascal MIDIOUTSETVOLUME(word long) midiOutSetVolume
213 pascal MIDIOUTCACHEPATCHES(word word segptr word) midiOutCachePatches
214 pascal MIDIOUTCACHEDRUMPATCHES(word word segptr word) midiOutCacheDrumPatches
215 pascal MIDIOUTGETID(word ptr) midiOutGetID
216 pascal MIDIOUTMESSAGE(word word long long) midiOutMessage
301 pascal MIDIINGETNUMDEVS() midiInGetNumDevs
@ -86,7 +88,7 @@ id 10
513 pascal WAVEINGETID(word ptr) waveInGetID
514 pascal WAVEINMESSAGE(word word long long) waveInMessage
601 pascal timeGetSystemTime(ptr word) timeGetSystemTime
602 pascal timeSetEvent(word word ptr long word) timeSetEvent
602 pascal timeSetEvent(word word segptr long word) timeSetEvent
603 pascal timeKillEvent(word) timeKillEvent
604 pascal timeGetDevCaps(ptr word) timeGetDevCaps
605 pascal timeBeginPeriod(word) timeBeginPeriod

View File

@ -31,8 +31,8 @@ struct dll_table_s dll_builtin_table[N_BUILTINS] =
DLL_ENTRY(KERNEL),
DLL_ENTRY(USER),
DLL_ENTRY(GDI),
DLL_ENTRY(WIN87EM),
DLL_ENTRY(SHELL),
DLL_ENTRY_NOTUSED(WIN87EM),
DLL_ENTRY_NOTUSED(SHELL),
DLL_ENTRY(SOUND),
DLL_ENTRY(KEYBOARD),
DLL_ENTRY(WINSOCK),
@ -41,7 +41,7 @@ struct dll_table_s dll_builtin_table[N_BUILTINS] =
DLL_ENTRY(SYSTEM),
DLL_ENTRY(TOOLHELP),
DLL_ENTRY(MOUSE),
DLL_ENTRY(COMMDLG),
DLL_ENTRY_NOTUSED(COMMDLG),
DLL_ENTRY_NOTUSED(OLE2),
DLL_ENTRY_NOTUSED(OLE2CONV),
DLL_ENTRY_NOTUSED(OLE2DISP),

View File

@ -13,6 +13,7 @@
#include "windows.h"
#include "dlls.h"
#include "pe_image.h"
#include "relay32.h"
#include "stddebug.h"
/* #define DEBUG_RELAY */
#include "debug.h"
@ -110,8 +111,7 @@ LONG RELAY32_CallWindowProc( WNDPROC func, int hwnd, int message,
int wParam, int lParam )
{
int ret;
SpyMessage(hwnd, message, wParam, lParam);
__asm__ (
__asm__ (
"push %1;"
"push %2;"
"push %3;"

View File

@ -329,7 +329,7 @@ id 2
362 stub DCHook
364 stub LookupIconIDFromDirectoryEx
368 pascal16 CopyIcon(word word) CopyIcon
369 stub CopyCursor
369 pascal16 CopyCursor(word word) CopyCursor
370 pascal16 GetWindowPlacement(word ptr) GetWindowPlacement
371 pascal16 SetWindowPlacement(word ptr) SetWindowPlacement
372 stub GetInternalIconHeader
@ -358,7 +358,7 @@ id 2
403 pascal16 UnregisterClass(segptr word) UnregisterClass
404 pascal16 GetClassInfo(word segptr ptr) GetClassInfo
406 pascal16 CreateCursor(word word word word word ptr ptr) CreateCursor
407 pascal16 CreateIcon(word word word byte byte ptr ptr) CreateIcon
407 pascal16 CreateIcon(word word word word word ptr ptr) CreateIcon
408 pascal16 CreateCursorIconIndirect(word ptr ptr ptr)
CreateCursorIconIndirect
409 stub InitThreadInput
@ -401,7 +401,7 @@ id 2
452 pascal16 CreateWindowEx(long segptr segptr long s_word s_word s_word s_word
word word word segptr) CreateWindowEx
454 pascal16 AdjustWindowRectEx(ptr long word long) AdjustWindowRectEx
455 stub GetIconId
455 pascal16 GetIconID(word long) GetIconID
456 pascal16 LoadIconHandler(word word) LoadIconHandler
457 pascal16 DestroyIcon(word) DestroyIcon
458 pascal16 DestroyCursor(word) DestroyCursor
@ -410,7 +410,7 @@ id 2
461 pascal16 SetInternalWindowPos(word word ptr ptr) SetInternalWindowPos
462 pascal16 CalcChildScroll(word word) CalcChildScroll
463 stub ScrollChildren
464 stub DragObject
464 pascal16 DragObject(word word word word word word) DragObject
465 stub DragDetect
466 pascal16 DrawFocusRect(word ptr) DrawFocusRect
470 stub StringFunc

View File

@ -108,7 +108,7 @@ id 24
172 register INT_Int48Handler(word) INT_DummyHandler
173 register INT_Int49Handler(word) INT_DummyHandler
174 register INT_Int4aHandler(word) INT_DummyHandler
175 register INT_Int4bHandler(word) INT_DummyHandler
175 register INT_Int4bHandler(word) INT_Int4bHandler
176 register INT_Int4cHandler(word) INT_DummyHandler
177 register INT_Int4dHandler(word) INT_DummyHandler
178 register INT_Int4eHandler(word) INT_DummyHandler
@ -289,3 +289,12 @@ id 24
353 register INT_IntfdHandler(word) INT_DummyHandler
354 register INT_IntfeHandler(word) INT_DummyHandler
355 register INT_IntffHandler(word) INT_DummyHandler
# VxDs. The first Vxd is at 400
#
#400+VXD_ID register <VxD handler>(word) <VxD handler>
#
414 register VXD_Comm(word) VXD_Comm
#415 register VXD_Printer(word) VXD_Printer
423 register VXD_Shell(word) VXD_Shell
433 register VXD_PageFile(word) VXD_PageFile

View File

@ -45,6 +45,6 @@ extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
/* objects/oembitmap.c */
extern HBITMAP OBM_LoadBitmap( WORD id );
extern HICON OBM_LoadIcon( WORD id );
extern HANDLE OBM_LoadCursorIcon( WORD id, BOOL fCursor );
#endif /* __WINE_BITMAP_H */

37
include/bitmaps/ocr_cross Normal file
View File

@ -0,0 +1,37 @@
/* XPM */
static char * ocr_cross[] = {
"32 32 2 1 9 9",
" s None c None",
". s black c black",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
"................... ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

37
include/bitmaps/ocr_ibeam Normal file
View File

@ -0,0 +1,37 @@
/* XPM */
static char * ocr_ibeam[] = {
"32 32 2 1 3 8",
" s black c black",
". s None c None",
" . .........................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
"... ............................",
" . .........................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};

38
include/bitmaps/ocr_icon Normal file
View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_icon[] = {
"32 32 3 1 8 6",
" s black c black",
". s None c None",
"X s white c white",
" ...............",
" ...............",
" XXXXXXXXXXX ...............",
" XX XX ...............",
" XX XX ...............",
" XX XX ...............",
" XX XX ...............",
" XX XX ...............",
" XX XX ...............",
" XX XX ...............",
" XXXXXXXXXXX ...............",
" ...............",
" ...............",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};

View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_normal[] = {
"32 32 3 1 0 0",
" s black c black",
". s None c None",
"X s white c white",
" ..............................",
" X .............................",
" XX ............................",
" XXX ...........................",
" XXXX ..........................",
" XXXXX .........................",
" XXXXXX ........................",
" XXXXXXX .......................",
" XXXXXXXX ......................",
" XXXXXXXXX .....................",
" XXXXXX ....................",
" XXX XX ........................",
" XX XX ........................",
" X . XX .......................",
" ... XX .......................",
" ..... XX ......................",
"...... XX ......................",
"....... XX .....................",
"....... XX .....................",
"........ ......................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};

38
include/bitmaps/ocr_size Normal file
View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_size[] = {
"32 32 3 1 11 11",
" s None c None",
". s black c black",
"X s white c white",
" .. ",
" .XX. ",
" .XXXX. ",
" .XXXXXX. ",
" .XXXXXXXX. ",
" ....XX.... ",
" .XX. ",
" .. .XX. .. ",
" .X. .XX. .X. ",
" .XX. .XX. .XX. ",
" .XXX......XX......XXX. ",
".XXXXXXXXXXXXXXXXXXXXXX. ",
".XXXXXXXXXXXXXXXXXXXXXX. ",
" .XXX......XX......XXX. ",
" .XX. .XX. .XX. ",
" .X. .XX. .X. ",
" .. .XX. .. ",
" .XX. ",
" ....XX.... ",
" .XXXXXXXX. ",
" .XXXXXX. ",
" .XXXX. ",
" .XX. ",
" .. ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_sizenesw[] = {
"32 32 3 1 6 6",
" s None c None",
". s black c black",
"X s white c white",
" ....... ",
" .XXXXXX. ",
" .XXXXX. ",
" .XXXX. ",
" .XXXXX. ",
".. .XXX.XX. ",
".X. .XXX. .X. ",
".XX.XXX. .. ",
".XXXXX. ",
".XXXX. ",
".XXXXX. ",
".XXXXXX. ",
" ....... ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_sizens[] = {
"32 32 3 1 4 7",
" s None c None",
". s black c black",
"X s white c white",
" .. ",
" .XX. ",
" .XXXX. ",
" .XXXXXX. ",
".XXXXXXXX. ",
"....XX.... ",
" .XX. ",
" .XX. ",
" .XX. ",
" .XX. ",
"....XX.... ",
".XXXXXXXX. ",
" .XXXXXX. ",
" .XXXX. ",
" .XX. ",
" .. ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_sizenwse[] = {
"32 32 3 1 6 6",
" s None c None",
". s black c black",
"X s white c white",
" ....... ",
".XXXXXX. ",
".XXXXX. ",
".XXXX. ",
".XXXXX. ",
".XX.XXX. .. ",
".X. .XXX. .X. ",
".. .XXX.XX. ",
" .XXXXX. ",
" .XXXX. ",
" .XXXXX. ",
" .XXXXXX. ",
" ....... ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_sizewe[] = {
"32 32 3 1 7 4",
" s None c None",
". s black c black",
"X s white c white",
" .. .. ",
" .X. .X. ",
" .XX. .XX. ",
" .XXX......XXX. ",
".XXXXXXXXXXXXXX. ",
".XXXXXXXXXXXXXX. ",
" .XXX......XXX. ",
" .XX. .XX. ",
" .X. .X. ",
" .. .. ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};

38
include/bitmaps/ocr_up Normal file
View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_up[] = {
"32 32 3 1 6 0",
" s None c None",
". s black c black",
"X s white c white",
" .. ",
" .. ",
" .... ",
" .... ",
" ..XX.. ",
" ..XX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXXXX.. ",
" ..XXXXXX.. ",
" ..XXXXXXXX.. ",
" ..XXXXXXXX.. ",
"..XXXXXXXXXX.. ",
"..XXXXXXXXXX.. ",
".....XXXX..... ",
".....XXXX..... ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ..XXXX.. ",
" ........ ",
" ........ ",
" ",
" ",
" ",
" "};

38
include/bitmaps/ocr_wait Normal file
View File

@ -0,0 +1,38 @@
/* XPM */
static char * ocr_wait[] = {
"32 32 3 1 7 13",
" s black c black",
". s None c None",
"X s white c white",
" .................",
" .................",
" XXXXXXXXXXX .................",
". ..................",
". XXXXXXXXX ..................",
". XXXXXXXXX ..................",
". XXXXXX XX ..................",
". X X X X X ..................",
". XX X X XX ..................",
".. XX X XX ...................",
"... XX XX ....................",
".... XXX .....................",
"..... X ......................",
"..... X ......................",
"..... X ......................",
".... XXX .....................",
"... XXXXX ....................",
".. XXX XXX ...................",
". XXXXXXXXX ..................",
". XXXX XXXX ..................",
". XXX X XXX ..................",
". XX X X XX ..................",
". X X X X X ..................",
". ..................",
" XXXXXXXXXXX .................",
" .................",
" .................",
"................................",
"................................",
"................................",
"................................",
"................................"};

View File

@ -28,6 +28,7 @@ typedef struct
#define BUTTON_STATE(hwnd) ((WIN_FindWndPtr(hwnd))->wExtra[0])
extern LONG ButtonWndProc( HWND hWnd, WORD uMsg, WORD wParam, LONG lParam );
extern LRESULT ButtonWndProc( HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam );
#endif /* BUTTON_H */

View File

@ -12,8 +12,6 @@
#include "stackframe.h"
#ifndef WINELIB
extern int CallTo32_LargeStack( int (*func)(), int nbargs, ... );
@ -22,6 +20,9 @@ extern int CallTo32_LargeStack( int (*func)(), int nbargs, ... );
/* func ds parameters */
extern WORD CallTo16_word_ ( FARPROC, WORD );
#ifndef WINELIB
extern WORD CallTo16_word_ww ( FARPROC, WORD, WORD, WORD );
extern WORD CallTo16_word_wl ( FARPROC, WORD, WORD, LONG );
extern WORD CallTo16_word_ll ( FARPROC, WORD, LONG, LONG );

View File

@ -32,7 +32,7 @@ typedef struct tagCLASS
#endif
HCLASS CLASS_FindClassByName( SEGPTR name, WORD hinstance, CLASS **ptr );
HCLASS CLASS_FindClassByName( SEGPTR name, HINSTANCE hinstance, CLASS **ptr );
CLASS * CLASS_FindClassPtr( HCLASS hclass );

View File

@ -15,3 +15,6 @@ typedef struct {
RECT RectButton;
BOOL bRedrawFlag;
} HEADCOMBO,*LPHEADCOMBO;
LRESULT ComboBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT ComboLBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

View File

@ -290,7 +290,13 @@ typedef DEVNAMES * LPDEVNAMES;
#define FINDDLG 9
#define REPLACEDLG 10
LRESULT FileOpenDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT FileSaveDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT ColorDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT FindTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT ReplaceTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT PrintDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT PrintSetupDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
#endif /* #ifdef COMMDLG_H */

View File

@ -1,41 +0,0 @@
/*
* structure definitions for CURSOR
*
* Copyright Martin Ayotte, 1993
*
*/
#ifndef __WINE_CURSOR_H
#define __WINE_CURSOR_H
typedef struct {
POINT pntHotSpot; /* cursor hot spot */
WORD nWidth; /* width of bitmap in pixels */
WORD nHeight;
WORD nWidthBytes;
BYTE byPlanes; /* number of bit planes */
BYTE byBitsPix; /* bits per pixel */
} CURSORICONINFO, FAR *LPCURSORICONINFO;
typedef struct {
WORD cdReserved;
WORD cdType;
WORD cdCount;
} CURSORDIR;
typedef struct {
WORD Width;
WORD Height;
WORD Planes;
WORD BitCount;
DWORD curDIBSize;
WORD curDIBOffset;
} CURSORDESCRIP;
typedef struct {
Cursor xcursor;
} CURSORALLOC;
extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */
#endif /* __WINE_CURSOR_H */

59
include/cursoricon.h Normal file
View File

@ -0,0 +1,59 @@
/*
* Cursor and icon definitions
*
* Copyright 1995 Alexandre Julliard
*/
#ifndef __WINE_CURSORICON_H
#define __WINE_CURSORICON_H
#include <X11/Xlib.h>
#include "windows.h"
#ifndef WINELIB
#pragma pack(1)
#endif
typedef struct
{
BYTE bWidth;
BYTE bHeight;
BYTE bColorCount;
BYTE bReserved;
WORD wPlanes;
WORD wBitCount;
DWORD dwBytesInRes;
WORD wResId;
} ICONDIRENTRY;
typedef struct
{
WORD wWidth;
WORD wHeight;
WORD wPlanes;
WORD wBitCount;
DWORD dwBytesInRes;
WORD wResId;
} CURSORDIRENTRY;
typedef union
{
ICONDIRENTRY icon;
CURSORDIRENTRY cursor;
} CURSORICONDIRENTRY;
typedef struct
{
WORD idReserved;
WORD idType;
WORD idCount;
CURSORICONDIRENTRY idEntries[1] WINE_PACKED;
} CURSORICONDIR;
#ifndef WINELIB
#pragma pack(4)
#endif
extern Cursor CURSORICON_XCursor; /* Current X cursor */
#endif /* __WINE_CURSORICON_H */

View File

@ -78,10 +78,8 @@
#undef DEBUG_RESOURCE
#undef DEBUG_SCROLL
#undef DEBUG_SELECTOR
#undef DEBUG_SELECTORS
#undef DEBUG_SEM
#undef DEBUG_SHM
#undef DEBUG_SPY
#undef DEBUG_STRESS
#undef DEBUG_SYSCOLOR
#undef DEBUG_TASK
@ -89,6 +87,7 @@
#undef DEBUG_TIMER
#undef DEBUG_TOOLHELP
#undef DEBUG_UTILITY
#undef DEBUG_VXD
#undef DEBUG_WIN
#undef DEBUG_WINSOCK
#endif
@ -156,10 +155,8 @@
#define DEBUG_RESOURCE
#define DEBUG_SCROLL
#define DEBUG_SELECTOR
#define DEBUG_SELECTORS
#define DEBUG_SEM
#define DEBUG_SHM
#define DEBUG_SPY
#define DEBUG_STRESS
#define DEBUG_SYSCOLOR
#define DEBUG_TASK
@ -167,6 +164,7 @@
#define DEBUG_TIMER
#define DEBUG_TOOLHELP
#define DEBUG_UTILITY
#define DEBUG_VXD
#define DEBUG_WIN
#define DEBUG_WINSOCK
#endif
@ -484,11 +482,6 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_SELECTORS
1,
#else
0,
#endif
#ifdef DEBUG_SEM
1,
#else
@ -499,11 +492,6 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_SPY
1,
#else
0,
#endif
#ifdef DEBUG_STRESS
1,
#else
@ -539,6 +527,11 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_VXD
1,
#else
0,
#endif
#ifdef DEBUG_WIN
1,
#else
@ -1363,21 +1356,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_selectors if(!debug_msg_enabled[62]) ; else fprintf
#define debugging_selectors debug_msg_enabled[62]
#else
#ifdef DEBUG_SELECTORS
#define dprintf_selectors fprintf
#define debugging_selectors 1
#else
#define dprintf_selectors while(0) fprintf
#define debugging_selectors 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_sem if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_sem debug_msg_enabled[63]
#define dprintf_sem if(!debug_msg_enabled[62]) ; else fprintf
#define debugging_sem debug_msg_enabled[62]
#else
#ifdef DEBUG_SEM
#define dprintf_sem fprintf
@ -1389,8 +1369,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_shm if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_shm debug_msg_enabled[64]
#define dprintf_shm if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_shm debug_msg_enabled[63]
#else
#ifdef DEBUG_SHM
#define dprintf_shm fprintf
@ -1402,21 +1382,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_spy if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_spy debug_msg_enabled[65]
#else
#ifdef DEBUG_SPY
#define dprintf_spy fprintf
#define debugging_spy 1
#else
#define dprintf_spy while(0) fprintf
#define debugging_spy 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_stress if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_stress debug_msg_enabled[66]
#define dprintf_stress if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_stress debug_msg_enabled[64]
#else
#ifdef DEBUG_STRESS
#define dprintf_stress fprintf
@ -1428,8 +1395,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_syscolor if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_syscolor debug_msg_enabled[67]
#define dprintf_syscolor if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_syscolor debug_msg_enabled[65]
#else
#ifdef DEBUG_SYSCOLOR
#define dprintf_syscolor fprintf
@ -1441,8 +1408,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_task if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_task debug_msg_enabled[68]
#define dprintf_task if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_task debug_msg_enabled[66]
#else
#ifdef DEBUG_TASK
#define dprintf_task fprintf
@ -1454,8 +1421,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_text if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_text debug_msg_enabled[69]
#define dprintf_text if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_text debug_msg_enabled[67]
#else
#ifdef DEBUG_TEXT
#define dprintf_text fprintf
@ -1467,8 +1434,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_timer if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_timer debug_msg_enabled[70]
#define dprintf_timer if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_timer debug_msg_enabled[68]
#else
#ifdef DEBUG_TIMER
#define dprintf_timer fprintf
@ -1480,8 +1447,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_toolhelp if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[71]
#define dprintf_toolhelp if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[69]
#else
#ifdef DEBUG_TOOLHELP
#define dprintf_toolhelp fprintf
@ -1493,8 +1460,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_utility if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_utility debug_msg_enabled[72]
#define dprintf_utility if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_utility debug_msg_enabled[70]
#else
#ifdef DEBUG_UTILITY
#define dprintf_utility fprintf
@ -1506,8 +1473,21 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_win debug_msg_enabled[73]
#define dprintf_vxd if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_vxd debug_msg_enabled[71]
#else
#ifdef DEBUG_VXD
#define dprintf_vxd fprintf
#define debugging_vxd 1
#else
#define dprintf_vxd while(0) fprintf
#define debugging_vxd 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_win debug_msg_enabled[72]
#else
#ifdef DEBUG_WIN
#define dprintf_win fprintf
@ -1519,8 +1499,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_winsock if(!debug_msg_enabled[74]) ; else fprintf
#define debugging_winsock debug_msg_enabled[74]
#define dprintf_winsock if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_winsock debug_msg_enabled[73]
#else
#ifdef DEBUG_WINSOCK
#define dprintf_winsock fprintf
@ -1597,10 +1577,8 @@ static char *debug_msg_name[] = {
"resource",
"scroll",
"selector",
"selectors",
"sem",
"shm",
"spy",
"stress",
"syscolor",
"task",
@ -1608,6 +1586,7 @@ static char *debug_msg_name[] = {
"timer",
"toolhelp",
"utility",
"vxd",
"win",
"winsock",
""

View File

@ -26,6 +26,18 @@ typedef struct
((addr)->seg ? (char *)PTR_SEG_OFF_TO_LIN((addr)->seg,(addr)->off) \
: (char *)(addr)->off)
#define DBG_CHECK_READ_PTR(addr,len) \
(!DEBUG_IsBadReadPtr((addr),(len)) || \
(fprintf(stderr,"*** Invalid address "), \
DEBUG_PrintAddress((addr),dbg_mode), \
fprintf(stderr,"\n"),0))
#define DBG_CHECK_WRITE_PTR(addr,len) \
(!DEBUG_IsBadWritePtr((addr),(len)) || \
(fprintf(stderr,"*** Invalid address "), \
DEBUG_PrintAddress(addr,dbg_mode), \
fprintf(stderr,"\n"),0))
enum debug_regs
{
REG_EAX, REG_EBX, REG_ECX, REG_EDX, REG_ESI,
@ -76,6 +88,8 @@ extern void DEBUG_PrintAddress( const DBG_ADDR *addr, int addrlen );
extern void DEBUG_Help(void);
/* debugger/memory.c */
extern BOOL DEBUG_IsBadReadPtr( const DBG_ADDR *address, int size );
extern BOOL DEBUG_IsBadWritePtr( const DBG_ADDR *address, int size );
extern int DEBUG_ReadMemory( const DBG_ADDR *address );
extern void DEBUG_WriteMemory( const DBG_ADDR *address, int value );
extern void DEBUG_ExamineMemory( const DBG_ADDR *addr, int count, char format);

View File

@ -20,4 +20,6 @@ typedef struct
extern BOOL DESKTOP_Init();
extern BOOL DESKTOP_SetPattern(char *pattern );
extern LRESULT DesktopWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
#endif /* DESKTOP_H */

View File

@ -12,9 +12,7 @@
extern BOOL DIALOG_Init(void);
extern HWND DIALOG_GetFirstTabItem( HWND hwndDlg );
#ifndef WINELIB
#pragma pack(1)
#endif
/* Dialog info structure.
* This structure is stored into the window extra bytes (cbWndExtra).
@ -70,8 +68,6 @@ typedef struct
SEGPTR faceName;
} DLGTEMPLATE;
#ifndef WINELIB
#pragma pack(4)
#endif
#endif /* DIALOG_H */

View File

@ -22,7 +22,7 @@ extern int DOS_SetSerialNumber(int drive, unsigned long serialnumber);
extern char *DOS_GetVolumeLabel(int drive);
extern int DOS_SetVolumeLabel(int drive, char *label);
extern int DOS_GetFreeSpace(int drive, long *size, long *available);
extern char *DOS_FindFile(char *buffer, int buflen, char *rootname, char **extensions, char *path);
extern char *DOS_FindFile(char *buffer, int buflen, const char *rootname, char **extensions, char *path);
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
extern struct dosdirent *DOS_opendir(char *dosdirname);
@ -30,6 +30,7 @@ extern struct dosdirent *DOS_readdir(struct dosdirent *de);
extern void DOS_closedir(struct dosdirent *de);
extern char *DOS_GetRedirectedDir(int drive);
extern void errno_to_doserr(void);
extern int DOS_Error(int extended, int class, int locus);
extern char WindowsPath[256];

View File

@ -3,5 +3,6 @@
extern void EVENT_ProcessEvent( XEvent *event ); /* event.c */
extern void EVENT_RegisterWindow( Window w, HWND hwnd ); /* event.c */
extern void EVENT_DummyMotionNotify(void); /* event.c */
#endif /* __WINE_EVENT_H */

View File

@ -197,37 +197,42 @@ typedef struct tagDC
#define DC_SAVED 2 /* It is a saved DC */
/* Last 32 bytes are reserved for stock object handles */
#ifdef WINELIB32
/* Stupid overloading (see DefWindowProc, case WM_ERASEBKGND) */
#define GDI_HEAP_SIZE (COLOR_BTNHIGHLIGHT+1)
#else
#define GDI_HEAP_SIZE 0xffe0
#endif
/* First handle possible for stock objects (must be >= GDI_HEAP_SIZE) */
#define FIRST_STOCK_HANDLE GDI_HEAP_SIZE
/* Stock objects handles */
#define STOCK_WHITE_BRUSH (FIRST_STOCK_HANDLE + WHITE_BRUSH)
#define STOCK_LTGRAY_BRUSH (FIRST_STOCK_HANDLE + LTGRAY_BRUSH)
#define STOCK_GRAY_BRUSH (FIRST_STOCK_HANDLE + GRAY_BRUSH)
#define STOCK_DKGRAY_BRUSH (FIRST_STOCK_HANDLE + DKGRAY_BRUSH)
#define STOCK_BLACK_BRUSH (FIRST_STOCK_HANDLE + BLACK_BRUSH)
#define STOCK_NULL_BRUSH (FIRST_STOCK_HANDLE + NULL_BRUSH)
#define STOCK_HOLLOW_BRUSH (FIRST_STOCK_HANDLE + HOLLOW_BRUSH)
#define STOCK_WHITE_PEN (FIRST_STOCK_HANDLE + WHITE_PEN)
#define STOCK_BLACK_PEN (FIRST_STOCK_HANDLE + BLACK_PEN)
#define STOCK_NULL_PEN (FIRST_STOCK_HANDLE + NULL_PEN)
#define STOCK_OEM_FIXED_FONT (FIRST_STOCK_HANDLE + OEM_FIXED_FONT)
#define STOCK_ANSI_FIXED_FONT (FIRST_STOCK_HANDLE + ANSI_FIXED_FONT)
#define STOCK_ANSI_VAR_FONT (FIRST_STOCK_HANDLE + ANSI_VAR_FONT)
#define STOCK_SYSTEM_FONT (FIRST_STOCK_HANDLE + SYSTEM_FONT)
#define STOCK_DEVICE_DEFAULT_FONT (FIRST_STOCK_HANDLE + DEVICE_DEFAULT_FONT)
#define STOCK_DEFAULT_PALETTE (FIRST_STOCK_HANDLE + DEFAULT_PALETTE)
#define STOCK_SYSTEM_FIXED_FONT (FIRST_STOCK_HANDLE + SYSTEM_FIXED_FONT)
#define NB_STOCK_OBJECTS (SYSTEM_FIXED_FONT + 1)
#define NB_STOCK_OBJECTS (SYSTEM_FIXED_FONT + 1)
#define FIRST_STOCK_FONT STOCK_OEM_FIXED_FONT
#define LAST_STOCK_FONT STOCK_SYSTEM_FIXED_FONT
#define STOCK_WHITE_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+WHITE_BRUSH))
#define STOCK_LTGRAY_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+LTGRAY_BRUSH))
#define STOCK_GRAY_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+GRAY_BRUSH))
#define STOCK_DKGRAY_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+DKGRAY_BRUSH))
#define STOCK_BLACK_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+BLACK_BRUSH))
#define STOCK_NULL_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+NULL_BRUSH))
#define STOCK_HOLLOW_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+HOLLOW_BRUSH))
#define STOCK_WHITE_PEN ((HPEN)(FIRST_STOCK_HANDLE+WHITE_PEN))
#define STOCK_BLACK_PEN ((HPEN)(FIRST_STOCK_HANDLE+BLACK_PEN))
#define STOCK_NULL_PEN ((HPEN)(FIRST_STOCK_HANDLE+NULL_PEN))
#define STOCK_OEM_FIXED_FONT ((HFONT)(FIRST_STOCK_HANDLE+OEM_FIXED_FONT))
#define STOCK_ANSI_FIXED_FONT ((HFONT)(FIRST_STOCK_HANDLE+ANSI_FIXED_FONT))
#define STOCK_ANSI_VAR_FONT ((HFONT)(FIRST_STOCK_HANDLE+ANSI_VAR_FONT))
#define STOCK_SYSTEM_FONT ((HFONT)(FIRST_STOCK_HANDLE+SYSTEM_FONT))
#define STOCK_DEVICE_DEFAULT_FONT ((HFONT)(FIRST_STOCK_HANDLE+DEVICE_DEFAULT_FONT))
#define STOCK_DEFAULT_PALETTE ((HPALETTE)(FIRST_STOCK_HANDLE+DEFAULT_PALETTE))
#define STOCK_SYSTEM_FIXED_FONT ((HFONT)(FIRST_STOCK_HANDLE+SYSTEM_FIXED_FONT))
#define FIRST_STOCK_FONT STOCK_OEM_FIXED_FONT
#define LAST_STOCK_FONT STOCK_SYSTEM_FIXED_FONT
#define LAST_STOCK_HANDLE ((DWORD)STOCK_SYSTEM_FIXED_FONT)
/* Device <-> logical coords conversion */

View File

@ -1,26 +0,0 @@
/*
* structure definitions for ICON
*
* Copyright Martin Ayotte, 1993
*
*/
typedef struct {
BYTE Width;
BYTE Height;
BYTE ColorCount;
BYTE Reserved1;
WORD Reserved2;
WORD Reserved3;
DWORD icoDIBSize;
DWORD icoDIBOffset;
} ICONDESCRIP;
typedef struct {
ICONDESCRIP descriptor;
HBITMAP hBitmap;
HBITMAP hBitMask;
} ICONALLOC;

80
include/kernel32.h Normal file
View File

@ -0,0 +1,80 @@
/* kernel32.h - 95-09-14 Cameron Heide
*
* Win32 functions, structures, and types related to kernel functions
*/
#include <stddef.h>
int KERN32_Init(void);
void SetLastError(DWORD error);
DWORD ErrnoToLastError(int errno_num);
/* Linux's wchar_t is unsigned long but Win32 wants unsigned short
*/
typedef unsigned short WCHAR;
/* Code page information.
*/
typedef struct {
DWORD MaxCharSize;
BYTE DefaultChar[2];
BYTE LeadBytes[5];
} CPINFO, *LPCPINFO;
/* The 'overlapped' data structure used by async I/O functions.
*/
typedef struct {
DWORD Internal;
DWORD InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED;
/* Process startup information.
*/
typedef struct {
DWORD cb;
LPSTR lpReserved;
LPSTR lpDesktop;
LPSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
BYTE *lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFO, *LPSTARTUPINFO;
typedef struct {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *LPSYSTEMTIME;
typedef struct {
LONG Bias;
WCHAR StandardName[32];
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR DaylightName[32];
SYSTEMTIME DaylightDate;
LONG DaylightBias;
} TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
#define TIME_ZONE_ID_UNKNOWN 0
#define TIME_ZONE_ID_STANDARD 1
#define TIME_ZONE_ID_DAYLIGHT 2

View File

@ -30,7 +30,7 @@ extern void LDT_BytesToEntry( const unsigned long *buffer, ldt_entry *content);
extern void LDT_EntryToBytes( unsigned long *buffer, const ldt_entry *content);
extern int LDT_GetEntry( int entry, ldt_entry *content );
extern int LDT_SetEntry( int entry, const ldt_entry *content );
extern void LDT_Print();
extern void LDT_Print( int start, int length );
/* This structure is used to build the local copy of the LDT. */
@ -73,7 +73,7 @@ extern ldt_copy_entry ldt_copy[LDT_SIZE];
((void*)(GET_SEL_BASE(seg) + (unsigned int)(off)))
#else
#define PTR_SEG_TO_LIN(ptr) ((void*)(ptr))
#define PTR_SEG_OFF_TO_LIN(seg,off) ((void*)(off))
#define PTR_SEG_OFF_TO_LIN(seg,off) ((void*)((char*)(seg)+(int)(off)))
#endif

View File

@ -67,3 +67,5 @@ extern void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC hdc,
WORD itemState);
extern int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y);
extern void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls);
extern LRESULT ListBoxWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);

View File

@ -13,14 +13,14 @@
/* excepted that they need DS as the first parameter. This */
/* allows managing several heaps from the emulation library. */
extern HLOCAL LOCAL_Alloc( WORD ds, WORD flags, WORD size );
extern HLOCAL LOCAL_ReAlloc( WORD ds, HLOCAL handle, WORD size, WORD flags );
extern HLOCAL LOCAL_Free( WORD ds, HLOCAL handle );
extern HLOCAL LOCAL_Handle( WORD ds, WORD addr );
extern WORD LOCAL_Size( WORD ds, HLOCAL handle );
extern WORD LOCAL_Flags( WORD ds, HLOCAL handle );
extern WORD LOCAL_HeapSize( WORD ds );
extern WORD LOCAL_Lock( WORD ds, HLOCAL handle );
extern BOOL LOCAL_Unlock( WORD ds, HLOCAL handle );
extern HLOCAL LOCAL_Alloc( HANDLE ds, WORD flags, WORD size );
extern HLOCAL LOCAL_ReAlloc( HANDLE ds, HLOCAL handle, WORD size, WORD flags );
extern HLOCAL LOCAL_Free( HANDLE ds, HLOCAL handle );
extern HLOCAL LOCAL_Handle( HANDLE ds, WORD addr );
extern WORD LOCAL_Size( HANDLE ds, HLOCAL handle );
extern WORD LOCAL_Flags( HANDLE ds, HLOCAL handle );
extern WORD LOCAL_HeapSize( HANDLE ds );
extern NPVOID LOCAL_Lock( HANDLE ds, HLOCAL handle );
extern BOOL LOCAL_Unlock( HANDLE ds, HLOCAL handle );
#endif /* __WINE_LOCAL_H */

View File

@ -11,8 +11,8 @@
#include "windows.h"
#define MDI_MAXLISTLENGTH 64
extern LONG MDIClientWndProc(HWND hwnd, WORD message,
WORD wParam, LONG lParam); /* mdi.c */
extern LRESULT MDIClientWndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam); /* mdi.c */
typedef struct

View File

@ -17,6 +17,7 @@ extern WORD MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
HWND hwnd, BOOL suppress_draw ); /* menu.c */
extern HMENU CopySysMenu(); /* menu.c */
extern LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam );
typedef struct tagMENUITEM
{

View File

@ -20,7 +20,7 @@ typedef struct tagQMSG
typedef struct tagMESSAGEQUEUE
{
WORD next;
WORD hTask; /* hTask owning the queue */
HTASK hTask; /* hTask owning the queue */
WORD msgSize; /* Size of messages in the queue */
WORD msgCount; /* Number of waiting messages */
WORD nextMessage; /* Next message to be retrieved */
@ -29,10 +29,10 @@ typedef struct tagMESSAGEQUEUE
DWORD GetMessageTimeVal; /* Value returned by GetMessageTime */
DWORD GetMessagePosVal; /* Value returned by GetMessagePos */
DWORD GetMessageExtraInfoVal; /* Value returned by GetMessageExtraInfo */
DWORD lParam; /* Next four values set by SendMessage */
WORD wParam;
WORD msg;
WORD hWnd;
LPARAM lParam; /* Next four values set by SendMessage */
WPARAM wParam;
UINT msg;
HWND hWnd;
WORD wPostQMsg; /* PostQuitMessage flag */
WORD wExitCode; /* PostQuitMessage exit code */
WORD InSendMessageHandle; /* Handle of task that sent a message */

View File

@ -10,7 +10,6 @@
#include "wintypes.h"
#include "registers.h"
/* miscemu/dosmem.c */
extern BOOL DOSMEM_Init(void);
extern void DOSMEM_FillBiosSegment(void);

View File

@ -19,7 +19,7 @@ typedef struct
WORD magic; /* 'NE' signature */
WORD count; /* Usage count */
WORD entry_table; /* Near ptr to entry table */
WORD next; /* Selector to next module */
HMODULE next; /* Selector to next module */
WORD dgroup_entry; /* Near ptr to segment entry for DGROUP */
WORD fileinfo; /* Near ptr to file info (LOADEDFILEINFO) */
WORD flags; /* Module flags */
@ -69,7 +69,7 @@ typedef struct
WORD size; /* Segment size on disk */
WORD flags; /* Segment flags */
WORD minsize; /* Min. size of segment in memory */
WORD selector; /* Selector of segment in memory */
HANDLE selector; /* Selector of segment in memory */
} SEGTABLEENTRY;
/* Self-loading modules contain this structure in their first segment */

View File

@ -39,6 +39,7 @@ struct fcb {
#define MAX_DOS_DRIVES 26
extern WORD ExtendedError;
extern BYTE ErrorClass, Action, ErrorLocus;
extern struct DosDeviceStruct COM[MAX_PORTS];
extern struct DosDeviceStruct LPT[MAX_PORTS];

View File

@ -68,6 +68,7 @@ struct ne_header_s
*/
#define NE_FFLAGS_SINGLEDATA 0x0001
#define NE_FFLAGS_MULTIPLEDATA 0x0002
#define NE_FFLAGS_BUILTIN 0x0010 /* Wine built-in module */
#define NE_FFLAGS_SELFLOAD 0x0800
#define NE_FFLAGS_LINKERROR 0x2000
#define NE_FFLAGS_LIBMODULE 0x8000
@ -196,7 +197,7 @@ struct resource_nameinfo_s
unsigned short length;
unsigned short flags;
unsigned short id;
unsigned short handle;
HANDLE handle;
unsigned short usage;
};

View File

@ -14,12 +14,12 @@ extern void NC_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack );
extern void NC_DoNCPaint( HWND hwnd, BOOL active, BOOL suppress_menupaint );
extern LONG NC_HandleNCPaint( HWND hwnd );
extern LONG NC_HandleNCActivate( HWND hwnd, WORD wParam );
extern LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam );
extern LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS *params );
extern LONG NC_HandleNCHitTest( HWND hwnd, POINT pt );
extern LONG NC_HandleNCLButtonDown( HWND hwnd, WORD wParam, LONG lParam );
extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WORD wParam, LONG lParam );
extern LONG NC_HandleSysCommand( HWND hwnd, WORD wParam, POINT pt );
extern LONG NC_HandleSetCursor( HWND hwnd, WORD wParam, LONG lParam );
extern LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam );
extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam );
extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT pt );
extern LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam );
#endif /* __WINE_NONCLIENT_H */

View File

@ -19,8 +19,8 @@ struct w_files
char * filename; /* Actual name of the unix file that satisfies this */
int type; /* DLL or EXE */
int fd;
unsigned short hinstance;
HANDLE hModule;
HINSTANCE hinstance;
HMODULE hModule;
int initialised;
struct mz_header_s *mz_header;
struct pe_data *pe;

View File

@ -40,13 +40,11 @@
#define ES_reg(context) ((context)->sc_es)
#define SS_reg(context) ((context)->sc_ss)
#ifdef linux
#ifdef linux
/* fs and gs are not supported on *BSD. Hopefully we won't need them. */
#define FS_reg(context) ((context)->sc_fs)
#define GS_reg(context) ((context)->sc_gs)
#else /* FIXME: are fs and gs supported under *BSD? */
#define FS_reg(context) 0
#define GS_reg(context) 0
#endif
#endif
#ifndef __FreeBSD__
#define EFL_reg(context) ((context)->sc_eflags)

View File

@ -4,8 +4,10 @@
* Copyright 1995 Martin von Loewis
*/
void RELAY32_Unimplemented(char *dll, int item);
void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint);
LONG RELAY32_CallWindowProc(WNDPROC,int,int,int,int);
void RELAY32_DebugEnter(char *dll,char *name);
typedef struct tagWNDCLASSA{
UINT style;

View File

@ -17,9 +17,6 @@ extern SEGPTR NE_LockResource( HMODULE hModule, HGLOBAL handle );
extern HGLOBAL NE_AllocResource( HMODULE hModule, HRSRC hRsrc, DWORD size );
extern HGLOBAL NE_LoadResource( HMODULE hModule, HRSRC hRsrc );
extern HBITMAP ConvertCoreBitmap( HDC hdc, BITMAPCOREHEADER * image );
extern HBITMAP ConvertInfoBitmap( HDC hdc, BITMAPINFO * image );
struct ResourceTable
{
int id,type;

View File

@ -18,7 +18,11 @@ extern INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
#define HKEY_CLASSES_ROOT 1
#ifdef WINELIB32
typedef void* HKEY;
#else
typedef DWORD HKEY;
#endif
typedef HKEY FAR* LPHKEY;
typedef struct tagKEYSTRUCT {
@ -32,6 +36,13 @@ typedef struct tagKEYSTRUCT {
} KEYSTRUCT;
typedef KEYSTRUCT *LPKEYSTRUCT;
typedef struct tagDROPFILESTRUCT { /* structure for dropped files */
WORD wSize;
POINT ptMousePos;
BOOL fInNonClientArea;
/* memory block with filenames follows */
} DROPFILESTRUCT,FAR *LPDROPFILESTRUCT;
#define SE_ERR_SHARE 26
#define SE_ERR_ASSOCINCOMPLETE 27
#define SE_ERR_DDETIMEOUT 28
@ -39,4 +50,5 @@ typedef KEYSTRUCT *LPKEYSTRUCT;
#define SE_ERR_DDEBUSY 30
#define SE_ERR_NOASSOC 31
LRESULT AboutDlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);

19
include/spy.h Normal file
View File

@ -0,0 +1,19 @@
/*
* Message Logging functions
*/
#ifndef __WINE_SPY_H
#define __WINE_SPY_H
#define SPY_DISPATCHMESSAGE 0x0099
#define SPY_SENDMESSAGE 0x0100
#define SPY_DEFWNDPROC 0x0101
#define SPY_RESULT_OK 0x0000
#define SPY_RESULT_INVALIDHWND 0x0001
extern void EnterSpyMessage( int, HWND, WORD, WORD, LONG);
extern void ExitSpyMessage( int, HWND, WORD, LONG);
extern void SpyInit( void);
#endif /* __WINE_SPY_H */

View File

@ -72,7 +72,7 @@ extern DWORD IF1632_Original32_esp;
#else
#define CURRENT_STACK16 error.error
#define CURRENT_DS 0
#define MAKE_SEGPTR(ptr) (ptr)
#define MAKE_SEGPTR(ptr) ((SEGPTR)ptr)
#endif
#endif /* WINE_STACKFRAME_H */

View File

@ -17,6 +17,6 @@ typedef struct
HICON hIcon; /* Icon handle for SS_ICON controls */
} STATICINFO;
extern LONG StaticWndProc( HWND hWnd, WORD uMsg, WORD wParam, LONG lParam );
extern LRESULT StaticWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam );
#endif /* STATIC_H */

View File

@ -138,10 +138,8 @@
#undef DEBUG_RESOURCE
#undef DEBUG_SCROLL
#undef DEBUG_SELECTOR
#undef DEBUG_SELECTORS
#undef DEBUG_SEM
#undef DEBUG_SHM
#undef DEBUG_SPY
#undef DEBUG_STRESS
#undef DEBUG_SYSCOLOR
#undef DEBUG_TASK
@ -149,6 +147,7 @@
#undef DEBUG_TIMER
#undef DEBUG_TOOLHELP
#undef DEBUG_UTILITY
#undef DEBUG_VXD
#undef DEBUG_WIN
#undef DEBUG_WINSOCK
#endif
@ -216,10 +215,8 @@
#define DEBUG_RESOURCE
#define DEBUG_SCROLL
#define DEBUG_SELECTOR
#define DEBUG_SELECTORS
#define DEBUG_SEM
#define DEBUG_SHM
#define DEBUG_SPY
#define DEBUG_STRESS
#define DEBUG_SYSCOLOR
#define DEBUG_TASK
@ -227,6 +224,7 @@
#define DEBUG_TIMER
#define DEBUG_TOOLHELP
#define DEBUG_UTILITY
#define DEBUG_VXD
#define DEBUG_WIN
#define DEBUG_WINSOCK
#endif

View File

@ -61,7 +61,7 @@ typedef struct
char priority; /* Task priority, between -32 and 15 */
BYTE unused1;
HGLOBAL hStack32; /* Handle to 32-bit stack */
WORD hSelf; /* Selector of this TDB */
HTASK hSelf; /* Selector of this TDB */
HANDLE hPrevInstance; /* Previous instance of the module */
DWORD esp; /* 32-bit stack pointer */
WORD ctrlword8087; /* 80x87 control word */

View File

@ -166,14 +166,14 @@ typedef struct {
HMODULE hModule;
WORD wcUsage;
char szExePath[MAX_PATH + 1];
WORD wNext;
HANDLE wNext;
} MODULEENTRY;
typedef MODULEENTRY *LPMODULEENTRY;
BOOL ModuleFirst(MODULEENTRY *lpModule);
BOOL ModuleNext(MODULEENTRY *lpModule);
HMODULE ModuleFindName(MODULEENTRY *lpModule, LPCSTR lpstrName);
HMODULE ModuleFindHandle(MODULEENTRY *lpModule, HMODULE hModule);
BOOL ModuleFindName(MODULEENTRY *lpModule, LPCSTR lpstrName);
BOOL ModuleFindHandle(MODULEENTRY *lpModule, HMODULE hModule);
/* tasks */
@ -240,7 +240,7 @@ typedef struct
DWORD dwSize;
HMODULE hInst; /* This is really an hModule */
char szClassName[MAX_CLASSNAME + 1];
WORD wNext;
HANDLE wNext;
} CLASSENTRY;
BOOL ClassFirst( CLASSENTRY *pClassEntry );

View File

@ -78,9 +78,11 @@ extern Window WIN_GetXWindow( HWND hwnd );
extern BOOL WIN_UnlinkWindow( HWND hwnd );
extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
extern HWND WIN_FindWinToRepaint( HWND hwnd );
extern void WIN_SendParentNotify( HWND hwnd, WORD event, LONG lParam );
extern void WIN_SendParentNotify( HWND hwnd, WORD event,
WORD idChild, LONG lValue );
extern BOOL WIN_CreateDesktopWindow(void);
extern HWND WIN_GetTopParent( HWND hwnd );
extern HINSTANCE WIN_GetWindowInstance( HWND hwnd );
extern Display * display;
extern Screen * screen;

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,19 @@ extern char *WinIniFileName(void);
#define WINE_INI WineIniFileName()
#define WIN_INI WinIniFileName()
#ifdef linux
#ifdef i386
extern int runtime_cpu (void);
#else
static inline int runtime_cpu(void) { return 3; }
#endif
#if defined ( linux) || defined(__svr4__)
/*
* SVR4 NOTE:
* This is not correct but gets it through the compiler
* Must come back and look at this again
*/
struct sigcontext_struct {
unsigned short sc_gs, __gsh;
unsigned short sc_fs, __fsh;
@ -32,8 +44,14 @@ struct sigcontext_struct {
unsigned long oldmask;
unsigned long cr2;
};
#ifdef linux
#define WINE_DATA_SELECTOR 0x2b
#define WINE_CODE_SELECTOR 0x23
#endif
#ifdef __svr4__
#define WINE_DATA_SELECTOR 0x1f
#define WINE_CODE_SELECTOR 0x17
#endif
#endif /* linux */
#ifdef __NetBSD__

View File

@ -64,6 +64,7 @@ typedef WSADATA FAR *LPWSADATA;
#ifndef _SYS_SOCKET_H_
#ifndef _sys_socket_h
#ifndef _NET_TRANSPORT_SOCKET_H
/*
* Structure used by kernel to pass protocol
* information in raw sockets.
@ -74,10 +75,14 @@ struct sockproto {
};
#endif
#endif
#endif
/*
* Maximum queue length specifiable by listen.
*/
#ifdef SOMAXCONN
#undef SOMAXCONN
#endif
#define SOMAXCONN 5
#ifndef MSG_DONTROUTE

View File

@ -1,17 +1,40 @@
#ifndef __WINE_WINTYPES_H
#define __WINE_WINTYPES_H
#ifdef WINELIB
# ifdef WINELIB16
# undef WINELIB32
# else
# ifndef WINELIB32
# define WINELIB32
# endif
# endif
#endif
typedef short INT;
typedef unsigned short UINT;
#define UIFMT "%hu"
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned short BOOL;
typedef unsigned char BYTE;
typedef long LONG;
#ifdef WINELIB32
typedef LONG WPARAM;
#else
typedef UINT WPARAM;
#endif
typedef LONG LPARAM;
typedef LONG LRESULT;
#ifdef WINELIB32
typedef void* HANDLE;
typedef void* NPVOID;
#define NPFMT "%p"
#else
typedef WORD HANDLE;
typedef WORD NPVOID;
#define NPFMT "%04X"
#endif
typedef DWORD HHOOK;
typedef DWORD SEGPTR;
typedef char *LPSTR;
@ -23,17 +46,8 @@ typedef WORD *LPWORD;
typedef DWORD *LPDWORD;
typedef LONG *LPLONG;
typedef void *LPVOID;
#ifdef WINELIB
typedef long (*FARPROC)();
typedef LONG (*WNDPROC)(WORD,WORD,WORD,LONG);
#else
typedef SEGPTR FARPROC;
typedef SEGPTR WNDPROC;
#endif
typedef FARPROC DLGPROC;
typedef WORD CATCHBUF[9];
typedef WORD *LPCATCHBUF;
typedef FARPROC HOOKPROC;
#define DECLARE_HANDLE(a) typedef HANDLE a;
@ -61,6 +75,16 @@ DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HWND);
DECLARE_HANDLE(LOCALHANDLE);
#ifdef WINELIB
typedef long (*FARPROC)();
typedef LRESULT (*WNDPROC)(HWND,UINT,WPARAM,LPARAM);
#else
typedef SEGPTR FARPROC;
typedef SEGPTR WNDPROC;
#endif
typedef FARPROC DLGPROC;
typedef FARPROC HOOKPROC;
#define TRUE 1
#define FALSE 0
#define CW_USEDEFAULT ((INT)0x8000)

View File

@ -1,37 +0,0 @@
#include "../Wine.tmpl"
MODULE = ipc
SRCS = bit_array.c \
dde_proc.c \
shm_main_blk.c \
dde_atom.c \
shm_semaph.c \
dde_mem.c \
shm_block.c \
shm_fragment.c
OBJS = $(SRCS:.c=.o)
SHM_OBJ=shm_block.o shm_semaph.o shm_main_blk.o dde_proc.o \
dde_mem.o bit_array.o shm_fragment.o wine_test_stub.o
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
tests:: dde_mem_test dde_proc_test dde_atom_test shm_fragment_test \
shm_semaph_test
NormalProgramTarget(bit_array_test, bit_array.o bit_array_test.o,,,)
NormalProgramTarget(shm_semaph_test, shm_semaph_test.o shm_semaph.o,,,)
NormalProgramTarget(shm_fragment_test, shm_fragment_test.o shm_fragment.o,,,)
NormalProgramTarget(dde_atom_test, dde_atom_test.o dde_atom.o $(SHM_OBJ),,,)
NormalProgramTarget(dde_mem_test, dde_mem_test.o $(SHM_OBJ),,,)
NormalProgramTarget(dde_proc_test, dde_proc_test.o $(SHM_OBJ) ,,,)
includes::
install::

View File

@ -1,23 +0,0 @@
#include "../Wine.tmpl"
MODULE = loader
SRCS = \
main.c \
module.c \
ne_image.c \
ne_resource.c \
pe_image.c \
pe_resource.c \
signal.c \
resource.c \
task.c
OBJS = $(SRCS:.c=.o)
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
includes::
install::

View File

@ -17,6 +17,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "comm.h"
#include "user.h"
#include "menu.h"
#include "kernel32.h"
#include "atom.h"
#include "dialog.h"
#include "message.h"
@ -29,12 +30,15 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "miscemu.h"
#include "neexe.h"
#include "options.h"
#include "spy.h"
#include "task.h"
#include "dce.h"
#include "pe_image.h"
#include "stddebug.h"
#include "debug.h"
void init_wine_signals(void);
/***********************************************************************
* Main initialisation routine
@ -48,11 +52,13 @@ int MAIN_Init(void)
SpyInit();
#ifndef WINELIB
/* Initialize relay code */
if (!RELAY_Init()) return 0;
/* Initialize Win32 relay code */
if (!RELAY32_Init()) return 0;
#endif
/* Create built-in modules */
if (!MODULE_Init()) return 0;
@ -63,6 +69,7 @@ int MAIN_Init(void)
/* Initialize tasks */
if (!TASK_Init()) return 0;
#ifndef WINELIB
/* Initialize interrupt vectors */
if (!INT_Init()) return 0;
@ -71,6 +78,7 @@ int MAIN_Init(void)
/* Initialize signal handling */
init_wine_signals();
#endif
/* Initialize communications */
COMM_Init();
@ -102,6 +110,9 @@ int MAIN_Init(void)
/* Initialize menus */
if (!MENU_Init()) return 0;
/* Initialize Win32 data structures */
if (!KERN32_Init()) return 0;
/* Create system message queue */
queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
if (!MSG_CreateSysMsgQueue( queueSize )) return 0;

View File

@ -29,6 +29,70 @@ static HMODULE hFirstModule = 0;
static HMODULE hCachedModule = 0; /* Module cached by MODULE_OpenFile */
/***********************************************************************
* MODULE_LoadBuiltin
*
* Load a built-in module. If the 'force' parameter is FALSE, we only
* load the module if it has not been disabled via the -dll option.
*/
static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
{
#ifndef WINELIB /* JBP: Not really allowed in libwine.a (FIXME:?) */
HMODULE hModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
struct dll_table_s *table;
int i;
char dllname[16], *p;
/* Fix the name in case we have a full path and extension */
if ((p = strrchr( name, '\\' ))) name = p + 1;
strncpy( dllname, name, 15 );
dllname[15] = '\0';
if ((p = strrchr( dllname, '.' ))) *p = '\0';
for (i = 0, table = dll_builtin_table; i < N_BUILTINS; i++, table++)
if (!strcasecmp( table->name, dllname )) break;
if (i >= N_BUILTINS) return 0;
if (!table->used && !force) return 0;
hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, table->module_start,
table->module_end - table->module_start,
0, FALSE, FALSE, FALSE, NULL );
if (!hModule) return 0;
FarSetOwner( hModule, hModule );
table->hModule = hModule;
dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n",
table->name, hModule );
/* Allocate the code segment */
pModule = (NE_MODULE *)GlobalLock( hModule );
pSegTable = NE_SEG_TABLE( pModule );
pSegTable->selector = GLOBAL_CreateBlock( GMEM_FIXED, table->code_start,
pSegTable->minsize, hModule,
TRUE, TRUE, FALSE, NULL );
if (!pSegTable->selector) return 0;
pSegTable++;
/* Allocate the data segment */
pSegTable->selector = GLOBAL_Alloc( GMEM_FIXED, pSegTable->minsize,
hModule, FALSE, FALSE, FALSE );
if (!pSegTable->selector) return 0;
memcpy( GlobalLock( pSegTable->selector ),
table->data_start, pSegTable->minsize );
pModule->next = hFirstModule;
hFirstModule = hModule;
return hModule;
}
/***********************************************************************
* MODULE_Init
*
@ -36,56 +100,19 @@ static HMODULE hCachedModule = 0; /* Module cached by MODULE_OpenFile */
*/
BOOL MODULE_Init(void)
{
HMODULE hModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
struct dll_table_s *table;
int i;
/* For these, built-in modules are always used */
/* Create the built-in modules */
for (i = 0, table = dll_builtin_table; i < N_BUILTINS; i++, table++)
{
if (!table->used) continue;
hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, table->module_start,
table->module_end - table->module_start,
0, FALSE, FALSE, FALSE, NULL );
if (!hModule) return FALSE;
FarSetOwner( hModule, hModule );
table->hModule = hModule;
dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n",
table->name, hModule );
/* Allocate the code segment */
pModule = (NE_MODULE *)GlobalLock( hModule );
pSegTable = NE_SEG_TABLE( pModule );
pSegTable->selector = GLOBAL_CreateBlock(GMEM_FIXED, table->code_start,
pSegTable->minsize, hModule,
TRUE, TRUE, FALSE, NULL );
if (!pSegTable->selector) return FALSE;
pSegTable++;
/* Allocate the data segment */
pSegTable->selector = GLOBAL_Alloc( GMEM_FIXED, pSegTable->minsize,
hModule, FALSE, FALSE, FALSE );
if (!pSegTable->selector) return FALSE;
memcpy( GlobalLock( pSegTable->selector ), table->data_start,
pSegTable->minsize );
pModule->next = hFirstModule;
hFirstModule = hModule;
}
if (!MODULE_LoadBuiltin( "KERNEL", TRUE ) ||
!MODULE_LoadBuiltin( "GDI", TRUE ) ||
!MODULE_LoadBuiltin( "USER", TRUE ) ||
!MODULE_LoadBuiltin( "WINPROCS", TRUE )) return FALSE;
#else
fprintf(stderr, "JBP: MODULE_Init() ignored.\n");
#endif
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
MODULE_SetEntryPoint( GetModuleHandle( "KERNEL" ), 178, GetWinFlags() );
return TRUE;
}
@ -103,7 +130,7 @@ void MODULE_PrintModule( HMODULE hmodule )
/* Dump the module info */
printf( "Module %04x:\n", hmodule );
printf( "Module "NPFMT":\n", hmodule );
printf( "count=%d flags=%04x heap=%d stack=%d\n",
pModule->count, pModule->flags,
pModule->heap_size, pModule->stack_size );
@ -124,7 +151,7 @@ void MODULE_PrintModule( HMODULE hmodule )
printf( "\nSegment table:\n" );
pSeg = NE_SEG_TABLE( pModule );
for (i = 0; i < pModule->seg_count; i++, pSeg++)
printf( "%02x: pos=%d size=%d flags=%04x minsize=%d sel=%04x\n",
printf( "%02x: pos=%d size=%d flags=%04x minsize=%d sel="NPFMT"\n",
i + 1, pSeg->filepos, pSeg->size, pSeg->flags,
pSeg->minsize, pSeg->selector );
@ -233,7 +260,7 @@ int MODULE_OpenFile( HMODULE hModule )
static int cachedfd = -1;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_module( stddeb, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n",
dprintf_module( stddeb, "MODULE_OpenFile("NPFMT") cache: mod="NPFMT" fd=%d\n",
hModule, hCachedModule, cachedfd );
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return -1;
if (hCachedModule == hModule) return cachedfd;
@ -278,9 +305,13 @@ static WORD MODULE_Ne2MemFlags(WORD flags)
DWORD MODULE_AllocateSegment(WORD wFlags, WORD wSize, WORD wElem)
{
WORD size = wSize << wElem;
WORD hMem = GlobalAlloc( MODULE_Ne2MemFlags(wFlags), size);
HANDLE hMem = GlobalAlloc( MODULE_Ne2MemFlags(wFlags), size);
#ifdef WINELIB32
return (DWORD)GlobalLock(hMem);
#else
WORD selector = HIWORD(GlobalLock(hMem));
return MAKELONG(hMem, selector);
#endif
}
/***********************************************************************
@ -389,14 +420,14 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
lseek( fd, 0, SEEK_SET );
if ((read( fd, &mz_header, sizeof(mz_header) ) != sizeof(mz_header)) ||
(mz_header.mz_magic != MZ_SIGNATURE)) return 11; /* invalid exe */
(mz_header.mz_magic != MZ_SIGNATURE)) return (HMODULE)11; /* invalid exe */
lseek( fd, mz_header.ne_offset, SEEK_SET );
if (read( fd, &ne_header, sizeof(ne_header) ) != sizeof(ne_header))
return 11; /* invalid exe */
return (HMODULE)11; /* invalid exe */
if (ne_header.ne_magic == PE_SIGNATURE) return 21; /* win32 exe */
if (ne_header.ne_magic != NE_SIGNATURE) return 11; /* invalid exe */
if (ne_header.ne_magic == PE_SIGNATURE) return (HMODULE)21; /* win32 exe */
if (ne_header.ne_magic != NE_SIGNATURE) return (HMODULE)11; /* invalid exe */
/* We now have a valid NE header */
@ -417,7 +448,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
ne_header.entry_tab_length;
hModule = GlobalAlloc( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
if (!hModule) return 11; /* invalid exe */
if (!hModule) return (HMODULE)11; /* invalid exe */
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock( hModule );
memcpy( pModule, &ne_header, sizeof(NE_MODULE) );
@ -465,7 +496,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
if (!READ( ne_header.segment_tab_offset,
ne_header.n_segment_tab * sizeof(struct ne_segment_table_entry_s),
buffer )) return 11; /* invalid exe */
buffer )) return (HMODULE)11; /* invalid exe */
pSeg = (struct ne_segment_table_entry_s *)buffer;
for (i = ne_header.n_segment_tab; i > 0; i--, pSeg++)
{
@ -474,7 +505,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
}
free( buffer );
}
else return 11; /* invalid exe */
else return (HMODULE)11; /* invalid exe */
/* Get the resource table */
@ -483,7 +514,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
pModule->res_table = (int)pData - (int)pModule;
if (!READ(ne_header.resource_tab_offset,
ne_header.rname_tab_offset - ne_header.resource_tab_offset,
pData )) return 11; /* invalid exe */
pData )) return (HMODULE)11; /* invalid exe */
pData += ne_header.rname_tab_offset - ne_header.resource_tab_offset;
}
else pModule->res_table = 0; /* No resource table */
@ -493,7 +524,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
pModule->name_table = (int)pData - (int)pModule;
if (!READ( ne_header.rname_tab_offset,
ne_header.moduleref_tab_offset - ne_header.rname_tab_offset,
pData )) return 11; /* invalid exe */
pData )) return (HMODULE)11; /* invalid exe */
pData += ne_header.moduleref_tab_offset - ne_header.rname_tab_offset;
/* Get the module references table */
@ -503,7 +534,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
pModule->modref_table = (int)pData - (int)pModule;
if (!READ( ne_header.moduleref_tab_offset,
ne_header.n_mod_ref_tab * sizeof(WORD),
pData )) return 11; /* invalid exe */
pData )) return (HMODULE)11; /* invalid exe */
pData += ne_header.n_mod_ref_tab * sizeof(WORD);
}
else pModule->modref_table = 0; /* No module references */
@ -513,7 +544,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
pModule->import_table = (int)pData - (int)pModule;
if (!READ( ne_header.iname_tab_offset,
ne_header.entry_tab_offset - ne_header.iname_tab_offset,
pData )) return 11; /* invalid exe */
pData )) return (HMODULE)11; /* invalid exe */
pData += ne_header.entry_tab_offset - ne_header.iname_tab_offset;
/* Get the entry table */
@ -521,7 +552,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
pModule->entry_table = (int)pData - (int)pModule;
if (!READ( ne_header.entry_tab_offset,
ne_header.entry_tab_length,
pData )) return 11; /* invalid exe */
pData )) return (HMODULE)11; /* invalid exe */
pData += ne_header.entry_tab_length;
/* Get the non-resident names table */
@ -530,11 +561,11 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
{
pModule->nrname_handle = GLOBAL_Alloc( 0, ne_header.nrname_tab_length,
hModule, FALSE, FALSE, FALSE );
if (!pModule->nrname_handle) return 11; /* invalid exe */
if (!pModule->nrname_handle) return (HMODULE)11; /* invalid exe */
buffer = GlobalLock( pModule->nrname_handle );
lseek( fd, ne_header.nrname_tab_offset, SEEK_SET );
if (read( fd, buffer, ne_header.nrname_tab_length )
!= ne_header.nrname_tab_length) return 11; /* invalid exe */
!= ne_header.nrname_tab_length) return (HMODULE)11; /* invalid exe */
}
else pModule->nrname_handle = 0;
@ -545,7 +576,7 @@ HMODULE MODULE_LoadExeHeader( int fd, OFSTRUCT *ofs )
pModule->dlls_to_init = GLOBAL_Alloc(GMEM_ZEROINIT,
(pModule->modref_count+1)*sizeof(HMODULE),
hModule, FALSE, FALSE, FALSE );
if (!pModule->dlls_to_init) return 11; /* invalid exe */
if (!pModule->dlls_to_init) return (HMODULE)11; /* invalid exe */
}
else pModule->dlls_to_init = 0;
@ -569,7 +600,7 @@ WORD MODULE_GetOrdinal( HMODULE hModule, char *name )
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
dprintf_module( stddeb, "MODULE_GetOrdinal(%04x,'%s')\n",
dprintf_module( stddeb, "MODULE_GetOrdinal("NPFMT",'%s')\n",
hModule, name );
/* First handle names of the form '#xxxx' */
@ -817,10 +848,12 @@ static void MODULE_FreeModule( HMODULE hModule )
HMODULE *hPrevModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegment;
WORD *pModRef;
HMODULE *pModRef;
int i;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return; /* Can't free built-in module */
/* FIXME: should call the exit code for the library here */
@ -861,6 +894,8 @@ static void MODULE_FreeModule( HMODULE hModule )
}
HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params);
/**********************************************************************
* LoadModule (KERNEL.45)
*/
@ -870,16 +905,30 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
HANDLE hInstance, hPrevInstance;
NE_MODULE *pModule;
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
#ifndef WINELIB /* JBP: Disabled for now in winelib.a */
WORD *pModRef, *pDLLs;
int i, fd;
hModule = MODULE_FindModule( name );
if (!hModule) /* We have to load the module */
{
OFSTRUCT ofs;
/* Try to load the built-in first if not disabled */
if ((hModule = MODULE_LoadBuiltin( name, FALSE ))) return hModule;
if (strchr( name, '/' )) name = DOS_GetDosFileName( name );
if ((fd = OpenFile( name, &ofs, OF_READ )) == -1)
{
/* Now try the built-in even if disabled */
if ((hModule = MODULE_LoadBuiltin( name, TRUE )))
{
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return hModule;
}
return 2; /* File not found */
}
/* Create the module structure */
@ -996,6 +1045,10 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
/* the module, even if it contains circular DLL references */
pModule->count = 1;
/* Clear built-in flag in case it was set in the EXE file */
pModule->flags &= ~NE_FFLAGS_BUILTIN;
}
else
{
@ -1006,6 +1059,14 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
NE_LoadSegment( hModule, pModule->dgroup );
pModule->count++;
}
#else
hModule = GlobalAlloc( GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof(NE_MODULE) );
pModule = (NE_MODULE *)GlobalLock( hModule );
pModule->count = 1;
pModule->magic = 0x454e;
hPrevInstance = 0;
hInstance = MODULE_CreateInstance( hModule, (LOADPARAMS*)paramBlock );
#endif /* WINELIB */
/* Create a task for this instance */
@ -1043,7 +1104,11 @@ BOOL FreeModule( HANDLE hModule )
*/
HMODULE WIN16_GetModuleHandle( SEGPTR name )
{
#ifdef WINELIB32
if (HIWORD(name) == 0) return GetExePtr( name );
#else
if (HIWORD(name) == 0) return GetExePtr( LOWORD(name) );
#endif
return MODULE_FindModule( PTR_SEG_TO_LIN(name) );
}
@ -1062,7 +1127,7 @@ int GetModuleUsage( HANDLE hModule )
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
dprintf_module( stddeb, "GetModuleUsage(%04x): returning %d\n",
dprintf_module( stddeb, "GetModuleUsage("NPFMT"): returning %d\n",
hModule, pModule->count );
return pModule->count;
}
@ -1099,14 +1164,14 @@ HANDLE LoadLibrary( LPCSTR libname )
if ((handle = MODULE_FindModule( libname )) != 0) return handle;
*/
handle = LoadModule( libname, (LPVOID)-1 );
if (handle == 2) /* file not found */
if (handle == (HANDLE)2) /* file not found */
{
char buffer[256];
strcpy( buffer, libname );
strcat( buffer, ".dll" );
handle = LoadModule( buffer, (LPVOID)-1 );
}
if (handle >= 32) NE_InitializeDLLs( GetExePtr(handle) );
if (handle >= (HANDLE)32) NE_InitializeDLLs( GetExePtr(handle) );
return handle;
}
@ -1116,7 +1181,7 @@ HANDLE LoadLibrary( LPCSTR libname )
*/
void FreeLibrary( HANDLE handle )
{
dprintf_module( stddeb,"FreeLibrary: %04x\n", handle );
dprintf_module( stddeb,"FreeLibrary: "NPFMT"\n", handle );
FreeModule( handle );
}
@ -1157,12 +1222,12 @@ HANDLE WinExec( LPSTR lpCmdLine, WORD nCmdShow )
/* Now load the executable file */
params.hEnvironment = SELECTOROF( GetDOSEnvironment() );
params.cmdLine = WIN16_GlobalLock( cmdLineHandle );
params.showCmd = WIN16_GlobalLock( cmdShowHandle );
params.hEnvironment = (HANDLE)SELECTOROF( GetDOSEnvironment() );
params.cmdLine = (SEGPTR)WIN16_GlobalLock( cmdLineHandle );
params.showCmd = (SEGPTR)WIN16_GlobalLock( cmdShowHandle );
params.reserved = 0;
handle = LoadModule( filename, &params );
if (handle == 2) /* file not found */
if (handle == (HANDLE)2) /* file not found */
{
strcat( filename, ".exe" );
handle = LoadModule( filename, &params );
@ -1170,6 +1235,7 @@ HANDLE WinExec( LPSTR lpCmdLine, WORD nCmdShow )
GlobalFree( cmdShowHandle );
GlobalFree( cmdLineHandle );
Yield(); /* program is executed immediatly ....needed for word */
return handle;
}
@ -1188,13 +1254,13 @@ FARPROC GetProcAddress( HANDLE hModule, SEGPTR name )
if (HIWORD(name) != 0)
{
ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
dprintf_module( stddeb, "GetProcAddress: %04x '%s'\n",
dprintf_module( stddeb, "GetProcAddress: "NPFMT" '%s'\n",
hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
}
else
{
ordinal = LOWORD(name);
dprintf_module( stddeb, "GetProcAddress: %04x %04x\n",
dprintf_module( stddeb, "GetProcAddress: "NPFMT" %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC)0;
@ -1206,6 +1272,7 @@ FARPROC GetProcAddress( HANDLE hModule, SEGPTR name )
}
#ifndef WINELIB
/***********************************************************************
* GetWndProcEntry16 (not a Windows API function)
*
@ -1220,6 +1287,7 @@ WNDPROC GetWndProcEntry16( char *name )
ordinal = MODULE_GetOrdinal( hModule, name );
return MODULE_GetEntryPoint( hModule, ordinal );
}
#endif
/**********************************************************************

View File

@ -34,7 +34,8 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable, *pSeg;
WORD *pModuleTable;
WORD count, i, module, offset;
WORD count, i, offset;
HMODULE module;
DWORD address;
int fd;
struct relocation_entry_s *rep, *reloc_entries;
@ -54,12 +55,13 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
if (!pSeg->filepos) return TRUE; /* No file image, just return */
fd = MODULE_OpenFile( hModule );
dprintf_module( stddeb, "Loading segment %d, selector=%04x\n",
dprintf_module( stddeb, "Loading segment %d, selector="NPFMT"\n",
segnum, pSeg->selector );
lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
size = pSeg->size ? pSeg->size : 0x10000;
mem = GlobalLock(pSeg->selector);
if (pModule->flags & NE_FFLAGS_SELFLOAD && segnum > 1) {
#ifndef WINELIB
/* Implement self loading segments */
SELFLOADHEADER *selfloadheader;
WORD oldss, oldsp, oldselector, newselector;
@ -92,6 +94,9 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
IF1632_Saved16_ss = oldss;
IF1632_Saved16_sp = oldsp;
#else
fprintf(stderr,"JBP: Ignoring self loading segments in NE_LoadSegment.\n");
#endif
}
else if (!(pSeg->flags & NE_SEGFLAGS_ITERATED))
read(fd, mem, size);
@ -126,7 +131,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
read( fd, &count, sizeof(count) );
if (!count) return TRUE;
dprintf_fixup( stddeb, "Fixups for %*.*s, segment %d, selector %04x\n",
dprintf_fixup( stddeb, "Fixups for %*.*s, segment %d, selector "NPFMT"\n",
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
@ -165,7 +170,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
{
NE_MODULE *pTarget = (NE_MODULE *)GlobalLock( module );
if (!pTarget)
fprintf( stderr, "Module not found: %04x, reference %d of module %*.*s\n",
fprintf( stderr, "Module not found: "NPFMT", reference %d of module %*.*s\n",
module, rep->target1,
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
@ -266,7 +271,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
case NE_RADDR_LOWBYTE:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x BYTE%s\n",
dprintf_fixup(stddeb," "NPFMT":%04x:%04x BYTE%s\n",
pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp;
if(additive)
@ -280,7 +285,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
case NE_RADDR_OFFSET16:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x OFFSET16%s\n",
dprintf_fixup(stddeb," "NPFMT":%04x:%04x OFFSET16%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
@ -292,7 +297,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
case NE_RADDR_POINTER32:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x POINTER32%s\n",
dprintf_fixup(stddeb," "NPFMT":%04x:%04x POINTER32%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
@ -305,7 +310,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
case NE_RADDR_SELECTOR:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x SELECTOR%s\n",
dprintf_fixup(stddeb," "NPFMT":%04x:%04x SELECTOR%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = HIWORD(address);
@ -434,6 +439,7 @@ void NE_FixupPrologs( HMODULE hModule )
*/
static BOOL NE_InitDLL( HMODULE hModule )
{
#ifndef WINELIB
int cs_reg, ds_reg, ip_reg, cx_reg, di_reg, bp_reg;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
@ -482,6 +488,10 @@ static BOOL NE_InitDLL( HMODULE hModule )
return CallTo16_regs_( (FARPROC)(cs_reg << 16 | ip_reg), ds_reg,
0 /*es*/, 0 /*bp*/, 0 /*ax*/, 0 /*bx*/,
cx_reg, 0 /*dx*/, 0 /*si*/, di_reg );
#else
fprintf( stderr,"JBP: Ignoring call to LibMain\n" );
return FALSE;
#endif
}
@ -493,14 +503,14 @@ static BOOL NE_InitDLL( HMODULE hModule )
void NE_InitializeDLLs( HMODULE hModule )
{
NE_MODULE *pModule;
WORD *pDLL;
HMODULE *pDLL;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (pModule->dlls_to_init)
{
HANDLE to_init = pModule->dlls_to_init;
pModule->dlls_to_init = 0;
for (pDLL = (WORD *)GlobalLock( to_init ); *pDLL; pDLL++)
for (pDLL = (HMODULE *)GlobalLock( to_init ); *pDLL; pDLL++)
{
NE_InitializeDLLs( *pDLL );
NE_InitDLL( *pDLL );

View File

@ -54,7 +54,8 @@ static DWORD NE_FindNameTableId( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
{
dprintf_resource( stddeb, "NameTable entry: type=%04x id=%04x\n",
pTypeInfo->type_id, pNameInfo->id );
handle = LoadResource( hModule, (int)pNameInfo - (int)pModule );
handle = LoadResource( hModule,
(HANDLE)((int)pNameInfo - (int)pModule) );
for(p = (WORD*)LockResource(handle); *p; p = (WORD *)((char*)p+*p))
{
dprintf_resource( stddeb," type=%04x '%s' id=%04x '%s'\n",
@ -118,14 +119,15 @@ static HRSRC NE_FindResourceFromType( NE_MODULE *pModule,
if (pNameInfo->id & 0x8000) continue;
p = (BYTE *)pModule + pModule->res_table + pNameInfo->id;
if ((*p == len) && !strncasecmp( p+1, str, len ))
return (int)pNameInfo - (int)pModule;
return (HRSRC)((int)pNameInfo - (int)pModule);
}
}
else /* Numeric resource id */
{
WORD id = LOWORD(resId) | 0x8000;
for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
if (pNameInfo->id == id) return (int)pNameInfo - (int)pModule;
if (pNameInfo->id == id)
return (HRSRC)((int)pNameInfo - (int)pModule);
}
return 0;
}
@ -219,13 +221,15 @@ HRSRC NE_FindResource( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
HGLOBAL NE_AllocResource( HMODULE hModule, HRSRC hRsrc, DWORD size )
{
NE_MODULE *pModule;
NE_NAMEINFO *pNameInfo;
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule || !pModule->res_table) return 0;
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
#ifndef WINELIB
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
#endif
if (size < (DWORD)pNameInfo->length << sizeShift)
size = (DWORD)pNameInfo->length << sizeShift;
return GLOBAL_Alloc( GMEM_FIXED, size, hModule, FALSE, FALSE, FALSE );
@ -238,14 +242,16 @@ HGLOBAL NE_AllocResource( HMODULE hModule, HRSRC hRsrc, DWORD size )
int NE_AccessResource( HMODULE hModule, HRSRC hRsrc )
{
NE_MODULE *pModule;
NE_NAMEINFO *pNameInfo;
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
char *name;
int fd;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule || !pModule->res_table) return 0;
#ifndef WINELIB
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
#endif
name = ((LOADEDFILEINFO*)((char*)pModule + pModule->fileinfo))->filename;
fd = open( DOS_GetUnixFileName(name), O_RDONLY );
@ -261,13 +267,15 @@ int NE_AccessResource( HMODULE hModule, HRSRC hRsrc )
DWORD NE_SizeofResource( HMODULE hModule, HRSRC hRsrc )
{
NE_MODULE *pModule;
NE_NAMEINFO *pNameInfo;
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule || !pModule->res_table) return 0;
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
#ifndef WINELIB
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
#endif
return (DWORD)pNameInfo->length << sizeShift;
}
@ -278,13 +286,15 @@ DWORD NE_SizeofResource( HMODULE hModule, HRSRC hRsrc )
HGLOBAL NE_LoadResource( HMODULE hModule, HRSRC hRsrc )
{
NE_MODULE *pModule;
NE_NAMEINFO *pNameInfo;
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
int fd;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule || !pModule->res_table) return 0;
#ifndef WINELIB
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
#endif
if (pNameInfo->handle)
{
pNameInfo->usage++;
@ -313,7 +323,7 @@ SEGPTR NE_LockResource( HMODULE hModule, HGLOBAL handle )
{
/* May need to reload the resource if discarded */
return WIN16_GlobalLock( handle );
return (SEGPTR)WIN16_GlobalLock( handle );
}
@ -349,6 +359,6 @@ BOOL NE_FreeResource( HMODULE hModule, HGLOBAL handle )
}
pTypeInfo = (NE_TYPEINFO *)pNameInfo;
}
fprintf( stderr, "FreeResource: %04x %04x not found!\n", hModule, handle );
fprintf( stderr, "FreeResource: "NPFMT" "NPFMT" not found!\n", hModule, handle );
return FALSE;
}

View File

@ -25,7 +25,7 @@
#include "task.h"
#include "ldt.h"
#include "registers.h"
#include "selectors.h"
#include "stddebug.h"
#include "debug.h"
@ -54,7 +54,11 @@ char * xmmap(char * vaddr, unsigned int v_size, unsigned int r_size,
if(r_size)
v_size=r_size;
else
#ifdef __svr4__
fprintf(stderr,"xmmap: %s line %d doesn't support MAP_ANON\n",__FILE__, __LINE__);
#else
flags |= MAP_ANON;
#endif
result = mmap(vaddr, v_size, prot, flags, fd, file_offset);
if((unsigned int) result != 0xffffffff) return result;
@ -131,7 +135,11 @@ void fixup_imports(struct PE_Import_Directory *pe_imports)
exit(0);
}
printf("--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
*thunk_list=RELAY32_GetEntryPoint(Module,pe_name->Name,pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
*thunk_list=(unsigned int)RELAY32_GetEntryPoint(Module,pe_name->Name,pe_name->Hint);
#else
fprintf(stderr,"JBP: Call to RELAY32_GetEntryPoint being ignored.\n");
#endif
if(!*thunk_list)
{
fprintf(stderr,"No implementation for %s.%d\n",Module, pe_name->Hint);
@ -197,12 +205,12 @@ HINSTANCE PE_LoadImage(struct w_files *wpnt)
for(i=0; i < wpnt->pe->pe_header->coff.NumberOfSections; i++)
{
if(!load_addr) {
result = xmmap((char *)0, wpnt->pe->pe_seg[i].Virtual_Size,
result = (int)xmmap((char *)0, wpnt->pe->pe_seg[i].Virtual_Size,
wpnt->pe->pe_seg[i].Size_Of_Raw_Data, 7,
MAP_PRIVATE, wpnt->fd, wpnt->pe->pe_seg[i].PointerToRawData);
load_addr = (unsigned int) result - wpnt->pe->pe_seg[i].Virtual_Address;
} else {
result = xmmap((char *) load_addr + wpnt->pe->pe_seg[i].Virtual_Address,
result = (int)xmmap((char *) load_addr + wpnt->pe->pe_seg[i].Virtual_Address,
wpnt->pe->pe_seg[i].Virtual_Size,
wpnt->pe->pe_seg[i].Size_Of_Raw_Data, 7, MAP_PRIVATE | MAP_FIXED,
wpnt->fd, wpnt->pe->pe_seg[i].PointerToRawData);
@ -232,10 +240,13 @@ HINSTANCE PE_LoadImage(struct w_files *wpnt)
if(wpnt->pe->pe_import) fixup_imports(wpnt->pe->pe_import);
if(wpnt->pe->pe_export) dump_exports(wpnt->pe->pe_export);
wpnt->hinstance = 0x8000;
wpnt->hinstance = (HINSTANCE)0x8000;
return (wpnt->hinstance);
}
HINSTANCE MODULE_CreateInstance(HMODULE hModule,LOADPARAMS *params);
void InitTask(struct sigcontext_struct context);
HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params)
{
struct w_files *wpnt;
@ -275,11 +286,11 @@ HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params)
hModule = GlobalAlloc( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
wpnt->hModule=hModule;
if (!hModule) return 11; /* invalid exe */
if (!hModule) return (HINSTANCE)11; /* invalid exe */
FarSetOwner( hModule, hModule );
pModule = GlobalLock(hModule);
pModule = (NE_MODULE*)GlobalLock(hModule);
/* Set all used entries */
pModule->magic=NE_SIGNATURE;
@ -312,9 +323,14 @@ HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params)
pSegment->minsize=0x1000;
pSegment++;
cts=GetWndProcEntry16("Win32CallToStart");
cts=(DWORD)GetWndProcEntry16("Win32CallToStart");
#ifdef WINELIB32
pSegment->selector=(void*)cts;
pModule->ip=0;
#else
pSegment->selector=cts>>16;
pModule->ip=cts & 0xFFFF;
#endif
pSegment++;
pStr=(char*)pSegment;
@ -332,7 +348,7 @@ HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params)
pModule->stack_size=0xE000;
/* CreateInstance allocates now 64KB */
hInstance=MODULE_CreateInstance(hModule);
hInstance=MODULE_CreateInstance(hModule,NULL /* FIX: NULL? really? */);
wpnt->hinstance=hInstance;
TASK_CreateTask(hModule,hInstance,0,
@ -342,11 +358,13 @@ HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params)
return hInstance;
}
int USER_InitApp(HINSTANCE hInstance);
void PE_Win32CallToStart(struct sigcontext_struct context)
{
int fs;
struct w_files *wpnt=wine_files;
fs=GlobalAlloc(GHND,0x10000);
fs=(int)GlobalAlloc(GHND,0x10000);
fprintf(stddeb,"Going to start Win32 program\n");
InitTask(context);
USER_InitApp(wpnt->hModule);

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