Commit 234bc24d authored by Alexandre Julliard's avatar Alexandre Julliard

Release 941210

Wed Dec 7 14:52:25 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [controls/listbox.c] Fixed problems due to new scroll-bar code. * [loader/signal.c] [miscemu/ioports.c] Handle I/O opcodes that use an absolute address. * [objects/text.c] Implemented TabbedTextOut(). Sat Dec 3 18:53:08 1994 Kenneth MacDonald <K.MacDonald@ed.ac.uk> * [objects/metafile.c] Implemented GetMetafile(). Fixed bug in PlayMetaFile() when reading disc based metafile records. Added META_POLYPOLYGON, META_DELETEOBJECT and META_EOF to PlayMetaFileRecord(). Wed Nov 30 06:32:25 1994 Martin von Loewis (martin@cs.csufresno.edu) * [Imakefile] wine.sym: Remove gcc2_compiled and friends * [controls/listbox.c][if1632/relay.c][if1632/relay.c] [loader/resource.c][memory/heap.c][objects/dib.c][windows/dialog.c] Replace #ifdef DEBUG_XXX with if(debugging_xxx){ * [if1632/call.S] CallToLibMain: New function * [if1632/relay.c][include/options.h][misc/main.c] [miscemu/int1a.c][miscemu/int21.c][miscemu/kernel.c] removed Options.relay_debug * [include/heap.h] HEAP_OWNER: Use ds instead of cs:ip * [loader/ne_image.c] LoadNEImage: Remember current exe, handle nodata dlls InitNEDLL: handle nodata dlls, call CallToLibMain * [loader/selector.c] CreateSelectors: Initialize auto_data_sel with 0 * [memory/heap.c] HEAP_CheckHeap: Check prev HEAP_CheckLocalHeaps: new function * [misc/profile] Remember and dump only changed profiles * [tools/makedebug] Introduce debugging_xxx flags Sun Nov 27 23:13:22 MET 1994 <erik@xs4all.nl> * [clipboard.h color.h dc.h dos_fs.h event.h font.h graphics.h if1632.h kernel.h library.h miscemu.h ne_image.h nonclient.h pe_image.h selectors.h wintypes.h] Added. * [*/*] - Commented all 'static char copyright statements', see misc/main.c - moved prototypes to headers files, fixed wrong prototypes. - *please* add a header file for each .c if you need to export things. * [misc/main.c] Added one static string which list the names of the contributors. Fri Nov 25 16:24:27 MET 1994 Dag Asheim (dash@ifi.uio.no) * [Configure] Made the support for multiple languages more automatic. Added a [fonts] section to the wine.conf file. Made the defaults better. Generally cleaned it up. * [rc/sysres_No.rc] [rc/sysres_De.rc] [rc/sysres.c] Norwegian resources and small fixes to the german resources. Wed Nov 23 20:28:59 1994 Martin von Loewis (martin@cs.csufresno.edu) * [debugger/break.c] bark(), toggle_next(), should_continue(): New functions insert_break(): Fixed, adds write access to page before writing wine_bp.next_addr: new structure field * [debugger/dbg.y] Changed symbol's value to be it's value instead of the value pointed to by the symbol. Changed SIGTRAP handling to allow continuation after break point * [misc/shell.c] ShellAbout(): Load resource from memory
parent ecc3712d
----------------------------------------------------------------------
Wed Dec 7 14:52:25 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/listbox.c]
Fixed problems due to new scroll-bar code.
* [loader/signal.c] [miscemu/ioports.c]
Handle I/O opcodes that use an absolute address.
* [objects/text.c]
Implemented TabbedTextOut().
Sat Dec 3 18:53:08 1994 Kenneth MacDonald <K.MacDonald@ed.ac.uk>
* [objects/metafile.c]
Implemented GetMetafile().
Fixed bug in PlayMetaFile() when reading disc based metafile records.
Added META_POLYPOLYGON, META_DELETEOBJECT and META_EOF to
PlayMetaFileRecord().
Wed Nov 30 06:32:25 1994 Martin von Loewis (martin@cs.csufresno.edu)
* [Imakefile]
wine.sym: Remove gcc2_compiled and friends
* [controls/listbox.c][if1632/relay.c][if1632/relay.c]
[loader/resource.c][memory/heap.c][objects/dib.c][windows/dialog.c]
Replace #ifdef DEBUG_XXX with if(debugging_xxx){
* [if1632/call.S]
CallToLibMain: New function
* [if1632/relay.c][include/options.h][misc/main.c]
[miscemu/int1a.c][miscemu/int21.c][miscemu/kernel.c]
removed Options.relay_debug
* [include/heap.h]
HEAP_OWNER: Use ds instead of cs:ip
* [loader/ne_image.c]
LoadNEImage: Remember current exe, handle nodata dlls
InitNEDLL: handle nodata dlls, call CallToLibMain
* [loader/selector.c]
CreateSelectors: Initialize auto_data_sel with 0
* [memory/heap.c]
HEAP_CheckHeap: Check prev
HEAP_CheckLocalHeaps: new function
* [misc/profile]
Remember and dump only changed profiles
* [tools/makedebug]
Introduce debugging_xxx flags
Sun Nov 27 23:13:22 MET 1994 <erik@xs4all.nl>
* [clipboard.h color.h dc.h dos_fs.h event.h font.h graphics.h
if1632.h kernel.h library.h miscemu.h ne_image.h nonclient.h
pe_image.h selectors.h wintypes.h]
Added.
* [*/*]
- Commented all 'static char copyright statements', see misc/main.c
- moved prototypes to headers files, fixed wrong prototypes.
- *please* add a header file for each .c if you need to export
things.
* [misc/main.c]
Added one static string which list the names of the contributors.
Fri Nov 25 16:24:27 MET 1994 Dag Asheim (dash@ifi.uio.no)
* [Configure]
Made the support for multiple languages more automatic. Added
a [fonts] section to the wine.conf file. Made the defaults
better. Generally cleaned it up.
* [rc/sysres_No.rc] [rc/sysres_De.rc] [rc/sysres.c]
Norwegian resources and small fixes to the german resources.
Wed Nov 23 20:28:59 1994 Martin von Loewis (martin@cs.csufresno.edu)
* [debugger/break.c]
bark(), toggle_next(), should_continue(): New functions
insert_break(): Fixed, adds write access to page before writing
wine_bp.next_addr: new structure field
* [debugger/dbg.y]
Changed symbol's value to be it's value instead of the value
pointed to by the symbol.
Changed SIGTRAP handling to allow continuation after break point
* [misc/shell.c]
ShellAbout(): Load resource from memory
----------------------------------------------------------------------
Sun Nov 20 18:30:06 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/scroll.c] [include/scroll.h]
......
......@@ -5,9 +5,14 @@
: ${EDITOR:=vi}
: ${PAGER:=more}
WINELIB=''
SHORTNAMES=''
XPM=''
LANG=not_matching
NEWBUILD=''
ALLDEFINES=''
# Ask question 'str' and sets 'var' reply (defaulting to 'def' on CR)
# Ask question 'str' and set 'var' to reply (defaulting to 'def' on CR)
prompt ()
{
str="$1"
......@@ -30,29 +35,6 @@ if [ "$input" = 'l' -o "$input" = 'L' ]
then
WINELIB='#define WINELIB -DWINELIB'
ALLDEFINES="$ALLDEFINES -DWINELIB"
else
WINELIB=''
# Commented out until the processor emulator starts to work.
#
# echo
# echo -n 'Use processor emulator (*DOES*NOT*WORK*YET*) (Y/N) [N]? '
# read input
# if [ "$input" = 'y' -o "$input" = 'Y' ]
# then
# PROCEMU='#define PROCEMU'
# ALLDEFINES="$ALLDEFINES -DPROCEMU"
# echo
# echo -n 'bochs directory [/usr/src/bochs]? '
# read input
# if [ "$input" = '' ]
# then
# ALLDEFINES="$ALLDEFINES -DPROC_EMU_DIR=/usr/src/bochs"
# else
# ALLDEFINES="$ALLDEFINES -DPROC_EMU_DIR="$input
# fi
# fi
fi
echo
......@@ -62,8 +44,6 @@ if [ "$input" = 'y' -o "$input" = 'Y' ]
then
SHORTNAMES='#define ShortNames -DSHORTNAMES'
ALLDEFINES="$ALLDEFINES -DSHORTNAMES"
else
SHORTNAMES=''
fi
echo
......@@ -73,13 +53,32 @@ if [ "$input" = 'y' -o "$input" = 'Y' ]
then
XPM='#define USE_XPM'
ALLDEFINES="$ALLDEFINES -DUSE_XPM"
else
XPM=''
fi
prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
LANGS=`echo En rc/sysres_*.rc | sed -e 's/rc\/sysres_//g' -e 's/\.rc//g' -e 's/ /\//g;'`
while expr "$LANGS" : ".*$LANG" == 0 > /dev/null
do
prompt "Language ($LANGS)" LANG En
if expr "$LANGS" : ".*$LANG" == 0 > /dev/null
then
echo "\"$LANG\" is not a supported language."
fi
done
ALLDEFINES="$ALLDEFINES -ALANG\($LANG\)"
WINE_INI_GLOBAL='#define WINE_INI_GLOBAL "'$WINE_CONFIGFILE'"'
if [ "`(domainname)`" = 'amscons.com' ]
then
echo
echo -n 'New build program (Y/N) [N]? '
read input
if [ "$input" = 'y' -o "$input" = 'Y' ]
then
NEWBUILD='#define NewBuild -DNEWBUILD'
ALLDEFINES="$ALLDEFINES -DNEWBUILD"
fi
fi
prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
if [ -r $WINE_CONFIGFILE ]
then
......@@ -108,18 +107,22 @@ then
fi
fi
case `awk 'BEGIN {s=0} {if ($3=="msdos") s++} END {print s}' /etc/fstab` in
0) CF_C=/c;;
1) CF_C=`awk '{if ($3=="msdos") print $2}' /etc/fstab`;;
*) CF_C=`awk '{if ($3=="msdos") {print $2;exit}}' /etc/fstab`;;
esac
prompt "Which directory do you want to use as A:" CF_A /a
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'
prompt "Where should Windows apps store temp files" CF_Temp 'c:\temp'
prompt "Which path should be used to find executables and DLL's" CF_Path 'c:\windows;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 sysres.dll" CF_SystemResources `pwd`/sysres.dll
prompt "Where is COM1" CF_Com1 '/dev/cua0'
prompt "Where is COM2" CF_Com2 '/dev/cua1'
......@@ -135,9 +138,7 @@ Here is the list of messages:\
prompt "Exclude which messages from the log" CF_Exclude 'WM_SIZE;WM_TIMER'
echo
echo "The config file $WINE_CONFIGFILE now looks like this:"
tee $WINE_CONFIGFILE << EOF
cat > $WINE_CONFIGFILE << EOF
[drives]
A=$CF_A
C=$CF_C
......@@ -149,6 +150,16 @@ 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
......@@ -162,6 +173,12 @@ 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' ]
......@@ -175,23 +192,6 @@ else
fi
fi
prompt "Language (En/De)" LANG En
ALLDEFINES="$ALLDEFINES -ALANG\($LANG\)"
NEWBUILD=''
if [ "`(domainname)`" = 'amscons.com' ]
then
echo
echo -n 'New build program (Y/N) [N]? '
read input
if [ "$input" = 'y' -o "$input" = 'Y' ]
then
NEWBUILD='#define NewBuild -DNEWBUILD'
ALLDEFINES="$ALLDEFINES -DNEWBUILD"
fi
fi
NEWLINUXLDT=''
if grep -s seg_not_present /usr/include/linux/ldt.h 2> /dev/null
then
ALLDEFINES="$ALLDEFINES -DNEW_LDT_STRUCT"
......@@ -203,12 +203,12 @@ $WINELIB
$SHORTNAMES
$XPM
$NEWBUILD
$WINE_INI_GLOBAL
$ENDIAN
$PROCEMUDIR
#define WINE_INI_GLOBAL "$WINE_CONFIGFILE"
#define AutoDefines $ALLDEFINES
EOF
echo
echo "Creating Makefiles. This may take a while."
xmkmf -a
if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
......@@ -223,5 +223,8 @@ List of "*.rej" files:
EOF
find . -name "*.rej" -print
echo
exit 1
fi
echo
echo "Configure finished. Do 'make' to compile Wine."
......@@ -107,6 +107,19 @@ a specific type of message in just one c-source-file, put the corresponding
#define DEBUG_XXXX or #undefine DEBUG_XXXX between #include<stddebug.h> and
#include <debug.h> in that specific file. In addition you can change the
types of displayed messages by supplying the "-debugmsg" option to Wine.
If your debugging code is more complex than just printf, you can use the
symbols debugging_XXX as well. These are true when XXX is enabled, either
permanent or in the command line. So instead of writing
#ifdef DEBUG_WIN
DumpSomeStructure(&str);
#endif
write
if(debugging_win)DumpSomeStructure(&str);
Don't worry about the inefficiency of the test. If it is permanently
disabled (thus debugging_win is 0 at compile time), the compiler will
eliminate the dead code.
The file handle "stddeb" is intended for displaying standard informational
messages, whereas "stdnimp" is intended for displaying messages concerning
......
......@@ -106,7 +106,7 @@ NormalLibraryTarget(wine,$(LIBOBJS) $(COMMONOBJS))
#endif
wine.sym: wine
nm wine|sort >wine.sym
nm wine|grep -v _compiled|sort >wine.sym
clean::
$(RM) wine.sym
......
......@@ -3,23 +3,17 @@
* Copyright (C) 1993 Johannes Ruscheinski
* Copyright (C) 1993 David Metcalfe
* Copyright (C) 1994 Alexandre Julliard
*/
static char Copyright1[] = "Copyright Johannes Ruscheinski, 1993";
static char Copyright2[] = "Copyright David Metcalfe, 1993";
static char Copyright3[] = "Copyright Alexandre Julliard, 1994";
*/
#include "button.h"
#include "win.h"
#include "user.h"
#include "syscolor.h"
/* windows/graphics.c */
extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size,
int shadow_size, BOOL pressed );
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height, int rop );
#include "graphics.h"
#include "button.h"
extern void DEFWND_SetText( HWND hwnd, LPSTR text ); /* windows/defwnd.c */
......
......@@ -3,9 +3,8 @@
*
* Copyright Martin Ayotte, 1993
*
*/
static char Copyright[] = "Copyright Martin Ayotte, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
......@@ -20,15 +19,8 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "prototypes.h"
#include "stddebug.h"
/* #define DEBUG_COMBO */
/* #undef DEBUG_COMBO */
#include "debug.h"
/* windows/graphics.c */
extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size,
int shadow_size, BOOL pressed );
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height, int rop );
#include "graphics.h"
HBITMAP hComboBit = 0;
......
......@@ -2,9 +2,9 @@
* Desktop window class.
*
* Copyright 1994 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
*/
#include <fcntl.h>
#include <stdio.h>
......@@ -13,11 +13,8 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include <unistd.h>
#include "win.h"
#include "desktop.h"
#include "prototypes.h"
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height,
int rop ); /* graphics.c */
#include "dos_fs.h"
#include "graphics.h"
/***********************************************************************
* DESKTOP_LoadBitmap
......@@ -35,7 +32,7 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, char *filename )
/* Read all the file into memory */
if (!(unixFileName = GetUnixFileName( filename ))) return 0;
if (!(unixFileName = DOS_GetUnixFileName( filename ))) return 0;
if ((file = open( unixFileName, O_RDONLY )) == -1) return 0;
size = lseek( file, 0, SEEK_END );
if (!(buffer = (char *)malloc( size )))
......@@ -151,7 +148,7 @@ LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam )
/***********************************************************************
* SetDeskPattern (USER.279)
*/
BOOL SetDeskPattern()
BOOL SetDeskPattern(void)
{
char buffer[100];
GetProfileString( "desktop", "Pattern", "(None)", buffer, 100 );
......
......@@ -4,9 +4,9 @@
* Copyright David W. Metcalfe, 1994
*
* Release 3, July 1994
*/
static char Copyright[] = "Copyright David W. Metcalfe, 1994";
*/
#include <stdio.h>
#include <stdlib.h>
......
......@@ -3,10 +3,8 @@
*
* Copyright Martin Ayotte, 1993
*
*/
static char Copyright[] = "Copyright Martin Ayotte, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
......@@ -17,12 +15,9 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "heap.h"
#include "win.h"
#include "msdos.h"
#include "wine.h"
#include "listbox.h"
#include "prototypes.h"
#include "dos_fs.h"
#include "stddebug.h"
/* #define DEBUG_LISTBOX */
/* #undef DEBUG_LISTBOX */
#include "debug.h"
#define GMEM_ZEROINIT 0x0040
......@@ -91,14 +86,8 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
lphl->hWndLogicParent = GetParent(hwnd);
lphl->hFont = GetStockObject(SYSTEM_FONT);
lphl->ColumnsWidth = wndPtr->rectClient.right - wndPtr->rectClient.left;
if (wndPtr->dwStyle & WS_VSCROLL) {
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE);
ShowScrollBar(hwnd, SB_VERT, FALSE);
}
if (wndPtr->dwStyle & WS_HSCROLL) {
SetScrollRange(hwnd, SB_HORZ, 1, 1, TRUE);
ShowScrollBar(hwnd, SB_HORZ, FALSE);
}
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE);
SetScrollRange(hwnd, SB_HORZ, 1, 1, TRUE);
if ((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) == LBS_OWNERDRAWFIXED) {
}
return 0;
......@@ -242,7 +231,6 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
if (y < 4) {
if (lphl->FirstVisible > 1) {
lphl->FirstVisible--;
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
......@@ -253,7 +241,6 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
if (y > (rect.bottom - 4)) {
if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) {
lphl->FirstVisible++;
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
......@@ -287,12 +274,12 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
hWndCtl = GetNextDlgTabItem(lphl->hWndLogicParent,
hwnd, !(GetKeyState(VK_SHIFT) < 0));
SetFocus(hWndCtl);
#ifdef DEBUG_LISTBOX
if(debugging_listbox){
if ((GetKeyState(VK_SHIFT) < 0))
dprintf_listbox(stddeb,"ListBox PreviousDlgTabItem %04X !\n", hWndCtl);
else
dprintf_listbox(stddeb,"ListBox NextDlgTabItem %04X !\n", hWndCtl);
#endif
}
break;
case VK_HOME:
lphl->ItemFocused = 0;
......@@ -342,8 +329,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
SendMessage(lphl->hWndLogicParent, WM_COMMAND,
wndPtr->wIDmenu, MAKELONG(hwnd, LBN_SELCHANGE));
}
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
break;
......@@ -357,9 +343,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
if (wParam == 0) break;
break;
case WM_SETREDRAW:
#ifdef DEBUG_LISTBOX
printf("ListBox WM_SETREDRAW hWnd=%04X w=%04X !\n", hwnd, wParam);
#endif
dprintf_listbox(stddeb,"ListBox WM_SETREDRAW hWnd=%04X w=%04X !\n", hwnd, wParam);
lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr);
if (lphl == NULL) return 0;
lphl->bRedrawFlag = wParam;
......@@ -489,9 +473,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
wParam);
lphl = ListBoxGetStorageHeader(hwnd);
lphl->FirstVisible = wParam;
wndPtr = WIN_FindWndPtr(hwnd);
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
break;
......@@ -553,10 +535,6 @@ void StdDrawListBox(HWND hwnd)
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH);
GetClientRect(hwnd, &rect);
/*
if (wndPtr->dwStyle & WS_VSCROLL) rect.right -= 16;
if (wndPtr->dwStyle & WS_HSCROLL) rect.bottom -= 16;
*/
FillRect(hdc, &rect, hBrush);
maxwidth = rect.right;
rect.right = lphl->ColumnsWidth;
......@@ -608,13 +586,6 @@ void StdDrawListBox(HWND hwnd)
}
EndOfPaint:
EndPaint( hwnd, &ps );
if ((lphl->ItemsCount > lphl->ItemsVisible) &
(wndPtr->dwStyle & WS_VSCROLL)) {
/*
InvalidateRect(wndPtr->hWndVScroll, NULL, TRUE);
UpdateWindow(wndPtr->hWndVScroll);
*/
}
}
......@@ -644,8 +615,6 @@ void OwnerDrawListBox(HWND hwnd)
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH);
GetClientRect(hwnd, &rect);
if (wndPtr->dwStyle & WS_VSCROLL) rect.right -= 16;
if (wndPtr->dwStyle & WS_HSCROLL) rect.bottom -= 16;
FillRect(hdc, &rect, hBrush);
maxwidth = rect.right;
rect.right = lphl->ColumnsWidth;
......@@ -704,14 +673,6 @@ void OwnerDrawListBox(HWND hwnd)
}
EndOfPaint:
EndPaint( hwnd, &ps );
if ((lphl->ItemsCount > lphl->ItemsVisible) &
(wndPtr->dwStyle & WS_VSCROLL)) {
/*
InvalidateRect(wndPtr->hWndVScroll, NULL, TRUE);
UpdateWindow(wndPtr->hWndVScroll);
*/
}
}
......@@ -729,8 +690,6 @@ int ListBoxFindMouse(HWND hwnd, int X, int Y)
lpls = lphl->lpFirst;
if (lpls == NULL) return LB_ERR;
GetClientRect(hwnd, &rect);
if (wndPtr->dwStyle & WS_VSCROLL) rect.right -= 16;
if (wndPtr->dwStyle & WS_HSCROLL) rect.bottom -= 16;
h = w2 = 0;
w = lphl->ColumnsWidth;
for(i = 1; i <= lphl->ItemsCount; i++) {
......@@ -882,18 +841,12 @@ int ListBoxInsertString(HWND hwnd, UINT uIndex, LPSTR newstr)
if (((wndPtr->dwStyle & LBS_OWNERDRAWVARIABLE) == LBS_OWNERDRAWVARIABLE) ||
((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) == LBS_OWNERDRAWFIXED))
ListBoxAskMeasure(wndPtr, lphl, lplsnew);
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl),
(lphl->FirstVisible != 1 && lphl->bRedrawFlag));
if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0)
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl),
(lphl->FirstVisible != 1 && lphl->bRedrawFlag));
if (lphl->ItemsPerColumn != 0)
SetScrollRange(hwnd, SB_HORZ, 1, lphl->ItemsVisible /
lphl->ItemsPerColumn + 1,
(lphl->FirstVisible != 1 && lphl->bRedrawFlag));
if (((lphl->ItemsCount - lphl->FirstVisible) == lphl->ItemsVisible) &&
(lphl->ItemsVisible != 0)) {
if (wndPtr->dwStyle & WS_VSCROLL) ShowScrollBar(hwnd, SB_VERT, TRUE);
if (wndPtr->dwStyle & WS_HSCROLL) ShowScrollBar(hwnd, SB_HORZ, TRUE);
}
if ((lphl->FirstVisible <= uIndex) &&
((lphl->FirstVisible + lphl->ItemsVisible) >= uIndex)) {
InvalidateRect(hwnd, NULL, TRUE);
......@@ -977,17 +930,10 @@ int ListBoxDeleteString(HWND hwnd, UINT uIndex)
lphl->ItemsCount--;
if (lpls->hData != 0) LIST_HEAP_FREE(lphl, lpls->hData);
if (lpls->hMem != 0) LIST_HEAP_FREE(lphl, lpls->hMem);
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE);
if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0)
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE);
if (lphl->ItemsPerColumn != 0)
SetScrollRange(hwnd, SB_HORZ, 1, lphl->ItemsVisible /
lphl->ItemsPerColumn + 1, TRUE);
if (lphl->ItemsCount < lphl->ItemsVisible) {
if (wndPtr->dwStyle & WS_VSCROLL)
ShowScrollBar(hwnd, SB_VERT, FALSE);
if (wndPtr->dwStyle & WS_HSCROLL)
ShowScrollBar(hwnd, SB_HORZ, FALSE);
}
if ((lphl->FirstVisible <= uIndex) &&
((lphl->FirstVisible + lphl->ItemsVisible) >= uIndex)) {
InvalidateRect(hwnd, NULL, TRUE);
......@@ -1056,15 +1002,10 @@ int ListBoxResetContent(HWND hwnd)
if ((wndPtr->dwStyle && LBS_NOTIFY) != 0)
SendMessage(lphl->hWndLogicParent, WM_COMMAND,
wndPtr->wIDmenu, MAKELONG(hwnd, LBN_SELCHANGE));
if (wndPtr->dwStyle & WS_VSCROLL)
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE);
if ((wndPtr->dwStyle & WS_HSCROLL) && lphl->ItemsPerColumn != 0)
SetScrollRange(hwnd, SB_VERT, 1, ListMaxFirstVisible(lphl), TRUE);
if (lphl->ItemsPerColumn != 0)
SetScrollRange(hwnd, SB_HORZ, 1, lphl->ItemsVisible /
lphl->ItemsPerColumn + 1, TRUE);
if (wndPtr->dwStyle & WS_VSCROLL)
ShowScrollBar(hwnd, SB_VERT, FALSE);
if (wndPtr->dwStyle & WS_HSCROLL)
ShowScrollBar(hwnd, SB_HORZ, FALSE);
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
return TRUE;
......
/*
* Menus functions
*/
static char RCSId[] = "$Id$";
static char Copyright[] = "Copyright Martin Ayotte, 1993";
static char Copyright2[] = "Copyright Alexandre Julliard, 1994";
*/
/*
* Note: the style MF_MOUSESELECT is used to mark popup items that
......@@ -11,7 +11,6 @@ static char Copyright2[] = "Copyright Alexandre Julliard, 1994";
* This is probably not the meaning this style has in MS-Windows.
*/
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
......@@ -23,14 +22,13 @@ static char Copyright2[] = "Copyright Alexandre Julliard, 1994";
#include "menu.h"
#include "user.h"
#include "win.h"
#include "library.h"
#include "message.h"
#include "graphics.h"
#include "stddebug.h"
/* #define DEBUG_MENU */
/* #undef DEBUG_MENU */
/* #define DEBUG_MENUCALC */
/* #undef DEBUG_MENUCALC */
/* #define DEBUG_MENUSHORTCUT */
/* #undef DEBUG_MENUSHORTCUT */
#include "debug.h"
......@@ -60,12 +58,6 @@ static BOOL fEndMenuCalled = FALSE;
extern void NC_DrawSysButton(HWND hwnd, HDC hdc, BOOL down); /* nonclient.c */
extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height,
int rop ); /* graphics.c */
extern HINSTANCE hSysRes;
static HBITMAP hStdCheck = 0;
static HBITMAP hStdMnArrow = 0;
......
......@@ -2,13 +2,12 @@
* Interface code to SCROLLBAR widget
*
* Copyright Martin Ayotte, 1993
* Copyright Alexandre Julliard, 1994
*
* Small fixes and implemented SB_THUMBPOSITION
* by Peter Broadhurst, 940611
*/
static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
......@@ -18,10 +17,10 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "sysmetrics.h"
#include "scroll.h"
#include "user.h"
#include "graphics.h"
#include "win.h"
#include "stddebug.h"
/* #define DEBUG_SCROLL */
/* #undef DEBUG_SCROLL */
#include "debug.h"
......@@ -48,10 +47,6 @@ static HBITMAP hRgArrowI = 0;
(((flags)&ESB_DISABLE_RIGHT) ? hRgArrowI : ((pressed) ? hRgArrowD:hRgArrow))
/* windows/graphics.c */
extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size,
int shadow_size, BOOL pressed );
/* Minimum size of the rectangle between the arrows */
#define SCROLL_MIN_RECT 4
......@@ -805,7 +800,8 @@ void SetScrollRange(HWND hwnd, int nBar, int MinVal, int MaxVal, BOOL bRedraw)
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return;
dprintf_scroll( stddeb,"SetScrollRange min=%d max=%d\n", MinVal, MaxVal );
dprintf_scroll( stddeb,"SetScrollRange hwnd=%x bar=%d min=%d max=%d\n",
hwnd, nBar, MinVal, MaxVal );
/* Invalid range -> range is set to (0,0) */
if ((MinVal > MaxVal) || ((long)MaxVal - MinVal > 32767L))
......@@ -815,8 +811,8 @@ void SetScrollRange(HWND hwnd, int nBar, int MinVal, int MaxVal, BOOL bRedraw)
infoPtr->MinVal = MinVal;
infoPtr->MaxVal = MaxVal;
/* Non-client scroll-bar is hidden iff range is (0,0) */
if (nBar != SB_CTL) ShowScrollBar( hwnd, nBar, (MinVal || MaxVal) );
/* Non-client scroll-bar is hidden if min==max */
if (nBar != SB_CTL) ShowScrollBar( hwnd, nBar, (MinVal != MaxVal) );
if (bRedraw) SCROLL_RefreshScrollBar( hwnd, nBar );
}
......@@ -842,7 +838,7 @@ void ShowScrollBar( HWND hwnd, WORD wBar, BOOL fShow )
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return;
dprintf_scroll( stddeb, "ShowScrollBar: %x %d %d\n", hwnd, wBar, fShow );
dprintf_scroll( stddeb, "ShowScrollBar: hwnd=%x bar=%d on=%d\n", hwnd, wBar, fShow );
switch(wBar)
{
......
......@@ -3,9 +3,8 @@
*
* Copyright David W. Metcalfe, 1993
*
*/
static char Copyright[] = "Copyright David W. Metcalfe, 1993";
*/
#include <stdio.h>
#include <windows.h>
......@@ -98,10 +97,12 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
return DefWindowProc(hWnd, uMsg, wParam, lParam);
case WM_CREATE:
if (style < 0L || style > LAST_STATIC_TYPE) {
if (style < 0L || style > LAST_STATIC_TYPE)
{
fprintf( stderr, "STATIC: Unknown style 0x%02lx\n", style );
lResult = -1L;
break;
}
}
/* initialise colours */
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_background = GetSysColor(COLOR_BACKGROUND);
......@@ -116,11 +117,11 @@ LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_PAINT:
if (staticPaintFunc[style])
{
PAINTSTRUCT ps;
BeginPaint( hWnd, &ps );
(staticPaintFunc[style])( hWnd, ps.hdc );
if (staticPaintFunc[style])
(staticPaintFunc[style])( hWnd, ps.hdc );
EndPaint( hWnd, &ps );
}
break;
......
......@@ -2,9 +2,9 @@
* Windows widgets (built-in window classes)
*
* Copyright 1993 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
#include "win.h"
#include "button.h"
......
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#ifdef linux
#include <sys/utsname.h>
#endif
#include <windows.h>
#define N_BP 25
extern int dbg_mode;
struct wine_bp{
unsigned long addr;
unsigned long next_addr;
char in_use;
char enabled;
unsigned char databyte;
......@@ -13,13 +21,19 @@ struct wine_bp{
static struct wine_bp wbp[N_BP] = {{0,},};
void info_break()
static int current_bp = -1;
static int cont_mode=0; /* 0 - continuous execution
1 - advancing after breakpoint
2 - single step - not implemented
*/
void info_break(void)
{
int j;
fprintf(stderr,"Breakpoint status\n");
for(j=0; j<N_BP; j++)
if(wbp[j].in_use)
fprintf(stderr,"%d: %c %8.8x\n", j, (wbp[j].enabled ? 'y' : 'n'),
fprintf(stderr,"%d: %c %8lx\n", j, (wbp[j].enabled ? 'y' : 'n'),
wbp[j].addr);
}
......@@ -48,11 +62,34 @@ void add_break(unsigned long addr)
wbp[j].in_use = 1;
wbp[j].enabled = 1;
wbp[j].addr = addr;
wbp[j].next_addr = 0;
return;
}
fprintf(stderr,"No more breakpoints\n");
}
static void bark()
{
static int barked=0;
if(barked)return;
barked=1;
perror("Sorry, can't set break point");
#ifdef linux
{struct utsname buf;
uname(&buf);
if(strcmp(buf.sysname,"Linux")==0)
{ if(strcmp(buf.release,"1.1.62")<0)
fprintf(stderr,"Your current Linux release is %s. "
"You should upgrade to 1.1.62 or higher\n"
"Alternatively, in /usr/src/linux/fs/exec.c,"
" change MAP_SHARED to MAP_PRIVATE.\n", buf.release);
} else
fprintf(stderr,"Why did you compile for Linux, while your system is"
" actually %s?\n",buf.sysname);
}
#endif
}
void insert_break(int flag)
{
unsigned char * pnt;
......@@ -61,6 +98,20 @@ void insert_break(int flag)
for(j=0; j<N_BP; j++)
if(wbp[j].enabled)
{
/* There are a couple of problems with this. On Linux prior to
1.1.62, this call fails (ENOACCESS) due to a bug in fs/exec.c.
This code is currently not tested at all on BSD.
How do I determine the page size in a more symbolic manner?
And why does mprotect need that start address of the page
in the first place?
Not that portability matters, this code is i386 only anyways...
How do I get the old protection in order to restore it later on?
*/
if(mprotect((caddr_t)(wbp[j].addr & (~4095)), 4096,
PROT_READ|PROT_WRITE|PROT_EXEC) == -1){
bark();
return;
}
pnt = (unsigned char *) wbp[j].addr;
if(flag) {
wbp[j].databyte = *pnt;
......@@ -68,6 +119,7 @@ void insert_break(int flag)
} else {
*pnt = wbp[j].databyte;
}
mprotect((caddr_t)(wbp[j].addr & ~4095), 4096, PROT_READ|PROT_EXEC);
}
}
......@@ -82,3 +134,27 @@ int get_bpnum(unsigned int addr)
return -1;
}
void toggle_next(int num)
{
unsigned int addr;
addr=wbp[num].addr;
if(wbp[num].next_addr == 0)
wbp[num].next_addr=addr+print_insn(addr,addr,stderr,dbg_mode);
wbp[num].addr=wbp[num].next_addr;
wbp[num].next_addr=addr;
}
int should_continue(int bpnum)
{
if(bpnum<0)return 0;
toggle_next(bpnum);
if(bpnum==current_bp){
current_bp=-1;
cont_mode=0;
return 1;
}
cont_mode=1;
current_bp=bpnum;
return 0;
}
......@@ -30,6 +30,7 @@ void mode_command(int);
%token BACKTRACE
%token INFO
%token STACK
%token SEGMENTS
%token REG
%token REGS
%token NUM
......@@ -83,7 +84,7 @@ x_command:
print:
'p'
| print
| PRINT
print_command:
print expr '\n' { examine_memory(((unsigned int) &$2 ), 1, 'x'); }
......@@ -107,15 +108,16 @@ print:
expr: NUM { $$ = $1; }
| REG { if(regval) $$ = regval[$1]; else application_not_running();}
| symbol { $$ = *((unsigned int *) $1); }
| symbol { $$ = $1; }
| expr '+' NUM { $$ = $1 + $3; }
| expr '-' NUM { $$ = $1 - $3; }
| '(' expr ')' { $$ = $2; }
| '*' expr { $$ = *((unsigned int *) $2); }
infocmd: INFO REGS { info_reg(); }
| INFO STACK { info_stack(); }
| INFO BREAK { info_break(); }
infocmd: INFO REGS { info_reg(); }
| INFO STACK { info_stack(); }
| INFO BREAK { info_break(); }
| INFO SEGMENTS { print_ldt(); }
%%
......@@ -187,17 +189,21 @@ wine_debug(int signal, int * regs)
}
/* Remove the breakpoints from memory... */
fprintf(stderr,"Removing BPs\n");
insert_break(0);
/* If we stopped on a breakpoint, report this fact */
if(signal == SIGTRAP)
{
unsigned int addr;
int bpnum;
addr = SC_EIP(dbg_mask);
if((addr & 0xffff0000) == 0 && dbg_mode == 16)
addr |= SC_CS << 16;
fprintf(stderr,"Stopped on breakpoint %d\n", get_bpnum(addr));
if(should_continue(bpnum=get_bpnum(addr))){
insert_break(1);
return;
}
fprintf(stderr,"Stopped on breakpoint %d\n", bpnum);
}
/* Show where we crashed */
......
/* Lexical scanner for command line parsing in the Wine debugger
*
* Version 1.0
......@@ -53,12 +51,12 @@ IDENTIFIER [_a-zA-Z\.~][_a-zA-Z0-9\.~]*
"?" { return HELP; }
"0x"+{HEXDIGIT}+ {
sscanf(yytext, "%lx", &yylval);
sscanf(yytext, "%x", &yylval);
return NUM;
}
{DIGIT}+ {
sscanf(yytext, "%ld", &yylval);
sscanf(yytext, "%d", &yylval);
return NUM;
}
......@@ -80,7 +78,7 @@ $cs { yylval = RN_CS; return REG;}
$ss { yylval = RN_SS; return REG;}
info|inf|in { return INFO; }
segments|segm { return SEGMENTS; }
break|brea|bre { return BREAK; }
enable|enabl|enab|ena { return ENABLE;}
disable|disabl|disab|disa|dis { return DISABLE; }
......@@ -183,8 +181,7 @@ dbg_read(char * buf, int size){
}
/* Strip whitespace from the start and end of STRING. */
stripwhite (string)
char *string;
void stripwhite (char *string)
{
register int i = 0;
......
......@@ -12,6 +12,7 @@
#include <neexe.h>
#include <segmem.h>
#include <prototypes.h>
#include "selectors.h"
#include <wine.h>
#include <dlls.h>
......
......@@ -202,7 +202,7 @@ void examine_memory(int addr, int count, char format){
pnt = (char *) addr;
for(i=0; i<count; i++)
{
fprintf(stderr," %02.2x", (*pnt++) & 0xff);
fprintf(stderr," %02x", (*pnt++) & 0xff);
if ((i % 32) == 7) {
fprintf(stderr,"\n");
print_address((unsigned int) pnt, stderr);
......
......@@ -1565,7 +1565,7 @@ OP_E (bytemode)
{
if (mod == 0 && rm == 6)
{
sprintf (scratchbuf, "0x%04.4x", get16 ());
sprintf (scratchbuf, "0x%04x", get16 ());
oappend (scratchbuf);
return 0;
}
......
......@@ -2,9 +2,9 @@
**
** History and file completion functions for editline library.
*/
#include <stdlib.h>
#include "editline.h"
#if defined(NEED_STRDUP)
/*
** Return an allocated copy of a string.
......
......@@ -163,9 +163,17 @@ A(CallToInit16:)
* 10 target cs
* 12 target ds
* 14 target cx (only CallTo16cx)
* 16 target di
*/
.align 4
.globl A(CallTo16), A(CallTo16cx)
.globl A(CallTo16), A(CallTo16cx), A(CallToLibMain)
A(CallToLibMain:)
pushl %ebp
movl %esp,%ebp
movw 16(%ebp),%di
movw 0,%si
movw 0,%es
jmp L1
A(CallTo16:)
A(CallTo16cx:)
pushl %ebp
......@@ -174,7 +182,7 @@ A(CallTo16cx:)
/*
* Get target address and new ds
*/
movl 8(%ebp),%eax
L1: movl 8(%ebp),%eax
movl %eax,jump_target
lea jump_target,%edx
movw 12(%ebp),%ax
......
#ifndef WINELIB
/*
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
......@@ -11,10 +13,8 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <setjmp.h>
#include "dlls.h"
#include "stddebug.h"
/* #define DEBUG_CALLBACK */
/* #undef DEBUG_CALLBACK */
#include "debug.h"
#include "if1632.h"
extern SEGDESC Segments[];
extern unsigned short IF1632_Saved16_ss;
......@@ -188,13 +188,15 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
/* default */
else
{
fprintf(stderr, "wine: Unknown wine callback %08x\n", func);
fprintf(stderr, "wine: Unknown wine callback %08x\n",
(unsigned int) func);
exit(1);
}
}
else if (IS_16_BIT_ADDRESS(func))
{
dprintf_callback(stddeb, "CallWindowProc // 16bit func=%p !\n", func);
dprintf_callback(stddeb, "CallWindowProc // 16bit func=%p !\n",
(unsigned int) func);
PushOn16( CALLBACK_SIZE_WORD, hwnd );
PushOn16( CALLBACK_SIZE_WORD, message );
PushOn16( CALLBACK_SIZE_WORD, wParam );
......@@ -204,7 +206,8 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
}
else
{
dprintf_callback(stddeb, "CallWindowProc // 32bit func=%08X !\n", func);
dprintf_callback(stddeb, "CallWindowProc // 32bit func=%08X !\n",
(unsigned int) func);
return (*func)(hwnd, message, wParam, lParam);
}
}
......@@ -319,11 +322,12 @@ int Catch (LPCATCHBUF cbuf)
memcpy (stack16, sb -> stack_part, STACK_DEPTH_16);
dprintf_catch (stddeb, "Been thrown here: %d, retval = %d\n",
sb, retval);
(int) sb, (int) retval);
free ((void *) sb);
return (retval);
} else {
dprintf_catch (stddeb, "Will somtime get thrown here: %d\n", sb);
dprintf_catch (stddeb, "Will somtime get thrown here: %d\n",
(int) sb);
return (retval);
}
}
......@@ -331,7 +335,7 @@ int Catch (LPCATCHBUF cbuf)
void Throw (LPCATCHBUF cbuf, int val)
{
sb = *((struct special_buffer **)cbuf);
dprintf_catch (stddeb, "Throwing to: %d\n", sb);
dprintf_catch (stddeb, "Throwing to: %d\n", (int) sb);
longjmp (sb -> buffer, val);
}
#endif /* !WINELIB */
......@@ -129,7 +129,7 @@ length 490
#121 pascal Death
#122 pascal ReSurRection
123 pascal16 PlayMetaFile(word word) PlayMetaFile(1 2)
#124 pascal GetMetaFile
124 pascal16 GetMetaFile(ptr) GetMetaFile(1)
125 pascal16 CreateMetaFile(ptr) CreateMetaFile(1)
126 pascal16 CloseMetaFile(word) CloseMetaFile(1)
127 pascal16 DeleteMetaFile(word) DeleteMetaFile(1)
......
/*
static char RCSId[] = "$Id: relay.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
......@@ -8,21 +10,29 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#ifdef linux
#include <linux/unistd.h>
#include <linux/head.h>
#include <linux/ldt.h>
#include <linux/segment.h>
#endif
#include <errno.h>
#include "neexe.h"
#include "segmem.h"
#include "prototypes.h"
#include "dlls.h"
#include "options.h"
#include "stddebug.h"
/* #define DEBUG_RELAY /* */
/* #define DEBUG_STACK /* */
#include "debug.h"
#define DEBUG_RELAY /* */
#if 0
/* Make make_debug think these were really used */
dprintf_relay
dprintf_stack
#endif
#ifdef WINELIB
#define WineLibSkip(x) 0
......@@ -103,11 +113,9 @@ DLLRelay(unsigned int func_num, unsigned int seg_off)
ordinal = func_num & 0xffff;
dll_p = &dll_builtin_table[dll_id].dll_table[ordinal];
#ifdef DEBUG_RELAY
if (Options.relay_debug)
if (debugging_relay)
{
unsigned int *ret_addr;
unsigned short *stack_p;
ret_addr = (unsigned int *) ((char *) seg_off + 0x14);
printf("Call %s (%s.%d), stack=%04x:%04x, ",
......@@ -119,18 +127,18 @@ DLLRelay(unsigned int func_num, unsigned int seg_off)
IF1632_Saved16_esp, IF1632_Saved16_ebp,
IF1632_Saved16_ss);
#ifdef DEBUG_STACK
stack_p = (unsigned short *) seg_off;
for (i = 0; i < 24; i++, stack_p++)
{
printf("%04x ", *stack_p);
if ((i & 7) == 7)
printf("\n");
if(debugging_stack)
{
unsigned short *stack_p = (unsigned short *) seg_off;
for (i = 0; i < 24; i++, stack_p++)
{
printf("%04x ", *stack_p);
if ((i & 7) == 7)
printf("\n");
}
printf("\n");
}
printf("\n");
#endif /* DEBUG_STACK */
}
#endif /* DEBUG_RELAY */
} /* DEBUG_RELAY */
/*
* Make sure we have a handler defined for this call.
......@@ -206,15 +214,13 @@ DLLRelay(unsigned int func_num, unsigned int seg_off)
arg_table[12], arg_table[13], arg_table[14],
arg_table[15]);
#ifdef DEBUG_RELAY
if (Options.relay_debug)
if (debugging_relay)
{
printf("Returning %08x from %s (%s.%d)\n",
ret_val,
dll_p->export_name,
dll_builtin_table[dll_id].dll_name, ordinal);
}
#endif
Stack16Frame = saved_Stack16Frame;
return ret_val;
......
......@@ -7,65 +7,61 @@ name winsock
id 9
length 155
1 pascal accept(word ptr ptr) Winsock_accept(1 2 3)
2 pascal bind(word ptr word) Winsock_bind(1 2 3)
3 pascal closesocket(word) Winsock_closesocket(1)
4 pascal connect(word ptr word) Winsock_connect(1 2 3)
5 pascal getpeername(word ptr ptr) Winsock_getpeername(1 2 3)
6 pascal getsockname(word ptr ptr) Winsock_getsockname(1 2 3)
7 pascal getsockopt(word word word ptr ptr)
Winsock_getsockopt(1 2 3 4 5)
8 pascal htonl(long) Winsock_htonl(1)
9 pascal htons(word) Winsock_htons(1)
10 pascal inet_addr(long) Winsock_inet_addr(1)
11 pascal inet_ntoa(long) Winsock_inet_ntoa(1)
12 pascal ioctlsocket(word long ptr) Winsock_ioctlsocket(1 2 3)
13 pascal listen(word word) Winsock_listen(1 2)
14 pascal ntohl(long) Winsock_ntohl(1)
15 pascal ntohs(word) Winsock_ntohs(1)
16 pascal recv(word ptr word word) Winsock_recv(1 2 3 4)
17 pascal recvfrom(word ptr word word ptr ptr)
Winsock_recvfrom(1 2 3 4 5 6)
18 pascal select(word ptr ptr ptr ptr word)
Winsock_select(1 2 3 4 5 6)
19 pascal send(word ptr word word) Winsock_send(1 2 3 4)
20 pascal sendto(word ptr word word ptr ptr)
Winsock_sendto(1 2 3 4 5 6)
21 pascal setsockopt(word word word ptr word)
Winsock_setsockopt(1 2 3 4 5)
22 pascal shutdown(word word) Winsock_shutdown(1 2)
23 pascal socket(word word word) Winsock_socket(1 2 3)
51 pascal gethostbyaddr(ptr word word) Winsock_gethostbyaddr(1 2 3)
52 pascal gethostbyname(ptr) Winsock_gethostbyname(1)
53 pascal getprotobyname(ptr) Winsock_getprotobyname(1)
54 pascal getprotobynumber(word) Winsock_getprotobynumber(1)
55 pascal getservbyname(ptr ptr) Winsock_getservbyname(1 2)
56 pascal getservbyport(word ptr) Winsock_getservbyport(1 2)
57 pascal gethostname(ptr word) Winsock_gethostname(1 2)
101 pascal WSAAsyncSelect(word word word long)
WSAAsyncSelect(1 2 3 4)
102 pascal WSAAsyncGetHostByAddr(word word ptr word word ptr word)
WSAAsyncGetHostByAddr(1 2 3 4 5 6 7)
103 pascal WSAAsyncGetHostByName(word word ptr ptr word)
WSAAsyncGetHostByName(1 2 3 4 5)
104 pascal WSAAsyncGetProtoByNumber(word word word ptr word)
WSAAsyncGetProtoByNumber(1 2 3 4 5)
105 pascal WSAAsyncGetProtoByName(word word ptr ptr word)
WSAAsyncGetProtoByName(1 2 3 4 5)
106 pascal WSAAsyncGetServByPort(word word word ptr ptr word)
WSAAsyncGetServByPort(1 2 3 4 5 6)
107 pascal WSAAsyncGetServByName(word word ptr ptr ptr word)
WSAAsyncGetServByName(1 2 3 4 5 6)
108 pascal WSACancelAsyncRequest(word) WSACancelAsyncRequest(1)
109 pascal WSASetBlockingHook() WSASetBlockingHook()
110 pascal WSAUnhookBlockingHook() WSAUnhookBlockingHook()
111 pascal WSAGetLastError() WSAGetLastError()
112 pascal WSASetLastError(word) WSASetLastError(1)
113 pascal WSACancelBlockingCall() WSACancelBlockingCall()
114 pascal WSAIsBlocking() WSAIsBlocking()
115 pascal WSAStartup(word ptr) WSAStartup(1 2)
116 pascal WSACleanup() WSACleanup()
151 pascal __WSAFDIsSet(word ptr) WSAFDIsSet(1 2)
1 pascal16 accept(word ptr ptr) WINSOCK_accept(1 2 3)
2 pascal16 bind(word ptr word) WINSOCK_bind(1 2 3)
3 pascal16 closesocket(word) WINSOCK_closesocket(1)
4 pascal16 connect(word ptr word) WINSOCK_connect(1 2 3)
5 pascal16 getpeername(word ptr ptr) WINSOCK_getpeername(1 2 3)
6 pascal16 getsockname(word ptr ptr) WINSOCK_getsockname(1 2 3)
7 pascal16 getsockopt(word word word ptr ptr) WINSOCK_getsockopt(1 2 3 4 5)
8 pascal htonl(long) WINSOCK_htonl(1)
9 pascal16 htons(word) WINSOCK_htons(1)
10 pascal inet_addr(long) WINSOCK_inet_addr(1)
11 pascal inet_ntoa(long) WINSOCK_inet_ntoa(1)
12 pascal16 ioctlsocket(word long ptr) WINSOCK_ioctlsocket(1 2 3)
13 pascal16 listen(word word) WINSOCK_listen(1 2)
14 pascal ntohl(long) WINSOCK_ntohl(1)
15 pascal16 ntohs(word) WINSOCK_ntohs(1)
16 pascal16 recv(word ptr word word) WINSOCK_recv(1 2 3 4)
17 pascal16 recvfrom(word ptr word word ptr ptr)
WINSOCK_recvfrom(1 2 3 4 5 6)
18 pascal16 select(word ptr ptr ptr ptr word)
WINSOCK_select(1 2 3 4 5 6)
19 pascal16 send(word ptr word word) WINSOCK_send(1 2 3 4)
20 pascal16 sendto(word ptr word word ptr ptr)
WINSOCK_sendto(1 2 3 4 5 6)
21 pascal16 setsockopt(word word word ptr word)
WINSOCK_setsockopt(1 2 3 4 5)
22 pascal16 shutdown(word word) WINSOCK_shutdown(1 2)
23 pascal16 socket(word word word) WINSOCK_socket(1 2 3)
51 pascal gethostbyaddr(ptr word word) WINSOCK_gethostbyaddr(1 2 3)
52 pascal gethostbyname(ptr) WINSOCK_gethostbyname(1)
53 pascal getprotobyname(ptr) WINSOCK_getprotobyname(1)
54 pascal getprotobynumber(word) WINSOCK_getprotobynumber(1)
55 pascal getservbyname(ptr ptr) WINSOCK_getservbyname(1 2)
56 pascal getservbyport(word ptr) WINSOCK_getservbyport(1 2)
57 pascal gethostname(ptr word) WINSOCK_gethostname(1 2)
101 pascal16 WSAAsyncSelect(word word word long)
WSAAsyncSelect(1 2 3 4)
102 pascal16 WSAAsyncGetHostByAddr(word word ptr word word ptr word)
WSAAsyncGetHostByAddr(1 2 3 4 5 6 7)
103 pascal16 WSAAsyncGetHostByName(word word ptr ptr word)
WSAAsyncGetHostByName(1 2 3 4 5)
104 pascal16 WSAAsyncGetProtoByNumber(word word word ptr word)
WSAAsyncGetProtoByNumber(1 2 3 4 5)
105 pascal16 WSAAsyncGetProtoByName(word word ptr ptr word)
WSAAsyncGetProtoByName(1 2 3 4 5)
106 pascal16 WSAAsyncGetServByPort(word word word ptr ptr word)
WSAAsyncGetServByPort(1 2 3 4 5 6)
107 pascal16 WSAAsyncGetServByName(word word ptr ptr ptr word)
WSAAsyncGetServByName(1 2 3 4 5 6)
108 pascal16 WSACancelAsyncRequest(word) WSACancelAsyncRequest(1)
109 pascal16 WSASetBlockingHook() WSASetBlockingHook()
110 pascal16 WSAUnhookBlockingHook() WSAUnhookBlockingHook()
111 pascal16 WSAGetLastError() WSAGetLastError()
112 pascal WSASetLastError(word) WSASetLastError(1)
113 pascal16 WSACancelBlockingCall() WSACancelBlockingCall()
114 pascal16 WSAIsBlocking() WSAIsBlocking()
115 pascal WSAStartup(word ptr) WSAStartup(1 2)
116 pascal WSACleanup() WSACleanup()
151 pascal16 __WSAFDIsSet(word ptr) WSAFDIsSet(1 2)
......@@ -19,6 +19,6 @@
#define CONV_CHAR_TO_LONG(a) (a)
#define CONV_SHORT_TO_LONG(a) (a)
#define CONV_BITMAPINFO
#define CONV_BITMAPCOREHEADER
#define CONV_BITMAPINFO(a) /* */
#define CONV_BITMAPCOREHEADER(a) /* */
#endif
......@@ -9,6 +9,8 @@
#include "windows.h"
extern BOOL ATOM_Init(void);
typedef struct
{
HANDLE next;
......
......@@ -10,6 +10,8 @@
#include <X11/Xlib.h>
#include "windows.h"
extern BOOL BITMAP_Init(void);
/* GCs used for B&W and color bitmap operations */
extern GC BITMAP_monoGC, BITMAP_colorGC;
......
......@@ -16,5 +16,6 @@
extern int CallTo16(unsigned int csip, unsigned short ds);
extern int CallBack16(void *func, int n_args, ...);
extern BOOL CallGrayStringProc(FARPROC func, HDC hdc, LPARAM lParam, INT cch);
#endif /* CALLBACK_H */
#ifndef __WINE_CLIPBOARD_H
#define __WINE_CLIPBOARD_H
extern void CLIPBOARD_ReadSelection(Window w,Atom prop);
void CLIPBOARD_ReleaseSelection(HWND hwnd);
#endif /* __WINE_CLIPBOARD_H */
#ifndef __WINE_COLOR_H
#define __WINE_COLOR_H
#include "gdi.h"
extern HPALETTE COLOR_Init(void);
extern int COLOR_ToPhysical( DC *dc, COLORREF color );
extern void COLOR_SetMapping( DC *dc, HANDLE, WORD );
extern BOOL COLOR_IsSolid( COLORREF color );
extern Colormap COLOR_WinColormap;
extern int COLOR_mapEGAPixel[16];
#endif /* __WINE_COLOR_H */
/*
* Communications header
*
* 93 Erik Bos (erik@trashcan.hacktic.nl)
*/
#ifndef COMM_H
#define COMM_H
#define MAX_PORTS 16
struct DosDeviceStruct {
......@@ -19,4 +12,7 @@ struct DosDeviceStruct {
int baudrate;
};
extern void Comm_Init(void);
extern void Comm_DeInit(void);
#endif /* COMM_H */
......@@ -4,6 +4,8 @@
* Copyright Martin Ayotte, 1993
*
*/
#ifndef __WINE_CURSOR_H
#define __WINE_CURSOR_H
typedef struct {
BYTE Width;
......@@ -25,3 +27,6 @@ typedef struct {
Cursor xcursor;
} CURSORALLOC;
extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */
#endif /* __WINE_CURSOR_H */
#ifndef __WINE_DC_H
#define __WINE_DC_H
#include "gdi.h"
extern void DC_InitDC( HDC hdc );
extern int DC_SetupGCForBrush( DC * dc );
extern int DC_SetupGCForPen( DC * dc );
extern int DC_SetupGCForText( DC * dc );
extern const int DC_XROPfunction[];
#endif /* __WINE_DC_H */
......@@ -9,6 +9,11 @@
#include "windows.h"
extern BOOL DIALOG_Init(void);
extern HWND DIALOG_GetFirstTabItem( HWND hwndDlg );
extern int DialogBoxIndirectPtr( HINSTANCE hInst, LPCSTR dlgTemplate,
HWND owner, WNDPROC dlgProc);
#pragma pack(1)
/* Dialog info structure.
......
#ifndef __WINE_DOS_FS_H
#define __WINE_DOS_FS_H
#include <wintypes.h>
extern void DOS_InitFS(void);
extern WORD DOS_GetEquipment(void);
extern int DOS_ValidDrive(int drive);
extern int DOS_GetDefaultDrive(void);
extern void DOS_SetDefaultDrive(int drive);
extern void ToUnix(char *s);
extern void ToDos(char *s);
extern void ChopOffSlash(char *string);
extern int DOS_DisableDrive(int drive);
extern int DOS_EnableDrive(int drive);
extern char *DOS_GetUnixFileName(char *dosfilename);
extern char *DOS_GetDosFileName(char *unixfilename);
extern char *DOS_GetCurrentDir(int drive);
extern int DOS_ChangeDir(int drive, char *dirname);
extern int DOS_MakeDir(int drive, char *dirname);
extern int DOS_GetSerialNumber(int drive, unsigned long *serialnumber);
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 *WineIniFileName(void);
extern char *WinIniFileName(void);
extern struct dosdirent *DOS_opendir(char *dosdirname);
extern struct dosdirent *DOS_readdir(struct dosdirent *de);
extern void DOS_closedir(struct dosdirent *de);
extern char WindowsPath[256];
#endif /* __WINE_DOS_FS_H */
#ifndef __WINE_EVENT_H
#define __WINE_EVENT_H
extern void EVENT_ProcessEvent( XEvent *event ); /* event.c */
extern void EVENT_RegisterWindow( Window w, HWND hwnd ); /* event.c */
#endif /* __WINE_EVENT_H */
#ifndef __WINE_FONT_H
#define __WINE_FONT_H
extern void Font_Init( void );
extern int FONT_GetObject( FONTOBJ * font, int count, LPSTR buffer );
extern HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font );
#endif /* __WINE_FONT_H */
......@@ -299,6 +299,7 @@ extern MDESC *GDI_Heap;
#endif
extern BOOL GDI_Init(void);
extern HANDLE GDI_AllocObject( WORD, WORD );
extern BOOL GDI_FreeObject( HANDLE );
extern GDIOBJHDR * GDI_GetObjPtr( HANDLE, WORD );
......@@ -307,5 +308,6 @@ extern Display * display;
extern Screen * screen;
extern Window rootWindow;
extern int screenWidth, screenHeight, screenDepth;
extern int desktopX, desktopY; /* misc/main.c */
#endif /* GDI_H */
#ifndef __WINE_GRAPHICS_H
#define __WINE_GRAPHICS_H
extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size,
int shadow_size, BOOL pressed );
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height, int rop );
#endif /* __WINE_GRAPHICS */
......@@ -35,11 +35,24 @@ extern void *HEAP_Alloc(MDESC **free_list, int flags, int bytes);
extern int HEAP_Free(MDESC **free_list, void *block);
extern void *HEAP_ReAlloc(MDESC **free_list, void *old_block,
int new_size, unsigned int flags);
extern LHEAP *HEAP_LocalFindHeap(unsigned short owner);
extern unsigned int HEAP_LocalSize(MDESC **free_list, unsigned int handle);
extern void HEAP_LocalInit(unsigned short owner, void *start, int length);
extern void *WIN16_LocalAlloc(int flags, int bytes);
extern int WIN16_LocalCompact(int min_free);
extern unsigned int WIN16_LocalFlags(unsigned int handle);
extern unsigned int WIN16_LocalFree(unsigned int handle);
extern void *WIN16_LocalLock(unsigned int handle);
extern void *WIN16_LocalReAlloc(unsigned int handle, int flags, int bytes);
extern unsigned int WIN16_LocalUnlock(unsigned int handle);
#if 0
#define HEAP_OWNER (Segments[Stack16Frame[11] >> 3].owner)
#endif
/* Use ds instead of owner of cs */
#define HEAP_OWNER Stack16Frame[6]
#define LOCALHEAP() (&HEAP_LocalFindHeap(HEAP_OWNER)->free_list)
#define LOCALATOMTABLE() (&HEAP_LocalFindHeap(HEAP_OWNER)->local_table)
......
#ifndef __WINE_IF1632_H
#define __WINE_IF1632_H
#include <wintypes.h>
extern int CallToInit16(unsigned long csip, unsigned long sssp,
unsigned short ds);
extern int CallTo16cx(unsigned long csip, unsigned long dscx);
extern int CallToDllEntry(unsigned long csip, unsigned long dscx, unsigned short di);
extern int CallBack16(void *func, int n_args, ...);
extern void *CALLBACK_MakeProcInstance(void *func, int instance);
extern void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam);
extern void winestat(void);
extern int DLLRelay(unsigned int func_num, unsigned int seg_off);
extern struct dll_table_entry_s *FindDLLTable(char *dll_name);
extern int FindOrdinalFromName(struct dll_table_entry_s *dll_table, char *func_name);
extern int ReturnArg(int arg);
#endif /* __WINE_IF1632_H */
extern int KERNEL_LockSegment(int segment);
extern int KERNEL_UnlockSegment(int segment);
extern KERNEL_InitTask(void);
extern int KERNEL_WaitEvent(int task);
#ifndef __WINE_LIBRARY_H
#define __WINE_LIBRARY_H
extern HINSTANCE hInstMain;
extern HINSTANCE hSysRes;
extern struct w_files *GetFileInfo(unsigned short instance);
extern int IsDLLLoaded(char *name);
extern void InitDLL(struct w_files *wpnt);
extern void InitializeLoadedDLLs(struct w_files *wpnt);
extern HINSTANCE LoadImage(char *module, int filetype, int change_dir);
extern struct dll_name_table_entry_s dll_builtin_table[];
#endif /* __WINE_LIBRARY_H */
......@@ -14,8 +14,8 @@ typedef LISTSTRUCT FAR* LPLISTSTRUCT;
typedef struct tagHEADLIST {
short FirstVisible;
short ItemsCount;
UINT FirstVisible;
UINT ItemsCount;
short ItemsVisible;
short ColumnsVisible;
short ItemsPerColumn;
......
......@@ -11,6 +11,9 @@
#include "windows.h"
#define MDI_MAXLISTLENGTH 64
extern LONG MDIClientWndProc(HWND hwnd, WORD message,
WORD wParam, LONG lParam); /* mdi.c */
typedef struct mdi_child_info_s
{
......
......@@ -8,6 +8,15 @@
#define MENU_MAGIC 0x554d /* 'MU' */
extern BOOL MENU_Init(void);
extern WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth,
int orgX, int orgY ); /* menu.c */
extern void MENU_TrackMouseMenuBar( HWND hwnd, POINT pt ); /* menu.c */
extern void MENU_TrackKbdMenuBar( HWND hwnd, WORD wParam ); /* menu.c */
extern WORD MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
HWND hwnd, BOOL suppress_draw ); /* menu.c */
extern HMENU CopySysMenu(); /* menu.c */
typedef struct tagMENUITEM
{
......
#ifndef __WINE_MISCEMU_H
#define __WINE_MISCEMU_H
extern int do_int10(struct sigcontext_struct *);
extern int do_int13(struct sigcontext_struct *);
extern int do_int15(struct sigcontext_struct *);
extern int do_int16(struct sigcontext_struct *);
extern int do_int1a(struct sigcontext_struct *);
extern int do_int21(struct sigcontext_struct *);
extern int do_int25(struct sigcontext_struct *);
extern int do_int26(struct sigcontext_struct *);
extern int do_int2a(struct sigcontext_struct *);
extern int do_int2f(struct sigcontext_struct *);
extern int do_int31(struct sigcontext_struct *);
extern void inportb(struct sigcontext_struct *context);
extern void inport(struct sigcontext_struct *context);
extern void outportb(struct sigcontext_struct *context);
extern void outport(struct sigcontext_struct *context);
extern void IntBarf(int i, struct sigcontext_struct *context);
extern void INT21_Init(void);
#endif /* __WINE_MISCEMU_H */
#ifndef __MSDOS_H
#define __MSDOS_H
#include <dirent.h>
#include <windows.h>
#include "comm.h"
struct dosdirent {
int inuse;
......@@ -30,6 +32,10 @@ struct fcb {
#define DOSVERSION 0x0330;
#define MAX_DOS_DRIVES 26
extern WORD ExtendedError;
extern struct DosDeviceStruct COM[MAX_PORTS];
extern struct DosDeviceStruct LPT[MAX_PORTS];
#define segment(a) ((DWORD)(a) >> 16)
#define offset(a) ((DWORD)(a) & 0xffff)
......
#ifndef __WINE_NE_IMAGE_H
#define __WINE_NE_IMAGE_H
extern int NE_FixupSegment(struct w_files *wpnt, int segment_num);
extern int NE_unloadImage(struct w_files *wpnt);
extern int NE_StartProgram(struct w_files *wpnt);
extern void NE_InitDLL(struct w_files *wpnt);
extern HINSTANCE NE_LoadImage(struct w_files *wpnt);
#endif /* __WINE_NE_IMAGE_H */
#ifndef __WINE_NONCLIENT_H
#define __WINE_NONCLIENT_H
extern LONG NC_HandleNCPaint( HWND hwnd, HRGN hrgn );
extern LONG NC_HandleNCActivate( HWND hwnd, WORD 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 );
#endif /* __WINE_NONCLIENT_H */
......@@ -16,7 +16,6 @@ struct options
int synchronous; /* X synchronous mode */
int backingstore; /* Use backing store */
short cmdShow;
int relay_debug;
int debug;
};
......
#ifndef __WINE_PE_IMAGE_H
#define __WINE_PE_IMAGE_H
extern int PE_unloadImage(struct w_files *wpnt);
extern int PE_StartProgram(struct w_files *wpnt);
extern void PE_InitDLL(struct w_files *wpnt);
extern HINSTANCE PE_LoadImage(struct w_files *wpnt);
extern void my_wcstombs(char * result, u_short * source, int len);
#endif /* __WINE_PE_IMAGE_H */
......@@ -10,22 +10,12 @@
#include "neexe.h"
#include "segmem.h"
#include "wine.h"
#include "heap.h"
#include "msdos.h"
#include "windows.h"
#ifndef WINELIB
/* loader/dump.c */
extern void PrintFileHeader(struct ne_header_s *ne_header);
extern void PrintSegmentTable(struct ne_segment_table_entry_s *seg_table,
int nentries);
extern void PrintRelocationTable(char *exe_ptr,
struct ne_segment_table_entry_s *seg_entry_p,
int segment);
/* loader/ldtlib.c */
struct segment_descriptor *
......@@ -37,153 +27,40 @@ int set_ldt_entry(int entry, unsigned long base, unsigned int limit,
/* loader/resource.c */
extern int OpenResourceFile(HANDLE instance);
extern HBITMAP ConvertCoreBitmap( HDC hdc, BITMAPCOREHEADER * image );
extern HBITMAP ConvertInfoBitmap( HDC hdc, BITMAPINFO * image );
/* loader/selector.c */
extern int FindUnusedSelectors(int n_selectors);
extern int IPCCopySelector(int i_old, unsigned long new, int swap_type);
extern WORD AllocSelector(WORD old_selector);
extern unsigned int PrestoChangoSelector(unsigned src_selector, unsigned dst_selector);
extern WORD AllocDStoCSAlias(WORD ds_selector);
extern WORD FreeSelector(WORD sel);
extern SEGDESC *CreateNewSegments(int code_flag, int read_only, int length,
int n_segments);
extern SEGDESC *GetNextSegment(unsigned int flags, unsigned int limit);
extern unsigned int GetEntryDLLName(char *dll_name, char *function, int *sel,
int *addr);
extern unsigned int GetEntryDLLOrdinal(char *dll_name, int ordinal, int *sel,
int *addr);
/* loader/signal.c */
extern int init_wine_signals(void);
extern void wine_debug(int signal, int * regs);
/* loader/wine.c */
extern void myerror(const char *s);
extern void load_mz_header (int, struct mz_header_s *);
extern void load_ne_header (int, struct ne_header_s *);
extern char *GetFilenameFromInstance(unsigned short instance);
extern HINSTANCE LoadImage(char *modulename, int filetype, int change_dir);
extern int _WinMain(int argc, char **argv);
extern void InitializeLoadedDLLs();
/* if1632/relay.c */
extern int CallBack16(void *func, int n_args, ...);
extern void *CALLBACK_MakeProcInstance(void *func, int instance);
extern void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam);
extern void winestat(void);
/* if1632/callback.c */
extern int DLLRelay(unsigned int func_num, unsigned int seg_off);
extern struct dll_table_entry_s *FindDLLTable(char *dll_name);
extern int FindOrdinalFromName(struct dll_table_entry_s *dll_table, char *func_name);
extern int ReturnArg(int arg);
/* miscemu/int1a.c */
extern do_int1A(struct sigcontext_struct *context);
/* miscemu/int21.c */
extern do_int21(struct sigcontext_struct *context);
/* miscemu/kernel.c */
extern int KERNEL_LockSegment(int segment);
extern int KERNEL_UnlockSegment(int segment);
extern KERNEL_InitTask();
extern void KERNEL_InitTask(void);
extern int KERNEL_WaitEvent(int task);
/* misc/comm.c */
void Comm_Init(void);
void Comm_DeInit(void);
/* misc/dos_fs.c */
extern void DOS_InitFS(void);
extern WORD DOS_GetEquipment(void);
extern int DOS_ValidDrive(int drive);
extern int DOS_GetDefaultDrive(void);
extern void DOS_SetDefaultDrive(int drive);
extern void ToUnix(char *s);
extern void ToDos(char *s);
extern void ChopOffSlash(char *string);
extern int DOS_DisableDrive(int drive);
extern int DOS_EnableDrive(int drive);
extern char *GetUnixFileName(char *dosfilename);
extern char *DOS_GetCurrentDir(int drive);
extern int DOS_ChangeDir(int drive, char *dirname);
extern int DOS_MakeDir(int drive, char *dirname);
extern int DOS_GetSerialNumber(int drive, unsigned long *serialnumber);
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 *FindFile(char *buffer, int buflen, char *rootname, char **extensions, char *path);
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
extern struct dosdirent *DOS_opendir(char *dosdirname);
extern struct dosdirent *DOS_readdir(struct dosdirent *de);
extern void DOS_closedir(struct dosdirent *de);
/* misc/profile.c */
extern void sync_profiles(void);
/* misc/spy.c */
extern void SpyInit(void);
/* controls/desktop.c */
extern BOOL DESKTOP_SetPattern(char *pattern);
/* controls/widget.c */
extern BOOL WIDGETS_Init(void);
/* memory/heap.c */
extern void HEAP_Init(MDESC **free_list, void *start, int length);
extern void *HEAP_Alloc(MDESC **free_list, int flags, int bytes);
extern void *HEAP_ReAlloc(MDESC **free_list, void *old_block, int new_size, unsigned int flags);
extern int HEAP_Free(MDESC **free_list, void *block);
extern LHEAP *HEAP_LocalFindHeap(unsigned short owner);
extern void HEAP_LocalInit(unsigned short owner, void *start, int length);
extern void *WIN16_LocalAlloc(int flags, int bytes);
extern int WIN16_LocalCompact(int min_free);
extern unsigned int WIN16_LocalFlags(unsigned int handle);
extern unsigned int WIN16_LocalFree(unsigned int handle);
extern unsigned int WIN16_LocalInit(unsigned int segment, unsigned int start, unsigned int end);
extern void *WIN16_LocalLock(unsigned int handle);
extern void *WIN16_LocalReAlloc(unsigned int handle, int flags, int bytes);
extern unsigned int WIN16_LocalSize(unsigned int handle);
extern unsigned int WIN16_LocalUnlock(unsigned int handle);
/* objects/bitmaps.c */
extern BOOL BITMAP_Init(void);
/* objects/color.c */
extern BOOL COLOR_Init(void);
/* objects/dib.c */
extern int DIB_BitmapInfoSize(BITMAPINFO *info, WORD coloruse);
/* objects/gdiobj.c */
extern BOOL GDI_Init(void);
/* objects/palette.c */
extern BOOL PALETTE_Init(void);
......@@ -200,17 +77,5 @@ extern void DrawReliefRect(HDC hdc, RECT rect, int thickness, BOOL pressed);
extern void DCE_Init(void);
/* windows/dialog.c */
extern BOOL DIALOG_Init(void);
/* windows/syscolor.c */
extern void SYSCOLOR_Init(void);
/* windows/sysmetrics.c */
extern void SYSMETRICS_Init(void);
#endif /* WINELIB */
#endif /* _WINE_PROTOTYPES_H */
......@@ -29,8 +29,8 @@
#define ES context->sc_es
#define SS context->sc_ss
#define DI context->sc_edi
#define SI context->sc_esi
#define DI ((WORD)context->sc_edi)
#define SI ((WORD)context->sc_esi)
#define SP context->sc_esp
#ifndef __FreeBSD__
#define EFL context->sc_eflags
......
......@@ -20,7 +20,8 @@ typedef struct
} SCROLLINFO;
extern LONG ScrollBarWndProc( HWND hwnd, WORD uMsg, WORD wParam, LONG lParam );
extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar );
extern void SCROLL_HandleScrollEvent( HWND hwnd, int nBar,
WORD msg, POINT pt); /* scroll.c */
#endif /* SCROLL_H */
#ifndef __WINE_SELECTORS_H
#define __WINE_SELECTORS_H
#include "dlls.h"
extern int FindUnusedSelectors(int n_selectors);
extern int IPCCopySelector(int i_old, unsigned long new, int swap_type);
extern WORD AllocSelector(WORD old_selector);
extern unsigned int PrestoChangoSelector(unsigned src_selector, unsigned dst_selector);
extern WORD AllocDStoCSAlias(WORD ds_selector);
extern SEGDESC *CreateSelectors(struct w_files * wpnt);
extern WORD FreeSelector(WORD sel);
extern SEGDESC *CreateNewSegments(int code_flag, int read_only, int length,
int n_segments);
extern SEGDESC *GetNextSegment(unsigned int flags, unsigned int limit);
extern unsigned int GetEntryDLLName(char *dll_name, char *function, int *sel,
int *addr);
extern unsigned int GetEntryDLLOrdinal(char *dll_name, int ordinal, int *sel,
int *addr);
extern unsigned int GetEntryPointFromOrdinal(struct w_files * wpnt,
int ordinal);
#endif /* __WINE_SELECTORS_H */
......@@ -129,9 +129,11 @@
#undef DEBUG_PROP
#undef DEBUG_REG
#undef DEBUG_REGION
#undef DEBUG_RELAY
#undef DEBUG_RESOURCE
#undef DEBUG_SCROLL
#undef DEBUG_SELECTORS
#undef DEBUG_STACK
#undef DEBUG_STRESS
#undef DEBUG_SYSCOLOR
#undef DEBUG_TASK
......@@ -196,9 +198,11 @@
#define DEBUG_PROP
#define DEBUG_REG
#define DEBUG_REGION
#define DEBUG_RELAY
#define DEBUG_RESOURCE
#define DEBUG_SCROLL
#define DEBUG_SELECTORS
#define DEBUG_STACK
#define DEBUG_STRESS
#define DEBUG_SYSCOLOR
#define DEBUG_TASK
......
......@@ -34,6 +34,7 @@ struct SysColorObjects
HBRUSH hbrushBtnHighlight; /* COLOR_BTNHIGHLIGHT */
};
extern void SYSCOLOR_Init(void);
extern struct SysColorObjects sysColorObjects;
#endif /* SYSCOLOR_H */
......@@ -48,8 +48,7 @@
#define SYSMETRICS_CYDOUBLECLK sysMetrics[SM_CYDOUBLECLK]
#define SYSMETRICS_MENUDROPALIGNMENT sysMetrics[SM_MENUDROPALIGNMENT]
extern void SYSMETRICS_Init(void);
extern short sysMetrics[SM_CMETRICS];
#endif
......@@ -72,6 +72,7 @@ Window WIN_GetXWindow( HWND hwnd );
BOOL WIN_UnlinkWindow( HWND hwnd );
BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
HWND WIN_FindWinToRepaint( HWND hwnd );
BOOL WIN_CreateDesktopWindow(void);
BOOL WINPOS_IsAnActiveWindow( HWND hwnd );
void WINPOS_ActivateChild( HWND hwnd );
......
......@@ -3,87 +3,14 @@
#ifndef WINDOWS_H
#define WINDOWS_H
#ifndef _WINARGS
typedef short INT;
typedef unsigned short UINT;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned short BOOL;
typedef unsigned char BYTE;
typedef long LONG;
typedef UINT WPARAM;
typedef LONG LPARAM;
typedef LONG LRESULT;
typedef WORD HANDLE;
typedef DWORD HHOOK;
typedef char *LPSTR;
typedef const char *LPCSTR;
typedef char *NPSTR;
typedef INT *LPINT;
typedef UINT *LPUINT;
typedef WORD *LPWORD;
typedef DWORD *LPDWORD;
typedef LONG *LPLONG;
typedef void *LPVOID;
typedef long (*FARPROC)();
typedef FARPROC DLGPROC;
typedef int CATCHBUF[9];
typedef int *LPCATCHBUF;
typedef FARPROC HOOKPROC;
#define DECLARE_HANDLE(a) typedef HANDLE a;
DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HDRVR);
DECLARE_HANDLE(HWND);
DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HCLASS);
DECLARE_HANDLE(HCURSOR);
DECLARE_HANDLE(HFONT);
DECLARE_HANDLE(HPEN);
DECLARE_HANDLE(HRGN);
DECLARE_HANDLE(HPALETTE);
DECLARE_HANDLE(HICON);
DECLARE_HANDLE(HINSTANCE);
DECLARE_HANDLE(HMENU);
DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HBRUSH);
DECLARE_HANDLE(LOCALHANDLE);
DECLARE_HANDLE(HMETAFILE);
DECLARE_HANDLE(HDWP);
#define TRUE 1
#define FALSE 0
#define CW_USEDEFAULT ((INT)0x8000)
#define FAR
#define NEAR
#define PASCAL
#define VOID void
#define WINAPI PASCAL
#define CALLBACK PASCAL
#ifndef NULL
#define NULL (void *)0
#endif
#define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)((UINT)(w) >> 8))
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#include <wintypes.h>
#pragma pack(1)
typedef struct { INT x, y; } POINT;
typedef struct {
INT x;
INT y;
} POINT;
typedef POINT *PPOINT;
typedef POINT *NPPOINT;
typedef POINT *LPPOINT;
......@@ -116,13 +43,6 @@ typedef PAINTSTRUCT *PPAINTSTRUCT;
typedef PAINTSTRUCT *NPPAINTSTRUCT;
typedef PAINTSTRUCT *LPPAINTSTRUCT;
#ifdef WINELIB
#define WINE_PACKED
#else
#define WINE_PACKED __attribute__ ((packed))
#endif
#pragma pack(1)
/* Window classes */
......@@ -2363,7 +2283,6 @@ typedef METAFILEPICT *LPMETAFILEPICT;
#define Fn(ret,name,t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7,t8,a8,t9,a9,t10,a10,t11,a11,t12,a12,t13,a13,t14,a14) ret name(t1 a1,t2 a2,t3 a3,t4 a4,t5 a5,t6 a6,t7 a7,t8 a8,t9 a9,t10 a10,t11 a11,t12 a12,t13 a13,t14 a14);
int wsprintf(LPSTR a,LPSTR b,...);
#endif
/* Implemented functions */
......
......@@ -32,21 +32,16 @@ struct sigcontext_struct {
unsigned long oldmask;
unsigned long cr2;
};
#endif
#ifdef linux
#define WINE_DATA_SELECTOR 0x2b
#define WINE_CODE_SELECTOR 0x23
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
#define WINE_DATA_SELECTOR 0x27
#define WINE_CODE_SELECTOR 0x1f
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <signal.h>
#define sigcontext_struct sigcontext
#define HZ 100
#define WINE_DATA_SELECTOR 0x27
#define WINE_CODE_SELECTOR 0x1f
#endif
#endif /* WINE_H */
......@@ -9,6 +9,15 @@
#define DWP_MAGIC 0x5057 /* 'WP' */
extern HWND WINPOS_ChangeActiveWindow( HWND hwnd, BOOL mouseMsg ); /*winpos.c*/
extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack ); /* winpos.c */
extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT *newWindowRect, RECT *oldWindowRect,
RECT *oldClientRect, WINDOWPOS *winpos,
RECT *newClientRect ); /* winpos.c */
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos ); /* winpos.c */
typedef struct
{
WORD actualCount;
......
#ifndef __WINE_WINTYPES_H
#define __WINE_WINTYPES_H
typedef short INT;
typedef unsigned short UINT;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned short BOOL;
typedef unsigned char BYTE;
typedef long LONG;
typedef UINT WPARAM;
typedef LONG LPARAM;
typedef LONG LRESULT;
typedef WORD HANDLE;
typedef DWORD HHOOK;
typedef char *LPSTR;
typedef const char *LPCSTR;
typedef char *NPSTR;
typedef INT *LPINT;
typedef UINT *LPUINT;
typedef WORD *LPWORD;
typedef DWORD *LPDWORD;
typedef LONG *LPLONG;
typedef void *LPVOID;
typedef long (*FARPROC)();
typedef FARPROC DLGPROC;
typedef int CATCHBUF[9];
typedef int *LPCATCHBUF;
typedef FARPROC HOOKPROC;
#define DECLARE_HANDLE(a) typedef HANDLE a;
DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HDRVR);
DECLARE_HANDLE(HWND);
DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HCLASS);
DECLARE_HANDLE(HCURSOR);
DECLARE_HANDLE(HFONT);
DECLARE_HANDLE(HPEN);
DECLARE_HANDLE(HRGN);
DECLARE_HANDLE(HPALETTE);
DECLARE_HANDLE(HICON);
DECLARE_HANDLE(HINSTANCE);
DECLARE_HANDLE(HMENU);
DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HBRUSH);
DECLARE_HANDLE(LOCALHANDLE);
DECLARE_HANDLE(HMETAFILE);
DECLARE_HANDLE(HDWP);
DECLARE_HANDLE(HDROP);
#define TRUE 1
#define FALSE 0
#define CW_USEDEFAULT ((INT)0x8000)
#define FAR
#define NEAR
#define PASCAL
#define VOID void
#define WINAPI PASCAL
#define CALLBACK PASCAL
#ifndef NULL
#define NULL (void *)0
#endif
#ifdef WINELIB
#define WINE_PACKED
#else
#define WINE_PACKED __attribute__ ((packed))
#endif
#pragma pack(1)
#define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)((UINT)(w) >> 8))
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#endif /* __WINE_WINTYPES_H */
#ifndef WINELIB
/*
static char RCSId[] = "$Id: dump.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
......
#ifndef WINELIB
/*
static char RCSId[] = "$Id: ldt.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
......
#ifndef WINELIB
/*
static char RCSId[] = "$Id: ldtlib.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "stddebug.h"
/* #define DEBUG_LDT */
/* #undef DEBUG_LDT */
#include "debug.h"
#ifdef linux
......
/*
* Module & Library functions
*/
static char Copyright[] = "Copyright 1993, 1994 Martin Ayotte, Robert J. Amstadt, Erik Bos";
*/
#include <stdio.h>
#include <stdlib.h>
......@@ -13,24 +13,21 @@ static char Copyright[] = "Copyright 1993, 1994 Martin Ayotte, Robert J. Amstadt
#include "neexe.h"
#include "segmem.h"
#include "dlls.h"
#include "wine.h"
#include "if1632.h"
#include "wineopts.h"
#include "arch.h"
#include "options.h"
#include "prototypes.h"
#include "dos_fs.h"
#include "windows.h"
#include "task.h"
#include "toolhelp.h"
#include "selectors.h"
#include "stddebug.h"
/* #define DEBUG_MODULE */
/* #undef DEBUG_MODULE */
#include "debug.h"
extern char WindowsPath[256];
extern struct dll_name_table_entry_s dll_builtin_table[];
extern char *GetDosFileName(char *);
extern HANDLE hSysRes;
#include "prototypes.h"
#include "library.h"
#include "ne_image.h"
#include "pe_image.h"
struct w_files *wine_files = NULL;
static char *DLL_Extensions[] = { "dll", NULL };
......@@ -58,8 +55,7 @@ void ExtractDLLName(char *libname, char *temp)
}
}
struct w_files *
GetFileInfo(unsigned short instance)
struct w_files *GetFileInfo(unsigned short instance)
{
register struct w_files *w = wine_files;
......@@ -86,9 +82,9 @@ int IsDLLLoaded(char *name)
void InitDLL(struct w_files *wpnt)
{
if (wpnt->ne)
InitNEDLL(wpnt);
NE_InitDLL(wpnt);
else
InitPEDLL(wpnt);
PE_InitDLL(wpnt);
}
void InitializeLoadedDLLs(struct w_files *wpnt)
......@@ -154,7 +150,7 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir)
/*
* search file
*/
fullname = FindFile(buffer, sizeof(buffer), module,
fullname = DOS_FindFile(buffer, sizeof(buffer), module,
(filetype == EXE ? EXE_Extensions : DLL_Extensions),
WindowsPath);
if (fullname == NULL)
......@@ -164,7 +160,7 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir)
return 2;
}
fullname = GetDosFileName(fullname);
fullname = DOS_GetDosFileName(fullname);
dprintf_module(stddeb,"LoadImage: loading %s (%s)\n [%s]\n",
module, buffer, fullname);
......@@ -225,7 +221,7 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir)
/*
* Stick this file into the list of loaded files so we don't try to reload
* it again if another module references this module. Do this before
* calling loadNEImage because we might get back here before loadNEImage
* calling NE_LoadImage because we might get back here before NE_loadImage
* returns.
*/
if(wine_files == NULL)
......@@ -239,9 +235,9 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir)
wpnt->next = NULL;
if (header[0] == 'N' && header[1] == 'E')
handle = LoadNEImage(wpnt);
handle = NE_LoadImage(wpnt);
if (header[0] == 'P' && header[1] == 'E')
handle = LoadPEImage(wpnt);
handle = PE_LoadImage(wpnt);
wpnt->hinstance = handle;
if (handle > 32) {
......@@ -365,7 +361,7 @@ int GetModuleFileName(HANDLE hModule, LPSTR lpFileName, short nSize)
/* check loaded dlls */
if ((w = GetFileInfo(hModule)) == NULL)
return 0;
str = GetDosFileName(w->filename);
str = DOS_GetDosFileName(w->filename);
if (nSize > strlen(str)) nSize = strlen(str) + 1;
strncpy(lpFileName, str, nSize);
dprintf_module(stddeb,"GetModuleFileName copied '%s' return %d \n", lpFileName, nSize);
......@@ -406,9 +402,9 @@ void FreeLibrary(HANDLE hLib)
if (lpMod->Count == 1) {
wpnt = GetFileInfo(hLib);
if (wpnt->ne)
NEunloadImage(wpnt);
NE_UnloadImage(wpnt);
else
PEunloadImage(wpnt);
PE_UnloadImage(wpnt);
if (hLib != (HANDLE)NULL) GlobalFree(hLib);
if (lpMod->ModuleName != NULL) free(lpMod->ModuleName);
if (lpMod->FileName != NULL) free(lpMod->FileName);
......
/*
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
......@@ -11,26 +12,24 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <errno.h>
#include "neexe.h"
#include "segmem.h"
#include "prototypes.h"
#include "dos_fs.h"
#include "dlls.h"
#include "wine.h"
#include "library.h"
#include "windows.h"
#include "wineopts.h"
#include "arch.h"
#include "dos_fs.h"
#include "task.h"
#include "prototypes.h"
#include "options.h"
#include "if1632.h"
#include "ne_image.h"
#include "pe_image.h"
#include "stddebug.h"
/* #define DEBUG_DLL */
/* #undef DEBUG_DLL */
#include "debug.h"
char *GetDosFileName(char *unixfilename);
extern char WindowsPath[256];
char **Argv;
int Argc;
HINSTANCE hSysRes;
HINSTANCE hSysRes, hInstMain;
unsigned short WIN_StackSize;
unsigned short WIN_HeapSize;
......@@ -55,8 +54,8 @@ myerror(const char *s)
int _WinMain(int argc, char **argv)
{
char *p, filename[256];
HANDLE hTaskMain;
HINSTANCE hInstMain;
HANDLE hTaskMain;
struct w_files *wpnt;
#ifdef WINESTAT
char * cp;
......@@ -73,11 +72,11 @@ int _WinMain(int argc, char **argv)
filename[p - Argv[0]] = '\0';
strcat(WindowsPath, ";");
if (strchr(filename, '/'))
strcat(WindowsPath, GetDosFileName(filename));
strcat(WindowsPath, DOS_GetDosFileName(filename));
else
strcat(WindowsPath, filename);
}
if ((hInstMain = LoadImage(Argv[0], EXE, 1)) < 32) {
fprintf(stderr, "wine: can't load %s!.\n", Argv[0]);
exit(1);
......@@ -97,6 +96,7 @@ int _WinMain(int argc, char **argv)
dprintf_dll(stddeb,"System Resources Loaded // hSysRes='%04X'\n",
hSysRes);
#ifdef WINESTAT
cp = strrchr(argv[0], '/');
if(!cp) cp = argv[0];
......@@ -117,9 +117,9 @@ int _WinMain(int argc, char **argv)
wine_debug(0, NULL);
if (wpnt->ne)
StartNEprogram(wpnt);
return(NE_StartProgram(wpnt));
else
StartPEprogram(wpnt);
return(PE_StartProgram(wpnt));
}
#endif /* #ifndef WINELIB */
/*
static char RCSId[] = "$Id: ne_resource.c,v 1.4 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -13,6 +14,8 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "peexe.h"
#include "arch.h"
#include "dlls.h"
#include "library.h"
#include "heap.h"
#include "resource.h"
#include "stddebug.h"
#include "debug.h"
......
......@@ -17,6 +17,7 @@
#include "dlls.h"
#include "neexe.h"
#include "peexe.h"
#include "pe_image.h"
#define MAP_ANONYMOUS 0x20
......@@ -133,10 +134,10 @@ static void dump_table(struct w_files *wpnt)
}
/**********************************************************************
* LoadPEImage
* PE_LoadImage
* Load one PE format executable into memory
*/
HINSTANCE LoadPEImage(struct w_files *wpnt)
HINSTANCE PE_LoadImage(struct w_files *wpnt)
{
int i, result;
......@@ -159,8 +160,8 @@ HINSTANCE LoadPEImage(struct w_files *wpnt)
for(i=0; i < wpnt->pe->pe_header->coff.NumberOfSections; i++)
{
if(!load_addr) {
result = xmmap(0, wpnt->pe->pe_seg[i].Size_Of_Raw_Data, 7, MAP_PRIVATE,
wpnt->fd, wpnt->pe->pe_seg[i].PointerToRawData);
result = xmmap((char *)0, 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,
......@@ -190,20 +191,20 @@ HINSTANCE LoadPEImage(struct w_files *wpnt)
return (wpnt->hinstance);
}
int PEunloadImage(struct w_files *wpnt)
int PE_UnloadImage(struct w_files *wpnt)
{
printf("PEunloadImage() called!\n");
/* free resources, image, unmap */
return 1;
}
int StartPEprogram(struct w_files *wpnt)
int PE_StartProgram(struct w_files *wpnt)
{
printf("StartPEprogram() called!\n");
return 0;
}
void InitPEDLL(struct w_files *wpnt)
void PE_InitDLL(struct w_files *wpnt)
{
/* Is this a library? */
if (wpnt->pe->pe_header->coff.Characteristics & IMAGE_FILE_DLL) {
......
/*
* (c) 1994 Erik Bos <erik@hacktic.nl>
* (c) 1994 Erik Bos <erik@xs4all.nl>
*
* based on Eric Youndale's pe-test and:
*
......@@ -17,10 +17,10 @@
#include "neexe.h"
#include "peexe.h"
#include "dlls.h"
#include "pe_image.h"
#include "resource.h"
#include "stddebug.h"
/* #define DEBUG_RESOURCE */
/* #undef DEBUG_RESOURCE */
#include "debug.h"
......
/*
static char RCSId[] = "$Id: resource.c,v 1.4 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -9,27 +10,22 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <fcntl.h>
#include <unistd.h>
#include "arch.h"
#include "prototypes.h"
#include "windows.h"
#include "gdi.h"
#include "wine.h"
#include "neexe.h"
#include "icon.h"
#include "menu.h"
#include "accel.h"
#include "dlls.h"
#include "resource.h"
#include "library.h"
#include "stddebug.h"
/* #define DEBUG_RESOURCE */
/* #undef DEBUG_RESOURCE */
/* #define DEBUG_ACCEL */
/* #undef DEBUG_ACCEL */
#include "debug.h"
#include "../rc/sysresbm.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
RESOURCE *Top = NULL;
extern HINSTANCE hSysRes;
extern int NE_FindResource(HANDLE, LPSTR, LPSTR, RESOURCE *);
extern int PE_FindResource(HANDLE, LPSTR, LPSTR, RESOURCE *);
......@@ -50,13 +46,13 @@ HANDLE FindResource(HANDLE instance, LPSTR name, LPSTR type)
RESOURCE *r;
HANDLE rh;
#ifdef DEBUG_RESOURCE
if(debugging_resource){
printf("FindResource(%04X", instance);
PrintId(name);
PrintId(type);
printf(")\n");
#endif
}
if (instance == (HANDLE)NULL)
instance = hSysRes;
......@@ -364,11 +360,11 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name)
int image_size;
HBITMAP hbmpOld1, hbmpOld2;
#ifdef DEBUG_RESOURCE
if(debugging_resource){
printf("LoadIcon(%04X", instance);
PrintId(icon_name);
printf(")\n");
#endif
}
if (!(hdc = GetDC(GetDesktopWindow()))) return 0;
rsc_mem = RSC_LoadResource(instance, icon_name, (LPSTR) NE_RSCTYPE_GROUP_ICON,
......@@ -545,11 +541,11 @@ HANDLE LoadAccelerators(HANDLE instance, LPSTR lpTableName)
ACCELHEADER *lpAccelTbl;
int i, image_size, n;
#ifdef DEBUG_ACCEL
if(debugging_accel){
printf("LoadAccelerators(%04X", instance);
PrintId(lpTableName);
printf(")\n");
#endif
}
rsc_mem = RSC_LoadResource(instance, lpTableName, (LPSTR) NE_RSCTYPE_ACCELERATOR,
&image_size);
......@@ -696,11 +692,11 @@ HMENU LoadMenu(HINSTANCE instance, char *menu_name)
HANDLE hMenu_desc;
MENU_HEADER *menu_desc;
#ifdef DEBUG_MENU
if(debugging_menu){
printf("LoadMenu(%04X", instance);
PrintId(menu_name);
printf(")\n");
#endif
}
if (menu_name == NULL)
return 0;
......@@ -725,11 +721,11 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name)
int image_size;
int size;
#ifdef DEBUG_RESOURCE
if(debugging_resource){
printf("LoadBitmap(%04X", instance);
PrintId(bmp_name);
printf(")\n");
#endif
}
if (!instance) {
struct ResourceTable *it;
......@@ -737,7 +733,7 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name)
if (hbitmap)
return hbitmap;
/* Load from sysresbm */
dprintf_resource(stddeb,"Searching for %d\n",bmp_name);
dprintf_resource(stddeb,"Searching for %d\n", (int) bmp_name);
for(it=sysresbmTable;it->value;it++){
if(it->type==NE_RSCTYPE_BITMAP)
if((((int)bmp_name & 0xFFFF0000) == 0))
......
#ifndef WINELIB
/*
static char RCSId[] = "$Id: selector.c,v 1.3 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -10,7 +11,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#ifdef __linux__
#include <sys/mman.h>
#include <linux/unistd.h>
......@@ -27,11 +27,11 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "neexe.h"
#include "segmem.h"
#include "wine.h"
#include "if1632.h"
#include "windows.h"
#include "prototypes.h"
#include "stddebug.h"
/* #define DEBUG_SELECTORS */
/* #undef DEBUG_SELECTORS */
#include "debug.h"
......@@ -854,6 +854,7 @@ CreateSelectors(struct w_files * wpnt)
int old_length, file_image_length;
int saved_old_length;
auto_data_sel=0;
/*
* Allocate memory for the table to keep track of all selectors.
*/
......@@ -966,6 +967,7 @@ CreateSelectors(struct w_files * wpnt)
}
}
if(!auto_data_sel)dprintf_selectors(stddeb,"Warning: No auto_data_sel\n");
s = selectors;
for (i = 0; i < ne_header->n_segment_tab; i++, s++)
{
......
......@@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <setjmp.h>
......@@ -20,20 +21,12 @@
#endif
#include "wine.h"
#include "dos_fs.h"
#include "segmem.h"
#include "prototypes.h"
#include "miscemu.h"
#include "win.h"
extern int do_int10(struct sigcontext_struct *);
extern int do_int13(struct sigcontext_struct *);
extern int do_int15(struct sigcontext_struct *);
extern int do_int16(struct sigcontext_struct *);
extern int do_int25(struct sigcontext_struct *);
extern int do_int26(struct sigcontext_struct *);
extern int do_int2a(struct sigcontext_struct *);
extern int do_int2f(struct sigcontext_struct *);
extern int do_int31(struct sigcontext_struct *);
#if !defined(BSD4_4) || defined(linux) || defined(__FreeBSD__)
char * cstack[4096];
#endif
......@@ -75,7 +68,7 @@ int do_int(int intnum, struct sigcontext_struct *scp)
case 0x13: return do_int13(scp);
case 0x15: return do_int15(scp);
case 0x16: return do_int16(scp);
case 0x1A: return do_int1A(scp);
case 0x1a: return do_int1a(scp);
case 0x21: return do_int21(scp);
case 0x22:
......@@ -157,6 +150,26 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
scp->sc_eip += 2; /* Bypass the int instruction */
break;
case 0xe4: /* inb al,XX */
inportb_abs(scp);
scp->sc_eip += 2;
break;
case 0xe5: /* in ax,XX */
inport_abs(scp);
scp->sc_eip += 2;
break;
case 0xe6: /* outb XX,al */
outportb_abs(scp);
scp->sc_eip += 2;
break;
case 0xe7: /* out XX,ax */
outport_abs(scp);
scp->sc_eip += 2;
break;
case 0xec: /* inb al,dx */
inportb(scp);
scp->sc_eip++;
......
/*
* Tasks functions
*/
*
static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "windows.h"
#include "wine.h"
#include "if1632.h"
#include "task.h"
#include "stddebug.h"
/* #define DEBUG_TASK */
/* #undef DEBUG_TASK */
#include "debug.h"
static LPWINETASKENTRY lpTaskList = NULL;
static int nTaskCount = 0;
/**********************************************************************
* GetCurrentTask [KERNEL.36]
*/
HTASK GetCurrentTask()
HTASK GetCurrentTask(void)
{
LPWINETASKENTRY lpTask = lpTaskList;
int pid = getpid();
......@@ -43,7 +39,7 @@ HTASK GetCurrentTask()
/**********************************************************************
* GetNumTasks [KERNEL.152]
*/
WORD GetNumTasks()
WORD GetNumTasks(void)
{
dprintf_task(stddeb,"GetNumTasks() returned %d !\n", nTaskCount);
return nTaskCount;
......@@ -89,7 +85,8 @@ BOOL EnumTaskWindows(HANDLE hTask, FARPROC lpEnumFunc, LONG lParam)
BOOL bRet;
int count = 0;
LPWINETASKENTRY lpTask = lpTaskList;
dprintf_task(stddeb,"EnumTaskWindows(%04X, %08X, %08X) !\n", hTask, lpEnumFunc, lParam);
dprintf_task(stddeb,"EnumTaskWindows(%04X, %08X, %08X) !\n", hTask,
(unsigned int) lpEnumFunc, (unsigned int) lParam);
while (TRUE) {
if (lpTask->te.hTask == hTask) break;
if (lpTask == NULL) {
......
/*
static char RCSId[] = "$Id: global.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#define GLOBAL_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "windows.h"
#include "prototypes.h"
#include "toolhelp.h"
#include "heap.h"
#include "segmem.h"
#include "selectors.h"
#include "stddebug.h"
/* #define DEBUG_HEAP /* */
/* #undef DEBUG_HEAP /* */
/* #define DEBUG_HEAP */
#include "debug.h"
......@@ -182,7 +185,7 @@ GlobalAlloc(unsigned int flags, unsigned long size)
GDESC *g_prev;
void *m;
dprintf_heap(stddeb,"GlobalAlloc flags %4X, size %d\n", flags, size);
dprintf_heap(stddeb,"GlobalAlloc flags %4X, size %ld\n", flags, size);
if (size == 0) size = 1;
......@@ -259,7 +262,7 @@ GlobalAlloc(unsigned int flags, unsigned long size)
* We have a new block. Let's create a GDESC entry for it.
*/
g = malloc(sizeof(*g));
dprintf_heap(stddeb,"New GDESC %08x\n", g);
dprintf_heap(stddeb,"New GDESC %08x\n", (unsigned int) g);
if (g == NULL)
return 0;
......@@ -356,7 +359,7 @@ GlobalLock(unsigned int block)
g->lock_count++;
dprintf_heap(stddeb,"GlobalLock: returning %08x\n", g->addr);
dprintf_heap(stddeb,"GlobalLock: returning %08x\n",(unsigned int)g->addr);
return g->addr;
}
......@@ -621,7 +624,7 @@ GlobalReAlloc(unsigned int block, unsigned int new_size, unsigned int flags)
{
GDESC *g_new;
GDESC *g_start = g;
int old_segments = g_start->length;
/* int old_segments = g_start->length;*/
unsigned short next_handle = g_start->handle;
for (i = 1; i <= n_segments; i++, g = g->next)
......@@ -815,7 +818,7 @@ DWORD GetFreeSpace(UINT wFlags)
if (free_map[i] == 1)
total_free++;
dprintf_heap(stddeb,"GetFreeSpace // return %ld !\n", total_free << 16);
dprintf_heap(stddeb,"GetFreeSpace // return %ld !\n", (long) (total_free << 16));
return total_free << 16;
}
......
/*
static char RCSId[] = "$Id: heap.c,v 1.3 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
......@@ -8,9 +10,9 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "segmem.h"
#include "heap.h"
#include "regfunc.h"
#include "dlls.h"
#include "stddebug.h"
/* #define DEBUG_HEAP /* */
/* #undef DEBUG_HEAP /* */
/* #define DEBUG_HEAP */
#include "debug.h"
......@@ -22,8 +24,16 @@ HEAP_CheckHeap(MDESC **free_list)
MDESC *m;
for (m = *free_list; m != NULL; m = m->next)
{
if (((int) m & 0xffff0000) != ((int) *free_list & 0xffff0000))
{ dprintf_heap(stddeb,"Invalid block %08x\n",m);
*(char *)0 = 0;
}
if (m->prev && (((int) m->prev & 0xffff0000) != ((int) *free_list & 0xffff0000)))
{ dprintf_heap(stddeb,"Invalid prev %08x from %08x\n", m->prev, m);
*(char *)0 = 0;
}
}
}
/**********************************************************************
......@@ -49,11 +59,9 @@ HEAP_Alloc(MDESC **free_list, int flags, int bytes)
{
MDESC *m, *m_new;
dprintf_heap(stddeb,"HeapAlloc: free_list %08x, flags %x, bytes %d\n",
free_list, flags, bytes);
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
dprintf_heap(stddeb,"HeapAlloc: free_list %08x(%08x), flags %x, bytes %d\n",
(unsigned int) free_list, (unsigned int) *free_list, flags, bytes);
if(debugging_heap)HEAP_CheckHeap(free_list);
/*
* Find free block big enough.
......@@ -86,10 +94,9 @@ HEAP_Alloc(MDESC **free_list, int flags, int bytes)
m->flags = 0;
if (flags & GLOBAL_FLAGS_ZEROINIT)
memset(m + 1, 0, bytes);
dprintf_heap(stddeb,"HeapAlloc: returning %08x\n", (m + 1));
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
dprintf_heap(stddeb,"HeapAlloc: returning %08x\n",
(unsigned int) (m + 1));
if(debugging_heap)HEAP_CheckHeap(free_list);
return (void *) (m + 1);
}
}
......@@ -110,17 +117,14 @@ HEAP_Alloc(MDESC **free_list, int flags, int bytes)
m->flags = 0;
if (flags & GLOBAL_FLAGS_ZEROINIT)
memset(m + 1, 0, bytes);
dprintf_heap(stddeb,"HeapAlloc: returning %08x\n", (m + 1));
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
dprintf_heap(stddeb,"HeapAlloc: returning %08x\n",
(unsigned int) (m + 1));
if(debugging_heap)HEAP_CheckHeap(free_list);
return (void *) (m + 1);
}
dprintf_heap(stddeb,"HeapAlloc: returning %08x\n", 0);
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
if(debugging_heap)HEAP_CheckHeap(free_list);
return 0;
}
......@@ -143,15 +147,19 @@ HEAP_ReAlloc(MDESC **free_list, void *old_block,
*/
m = (MDESC *) old_block - 1;
dprintf_heap(stddeb,"HEAP_ReAlloc new_size=%d !\n", new_size);
dprintf_heap(stddeb,"HEAP_ReAlloc old_block=%08X !\n", old_block);
dprintf_heap(stddeb,"HEAP_ReAlloc m=%08X free_list=%08X !\n", m,free_list);
dprintf_heap(stddeb,"HEAP_ReAlloc m->prev=%08X !\n", m->prev);
dprintf_heap(stddeb,"HEAP_ReAlloc m->next=%08X !\n", m->next);
dprintf_heap(stddeb,"HEAP_ReAlloc *free_list=%08X !\n", *free_list);
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
dprintf_heap(stddeb,"HEAP_ReAlloc new_size=%d !\n",
(unsigned int) new_size);
dprintf_heap(stddeb,"HEAP_ReAlloc old_block=%08X !\n",
(unsigned int) old_block);
dprintf_heap(stddeb,"HEAP_ReAlloc m=%08X free_list=%08X !\n",
(unsigned int) m, (unsigned int) free_list);
dprintf_heap(stddeb,"HEAP_ReAlloc m->prev=%08X !\n",
(unsigned int) m->prev);
dprintf_heap(stddeb,"HEAP_ReAlloc m->next=%08X !\n",
(unsigned int) m->next);
dprintf_heap(stddeb,"HEAP_ReAlloc *free_list=%08X !\n",
(unsigned int) *free_list);
if(debugging_heap)HEAP_CheckHeap(free_list);
if (m->prev != m || m->next != m ||
((int) m & 0xffff0000) != ((int) *free_list & 0xffff0000))
......@@ -179,9 +187,7 @@ HEAP_ReAlloc(MDESC **free_list, void *old_block,
return NULL;
memcpy(new_p, old_block, m->length);
HEAP_Free(free_list, old_block);
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
if(debugging_heap)HEAP_CheckHeap(free_list);
return new_p;
}
......@@ -214,9 +220,7 @@ HEAP_ReAlloc(MDESC **free_list, void *old_block,
HEAP_Free(free_list, m_free + 1);
}
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
if(debugging_heap)HEAP_CheckHeap(free_list);
return old_block;
}
......@@ -233,9 +237,7 @@ HEAP_Free(MDESC **free_list, void *block)
dprintf_heap(stddeb,"HeapFree: free_list %08x, block %08x\n",
free_list, block);
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
if(debugging_heap)HEAP_CheckHeap(free_list);
/*
* Validate pointer.
......@@ -332,28 +334,44 @@ HEAP_Free(MDESC **free_list, void *block)
m_free->next = NULL;
}
#ifdef DEBUG_HEAP
HEAP_CheckHeap(free_list);
#endif
if(debugging_heap)HEAP_CheckHeap(free_list);
return 0;
}
/**********************************************************************
* HEAP_CheckLocalHeaps
*/
void
HEAP_CheckLocalHeaps(char *file,int line)
{
LHEAP *lh;
dprintf_heap(stddeb,"CheckLocalHeaps called from %s %d\n",file,line);
for(lh=LocalHeaps; lh!=NULL; lh = lh->next)
{ dprintf_heap(stddeb,"Checking heap %08x, free_list %08x\n",
lh,lh->free_list);
HEAP_CheckHeap(&lh->free_list);
}
}
/**********************************************************************
* HEAP_LocalFindHeap
*/
LHEAP *
HEAP_LocalFindHeap(unsigned short owner)
{
LHEAP *lh;
extern struct w_files *current_exe;
dprintf_heap(stddeb,"HEAP_LocalFindHeap: owner %04x\n", owner);
for (lh = LocalHeaps; lh != NULL; lh = lh->next)
{
if (lh->selector == owner)
return lh;
}
dprintf_heap(stddeb,"Warning: Local heap not found\n");
return NULL;
}
......@@ -380,6 +398,7 @@ HEAP_LocalInit(unsigned short owner, void *start, int length)
lh->local_table = NULL;
lh->delta = 0x20;
HEAP_Init(&lh->free_list, start, length);
dprintf_heap(stddeb,"HEAP_LocalInit: free_list %08x, length %04x, prev %08x, next %08x\n",&lh->free_list,lh->free_list->length, lh->free_list->prev,lh->free_list->next);
LocalHeaps = lh;
}
......@@ -408,7 +427,7 @@ WIN16_LocalAlloc(int flags, int bytes)
void *m;
dprintf_heap(stddeb,"WIN16_LocalAlloc: flags %x, bytes %d\n", flags,bytes);
dprintf_heap(stddeb," called from segment %04x\n", Stack16Frame[11]);
dprintf_heap(stddeb," called from segment %04x, ds=%04x\n", Stack16Frame[11],Stack16Frame[6]);
m = HEAP_Alloc(LOCALHEAP(), flags, bytes);
......
/*
static char RCSId[] = "$Id$";
static char Copyright[] = "Copyright Robert J. Amstadt, 1994";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -73,7 +73,7 @@ static BOOL ATOM_InitTable( ATOMTABLE ** table, WORD entries )
}
else
{
handle = LocalAlign ( LMEM_MOVEABLE, sizeof(ATOMTABLE) +
handle = (HANDLE) LocalAlign ( LMEM_MOVEABLE, sizeof(ATOMTABLE) +
(entries-1) * sizeof(HANDLE) );
if (!handle)
return FALSE;
......
......@@ -2,9 +2,8 @@
* 'Wine' Clipboard function handling
*
* Copyright 1994 Martin Ayotte
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
#include <stdlib.h>
#include <stdio.h>
......@@ -18,9 +17,8 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "prototypes.h"
#include "heap.h"
#include "win.h"
#include "clipboard.h"
#include "stddebug.h"
/* #define DEBUG_CLIPBOARD /* */
/* #undef DEBUG_CLIPBOARD /* */
#include "debug.h"
typedef struct tagCLIPFORMAT {
......@@ -304,6 +302,8 @@ BOOL ChangeClipboardChain(HWND hWnd, HWND hWndNext)
{
dprintf_clipboard(stdnimp,
"ChangeClipboardChain(%04X, %04X) !\n", hWnd, hWndNext);
return 0;
}
......@@ -343,6 +343,8 @@ int GetPriorityClipboardFormat(WORD FAR *lpPriorityList, short nCount)
{
dprintf_clipboard(stdnimp,
"GetPriorityClipboardFormat(%p, %d) !\n", lpPriorityList, nCount);
return 0;
}
......
......@@ -2,19 +2,22 @@
* COMMDLG functions
*
* Copyright 1994 Martin Ayotte
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
/*
#define DEBUG_OPENDLG
#define DEBUG_OPENDLG_DRAW
*/
#include "stdio.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dialog.h"
#include "win.h"
#include "user.h"
#include "message.h"
#include "library.h"
#include "heap.h"
#include "commdlg.h"
#include "dlgs.h"
......@@ -22,8 +25,6 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#define OPENFILEDLG2 11
#define SAVEFILEDLG2 12
extern HINSTANCE hSysRes;
static DWORD CommDlgLastError = 0;
static HBITMAP hFolder = 0;
......
......@@ -25,9 +25,10 @@
#include <sys/mount.h>
#endif
#include "wine.h"
#include "windows.h"
#include "msdos.h"
#include "prototypes.h"
/* #include "dos_fs.h" */
#include "autoconf.h"
#include "comm.h"
#include "stddebug.h"
......@@ -178,8 +179,6 @@ WORD DOS_GetEquipment(void)
int parallelports = 0;
int serialports = 0;
int x;
extern struct DosDeviceStruct COM[MAX_PORTS];
extern struct DosDeviceStruct LPT[MAX_PORTS];
/* borrowed from Ralph Brown's interrupt lists
......@@ -255,7 +254,7 @@ int DOS_ValidDirectory(char *name)
char *dirname;
struct stat s;
dprintf_dosfs(stddeb, "DOS_ValidDirectory: '%s'\n", name);
if ((dirname = GetUnixFileName(name)) == NULL)
if ((dirname = DOS_GetUnixFileName(name)) == NULL)
return 0;
if (stat(dirname,&s))
return 0;
......@@ -392,7 +391,7 @@ static void GetUnixDirName(char *rootdir, char *name)
}
char *GetUnixFileName(char *dosfilename)
char *DOS_GetUnixFileName(char *dosfilename)
{
/* a:\windows\system.ini => /dos/windows/system.ini */
......@@ -418,7 +417,7 @@ char *GetUnixFileName(char *dosfilename)
return(temp);
}
char *GetDosFileName(char *unixfilename)
char *DOS_GetDosFileName(char *unixfilename)
{
int i;
static char temp[256], rootdir[256];
......@@ -555,7 +554,7 @@ int DOS_GetFreeSpace(int drive, long *size, long *available)
return 1;
}
char *FindFile(char *buffer, int buflen, char *filename, char **extensions,
char *DOS_FindFile(char *buffer, int buflen, char *filename, char **extensions,
char *path)
{
char *workingpath, *dirname, *rootname, **e;
......@@ -566,7 +565,7 @@ char *FindFile(char *buffer, int buflen, char *filename, char **extensions,
if (strchr(filename, '\\') != NULL)
{
strncpy(buffer, GetUnixFileName(filename), buflen);
strncpy(buffer, DOS_GetUnixFileName(filename), buflen);
stat( buffer, &filestat);
if (S_ISREG(filestat.st_mode))
return buffer;
......@@ -580,7 +579,7 @@ char *FindFile(char *buffer, int buflen, char *filename, char **extensions,
return buffer;
}
dprintf_dosfs(stddeb,"FindFile: looking for %s\n", filename);
dprintf_dosfs(stddeb,"DOS_FindFile: looking for %s\n", filename);
rootnamelen = strlen(filename);
rootname = strdup(filename);
ToUnix(rootname);
......@@ -591,7 +590,7 @@ char *FindFile(char *buffer, int buflen, char *filename, char **extensions,
dirname = strtok(NULL, ";"))
{
if (strchr(dirname, '\\') != NULL)
d = opendir( GetUnixFileName(dirname) );
d = opendir( DOS_GetUnixFileName(dirname) );
else
d = opendir( dirname );
......@@ -618,7 +617,7 @@ char *FindFile(char *buffer, int buflen, char *filename, char **extensions,
if (found)
{
if (strchr(dirname, '\\') != NULL)
strncpy(buffer, GetUnixFileName(dirname), buflen);
strncpy(buffer, DOS_GetUnixFileName(dirname), buflen);
else
strncpy(buffer, dirname, buflen);
......@@ -679,7 +678,7 @@ char *WinIniFileName(void)
name = malloc(1024);
strcpy(name, GetUnixFileName(WindowsDirectory));
strcpy(name, DOS_GetUnixFileName(WindowsDirectory));
strcat(name, "/");
strcat(name, "win.ini");
......@@ -732,7 +731,7 @@ struct dosdirent *DOS_opendir(char *dosdirname)
if (x == MAX_OPEN_DIRS)
return NULL;
if ((unixdirname = GetUnixFileName(dosdirname)) == NULL)
if ((unixdirname = DOS_GetUnixFileName(dosdirname)) == NULL)
return NULL;
strcpy(temp, unixdirname);
......
......@@ -2,9 +2,8 @@
* Wine Drivers functions
*
* Copyright 1994 Martin Ayotte
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
#include <stdio.h>
#include "windows.h"
......@@ -13,13 +12,11 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "dlls.h"
#include "driver.h"
#include "stddebug.h"
/* #define DEBUG_DRIVER /* */
/* #undef DEBUG_DRIVER /* */
#include "debug.h"
LPDRIVERITEM lpDrvItemList = NULL;
void LoadStartupDrivers()
void LoadStartupDrivers(void)
{
HDRVR hDrv;
char str[256];
......
......@@ -2,9 +2,9 @@
* Escape() function.
*
* Copyright 1994 Bob Amstadt
*/
*
static char Copyright[] = "Copyright Bob Amstadt, 1994";
*/
#include <stdlib.h>
#include <stdio.h>
......
......@@ -11,11 +11,12 @@
#include "segmem.h"
#include "prototypes.h"
#include "dlls.h"
#include "wine.h"
#include "windows.h"
#include "if1632.h"
#include "callback.h"
#include "library.h"
#include "ne_image.h"
#include "stddebug.h"
/* #define DEBUG_EXEC /* */
/* #undef DEBUG_EXEC /* */
#include "debug.h"
#define HELP_CONTEXT 0x0001
......@@ -33,8 +34,6 @@
#define HELP_MULTIKEY 0x0201
#define HELP_SETWINPOS 0x0203
extern struct w_files * wine_files;
typedef struct {
WORD wEnvSeg;
LPSTR lpCmdLine;
......@@ -44,9 +43,6 @@ typedef struct {
typedef BOOL (CALLBACK * LPFNWINMAIN)(HANDLE, HANDLE, LPSTR, int);
extern int CallToInit16(unsigned long csip, unsigned long sssp,
unsigned short ds);
HANDLE CreateNewTask(HINSTANCE hInst);
#ifndef WINELIB
......@@ -113,7 +109,7 @@ void StartNewTask(HINSTANCE hInst)
dprintf_exec(stddeb,"StartNewTask() // before FixupSegment !\n");
for(w = wpnt; w; w = w->next) {
for (segment = 0; segment < w->ne->ne_header->n_segment_tab; segment++) {
if (FixupSegment(w, segment) < 0) {
if (NE_FixupSegment(w, segment) < 0) {
myerror("fixup failed.");
}
}
......@@ -227,6 +223,8 @@ BOOL ExitWindows(DWORD dwReserved, WORD wRetCode)
{
dprintf_exec(stdnimp,"EMPTY STUB !!! ExitWindows(%08lX, %04X) !\n",
dwReserved, wRetCode);
exit(wRetCode);
}
......
......@@ -8,7 +8,7 @@
* NOV 93 Erik Bos (erik@xs4all.nl)
* - removed ParseDosFileName, and DosDrive structures.
* - structures dynamically configured at runtime.
* - _lopen modified to use GetUnixFileName.
* - _lopen modified to use DOS_GetUnixFileName.
* - Existing functions modified to use dosfs functions.
* - Added _llseek, _lcreat, GetDriveType, GetTempDrive,
* GetWindowsDirectory, GetSystemDirectory, GetTempFileName.
......@@ -22,7 +22,7 @@
#include <time.h>
#include <sys/stat.h>
#include <string.h>
#include "prototypes.h"
#include "dos_fs.h"
#include "regfunc.h"
#include "windows.h"
#include "wine.h"
......@@ -30,20 +30,11 @@
#include "registers.h"
#include "options.h"
#include "stddebug.h"
/* #define DEBUG_FILE /* */
/* #undef DEBUG_FILE /* */
#include "debug.h"
#define MAX_PATH 255
char WindowsDirectory[256], SystemDirectory[256], TempDirectory[256];
extern char WindowsPath[256];
extern char WindowsPath[];
extern WORD ExtendedError;
char *GetDosFileName(char *unixfilename);
/***************************************************************************
_lopen
......@@ -56,7 +47,7 @@ INT _lopen (LPSTR lpPathName, INT iReadWrite)
char *UnixFileName;
dprintf_file(stddeb, "_lopen: open('%s', %X);\n", lpPathName, iReadWrite);
if ((UnixFileName = GetUnixFileName(lpPathName)) == NULL)
if ((UnixFileName = DOS_GetUnixFileName(lpPathName)) == NULL)
return HFILE_ERROR;
iReadWrite &= 0x000F;
handle = open (UnixFileName, iReadWrite);
......@@ -122,7 +113,6 @@ INT _lclose (INT hFile)
**************************************************************************/
INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
{
int handle;
#ifndef PROCEMU
struct sigcontext_struct ccontext;
/* To make macros like EAX happy */
......@@ -155,7 +145,7 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
ofs->nErrCode = 0;
*((int*)ofs->reserved) = 0;
if ((unixfilename = GetUnixFileName (ofs->szPathName)) == NULL)
if ((unixfilename = DOS_GetUnixFileName (ofs->szPathName)) == NULL)
{
errno_to_doserr();
ofs->nErrCode = ExtendedError;
......@@ -181,23 +171,23 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
{
char temp[MAX_PATH+1];
strcpy (filename, lpFileName);
if ( (!stat(GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
if ( (!stat(DOS_GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
break;
GetWindowsDirectory (filename,MAX_PATH);
if ((!filename[0])||(filename[strlen(filename)-1]!='\\'))
strcat(filename, "\\");
strcat (filename, lpFileName);
if ( (!stat(GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
if ( (!stat(DOS_GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
break;
GetSystemDirectory (filename,MAX_PATH);
if ((!filename[0])||(filename[strlen(filename)-1]!='\\'))
strcat(filename, "\\");
strcat (filename, lpFileName);
if ( (!stat(GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
if ( (!stat(DOS_GetUnixFileName(filename), &s)) && (S_ISREG(s.st_mode)) )
break;
if (!FindFile(temp,MAX_PATH,lpFileName,NULL,WindowsPath))
if (!DOS_FindFile(temp,MAX_PATH,lpFileName,NULL,WindowsPath))
{
strcpy(filename, GetDosFileName(temp));
strcpy(filename, DOS_GetDosFileName(temp));
break;
}
strcpy (filename, lpFileName);
......@@ -224,7 +214,7 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
/* Now on to getting some information about that file */
if (res = stat(GetUnixFileName(ofs->szPathName), &s))
if ((res = stat(DOS_GetUnixFileName(ofs->szPathName), &s)))
{
errno_to_doserr();
ofs->nErrCode = ExtendedError;
......@@ -232,21 +222,21 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
}
now = localtime (&s.st_mtime);
if (action & OF_VERIFY)
verify_time = *((int*)ofs->reserved);
*((WORD*)(&ofs->reserved[2]))=
((now->tm_hour * 0x2000) + (now->tm_min * 0x20) + (now->tm_sec / 2));
*((WORD*)(&ofs->reserved[0]))=
((now->tm_year * 0x200) + (now->tm_mon * 0x20) + now->tm_mday);
if (action & OF_EXIST)
return 0;
if (action & OF_VERIFY)
return (verify_time != *((int*)ofs->reserved));
if (action & OF_EXIST)
return 0;
/* Now we are actually going to open the file. According to Microsoft's
Knowledge Basis, this is done by calling int 21h, ax=3dh. */
......@@ -317,7 +307,7 @@ INT _lcreat (LPSTR lpszFilename, INT fnAttribute)
dprintf_file(stddeb, "_lcreat: filename %s, attributes %d\n",
lpszFilename, fnAttribute);
if ((UnixFileName = GetUnixFileName(lpszFilename)) == NULL)
if ((UnixFileName = DOS_GetUnixFileName(lpszFilename)) == NULL)
return HFILE_ERROR;
handle = open (UnixFileName, O_CREAT | O_TRUNC | O_WRONLY, 426);
......@@ -422,6 +412,8 @@ INT GetTempFileName(BYTE bDriveLetter, LPCSTR lpszPrefixString, UINT uUnique, LP
WORD SetErrorMode(WORD x)
{
dprintf_file(stdnimp,"wine: SetErrorMode %4x (ignored)\n",x);
return 1;
}
/***************************************************************************
......
/*
static char RCSId[] = "$Id: keyboard.c,v 1.2 1993/09/13 18:52:02 scott Exp $";
static char Copyright[] = "Copyright Scott A. Laird, Erik Bos 1993, 1994";
*/
#include <stdlib.h>
#include <stdio.h>
......@@ -8,8 +10,7 @@ static char Copyright[] = "Copyright Scott A. Laird, Erik Bos 1993, 1994";
#include "windows.h"
#include "keyboard.h"
#include "stddebug.h"
/* #define DEBUG_KEYBOARD /* */
/* #undef DEBUG_KEYBOARD /* */
/* #define DEBUG_KEYBOARD */
#include "debug.h"
int ToAscii(WORD wVirtKey, WORD wScanCode, LPSTR lpKeyState,
......
/*
static char Copyright[] = "Copyright Yngvi Sigurjonsson (yngvi@hafro.is), 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -164,15 +165,14 @@ char FAR* AnsiPrev(/*const*/ char FAR* start,char FAR* current)
return (current==start)?start:current-1;
}
static char Oem2Ansi[256];
static char Ansi2Oem[256];
BYTE Oem2Ansi[256], Ansi2Oem[256];
void InitOemAnsiTranslations(void)
{
static int inited=0; /* should called called in some init function*/
int transfile,i;
if(inited) return;
if(transfile=open("oem2ansi.trl",O_RDONLY)){
if((transfile=open("oem2ansi.trl",O_RDONLY))){
read(transfile,Oem2Ansi,256);
close(transfile);
}
......@@ -180,7 +180,7 @@ void InitOemAnsiTranslations(void)
for(i=0;i<256;i++) /* Needs some fixing */
Oem2Ansi[i]=i;
}
if(transfile=open("ansi2oem.trl",O_RDONLY)){
if((transfile=open("ansi2oem.trl",O_RDONLY))){
read(transfile,Ansi2Oem,256);
close(transfile);
}
......
......@@ -2,10 +2,9 @@
* Main function.
*
* Copyright 1994 Alexandre Julliard
*/
*
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -15,15 +14,30 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include "wine.h"
#include "msdos.h"
#include "windows.h"
#include "comm.h"
#include "miscemu.h"
#include "winsock.h"
#include "options.h"
#include "dos_fs.h"
#include "desktop.h"
#include "prototypes.h"
#include "texts.h"
#define DEBUG_DEFINE_VARIABLES
#include "stddebug.h"
#include "debug.h"
extern ButtonTexts ButtonText;
static char people[] = "People who have generously donated time to the Wine " \
"project include Bob Amstadt, Martin Ayotte, Erik Bos, John Brezak, "\
"Andrew Bulhak, John Burton, Peter Galbavy, Jeffery Hsu, Miguel de Icaza, " \
"Alexandre Julliard, Scott A. Laird, Peter MacDonald, David Metcalfe, " \
"John Richardson, Johannes Ruscheinski, Yngvi Sigurjonsson, Linus Torvalds, " \
"Carl Williams, Karl Guenter Wuensch, and Eric Youngdale. ";
#define WINE_CLASS "Wine" /* Class name for resources */
typedef struct tagENVENTRY {
......@@ -44,8 +58,6 @@ int screenWidth = 0, screenHeight = 0; /* Desktop window dimensions */
int screenDepth = 0; /* Screen depth to use */
int desktopX = 0, desktopY = 0; /* Desktop window position (if any) */
extern ButtonTexts ButtonText;
struct options Options =
{ /* default options */
NULL, /* spyFilename */
......@@ -71,7 +83,6 @@ static XrmOptionDescRec optionsTable[] =
{ "-synchronous", ".synchronous", XrmoptionNoArg, (caddr_t)"on" },
{ "-spy", ".spy", XrmoptionSepArg, (caddr_t)NULL },
{ "-debug", ".debug", XrmoptionNoArg, (caddr_t)"on" },
{ "-relaydbg", ".relaydbg", XrmoptionNoArg, (caddr_t)"on" },
{ "-debugmsg", ".debugmsg", XrmoptionSepArg, (caddr_t)NULL }
};
......@@ -91,7 +102,7 @@ static XrmOptionDescRec optionsTable[] =
" -synchronous Turn on synchronous display mode\n" \
" -backingstore Turn on backing store\n" \
" -spy file Turn on message spying to the specified file\n" \
" -relaydbg Display call relay information\n" \
" -relaydbg Obsolete. Use -debugmsg +relay instead\n" \
" -debugmsg name Turn debugging-messages on or off\n"
......@@ -165,7 +176,6 @@ static int MAIN_GetResource( XrmDatabase db, char *name, XrmValue *value )
static void MAIN_GetButtonText( XrmDatabase db, char *name, ButtonDesc *Button)
{
XrmValue value;
char Hotkey;
char *i;
if (MAIN_GetResource( db, name, &value))
......@@ -294,8 +304,6 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
Options.synchronous = TRUE;
if (MAIN_GetResource( db, ".backingstore", &value ))
Options.backingstore = TRUE;
if (MAIN_GetResource( db, ".relaydbg", &value ))
Options.relay_debug = TRUE;
if (MAIN_GetResource( db, ".debug", &value ))
Options.debug = TRUE;
if (MAIN_GetResource( db, ".spy", &value))
......@@ -346,9 +354,9 @@ static void MAIN_CreateDesktop( int argc, char *argv[] )
int flags;
unsigned int width = 640, height = 480; /* Default size = 640x480 */
char *name = "Wine desktop";
XSizeHints size_hints;
XWMHints wm_hints;
XClassHint class_hints;
XSizeHints *size_hints;
XWMHints *wm_hints;
XClassHint *class_hints;
XSetWindowAttributes win_attr;
XTextProperty window_name;
......@@ -372,22 +380,33 @@ static void MAIN_CreateDesktop( int argc, char *argv[] )
/* Set window manager properties */
size_hints.min_width = size_hints.max_width = width;
size_hints.min_height = size_hints.max_height = height;
size_hints.flags = PMinSize | PMaxSize;
if (flags & (XValue | YValue)) size_hints.flags |= USPosition;
if (flags & (WidthValue | HeightValue)) size_hints.flags |= USSize;
else size_hints.flags |= PSize;
wm_hints.flags = InputHint | StateHint;
wm_hints.input = True;
wm_hints.initial_state = NormalState;
class_hints.res_name = argv[0];
class_hints.res_class = "Wine";
size_hints = XAllocSizeHints();
wm_hints = XAllocWMHints();
class_hints = XAllocClassHint();
if (!size_hints || !wm_hints || !class_hints)
{
fprintf( stderr, "Not enough memory for window manager hints.\n" );
exit(1);
}
size_hints->min_width = size_hints->max_width = width;
size_hints->min_height = size_hints->max_height = height;
size_hints->flags = PMinSize | PMaxSize;
if (flags & (XValue | YValue)) size_hints->flags |= USPosition;
if (flags & (WidthValue | HeightValue)) size_hints->flags |= USSize;
else size_hints->flags |= PSize;
wm_hints->flags = InputHint | StateHint;
wm_hints->input = True;
wm_hints->initial_state = NormalState;
class_hints->res_name = argv[0];
class_hints->res_class = "Wine";
XStringListToTextProperty( &name, 1, &window_name );
XSetWMProperties( display, rootWindow, &window_name, &window_name,
argv, argc, &size_hints, &wm_hints, &class_hints );
argv, argc, size_hints, wm_hints, class_hints );
XFree( size_hints );
XFree( wm_hints );
XFree( class_hints );
/* Map window */
......
......@@ -2,10 +2,9 @@
* 'Wine' MessageBox function handling
*
* Copyright 1993 Martin Ayotte
*/
*
static char Copyright[] = "Copyright Martin Ayotte, 1993";
*/
#include <stdlib.h>
#include <stdio.h>
......@@ -18,11 +17,11 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include <unistd.h>
#include "prototypes.h"
#include "heap.h"
#include "library.h"
#include "win.h"
#include "texts.h"
#include "stddebug.h"
/* #define DEBUG_MSGBOX */
/* #undef DEBUG_MSGBOX */
#include "debug.h"
......@@ -40,7 +39,6 @@ ButtonTexts ButtonText = {
"&Ignore", 'I'
};
extern HINSTANCE hSysRes;
extern HBITMAP hUpArrow;
typedef struct tagMSGBOX {
......@@ -80,13 +78,13 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
hInst = hSysRes;
dprintf_msgbox(stddeb,"MessageBox(NULL, %08X='%s', %08X='%s', %04X)\n",
str, str, title, title, type);
dprintf_msgbox(stddeb,"MessageBox(NULL, str='%s', title='%s', %04X)\n",
str, title, type);
}
else {
hInst = wndPtr->hInstance;
dprintf_msgbox(stddeb,"MessageBox(%04X, %08X='%s', %08X='%s', %04X)\n",
hWnd, str, str, title, title, type);
dprintf_msgbox(stddeb,"MessageBox(%04X, str='%s', title='%s', %04X)\n",
hWnd, str, title, type);
}
lpmb = (LPMSGBOX) malloc(sizeof(MSGBOX));
memset(lpmb, 0, sizeof(MSGBOX));
......
......@@ -14,23 +14,21 @@
* has a NULL KeyValue returning a list of KeyNames, and a NULL
* AppName undefined. I changed GetSetProfile to match. This makes
* PROGMAN.EXE do the right thing.
*/
*
static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza";
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "wine.h"
#include "windows.h"
#include "dos_fs.h"
#include "prototypes.h"
#include "stddebug.h"
/* #define DEBUG_PROFILE */
/* #undef DEBUG_PROFILE */
#include "debug.h"
#define STRSIZE 255
#define xmalloc(x) malloc(x)
#define overflow (next == &CharBuffer [STRSIZE-1])
......@@ -53,6 +51,7 @@ typedef struct TProfile {
char *FileName;
TSecHeader *Section;
struct TProfile *link;
int changed;
} TProfile;
TProfile *Current = 0;
......@@ -80,13 +79,13 @@ static char *GetIniFileName(char *name)
return name;
if (strchr(name, '\\'))
return GetUnixFileName(name);
return DOS_GetUnixFileName(name);
GetWindowsDirectory(temp, sizeof(temp) );
strcat(temp, "\\");
strcat(temp, name);
return GetUnixFileName(temp);
return DOS_GetUnixFileName(temp);
}
static TSecHeader *load (char *filename)
......@@ -223,6 +222,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
New->link = Base;
New->FileName = strdup (FileName);
New->Section = load (FileName);
New->changed = FALSE;
Base = New;
section = New->Section;
Current = New;
......@@ -253,9 +253,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
p += slen;
}
*p = '\0';
#ifdef DEBUG_PROFILE
printf("GetSetProfile // normal end of enum !\n");
#endif
dprintf_profile(stddeb,"GetSetProfile // normal end of enum !\n");
return (Size - 2 - left);
}
for (key = section->Keys; key; key = key->link){
......@@ -264,6 +262,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
if (set){
free (key->Value);
key->Value = strdup (Default ? Default : "");
Current->changed=TRUE;
return 1;
}
ReturnedString [Size-1] = 0;
......@@ -289,6 +288,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
new_key (section, KeyName, Default);
section->link = Current->Section;
Current->Section = section;
Current->changed = TRUE;
} else {
ReturnedString [Size-1] = 0;
strncpy (ReturnedString, Default, Size-1);
......@@ -375,6 +375,8 @@ static void dump_profile (TProfile *p)
if (!p)
return;
dump_profile (p->link);
if(!p->changed)
return;
if ((profile = fopen (GetIniFileName(p->FileName), "w")) != NULL){
dump_sections (profile, p->Section);
fclose (profile);
......
/*
* Windows Properties Functions
*/
*
static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
#include <stdlib.h>
#include <stdio.h>
......@@ -158,7 +158,8 @@ BOOL SetProp(HWND hWnd, LPSTR lpStr, HANDLE hData)
GlobalUnlock(wndPtr->hProp);
return FALSE;
}
dprintf_prop(stddeb, "SetProp // entry allocated %08X\n", lpNewProp);
dprintf_prop(stddeb, "SetProp // entry allocated %08X\n",
(unsigned int) lpNewProp);
if (lpProp == NULL) {
wndPtr->hProp = hNewProp;
lpNewProp->lpPrevProp = NULL;
......@@ -199,7 +200,7 @@ int EnumProps(HWND hWnd, FARPROC lpEnumFunc)
LPPROPENTRY lpProp;
LPSTR str;
int nRet;
printf("EnumProps(%04X, %08X)\n", hWnd, lpEnumFunc);
printf("EnumProps(%04X, %08X)\n", hWnd, (unsigned int) lpEnumFunc);
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
printf("EnumProps // Bad Window handle !\n");
......
......@@ -2,9 +2,9 @@
* Rectangle-related functions
*
* Copyright 1993 Alexandre Julliard
*/
*
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
*/
#include "windows.h"
......
......@@ -7,19 +7,15 @@
#include <unistd.h>
#include "prototypes.h"
#include "windows.h"
#include "library.h"
#include "shell.h"
#include "../rc/sysres.h"
#include "stddebug.h"
/* #define DEBUG_REG */
/* #undef DEBUG_REG */
#include "debug.h"
LPKEYSTRUCT lphRootKey = NULL;
DECLARE_HANDLE(HDROP);
extern HINSTANCE hSysRes;
/*************************************************************************
* RegOpenKey [SHELL.1]
*/
......@@ -344,7 +340,7 @@ INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
else
*AppMisc = 0;
return DialogBox(hSysRes, "SHELL_ABOUT_MSGBOX", hWnd, (WNDPROC)AboutDlgProc);
return DialogBoxIndirectPtr(hSysRes, sysres_DIALOG_SHELL_ABOUT_MSGBOX, hWnd, (WNDPROC)AboutDlgProc);
}
......
/*
static char RCSId[] = "$Id: heap.c,v 1.3 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdlib.h>
#include <stdio.h>
......@@ -68,7 +70,7 @@ int WaitSoundState(int x)
fprintf(stderr, "WaitSoundState(%d)\n", x);
}
SyncAllVoices(void)
int SyncAllVoices(void)
{
fprintf(stderr, "SyncAllVoices()\n");
}
......@@ -83,7 +85,7 @@ LPINT GetThresholdEvent(void)
fprintf(stderr, "GetThresholdEvent()\n");
}
GetThresholdStatus(void)
int GetThresholdStatus(void)
{
fprintf(stderr, "GetThresholdStatus()\n");
}
......
/*
static char RCSId[] = "$Id: user.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include "prototypes.h"
#include "atom.h"
#include "gdi.h"
#include "dlls.h"
#include "selectors.h"
#include "sysmetrics.h"
#include "menu.h"
#include "dialog.h"
#include "syscolor.h"
#include "win.h"
#include "windows.h"
#include "prototypes.h"
#include "user.h"
#include "message.h"
#define USER_HEAP_SIZE 0x10000
MDESC *USER_Heap = NULL;
extern BOOL ATOM_Init();
extern BOOL GDI_Init();
extern void SYSMETRICS_Init();
extern BOOL MENU_Init();
extern BOOL WIN_CreateDesktopWindow();
#ifndef WINELIB
/***********************************************************************
* USER_HeapInit
*/
static BOOL USER_HeapInit()
static BOOL USER_HeapInit(void)
{
struct segment_descriptor_s * s;
s = GetNextSegment( 0, 0x10000 );
......
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment