Release 961208
Sun Dec 8 14:51:57 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [configure.in] Added check to see if the compiler supports building a DLL when the --with-dll option is used. * [controls/listbox.c] Don't send LBN_SELCHANGE too often. Added WM_CHARTOITEM support. * [Make.rules.in] [library/Makefile.in] Build winestub.o and link it with Winelib programs. * [objects/text.c] Added support for '&&' in DrawText(). * [tools/build.c] Added -o option. Sat Dec 7 12:07:07 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [win32/thread.c] GetCurrentThread(): return -2 (current thread pseudo-handle). GetCurrentThreadId(): return GetCurrentTask(). * [objects/font.c] [if1632/gdi32.spec] GetTextExtentPoint32{A,W}Buggy(): for future bug-compatibility. * [win32/findfile.c] FindClose(): ignore INVALID_HANDLE_VALUE (like Win95). * [windows/hook.c] [include/hook.h] [if1632/user.spec] [if1632/user32.spec] [windows/focus.c] [windows/message.c] [windows/nonclient.c] [windows/win.c] [windows/winpos.c] Hooks rewritten to support Win32. * [misc/winsock.c] WINSOCK_select(): need to put sockets with errors into exceptfds. WINSOCK_socket(): fix error return. * [windows/win.c] SetWindowWord(): call SetParent on GWW_HWNDPARENT. Wed Dec 4 22:03:05 1996 Andrew Taylor <andrew@riscan.com> * [files/dos_fs.c] Check if buf is NULL before copying string in GetFullPathName32A(). Wed Dec 4 21:40:59 1996 Robert Pouliot <krynos@clic.net> * [graphics/wing.c] [if1632/wing.spec] Implemented many WinG functions, but some don't seem to work correctly (probably due to the one not done). Wed Dec 4 03:38:25 1996 Lee Jaekil <juria@puma.kaitech.re.kr> * [misc/main.c] Implemented a few more of the SystemParametersInfo() cases. Sun Dec 1 22:30:00 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [controls/button.c] Improved focus rectangle painting. * [windows/dialog.c] [windows/defdlg.c] Fixed IE3.0 problems with DWL_MSGRESULT. Sun Dec 1 20:49:32 1996 Albrecht Kleine <kleine@ak.sax.de> * [files/profile.c] Changed error handling in PROFILE_SetString().
This commit is contained in:
parent
da0cfb3610
commit
7e6ae4ba5e
18
ANNOUNCE
18
ANNOUNCE
|
@ -1,15 +1,13 @@
|
|||
This is release 961201 of Wine, the MS Windows emulator. This is still a
|
||||
This is release 961208 of Wine, the MS Windows emulator. This is still a
|
||||
developer's only release. There are many bugs and many unimplemented API
|
||||
features. Most applications still do not work correctly.
|
||||
|
||||
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
|
||||
forget to include a ChangeLog entry.
|
||||
|
||||
WHAT'S NEW with Wine-961201: (see ChangeLog for details)
|
||||
- Better Winsock.
|
||||
- Rewritten listboxes.
|
||||
- Windows 3.1 registry loader.
|
||||
- Improved keyboard support.
|
||||
WHAT'S NEW with Wine-961208: (see ChangeLog for details)
|
||||
- Win32 hooks.
|
||||
- fnt2bdf font conversion tool.
|
||||
- Lots of bug fixes.
|
||||
|
||||
See the README file in the distribution for installation instructions.
|
||||
|
@ -18,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before
|
|||
the release is available at the ftp sites. The sources will be available
|
||||
from the following locations:
|
||||
|
||||
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-961201.tar.gz
|
||||
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-961201.tar.gz
|
||||
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-961201.tar.gz
|
||||
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-961201.tar.gz
|
||||
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-961208.tar.gz
|
||||
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-961208.tar.gz
|
||||
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-961208.tar.gz
|
||||
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-961208.tar.gz
|
||||
|
||||
It should also be available from any site that mirrors tsx-11 or sunsite.
|
||||
|
||||
|
|
15
BUGS
15
BUGS
|
@ -5,18 +5,13 @@ done something for one of the problems. You are encouraged to
|
|||
add new entries and, more importantly, remove those for the
|
||||
bugs you fixed ;-)
|
||||
------------------------------------------------------------
|
||||
As of Nov 8 1996 -
|
||||
As of Dec 1 1996 -
|
||||
|
||||
General:
|
||||
|
||||
* Combobox code is very inadequate (no notification messages,
|
||||
dropdown listboxes often stay visible, etc... ).
|
||||
|
||||
* Multicolumn and/or LBS_EXTENDEDSEL style listboxes are still
|
||||
screwed up. [julliard@lrc.epfl.ch]
|
||||
|
||||
* Winsock asynchronous functions do not work.
|
||||
|
||||
* Font mapping is too generic. No soft font loading, no rotated
|
||||
text support. [alex@amadeus.pharm.sunysb.edu]
|
||||
|
||||
|
@ -31,12 +26,16 @@ General:
|
|||
|
||||
Miscellaneous:
|
||||
|
||||
* Simple OLE actions were working in October release, got
|
||||
broken in November (in Winword "Insert Object" now results in
|
||||
segfault right after the call to LoadModule()).
|
||||
* Write and other applications have problems with displaying partially
|
||||
obscured bitmaps.
|
||||
* Asynchronous Winsock services sometimes produce zombie processes.
|
||||
* AllocCSToDSAlias() shouldn't alloc alias for the same segment multiple
|
||||
times.
|
||||
* ScrollWindowEx() is outdated.
|
||||
* HCBT_CLICKSKIPPED/HCBT_KEYSKIPPED hook actions are not implemented.
|
||||
* Write sometimes segfaults in StretchDIBits() (when inside BITBLT_GetRow)
|
||||
when only lower part of the resulting image is visible.
|
||||
|
||||
Where to look in source files:
|
||||
|
||||
|
|
73
ChangeLog
73
ChangeLog
|
@ -1,3 +1,76 @@
|
|||
----------------------------------------------------------------------
|
||||
Sun Dec 8 14:51:57 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
|
||||
|
||||
* [configure.in]
|
||||
Added check to see if the compiler supports building a DLL when
|
||||
the --with-dll option is used.
|
||||
|
||||
* [controls/listbox.c]
|
||||
Don't send LBN_SELCHANGE too often.
|
||||
Added WM_CHARTOITEM support.
|
||||
|
||||
* [Make.rules.in] [library/Makefile.in]
|
||||
Build winestub.o and link it with Winelib programs.
|
||||
|
||||
* [objects/text.c]
|
||||
Added support for '&&' in DrawText().
|
||||
|
||||
* [tools/build.c]
|
||||
Added -o option.
|
||||
|
||||
Sat Dec 7 12:07:07 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
|
||||
|
||||
* [win32/thread.c]
|
||||
GetCurrentThread(): return -2 (current thread pseudo-handle).
|
||||
GetCurrentThreadId(): return GetCurrentTask().
|
||||
|
||||
* [objects/font.c] [if1632/gdi32.spec]
|
||||
GetTextExtentPoint32{A,W}Buggy(): for future bug-compatibility.
|
||||
|
||||
* [win32/findfile.c]
|
||||
FindClose(): ignore INVALID_HANDLE_VALUE (like Win95).
|
||||
|
||||
* [windows/hook.c] [include/hook.h] [if1632/user.spec]
|
||||
[if1632/user32.spec] [windows/focus.c] [windows/message.c]
|
||||
[windows/nonclient.c] [windows/win.c] [windows/winpos.c]
|
||||
Hooks rewritten to support Win32.
|
||||
|
||||
* [misc/winsock.c]
|
||||
WINSOCK_select(): need to put sockets with errors into exceptfds.
|
||||
WINSOCK_socket(): fix error return.
|
||||
|
||||
* [windows/win.c]
|
||||
SetWindowWord(): call SetParent on GWW_HWNDPARENT.
|
||||
|
||||
Wed Dec 4 22:03:05 1996 Andrew Taylor <andrew@riscan.com>
|
||||
|
||||
* [files/dos_fs.c]
|
||||
Check if buf is NULL before copying string in GetFullPathName32A().
|
||||
|
||||
Wed Dec 4 21:40:59 1996 Robert Pouliot <krynos@clic.net>
|
||||
|
||||
* [graphics/wing.c] [if1632/wing.spec]
|
||||
Implemented many WinG functions, but some don't seem to
|
||||
work correctly (probably due to the one not done).
|
||||
|
||||
Wed Dec 4 03:38:25 1996 Lee Jaekil <juria@puma.kaitech.re.kr>
|
||||
|
||||
* [misc/main.c]
|
||||
Implemented a few more of the SystemParametersInfo() cases.
|
||||
|
||||
Sun Dec 1 22:30:00 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu>
|
||||
|
||||
* [controls/button.c]
|
||||
Improved focus rectangle painting.
|
||||
|
||||
* [windows/dialog.c] [windows/defdlg.c]
|
||||
Fixed IE3.0 problems with DWL_MSGRESULT.
|
||||
|
||||
Sun Dec 1 20:49:32 1996 Albrecht Kleine <kleine@ak.sax.de>
|
||||
|
||||
* [files/profile.c]
|
||||
Changed error handling in PROFILE_SetString().
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
# Global rules shared by all makefiles -*-Makefile-*-
|
||||
#
|
||||
# Each individual makefile should define the following variables:
|
||||
# TOPSRCDIR : top-level source directory
|
||||
# TOPOBJDIR : top-level object directory
|
||||
# SRCDIR : source directory for this module
|
||||
# MODULE : name of the module being built
|
||||
# C_SRCS : C sources for the module
|
||||
# GEN_C_SRCS : generated C sources (optional)
|
||||
# ASM_SRCS : assembly sources (optional)
|
||||
# EXTRA_OBJS : extra object files (optional)
|
||||
# TOPSRCDIR : top-level source directory
|
||||
# TOPOBJDIR : top-level object directory
|
||||
# SRCDIR : source directory for this module
|
||||
# MODULE : name of the module being built
|
||||
# C_SRCS : C sources for the module
|
||||
# GEN_C_SRCS : generated C sources (optional)
|
||||
# ASM_SRCS : assembly sources (optional)
|
||||
# GEN_ASM_SRCS : generated assembly sources (optional)
|
||||
# EXTRA_OBJS : extra object files (optional)
|
||||
|
||||
# First some useful definitions
|
||||
|
||||
|
@ -21,7 +22,7 @@ X_CFLAGS = @X_CFLAGS@
|
|||
X_LIBS = @X_LIBS@
|
||||
XPM_LIB = -lXpm
|
||||
XLIB = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
|
||||
WINELIB = -L$(TOPOBJDIR) -lwine
|
||||
WINELIB = $(WINESTUB) $(TOPOBJDIR)/@MAIN_TARGET@
|
||||
LDLIBS = @LDLIBS@
|
||||
YACC = @YACC@
|
||||
LEX = @LEX@
|
||||
|
@ -33,10 +34,12 @@ RM = rm -f
|
|||
BUILD = $(TOPOBJDIR)/tools/build
|
||||
MAKEDEP = $(TOPOBJDIR)/tools/makedep
|
||||
WINERC = $(TOPOBJDIR)/rc/winerc
|
||||
WINESTUB = $(TOPOBJDIR)/library/winestub.o
|
||||
SUBMAKE = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'OPTIONS=$(OPTIONS)'
|
||||
@SET_MAKE@
|
||||
|
||||
OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
|
||||
OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) \
|
||||
$(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
|
||||
|
||||
# Implicit rules
|
||||
|
||||
|
@ -45,6 +48,9 @@ OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
|
|||
.c.o:
|
||||
$(CC) -c $(ALLCFLAGS) -o $*.o $<
|
||||
|
||||
.s.o:
|
||||
$(CC) -c -o $*.o $<
|
||||
|
||||
.S.o:
|
||||
$(CC) -c -o $*.o $<
|
||||
|
||||
|
@ -85,7 +91,7 @@ depend:: $(MAKEDEP) $(C_SRCS) $(GEN_C_SRCS)
|
|||
$(MAKEDEP) $(DIVINCL) -C. $(GEN_C_SRCS) -C$(SRCDIR) $(C_SRCS)
|
||||
|
||||
clean::
|
||||
$(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc winerctmp.c $(GEN_C_SRCS) $(GEN_C_SRCS:.c=.h) $(PROGRAMS)
|
||||
$(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc winerctmp.c $(GEN_C_SRCS) $(GEN_C_SRCS:.c=.h) $(GEN_ASM_SRCS) $(PROGRAMS)
|
||||
|
||||
dummy:
|
||||
|
||||
|
|
22
configure.in
22
configure.in
|
@ -18,7 +18,7 @@ AC_ARG_WITH(library,
|
|||
|
||||
AC_ARG_WITH(dll,
|
||||
[ --with-dll build Wine as a DLL instead of an emulator],
|
||||
[OPTIONS="-DWINELIB -DWINELIBDLL" MAIN_TARGET="libwine.so.1.0" CFLAGS="$CFLAGS -fPIC"])
|
||||
[OPTIONS="-DWINELIB" MAIN_TARGET="libwine.so.1.0"])
|
||||
|
||||
AC_ARG_WITH(ipc,
|
||||
[ --with-ipc use inter-process communication for DDE],
|
||||
|
@ -45,7 +45,6 @@ dnl **** Check for gcc strength-reduce bug ****
|
|||
if test "x${GCC}" = "xyes"
|
||||
then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
AC_C_CROSS
|
||||
AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
|
||||
AC_TRY_RUN([
|
||||
int main(void) {
|
||||
|
@ -83,6 +82,25 @@ then
|
|||
AC_DEFINE(NEED_UNDERSCORE_PREFIX)
|
||||
fi
|
||||
|
||||
dnl **** Check for working dll ****
|
||||
|
||||
if test "$MAIN_TARGET" = "libwine.so.1.0"
|
||||
then
|
||||
AC_CACHE_CHECK("whether we can build a dll",
|
||||
ac_cv_c_dll,
|
||||
[saved_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
|
||||
AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
|
||||
CFLAGS=$saved_cflags
|
||||
])
|
||||
if test "$ac_cv_c_dll" = "yes"
|
||||
then
|
||||
CFLAGS="$CFLAGS -fPIC"
|
||||
else
|
||||
MAIN_TARGET="libwine.a"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl **** Check for functions and header files ****
|
||||
|
||||
AC_CHECK_FUNCS(memmove tcgetattr usleep)
|
||||
|
|
|
@ -427,11 +427,15 @@ static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
|
|||
{
|
||||
/* again, this is what CTL3D expects */
|
||||
|
||||
DWORD tm = (textlen) ? GetTextExtent( hDC, wndPtr->text, textlen) : 0x00020002;
|
||||
delta = (rtext.bottom - rtext.top - HIWORD(tm) - 1)/2;
|
||||
|
||||
rbox.bottom = (rbox.top = rtext.top + delta - 1) + HIWORD(tm) + 2;
|
||||
rbox.right = (rbox.left = --rtext.left) + LOWORD(tm) + 2;
|
||||
SetRectEmpty16(&rbox);
|
||||
if( textlen )
|
||||
DrawText16( hDC, wndPtr->text, textlen, &rbox,
|
||||
DT_SINGLELINE | DT_CALCRECT );
|
||||
textlen = rbox.bottom - rbox.top;
|
||||
delta = ((rtext.bottom - rtext.top) - textlen)/2;
|
||||
rbox.bottom = (rbox.top = rtext.top + delta - 1) + textlen + 2;
|
||||
textlen = rbox.right - rbox.left;
|
||||
rbox.right = (rbox.left += --rtext.left) + textlen + 2;
|
||||
IntersectRect16(&rbox, &rbox, &rtext);
|
||||
DrawFocusRect16( hDC, &rbox );
|
||||
}
|
||||
|
|
|
@ -1130,8 +1130,6 @@ static LRESULT LISTBOX_SelectItemRange( WND *wnd, LB_DESCR *descr, INT32 first,
|
|||
LISTBOX_RepaintItem( wnd, descr, i, ODA_SELECT );
|
||||
}
|
||||
}
|
||||
if (descr->style & LBS_NOTIFY)
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
|
||||
return LB_OKAY;
|
||||
}
|
||||
|
||||
|
@ -1180,7 +1178,6 @@ static LRESULT LISTBOX_SetSelection( WND *wnd, LB_DESCR *descr, INT32 index,
|
|||
if (oldsel != -1) descr->items[oldsel].selected = FALSE;
|
||||
if (index != -1) descr->items[index].selected = TRUE;
|
||||
descr->selected_item = index;
|
||||
/* FIXME if (index != -1) LISTBOX_MakeItemVisible( wnd, descr, index );*/
|
||||
if (oldsel != -1) LISTBOX_RepaintItem( wnd, descr, oldsel, ODA_SELECT);
|
||||
if (index != -1) LISTBOX_RepaintItem( wnd, descr, index, ODA_SELECT );
|
||||
if (send_notify) SEND_NOTIFICATION( wnd, descr,
|
||||
|
@ -1214,8 +1211,7 @@ static void LISTBOX_MoveCaret( WND *wnd, LB_DESCR *descr, INT32 index,
|
|||
else if (!(descr->style & LBS_MULTIPLESEL) && (descr->selected_item != -1))
|
||||
{
|
||||
/* Set selection to new caret item */
|
||||
LISTBOX_SetSelection( wnd, descr, index, TRUE,
|
||||
(descr->style & LBS_NOTIFY) != 0 );
|
||||
LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1683,8 +1679,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
|
|||
{
|
||||
LISTBOX_SetCaretIndex( wnd, descr, index, FALSE );
|
||||
LISTBOX_SetSelection( wnd, descr, index,
|
||||
!descr->items[index].selected,
|
||||
(descr->style & LBS_NOTIFY) != 0 );
|
||||
!descr->items[index].selected, FALSE );
|
||||
}
|
||||
else LISTBOX_MoveCaret( wnd, descr, index, FALSE );
|
||||
}
|
||||
|
@ -1693,8 +1688,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
|
|||
LISTBOX_MoveCaret( wnd, descr, index, FALSE );
|
||||
LISTBOX_SetSelection( wnd, descr, index,
|
||||
(!(descr->style & LBS_MULTIPLESEL) ||
|
||||
!descr->items[index].selected),
|
||||
(descr->style & LBS_NOTIFY) != 0 );
|
||||
!descr->items[index].selected), FALSE );
|
||||
}
|
||||
}
|
||||
SetFocus32( wnd->hwndSelf );
|
||||
|
@ -1715,6 +1709,21 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* LISTBOX_HandleLButtonUp
|
||||
*/
|
||||
static LRESULT LISTBOX_HandleLButtonUp( WND *wnd, LB_DESCR *descr )
|
||||
{
|
||||
if (LISTBOX_Timer != LB_TIMER_NONE)
|
||||
KillSystemTimer32( wnd->hwndSelf, LB_TIMER_ID );
|
||||
LISTBOX_Timer = LB_TIMER_NONE;
|
||||
if (GetCapture32() == wnd->hwndSelf) ReleaseCapture();
|
||||
if (descr->style & LBS_NOTIFY)
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* LISTBOX_HandleTimer
|
||||
*
|
||||
|
@ -1883,16 +1892,13 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr,
|
|||
caret = descr->nb_items - 1;
|
||||
break;
|
||||
case VK_SPACE:
|
||||
if (descr->style & LBS_EXTENDEDSEL)
|
||||
{
|
||||
if (!(GetKeyState(VK_SHIFT) & 0x8000))
|
||||
descr->anchor_item = descr->focus_item;
|
||||
LISTBOX_MoveCaret( wnd, descr, descr->focus_item, TRUE );
|
||||
}
|
||||
if (descr->style & LBS_EXTENDEDSEL) caret = descr->focus_item;
|
||||
else if (descr->style & LBS_MULTIPLESEL)
|
||||
{
|
||||
LISTBOX_SetSelection( wnd, descr, descr->focus_item,
|
||||
!descr->items[descr->focus_item].selected,
|
||||
(descr->style & LBS_NOTIFY) != 0 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (caret >= 0)
|
||||
|
@ -1901,6 +1907,8 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr,
|
|||
!(GetKeyState( VK_SHIFT ) & 0x8000))
|
||||
descr->anchor_item = caret;
|
||||
LISTBOX_MoveCaret( wnd, descr, caret, TRUE );
|
||||
if (descr->style & LBS_NOTIFY)
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1912,11 +1920,24 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr,
|
|||
static LRESULT LISTBOX_HandleChar( WND *wnd, LB_DESCR *descr,
|
||||
WPARAM32 wParam )
|
||||
{
|
||||
INT32 index;
|
||||
INT32 caret = -1;
|
||||
char str[2] = { wParam & 0xff, '\0' };
|
||||
|
||||
index = LISTBOX_FindString( wnd, descr, descr->focus_item, str, FALSE );
|
||||
if (index != LB_ERR) LISTBOX_MoveCaret( wnd, descr, index, TRUE );
|
||||
if (descr->style & LBS_WANTKEYBOARDINPUT)
|
||||
{
|
||||
caret = SendMessage32A( descr->owner, WM_CHARTOITEM,
|
||||
MAKEWPARAM(LOWORD(wParam), descr->focus_item),
|
||||
wnd->hwndSelf );
|
||||
if (caret == -2) return 0;
|
||||
}
|
||||
if (caret == -1)
|
||||
caret = LISTBOX_FindString( wnd, descr, descr->focus_item, str, FALSE);
|
||||
if (caret != -1)
|
||||
{
|
||||
LISTBOX_MoveCaret( wnd, descr, caret, TRUE );
|
||||
if (descr->style & LBS_NOTIFY)
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2159,8 +2180,7 @@ LRESULT ListBoxWndProc(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
|||
INT32 index = LISTBOX_FindString( wnd, descr, wParam,
|
||||
(LPCSTR)lParam, FALSE );
|
||||
if (index == LB_ERR) return LB_ERR;
|
||||
LISTBOX_SetSelection( wnd, descr, index, TRUE,
|
||||
(descr->style & LBS_NOTIFY) != 0 );
|
||||
LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
|
||||
return index;
|
||||
}
|
||||
|
||||
|
@ -2176,13 +2196,13 @@ LRESULT ListBoxWndProc(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
|||
lParam = (INT32)(INT16)lParam;
|
||||
/* fall through */
|
||||
case LB_SETSEL32:
|
||||
return LISTBOX_SetSelection( wnd, descr, lParam, wParam,
|
||||
(descr->style & LBS_NOTIFY) != 0 );
|
||||
return LISTBOX_SetSelection( wnd, descr, lParam, wParam, FALSE );
|
||||
|
||||
case LB_SETCURSEL16:
|
||||
wParam = (INT32)(INT16)wParam;
|
||||
/* fall through */
|
||||
case LB_SETCURSEL32:
|
||||
if (wParam != -1) LISTBOX_MakeItemVisible( wnd, descr, wParam, TRUE );
|
||||
return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
|
||||
|
||||
case LB_GETSELCOUNT16:
|
||||
|
@ -2344,11 +2364,7 @@ LRESULT ListBoxWndProc(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
|||
return 0;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
if (LISTBOX_Timer != LB_TIMER_NONE)
|
||||
KillSystemTimer32( hwnd, LB_TIMER_ID );
|
||||
LISTBOX_Timer = LB_TIMER_NONE;
|
||||
if (GetCapture32() == hwnd) ReleaseCapture();
|
||||
return 0;
|
||||
return LISTBOX_HandleLButtonUp( wnd, descr );
|
||||
|
||||
case WM_KEYDOWN:
|
||||
return LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||
|
|
|
@ -137,7 +137,9 @@ void DEBUG_SetBreakpoints( BOOL32 set )
|
|||
{
|
||||
if (breakpoints[i].in_use && breakpoints[i].enabled)
|
||||
{
|
||||
if (DEBUG_IsBadWritePtr( &breakpoints[i].addr, 1 ))
|
||||
/* Note: we check for read here, because if reading is allowed */
|
||||
/* writing permission will be forced in DEBUG_SetOpcode. */
|
||||
if (DEBUG_IsBadReadPtr( &breakpoints[i].addr, 1 ))
|
||||
{
|
||||
fprintf( stderr, "Invalid address for breakpoint %d, disabling it\n", i );
|
||||
breakpoints[i].enabled = FALSE;
|
||||
|
|
|
@ -888,12 +888,15 @@ DWORD GetShortPathName32W( LPCWSTR longpath, LPWSTR shortpath, DWORD shortlen )
|
|||
/***********************************************************************
|
||||
* GetFullPathNameA (KERNEL32.272)
|
||||
*/
|
||||
DWORD GetFullPathName32A( LPCSTR fn, DWORD buflen, LPSTR buf, LPSTR *lastpart) {
|
||||
DWORD GetFullPathName32A( LPCSTR fn, DWORD buflen, LPSTR buf, LPSTR *lastpart)
|
||||
{
|
||||
dprintf_file(stddeb,"GetFullPathNameA(%s)\n",fn);
|
||||
/* FIXME */
|
||||
lstrcpyn32A(buf,fn,buflen);
|
||||
if (lastpart)
|
||||
*lastpart=strrchr(buf,'\\');
|
||||
if (buf)
|
||||
{
|
||||
lstrcpyn32A(buf,fn,buflen);
|
||||
if (lastpart) *lastpart = strrchr(buf,'\\');
|
||||
}
|
||||
return strlen(fn);
|
||||
}
|
||||
|
||||
|
|
|
@ -506,22 +506,21 @@ static INT32 PROFILE_GetString( LPCSTR section, LPCSTR key_name,
|
|||
static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
|
||||
LPCSTR value )
|
||||
{
|
||||
BOOL32 ret;
|
||||
|
||||
if (!key_name) /* Delete a whole section */
|
||||
{
|
||||
dprintf_profile(stddeb, "PROFILE_DeleteSection('%s')\n", section_name);
|
||||
ret = PROFILE_DeleteSection( &CurProfile.section, section_name );
|
||||
CurProfile.changed |= ret;
|
||||
return ret;
|
||||
CurProfile.changed |= PROFILE_DeleteSection( &CurProfile.section,
|
||||
section_name );
|
||||
return TRUE; /* Even if PROFILE_DeleteSection() has failed,
|
||||
this is not an error on application's level.*/
|
||||
}
|
||||
else if (!value) /* Delete a key */
|
||||
{
|
||||
dprintf_profile( stddeb, "PROFILE_DeleteKey('%s','%s')\n",
|
||||
section_name, key_name );
|
||||
ret = PROFILE_DeleteKey( &CurProfile.section, section_name, key_name );
|
||||
CurProfile.changed |= ret;
|
||||
return ret;
|
||||
CurProfile.changed |= PROFILE_DeleteKey( &CurProfile.section,
|
||||
section_name, key_name );
|
||||
return TRUE; /* same error handling as above */
|
||||
}
|
||||
else /* Set the key value */
|
||||
{
|
||||
|
@ -542,8 +541,8 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
|
|||
else dprintf_profile( stddeb, "creating key\n" );
|
||||
key->value = xstrdup( value );
|
||||
CurProfile.changed = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ VPATH = @srcdir@
|
|||
MODULE = graphics
|
||||
|
||||
C_SRCS = \
|
||||
wing.c \
|
||||
bitblt.c \
|
||||
driver.c
|
||||
driver.c \
|
||||
wing.c
|
||||
|
||||
all: $(MODULE).o
|
||||
|
||||
|
|
|
@ -5,19 +5,10 @@
|
|||
*/
|
||||
|
||||
#include "gdi.h"
|
||||
#include "windows.h"
|
||||
#include "stddebug.h"
|
||||
#include "debug.h"
|
||||
|
||||
/* I dunno if this structure can be put here... Maybe copyright, I'm no lawyer... */
|
||||
typedef enum WING_DITHER_TYPE
|
||||
{
|
||||
WING_DISPERSED_4x4,
|
||||
WING_DISPERSED_8x8,
|
||||
|
||||
WING_CLUSTERED_4x4
|
||||
|
||||
} WING_DITHER_TYPE;
|
||||
|
||||
/***********************************************************************
|
||||
* WingCreateDC16 (WING.1001)
|
||||
*/
|
||||
|
@ -33,8 +24,21 @@ HDC16 WinGCreateDC16(void)
|
|||
*/
|
||||
BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt)
|
||||
{
|
||||
fprintf(stdnimp,"WinGRecommendDIBFormat: empty stub!\n");
|
||||
return 0;
|
||||
HDC16 i=GetDC16(0);
|
||||
|
||||
fmt->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
|
||||
fmt->bmiHeader.biWidth=0;
|
||||
fmt->bmiHeader.biHeight=1; /* The important part */
|
||||
fmt->bmiHeader.biPlanes=GetDeviceCaps(i, PLANES);
|
||||
fmt->bmiHeader.biBitCount=GetDeviceCaps(i, BITSPIXEL);
|
||||
fmt->bmiHeader.biCompression=BI_RGB;
|
||||
fmt->bmiHeader.biSizeImage=0;
|
||||
fmt->bmiHeader.biXPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSX);
|
||||
fmt->bmiHeader.biYPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSY);
|
||||
fmt->bmiHeader.biClrUsed=0;
|
||||
fmt->bmiHeader.biClrImportant=0;
|
||||
ReleaseDC16(0, i);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -42,26 +46,82 @@ BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt)
|
|||
*/
|
||||
HBITMAP16 WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, void **bits)
|
||||
{
|
||||
fprintf(stdnimp,"WinGCreateBitmap: empty stub! (expect failure)\n");
|
||||
*bits=0;
|
||||
fprintf(stdnimp,"WinGCreateBitmap: almost empty stub! (expect failure)\n");
|
||||
/* Assume RGB color */
|
||||
if(bits==NULL)
|
||||
return CreateDIBitmap(winDC, header, 0, bits, header, 0);
|
||||
else
|
||||
return CreateDIBitmap(winDC, header, 1, bits, header, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinGGetDIBPointer16 (WING.1004)
|
||||
*/
|
||||
void* WinGGetDIBPointer16(HBITMAP16 bmap, BITMAPINFO *header)
|
||||
{
|
||||
fprintf(stdnimp,"WinGGetDIBPointer16: empty stub!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinGGetDIBColorTable16 (WING.1005)
|
||||
*/
|
||||
UINT16 WinGGetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry,
|
||||
RGBQUAD* colors)
|
||||
{
|
||||
return GetPaletteEntries(winDC, start, numentry, colors);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinGSetDIBColorTable16 (WING.1006)
|
||||
*/
|
||||
UINT16 WinGSetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry,
|
||||
RGBQUAD* colors)
|
||||
{
|
||||
return SetPaletteEntries(winDC, start, numentry, colors);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* WinGCreateHalfTonePalette16 (WING.1007)
|
||||
*/
|
||||
HPALETTE16 WinGCreateHalfTonePalette16(void)
|
||||
{
|
||||
fprintf(stdnimp,"WinGCreateHalfTonePalette: empty stub!\n");
|
||||
fprintf(stdnimp,"WinGCreateHalfTonePalette16: empty stub!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinGCreateHalfToneBrush16 (WING.1008)
|
||||
*/
|
||||
HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, WING_DITHER_TYPE type)
|
||||
HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, INT16 dithertype)
|
||||
{
|
||||
fprintf(stdnimp,"WinGCreateHalfToneBrush: empty stub!\n");
|
||||
fprintf(stdnimp,"WinGCreateHalfToneBrush16: empty stub!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinGStretchBlt16 (WING.1009)
|
||||
*/
|
||||
BOOL16 WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest,
|
||||
INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc,
|
||||
INT16 widSrc, INT16 heiSrc)
|
||||
{
|
||||
|
||||
return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
|
||||
/* fprintf(stdnimp,"WinGStretchBlt16: empty stub!\n");*/
|
||||
/* return 0; */
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinGBitBlt16 (WING.1010)
|
||||
*/
|
||||
BOOL16 WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest,
|
||||
INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc)
|
||||
{
|
||||
return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, SRCCOPY);
|
||||
/* fprintf(stdnimp,"WinGBitBlt16: empty stub!\n");*/
|
||||
/* return 0;*/
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ DLLS = \
|
|||
comdlg32.spec \
|
||||
commdlg.spec \
|
||||
compobj.spec \
|
||||
crtdll.spec \
|
||||
crtdll.spec \
|
||||
ddeml.spec \
|
||||
gdi.spec \
|
||||
gdi32.spec \
|
||||
|
@ -23,7 +23,7 @@ DLLS = \
|
|||
mmsystem.spec \
|
||||
mouse.spec \
|
||||
mpr.spec \
|
||||
ntdll.spec \
|
||||
ntdll.spec \
|
||||
ole2.spec \
|
||||
ole2conv.spec \
|
||||
ole2disp.spec \
|
||||
|
@ -52,7 +52,7 @@ DLLS = \
|
|||
wprocs.spec \
|
||||
wsock32.spec
|
||||
|
||||
SPEC_FILES = $(DLLS:.spec=.S)
|
||||
SPEC_FILES = $(DLLS:.spec=.s)
|
||||
|
||||
C_SRCS = \
|
||||
dummy.c \
|
||||
|
@ -60,17 +60,19 @@ C_SRCS = \
|
|||
thunk.c
|
||||
|
||||
ASM_SRCS = \
|
||||
$(SPEC_FILES) \
|
||||
callfrom16.S \
|
||||
callfrom32.S \
|
||||
callto16.S \
|
||||
callto32.S \
|
||||
except.S
|
||||
|
||||
GEN_ASM_SRCS = \
|
||||
$(SPEC_FILES) \
|
||||
callfrom16.s \
|
||||
callfrom32.s \
|
||||
callto16.s \
|
||||
callto32.s \
|
||||
|
||||
.SUFFIXES: .spec
|
||||
|
||||
.spec.S:
|
||||
$(BUILD) -spec $< > $*.S
|
||||
.spec.s:
|
||||
$(BUILD) -o $@ -spec $<
|
||||
|
||||
all: checkbuild $(MODULE).o
|
||||
|
||||
|
@ -81,22 +83,19 @@ $(SPEC_FILES): $(BUILD)
|
|||
$(BUILD) checkbuild:
|
||||
cd $(TOPOBJDIR)/tools; $(SUBMAKE) build
|
||||
|
||||
callfrom16.S: $(SPEC_FILES)
|
||||
$(BUILD) -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq` > callfrom16.S
|
||||
callfrom16.s: $(SPEC_FILES)
|
||||
$(BUILD) -o $@ -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq`
|
||||
|
||||
callfrom32.S: $(SPEC_FILES)
|
||||
$(BUILD) -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\(.*\)/\1/' | sort | uniq` > callfrom32.S
|
||||
callfrom32.s: $(SPEC_FILES)
|
||||
$(BUILD) -o $@ -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\(.*\)/\1/' | sort | uniq`
|
||||
|
||||
callto16.S: $(TOPSRCDIR)/include/callback.h $(BUILD)
|
||||
$(BUILD) -callto16 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > callto16.S
|
||||
callto16.s: $(TOPSRCDIR)/include/callback.h $(BUILD)
|
||||
$(BUILD) -o $@ -callto16 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq`
|
||||
|
||||
callto32.S: $(TOPSRCDIR)/include/callback.h $(BUILD)
|
||||
$(BUILD) -callto32 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo32_" | sed 's/.*CallTo32_\(.*\)(.*/\1/' | sort | uniq` > callto32.S
|
||||
callto32.s: $(TOPSRCDIR)/include/callback.h $(BUILD)
|
||||
$(BUILD) -o $@ -callto32 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo32_" | sed 's/.*CallTo32_\(.*\)(.*/\1/' | sort | uniq`
|
||||
|
||||
except.o: except.S $(TOPOBJDIR)/include/config.h
|
||||
$(CC) -c $(DIVINCL) -o $*.o $(SRCDIR)/except.S
|
||||
|
||||
clean::
|
||||
$(RM) $(SPEC_FILES) callfrom16.S callfrom32.S callto16.S callto32.S
|
||||
|
||||
### Dependencies:
|
||||
|
|
|
@ -272,8 +272,8 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
|
|||
410 pascal16 IsValidMetaFile (word) IsValidMetaFile
|
||||
411 pascal16 GetCurLogFont(word) GetCurLogFont
|
||||
412 pascal16 IsDCCurrentPalette(word) IsDCCurrentPalette
|
||||
439 pascal16 StretchDIBits (word s_word s_word word word word word
|
||||
word word ptr ptr word long) StretchDIBits
|
||||
439 pascal16 StretchDIBits (word s_word s_word s_word s_word s_word s_word
|
||||
s_word s_word ptr ptr word long) StretchDIBits16
|
||||
440 pascal16 SetDIBits(word word word word ptr ptr word) SetDIBits
|
||||
441 pascal16 GetDIBits(word word word word ptr ptr word) GetDIBits
|
||||
442 pascal16 CreateDIBitmap(word ptr long ptr ptr word) CreateDIBitmap
|
||||
|
|
|
@ -236,9 +236,9 @@ base 1
|
|||
0228 stub GetTextExtentExPointA
|
||||
0229 stub GetTextExtentExPointW
|
||||
0230 stdcall GetTextExtentPoint32A(long ptr long ptr) GetTextExtentPoint32A
|
||||
0231 stub GetTextExtentPoint32W
|
||||
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32A
|
||||
0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32W
|
||||
0231 stdcall GetTextExtentPoint32W(long ptr long ptr) GetTextExtentPoint32W
|
||||
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32ABuggy
|
||||
0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32WBuggy
|
||||
0234 stdcall GetTextFaceA(long long ptr) GetTextFace
|
||||
0235 stub GetTextFaceW
|
||||
0236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A
|
||||
|
@ -358,8 +358,8 @@ base 1
|
|||
0349 stub StartPage
|
||||
0350 stdcall StretchBlt(long long long long long long long long long long long)
|
||||
StretchBlt32
|
||||
0351 stdcall StretchDIBits(long long long long long long long
|
||||
long long long long long long) StretchDIBits
|
||||
0351 stdcall StretchDIBits(long long long long long long long long long
|
||||
ptr ptr long long) StretchDIBits32
|
||||
0352 stub StrokeAndFillPath
|
||||
0353 stub StrokePath
|
||||
0354 stub SwapBuffers
|
||||
|
|
|
@ -122,7 +122,7 @@ heap 65520
|
|||
120 pascal GetMessageTime() GetMessageTime
|
||||
121 pascal SetWindowsHook(s_word segptr) THUNK_SetWindowsHook16
|
||||
122 pascal CallWindowProc(segptr word word word long) CallWindowProc16
|
||||
123 pascal16 CallMsgFilter(segptr s_word) CallMsgFilter
|
||||
123 pascal16 CallMsgFilter(segptr s_word) CallMsgFilter16
|
||||
124 pascal16 UpdateWindow(word) UpdateWindow
|
||||
125 pascal16 InvalidateRect(word ptr word) InvalidateRect16
|
||||
126 pascal16 InvalidateRgn(word word word) InvalidateRgn
|
||||
|
@ -235,7 +235,7 @@ heap 65520
|
|||
232 pascal16 SetWindowPos(word word word word word word word) SetWindowPos
|
||||
233 pascal16 SetParent(word word) SetParent
|
||||
234 pascal16 UnhookWindowsHook(s_word segptr) THUNK_UnhookWindowsHook16
|
||||
235 pascal DefHookProc(s_word word long ptr) DefHookProc
|
||||
235 pascal DefHookProc(s_word word long ptr) DefHookProc16
|
||||
236 pascal16 GetCapture() GetCapture16
|
||||
237 pascal16 GetUpdateRgn(word word word) GetUpdateRgn
|
||||
238 pascal16 ExcludeUpdateRgn(word word) ExcludeUpdateRgn
|
||||
|
@ -296,7 +296,7 @@ heap 65520
|
|||
290 pascal16 RedrawWindow(word ptr word word) RedrawWindow16
|
||||
291 pascal SetWindowsHookEx(s_word segptr word word) THUNK_SetWindowsHookEx16
|
||||
292 pascal16 UnhookWindowsHookEx(segptr) THUNK_UnhookWindowsHookEx16
|
||||
293 pascal CallNextHookEx(segptr s_word word long) CallNextHookEx
|
||||
293 pascal CallNextHookEx(segptr s_word word long) CallNextHookEx16
|
||||
294 stub LockWindowUpdate
|
||||
299 register Mouse_Event() Mouse_Event
|
||||
300 stub UnloadInstalledDrivers
|
||||
|
|
|
@ -16,9 +16,9 @@ base 1
|
|||
0011 stub BroadcastSystemMessage
|
||||
0012 stub CalcChildScroll
|
||||
0013 stub CallMsgFilter
|
||||
0014 stub CallMsgFilterA
|
||||
0015 stub CallMsgFilterW
|
||||
0016 stub CallNextHookEx
|
||||
0014 stdcall CallMsgFilterA(ptr long) CallMsgFilter32A
|
||||
0015 stdcall CallMsgFilterW(ptr long) CallMsgFilter32W
|
||||
0016 stdcall CallNextHookEx(long long long long) CallNextHookEx32
|
||||
0017 stdcall CallWindowProcA(ptr long long long long) CallWindowProc32A
|
||||
0018 stdcall CallWindowProcW(ptr long long long long) CallWindowProc32W
|
||||
0019 stub CascadeChildWindows
|
||||
|
@ -530,8 +530,8 @@ base 1
|
|||
0523 stdcall SetWindowWord(long long long) SetWindowWord
|
||||
0524 stdcall SetWindowsHookA(long ptr) SetWindowsHook32A
|
||||
0525 stdcall SetWindowsHookExA(long long long long) SetWindowsHookEx32A
|
||||
0526 stub SetWindowsHookExW
|
||||
0527 stub SetWindowsHookW
|
||||
0526 stdcall SetWindowsHookExW(long long long long) SetWindowsHookEx32W
|
||||
0527 stdcall SetWindowsHookW(long long long long) SetWindowsHook32W
|
||||
0528 stdcall ShowCaret(long) ShowCaret
|
||||
0529 stdcall ShowCursor(long) ShowCursor
|
||||
0530 stub ShowOwnedPopups
|
||||
|
@ -560,7 +560,7 @@ base 1
|
|||
0553 stub TranslateCharsetInfo
|
||||
0554 stub TranslateMDISysAccel
|
||||
0555 stdcall TranslateMessage(ptr) USER32_TranslateMessage
|
||||
0556 stub UnhookWindowsHook
|
||||
0556 stdcall UnhookWindowsHook(long ptr) UnhookWindowsHook32
|
||||
0557 stdcall UnhookWindowsHookEx(long) UnhookWindowsHookEx32
|
||||
0558 stdcall UnionRect(ptr ptr ptr) UnionRect32
|
||||
0559 stub UnloadKeyboardLayout
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
name wing
|
||||
type win16
|
||||
|
||||
1001 pascal16 WinGCreateDC() WinGCreateDC16
|
||||
1002 pascal16 WinGRecommendDIBFormat(ptr) WinGRecommendDIBFormat16
|
||||
1003 pascal16 WinGCreateBitmap(word ptr ptr) WinGCreateBitmap16
|
||||
1004 stub WINGGETDIBPOINTER
|
||||
1005 stub WINGGETDIBCOLORTABLE
|
||||
1006 stub WINGSETDIBCOLORTABLE
|
||||
1007 pascal16 WinGCreateHalfTonePalette() WinGCreateHalfTonePalette16
|
||||
1008 pascal16 WinGCreateHalfToneBrush(word long word) WinGCreateHalfToneBrush16
|
||||
1009 stub WINGSTRETCHBLT
|
||||
# Probably much like BitBlt16... but, without the last field (what value?)
|
||||
1010 stub WINGBITBLT
|
||||
1001 pascal16 WINGCREATEDC() WinGCreateDC16
|
||||
1002 pascal16 WINGRECOMMENDDIBFORMAT(ptr) WinGRecommendDIBFormat16
|
||||
1003 pascal16 WINGCREATEBITMAP(word ptr ptr) WinGCreateBitmap16
|
||||
1004 pascal WINGGETDIBPOINTER(word ptr) WinGGetDIBPointer16
|
||||
1005 pascal16 WINGGETDIBCOLORTABLE(word word word ptr) WinGGetDIBColorTable16
|
||||
1006 pascal16 WINGSETDIBCOLORTABLE(word word word ptr) WinGSetDIBColorTable16
|
||||
1007 pascal16 WINGCREATEHALFTONEPALETTE() WinGCreateHalfTonePalette16
|
||||
1008 pascal16 WINGCREATEHALFTONEBRUSH(word word word) WinGCreateHalfToneBrush16
|
||||
1009 pascal16 WINGSTRETCHBLT(word word word word word word word word word word) WinGStretchBlt16
|
||||
1010 pascal16 WINGBITBLT(word word word word word word word word) WinGBitBlt16
|
||||
|
||||
# Seem that 1299 is the limit... weird...
|
||||
#1500 stub WINGINITIALIZETHUNK16
|
||||
|
|
|
@ -14,20 +14,29 @@
|
|||
* This structure is stored into the window extra bytes (cbWndExtra).
|
||||
* sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
|
||||
*/
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT32 msgResult; /* Result of EndDialog() / Default button id */
|
||||
HWINDOWPROC dlgProc; /* Dialog procedure */
|
||||
LONG userInfo; /* User information (for DWL_USER) */
|
||||
INT32 msgResult; /* +00 Last message result */
|
||||
HWINDOWPROC dlgProc; /* +04 Dialog procedure */
|
||||
LONG userInfo; /* +08 User information (for DWL_USER) */
|
||||
|
||||
/* implementation-dependent part */
|
||||
|
||||
HWND16 hwndFocus; /* Current control with focus */
|
||||
HFONT16 hUserFont; /* Dialog font */
|
||||
HMENU16 hMenu; /* Dialog menu */
|
||||
WORD xBaseUnit; /* Dialog units (depends on the font) */
|
||||
WORD yBaseUnit;
|
||||
INT32 idResult; /* EndDialog() result / default pushbutton ID */
|
||||
WORD fEnd; /* EndDialog() called for this dialog */
|
||||
HGLOBAL16 hDialogHeap;
|
||||
} DIALOGINFO;
|
||||
|
||||
#pragma pack(4)
|
||||
|
||||
extern BOOL32 DIALOG_Init(void);
|
||||
|
||||
#endif /* DIALOG_H */
|
||||
|
|
|
@ -9,12 +9,23 @@
|
|||
|
||||
#include "windows.h"
|
||||
|
||||
extern HANDLE16 HOOK_GetHook( INT16 id , HQUEUE16 hQueue );
|
||||
extern LRESULT HOOK_CallHooks( INT16 id, INT16 code,
|
||||
WPARAM16 wParam, LPARAM lParam );
|
||||
extern HOOKPROC16 HOOK_GetProc16( HHOOK hook );
|
||||
extern void HOOK_ResetQueueHooks( HQUEUE16 hQueue );
|
||||
#define HOOK_WIN16 0x0
|
||||
#define HOOK_WIN32 0x1
|
||||
#define HOOK_UNICODE 0x2
|
||||
|
||||
#define HOOK_MAPTYPE (HOOK_WIN32 | HOOK_UNICODE)
|
||||
|
||||
extern HOOKPROC16 HOOK_GetProc16( HHOOK hhook );
|
||||
extern BOOL32 HOOK_IsHooked( INT16 id );
|
||||
extern LRESULT HOOK_CallHooks16( INT16 id, INT16 code, WPARAM16 wParam,
|
||||
LPARAM lParam );
|
||||
extern LRESULT HOOK_CallHooks32A( INT32 id, INT32 code, WPARAM32 wParam,
|
||||
LPARAM lParam );
|
||||
extern LRESULT HOOK_CallHooks32W( INT32 id, INT32 code, WPARAM32 wParam,
|
||||
LPARAM lParam );
|
||||
extern void HOOK_FreeModuleHooks( HMODULE16 hModule );
|
||||
extern void HOOK_FreeQueueHooks( HQUEUE16 hQueue );
|
||||
extern void HOOK_ResetQueueHooks( HQUEUE16 hQueue );
|
||||
extern HOOKPROC32 HOOK_GetProc( HHOOK hook );
|
||||
|
||||
#endif /* __WINE_HOOK_H */
|
||||
|
|
|
@ -583,15 +583,16 @@ typedef struct
|
|||
{
|
||||
BOOL16 fMouse;
|
||||
HWND16 hWndActive;
|
||||
} CBTACTIVATESTRUCT16;
|
||||
} CBTACTIVATESTRUCT16, *LPCBTACTIVATESTRUCT16;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOL32 fMouse;
|
||||
HWND32 hWndActive;
|
||||
} CBTACTIVATESTRUCT32;
|
||||
} CBTACTIVATESTRUCT32, *LPCBTACTIVATESTRUCT32;
|
||||
|
||||
DECL_WINELIB_TYPE(CBTACTIVATESTRUCT);
|
||||
DECL_WINELIB_TYPE(LPCBTACTIVATESTRUCT);
|
||||
|
||||
/* Shell hook values */
|
||||
#define HSHELL_WINDOWCREATED 1
|
||||
|
@ -977,6 +978,8 @@ typedef struct
|
|||
#define DEFAULT_CHARSET 1
|
||||
#define SYMBOL_CHARSET 2
|
||||
#define SHIFTJIS_CHARSET 128
|
||||
#define HANGEUL_CHARSET 129
|
||||
#define CHINESEBIG5_CHARSET 136
|
||||
#define OEM_CHARSET 255
|
||||
|
||||
/* lfOutPrecision values */
|
||||
|
@ -4063,16 +4066,20 @@ HRSRC32 FindResourceEx32A(HINSTANCE32,LPCSTR,LPCSTR,WORD);
|
|||
HRSRC32 FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
|
||||
#define FindResourceEx WINELIB_NAME_AW(FindResourceEx)
|
||||
BOOL32 FlushFileBuffers(HFILE);
|
||||
UINT32 GetACP(void);
|
||||
LPCSTR GetCommandLine32A();
|
||||
LPCWSTR GetCommandLine32W();
|
||||
#define GetCommandLine WINELIB_NAME_AW(GetCommandLine)
|
||||
BOOL32 GetCommTimeouts(INT32,LPCOMMTIMEOUTS);
|
||||
DWORD GetCurrentThreadId(void);
|
||||
HANDLE32 GetCurrentThread(void);
|
||||
BOOL32 GetDCOrgEx(HDC32,LPPOINT32);
|
||||
DWORD GetFileInformationByHandle(HFILE,BY_HANDLE_FILE_INFORMATION*);
|
||||
DWORD GetFileSize(HFILE,LPDWORD);
|
||||
DWORD GetFileType(HFILE);
|
||||
VOID GetLocalTime(LPSYSTEMTIME);
|
||||
DWORD GetLogicalDrives(void);
|
||||
UINT32 GetOEMCP(void);
|
||||
HANDLE32 GetProcessHeap(void);
|
||||
DWORD GetShortPathName32A(LPCSTR,LPSTR,DWORD);
|
||||
DWORD GetShortPathName32W(LPCWSTR,LPWSTR,DWORD);
|
||||
|
@ -4228,6 +4235,9 @@ BOOL32 BuildCommDCB32W(LPCWSTR,LPDCB32);
|
|||
BOOL32 BuildCommDCBAndTimeouts32A(LPCSTR,LPDCB32,LPCOMMTIMEOUTS);
|
||||
BOOL32 BuildCommDCBAndTimeouts32W(LPCWSTR,LPDCB32,LPCOMMTIMEOUTS);
|
||||
#define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
|
||||
LRESULT CallNextHookEx16(HHOOK,INT16,WPARAM16,LPARAM);
|
||||
LRESULT CallNextHookEx32(HHOOK,INT32,WPARAM32,LPARAM);
|
||||
#define CallNextHookEx WINELIB_NAME(CallNextHookEx)
|
||||
LRESULT CallWindowProc16(WNDPROC16,HWND16,UINT16,WPARAM16,LPARAM);
|
||||
LRESULT CallWindowProc32A(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM);
|
||||
LRESULT CallWindowProc32W(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM);
|
||||
|
@ -4403,6 +4413,10 @@ LRESULT DefFrameProc16(HWND16,HWND16,UINT16,WPARAM16,LPARAM);
|
|||
LRESULT DefFrameProc32A(HWND32,HWND32,UINT32,WPARAM32,LPARAM);
|
||||
LRESULT DefFrameProc32W(HWND32,HWND32,UINT32,WPARAM32,LPARAM);
|
||||
#define DefFrameProc WINELIB_NAME_AW(DefFrameProc)
|
||||
LRESULT DefHookProc16(INT16,WPARAM16,LPARAM,HHOOK*);
|
||||
#define DefHookProc32(code,wparam,lparam,phhook) \
|
||||
CallNextHookEx32(*(phhook),code,wparam,lparam)
|
||||
#define DefHookProc WINELIB_NAME(DefHookProc)
|
||||
LRESULT DefMDIChildProc16(HWND16,UINT16,WPARAM16,LPARAM);
|
||||
LRESULT DefMDIChildProc32A(HWND32,UINT32,WPARAM32,LPARAM);
|
||||
LRESULT DefMDIChildProc32W(HWND32,UINT32,WPARAM32,LPARAM);
|
||||
|
@ -5294,6 +5308,9 @@ BOOL16 StretchBlt16(HDC16,INT16,INT16,INT16,INT16,HDC16,INT16,INT16,
|
|||
BOOL32 StretchBlt32(HDC32,INT32,INT32,INT32,INT32,HDC32,INT32,INT32,
|
||||
INT32,INT32,DWORD);
|
||||
#define StretchBlt WINELIB_NAME(StretchBlt)
|
||||
INT16 StretchDIBits16(HDC16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,const VOID*,const BITMAPINFO*,UINT16,DWORD);
|
||||
INT32 StretchDIBits32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,const VOID*,const BITMAPINFO*,UINT32,DWORD);
|
||||
#define StretchDIBits WINELIB_NAME(StretchDIBits)
|
||||
BOOL16 SubtractRect16(LPRECT16,const RECT16*,const RECT16*);
|
||||
BOOL32 SubtractRect32(LPRECT32,const RECT32*,const RECT32*);
|
||||
#define SubtractRect WINELIB_NAME(SubtractRect)
|
||||
|
@ -5468,7 +5485,6 @@ HDWP16 BeginDeferWindowPos(INT);
|
|||
BOOL BringWindowToTop(HWND);
|
||||
void CalcChildScroll(HWND,WORD);
|
||||
BOOL CallMsgFilter(SEGPTR,INT);
|
||||
LRESULT CallNextHookEx(HHOOK,INT,WPARAM16,LPARAM);
|
||||
BOOL ChangeClipboardChain(HWND,HWND);
|
||||
INT CheckMenuItem(HMENU16,UINT,UINT);
|
||||
BOOL CloseClipboard(void);
|
||||
|
@ -5488,7 +5504,6 @@ HICON16 CreateIcon(HINSTANCE16,INT,INT,BYTE,BYTE,const BYTE*,const BYTE*);
|
|||
HMENU16 CreateMenu(void);
|
||||
HPALETTE16 CreatePalette(const LOGPALETTE*);
|
||||
HMENU16 CreatePopupMenu(void);
|
||||
DWORD DefHookProc(short,WORD,DWORD,HHOOK*);
|
||||
HDWP16 DeferWindowPos(HDWP16,HWND,HWND,INT,INT,INT,INT,UINT);
|
||||
ATOM DeleteAtom(ATOM);
|
||||
BOOL DeleteDC(HDC16);
|
||||
|
@ -5716,7 +5731,6 @@ BOOL ShowWindow(HWND,int);
|
|||
DWORD SizeofResource(HMODULE16,HRSRC16);
|
||||
int StartSound(void);
|
||||
int StopSound(void);
|
||||
int StretchDIBits(HDC16,WORD,WORD,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD,DWORD);
|
||||
BOOL SwapMouseButton(BOOL);
|
||||
void SwapRecording(WORD);
|
||||
int SyncAllVoices(void);
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
#include <sys/socket.h>
|
||||
#include "windows.h"
|
||||
|
||||
#ifndef WINELIB
|
||||
#pragma pack(1) /* tight alignment for the emulator */
|
||||
#endif
|
||||
#pragma pack(1)
|
||||
|
||||
/* Win16 socket-related types */
|
||||
|
||||
|
@ -135,9 +133,7 @@ typedef struct WSAData {
|
|||
SEGPTR lpVendorInfo;
|
||||
} WSADATA, *LPWSADATA;
|
||||
|
||||
#ifndef WINELIB
|
||||
#pragma pack(4)
|
||||
#endif
|
||||
|
||||
/* ----------------------------------- no Win16 structure defs beyond this line! */
|
||||
|
||||
|
|
|
@ -3,16 +3,26 @@ TOPSRCDIR = @top_srcdir@
|
|||
TOPOBJDIR = ..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = library
|
||||
MODULE = none
|
||||
LIBMODULE = library
|
||||
|
||||
C_SRCS = \
|
||||
LIB_SRCS = \
|
||||
arch.c \
|
||||
libres.c \
|
||||
miscstubs.c \
|
||||
sup.c \
|
||||
winmain.c
|
||||
sup.c
|
||||
|
||||
all: $(MODULE).o
|
||||
STUB_SRCS = winestub.c
|
||||
|
||||
LIB_OBJS = $(LIB_SRCS:.c=.o)
|
||||
STUB_OBJS = $(STUB_SRCS:.c=.o)
|
||||
|
||||
C_SRCS = $(LIB_SRCS) $(STUB_SRCS)
|
||||
|
||||
all: $(LIBMODULE).o $(STUB_OBJS)
|
||||
|
||||
$(LIBMODULE).o: $(LIB_OBJS)
|
||||
$(LDCOMBINE) $(LIB_OBJS) -o $(LIBMODULE).o
|
||||
|
||||
@MAKE_RULES@
|
||||
|
||||
|
|
|
@ -1,18 +1,51 @@
|
|||
/* Sample winestub.c file for compiling programs with libwine.so. */
|
||||
|
||||
#include <string.h>
|
||||
#include "windows.h"
|
||||
#ifdef WIN_DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include "xmalloc.h"
|
||||
|
||||
extern int PASCAL WinMain(HINSTANCE,HINSTANCE,LPSTR,int);
|
||||
extern int WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int);
|
||||
extern int MAIN_Init(void);
|
||||
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
|
||||
extern void TASK_Reschedule(void);
|
||||
|
||||
int main( int argc, char *argv [] )
|
||||
{
|
||||
HINSTANCE16 hInstance;
|
||||
LPSTR lpszCmdParam;
|
||||
int i, len = 0;
|
||||
|
||||
MAIN_WineInit( &argc, argv );
|
||||
|
||||
/* Alloc szCmdParam */
|
||||
for (i = 1; i < argc; i++) len += strlen(argv[i]) + 1;
|
||||
lpszCmdParam = (LPSTR) xmalloc(len + 1);
|
||||
/* Concatenate arguments */
|
||||
if (argc > 1) strcpy(lpszCmdParam, argv[1]);
|
||||
else lpszCmdParam[0] = '\0';
|
||||
for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]);
|
||||
|
||||
if(!MAIN_Init()) return 0; /* JBP: Needed for DosDrives[] structure, etc. */
|
||||
hInstance = WinExec( *argv, SW_SHOWNORMAL );
|
||||
TASK_Reschedule();
|
||||
InitApp( hInstance );
|
||||
|
||||
return WinMain (hInstance, /* hInstance */
|
||||
0, /* hPrevInstance */
|
||||
lpszCmdParam, /* lpszCmdParam */
|
||||
SW_NORMAL); /* nCmdShow */
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
extern int WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int);
|
||||
/* This is the renamed main() subroutine in misc/main.c. */
|
||||
/* Note that the libdll `init()' won't work: */
|
||||
extern HINSTANCE _wine_main(int, char *[]);
|
||||
extern HINSTANCE32 _wine_main(int, char *[]);
|
||||
|
||||
int main (int argc, char *argv [])
|
||||
{
|
||||
HINSTANCE hInstance;
|
||||
HINSTANCE32 hInstance;
|
||||
char szCmdParam[256] = {0};
|
||||
int index, buffer_pos;
|
||||
char *arg_holder;
|
||||
|
@ -22,7 +55,7 @@ int main (int argc, char *argv [])
|
|||
char *wine_argv[] = {argv[0], ""};
|
||||
|
||||
/* Initialize the library dll: */
|
||||
hInstance = (HINSTANCE)_wine_main((sizeof(wine_argv)/sizeof(char *))-1, wine_argv);
|
||||
hInstance = (HINSTANCE32)_wine_main((sizeof(wine_argv)/sizeof(char *))-1, wine_argv);
|
||||
|
||||
#ifdef WIN_DEBUG
|
||||
fprintf(stderr,"In winestub, reporting hInstance = %d\n", hInstance);
|
||||
|
@ -49,3 +82,4 @@ int main (int argc, char *argv [])
|
|||
(LPSTR)szCmdParam, /* lpszCmdParam */
|
||||
SW_NORMAL); /* nCmdShow */
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include "windows.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
extern int MAIN_Init(void);
|
||||
extern BOOL WIDGETS_Init(void);
|
||||
extern BOOL WIN_CreateDesktopWindow(void);
|
||||
extern int WinMain(HINSTANCE16,HINSTANCE16,LPSTR,int);
|
||||
extern void TASK_Reschedule(void);
|
||||
|
||||
|
||||
int _WinMain (int argc, char *argv [])
|
||||
{
|
||||
HINSTANCE16 hInstance;
|
||||
LPSTR lpszCmdParam;
|
||||
int i, len = 0;
|
||||
|
||||
/* Alloc szCmdParam */
|
||||
for (i = 1; i < argc; i++) len += strlen(argv[i]) + 1;
|
||||
lpszCmdParam = (LPSTR) xmalloc(len + 1);
|
||||
/* Concatenate arguments */
|
||||
if (argc > 1) strcpy(lpszCmdParam, argv[1]);
|
||||
else lpszCmdParam[0] = '\0';
|
||||
for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]);
|
||||
|
||||
if(!MAIN_Init()) return 0; /* JBP: Needed for DosDrives[] structure, etc. */
|
||||
hInstance = WinExec( *argv, SW_SHOWNORMAL );
|
||||
TASK_Reschedule();
|
||||
InitApp( hInstance );
|
||||
|
||||
#ifdef WINELIBDLL
|
||||
return (int)hInstance;
|
||||
#else
|
||||
return WinMain (hInstance, /* hInstance */
|
||||
0, /* hPrevInstance */
|
||||
lpszCmdParam, /* lpszCmdParam */
|
||||
SW_NORMAL); /* nCmdShow */
|
||||
#endif
|
||||
}
|
|
@ -163,12 +163,15 @@ int MAIN_Init(void)
|
|||
/**********************************************************************
|
||||
* main
|
||||
*/
|
||||
int _WinMain(int argc, char **argv)
|
||||
int main(int argc, char *argv[] )
|
||||
{
|
||||
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
|
||||
|
||||
int i;
|
||||
HINSTANCE16 handle;
|
||||
|
||||
if (!MAIN_Init()) return 0;
|
||||
if (!MAIN_WineInit( &argc, argv )) return 1;
|
||||
if (!MAIN_Init()) return 1;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
|
@ -182,7 +185,7 @@ int _WinMain(int argc, char **argv)
|
|||
case 21: fprintf( stderr, "win32 executable\n" ); break;
|
||||
default: fprintf( stderr, "error=%d\n", handle ); break;
|
||||
}
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@ void TASK_Reschedule(void)
|
|||
|
||||
/* extract hardware events only! */
|
||||
|
||||
EVENT_WaitXEvent( FALSE, TRUE );
|
||||
if (!hTask) EVENT_WaitXEvent( FALSE, TRUE );
|
||||
|
||||
while (!hTask)
|
||||
{
|
||||
|
|
77
misc/main.c
77
misc/main.c
|
@ -606,15 +606,12 @@ static void called_at_exit(void)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* main
|
||||
* MAIN_WineInit
|
||||
*
|
||||
* Wine initialisation and command-line parsing
|
||||
*/
|
||||
#if defined(WINELIB) && defined(WINELIBDLL)
|
||||
int _wine_main (int argc, char *argv[])
|
||||
#else
|
||||
int main( int argc, char *argv[] )
|
||||
#endif
|
||||
BOOL32 MAIN_WineInit( int *argc, char *argv[] )
|
||||
{
|
||||
int ret_val;
|
||||
int depth_count, i;
|
||||
int *depth_list;
|
||||
struct timeval tv;
|
||||
|
@ -645,7 +642,7 @@ int main( int argc, char *argv[] )
|
|||
|
||||
XrmInitialize();
|
||||
|
||||
MAIN_ParseOptions( &argc, argv );
|
||||
MAIN_ParseOptions( argc, argv );
|
||||
|
||||
if (Options.desktopGeometry && Options.managed)
|
||||
{
|
||||
|
@ -672,15 +669,12 @@ int main( int argc, char *argv[] )
|
|||
}
|
||||
else screenDepth = DefaultDepthOfScreen( screen );
|
||||
if (Options.synchronous) XSynchronize( display, True );
|
||||
if (Options.desktopGeometry) MAIN_CreateDesktop( argc, argv );
|
||||
if (Options.desktopGeometry) MAIN_CreateDesktop( *argc, argv );
|
||||
else rootWindow = DefaultRootWindow( display );
|
||||
|
||||
MAIN_SaveSetup();
|
||||
atexit(called_at_exit);
|
||||
|
||||
ret_val = _WinMain( argc, argv );
|
||||
|
||||
return ret_val;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1063,7 +1057,8 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
|
|||
XKeyboardControl keyboard_value;
|
||||
|
||||
|
||||
switch (uAction) {
|
||||
switch (uAction)
|
||||
{
|
||||
case SPI_GETBEEP:
|
||||
XGetKeyboardControl(display, &keyboard_state);
|
||||
if (keyboard_state.bell_percent == 0)
|
||||
|
@ -1089,20 +1084,22 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
|
|||
1 );
|
||||
break;
|
||||
|
||||
case SPI_GETICONTITLEWRAP:
|
||||
*(BOOL *) lpvParam = FALSE;
|
||||
/* FIXME GetProfileInt32A( "desktop", "?", True ) */
|
||||
break;
|
||||
case SPI_GETICONTITLEWRAP:
|
||||
*(BOOL *) lpvParam = GetProfileInt32A( "desktop",
|
||||
"IconTitleWrap",
|
||||
TRUE );
|
||||
break;
|
||||
|
||||
case SPI_GETKEYBOARDDELAY:
|
||||
*(INT *) lpvParam = 1;
|
||||
/* FIXME */
|
||||
break;
|
||||
case SPI_GETKEYBOARDDELAY:
|
||||
*(INT *) lpvParam = GetProfileInt32A( "keyboard",
|
||||
"KeyboardDelay", 1 );
|
||||
break;
|
||||
|
||||
case SPI_GETKEYBOARDSPEED:
|
||||
*(WORD *) lpvParam = 30;
|
||||
/* FIXME */
|
||||
break;
|
||||
case SPI_GETKEYBOARDSPEED:
|
||||
*(WORD *) lpvParam = GetProfileInt32A( "keyboard",
|
||||
"KeyboardSpeed",
|
||||
30 );
|
||||
break;
|
||||
|
||||
case SPI_GETMENUDROPALIGNMENT:
|
||||
*(BOOL *) lpvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); /* XXX check this */
|
||||
|
@ -1174,19 +1171,21 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
|
|||
|
||||
case SPI_GETICONTITLELOGFONT:
|
||||
{
|
||||
/* FIXME GetProfileString32A( "?", "?", "?" ) */
|
||||
LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
|
||||
lpLogFont->lfHeight = 10;
|
||||
lpLogFont->lfWidth = 0;
|
||||
lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
|
||||
lpLogFont->lfWeight = FW_NORMAL;
|
||||
lpLogFont->lfItalic = lpLogFont->lfStrikeOut = lpLogFont->lfUnderline = FALSE;
|
||||
lpLogFont->lfCharSet = ANSI_CHARSET;
|
||||
lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
|
||||
lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
||||
lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
|
||||
break;
|
||||
}
|
||||
/* FIXME GetProfileString32A( "?", "?", "?" ) */
|
||||
LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
|
||||
lpLogFont->lfHeight = 10;
|
||||
lpLogFont->lfWidth = 0;
|
||||
lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
|
||||
lpLogFont->lfWeight = FW_NORMAL;
|
||||
lpLogFont->lfItalic = FALSE;
|
||||
lpLogFont->lfStrikeOut = FALSE;
|
||||
lpLogFont->lfUnderline = FALSE;
|
||||
lpLogFont->lfCharSet = ANSI_CHARSET;
|
||||
lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
|
||||
lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
||||
lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
|
||||
break;
|
||||
}
|
||||
|
||||
case SPI_LANGDRIVER:
|
||||
case SPI_SETBORDER:
|
||||
|
|
|
@ -174,24 +174,68 @@ static void fd_set_normalize(fd_set* fds, LPWSINFO pwsi, ws_fd_set* ws, int* hig
|
|||
}
|
||||
}
|
||||
|
||||
static void fd_set_update(LPWSINFO pwsi, fd_set* fds, ws_fd_set* ws)
|
||||
/*
|
||||
* Note weirdness here: sockets with errors belong in exceptfds, but
|
||||
* are given to us in readfds or writefds, so move them to exceptfds if
|
||||
* there is an error. Note that this means that exceptfds may have mysterious
|
||||
* sockets set in it that the program never asked for.
|
||||
*/
|
||||
|
||||
static int inline sock_error_p(int s)
|
||||
{
|
||||
if( ws )
|
||||
{
|
||||
int i, j, count = ws->fd_count;
|
||||
ws_socket* pws;
|
||||
for( i = 0, j = 0; i < count; i++ )
|
||||
unsigned int optval, optlen;
|
||||
|
||||
optlen = sizeof(optval);
|
||||
getsockopt(s, SOL_SOCKET, SO_ERROR, &optval, &optlen);
|
||||
if (optval) dprintf_winsock(stddeb, "error: %d\n", optval);
|
||||
return optval != 0;
|
||||
}
|
||||
|
||||
static void fd_set_update(LPWSINFO pwsi, fd_set* fds, ws_fd_set* ws,
|
||||
fd_set *errorfds)
|
||||
{
|
||||
if( ws )
|
||||
{
|
||||
pws = (ws_socket*)WS_HANDLE2PTR(ws->fd_array[i]);
|
||||
if( _check_ws(pwsi, pws) )
|
||||
if( FD_ISSET(pws->fd, fds) )
|
||||
{
|
||||
ws->fd_array[j++] = ws->fd_array[i];
|
||||
continue;
|
||||
}
|
||||
ws->fd_count--;
|
||||
int i, j, count = ws->fd_count;
|
||||
|
||||
for( i = 0, j = 0; i < count; i++ )
|
||||
{
|
||||
ws_socket *pws = (ws_socket*)WS_HANDLE2PTR(ws->fd_array[i]);
|
||||
int fd = pws->fd;
|
||||
|
||||
if( _check_ws(pwsi, pws) && FD_ISSET(fd, fds) )
|
||||
{
|
||||
/* if error, move to errorfds */
|
||||
if (errorfds && (FD_ISSET(fd, errorfds) || sock_error_p(fd)))
|
||||
FD_SET(fd, errorfds);
|
||||
else
|
||||
ws->fd_array[j++] = ws->fd_array[i];
|
||||
}
|
||||
}
|
||||
ws->fd_count = j;
|
||||
dprintf_winsock(stddeb, "\n");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void fd_set_update_except(LPWSINFO pwsi, fd_set *fds, ws_fd_set *ws,
|
||||
fd_set *errorfds)
|
||||
{
|
||||
if (ws)
|
||||
{
|
||||
int i, j, count = ws->fd_count;
|
||||
|
||||
for (i=j=0; i < count; i++)
|
||||
{
|
||||
ws_socket *pws = (ws_socket *)WS_HANDLE2PTR(ws->fd_array[i]);
|
||||
|
||||
if (_check_ws(pwsi, pws) && (FD_ISSET(pws->fd, fds)
|
||||
|| FD_ISSET(pws->fd, errorfds)))
|
||||
ws->fd_array[j++] = ws->fd_array[i];
|
||||
}
|
||||
ws->fd_count = j;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* ----------------------------------- API -----
|
||||
|
@ -512,7 +556,7 @@ INT16 WINSOCK_getsockopt(SOCKET16 s, INT16 level,
|
|||
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
|
||||
LPWSINFO pwsi = wsi_find(GetCurrentTask());
|
||||
|
||||
dprintf_winsock(stddeb, "WSA_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n",
|
||||
dprintf_winsock(stddeb, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n",
|
||||
(unsigned)pwsi, s, level, (int) optval, (int) *optlen);
|
||||
|
||||
if( _check_ws(pwsi, pws) )
|
||||
|
@ -662,19 +706,20 @@ INT16 WINSOCK_select(INT16 nfds, ws_fd_set *ws_readfds,
|
|||
if( pwsi )
|
||||
{
|
||||
int highfd = 0;
|
||||
fd_set readfds, writefds, exceptfds;
|
||||
fd_set readfds, writefds, exceptfds, errorfds;
|
||||
|
||||
fd_set_normalize(&readfds, pwsi, ws_readfds, &highfd);
|
||||
fd_set_normalize(&writefds, pwsi, ws_writefds, &highfd);
|
||||
fd_set_normalize(&exceptfds, pwsi, ws_exceptfds, &highfd);
|
||||
FD_ZERO(&errorfds);
|
||||
|
||||
if( (highfd = select(highfd + 1, &readfds, &writefds, &exceptfds, timeout)) >= 0 )
|
||||
{
|
||||
if( highfd )
|
||||
{
|
||||
fd_set_update(pwsi, &readfds, ws_readfds);
|
||||
fd_set_update(pwsi, &writefds, ws_writefds);
|
||||
fd_set_update(pwsi, &exceptfds, ws_exceptfds);
|
||||
fd_set_update(pwsi, &readfds, ws_readfds, &errorfds);
|
||||
fd_set_update(pwsi, &writefds, ws_writefds, &errorfds);
|
||||
fd_set_update_except(pwsi, &exceptfds, ws_exceptfds, &errorfds);
|
||||
}
|
||||
return highfd;
|
||||
}
|
||||
|
@ -820,14 +865,19 @@ SOCKET16 WINSOCK_socket(INT16 af, INT16 type, INT16 protocol)
|
|||
/* printf("created %04x (%i)\n", sock, (UINT16)WS_PTR2HANDLE(pnew));
|
||||
*/
|
||||
if( pnew ) return (SOCKET16)WS_PTR2HANDLE(pnew);
|
||||
else pwsi->errno = WSAENOBUFS;
|
||||
else
|
||||
{
|
||||
close(sock);
|
||||
pwsi->errno = WSAENOBUFS;
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
|
||||
if (errno == EPERM) /* raw socket denied */
|
||||
{
|
||||
fprintf(stderr, "WS_SOCKET: not enough privileges\n");
|
||||
pwsi->errno = WSAESOCKTNOSUPPORT;
|
||||
} pwsi->errno = wsaErrno();
|
||||
} else pwsi->errno = wsaErrno();
|
||||
}
|
||||
|
||||
dprintf_winsock(stddeb, "\t\tfailed!\n");
|
||||
|
|
|
@ -619,26 +619,40 @@ static int DIB_SetImageBits( DC *dc, WORD lines, WORD depth, LPSTR bits,
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* StretchDIBits (GDI.439)
|
||||
* StretchDIBits16 (GDI.439)
|
||||
*/
|
||||
int StretchDIBits( HDC16 hdc,
|
||||
WORD xDest, WORD yDest, WORD wDestWidth, WORD wDestHeight,
|
||||
WORD xSrc, WORD ySrc, WORD wSrcWidth, WORD wSrcHeight,
|
||||
LPSTR bits, LPBITMAPINFO info, WORD wUsage, DWORD dwRop )
|
||||
INT16 StretchDIBits16( HDC16 hdc, INT16 xDst, INT16 yDst, INT16 widthDst,
|
||||
INT16 heightDst, INT16 xSrc, INT16 ySrc, INT16 widthSrc,
|
||||
INT16 heightSrc, const VOID *bits,
|
||||
const BITMAPINFO *info, UINT16 wUsage, DWORD dwRop )
|
||||
{
|
||||
HBITMAP16 hBitmap, hOldBitmap;
|
||||
HDC16 hdcMem;
|
||||
return (INT16)StretchDIBits32( hdc, xDst, yDst, widthDst, heightDst,
|
||||
xSrc, ySrc, widthSrc, heightSrc, bits,
|
||||
info, wUsage, dwRop );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* StretchDIBits32 (GDI32.351)
|
||||
*/
|
||||
INT32 StretchDIBits32( HDC32 hdc, INT32 xDst, INT32 yDst, INT32 widthDst,
|
||||
INT32 heightDst, INT32 xSrc, INT32 ySrc, INT32 widthSrc,
|
||||
INT32 heightSrc, const void *bits,
|
||||
const BITMAPINFO *info, UINT32 wUsage, DWORD dwRop )
|
||||
{
|
||||
HBITMAP32 hBitmap, hOldBitmap;
|
||||
HDC32 hdcMem;
|
||||
|
||||
hBitmap = CreateDIBitmap( hdc, &info->bmiHeader, CBM_INIT,
|
||||
bits, info, wUsage );
|
||||
hdcMem = CreateCompatibleDC( hdc );
|
||||
hOldBitmap = SelectObject32( hdcMem, hBitmap );
|
||||
StretchBlt32( hdc, xDest, yDest, wDestWidth, wDestHeight,
|
||||
hdcMem, xSrc, ySrc, wSrcWidth, wSrcHeight, dwRop );
|
||||
StretchBlt32( hdc, xDst, yDst, widthDst, heightDst,
|
||||
hdcMem, xSrc, ySrc, widthSrc, heightSrc, dwRop );
|
||||
SelectObject32( hdcMem, hOldBitmap );
|
||||
DeleteDC( hdcMem );
|
||||
DeleteObject32( hBitmap );
|
||||
return wSrcHeight;
|
||||
return heightSrc;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -320,7 +320,9 @@ void FONT_GetMetrics( LOGFONT16 * logfont, XFontStruct * xfont,
|
|||
metrics->tmDigitizedAspectX = 1;
|
||||
metrics->tmDigitizedAspectY = 1;
|
||||
metrics->tmPitchAndFamily = (logfont->lfPitchAndFamily&0xf0)|TMPF_DEVICE;
|
||||
if (logfont->lfPitchAndFamily & FIXED_PITCH)
|
||||
|
||||
/* TMPF_FIXED_PITCH bit means variable pitch...Don't you love Microsoft? */
|
||||
if (xfont->min_bounds.width != xfont->max_bounds.width)
|
||||
metrics->tmPitchAndFamily |= TMPF_FIXED_PITCH;
|
||||
|
||||
if (!xfont->per_char) average = metrics->tmMaxCharWidth;
|
||||
|
@ -827,6 +829,10 @@ DWORD GetTextExtent( HDC16 hdc, LPCSTR str, short count )
|
|||
|
||||
/***********************************************************************
|
||||
* GetTextExtentPoint16 (GDI.471)
|
||||
*
|
||||
* FIXME: Should this have a bug for compatibility?
|
||||
* Original Windows versions of GetTextExtentPoint{A,W} have documented
|
||||
* bugs.
|
||||
*/
|
||||
BOOL16 GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size)
|
||||
{
|
||||
|
@ -838,7 +844,7 @@ BOOL16 GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size)
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextExtentPoint32A (GDI32.232)
|
||||
* GetTextExtentPoint32A (GDI32.230)
|
||||
*/
|
||||
BOOL32 GetTextExtentPoint32A( HDC32 hdc, LPCSTR str, INT32 count,
|
||||
LPSIZE32 size )
|
||||
|
@ -861,7 +867,7 @@ BOOL32 GetTextExtentPoint32A( HDC32 hdc, LPCSTR str, INT32 count,
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextExtentPoint32W (GDI32.233)
|
||||
* GetTextExtentPoint32W (GDI32.231)
|
||||
*/
|
||||
BOOL32 GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count,
|
||||
LPSIZE32 size )
|
||||
|
@ -872,6 +878,26 @@ BOOL32 GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextExtentPoint32ABuggy (GDI32.232)
|
||||
*/
|
||||
BOOL32 GetTextExtentPoint32ABuggy( HDC32 hdc, LPCSTR str, INT32 count,
|
||||
LPSIZE32 size )
|
||||
{
|
||||
fprintf( stderr, "GetTextExtentPoint32ABuggy: not bug compatible.\n" );
|
||||
return GetTextExtentPoint32A( hdc, str, count, size );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextExtentPoint32WBuggy (GDI32.233)
|
||||
*/
|
||||
BOOL32 GetTextExtentPoint32WBuggy( HDC32 hdc, LPCWSTR str, INT32 count,
|
||||
LPSIZE32 size )
|
||||
{
|
||||
fprintf( stderr, "GetTextExtentPoint32WBuggy: not bug compatible.\n" );
|
||||
return GetTextExtentPoint32W( hdc, str, count, size );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetTextMetrics16 (GDI.93)
|
||||
|
|
|
@ -677,10 +677,10 @@ void PlayMetaFileRecord(HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
|
|||
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[11]);
|
||||
LPSTR bits = MF_GetDIBitsPointer(info);
|
||||
if (bits)
|
||||
StretchDIBits(hdc,mr->rdParam[10],mr->rdParam[9],mr->rdParam[8],
|
||||
mr->rdParam[7],mr->rdParam[6],mr->rdParam[5],
|
||||
mr->rdParam[4],mr->rdParam[3],bits,info,
|
||||
mr->rdParam[2],MAKELONG(mr->rdParam[0],mr->rdParam[1]));
|
||||
StretchDIBits16(hdc,mr->rdParam[10],mr->rdParam[9],mr->rdParam[8],
|
||||
mr->rdParam[7],mr->rdParam[6],mr->rdParam[5],
|
||||
mr->rdParam[4],mr->rdParam[3],bits,info,
|
||||
mr->rdParam[2],MAKELONG(mr->rdParam[0],mr->rdParam[1]));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -689,10 +689,10 @@ void PlayMetaFileRecord(HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
|
|||
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[10]);
|
||||
LPSTR bits = MF_GetDIBitsPointer(info);
|
||||
if (bits)
|
||||
StretchDIBits(hdc,mr->rdParam[9],mr->rdParam[8],mr->rdParam[7],
|
||||
mr->rdParam[6],mr->rdParam[5],mr->rdParam[4],
|
||||
mr->rdParam[3],mr->rdParam[2],bits,info,
|
||||
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1]));
|
||||
StretchDIBits16(hdc,mr->rdParam[9],mr->rdParam[8],mr->rdParam[7],
|
||||
mr->rdParam[6],mr->rdParam[5],mr->rdParam[4],
|
||||
mr->rdParam[3],mr->rdParam[2],bits,info,
|
||||
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1]));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -705,7 +705,7 @@ void PlayMetaFileRecord(HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
|
|||
mr->rdParam[14], /*BitsPixel*/
|
||||
(LPSTR)&mr->rdParam[15]); /*bits*/
|
||||
SelectObject32(hdcSrc,hbitmap);
|
||||
StretchBlt32(hdc,mr->rdParam[9],mr->rdParam[8],
|
||||
StretchBlt16(hdc,mr->rdParam[9],mr->rdParam[8],
|
||||
mr->rdParam[7],mr->rdParam[6],
|
||||
hdcSrc,mr->rdParam[5],mr->rdParam[4],
|
||||
mr->rdParam[3],mr->rdParam[2],
|
||||
|
|
|
@ -86,19 +86,20 @@ static const char *TEXT_NextLine( HDC16 hdc, const char *str, int *count,
|
|||
case PREFIX:
|
||||
if (!(format & DT_NOPREFIX))
|
||||
{
|
||||
prefix_offset = j;
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[j++] = str[i++];
|
||||
if (!(format & DT_NOCLIP) || (format & DT_WORDBREAK))
|
||||
{
|
||||
if (!GetTextExtentPoint16(hdc, &dest[j-1], 1, &size))
|
||||
return NULL;
|
||||
plen += size.cx;
|
||||
}
|
||||
if (str[++i] != PREFIX)
|
||||
{
|
||||
prefix_offset = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
dest[j++] = str[i++];
|
||||
if (!(format & DT_NOCLIP) || !(format & DT_NOPREFIX) ||
|
||||
(format & DT_WORDBREAK))
|
||||
{
|
||||
if (!GetTextExtentPoint16(hdc, &dest[j-1], 1, &size))
|
||||
return NULL;
|
||||
plen += size.cx;
|
||||
}
|
||||
break;
|
||||
|
||||
case TAB:
|
||||
|
|
|
@ -53,7 +53,6 @@ int main(int argc,char *argv[])
|
|||
{
|
||||
extern int yydebug;
|
||||
extern char* optarg;
|
||||
char* tmpc;
|
||||
int optc,lose,ret,binary;
|
||||
lose=binary=0;
|
||||
while((optc=getopt(argc,argv,"bcdp:vo:w:"))!=EOF)
|
||||
|
@ -66,12 +65,7 @@ int main(int argc,char *argv[])
|
|||
setbuf(stdout,0);
|
||||
setbuf(stderr,0);
|
||||
break;
|
||||
case 'p':prefix=strdup(optarg);
|
||||
if(!isalpha(*prefix))*prefix='_';
|
||||
for(tmpc=prefix;*tmpc;tmpc++)
|
||||
if( !isalnum(*tmpc) && *tmpc!='_')
|
||||
*tmpc='_';
|
||||
break;
|
||||
case 'p':prefix=strdup(optarg); break;
|
||||
case 'c':constant=1;break;
|
||||
case 'v':verbose=1;
|
||||
setbuf(stderr,0);
|
||||
|
|
|
@ -4,10 +4,10 @@ TOPOBJDIR = ..
|
|||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
PROGRAMS = build makedep
|
||||
PROGRAMS = build makedep fnt2bdf
|
||||
MODULE = none
|
||||
|
||||
C_SRCS = build.c makedep.c
|
||||
C_SRCS = build.c makedep.c fnt2bdf.c
|
||||
|
||||
all: $(PROGRAMS)
|
||||
|
||||
|
@ -19,4 +19,7 @@ build: build.o
|
|||
makedep: makedep.o
|
||||
$(CC) $(CFLAGS) -o makedep makedep.o
|
||||
|
||||
fnt2bdf: fnt2bdf.o
|
||||
$(CC) $(CFLAGS) -o fnt2bdf fnt2bdf.o
|
||||
|
||||
### Dependencies:
|
||||
|
|
1206
tools/build.c
1206
tools/build.c
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,584 @@
|
|||
/************************************************
|
||||
*
|
||||
* Extract fonts from .fnt or Windows DLL files
|
||||
* and convert them to the .bdf format.
|
||||
*
|
||||
* Copyright 1994-1996 Kevin Carothers and Alex Korobka
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "windows.h"
|
||||
#include "fnt2bdf.h"
|
||||
#include "neexe.h"
|
||||
#include "module.h"
|
||||
|
||||
#define MAP_BEG 118
|
||||
|
||||
extern char* g_lpstrFileName;
|
||||
extern char* g_lpstrCharSet;
|
||||
|
||||
#define FILE_ERROR 0
|
||||
#define FILE_DLL 1
|
||||
#define FILE_FNT 2
|
||||
|
||||
/* global options */
|
||||
|
||||
char* g_lpstrFileName = NULL;
|
||||
char* g_lpstrCharSet = NULL;
|
||||
char* g_lpstrInputFile = NULL;
|
||||
|
||||
static char* errorDLLRead = "Unable to read Windows DLL.\n";
|
||||
static char* errorFNTRead = "Unable to read .FNT file.\n";
|
||||
static char* errorOpenFile = "Unable to open file.\n";
|
||||
static char* errorMemory = "Memory allocation error.\n";
|
||||
static char* errorFile = "Corrupt or invalid file.\n";
|
||||
static char* errorFontData = "Unable to parse font data: Error ";
|
||||
static char* errorEmpty = "No fonts found.\n";
|
||||
|
||||
/* info */
|
||||
|
||||
void usage()
|
||||
{
|
||||
printf("Usage: font2bdf [-c charset] [-o basename] [input file]\n");
|
||||
printf(" -c charset\tuse this charset name for OEM_CHARSET fonts\n");
|
||||
printf(" -f basename\tbasic output filename\n");
|
||||
printf(" input file\tMSWindows .fon, .fnt, .dll, or .exe file.\n");
|
||||
printf("\nExample:\n fnt2bdf -c winsys vgasys.fnt\n\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* convert big-endian value to the local format */
|
||||
|
||||
int return_data_value(enum data_types dtype, void * pChr)
|
||||
{
|
||||
int ret_val = 0;
|
||||
|
||||
switch(dtype) {
|
||||
case (dfChar):
|
||||
ret_val = (int) *(unsigned char *)pChr;
|
||||
break;
|
||||
|
||||
case(dfShort):
|
||||
ret_val = *(unsigned char *)pChr;
|
||||
ret_val += (*((unsigned char *)pChr + 1) << 8);
|
||||
break;
|
||||
|
||||
case(dfLong): {
|
||||
int i;
|
||||
|
||||
for(i=3; i >= 0; i--) {
|
||||
ret_val += *((unsigned char *)pChr + i) << (8*i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case(dfString):
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
int make_bdf_filename(char* name, fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
|
||||
{
|
||||
int l_nameoffset = return_data_value(dfLong, cpe_font_struct->hdr.dfFace);
|
||||
char* lpChar;
|
||||
|
||||
if( !g_lpstrFileName )
|
||||
{
|
||||
if( !l_nameoffset ||
|
||||
l_nameoffset > return_data_value(dfLong, cpe_font_struct->hdr.dfSize) + 1 )
|
||||
return ERROR_DATA;
|
||||
lpChar = (char*)(file_buffer + l_nameoffset);
|
||||
}
|
||||
else lpChar = g_lpstrFileName;
|
||||
|
||||
strcpy( name, lpChar );
|
||||
|
||||
while( (lpChar = strchr( name, ' ')) )
|
||||
*lpChar = '-';
|
||||
|
||||
/* construct a filename from the font typeface, slant, weight, and size */
|
||||
|
||||
if( cpe_font_struct->hdr.dfItalic[0] ) strcat(name, "_i" );
|
||||
else strcat(name, "_r" );
|
||||
|
||||
lpChar = name + strlen( name );
|
||||
sprintf(lpChar, "%d-%d.bdf", return_data_value(dfShort, cpe_font_struct->hdr.dfWeight),
|
||||
return_data_value(dfShort, cpe_font_struct->hdr.dfPoints) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* parse FONT resource and write .bdf file */
|
||||
|
||||
int parse_fnt_data(unsigned char* file_buffer, int length)
|
||||
{
|
||||
fnt_fontS cpe_font_struct;
|
||||
int ic=0, t;
|
||||
|
||||
bcopy(file_buffer, (char *) &cpe_font_struct.hdr, sizeof(fnt_hdrS));
|
||||
|
||||
/* check font header */
|
||||
|
||||
t = return_data_value(dfShort, cpe_font_struct.hdr.dfVersion);
|
||||
if( t != 0x300 && t != 0x200) return ERROR_VERSION;
|
||||
|
||||
t = return_data_value(dfLong, cpe_font_struct.hdr.dfSize);
|
||||
if( t > length ) return ERROR_SIZE;
|
||||
else
|
||||
{
|
||||
/* set up the charWidth/charOffset structure pairs (dfCharTable)... */
|
||||
|
||||
int l_fchar = return_data_value(dfChar, cpe_font_struct.hdr.dfFirstChar),
|
||||
l_lchar = return_data_value(dfChar, cpe_font_struct.hdr.dfLastChar);
|
||||
int l_len = l_lchar-l_fchar, l_ptr = MAP_BEG;
|
||||
|
||||
/* malloc size = (# chars) * sizeof(WinCharS) */
|
||||
|
||||
if((cpe_font_struct.dfCharTable = (WinCharS *) calloc(sizeof(WinCharS), l_len)) == NULL)
|
||||
return ERROR_MEMORY;
|
||||
|
||||
/* NOW, convert them all to UNIX (lton) notation... */
|
||||
|
||||
for(ic=0; ic < l_len; ic++) {
|
||||
cpe_font_struct.dfCharTable[ic].charWidth = return_data_value(dfShort, &file_buffer[l_ptr]);
|
||||
l_ptr += 2; /* bump by sizeof(short) */
|
||||
|
||||
|
||||
if( return_data_value(dfShort, cpe_font_struct.hdr.dfVersion) == 0x200) {
|
||||
cpe_font_struct.dfCharTable[ic].charOffset =
|
||||
return_data_value(dfShort, &file_buffer[l_ptr]);
|
||||
l_ptr += 2; /* bump by sizeof(long) */
|
||||
}
|
||||
else { /* Windows Version 3.0 type font */
|
||||
cpe_font_struct.dfCharTable[ic].charOffset =
|
||||
return_data_value(dfLong, &file_buffer[l_ptr]);
|
||||
l_ptr += 4; /* bump by sizeof(long) */
|
||||
}
|
||||
}
|
||||
t = dump_bdf(&cpe_font_struct, file_buffer);
|
||||
free( cpe_font_struct.dfCharTable );
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
|
||||
{
|
||||
FILE* fp;
|
||||
int ic;
|
||||
int l_fchar = return_data_value(dfChar, cpe_font_struct->hdr.dfFirstChar),
|
||||
l_lchar = return_data_value(dfChar, cpe_font_struct->hdr.dfLastChar);
|
||||
|
||||
int l_len = l_lchar-l_fchar,
|
||||
l_hgt = return_data_value(dfChar, cpe_font_struct->hdr.dfPixHeight);
|
||||
int l_ascent = return_data_value(dfShort, cpe_font_struct->hdr.dfAscent);
|
||||
char l_filename[256];
|
||||
|
||||
if( (ic = make_bdf_filename(l_filename, cpe_font_struct, file_buffer)) )
|
||||
return ic;
|
||||
|
||||
if((fp = fopen(l_filename, "w")) == (FILE *) 0)
|
||||
{
|
||||
fprintf(stderr, "Couldn't open \"%s\" for output.\n", l_filename);
|
||||
return ERROR_FILE;
|
||||
}
|
||||
|
||||
dump_bdf_hdr(fp, cpe_font_struct, file_buffer);
|
||||
|
||||
/* NOW, convert all chars to UNIX (lton) notation... */
|
||||
|
||||
for(ic=0; ic < l_len; ic++) {
|
||||
int rowidx, l_span, /* how many char-cols wide is char? */
|
||||
l_idx = cpe_font_struct->dfCharTable[ic].charOffset;
|
||||
|
||||
l_span = (int) (cpe_font_struct->dfCharTable[ic].charWidth-1)/8;
|
||||
|
||||
fprintf(fp, "STARTCHAR %d \n", ic);
|
||||
fprintf(fp, "ENCODING %d\n", l_fchar);
|
||||
fprintf(fp, "SWIDTH %d %d \n",
|
||||
cpe_font_struct->dfCharTable[ic].charWidth*1000,
|
||||
0);
|
||||
|
||||
fprintf(fp, "DWIDTH %d %d \n",
|
||||
cpe_font_struct->dfCharTable[ic].charWidth, 0);
|
||||
|
||||
fprintf(fp, "BBX %d %d %d %d\n",
|
||||
cpe_font_struct->dfCharTable[ic].charWidth, l_hgt, 0,
|
||||
l_ascent - l_hgt);
|
||||
|
||||
fprintf(fp, "BITMAP\n");
|
||||
for(rowidx=0; rowidx < l_hgt; rowidx++) {
|
||||
switch(l_span) {
|
||||
case(0): /* 1-7 pixels wide font */
|
||||
{
|
||||
fprintf(fp, "%02X\n", (int) file_buffer[l_idx+rowidx]);
|
||||
break;
|
||||
}
|
||||
|
||||
case(1): /* 8-15 pixels wide font */
|
||||
{
|
||||
fprintf(fp, "%02X%02X",
|
||||
(int) file_buffer[l_idx+rowidx], file_buffer[l_idx+l_hgt+rowidx]);
|
||||
fprintf(fp, "\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case(2): /* 16-23 pixels wide font */
|
||||
{
|
||||
fprintf(fp, "%02X%02X%02X",
|
||||
file_buffer[l_idx+rowidx],
|
||||
file_buffer[l_idx+l_hgt+rowidx],
|
||||
file_buffer[l_idx+(2*l_hgt)+rowidx]);
|
||||
fprintf(fp, "\n");
|
||||
break;
|
||||
}
|
||||
|
||||
case(3): /* 24-31 pixels wide font */
|
||||
{
|
||||
fprintf(fp, "%02X%02X%02X%02X",
|
||||
file_buffer[l_idx+rowidx],
|
||||
file_buffer[l_idx+l_hgt+rowidx],
|
||||
file_buffer[l_idx+(2*l_hgt)+rowidx],
|
||||
file_buffer[l_idx+(3*l_hgt)+rowidx]);
|
||||
fprintf(fp, "\n");
|
||||
break;
|
||||
}
|
||||
case(4): /* 32-39 */
|
||||
{
|
||||
fprintf(fp, "%02X%02X%02X%02X%02X",
|
||||
file_buffer[l_idx+rowidx],
|
||||
file_buffer[l_idx+l_hgt+rowidx],
|
||||
file_buffer[l_idx+(2*l_hgt)+rowidx],
|
||||
file_buffer[l_idx+(3*l_hgt)+rowidx],
|
||||
file_buffer[l_idx+(4*l_hgt)+rowidx]);
|
||||
fprintf(fp, "\n");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
fclose(fp);
|
||||
unlink(l_filename);
|
||||
return ERROR_DATA;
|
||||
}
|
||||
}
|
||||
fprintf(fp, "ENDCHAR\n");
|
||||
|
||||
l_fchar++; /* Go to next one */
|
||||
}
|
||||
fprintf(fp, "ENDFONT\n");
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
|
||||
{
|
||||
int l_fchar = return_data_value(dfChar, cpe_font_struct->hdr.dfFirstChar),
|
||||
l_lchar = return_data_value(dfChar, cpe_font_struct->hdr.dfLastChar);
|
||||
int l_len = l_lchar - l_fchar;
|
||||
int l_nameoffset = return_data_value(dfLong, cpe_font_struct->hdr.dfFace);
|
||||
int l_cellheight = return_data_value(dfShort, cpe_font_struct->hdr.dfPixHeight);
|
||||
int l_ascent = return_data_value(dfShort, cpe_font_struct->hdr.dfAscent);
|
||||
|
||||
fprintf(fs, "STARTFONT 2.1\n");
|
||||
|
||||
/* Compose font name */
|
||||
|
||||
if( l_nameoffset &&
|
||||
l_nameoffset < return_data_value(dfLong, cpe_font_struct->hdr.dfSize) )
|
||||
{
|
||||
int dpi, point_size;
|
||||
char* lpFace = (char*)(file_buffer + l_nameoffset), *lpChar;
|
||||
short tmWeight = return_data_value(dfShort, cpe_font_struct->hdr.dfWeight);
|
||||
|
||||
while((lpChar = strchr(lpFace, '-')) )
|
||||
*lpChar = ' ';
|
||||
|
||||
fprintf(fs, "FONT -windows-%s-", lpFace );
|
||||
|
||||
if( tmWeight == 0 ) /* weight */
|
||||
fputs("medium-", fs);
|
||||
else if( tmWeight <= FW_LIGHT )
|
||||
fputs("light-", fs);
|
||||
else if( tmWeight <= FW_MEDIUM )
|
||||
fputs("medium-", fs);
|
||||
else if( tmWeight <= FW_DEMIBOLD )
|
||||
fputs("demibold-", fs);
|
||||
else if( tmWeight <= FW_BOLD )
|
||||
fputs("bold-", fs);
|
||||
else fputs("black-", fs);
|
||||
|
||||
if( cpe_font_struct->hdr.dfItalic[0] ) /* slant */
|
||||
fputs("i-", fs);
|
||||
else fputs("r-", fs);
|
||||
|
||||
/* style */
|
||||
|
||||
if( (cpe_font_struct->hdr.dfPitchAndFamily[0] & 0xF0) == FF_SWISS )
|
||||
fputs("normal-sans-", fs);
|
||||
else fputs("normal--", fs); /* still can be -sans */
|
||||
|
||||
/* y extents */
|
||||
|
||||
point_size = 10 * return_data_value(dfShort, cpe_font_struct->hdr.dfPoints );
|
||||
dpi = (l_cellheight * 720) / point_size;
|
||||
|
||||
fprintf(fs, "%d-%d-%d-%d-", l_cellheight, 10*l_cellheight, 72, 72);
|
||||
/* point_size, dpi, dpi); */
|
||||
|
||||
/* spacing */
|
||||
|
||||
if( return_data_value(dfShort, cpe_font_struct->hdr.dfPixWidth) ) fputs("c-", fs);
|
||||
else fputs("m-", fs);
|
||||
|
||||
/* average width */
|
||||
|
||||
fprintf( fs, "%d-", 10 * return_data_value(dfShort, cpe_font_struct->hdr.dfAvgWidth) );
|
||||
|
||||
/* charset */
|
||||
|
||||
switch( cpe_font_struct->hdr.dfCharSet[0] )
|
||||
{
|
||||
case ANSI_CHARSET: fputs("ansi-0\n", fs); break;
|
||||
default:
|
||||
case DEFAULT_CHARSET: fputs("iso8859-1\n", fs); break;
|
||||
case SYMBOL_CHARSET: fputs("misc-fontspecific\n", fs); break;
|
||||
case SHIFTJIS_CHARSET: fputs("jisx0208.1983-0\n", fs); break;
|
||||
case OEM_CHARSET:
|
||||
if( !g_lpstrCharSet )
|
||||
{ fputs("Undefined OEM charset, use -c option.\n", stderr);
|
||||
return ERROR_DATA; }
|
||||
fprintf(fs, "%s\n", g_lpstrCharSet);
|
||||
}
|
||||
}
|
||||
else return ERROR_DATA;
|
||||
|
||||
fprintf(fs, "SIZE %d %d %d\n",
|
||||
l_cellheight,
|
||||
return_data_value(dfShort, cpe_font_struct->hdr.dfHorizRes),
|
||||
return_data_value(dfShort, cpe_font_struct->hdr.dfVertRes)); /* dfVertRes[2] */
|
||||
|
||||
fprintf(fs, "FONTBOUNDINGBOX %d %d %d %d\n",
|
||||
return_data_value(dfShort, cpe_font_struct->hdr.dfMaxWidth),
|
||||
return_data_value(dfChar, cpe_font_struct->hdr.dfPixHeight),
|
||||
0, l_ascent - l_cellheight );
|
||||
|
||||
fprintf(fs, "STARTPROPERTIES 4\n");
|
||||
|
||||
fprintf(fs, "FONT_ASCENT %d\n", l_ascent ); /* dfAscent[2] */
|
||||
fprintf(fs, "FONT_DESCENT %d\n", l_cellheight - l_ascent );
|
||||
fprintf(fs, "CAP_HEIGHT %d\n", l_ascent -
|
||||
return_data_value(dfShort, cpe_font_struct->hdr.dfInternalLeading));
|
||||
fprintf(fs, "DEFAULT_CHAR %d\n", return_data_value(dfShort, cpe_font_struct->hdr.dfDefaultChar));
|
||||
|
||||
fprintf(fs, "ENDPROPERTIES\n");
|
||||
|
||||
fprintf(fs, "CHARS %d\n", l_len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void parse_options(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch( argc )
|
||||
{
|
||||
case 2:
|
||||
g_lpstrInputFile = argv[1];
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
for( i = 1; i < argc - 1; i++ )
|
||||
{
|
||||
if( argv[i][0] != '-' ||
|
||||
strlen(argv[i]) != 2 ) break;
|
||||
|
||||
if( argv[i][1] == 'c' ) { g_lpstrCharSet = argv[i+1]; }
|
||||
else
|
||||
if( argv[i][1] == 'f' ) { g_lpstrFileName = argv[i+1]; }
|
||||
else
|
||||
usage();
|
||||
|
||||
i++;
|
||||
}
|
||||
if( i == argc - 1 )
|
||||
{
|
||||
g_lpstrInputFile = argv[i];
|
||||
break;
|
||||
}
|
||||
default: usage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* read file data and return file type */
|
||||
|
||||
int get_resource_table(int fd, unsigned char** lpdata, int fsize)
|
||||
{
|
||||
struct mz_header_s mz_header;
|
||||
struct ne_header_s ne_header;
|
||||
short s, offset, size, retval;
|
||||
|
||||
|
||||
lseek( fd, 0, SEEK_SET );
|
||||
|
||||
if( read(fd, &mz_header, sizeof(mz_header)) != sizeof(mz_header) )
|
||||
return FILE_ERROR;
|
||||
|
||||
s = return_data_value(dfShort, &mz_header.mz_magic);
|
||||
|
||||
if( s == MZ_SIGNATURE) /* looks like .dll file so far... */
|
||||
{
|
||||
s = return_data_value(dfShort, &mz_header.ne_offset);
|
||||
lseek( fd, s, SEEK_SET );
|
||||
|
||||
if( read(fd, &ne_header, sizeof(ne_header)) != sizeof(ne_header) )
|
||||
return FILE_ERROR;
|
||||
|
||||
s = return_data_value(dfShort, &ne_header.ne_magic);
|
||||
|
||||
if( s == PE_SIGNATURE)
|
||||
{
|
||||
fprintf( stderr, "Do not know how to handle 32-bit Windows DLLs.\n");
|
||||
return FILE_ERROR;
|
||||
}
|
||||
else if ( s != NE_SIGNATURE) return FILE_ERROR;
|
||||
|
||||
s = return_data_value(dfShort, &ne_header.resource_tab_offset);
|
||||
size = return_data_value(dfShort, &ne_header.rname_tab_offset);
|
||||
|
||||
if( size > fsize ) return FILE_ERROR;
|
||||
|
||||
size -= s;
|
||||
offset = s + return_data_value(dfShort, &mz_header.ne_offset);
|
||||
|
||||
if( size <= sizeof(NE_TYPEINFO) ) return FILE_ERROR;
|
||||
retval = FILE_DLL;
|
||||
}
|
||||
else if( s == 0x300 || s == 0x200 ) /* maybe .fnt ? */
|
||||
{
|
||||
size = return_data_value(dfLong, &mz_header.dont_care);
|
||||
|
||||
if( size != fsize ) return FILE_ERROR;
|
||||
offset = 0;
|
||||
retval = FILE_FNT;
|
||||
}
|
||||
else return FILE_ERROR;
|
||||
|
||||
*lpdata = (unsigned char*)malloc(size);
|
||||
|
||||
if( *lpdata )
|
||||
{
|
||||
lseek( fd, offset, SEEK_SET );
|
||||
if( read(fd, *lpdata, size) != size )
|
||||
{ free( *lpdata ); *lpdata = NULL; }
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/* entry point */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned char* lpdata = NULL;
|
||||
int fd;
|
||||
|
||||
parse_options( argc, argv);
|
||||
|
||||
if( (fd = open( g_lpstrInputFile, O_RDONLY)) )
|
||||
{
|
||||
int i;
|
||||
struct stat file_stat;
|
||||
|
||||
fstat( fd, &file_stat);
|
||||
i = get_resource_table( fd, &lpdata, file_stat.st_size );
|
||||
|
||||
switch(i)
|
||||
{
|
||||
case FILE_DLL:
|
||||
if( lpdata )
|
||||
{
|
||||
int j, count = 0;
|
||||
NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(lpdata + 2);
|
||||
NE_NAMEINFO* pFontStorage = NULL;
|
||||
|
||||
while( (i = return_data_value(dfShort, &pTInfo->type_id)) )
|
||||
{
|
||||
j = return_data_value(dfShort, &pTInfo->count);
|
||||
if( i == NE_RSCTYPE_FONT )
|
||||
{
|
||||
count = j;
|
||||
pFontStorage = (NE_NAMEINFO*)(pTInfo + 1);
|
||||
}
|
||||
|
||||
pTInfo = (NE_TYPEINFO *)((char*)(pTInfo+1) + j*sizeof(NE_NAMEINFO));
|
||||
}
|
||||
if( pFontStorage && count )
|
||||
{
|
||||
unsigned short size_shift = return_data_value(dfShort, lpdata);
|
||||
unsigned char* lpfont = NULL;
|
||||
unsigned offset;
|
||||
unsigned length;
|
||||
|
||||
for( j = 0; j < count; j++, pFontStorage++ )
|
||||
{
|
||||
length = return_data_value(dfShort, &pFontStorage->length) << size_shift;
|
||||
offset = return_data_value(dfShort, &pFontStorage->offset) << size_shift;
|
||||
|
||||
if( !(lpfont = (unsigned char*) realloc( lpfont, length )) )
|
||||
{
|
||||
fprintf(stderr, errorMemory );
|
||||
free(lpdata);
|
||||
return -1;
|
||||
}
|
||||
|
||||
lseek( fd, offset, SEEK_SET );
|
||||
if( read(fd, lpfont, length) != length )
|
||||
{
|
||||
fprintf(stderr, errorDLLRead );
|
||||
free(lpdata); free(lpfont);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( (i = parse_fnt_data( lpfont, length )) )
|
||||
fprintf(stderr, "%s%d\n", errorFontData, i );
|
||||
}
|
||||
free(lpfont); free(lpdata);
|
||||
return 0;
|
||||
}
|
||||
else fprintf(stderr, errorEmpty );
|
||||
free( lpdata );
|
||||
}
|
||||
else fprintf(stderr, errorDLLRead);
|
||||
break;
|
||||
|
||||
case FILE_FNT:
|
||||
if( lpdata )
|
||||
{
|
||||
if( (i = parse_fnt_data( lpdata, file_stat.st_size )) )
|
||||
fprintf(stderr, "%s%d\n", errorFontData, i );
|
||||
|
||||
free( lpdata );
|
||||
}
|
||||
else fprintf(stderr, errorFNTRead);
|
||||
break;
|
||||
|
||||
case FILE_ERROR:
|
||||
fprintf(stderr, errorFile );
|
||||
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
else fprintf(stderr, errorOpenFile );
|
||||
return -1;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
#include <stdio.h>
|
||||
|
||||
enum data_types {dfChar, dfShort, dfLong, dfString};
|
||||
|
||||
#define ERROR_DATA 1
|
||||
#define ERROR_VERSION 2
|
||||
#define ERROR_SIZE 3
|
||||
#define ERROR_MEMORY 4
|
||||
#define ERROR_FILE 5
|
||||
|
||||
typedef struct tagFontHeader
|
||||
{
|
||||
unsigned char dfVersion[2]; /* Version (always 0x3000) */
|
||||
unsigned char dfSize[4]; /* Total File Size */
|
||||
unsigned char dfCopyright[60]; /* Copyright notice */
|
||||
unsigned char dfType[2]; /* Vector or bitmap font */
|
||||
unsigned char dfPoints[2]; /* Nominal point size */
|
||||
unsigned char dfVertRes[2]; /* Vertical Resolution */
|
||||
unsigned char dfHorizRes[2]; /* Horizontal Resolutionchar */
|
||||
unsigned char dfAscent[2]; /* Character ascent in pixels */
|
||||
unsigned char dfInternalLeading[2]; /* Leading included in character defn */
|
||||
unsigned char dfExternalLeading[2]; /* Leading to be added by Windows */
|
||||
unsigned char dfItalic[1]; /* 1=Italic font */
|
||||
unsigned char dfUnderline[1]; /* 1=underlined font */
|
||||
unsigned char dfStrikeOut[1]; /* 1=strike-out font */
|
||||
unsigned char dfWeight[2]; /* Weight: 400=normal */
|
||||
unsigned char dfCharSet[1]; /* Character Set for this font */
|
||||
unsigned char dfPixWidth[2]; /* Character width (0 for proportional) */
|
||||
unsigned char dfPixHeight[2]; /* Character height */
|
||||
unsigned char dfPitchAndFamily[1]; /* Font Pitch and family */
|
||||
unsigned char dfAvgWidth[2]; /* Average character width */
|
||||
unsigned char dfMaxWidth[2]; /* Maximum character width */
|
||||
unsigned char dfFirstChar[1]; /* Firwst character of the font */
|
||||
unsigned char dfLastChar[1]; /* Last character of the font */
|
||||
unsigned char dfDefaultChar[1]; /* Missing character */
|
||||
unsigned char dfBreakChar[1]; /* Character to indicate word breaks */
|
||||
unsigned char dfWidthBytes[2]; /* Number of bytes in each row */
|
||||
unsigned char dfDevice[4]; /* Offset to device name */
|
||||
unsigned char dfFace[4]; /* Offset to type face name */
|
||||
unsigned char dfBitsPointer[4];
|
||||
unsigned char dfBitsOffset[4]; /* Offset to bitmaps */
|
||||
unsigned char dfReserved[1];
|
||||
unsigned char dfFlags[4]; /* Bitmapped flags */
|
||||
unsigned char dfAspace[2];
|
||||
unsigned char dfBspace[2];
|
||||
unsigned char dfCspace[2];
|
||||
unsigned char dfColorTable[2]; /* Offset to Color table */
|
||||
unsigned char dfReserved1[4];
|
||||
} fnt_hdrS;
|
||||
|
||||
typedef struct WinCharStruct
|
||||
{
|
||||
unsigned int charWidth;
|
||||
unsigned int charOffset;
|
||||
} WinCharS;
|
||||
|
||||
typedef struct fntFontStruct
|
||||
{
|
||||
fnt_hdrS hdr;
|
||||
WinCharS *dfCharTable;
|
||||
unsigned char *dfDeviceP;
|
||||
unsigned char *dfFaceP;
|
||||
unsigned char *dfBitsPointerP;
|
||||
unsigned char *dfBitsOffsetP;
|
||||
short *dfColorTableP;
|
||||
} fnt_fontS;
|
||||
|
||||
extern int return_data_value(enum data_types, void *);
|
||||
|
||||
extern int dump_bdf(fnt_fontS*, unsigned char* );
|
||||
extern int dump_bdf_hdr(FILE* fp,fnt_fontS*, unsigned char* );
|
||||
|
||||
extern int parse_fnt_data(unsigned char* file_buffer, int length);
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
/***********************************************************************
|
||||
* GetACP (KERNEL32.148)
|
||||
*/
|
||||
UINT GetACP(void)
|
||||
UINT32 GetACP(void)
|
||||
{
|
||||
return 1252; /* Windows 3.1 ISO Latin */
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ BOOL GetCPInfo(UINT codepage, LPCPINFO cpinfo)
|
|||
/***********************************************************************
|
||||
* GetOEMCP (KERNEL32.248)
|
||||
*/
|
||||
UINT GetOEMCP(void)
|
||||
UINT32 GetOEMCP(void)
|
||||
{
|
||||
return 437; /* MS-DOS United States */
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <malloc.h>
|
||||
#include "xmalloc.h"
|
||||
#include "windows.h"
|
||||
#include "winerror.h"
|
||||
#include "dos_fs.h"
|
||||
#include "heap.h"
|
||||
#include "string32.h"
|
||||
|
@ -188,8 +189,12 @@ BOOL32 FindClose32(HANDLE32 handle)
|
|||
{
|
||||
FindFileContext32 *context;
|
||||
|
||||
if (handle==(INVALID_HANDLE_VALUE))
|
||||
return TRUE;
|
||||
/* Windows95 ignores an invalid handle. */
|
||||
if (handle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
context = (FindFileContext32 *) handle;
|
||||
if (context->dir)
|
||||
closedir(context->dir);
|
||||
|
|
|
@ -23,32 +23,6 @@ BOOL WIN32_WinHelpA(HWND hWnd,LPCSTR lpszHelp,UINT uCommand, DWORD dwData)
|
|||
return WinHelp(hWnd,lpszHelp,uCommand,dwData);
|
||||
}
|
||||
|
||||
HHOOK SetWindowsHookEx32A(INT32 id, HOOKPROC32 hookfn, HINSTANCE32 hModule,
|
||||
DWORD ThreadId)
|
||||
|
||||
{
|
||||
/* Stub for now */
|
||||
fprintf(stdnimp, "SetWindowsHookEx32A Stub called! (hook Id %d)\n",id);
|
||||
|
||||
return (HHOOK) NULL;
|
||||
}
|
||||
|
||||
HHOOK SetWindowsHook32A(INT32 HookId, HOOKPROC32 hookfn)
|
||||
{
|
||||
/* Stub for now */
|
||||
fprintf(stdnimp, "SetWindowsHook32A Stub called! (hook Id %d)\n", HookId);
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return (HHOOK) NULL;
|
||||
}
|
||||
|
||||
BOOL32 UnhookWindowsHookEx32(HHOOK hHook)
|
||||
|
||||
{
|
||||
/* Stub for now */
|
||||
fprintf(stdnimp, "UnhookWindowsHookEx32 Stub called!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* QueryPerformanceCounter (KERNEL32.415)
|
||||
*/
|
||||
|
|
|
@ -15,12 +15,13 @@
|
|||
#include "xmalloc.h"
|
||||
|
||||
/***********************************************************************
|
||||
* GetCurrentThreadId (KERNEL32.200)
|
||||
* GetCurrentThreadId (KERNEL32.201)
|
||||
*/
|
||||
|
||||
int GetCurrentThreadId(void)
|
||||
DWORD GetCurrentThreadId(void)
|
||||
{
|
||||
return getpid();
|
||||
/* Windows 95 returns the address of the thread database (sorta) */
|
||||
return MAKELONG(GetCurrentTask(), 0);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -35,7 +36,7 @@ BOOL GetThreadContext(HANDLE32 hThread, void *lpContext)
|
|||
*/
|
||||
HANDLE32 GetCurrentThread(void)
|
||||
{
|
||||
return 0;
|
||||
return 0xFFFFFFFE; /* that's -2 */
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -89,18 +89,18 @@ static BOOL32 DEFDLG_SetDefButton( HWND32 hwndDlg, DIALOGINFO *dlgInfo,
|
|||
!(SendMessage16(hwndNew, WM_GETDLGCODE, 0, 0 ) & DLGC_UNDEFPUSHBUTTON))
|
||||
return FALSE; /* Destination is not a push button */
|
||||
|
||||
if (dlgInfo->msgResult) /* There's already a default pushbutton */
|
||||
if (dlgInfo->idResult) /* There's already a default pushbutton */
|
||||
{
|
||||
HWND32 hwndOld = GetDlgItem( hwndDlg, dlgInfo->msgResult );
|
||||
HWND32 hwndOld = GetDlgItem( hwndDlg, dlgInfo->idResult );
|
||||
if (SendMessage32A( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
|
||||
SendMessage32A( hwndOld, BM_SETSTYLE32, BS_PUSHBUTTON, TRUE );
|
||||
}
|
||||
if (hwndNew)
|
||||
{
|
||||
SendMessage32A( hwndNew, BM_SETSTYLE32, BS_DEFPUSHBUTTON, TRUE );
|
||||
dlgInfo->msgResult = GetDlgCtrlID( hwndNew );
|
||||
dlgInfo->idResult = GetDlgCtrlID( hwndNew );
|
||||
}
|
||||
else dlgInfo->msgResult = 0;
|
||||
else dlgInfo->idResult = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -177,8 +177,8 @@ static LRESULT DEFDLG_Proc( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
|
|||
|
||||
case DM_GETDEFID:
|
||||
if (dlgInfo->fEnd) return 0;
|
||||
if (dlgInfo->msgResult)
|
||||
return MAKELONG( dlgInfo->msgResult, DC_HASDEFID );
|
||||
if (dlgInfo->idResult)
|
||||
return MAKELONG( dlgInfo->idResult, DC_HASDEFID );
|
||||
hwndDefId = DEFDLG_FindDefButton( hwnd );
|
||||
if (hwndDefId)
|
||||
return MAKELONG( GetDlgCtrlID( hwndDefId ), DC_HASDEFID);
|
||||
|
@ -223,7 +223,9 @@ LRESULT DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam )
|
|||
hwnd, msg, wParam, lParam );
|
||||
|
||||
/* Check if window was destroyed by dialog procedure */
|
||||
if (result || !IsWindow( hwnd )) return result;
|
||||
|
||||
if (!IsWindow( hwnd )) return result;
|
||||
else if( result ) return dlgInfo->msgResult;
|
||||
}
|
||||
|
||||
switch(msg)
|
||||
|
@ -267,7 +269,9 @@ LRESULT DefDlgProc32A( HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
|||
hwnd, msg, wParam, lParam );
|
||||
|
||||
/* Check if window was destroyed by dialog procedure */
|
||||
if (result || !IsWindow( hwnd )) return result;
|
||||
|
||||
if (!IsWindow( hwnd )) return result;
|
||||
else if( result ) return dlgInfo->msgResult;
|
||||
}
|
||||
|
||||
switch(msg)
|
||||
|
@ -310,7 +314,9 @@ LRESULT DefDlgProc32W( HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
|
|||
hwnd, msg, wParam, lParam );
|
||||
|
||||
/* Check if window was destroyed by dialog procedure */
|
||||
if (result || !IsWindow( hwnd )) return result;
|
||||
|
||||
if (!IsWindow( hwnd )) return result;
|
||||
else if( result ) return dlgInfo->msgResult;
|
||||
}
|
||||
|
||||
switch(msg)
|
||||
|
|
|
@ -293,7 +293,7 @@ static BOOL32 DIALOG_CreateControls( WND *pWnd, LPCSTR template, INT32 items,
|
|||
SendMessage32A( hwndDefButton, BM_SETSTYLE32,
|
||||
BS_PUSHBUTTON,FALSE );
|
||||
hwndDefButton = hwndCtrl;
|
||||
dlgInfo->msgResult = GetWindowWord( hwndCtrl, GWW_ID );
|
||||
dlgInfo->idResult = GetWindowWord( hwndCtrl, GWW_ID );
|
||||
}
|
||||
}
|
||||
dprintf_dialog(stddeb, " END\n" );
|
||||
|
@ -583,7 +583,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
|
|||
dlgInfo->hMenu = hMenu;
|
||||
dlgInfo->xBaseUnit = xUnit;
|
||||
dlgInfo->yBaseUnit = yUnit;
|
||||
dlgInfo->msgResult = 0; /* This is used to store the default button id */
|
||||
dlgInfo->msgResult = 0;
|
||||
dlgInfo->idResult = 0;
|
||||
dlgInfo->hDialogHeap = 0;
|
||||
|
||||
if (dlgInfo->hUserFont)
|
||||
|
@ -747,7 +748,7 @@ static INT32 DIALOG_DoDialogBox( HWND hwnd, HWND owner )
|
|||
}
|
||||
if (dlgInfo->fEnd) break;
|
||||
}
|
||||
retval = dlgInfo->msgResult;
|
||||
retval = dlgInfo->idResult;
|
||||
EnableWindow( owner, TRUE );
|
||||
DestroyWindow( hwnd );
|
||||
return retval;
|
||||
|
@ -860,7 +861,7 @@ BOOL16 EndDialog( HWND32 hwnd, INT32 retval )
|
|||
{
|
||||
WND * wndPtr = WIN_FindWndPtr( hwnd );
|
||||
DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
|
||||
dlgInfo->msgResult = retval;
|
||||
dlgInfo->idResult = retval;
|
||||
dlgInfo->fEnd = TRUE;
|
||||
dprintf_dialog(stddeb, "EndDialog: %04x %d\n", hwnd, retval );
|
||||
return TRUE;
|
||||
|
|
|
@ -307,6 +307,8 @@ void EVENT_RegisterWindow( WND *pWnd )
|
|||
if( dndSelection == None )
|
||||
dndSelection = XInternAtom( display, "DndSelection" , False );
|
||||
|
||||
XSetWMProtocols( display, pWnd->window, &wmDeleteWindow, 1 );
|
||||
|
||||
if (!winContext) winContext = XUniqueContext();
|
||||
XSaveContext( display, pWnd->window, winContext, (char *)pWnd );
|
||||
}
|
||||
|
|
|
@ -101,8 +101,8 @@ HWND32 SetFocus32( HWND32 hwnd )
|
|||
if( hwnd == hwndFocus ) return hwnd;
|
||||
|
||||
/* call hooks */
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM16)hwnd,
|
||||
(LPARAM)hwndFocus) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_SETFOCUS, (WPARAM16)hwnd,
|
||||
(LPARAM)hwndFocus) )
|
||||
return 0;
|
||||
|
||||
/* activate hwndTop if needed. */
|
||||
|
@ -113,7 +113,7 @@ HWND32 SetFocus32( HWND32 hwnd )
|
|||
if (!IsWindow( hwnd )) return 0; /* Abort if window destroyed */
|
||||
}
|
||||
}
|
||||
else if( HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)hwndFocus ) )
|
||||
else if( HOOK_CallHooks16( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)hwndFocus ) )
|
||||
return 0;
|
||||
|
||||
/* Change focus and send messages */
|
||||
|
|
1172
windows/hook.c
1172
windows/hook.c
File diff suppressed because it is too large
Load Diff
|
@ -91,15 +91,15 @@ static SYSQ_STATUS MSG_TranslateMouseMsg( MSG16 *msg, BOOL remove )
|
|||
msg->lParam = MAKELONG( pt.x, pt.y );
|
||||
/* No need to further process the message */
|
||||
|
||||
if (!HOOK_GetHook( WH_MOUSE, GetTaskQueue(0)) ||
|
||||
if (!HOOK_IsHooked( WH_MOUSE ) ||
|
||||
!(hook = SEGPTR_NEW(MOUSEHOOKSTRUCT16)))
|
||||
return SYSQ_MSG_ACCEPT;
|
||||
hook->pt = msg->pt;
|
||||
hook->hwnd = msg->hwnd;
|
||||
hook->wHitTestCode = HTCLIENT;
|
||||
hook->dwExtraInfo = 0;
|
||||
ret = !HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
|
||||
msg->message, (LPARAM)SEGPTR_GET(hook));
|
||||
ret = !HOOK_CallHooks16( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
|
||||
msg->message, (LPARAM)SEGPTR_GET(hook));
|
||||
SEGPTR_FREE(hook);
|
||||
return ret ? SYSQ_MSG_ACCEPT : SYSQ_MSG_SKIP ;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ static SYSQ_STATUS MSG_TranslateMouseMsg( MSG16 *msg, BOOL remove )
|
|||
|
||||
/* Call the WH_MOUSE hook */
|
||||
|
||||
if (!HOOK_GetHook( WH_MOUSE, GetTaskQueue(0)) ||
|
||||
if (!HOOK_IsHooked( WH_MOUSE ) ||
|
||||
!(hook = SEGPTR_NEW(MOUSEHOOKSTRUCT16)))
|
||||
return SYSQ_MSG_ACCEPT;
|
||||
|
||||
|
@ -203,8 +203,8 @@ static SYSQ_STATUS MSG_TranslateMouseMsg( MSG16 *msg, BOOL remove )
|
|||
hook->hwnd = msg->hwnd;
|
||||
hook->wHitTestCode = hittest;
|
||||
hook->dwExtraInfo = 0;
|
||||
ret = !HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
|
||||
msg->message, (LPARAM)SEGPTR_GET(hook) );
|
||||
ret = !HOOK_CallHooks16( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
|
||||
msg->message, (LPARAM)SEGPTR_GET(hook) );
|
||||
SEGPTR_FREE(hook);
|
||||
return ret ? SYSQ_MSG_ACCEPT : SYSQ_MSG_SKIP;
|
||||
}
|
||||
|
@ -245,9 +245,9 @@ static SYSQ_STATUS MSG_TranslateKeyboardMsg( MSG16 *msg, BOOL remove )
|
|||
if (queue) QUEUE_SetWakeBit( queue, QS_KEY );
|
||||
return SYSQ_MSG_ABANDON;
|
||||
}
|
||||
return (HOOK_CallHooks( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE,
|
||||
msg->wParam, msg->lParam ))
|
||||
? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT;
|
||||
return (HOOK_CallHooks16( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE,
|
||||
msg->wParam, msg->lParam )
|
||||
? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -268,16 +268,16 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
|
|||
event->paramH = msg->lParam & 0x7FFF;
|
||||
if (HIWORD(msg->lParam) & 0x0100)
|
||||
event->paramH |= 0x8000; /* special_key - bit */
|
||||
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0,
|
||||
(LPARAM)SEGPTR_GET(event) );
|
||||
HOOK_CallHooks16( WH_JOURNALRECORD, HC_ACTION, 0,
|
||||
(LPARAM)SEGPTR_GET(event) );
|
||||
}
|
||||
else if ((msg->message >= WM_MOUSEFIRST) && (msg->message <= WM_MOUSELAST))
|
||||
{
|
||||
event->paramL = LOWORD(msg->lParam); /* X pos */
|
||||
event->paramH = HIWORD(msg->lParam); /* Y pos */
|
||||
ClientToScreen16( msg->hwnd, (LPPOINT16)&event->paramL );
|
||||
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0,
|
||||
(LPARAM)SEGPTR_GET(event) );
|
||||
HOOK_CallHooks16( WH_JOURNALRECORD, HC_ACTION, 0,
|
||||
(LPARAM)SEGPTR_GET(event) );
|
||||
}
|
||||
else if ((msg->message >= WM_NCMOUSEFIRST) &&
|
||||
(msg->message <= WM_NCMOUSELAST))
|
||||
|
@ -285,8 +285,8 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
|
|||
event->paramL = LOWORD(msg->lParam); /* X pos */
|
||||
event->paramH = HIWORD(msg->lParam); /* Y pos */
|
||||
event->message += WM_MOUSEMOVE-WM_NCMOUSEMOVE;/* give no info about NC area */
|
||||
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0,
|
||||
(LPARAM)SEGPTR_GET(event) );
|
||||
HOOK_CallHooks16( WH_JOURNALRECORD, HC_ACTION, 0,
|
||||
(LPARAM)SEGPTR_GET(event) );
|
||||
}
|
||||
SEGPTR_FREE(event);
|
||||
}
|
||||
|
@ -302,10 +302,11 @@ static int MSG_JournalPlayBackMsg(void)
|
|||
long wtime,lParam;
|
||||
WORD keyDown,i,wParam,result=0;
|
||||
|
||||
if ( HOOK_GetHook(WH_JOURNALPLAYBACK, 0) )
|
||||
if ( HOOK_IsHooked( WH_JOURNALPLAYBACK ) )
|
||||
{
|
||||
tmpMsg = SEGPTR_NEW(EVENTMSG16);
|
||||
wtime=HOOK_CallHooks( WH_JOURNALPLAYBACK, HC_GETNEXT, 0, (LPARAM)SEGPTR_GET(tmpMsg));
|
||||
wtime=HOOK_CallHooks16( WH_JOURNALPLAYBACK, HC_GETNEXT, 0,
|
||||
(LPARAM)SEGPTR_GET(tmpMsg));
|
||||
/* dprintf_msg(stddeb,"Playback wait time =%ld\n",wtime); */
|
||||
if (wtime<=0)
|
||||
{
|
||||
|
@ -360,7 +361,8 @@ static int MSG_JournalPlayBackMsg(void)
|
|||
tmpMsg->paramL, tmpMsg->paramH, tmpMsg->time, 0 );
|
||||
}
|
||||
}
|
||||
HOOK_CallHooks( WH_JOURNALPLAYBACK, HC_SKIP, 0, (LPARAM)SEGPTR_GET(tmpMsg));
|
||||
HOOK_CallHooks16( WH_JOURNALPLAYBACK, HC_SKIP, 0,
|
||||
(LPARAM)SEGPTR_GET(tmpMsg));
|
||||
}
|
||||
else
|
||||
result= QS_MOUSE | QS_KEY;
|
||||
|
@ -412,9 +414,9 @@ static BOOL MSG_PeekHardwareMsg( MSG16 *msg, HWND hwnd, WORD first, WORD last,
|
|||
hook->wMessage = msg->message;
|
||||
hook->wParam = msg->wParam;
|
||||
hook->lParam = msg->lParam;
|
||||
ret = HOOK_CallHooks( WH_HARDWARE,
|
||||
remove ? HC_ACTION : HC_NOREMOVE,
|
||||
0, (LPARAM)SEGPTR_GET(hook) );
|
||||
ret = HOOK_CallHooks16( WH_HARDWARE,
|
||||
remove ? HC_ACTION : HC_NOREMOVE,
|
||||
0, (LPARAM)SEGPTR_GET(hook) );
|
||||
SEGPTR_FREE(hook);
|
||||
status = ret ? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT;
|
||||
}
|
||||
|
@ -434,7 +436,7 @@ static BOOL MSG_PeekHardwareMsg( MSG16 *msg, HWND hwnd, WORD first, WORD last,
|
|||
((msg->message < first) || (msg->message > last))) continue;
|
||||
if (remove)
|
||||
{
|
||||
if (HOOK_GetHook( WH_JOURNALRECORD, GetTaskQueue(0) ))
|
||||
if (HOOK_IsHooked( WH_JOURNALRECORD ))
|
||||
MSG_JournalRecordMsg( msg );
|
||||
QUEUE_RemoveMsg( sysMsgQueue, pos );
|
||||
}
|
||||
|
@ -776,18 +778,17 @@ BOOL32 MSG_InternalGetMessage( MSG16 *msg, HWND32 hwnd, HWND32 hwndOwner,
|
|||
|
||||
/* Call message filters */
|
||||
|
||||
if (HOOK_GetHook( WH_SYSMSGFILTER, GetTaskQueue(0) ) ||
|
||||
HOOK_GetHook( WH_MSGFILTER, GetTaskQueue(0) ))
|
||||
if (HOOK_IsHooked( WH_SYSMSGFILTER ) || HOOK_IsHooked( WH_MSGFILTER ))
|
||||
{
|
||||
MSG16 *pmsg = SEGPTR_NEW(MSG16);
|
||||
if (pmsg)
|
||||
{
|
||||
BOOL32 ret;
|
||||
*pmsg = *msg;
|
||||
ret = ((BOOL16)HOOK_CallHooks( WH_SYSMSGFILTER, code, 0,
|
||||
(LPARAM)SEGPTR_GET(pmsg) ) ||
|
||||
(BOOL16)HOOK_CallHooks( WH_MSGFILTER, code, 0,
|
||||
(LPARAM)SEGPTR_GET(pmsg) ));
|
||||
ret = ((BOOL16)HOOK_CallHooks16( WH_SYSMSGFILTER, code, 0,
|
||||
(LPARAM)SEGPTR_GET(pmsg) ) ||
|
||||
(BOOL16)HOOK_CallHooks16( WH_MSGFILTER, code, 0,
|
||||
(LPARAM)SEGPTR_GET(pmsg) ));
|
||||
SEGPTR_FREE(pmsg);
|
||||
if (ret)
|
||||
{
|
||||
|
@ -826,7 +827,7 @@ BOOL GetMessage( SEGPTR msg, HWND hwnd, UINT first, UINT last )
|
|||
|
||||
dprintf_msg(stddeb,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message,
|
||||
hwnd, first, last );
|
||||
HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg );
|
||||
HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg );
|
||||
return (lpmsg->message != WM_QUIT);
|
||||
}
|
||||
|
||||
|
@ -924,30 +925,30 @@ LRESULT SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (HOOK_GetHook( WH_CALLWNDPROC, GetTaskQueue(0) ))
|
||||
if (HOOK_IsHooked( WH_CALLWNDPROC ))
|
||||
{
|
||||
struct msgstruct
|
||||
{
|
||||
LPARAM lParam;
|
||||
WPARAM16 wParam;
|
||||
UINT16 wMsg;
|
||||
HWND16 hWnd;
|
||||
} *pmsg;
|
||||
struct msgstruct
|
||||
{
|
||||
LPARAM lParam;
|
||||
WPARAM16 wParam;
|
||||
UINT16 wMsg;
|
||||
HWND16 hWnd;
|
||||
} *pmsg;
|
||||
|
||||
if ((pmsg = SEGPTR_NEW(struct msgstruct)))
|
||||
{
|
||||
pmsg->hWnd = hwnd;
|
||||
pmsg->wMsg = msg;
|
||||
pmsg->wParam = wParam;
|
||||
pmsg->lParam = lParam;
|
||||
HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 1,
|
||||
(LPARAM)SEGPTR_GET(pmsg) );
|
||||
hwnd = pmsg->hWnd;
|
||||
msg = pmsg->wMsg;
|
||||
wParam = pmsg->wParam;
|
||||
lParam = pmsg->lParam;
|
||||
SEGPTR_FREE( pmsg );
|
||||
}
|
||||
if ((pmsg = SEGPTR_NEW(struct msgstruct)))
|
||||
{
|
||||
pmsg->hWnd = hwnd;
|
||||
pmsg->wMsg = msg;
|
||||
pmsg->wParam = wParam;
|
||||
pmsg->lParam = lParam;
|
||||
HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1,
|
||||
(LPARAM)SEGPTR_GET(pmsg) );
|
||||
hwnd = pmsg->hWnd;
|
||||
msg = pmsg->wMsg;
|
||||
wParam = pmsg->wParam;
|
||||
lParam = pmsg->lParam;
|
||||
SEGPTR_FREE( pmsg );
|
||||
}
|
||||
}
|
||||
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd )))
|
||||
|
@ -1134,7 +1135,7 @@ LONG DispatchMessage( const MSG16* msg )
|
|||
{
|
||||
if (msg->lParam)
|
||||
{
|
||||
/* HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
|
||||
/* HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
|
||||
return CallWindowProc16( (WNDPROC16)msg->lParam, msg->hwnd,
|
||||
msg->message, msg->wParam, GetTickCount() );
|
||||
}
|
||||
|
@ -1145,7 +1146,7 @@ LONG DispatchMessage( const MSG16* msg )
|
|||
if (!wndPtr->winproc) return 0;
|
||||
painting = (msg->message == WM_PAINT);
|
||||
if (painting) wndPtr->flags |= WIN_NEEDS_BEGINPAINT;
|
||||
/* HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
|
||||
/* HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
|
||||
|
||||
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, msg->hwnd, msg->message,
|
||||
msg->wParam, msg->lParam );
|
||||
|
|
|
@ -1149,14 +1149,14 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam, POINT16 pt )
|
|||
if (rootWindow == DefaultRootWindow(display)) XUngrabServer( display );
|
||||
}
|
||||
|
||||
if (HOOK_GetHook( WH_CBT, GetTaskQueue(0) ))
|
||||
if (HOOK_IsHooked( WH_CBT ))
|
||||
{
|
||||
RECT16* pr = SEGPTR_NEW(RECT16);
|
||||
if( pr )
|
||||
{
|
||||
*pr = sizingRect;
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_MOVESIZE, hwnd,
|
||||
(LPARAM)SEGPTR_GET(pr)) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_MOVESIZE, hwnd,
|
||||
(LPARAM)SEGPTR_GET(pr)) )
|
||||
sizingRect = wndPtr->rectWindow;
|
||||
else
|
||||
sizingRect = *pr;
|
||||
|
|
|
@ -579,36 +579,20 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
|
|||
|
||||
hwndLinkAfter = (cs->style & WS_CHILD) ? HWND_BOTTOM : HWND_TOP;
|
||||
|
||||
if (HOOK_GetHook( WH_CBT, GetTaskQueue(0) ))
|
||||
if (HOOK_IsHooked( WH_CBT ))
|
||||
{
|
||||
CBT_CREATEWND16* cbtc;
|
||||
CBT_CREATEWND32A cbtc;
|
||||
|
||||
if ((cbtc = SEGPTR_NEW(CBT_CREATEWND16)))
|
||||
{
|
||||
/* Dummy message params to use WINPROC_MapMsg functions */
|
||||
UINT16 msg;
|
||||
WPARAM16 wparam;
|
||||
LPARAM lparam;
|
||||
|
||||
/* Map the CREATESTRUCT to 16-bit format */
|
||||
lparam = (LPARAM)cs;
|
||||
if (unicode)
|
||||
WINPROC_MapMsg32WTo16( WM_CREATE, 0, &msg, &wparam, &lparam );
|
||||
else
|
||||
WINPROC_MapMsg32ATo16( WM_CREATE, 0, &msg, &wparam, &lparam );
|
||||
cbtc->lpcs = (CREATESTRUCT16 *)lparam;
|
||||
cbtc->hwndInsertAfter = hwndLinkAfter;
|
||||
wmcreate = !HOOK_CallHooks( WH_CBT, HCBT_CREATEWND, hwnd,
|
||||
(LPARAM)SEGPTR_GET(cbtc) );
|
||||
WINPROC_UnmapMsg32ATo16( WM_CREATE, 0, lparam );
|
||||
SEGPTR_FREE(cbtc);
|
||||
if (!wmcreate)
|
||||
{
|
||||
dprintf_win(stddeb,"CreateWindowEx: CBT-hook returned 0\n" );
|
||||
USER_HEAP_FREE( hwnd );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
cbtc.lpcs = cs;
|
||||
cbtc.hwndInsertAfter = hwndLinkAfter;
|
||||
wmcreate = !HOOK_CallHooks32A( WH_CBT, HCBT_CREATEWND, hwnd,
|
||||
(LPARAM)&cbtc );
|
||||
if (!wmcreate)
|
||||
{
|
||||
dprintf_win(stddeb, "CreateWindowEx: CBT-hook returned 0\n");
|
||||
USER_HEAP_FREE( hwnd );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the window procedure */
|
||||
|
@ -817,7 +801,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
|
|||
/* Call WH_SHELL hook */
|
||||
|
||||
if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
|
||||
HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
|
||||
HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
|
||||
|
||||
dprintf_win(stddeb, "CreateWindowEx: returning %04x\n", hwnd);
|
||||
return hwnd;
|
||||
|
@ -1019,12 +1003,12 @@ BOOL DestroyWindow( HWND hwnd )
|
|||
|
||||
/* Call hooks */
|
||||
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_DESTROYWND, hwnd, 0L) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_DESTROYWND, hwnd, 0L) )
|
||||
return FALSE;
|
||||
|
||||
if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
|
||||
{
|
||||
HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWDESTROYED, hwnd, 0L );
|
||||
HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWDESTROYED, hwnd, 0L );
|
||||
/* FIXME: clean up palette - see "Internals" p.352 */
|
||||
}
|
||||
|
||||
|
@ -1406,6 +1390,7 @@ WORD SetWindowWord( HWND32 hwnd, INT32 offset, WORD newval )
|
|||
{
|
||||
case GWW_ID: ptr = (WORD *)&wndPtr->wIDmenu; break;
|
||||
case GWW_HINSTANCE: ptr = (WORD *)&wndPtr->hInstance; break;
|
||||
case GWW_HWNDPARENT: return SetParent( hwnd, newval );
|
||||
default:
|
||||
fprintf( stderr, "SetWindowWord: invalid offset %d\n", offset );
|
||||
return 0;
|
||||
|
|
|
@ -595,7 +595,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
|
|||
swpflags |= SWP_FRAMECHANGED;
|
||||
if (!(wndPtr->dwStyle & WS_MINIMIZE))
|
||||
{
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
return 0;
|
||||
|
||||
if (wndPtr->dwStyle & WS_MAXIMIZE)
|
||||
|
@ -623,7 +623,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
|
|||
swpflags |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
|
||||
if (!(wndPtr->dwStyle & WS_MAXIMIZE))
|
||||
{
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
return 0;
|
||||
|
||||
/* Store the current position and find the maximized size */
|
||||
|
@ -669,7 +669,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
|
|||
|
||||
if (wndPtr->dwStyle & WS_MINIMIZE)
|
||||
{
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
return 0;
|
||||
|
||||
if( !SendMessage16( hwnd, WM_QUERYOPEN, 0, 0L) )
|
||||
|
@ -702,7 +702,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
|
|||
}
|
||||
else if (wndPtr->dwStyle & WS_MAXIMIZE)
|
||||
{
|
||||
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
|
||||
return 0;
|
||||
|
||||
wndPtr->ptMaxPos.x = wndPtr->rectWindow.left;
|
||||
|
@ -962,8 +962,8 @@ BOOL32 WINPOS_SetActiveWindow( HWND32 hWnd, BOOL32 fMouse, BOOL32 fChangeFocus)
|
|||
LRESULT wRet;
|
||||
cbtStruct->fMouse = fMouse;
|
||||
cbtStruct->hWndActive = hwndActive;
|
||||
wRet = HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM16)hWnd,
|
||||
(LPARAM)SEGPTR_GET(cbtStruct) );
|
||||
wRet = HOOK_CallHooks16( WH_CBT, HCBT_ACTIVATE, (WPARAM16)hWnd,
|
||||
(LPARAM)SEGPTR_GET(cbtStruct) );
|
||||
SEGPTR_FREE(cbtStruct);
|
||||
if (wRet) return wRet;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue