Commit da0cfb36 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 961201

Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [configure] Re-generated with autoconf 2.11. Let me know if you have problems. * [controls/listbox.c] [controls/oldlbox.c] Listboxes rewritten from scratch. Moved old code still used by comboboxes to oldlbox.c * [misc/registry.c] Use temporary file when saving registry. * [windows/dialog.c] Implemented Win32 version of DlgDirList() and DlgDirListComboBox(). * [windows/winproc.c] Added translation for listbox Win32 messages. Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [controls/widgets.c] [controls/button.c] Fixed some incompatibilities with CTL3D DLL. * [windows/dialog.c] Made dialog windows fit into the desktop. * [misc/winsock.c] [misc/winsock_async.c] New Winsock engine. * [windows/message.c] GetMessage() fixes. * [windows/queue.c] [windows/hook.c] [windows/win.c] SetMessageQueue() fixes. Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de> * [objects/text.c] DrawText16(): Fixed return value. Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/profile.c] [*/*] Added Win32 profile functions, updated to new naming standard. * [objects/font.c] [if1632/thunk.c] [include/windows.h] Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and structures. * [misc/ole2nls.c] [if1632/thunk.c] Added EnumSystemLocales() (winhelp.exe). * [misc/registry.c] Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no * [win32/file.c] Partially fixed CreateFileMapping(), added UnmapViewOfFile(). Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie> * [misc/shell.c] Fixed some FIXMEs relating to ShellExec() and FindExecutable(). * [misc/main.c] Implemented a few more of the SystemParametersInfo() cases. Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be> * [include/keyboard.h] New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c). * [include/windows.h] New [VK_A, VK_Z] and [VK_0, VK9] macros. * [misc/keyboard.c] Fixes in KeyTable and ToAscii. * [objects/font.c] FONT_init : Give default value for MSWIN "system" font. FONT_MatchFont : Do not try every size of a font family if the family does not exist. * [windows/event.c] lastEventChar hack removed. KeyStateTable replaced by InputKeyStateTable (maintained in event.c) and QueueKeyStateTable (maintained in message.c). EVENT_key : Corrections to the extended bit setting. * [windows/message.c] [windows/keyboard.c] Implementation of a new QueueKeyStateTable : table of key states valid when messages are retrieved by GetMessage or PeekMessage, and valid for TranslateMessage. TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable and ToAscii. Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net> * [graphics/Makefile.in] [graphics/wing.c] [if1632/wing.spec] Some functions for WinG support, mostly empty stubs. * [misc/crtdll.c] [if1632/crtdll.spec] Many functions added to CRTDLL, mostly calls to Unix C library.
parent 75d86e1f
This is release 961117 of Wine, the MS Windows emulator. This is still a
This is release 961201 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-961117: (see ChangeLog for details)
- More Win32 functions.
- OffiX-style drag and drop.
WHAT'S NEW with Wine-961201: (see ChangeLog for details)
- Better Winsock.
- Rewritten listboxes.
- Windows 3.1 registry loader.
- Improved keyboard support.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -16,10 +18,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-961117.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-961117.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-961117.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-961117.tar.gz
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
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
----------------------------------------------------------------------
Sun Nov 17 15:01:45 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [graphics/bitblt.c] [graphics/x11drv/bitblt.c]
......
......@@ -59,7 +59,7 @@ OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
echo "#include \"windows.h\"" >winerctmp.c
echo WINDOWS_H_ENDS_HERE >>winerctmp.c
cat $< >>winerctmp.c
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) -c -o $* -p $*
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P winerctmp.c | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | $(WINERC) $(RCFLAGS) -c -o $* -p $*
$(RM) winerctmp.c
......
......@@ -7,8 +7,6 @@ AC_CONFIG_HEADER(include/config.h)
AC_CONFIG_AUX_DIR(tools)
# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS="-g -O2" AC_SUBST(CFLAGS)
test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
test -z "$LDLIBS" && LDLIBS=-lm AC_SUBST(LDLIBS)
dnl **** Command-line arguments ****
......
......@@ -12,6 +12,7 @@ C_SRCS = \
edit.c \
listbox.c \
menu.c \
oldlbox.c \
scroll.c \
static.c \
status.c \
......
......@@ -187,7 +187,8 @@ LRESULT ButtonWndProc(HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_KILLFOCUS:
infoPtr->state &= ~BUTTON_HASFOCUS;
PAINT_BUTTON( wndPtr, style, ODA_FOCUS );
PAINT_BUTTON( wndPtr, style, ODA_FOCUS );
InvalidateRect16( hWnd, NULL, TRUE );
break;
case WM_SYSCOLORCHANGE:
......@@ -369,57 +370,70 @@ void PB_PaintGrayOnGray(HDC32 hDC,HFONT32 hFont,RECT32 *rc,char *text)
static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
{
RECT16 rc;
RECT16 rbox, rtext, client;
HBRUSH16 hBrush;
int textlen, delta, x, y;
TEXTMETRIC16 tm;
int textlen, delta;
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
GetClientRect16(wndPtr->hwndSelf, &rc);
textlen = 0;
GetClientRect16(wndPtr->hwndSelf, &client);
rbox = rtext = client;
if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
if (action == ODA_DRAWENTIRE) FillRect16( hDC, &rc, hBrush );
if (wndPtr->dwStyle & BS_LEFTTEXT)
{
/* magic +4 is what CTL3D expects */
GetTextMetrics16(hDC, &tm);
delta = (rc.bottom - rc.top - tm.tmHeight) >> 1;
rtext.right -= checkBoxWidth + 4;
rbox.left = rbox.right - checkBoxWidth;
}
else
{
rtext.left += checkBoxWidth + 4;
rbox.right = checkBoxWidth;
}
/* Draw the check-box bitmap */
x = y = 0;
if (infoPtr->state & BUTTON_HIGHLIGHTED) x += 2 * checkBoxWidth;
if (infoPtr->state & (BUTTON_CHECKED | BUTTON_3STATE)) x += checkBoxWidth;
if (((wndPtr->dwStyle & 0x0f) == BS_RADIOBUTTON) ||
((wndPtr->dwStyle & 0x0f) == BS_AUTORADIOBUTTON)) y += checkBoxHeight;
else if (infoPtr->state & BUTTON_3STATE) y += 2 * checkBoxHeight;
GRAPH_DrawBitmap( hDC, hbitmapCheckBoxes, rc.left, rc.top + delta,
x, y, checkBoxWidth, checkBoxHeight );
rc.left += checkBoxWidth + tm.tmAveCharWidth / 2;
if (!wndPtr->text) return;
textlen = strlen( wndPtr->text );
if (wndPtr->text) textlen = strlen( wndPtr->text );
if (action == ODA_DRAWENTIRE || action == ODA_SELECT)
{
int x = 0, y = 0;
delta = (rbox.bottom - rbox.top - checkBoxHeight) >> 1;
if (action == ODA_DRAWENTIRE)
{
if (wndPtr->dwStyle & WS_DISABLED)
SetTextColor( hDC, GetSysColor(COLOR_GRAYTEXT) );
DrawText16( hDC, wndPtr->text, textlen, &rc,
DT_SINGLELINE | DT_VCENTER | DT_NOCLIP );
if (action == ODA_SELECT) FillRect16( hDC, &rbox, hBrush );
else FillRect16( hDC, &client, hBrush );
if (infoPtr->state & BUTTON_HIGHLIGHTED) x += 2 * checkBoxWidth;
if (infoPtr->state & (BUTTON_CHECKED | BUTTON_3STATE)) x += checkBoxWidth;
if (((wndPtr->dwStyle & 0x0f) == BS_RADIOBUTTON) ||
((wndPtr->dwStyle & 0x0f) == BS_AUTORADIOBUTTON)) y += checkBoxHeight;
else if (infoPtr->state & BUTTON_3STATE) y += 2 * checkBoxHeight;
GRAPH_DrawBitmap( hDC, hbitmapCheckBoxes, rbox.left, rbox.top + delta,
x, y, checkBoxWidth, checkBoxHeight );
if( textlen && action != ODA_SELECT )
{
if (wndPtr->dwStyle & WS_DISABLED)
SetTextColor( hDC, GetSysColor(COLOR_GRAYTEXT) );
DrawText16( hDC, wndPtr->text, textlen, &rtext,
DT_SINGLELINE | DT_VCENTER );
}
}
if ((action == ODA_FOCUS) ||
((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS)))
{
RECT16 rect = { 0, 0, 0, 0 };
DrawText16( hDC, wndPtr->text, textlen, &rect,
DT_SINGLELINE | DT_CALCRECT );
if (delta > 1)
{
rc.top += delta - 1;
rc.bottom -= delta + 1;
}
rc.left--;
rc.right = rc.left + rect.right + 2;
DrawFocusRect16( hDC, &rc );
/* 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;
IntersectRect16(&rbox, &rbox, &rtext);
DrawFocusRect16( hDC, &rbox );
}
}
......
......@@ -1233,68 +1233,3 @@ LRESULT ComboLBoxWndProc(HWND hwnd, UINT message, WPARAM16 wParam, LPARAM lParam
}
return DefWindowProc16(hwnd, message, wParam, lParam);
}
static INT32 COMBO_DlgDirList( HWND32 hDlg, LPARAM path, INT32 idCBox,
INT32 idStatic, UINT32 wType, BOOL32 unicode )
{
LRESULT res = 0;
if (idCBox)
{
SendDlgItemMessage32A( hDlg, idCBox, CB_RESETCONTENT16, 0, 0 );
if (unicode)
res = SendDlgItemMessage32W( hDlg, idCBox, CB_DIR16, wType, path );
else
res = SendDlgItemMessage32A( hDlg, idCBox, CB_DIR16, wType, path );
}
if (idStatic)
{
char temp[512] = "A:\\";
int drive = DRIVE_GetCurrentDrive();
temp[0] += drive;
lstrcpyn32A( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
AnsiLower( temp );
SetDlgItemText32A( hDlg, idStatic, temp );
}
return (res >= 0);
}
/***********************************************************************
* DlgDirListComboBox16 (USER.195)
*/
INT16 DlgDirListComboBox16( HWND16 hDlg, SEGPTR path, INT16 idCBox,
INT16 idStatic, UINT16 wType )
{
dprintf_combo( stddeb,"DlgDirListComboBox16(%04x,%08x,%d,%d,%04x)\n",
hDlg, (UINT32)path, idCBox, idStatic, wType );
return COMBO_DlgDirList( hDlg, (LPARAM)path, idCBox,
idStatic, wType, FALSE );
}
/***********************************************************************
* DlgDirListComboBox32A (USER32.143)
*/
INT32 DlgDirListComboBox32A( HWND32 hDlg, LPCSTR path, INT32 idCBox,
INT32 idStatic, UINT32 wType )
{
dprintf_combo( stddeb,"DlgDirListComboBox32A(%08x,'%s',%d,%d,%08X)\n",
hDlg, path, idCBox, idStatic, wType );
return COMBO_DlgDirList( hDlg, (LPARAM)path, idCBox,
idStatic, wType, FALSE );
}
/***********************************************************************
* DlgDirListComboBox32W (USER32.144)
*/
INT32 DlgDirListComboBox32W( HWND32 hDlg, LPCWSTR path, INT32 idCBox,
INT32 idStatic, UINT32 wType )
{
dprintf_combo( stddeb,"DlgDirListComboBox32W(%08x,%p,%d,%d,%08X)\n",
hDlg, path, idCBox, idStatic, wType );
return COMBO_DlgDirList( hDlg, (LPARAM)path, idCBox,
idStatic, wType, TRUE );
}
......@@ -173,7 +173,7 @@ LRESULT DesktopWndProc( HWND32 hwnd, UINT32 message,
BOOL16 SetDeskPattern(void)
{
char buffer[100];
GetProfileString( "desktop", "Pattern", "(None)", buffer, 100 );
GetProfileString32A( "desktop", "Pattern", "(None)", buffer, 100 );
return DESKTOP_SetPattern( buffer );
}
......@@ -202,7 +202,7 @@ BOOL32 SetDeskWallPaper32( LPCSTR filename )
if (filename == (LPSTR)-1)
{
GetProfileString( "desktop", "WallPaper", "(None)", buffer, 256 );
GetProfileString32A( "desktop", "WallPaper", "(None)", buffer, 256 );
filename = buffer;
}
hdc = GetDC32( 0 );
......@@ -210,7 +210,7 @@ BOOL32 SetDeskWallPaper32( LPCSTR filename )
ReleaseDC32( 0, hdc );
if (infoPtr->hbitmapWallPaper) DeleteObject32( infoPtr->hbitmapWallPaper );
infoPtr->hbitmapWallPaper = hbitmap;
infoPtr->fTileWallPaper = GetProfileInt( "desktop", "TileWallPaper", 0 );
infoPtr->fTileWallPaper = GetProfileInt32A( "desktop", "TileWallPaper", 0 );
if (hbitmap)
{
BITMAP32 bmp;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -84,8 +84,8 @@ static BOOL fEndMenuCalled = FALSE;
#define NO_SELECTED_ITEM 0xffff
#define SYSMENU_SELECTED 0xfffe /* Only valid on menu-bars */
#define IS_STRING_ITEM(flags) (!((flags) & (MF_BITMAP | MF_OWNERDRAW | \
MF_MENUBARBREAK | MF_MENUBREAK | MF_SEPARATOR)))
#define IS_STRING_ITEM(flags) \
(!((flags) & (MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR)))
extern void NC_DrawSysButton(HWND hwnd, HDC32 hdc, BOOL down); /*nonclient.c*/
extern BOOL NC_GetSysPopupPos(WND* wndPtr, RECT16* rect);
......@@ -1923,8 +1923,9 @@ BOOL32 TrackPopupMenu32( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
INT32 nReserved, HWND32 hWnd, const RECT32 *lpRect )
{
RECT16 r;
CONV_RECT32TO16( lpRect, &r );
return TrackPopupMenu16( hMenu, wFlags, x, y, nReserved, hWnd, &r );
if (lpRect)
CONV_RECT32TO16( lpRect, &r );
return TrackPopupMenu16(hMenu,wFlags,x,y,nReserved,hWnd,lpRect?&r:NULL);
}
......
......@@ -54,7 +54,7 @@ static HBITMAP32 hRgArrowI = 0;
#define SCROLL_FIRST_DELAY 200
/* Delay (in ms) between scroll repetitions */
#define SCROLL_REPEAT_DELAY 100
#define SCROLL_REPEAT_DELAY 50
/* Scroll timer id */
#define SCROLL_TIMER 0
......
......@@ -16,7 +16,12 @@
#include "module.h"
#include "heap.h"
#define OLD_LISTBOX
/* Window procedures */
extern LRESULT ListBoxWndProc( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
/* Win16 class info */
typedef struct
{
......@@ -27,42 +32,39 @@ typedef struct
LPCSTR className;
} BUILTIN_CLASS_INFO16;
/* Win16 built-in classes */
static const BUILTIN_CLASS_INFO16 WIDGETS_BuiltinClasses16[] =
{
{ CS_GLOBALCLASS | CS_PARENTDC,
sizeof(STATICINFO), 0, "StaticWndProc", "STATIC" },
#ifdef OLD_LISTBOX
sizeof(STATICINFO), 0, "StaticWndProc", "Static" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
8, 0, "ListBoxWndProc", "LISTBOX" },
#endif
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
8, 0, "ComboBoxWndProc", "COMBOBOX" },
8, 0, "ComboBoxWndProc", "ComboBox" },
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
8, 0, "ComboLBoxWndProc", "COMBOLBOX" },
8, 0, "ComboLBoxWndProc", "ComboLBox" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
sizeof(DWORD), 0, "EditWndProc", "EDIT" },
sizeof(DWORD), 0, "EditWndProc", "Edit" },
{ CS_GLOBALCLASS | CS_SAVEBITS,
sizeof(HMENU32), 0, "PopupMenuWndProc", POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS | CS_SAVEBITS,
DLGWINDOWEXTRA, 0, "DefDlgProc", DIALOG_CLASS_NAME },
{ CS_GLOBALCLASS, sizeof(MDICLIENTINFO),
STOCK_LTGRAY_BRUSH, "MDIClientWndProc", "MDICLIENT" }
STOCK_LTGRAY_BRUSH, "MDIClientWndProc", "MDIClient" }
};
#define NB_BUILTIN_CLASSES16 \
(sizeof(WIDGETS_BuiltinClasses16)/sizeof(WIDGETS_BuiltinClasses16[0]))
/* Win32 built-in classes */
static WNDCLASS32A WIDGETS_BuiltinClasses32[] =
{
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, 0, 0, 0, "BUTTON" },
#ifndef OLD_LISTBOX
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, 0, 0, 0, "Button" },
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
ListBoxWndProc32, 0, sizeof(void *), 0, 0, 0, 0, 0, "LISTBOX" },
#endif
ListBoxWndProc, 0, sizeof(void *), 0, 0, 0, 0, 0, "ListBox" },
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, 0, 0, 0, "SCROLLBAR"},
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, 0, 0, 0, "ScrollBar"},
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, 0, DESKTOP_CLASS_NAME }
};
......@@ -71,6 +73,8 @@ static WNDCLASS32A WIDGETS_BuiltinClasses32[] =
(sizeof(WIDGETS_BuiltinClasses32)/sizeof(WIDGETS_BuiltinClasses32[0]))
/* Win32 common controls */
static WNDCLASS32A WIDGETS_CommonControls32[] =
{
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, StatusWindowProc, 0,
......
......@@ -6,6 +6,7 @@ VPATH = @srcdir@
MODULE = graphics
C_SRCS = \
wing.c \
bitblt.c \
driver.c
......
/*
* WingG support
*
* Started by Robert Pouliot <krynos@clic.net>
*/
#include "gdi.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)
*/
HDC16 WinGCreateDC16(void)
{
/* FIXME: Probably wrong... */
return CreateDC("DISPLAY", NULL, NULL, NULL);
}
/***********************************************************************
* WinGRecommendDIBFormat16 (WING.1002)
*/
BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt)
{
fprintf(stdnimp,"WinGRecommendDIBFormat: empty stub!\n");
return 0;
}
/***********************************************************************
* WinGCreateBitmap16 (WING.1003)
*/
HBITMAP16 WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, void **bits)
{
fprintf(stdnimp,"WinGCreateBitmap: empty stub! (expect failure)\n");
*bits=0;
return 0;
}
/***********************************************************************
* WinGCreateHalfTonePalette16 (WING.1007)
*/
HPALETTE16 WinGCreateHalfTonePalette16(void)
{
fprintf(stdnimp,"WinGCreateHalfTonePalette: empty stub!\n");
return 0;
}
/***********************************************************************
* WinGCreateHalfToneBrush16 (WING.1008)
*/
HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, WING_DITHER_TYPE type)
{
fprintf(stdnimp,"WinGCreateHalfToneBrush: empty stub!\n");
return 0;
}
......@@ -343,7 +343,7 @@ base 1
338 stub abort
339 cdecl abs(long) CRTDLL_abs
340 cdecl acos(long) CRTDLL_acos
341 stub asctime
341 cdecl asctime(ptr) asctime
342 cdecl asin(long) CRTDLL_asin
343 cdecl atan(long) CRTDLL_atan
344 cdecl atan2(long long) CRTDLL_atan2
......@@ -352,15 +352,15 @@ base 1
347 cdecl atoi(ptr) CRTDLL_atoi
348 cdecl atol(ptr) CRTDLL_atol
349 stub bsearch
350 stub calloc
350 cdecl calloc(long long) CRTDLL_calloc
351 stub ceil
352 stub clearerr
353 stub clock
353 cdecl clock() clock
354 cdecl cos(long) CRTDLL_cos
355 cdecl cosh(long) CRTDLL_cosh
356 stub ctime
356 cdecl ctime(ptr) ctime
357 stub difftime
358 stub div
358 cdecl div(long long) div
359 cdecl exit(long) CRTDLL_exit
360 cdecl exp(long) CRTDLL_exp
361 cdecl fabs(long) CRTDLL_fabs
......@@ -394,7 +394,7 @@ base 1
389 stub getchar
390 stub getenv
391 cdecl gets(ptr) CRTDLL_gets
392 stub gmtime
392 cdecl gmtime(ptr) gmtime
393 stub is_wctype
394 cdecl isalnum(long) CRTDLL_isalnum
395 cdecl isalpha(long) CRTDLL_isalpha
......@@ -423,9 +423,9 @@ base 1
418 cdecl isxdigit(long) CRTDLL_isxdigit
419 cdecl labs(long) CRTDLL_labs
420 stub ldexp
421 stub ldiv
421 cdecl ldiv(long long) ldiv
422 stub localeconv
423 stub localtime
423 cdecl localtime(ptr) localtime
424 cdecl log(long) CRTDLL_log
425 cdecl log10(long) CRTDLL_log10
426 stub longjmp
......@@ -438,7 +438,7 @@ base 1
433 cdecl memcpy(ptr ptr long) memcpy
434 cdecl memmove(ptr ptr long) memmove
435 cdecl memset(ptr long long) memset
436 stub mktime
436 cdecl mktime(ptr) mktime
437 stub modf
438 stub perror
439 cdecl pow(long long) CRTDLL_pow
......@@ -449,7 +449,7 @@ base 1
444 stub qsort
445 stub raise
446 cdecl rand() CRTDLL_rand
447 stub realloc
447 cdecl realloc(ptr long) CRTDLL_realloc
448 stub remove
449 stub rename
450 stub rewind
......@@ -464,27 +464,27 @@ base 1
459 cdecl sqrt(long) CRTDLL_sqrt
460 cdecl srand(long) CRTDLL_srand
461 stub sscanf
462 cdecl strcat(ptr ptr) lstrcat32A
462 cdecl strcat(ptr ptr) strcat
463 cdecl strchr(ptr long) strchr
464 cdecl strcmp(ptr ptr) lstrcmp32A
465 stub strcoll
466 cdecl strcpy(ptr ptr) lstrcpy32A
464 cdecl strcmp(ptr ptr) strcmp
465 cdecl strcoll(ptr ptr) strcoll
466 cdecl strcpy(ptr ptr) strcpy
467 cdecl strcspn(ptr ptr) strcspn
468 stub strerror
469 stub strftime
470 cdecl strlen(ptr) lstrlen32A
471 cdecl strncat(ptr ptr long) lstrcatn32A
472 cdecl strncmp(ptr ptr long) lstrncmp32A
473 cdecl strncpy(ptr ptr long) lstrcpyn32A
474 stub strpbrk
475 stub strrchr
469 cdecl strftime(ptr long ptr ptr) strftime
470 cdecl strlen(ptr) strlen
471 cdecl strncat(ptr ptr long) strncat
472 cdecl strncmp(ptr ptr long) strncmp
473 cdecl strncpy(ptr ptr long) strncpy
474 cdecl strpbrk(ptr ptr) strpbrk
475 cdecl strrchr(ptr long) strrchr
476 cdecl strspn(ptr ptr) strspn
477 cdecl strstr(ptr ptr) strstr
478 stub strtod
479 cdecl strtok(ptr ptr) strtok
480 cdecl strtol(ptr ptr long) strtol
481 cdecl strtoul(ptr ptr long) strtoul
482 stub strxfrm
482 cdecl strxfrm(ptr ptr long) strxfrm
483 stub swprintf
484 stub swscanf
485 stub system
......
......@@ -149,7 +149,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
169 stub IsDCDirty
170 stub SetDCStatus
172 pascal16 SetRectRgn(word s_word s_word s_word s_word) SetRectRgn
173 pascal16 GetClipRgn(word) GetClipRgn
173 pascal16 GetClipRgn(word) GetClipRgn16
175 pascal16 EnumMetaFile(word word segptr long) THUNK_EnumMetaFile16
176 pascal16 PlayMetaFileRecord(word ptr ptr word) PlayMetaFileRecord
179 pascal16 GetDCState(word) GetDCState
......@@ -382,7 +382,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
610 stub GDISignalProc32
611 stub GetRandomRgn
612 stub GetTextCharSet
613 stub EnumFontFamiliesEx
613 pascal16 EnumFontFamiliesEx(word ptr segptr long long) THUNK_EnumFontFamiliesEx16
614 stub AddLpkToGDI
615 stub GetCharacterPlacement
616 stub GetFontLanguageInfo
......
......@@ -86,11 +86,11 @@ base 1
0078 stub EndPath
0079 stub EnumEnhMetaFile
0080 stdcall EnumFontFamiliesA(long ptr ptr long) THUNK_EnumFontFamilies32A
0081 stub EnumFontFamiliesExA
0082 stub EnumFontFamiliesExW
0081 stdcall EnumFontFamiliesExA(long ptr ptr long long) THUNK_EnumFontFamiliesEx32A
0082 stdcall EnumFontFamiliesExW(long ptr ptr long long) THUNK_EnumFontFamiliesEx32W
0083 stdcall EnumFontFamiliesW(long ptr ptr long) THUNK_EnumFontFamilies32W
0084 stub EnumFontsA
0085 stub EnumFontsW
0084 stdcall EnumFontsA(long ptr ptr long) THUNK_EnumFonts32A
0085 stdcall EnumFontsW(long ptr ptr long) THUNK_EnumFonts32W
0086 stub EnumICMProfilesA
0087 stub EnumICMProfilesW
0088 stub EnumMetaFile
......@@ -153,7 +153,7 @@ base 1
0145 stdcall GetBkColor(long) GetBkColor
0146 stub GetBkMode
0147 stub GetBoundsRect
0148 stub GetBrushOrgEx
0148 stdcall GetBrushOrgEx(long ptr) GetBrushOrgEx32
0149 stub GetCharABCWidthsA
0150 stub GetCharABCWidthsFloatA
0151 stub GetCharABCWidthsFloatW
......@@ -168,12 +168,12 @@ base 1
0160 stub GetCharacterPlacementA
0161 stub GetCharacterPlacementW
0162 stdcall GetClipBox(long ptr) GetClipBox32
0163 stub GetClipRgn
0163 stdcall GetClipRgn(long long) GetClipRgn32
0164 stub GetColorAdjustment
0165 stub GetColorSpace
0166 stub GetCurrentObject
0167 stub GetCurrentPositionEx
0168 stub GetDCOrgEx
0167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
0168 stdcall GetDCOrgEx(long ptr) GetDCOrgEx
0169 stub GetDIBColorTable
0170 stub GetDIBits
0171 stdcall GetDeviceCaps(long long) GetDeviceCaps
......@@ -239,16 +239,16 @@ base 1
0231 stub GetTextExtentPoint32W
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32A
0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32W
0234 stub GetTextFaceA
0234 stdcall GetTextFaceA(long long ptr) GetTextFace
0235 stub GetTextFaceW
0236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A
0237 stdcall GetTextMetricsW(long ptr) GetTextMetrics32W
0238 stub GetTransform
0239 stub GetViewportExtEx
0240 stub GetViewportOrgEx
0239 stdcall GetViewportExtEx(long ptr) GetViewportExtEx32
0240 stdcall GetViewportOrgEx(long ptr) GetViewportOrgEx32
0241 stub GetWinMetaFileBits
0242 stub GetWindowExtEx
0243 stub GetWindowOrgEx
0242 stdcall GetWindowExtEx(long ptr) GetWindowExtEx32
0243 stdcall GetWindowOrgEx(long ptr) GetWindowOrgEx32
0244 stub GetWorldTransform
0245 stdcall IntersectClipRect(long long long long long) IntersectClipRect32
0246 stdcall InvertRgn(long long) InvertRgn32
......@@ -328,7 +328,7 @@ base 1
0319 stub SetICMProfileA
0320 stub SetICMProfileW
0321 stdcall SetMapMode(long long) SetMapMode
0322 stub SetMapperFlags
0322 stdcall SetMapperFlags(long long) SetMapperFlags
0323 stub SetMetaFileBitsEx
0324 stub SetMetaRgn
0325 stub SetMiterLimit
......
......@@ -53,9 +53,9 @@ type win16
54 pascal16 GetInstanceData(word word word) GetInstanceData
55 pascal16 Catch(ptr) Catch
56 pascal16 Throw(ptr word) Throw
57 pascal16 GetProfileInt(ptr ptr s_word) GetProfileInt
58 pascal16 GetProfileString(ptr ptr ptr ptr word) GetProfileString
59 pascal16 WriteProfileString(ptr ptr ptr) WriteProfileString
57 pascal16 GetProfileInt(ptr ptr s_word) GetProfileInt16
58 pascal16 GetProfileString(ptr ptr ptr ptr word) GetProfileString16
59 pascal16 WriteProfileString(ptr ptr ptr) WriteProfileString16
60 pascal16 FindResource(word segptr segptr) FindResource16
61 pascal16 LoadResource(word word) LoadResource16
62 pascal LockResource(word) WIN16_LockResource16
......@@ -123,11 +123,11 @@ type win16
124 return EnableKernel 0 0
125 return DisableKernel 0 0
126 stub MemoryFreed
127 pascal16 GetPrivateProfileInt(ptr ptr s_word ptr) GetPrivateProfileInt
127 pascal16 GetPrivateProfileInt(ptr ptr s_word ptr) GetPrivateProfileInt16
128 pascal16 GetPrivateProfileString(ptr ptr ptr ptr word ptr)
GetPrivateProfileString
GetPrivateProfileString16
129 pascal16 WritePrivateProfileString(ptr ptr ptr ptr)
WritePrivateProfileString
WritePrivateProfileString16
130 pascal FileCDR(ptr) FileCDR
131 pascal GetDOSEnvironment() GetDOSEnvironment
132 pascal GetWinFlags() GetWinFlags
......
......@@ -96,8 +96,8 @@ base 1
0091 stub EnumResourceTypesW
0092 stdcall EnumSystemCodePagesA(ptr long) THUNK_EnumSystemCodePages32A
0093 stdcall EnumSystemCodePagesW(ptr long) THUNK_EnumSystemCodePages32W
0094 stub EnumSystemLocalesA
0095 stub EnumSystemLocalesW
0094 stdcall EnumSystemLocalesA(ptr long) THUNK_EnumSystemLocales32A
0095 stdcall EnumSystemLocalesW(ptr long) THUNK_EnumSystemLocales32W
0096 stub EnumTimeFormatsA
0097 stub EnumTimeFormatsW
0098 stub EraseTape
......@@ -253,12 +253,12 @@ base 1
0248 stdcall GetOEMCP() GetOEMCP
0249 stub GetOverlappedResult
0250 stub GetPriorityClass
0251 stdcall GetPrivateProfileIntA(ptr ptr long ptr) GetPrivateProfileInt
0252 stub GetPrivateProfileIntW
0251 stdcall GetPrivateProfileIntA(ptr ptr long ptr) GetPrivateProfileInt32A
0252 stdcall GetPrivateProfileIntW(ptr ptr long ptr) GetPrivateProfileInt32W
0253 stub GetPrivateProfileSectionA
0254 stub GetPrivateProfileSectionW
0255 stdcall GetPrivateProfileStringA(ptr ptr ptr ptr long ptr) GetPrivateProfileString
0256 stub GetPrivateProfileStringW
0255 stdcall GetPrivateProfileStringA(ptr ptr ptr ptr long ptr) GetPrivateProfileString32A
0256 stdcall GetPrivateProfileStringW(ptr ptr ptr ptr long ptr) GetPrivateProfileString32W
0257 stdcall GetProcAddress(long ptr) GetProcAddress32
0258 stdcall GetProcessAffinityMask(long ptr ptr) GetProcessAffinityMask
0259 stdcall GetProcessHeap() GetProcessHeap
......@@ -266,12 +266,12 @@ base 1
0261 stub GetProcessShutdownParameters
0262 stub GetProcessTimes
0263 stub GetProcessWorkingSetSize
0264 stdcall GetProfileIntA(ptr ptr long) GetProfileInt
0265 stub GetProfileIntW
0264 stdcall GetProfileIntA(ptr ptr long) GetProfileInt32A
0265 stdcall GetProfileIntW(ptr ptr long) GetProfileInt32W
0266 stub GetProfileSectionA
0267 stub GetProfileSectionW
0268 stdcall GetProfileStringA(ptr ptr ptr ptr long) GetProfileString
0269 stub GetProfileStringW
0268 stdcall GetProfileStringA(ptr ptr ptr ptr long) GetProfileString32A
0269 stdcall GetProfileStringW(ptr ptr ptr ptr long) GetProfileString32W
0270 stub GetQueuedCompletionStatus
0271 stdcall GetShortPathNameA(ptr ptr long) GetShortPathName32A
0272 stdcall GetShortPathNameW(ptr ptr long) GetShortPathName32W
......@@ -542,7 +542,7 @@ base 1
0537 stdcall UnhandledExceptionFilter(ptr) UnhandledExceptionFilter
0538 stub UnlockFile
0539 stub UnlockFileEx
0540 stub UnmapViewOfFile
0540 stdcall UnmapViewOfFile(ptr) UnmapViewOfFile
0541 stub UpdateResourceA
0542 stub UpdateResourceW
0543 stub VDMConsoleOperation
......@@ -584,13 +584,13 @@ base 1
0579 stub WriteFileEx
0580 stub WritePrivateProfileSectionA
0581 stub WritePrivateProfileSectionW
0582 stdcall WritePrivateProfileStringA(ptr ptr ptr ptr) WritePrivateProfileString
0583 stub WritePrivateProfileStringW
0582 stdcall WritePrivateProfileStringA(ptr ptr ptr ptr) WritePrivateProfileString32A
0583 stdcall WritePrivateProfileStringW(ptr ptr ptr ptr) WritePrivateProfileString32W
0584 stub WriteProcessMemory
0585 stub WriteProfileSectionA
0586 stub WriteProfileSectionW
0587 stdcall WriteProfileStringA(ptr ptr ptr) WriteProfileString
0588 stub WriteProfileStringW
0587 stdcall WriteProfileStringA(ptr ptr ptr) WriteProfileString32A
0588 stdcall WriteProfileStringW(ptr ptr ptr) WriteProfileString32W
0589 stub WriteTapemark
0590 stdcall _hread(long ptr long) _hread
0591 stdcall _hwrite(long ptr long) _hwrite
......
......@@ -117,9 +117,28 @@ INT16 THUNK_EnumFonts16( HDC16 hdc, LPCSTR lpFaceName,
FONTENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_llwl );
return EnumFonts( hdc, lpFaceName, (FONTENUMPROC16)&thunk, lParam );
return EnumFonts16( hdc, lpFaceName, (FONTENUMPROC16)&thunk, lParam );
}
/*************************************************************************
* THUNK_EnumFonts32A (GDI32.84)
*/
INT32 THUNK_EnumFonts32A( HDC32 hdc, LPCSTR lpFaceName,
FONTENUMPROC32A func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFonts32A( hdc, lpFaceName, (FONTENUMPROC32A)&thunk, lParam );
}
/*************************************************************************
* THUNK_EnumFonts32W (GDI32.85)
*/
INT32 THUNK_EnumFonts32W( HDC32 hdc, LPCWSTR lpFaceName,
FONTENUMPROC32W func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFonts32W( hdc, lpFaceName, (FONTENUMPROC32W)&thunk, lParam );
}
/******************************************************************
* THUNK_EnumMetaFile16 (GDI.175)
......@@ -164,6 +183,44 @@ INT32 THUNK_EnumFontFamilies32W( HDC32 hdc, LPCWSTR lpszFamily,
return EnumFontFamilies32W(hdc,lpszFamily,(FONTENUMPROC32W)&thunk,lParam);
}
/*************************************************************************
* THUNK_EnumFontFamiliesEx16 (GDI.613)
*/
INT16 THUNK_EnumFontFamiliesEx16( HDC16 hdc, LPLOGFONT16 lpLF,
FONTENUMPROCEX16 func, LPARAM lParam,
DWORD reserved )
{
DECL_THUNK( thunk, func, CallTo16_word_llwl );
return EnumFontFamiliesEx16( hdc, lpLF, (FONTENUMPROCEX16)&thunk,
lParam, reserved );
}
/*************************************************************************
* THUNK_EnumFontFamiliesEx32A (GDI32.81)
*/
INT32 THUNK_EnumFontFamiliesEx32A( HDC32 hdc, LPLOGFONT32A lpLF,
FONTENUMPROCEX32A func, LPARAM lParam,
DWORD reserved)
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFontFamiliesEx32A( hdc, lpLF, (FONTENUMPROCEX32A)&thunk,
lParam, reserved );
}
/*************************************************************************
* THUNK_EnumFontFamiliesEx32W (GDI32.82)
*/
INT32 THUNK_EnumFontFamiliesEx32W( HDC32 hdc, LPLOGFONT32W lpLF,
FONTENUMPROCEX32W func, LPARAM lParam,
DWORD reserved )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFontFamiliesEx32W( hdc, lpLF, (FONTENUMPROCEX32W)&thunk,
lParam, reserved );
}
/**********************************************************************
* THUNK_LineDDA16 (GDI.100)
......@@ -320,6 +377,25 @@ BOOL32 THUNK_EnumSystemCodePages32W( CODEPAGE_ENUMPROC32W func, DWORD flags )
return EnumSystemCodePages32W( (CODEPAGE_ENUMPROC32W)&thunk, flags );
}
/***********************************************************************
* THUNK_EnumSystemLocales32A (KERNEL32.92)
*/
BOOL32 THUNK_EnumSystemLocales32A( LOCALE_ENUMPROC32A func, DWORD flags )
{
DECL_THUNK( thunk, func, CallTo32_1 );
return EnumSystemLocales32A( (LOCALE_ENUMPROC32A)&thunk, flags );
}
/***********************************************************************
* THUNK_EnumSystemLocales32W (KERNEL32.93)
*/
BOOL32 THUNK_EnumSystemLocales32W( LOCALE_ENUMPROC32W func, DWORD flags )
{
DECL_THUNK( thunk, func, CallTo32_1 );
return EnumSystemLocales32W( (LOCALE_ENUMPROC32W)&thunk, flags );
}
/***********************************************************************
* THUNK_GrayString16 (USER.185)
......
......@@ -99,7 +99,7 @@ heap 65520
97 pascal16 CheckDlgButton(word word word) CheckDlgButton
98 pascal16 IsDlgButtonChecked(word word) IsDlgButtonChecked
99 pascal16 DlgDirSelect(word ptr word) DlgDirSelect
100 pascal16 DlgDirList(word segptr word word word) DlgDirList
100 pascal16 DlgDirList(word ptr word word word) DlgDirList16
101 pascal SendDlgItemMessage(word word word word long) SendDlgItemMessage16
102 pascal16 AdjustWindowRect(ptr long word) AdjustWindowRect16
103 pascal16 MapDialogRect(word ptr) MapDialogRect16
......@@ -194,7 +194,7 @@ heap 65520
192 pascal16 InSendMessage() InSendMessage
193 pascal16 IsClipboardFormatAvailable(word) IsClipboardFormatAvailable
194 pascal16 DlgDirSelectComboBox(word ptr word) DlgDirSelectComboBox
195 pascal16 DlgDirListComboBox(word segptr word word word) DlgDirListComboBox16
195 pascal16 DlgDirListComboBox(word ptr word word word) DlgDirListComboBox16
196 pascal TabbedTextOut(word s_word s_word ptr s_word s_word ptr s_word)
TabbedTextOut
197 pascal GetTabbedTextExtent(word ptr word word ptr) GetTabbedTextExtent
......
......@@ -82,7 +82,7 @@ base 1
0077 stub CreateIconIndirect
0078 stub CreateMDIWindowA
0079 stub CreateMDIWindowW
0080 stub CreateMenu
0080 stdcall CreateMenu() CreateMenu
0081 stdcall CreatePopupMenu() CreatePopupMenu
0082 stdcall CreateWindowExA(long ptr ptr long long long long long
long long long ptr) CreateWindowEx32A
......@@ -146,10 +146,10 @@ base 1
0139 stdcall DialogBoxParamW(long ptr long ptr long) DialogBoxParam32W
0140 stdcall DispatchMessageA(ptr) USER32_DispatchMessageA
0141 stdcall DispatchMessageW(ptr) USER32_DispatchMessageA
0142 stub DlgDirListA
0142 stdcall DlgDirListA(long ptr long long long) DlgDirList32A
0143 stdcall DlgDirListComboBoxA(long ptr long long long) DlgDirListComboBox32A
0144 stdcall DlgDirListComboBoxW(long ptr long long long) DlgDirListComboBox32W
0145 stub DlgDirListW
0145 stdcall DlgDirListW(long ptr long long long) DlgDirList32W
0146 stdcall DlgDirSelectComboBoxExA(long ptr long long) DlgDirSelectComboBoxEx32A
0147 stdcall DlgDirSelectComboBoxExW(long ptr long long) DlgDirSelectComboBoxEx32W
0148 stdcall DlgDirSelectExA(long ptr long long) DlgDirSelectEx32A
......@@ -466,7 +466,7 @@ base 1
0459 stub SendNotifyMessageA
0460 stub SendNotifyMessageW
0461 stub ServerSetFunctionPointers
0462 stub SetActiveWindow
0462 stdcall SetActiveWindow(long) SetActiveWindow
0463 stdcall SetCapture(long) SetCapture32
0464 stdcall SetCaretBlinkTime(long) SetCaretBlinkTime
0465 stdcall SetCaretPos(long long) SetCaretPos
......
name wing
type win16
1001 stub WINGCREATEDC
1002 stub WINGRECOMMENDDIBFORMAT
1003 stub WINGCREATEBITMAP
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 stub WINGCREATEHALFTONEPALETTE
1008 stub WINGCREATEHALFTONEBRUSH
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
# Seem that 1299 is the limit... weird...
......
......@@ -139,7 +139,7 @@ type win32
0138 stub timeEndPeriod
0139 stub timeGetDevCaps
0140 stub timeGetSystemTime
0141 stub timeGetTime
0141 stdcall timeGetTime() timeGetTime
0142 stub timeKillEvent
0143 stub timeSetEvent
0144 stub waveInAddBuffer
......
......@@ -37,17 +37,17 @@ type win16
56 pascal getservbyport(word ptr) WINSOCK_getservbyport
57 pascal gethostname(ptr word) WINSOCK_gethostname
101 pascal16 WSAAsyncSelect(word word word long) WSAAsyncSelect
102 pascal16 WSAAsyncGetHostByAddr(word word ptr word word ptr word)
102 pascal16 WSAAsyncGetHostByAddr(word word ptr word word segptr word)
WSAAsyncGetHostByAddr
103 pascal16 WSAAsyncGetHostByName(word word ptr ptr word)
103 pascal16 WSAAsyncGetHostByName(word word ptr segptr word)
WSAAsyncGetHostByName
104 pascal16 WSAAsyncGetProtoByNumber(word word word ptr word)
104 pascal16 WSAAsyncGetProtoByNumber(word word word segptr word)
WSAAsyncGetProtoByNumber
105 pascal16 WSAAsyncGetProtoByName(word word ptr ptr word)
105 pascal16 WSAAsyncGetProtoByName(word word ptr segptr word)
WSAAsyncGetProtoByName
106 pascal16 WSAAsyncGetServByPort(word word word ptr ptr word)
106 pascal16 WSAAsyncGetServByPort(word word word ptr segptr word)
WSAAsyncGetServByPort
107 pascal16 WSAAsyncGetServByName(word word ptr ptr ptr word)
107 pascal16 WSAAsyncGetServByName(word word ptr ptr segptr word)
WSAAsyncGetServByName
108 pascal16 WSACancelAsyncRequest(word) WSACancelAsyncRequest
109 pascal16 WSASetBlockingHook() WSASetBlockingHook
......@@ -58,4 +58,4 @@ type win16
114 pascal16 WSAIsBlocking() WSAIsBlocking
115 pascal WSAStartup(word ptr) WSAStartup
116 pascal WSACleanup() WSACleanup
151 pascal16 __WSAFDIsSet(word ptr) WSAFDIsSet
151 pascal16 __WSAFDIsSet(word ptr) __WSAFDIsSet
......@@ -4,7 +4,6 @@ type win16
1 pascal WINPROC_CallProc16To32A(word word word long long) WINPROC_CallProc16To32A
2 pascal StaticWndProc(word word word long) StaticWndProc
3 pascal ScrollBarWndProc(word word word long) ScrollBarWndProc
4 pascal ListBoxWndProc(word word word long) ListBoxWndProc
5 pascal ComboBoxWndProc(word word word long) ComboBoxWndProc
6 pascal EditWndProc(word word word long) EditWndProc
7 pascal PopupMenuWndProc(word word word long) PopupMenuWndProc
......
......@@ -3,9 +3,6 @@
/* Define to empty if the keyword does not work. */
#undef const
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
......@@ -15,6 +12,9 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define if symbols declared in assembly code need an underscore prefix */
#undef NEED_UNDERSCORE_PREFIX
......
......@@ -8,6 +8,7 @@
#define DCE_H
#include "windows.h"
#include "win.h"
/* additional DCX flags
*/
......@@ -44,8 +45,9 @@ typedef struct tagDCE
} DCE;
extern void DCE_Init(void);
extern DCE *DCE_AllocDCE( HWND32 hWnd, DCE_TYPE type );
extern void DCE_FreeDCE( DCE *dce );
extern void DCE_Init(void);
extern DCE* DCE_AllocDCE( HWND32 hWnd, DCE_TYPE type );
extern void DCE_FreeDCE( DCE *dce );
extern INT16 DCE_ExcludeRgn( HDC32, WND*, HRGN32 );
#endif /* DCE_H */
......@@ -13,6 +13,7 @@ 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 );
extern void HOOK_FreeModuleHooks( HMODULE16 hModule );
extern void HOOK_FreeQueueHooks( HQUEUE16 hQueue );
......
/*
* Keyboard definitions
*
*/
#ifndef __WINE_KEYBOARD_H
#define __WINE_KEYBOARD_H
#define WINE_VKEY_MAPPINGS\
vkcase('!', '1')\
vkcase('@', '2')\
vkcase('#', '3')\
vkcase('$', '4')\
vkcase('%', '5')\
vkcase('^', '6')\
vkcase('&', '7')\
vkcase('*', '8')\
vkcase('(', '9')\
vkcase(')', '0')\
vkcase2('`', '~', 0xc0)\
vkcase2('-', '_', 0xbd)\
vkcase2('=', '+', 0xbb)\
vkcase2('[', '{', 0xdb)\
vkcase2(']', '}', 0xdd)\
vkcase2(';', ':', 0xba)\
vkcase2('\'', '"', 0xde)\
vkcase2(',', '<', 0xbc)\
vkcase2('.', '>', 0xbe)\
vkcase2('/', '?', 0xbf)\
vkcase2('\\', '|', 0xdc)
#endif /* __WINE_KEYBOARD_H */
......@@ -69,5 +69,3 @@ extern void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC16 hdc,
WORD itemState);
extern int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y);
extern void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls);
extern LRESULT ListBoxWndProc(HWND hwnd,UINT message,WPARAM16 wParam,LPARAM lParam);
......@@ -92,7 +92,7 @@ extern BOOL32 WIN_LinkWindow( HWND32 hwnd, HWND32 hwndInsertAfter );
extern HWND32 WIN_FindWinToRepaint( HWND32 hwnd, HQUEUE16 hQueue );
extern void WIN_SendParentNotify( HWND32 hwnd, WORD event,
WORD idChild, LPARAM lValue );
extern void WIN_DestroyQueueWindows( WND* wnd, HQUEUE16 hQueue );
extern void WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew );
extern BOOL32 WIN_CreateDesktopWindow(void);
extern HWND32 WIN_GetTopParent( HWND32 hwnd );
extern BOOL32 WIN_IsWindowDrawable(WND*, BOOL32 );
......
#ifndef __WINE_WINNLS_H
#define __WINE_WINNLS_H
/* When adding new defines, don't forget to add an entry to the
* locale2id map in misc/ole2nls.c
*/
#define LOCALE_ILANGUAGE 0x00000001
#define LOCALE_SLANGUAGE 0x00000002
#define LOCALE_SENGLANGUAGE 0x00001001
......
......@@ -50,9 +50,9 @@ extern void WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg16To32W( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg32ATo16( UINT16 msg, WPARAM16 wParam,
extern void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg32WTo16( UINT16 msg, WPARAM16 wParam,
extern void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM16 wParam,
LPARAM lParam );
#endif /* __WINE_WINPROC_H */
......@@ -13,6 +13,11 @@
#include "debug.h"
#include "xmalloc.h"
void SIGNAL_MaskAsyncEvents( BOOL32 mask )
{
/* FIXME: signals don't work in the library */
}
int CallTo32_LargeStack( int (*func)(), int nbargs, ...)
{
va_list arglist;
......@@ -49,7 +54,6 @@ extern LRESULT EditWndProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT FileOpenDlgProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT FileSaveDlgProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT FindTextDlgProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT ListBoxWndProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT MDIClientWndProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT PopupMenuWndProc(HWND,UINT,WPARAM16,LPARAM);
extern LRESULT PrintDlgProc(HWND,UINT,WPARAM16,LPARAM);
......@@ -77,7 +81,6 @@ FARPROC16 MODULE_GetWndProcEntry16( char *name )
MAP_STR_TO_PROC("FileOpenDlgProc",FileOpenDlgProc);
MAP_STR_TO_PROC("FileSaveDlgProc",FileSaveDlgProc);
MAP_STR_TO_PROC("FindTextDlgProc",FindTextDlgProc);
MAP_STR_TO_PROC("ListBoxWndProc",ListBoxWndProc);
MAP_STR_TO_PROC("MDIClientWndProc",MDIClientWndProc);
MAP_STR_TO_PROC("PopupMenuWndProc",PopupMenuWndProc);
MAP_STR_TO_PROC("PrintDlgProc",PrintDlgProc);
......
......@@ -149,11 +149,11 @@ int MAIN_Init(void)
if (!KERN32_Init()) return 0;
/* Create system message queue */
queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
queueSize = GetProfileInt32A( "windows", "TypeAhead", 120 );
if (!QUEUE_CreateSysMsgQueue( queueSize )) return 0;
/* Set double click time */
SetDoubleClickTime( GetProfileInt( "windows", "DoubleClickSpeed", 452 ) );
SetDoubleClickTime( GetProfileInt32A("windows","DoubleClickSpeed",452) );
return 1;
}
......
......@@ -1290,6 +1290,7 @@ INT16 GetModuleFileName( HINSTANCE16 hModule, LPSTR lpFileName, INT16 nSize )
{
NE_MODULE *pModule;
if (!hModule) hModule = GetCurrentTask();
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
......@@ -1407,7 +1408,8 @@ HINSTANCE16 WinExec( LPSTR lpCmdLine, WORD nCmdShow )
{
/* Check that the original file name did not have a suffix */
p = strrchr(filename, '.');
if (!p || (strchr(p, '/') && strchr(p, '\\')))
/* if there is a '.', check if either \ OR / follow */
if (!p || strchr(p, '/') || strchr(p, '\\'))
{
p = filename + strlen(filename);
strcpy( p, ".exe" );
......
......@@ -124,14 +124,14 @@ static void SIGNAL_fault(int signal, int code, SIGCONTEXT *context)
/**********************************************************************
* SIGNAL_SetHandler
*/
static void SIGNAL_SetHandler( int sig, void (*func)() )
static void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
{
int ret;
struct sigaction sig_act;
#ifdef linux
sig_act.sa_handler = func;
sig_act.sa_flags = SA_RESTART | SA_NOMASK;
sig_act.sa_flags = SA_RESTART | (flags) ? SA_NOMASK : 0;
/* Point to the top of the stack, minus 4 just in case, and make
it aligned */
sig_act.sa_restorer =
......@@ -165,6 +165,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)() )
}
extern void stop_wait(int a);
extern void WINSOCK_sigio(int a);
/**********************************************************************
......@@ -204,18 +205,19 @@ BOOL32 SIGNAL_Init(void)
}
#endif /* __svr4__ || _SCO_DS */
SIGNAL_SetHandler( SIGALRM, (void (*)())wine_timer );
SIGNAL_SetHandler( SIGSEGV, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGILL, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGFPE, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGTRAP, (void (*)())SIGNAL_trap ); /* debugger */
SIGNAL_SetHandler( SIGHUP, (void (*)())SIGNAL_trap ); /* forced break */
SIGNAL_SetHandler( SIGALRM, (void (*)())wine_timer, 1);
SIGNAL_SetHandler( SIGSEGV, (void (*)())SIGNAL_fault, 1);
SIGNAL_SetHandler( SIGILL, (void (*)())SIGNAL_fault, 1);
SIGNAL_SetHandler( SIGFPE, (void (*)())SIGNAL_fault, 1);
SIGNAL_SetHandler( SIGTRAP, (void (*)())SIGNAL_trap, 1); /* debugger */
SIGNAL_SetHandler( SIGHUP, (void (*)())SIGNAL_trap, 1); /* forced break */
#ifdef SIGBUS
SIGNAL_SetHandler( SIGBUS, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGBUS, (void (*)())SIGNAL_fault, 1);
#endif
#ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait, 1); /* For IPC */
#endif
SIGNAL_SetHandler( SIGIO, (void (*)())WINSOCK_sigio, 0);
return TRUE;
}
......@@ -239,4 +241,19 @@ void SIGNAL_StartBIOSTimer(void)
setitimer(ITIMER_REAL, &vt_timer, NULL);
}
/**********************************************************************
* SIGNAL_MaskAsyncEvents
*/
void SIGNAL_MaskAsyncEvents( BOOL32 flag )
{
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGIO);
sigaddset(&set, SIGUSR1);
#ifdef CONFIG_IPC
sigaddset(&set, SIGUSR2);
#endif
sigprocmask( (flag) ? SIG_BLOCK : SIG_UNBLOCK , &set, NULL);
}
#endif /* ifndef WINELIB */
......@@ -67,6 +67,7 @@ static FARPROC16 TASK_RescheduleProc;
#endif
static HGLOBAL16 TASK_CreateDOSEnvironment(void);
static void TASK_YieldToSystem(TDB*);
/***********************************************************************
* TASK_Init
......@@ -514,7 +515,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
/* Get the compatibility flags */
pTask->compat_flags = GetProfileInt( "Compatibility", name, 0 );
pTask->compat_flags = GetProfileInt32A( "Compatibility", name, 0 );
/* Allocate a code segment alias for the TDB */
......@@ -685,11 +686,22 @@ void TASK_KillCurrentTask( INT16 exitCode )
/* Remove the task from the list to be sure we never switch back to it */
TASK_UnlinkTask( hCurrentTask );
if( nTaskCount )
{
TDB* p = (TDB *)GlobalLock16( hFirstTask );
while( p )
{
if( p->hYieldTo == hCurrentTask ) p->hYieldTo = 0;
p = (TDB *)GlobalLock16( p->hNext );
}
}
hTaskToKill = hCurrentTask;
hLockedTask = 0;
Yield();
pTask->nEvents = 0;
TASK_YieldToSystem(pTask);
/* We should never return from this Yield() */
fprintf(stderr,"Return of the living dead %04x!!!\n", hCurrentTask);
......@@ -753,8 +765,9 @@ void TASK_Reschedule(void)
/* check for DirectedYield() */
hTask = pOldTask->hYieldTo;
if (!(pNewTask = (TDB *)GlobalLock16( hTask )) || !pNewTask->nEvents)
hTask = 0;
pNewTask = (TDB *)GlobalLock16( hTask );
if( !pNewTask || !pNewTask->nEvents) hTask = 0;
pOldTask->hYieldTo = 0;
}
/* extract hardware events only! */
......
......@@ -38,7 +38,8 @@ C_SRCS = \
user.c \
ver.c \
w32sys.c \
winsocket.c \
winsock.c \
winsock_async.c \
wsprintf.c \
xmalloc.c
......
......@@ -166,22 +166,14 @@ static void FILEDLG_StripEditControl(HWND hwnd)
*/
static BOOL FILEDLG_ScanDir(HWND hWnd, LPSTR newPath)
{
BOOL32 ret = FALSE;
int len;
char *str = SEGPTR_ALLOC(512);
if (!str) return TRUE;
char str[512];
lstrcpyn32A( str, newPath, 512 );
len = strlen(str);
GetDlgItemText32A( hWnd, edt1, str + len, 512 - len );
if (DlgDirList(hWnd, SEGPTR_GET(str), lst1, 0, 0x0000))
{
strcpy( str, "*.*" );
DlgDirList(hWnd, SEGPTR_GET(str), lst2, stc1, 0x8010 );
ret = TRUE;
}
SEGPTR_FREE(str);
return ret;
GetDlgItemText32A( hWnd, edt1, str + len, sizeof(str) - len );
if (!DlgDirList32A( hWnd, str, lst1, 0, 0x0000 )) return FALSE;
return DlgDirList32A( hWnd, "*.*", lst2, stc1, 0x8010 );
}
/***********************************************************************
......@@ -388,10 +380,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM16 wParam, LPARAM lParam)
lpofn->nFilterIndex, tmpstr);
SetDlgItemText32A( hWnd, edt1, tmpstr );
/* get drive list */
pstr = SEGPTR_ALLOC(1);
*pstr = 0;
DlgDirListComboBox16(hWnd, SEGPTR_GET(pstr), cmb2, 0, 0xC000);
SEGPTR_FREE(pstr);
DlgDirListComboBox32A(hWnd, "", cmb2, 0, 0xC000);
/* read initial directory */
if (PTR_SEG_TO_LIN(lpofn->lpstrInitialDir) != NULL)
{
......
......@@ -616,6 +616,22 @@ VOID* CRTDLL_malloc(DWORD size)
}
/*********************************************************************
* calloc (CRTDLL.350)
*/
VOID* CRTDLL_calloc(DWORD size, DWORD count)
{
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size * count );
}
/*********************************************************************
* realloc (CRTDLL.447)
*/
VOID* CRTDLL_realloc( VOID *ptr, DWORD size )
{
return HeapReAlloc( GetProcessHeap(), 0, ptr, size );
}
/*********************************************************************
* free (CRTDLL.427)
*/
VOID CRTDLL_free(LPVOID ptr)
......
......@@ -21,7 +21,7 @@ void LoadStartupDrivers(void)
char str[256];
LPSTR ptr;
if (GetPrivateProfileString( "drivers", NULL, "", str, sizeof(str),
if (GetPrivateProfileString32A( "drivers", NULL, "", str, sizeof(str),
"SYSTEM.INI" ) < 2)
{
fprintf( stderr,
......@@ -84,7 +84,7 @@ HDRVR16 OpenDriver(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
lpDriverName, lpSectionName, lParam );
if (lpSectionName == NULL) lpSectionName = "drivers";
GetPrivateProfileString( lpSectionName, lpDriverName, "", DrvName,
GetPrivateProfileString32A( lpSectionName, lpDriverName, "", DrvName,
sizeof(DrvName), "SYSTEM.INI" );
dprintf_driver( stddeb,"OpenDriver // DrvName='%s'\n", DrvName );
if (lstrlen32A(DrvName) < 1) return 0;
......
......@@ -804,7 +804,8 @@ LONG GetWinFlags(void)
fprintf(stderr, "Unknown mode set? This shouldn't happen. Check GetWinFlags()!\n");
break;
}
if( getVersionEx.dwPlatformId == VER_PLATFORM_WIN32_NT )
result |= 0x4000; /* undocumented WF_WINNT */
return result;
}
......@@ -1076,18 +1077,21 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
break;
case SPI_GETFASTTASKSWITCH:
*(BOOL *) lpvParam = FALSE;
/* FIXME GetProfileInt( "windows", "CoolSwitch", 1 ) */
if ( GetProfileInt32A( "windows", "CoolSwitch", 1 ) == 1 )
*(BOOL *) lpvParam = TRUE;
else
*(BOOL *) lpvParam = FALSE;
break;
case SPI_GETGRIDGRANULARITY:
*(INT *) lpvParam = 1;
/* FIXME GetProfileInt( "desktop", "GridGranularity", 1 ) */
break;
*(INT *) lpvParam = GetProfileInt32A( "desktop",
"GridGranularity",
1 );
break;
case SPI_GETICONTITLEWRAP:
*(BOOL *) lpvParam = FALSE;
/* FIXME GetProfileInt( "desktop", "?", True ) */
/* FIXME GetProfileInt32A( "desktop", "?", True ) */
break;
case SPI_GETKEYBOARDDELAY:
......@@ -1105,9 +1109,11 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
break;
case SPI_GETSCREENSAVEACTIVE:
/* FIXME GetProfileInt( "windows", "ScreenSaveActive", 1 ); */
*(BOOL *) lpvParam = FALSE;
break;
if ( GetProfileInt32A( "windows", "ScreenSaveActive", 1 ) == 1 )
*(BOOL *) lpvParam = TRUE;
else
*(BOOL *) lpvParam = FALSE;
break;
case SPI_GETSCREENSAVETIMEOUT:
/* FIXME GetProfileInt( "windows", "ScreenSaveTimeout", 300 ); */
......@@ -1116,18 +1122,20 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
break;
case SPI_ICONHORIZONTALSPACING:
/* FIXME Get/SetProfileInt */
if (lpvParam == NULL)
fprintf(stderr, "SystemParametersInfo: Horizontal icon spacing set to %d\n.", uParam);
else
*(INT *) lpvParam = GetSystemMetrics( SM_CXICONSPACING );
/*SetSystemMetrics( SM_CXICONSPACING, uParam )*/ ;
else
*(INT *) lpvParam = GetSystemMetrics( SM_CXICONSPACING );
break;
case SPI_ICONVERTICALSPACING:
if (lpvParam == NULL)
fprintf(stderr, "SystemParametersInfo: Vertical icon spacing set to %d\n.", uParam);
else
*(INT *) lpvParam = GetSystemMetrics( SM_CYICONSPACING );
break;
/* FIXME Get/SetProfileInt */
if (lpvParam == NULL)
/*SetSystemMetrics( SM_CYICONSPACING, uParam )*/ ;
else
*(INT *) lpvParam = GetSystemMetrics(SM_CYICONSPACING);
break;
case SPI_SETBEEP:
if (uParam == TRUE)
......@@ -1147,7 +1155,7 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
case SPI_SETSCREENSAVETIMEOUT:
XSetScreenSaver(display, uParam, 60, DefaultBlanking,
DefaultExposures);
DefaultExposures);
break;
case SPI_SETDESKWALLPAPER:
......@@ -1156,7 +1164,7 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
case SPI_SETDESKPATTERN:
if ((INT) uParam == -1) {
GetProfileString("Desktop", "Pattern",
GetProfileString32A("Desktop", "Pattern",
"170 85 170 85 170 85 170 85",
buffer, sizeof(buffer) );
return (DESKTOP_SetPattern((LPSTR) buffer));
......@@ -1166,19 +1174,20 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
case SPI_GETICONTITLELOGFONT:
{
/* FIXME GetProfileString( "?", "?", "?" ) */
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 = 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;
}
case SPI_LANGDRIVER:
case SPI_SETBORDER:
case SPI_SETDOUBLECLKHEIGHT:
......
......@@ -450,7 +450,7 @@ _savesubreg(FILE *F,LPKEYSTRUCT lpkey,int all) {
return _savesubkey(F,lpkey->nextsub,0,all);
}
static void
static BOOL32
_savereg(LPKEYSTRUCT lpkey,char *fn,int all) {
FILE *F;
......@@ -459,15 +459,16 @@ _savereg(LPKEYSTRUCT lpkey,char *fn,int all) {
fprintf(stddeb,__FILE__":_savereg:Couldn't open %s for writing: %s\n",
fn,strerror(errno)
);
return;
return FALSE;
}
if (!_savesubreg(F,lpkey,all)) {
fclose(F);
unlink(fn);
fprintf(stddeb,__FILE__":_savereg:Failed to save keys, perhaps no more diskspace for %s?\n",fn);
return;
return FALSE;
}
fclose(F);
return TRUE;
}
void
......@@ -500,19 +501,22 @@ SHELL_SaveRegistry() {
if (lstrcmpi32A(buf,"yes"))
all=1;
pwd=getpwuid(getuid());
if (pwd!=NULL && pwd->pw_dir!=NULL) {
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_USERS_DEFAULT)+2);
if (pwd!=NULL && pwd->pw_dir!=NULL)
{
char *tmp = tmpnam(NULL);
fn=(char*)xmalloc( strlen(pwd->pw_dir) + strlen(WINE_PREFIX) +
strlen(SAVE_CURRENT_USER) + 2 );
strcpy(fn,pwd->pw_dir);
strcat(fn,WINE_PREFIX);
/* create the directory. don't care about errorcodes. */
mkdir(fn,0755); /* drwxr-xr-x */
strcat(fn,"/"SAVE_CURRENT_USER);
_savereg(key_current_user,fn,all);
if (_savereg(key_current_user,tmp,all)) rename(tmp,fn);
free(fn);
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_LOCAL_MACHINE)+2);
strcpy(fn,pwd->pw_dir);
strcat(fn,WINE_PREFIX"/"SAVE_LOCAL_MACHINE);
_savereg(key_local_machine,fn,all);
if (_savereg(key_local_machine,tmp,all)) rename(tmp,fn);
free(fn);
} else
fprintf(stderr,"SHELL_SaveRegistry:failed to get homedirectory of UID %d.\n",getuid());
......@@ -1315,6 +1319,216 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) {
free(keys);
}
/* WINDOWS 31 REGISTRY LOADER, supplied by Tor Sjwall, tor@sn.no */
/*
reghack - windows 3.11 registry data format demo program.
The reg.dat file has 3 parts, a header, a table of 8-byte entries that is
a combined hash table and tree description, and finally a text table.
The header is obvious from the struct header. The taboff1 and taboff2
fields are always 0x20, and their usage is unknown.
The 8-byte entry table has various entry types.
tabent[0] is a root index. The second word has the index of the root of
the directory.
tabent[1..hashsize] is a hash table. The first word in the hash entry is
the index of the key/value that has that hash. Data with the same
hash value are on a circular list. The other three words in the
hash entry are always zero.
tabent[hashsize..tabcnt] is the tree structure. There are two kinds of
entry: dirent and keyent/valent. They are identified by context.
tabent[freeidx] is the first free entry. The first word in a free entry
is the index of the next free entry. The last has 0 as a link.
The other three words in the free list are probably irrelevant.
Entries in text table are preceeded by a word at offset-2. This word
has the value (2*index)+1, where index is the referring keyent/valent
entry in the table. I have no suggestion for the 2* and the +1.
Following the word, there are N bytes of data, as per the keyent/valent
entry length. The offset of the keyent/valent entry is from the start
of the text table to the first data byte.
This information is not available from Microsoft. The data format is
deduced from the reg.dat file by me. Mistakes may
have been made. I claim no rights and give no guarantees for this program.
Tor Sjwall, tor@sn.no
*/
/* reg.dat header format */
struct _w31_header {
char cookie[8]; /* 'SHCC3.10' */
unsigned long taboff1; /* offset of hash table (??) = 0x20 */
unsigned long taboff2; /* offset of index table (??) = 0x20 */
unsigned long tabcnt; /* number of entries in index table */
unsigned long textoff; /* offset of text part */
unsigned long textsize; /* byte size of text part */
unsigned short hashsize; /* hash size */
unsigned short freeidx; /* free index */
};
/* generic format of table entries */
struct _w31_tabent {
unsigned short w0, w1, w2, w3;
};
/* directory tabent: */
struct _w31_dirent {
unsigned short sibling_idx; /* table index of sibling dirent */
unsigned short child_idx; /* table index of child dirent */
unsigned short key_idx; /* table index of key keyent */
unsigned short value_idx; /* table index of value valent */
};
/* key tabent: */
struct _w31_keyent {
unsigned short hash_idx; /* hash chain index for string */
unsigned short refcnt; /* reference count */
unsigned short length; /* length of string */
unsigned short string_off; /* offset of string in text table */
};
/* value tabent: */
struct _w31_valent {
unsigned short hash_idx; /* hash chain index for string */
unsigned short refcnt; /* reference count */
unsigned short length; /* length of string */
unsigned short string_off; /* offset of string in text table */
};
/* recursive helper function to display a directory tree */
void
__w31_dumptree( unsigned short idx,
unsigned char *txt,
struct _w31_tabent *tab,
struct _w31_header *head,
LPKEYSTRUCT lpkey,
time_t lastmodified,
int level
) {
struct _w31_dirent *dir;
struct _w31_keyent *key;
struct _w31_valent *val;
LPKEYSTRUCT xlpkey;
LPWSTR name,value;
static char tail[400];
while (idx!=0) {
dir=(struct _w31_dirent*)&tab[idx];
if (dir->key_idx) {
key = (struct _w31_keyent*)&tab[dir->key_idx];
memcpy(tail,&txt[key->string_off],key->length);
tail[key->length]='\0';
/* all toplevel entries AND the entries in the
* toplevel subdirectory belong to \SOFTWARE\Classes
*/
if (!level && !lstrcmp32A(tail,".classes")) {
__w31_dumptree(dir->child_idx,txt,tab,head,lpkey,lastmodified,level+1);
idx=dir->sibling_idx;
continue;
}
name=STRING32_DupAnsiToUni(tail);
xlpkey=_find_or_add_key(lpkey,name);
/* only add if leaf node or valued node */
if (dir->value_idx!=0||dir->child_idx==0) {
if (dir->value_idx) {
val=(struct _w31_valent*)&tab[dir->value_idx];
memcpy(tail,&txt[val->string_off],val->length);
tail[val->length]='\0';
value=STRING32_DupAnsiToUni(tail);
_find_or_add_value(xlpkey,NULL,REG_SZ,(LPBYTE)value,lstrlen32W(value)*2+2,lastmodified);
}
}
} else {
dprintf_reg(stddeb,"__w31_dumptree:strange: no directory key name, idx=%04x\n", idx);
}
__w31_dumptree(dir->child_idx,txt,tab,head,xlpkey,lastmodified,level+1);
idx=dir->sibling_idx;
}
}
void
_w31_loadreg() {
HFILE hf;
struct _w31_header head;
struct _w31_tabent *tab;
unsigned char *txt;
int len;
OFSTRUCT ofs;
BY_HANDLE_FILE_INFORMATION hfinfo;
time_t lastmodified;
HKEY hkey;
LPKEYSTRUCT lpkey;
hf = OpenFile("reg.dat",&ofs,OF_READ);
if (hf==HFILE_ERROR)
return;
/* read & dump header */
if (sizeof(head)!=_lread32(hf,&head,sizeof(head))) {
dprintf_reg(stddeb,"_w31_loadreg:reg.dat is too short.\n");
_lclose(hf);
return;
}
if (memcmp(head.cookie, "SHCC3.10", sizeof(head.cookie))!=0) {
dprintf_reg(stddeb,"_w31_loadreg:reg.dat has bad signature.\n");
_lclose(hf);
return;
}
len = head.tabcnt * sizeof(struct _w31_tabent);
/* read and dump index table */
tab = xmalloc(len);
if (len!=_lread32(hf,tab,len)) {
dprintf_reg(stderr,"_w31_loadreg:couldn't read %d bytes.\n",len);
free(tab);
_lclose(hf);
return;
}
/* read text */
txt = xmalloc(head.textsize);
if (-1==_llseek(hf,head.textoff,SEEK_SET)) {
dprintf_reg(stderr,"_w31_loadreg:couldn't seek to textblock.\n");
free(tab);
free(txt);
_lclose(hf);
return;
}
if (head.textsize!=_lread32(hf,txt,head.textsize)) {
dprintf_reg(stderr,"_w31_loadreg:textblock too short (%d instead of %ld).\n",len,head.textsize);
free(tab);
free(txt);
_lclose(hf);
return;
}
if (!GetFileInformationByHandle(hf,&hfinfo)) {
dprintf_reg(stderr,"_w31_loadreg:GetFileInformationByHandle failed?.\n");
free(tab);
free(txt);
_lclose(hf);
return;
}
lastmodified = DOSFS_FileTimeToUnixTime(&(hfinfo.ftLastWriteTime));
if (RegCreateKey16(HKEY_LOCAL_MACHINE,"\\SOFTWARE\\Classes",&hkey)!=ERROR_SUCCESS)
return;
lpkey = lookup_hkey(hkey);
__w31_dumptree(tab[0].w1,txt,tab,&head,lpkey,lastmodified,0);
free(tab);
free(txt);
_lclose(hf);
return;
}
void
SHELL_LoadRegistry() {
char *fn;
......@@ -1326,13 +1540,13 @@ SHELL_LoadRegistry() {
if (key_classes_root==NULL)
SHELL_Init();
/* Load windows 3.1 entries */
_w31_loadreg();
/* Load windows 95 entries */
_w95_loadreg("C:\\system.1st", key_local_machine);
_w95_loadreg("system.dat", key_local_machine);
_w95_loadreg("user.dat", key_users);
/* FIXME: win3.1 reg.dat loader still missing */
/* the global user default is loaded under HKEY_USERS\\.Default */
RegCreateKey16(HKEY_USERS,".Default",&hkey);
lpkey = lookup_hkey(hkey);
......
......@@ -195,29 +195,34 @@ static HINSTANCE16 SHELL_FindExecutable( LPCSTR lpFile,
/* extensions; however, it'd make sense to check the programs */
/* section first, so that's what happens here. */
/* See if it's a program */
GetProfileString("windows", "programs", "exe pif bat com",
buffer, sizeof(buffer)); /* FIXME check return code! */
for (i=0;i<strlen(buffer); i++) buffer[i]=tolower(buffer[i]);
tok = strtok(buffer, " \t"); /* ? */
while( tok!= NULL)
{
if (strcmp(tok, &tmpext[1])==0) /* have to skip the leading "." */
{
strcpy(lpResult, xlpFile); /* Need to perhaps check that */
/* the file has a path attached */
dprintf_exec(stddeb, "SHELL_FindExecutable: found %s\n",
lpResult);
return 33; /* Greater than 32 to indicate success FIXME */
/* According to the docs, I should be returning */
/* a handle for the executable. Does this mean */
/* I'm supposed to open the executable file or */
/* something? More RTFM, I guess... */
}
tok=strtok(NULL, " \t");
}
/* See if it's a program - if GetProfileString fails, we skip this
* section. Actually, if GetProfileString fails, we've probably
* got a lot more to worry about than running a program... */
if ( GetProfileString32A("windows", "programs", "exe pif bat com",
buffer, sizeof(buffer)) > 0 )
{
for (i=0;i<strlen(buffer); i++) buffer[i]=tolower(buffer[i]);
tok = strtok(buffer, " \t"); /* ? */
while( tok!= NULL)
{
if (strcmp(tok, &tmpext[1])==0) /* have to skip the leading "." */
{
strcpy(lpResult, xlpFile);
/* Need to perhaps check that the file has a path
* attached */
dprintf_exec(stddeb, "SHELL_FindExecutable: found %s\n",
lpResult);
return 33;
/* Greater than 32 to indicate success FIXME According to the
* docs, I should be returning a handle for the
* executable. Does this mean I'm supposed to open the
* executable file or something? More RTFM, I guess... */
}
tok=strtok(NULL, " \t");
}
}
/* Check registry */
if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, tmpext, filetype,
......@@ -249,32 +254,34 @@ static HINSTANCE16 SHELL_FindExecutable( LPCSTR lpFile,
strcat( lpResult, &tok[2] );
}
}
retval=33;
retval=33; /* FIXME see above */
}
}
else /* Check win.ini */
{
/* Toss the leading dot */
extension++;
GetProfileString( "extensions", extension, "", command,
sizeof(command));
if (strlen(command)!=0)
{
strcpy( lpResult, command );
tok=strstr( lpResult, "^" ); /* should be ^.extension? */
if (tok != NULL)
{
tok[0]='\0';
strcat( lpResult, xlpFile ); /* what if no dir in xlpFile? */
tok=strstr( command, "^" ); /* see above */
if ((tok != NULL) && (strlen(tok)>5))
{
strcat( lpResult, &tok[5]);
}
}
retval=33;
if ( GetProfileString32A( "extensions", extension, "", command,
sizeof(command)) > 0)
{
if (strlen(command)!=0)
{
strcpy( lpResult, command );
tok=strstr( lpResult, "^" ); /* should be ^.extension? */
if (tok != NULL)
{
tok[0]='\0';
strcat( lpResult, xlpFile ); /* what if no dir in xlpFile? */
tok=strstr( command, "^" ); /* see above */
if ((tok != NULL) && (strlen(tok)>5))
{
strcat( lpResult, &tok[5]);
}
}
retval=33; /* FIXME - see above */
}
}
}
}
dprintf_exec(stddeb, "SHELL_FindExecutable: returning %s\n", lpResult);
return retval;
......@@ -804,7 +811,7 @@ DWORD DoEnvironmentSubst(LPSTR str,WORD length)
*/
int RegisterShellHook(void *ptr)
{
fprintf(stdnimp, "RegisterShellHook : Empty Stub !!!\n");
fprintf(stdnimp, "RegisterShellHook( %p ) : Empty Stub !!!\n", ptr);
return 0;
}
......
......@@ -296,7 +296,8 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
"LB_SETITEMHEIGHT32", /* 0x01a0 */
"LB_GETITEMHEIGHT32", /* 0x01a1 */
"LB_FINDSTRINGEXACT32", /* 0x01a2 */
NULL, NULL,
"LB_CARETON32", /* 0x01a3 */
"LB_CARETOFF32", /* 0x01a4 */
"LB_SETLOCALE32", /* 0x01a5 */
"LB_GETLOCALE32", /* 0x01a6 */
"LB_SETCOUNT32", /* 0x01a7 */
......
......@@ -101,7 +101,7 @@ INT16 InitApp( HINSTANCE16 hInstance )
int queueSize;
/* Create task message queue */
queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
queueSize = GetProfileInt32A( "windows", "DefaultQueueSize", 8 );
if (!SetMessageQueue( queueSize )) return 0;
return 1;
......@@ -112,8 +112,7 @@ INT16 InitApp( HINSTANCE16 hInstance )
*/
void USER_AppExit( HTASK16 hTask, HINSTANCE16 hInstance, HQUEUE16 hQueue )
{
/* FIXME: flush send messages (which are not implemented yet),
* empty clipboard if needed, maybe destroy menus (Windows
/* FIXME: empty clipboard if needed, maybe destroy menus (Windows
* only complains about them but does nothing);
*/
......@@ -126,18 +125,13 @@ void USER_AppExit( HTASK16 hTask, HINSTANCE16 hInstance, HQUEUE16 hQueue )
/* Patch resident popup menu window */
MENU_SwitchTPWndTo(0);
/* Nuke timers */
TIMER_RemoveQueueTimers( hQueue );
QUEUE_FlushMessages( hQueue );
HOOK_FreeQueueHooks( hQueue );
QUEUE_SetDoomedQueue( hQueue );
/* Nuke orphaned windows */
WIN_DestroyQueueWindows( desktop->child, hQueue );
WIN_ResetQueueWindows( desktop->child, hQueue, (HQUEUE16)0);
QUEUE_SetDoomedQueue( 0 );
/* Free the message queue */
......
This diff is collapsed. Click to expand it.
......@@ -649,7 +649,6 @@ static int INT21_GetCurrentDirectory( SIGCONTEXT *context )
}
lstrcpyn32A( ptr, DRIVE_GetDosCwd(drive), 64 );
if (!ptr[0]) strcpy( ptr, "\\" );
return 1;
}
......
......@@ -91,7 +91,7 @@ BOOL sndPlaySound(LPCSTR lpszSoundName, UINT uFlags)
MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
if (hmmio == 0) {
dprintf_mmsys(stddeb, "sndPlaySound // searching in SystemSound List !\n");
GetProfileString("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str));
GetProfileString32A("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str));
if (strlen(str) == 0) return FALSE;
if ( (ptr = (LPSTR)strchr(str, ',')) != NULL) *ptr = '\0';
hmmio = mmioOpen(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
......@@ -586,7 +586,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lp16Parms)
s=(char*)PTR_SEG_TO_LIN(lpParms->lpstrElementName);
t=strrchr(s,'.');
if (t) {
GetProfileString("mci extensions",t+1,"*",str,sizeof(str));
GetProfileString32A("mci extensions",t+1,"*",str,sizeof(str));
AnsiUpper(str);
if (strcmp(str, "CDAUDIO") == 0) {
uDevTyp = MCI_DEVTYPE_CD_AUDIO;
......@@ -745,7 +745,7 @@ DWORD mciSysInfo(DWORD dwFlags, LPMCI_SYSINFO_PARMS lpParms)
InstalledCount = 0;
InstalledListLen = 0;
ptr = lpInstallNames = xmalloc(2048);
GetPrivateProfileString("mci", NULL, "", lpInstallNames, 2000, SysFile);
GetPrivateProfileString32A("mci", NULL, "", lpInstallNames, 2000, SysFile);
while(strlen(ptr) > 0) {
dprintf_mci(stddeb, "---> '%s' \n", ptr);
len = strlen(ptr) + 1;
......
......@@ -418,6 +418,24 @@ INT32 GetClipBox32( HDC32 hdc, LPRECT32 rect )
return ret;
}
/***********************************************************************
* GetClipRgn32 (GDI32.163)
*/
INT32 GetClipRgn32( HDC32 hdc, HRGN32 hRgn )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if( dc && hRgn )
if( dc->w.hClipRgn )
{
/* this assumes that dc->w.hClipRgn is in coordinates
relative to the DC origin (not device) */
if( CombineRgn32(hRgn, dc->w.hClipRgn, 0, RGN_COPY) != ERROR )
return 1;
}
else return 0;
return -1;
}
/***********************************************************************
* SaveVisRgn (GDI.129)
......
......@@ -719,19 +719,36 @@ WORD SetTextAlign( HDC16 hdc, WORD textAlign )
/***********************************************************************
* GetDCOrgEx (GDI32.168)
*/
BOOL32 GetDCOrgEx(HDC32 hDC, LPPOINT32 lpp)
{
DC * dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC );
if (!dc || !lpp) return FALSE;
if (!(dc->w.flags & DC_MEMORY))
{
Window root;
int w, h, border, depth;
XGetGeometry( display, dc->u.x.drawable, &root,
&lpp->x, &lpp->y, &w, &h, &border, &depth );
}
else lpp->x = lpp->y = 0;
lpp->x += dc->w.DCOrgX; lpp->y += dc->w.DCOrgY;
return TRUE;
}
/***********************************************************************
* GetDCOrg (GDI.79)
*/
DWORD GetDCOrg( HDC16 hdc )
{
Window root;
int x, y, w, h, border, depth;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return 0;
if (dc->w.flags & DC_MEMORY) return 0;
XGetGeometry( display, dc->u.x.drawable, &root,
&x, &y, &w, &h, &border, &depth );
return MAKELONG( dc->w.DCOrgX + (WORD)x, dc->w.DCOrgY + (WORD)y );
POINT32 pt;
if( GetDCOrgEx( hdc, &pt) )
return MAKELONG( (WORD)pt.x, (WORD)pt.y );
return 0;
}
......
......@@ -86,7 +86,6 @@ DC_GET_X_Y( DWORD, GetWindowExt, WndExtX, WndExtY ) /* GDI.96 */
DC_GET_X_Y( DWORD, GetWindowOrg, WndOrgX, WndOrgY ) /* GDI.97 */
DC_GET_VAL( HRGN32, InquireVisRgn, hVisRgn ) /* GDI.131 */
DC_GET_X_Y( DWORD, GetBrushOrg, brushOrgX, brushOrgY ) /* GDI.149 */
DC_GET_VAL( HRGN32, GetClipRgn, hClipRgn ) /* GDI.173 */
DC_GET_VAL( WORD, GetTextAlign, textAlign ) /* GDI.345 */
DC_GET_VAL( HFONT16, GetCurLogFont, hFont ) /* GDI.411 */
DC_GET_VAL_EX( GetBrushOrgEx, brushOrgX, brushOrgY ) /* GDI.469 */
......@@ -95,3 +94,9 @@ DC_GET_VAL_EX( GetViewportExtEx, VportExtX, VportExtY ) /* GDI.472 */
DC_GET_VAL_EX( GetViewportOrgEx, VportOrgX, VportOrgY ) /* GDI.473 */
DC_GET_VAL_EX( GetWindowExtEx, WndExtX, WndExtY ) /* GDI.474 */
DC_GET_VAL_EX( GetWindowOrgEx, WndOrgX, WndOrgY ) /* GDI.475 */
/* this one is wrong - Windows returns region that
is relative to the device and not to the DC origin */
DC_GET_VAL( HRGN16, GetClipRgn16, hClipRgn ) /* GDI.173 */
......@@ -13,7 +13,7 @@
static const char PEN_dash[] = { 5,3 }; /* ----- ----- ----- */
static const char PEN_dot[] = { 2,2 }; /* -- -- -- -- -- -- */
static const char PEN_dot[] = { 1,1 }; /* -- -- -- -- -- -- */
static const char PEN_dashdot[] = { 4,3,2,3 }; /* ---- -- ---- -- */
static const char PEN_dashdotdot[] = { 4,2,2,2,2,2 }; /* ---- -- -- ---- */
......
......@@ -283,7 +283,7 @@ INT16 DrawText16( HDC16 hdc, LPCSTR str, INT16 i_count,
rect->right = rect->left + max_width;
rect->bottom = y;
}
return 1;
return y - rect->top;
}
......
......@@ -592,7 +592,7 @@ static LRESULT WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
{
BOOL update = TRUE;
RECT rect;
INT16 Min, Max;
INT Min, Max;
INT CurPos = GetScrollPos(hWnd, SB_VERT);
GetScrollRange(hWnd, SB_VERT, &Min, &Max);
GetClientRect(hWnd, &rect);
......
......@@ -60,20 +60,16 @@ HANDLE32 CreateFileMapping32A(HANDLE32 h,LPSECURITY_ATTRIBUTES ats,
SetLastError(ErrnoToLastError(errno));
return INVALID_HANDLE_VALUE;
}
hfile = _lcreat(lpName,1);
if(hfile == HFILE_ERROR) {
SetLastError(ErrnoToLastError(errno));
return INVALID_HANDLE_VALUE;
}
filemap_obj=(FILEMAP_OBJECT *)CreateKernelObject(sizeof(FILEMAP_OBJECT));
if(filemap_obj == NULL) {
_lclose(hfile);
SetLastError(ERROR_UNKNOWN);
return 0;
}
if (h==INVALID_HANDLE_VALUE)
h=_lcreat(lpName,1);/*FIXME*/
filemap_obj->common.magic = KERNEL_OBJECT_FILEMAP;
filemap_obj->hfile = hfile;
filemap_obj->hfile = h;
filemap_obj->prot = TranslateProtectionFlags(pot);
filemap_obj->size = hlow;
return (HANDLE32)filemap_obj;;
......@@ -97,7 +93,6 @@ HANDLE32 CreateFileMapping32W(HANDLE32 h,LPSECURITY_ATTRIBUTES ats,
/***********************************************************************
* MapViewOfFile (KERNEL32.385)
*
*/
LPVOID MapViewOfFile(HANDLE32 handle, DWORD access, DWORD offhi,
DWORD offlo, DWORD size)
......@@ -112,13 +107,25 @@ LPVOID MapViewOfFile(HANDLE32 handle, DWORD access, DWORD offhi,
LPVOID MapViewOfFileEx(HANDLE32 handle, DWORD access, DWORD offhi,
DWORD offlo, DWORD size, DWORD st)
{
if (!size) size = ((FILEMAP_OBJECT *)handle)->size;
return mmap ((caddr_t)st, size, ((FILEMAP_OBJECT *)handle)->prot,
FILEMAP_OBJECT *fmap = (FILEMAP_OBJECT*)handle;
if (!size) size = fmap->size;
if (!size) size = 1;
return mmap ((caddr_t)st, size, fmap->prot,
MAP_ANON|MAP_PRIVATE,
FILE_GetUnixHandle(((FILEMAP_OBJECT *)handle)->hfile),
FILE_GetUnixHandle(fmap->hfile),
offlo);
}
/***********************************************************************
* UnmapViewOfFile (KERNEL32.385)
*/
BOOL32 UnmapViewOfFile(LPVOID address) {
munmap(address,/*hmm*/1); /* FIXME: size? */
return TRUE;
}
/***********************************************************************
* GetFileInformationByHandle (KERNEL32.219)
......
......@@ -150,7 +150,7 @@ BOOL16 CreateCaret( HWND32 hwnd, HBITMAP32 bitmap, INT32 width, INT32 height )
Caret.x = 0;
Caret.y = 0;
Caret.timeout = GetProfileInt( "windows", "CursorBlinkRate", 750 );
Caret.timeout = GetProfileInt32A( "windows", "CursorBlinkRate", 750 );
return TRUE;
}
......
......@@ -282,7 +282,8 @@ HRGN32 DCE_GetVisRgn( HWND hwnd, WORD flags )
/* Get visible rectangle and create a region with it.
* do we really need to calculate vis rgns for X windows?
* - yes, to clip child windows.
* - yes, to clip child windows but we should skip
* siblings in this case.
*/
if (!wndPtr || !DCE_GetVisRect( wndPtr, !(flags & DCX_WINDOW), &rect ))
......@@ -377,7 +378,41 @@ static void DCE_SetDrawable( WND *wndPtr, DC *dc, WORD flags )
dc->u.x.drawable = wndPtr->window;
}
}
/***********************************************************************
* DCE_ExcludeRgn
*
* Translate given region from the wnd client to the DC coordinates
* and add it to the clipping region.
*/
INT16 DCE_ExcludeRgn( HDC32 hDC, WND* wnd, HRGN32 hRgn )
{
INT16 ret;
POINT32 pt = {0, 0};
HRGN32 hRgnClip = GetClipRgn16( hDC );
DCE *dce = firstDCE;
while (dce && (dce->hDC != hDC)) dce = dce->next;
if( dce )
{
MapWindowPoints32( wnd->hwndSelf, dce->hwndCurrent, &pt, 1);
if( dce->DCXflags & DCX_WINDOW )
{
wnd = WIN_FindWndPtr(dce->hwndCurrent);
pt.x += wnd->rectClient.left - wnd->rectWindow.left;
pt.y += wnd->rectClient.top - wnd->rectWindow.top;
}
}
else return ERROR;
OffsetRgn32(hRgn, pt.x, pt.y);
if( hRgnClip ) ret = CombineRgn32( hRgnClip, hRgnClip, hRgn, RGN_DIFF );
else
{
hRgnClip = InquireVisRgn( hDC );
ret = CombineRgn32( hRgn, hRgnClip, hRgn, RGN_DIFF );
SelectClipRgn32( hDC, hRgn );
}
return ret;
}
/***********************************************************************
* GetDCEx16 (USER.359)
......
......@@ -376,7 +376,7 @@ LRESULT DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
if (wParam && wndPtr->text)
{
lstrcpyn32A( (LPSTR)PTR_SEG_TO_LIN(lParam), wndPtr->text, wParam );
result = (LRESULT)strlen( (LPSTR)PTR_SEG_TO_LIN(lParam) ) + 1;
result = (LRESULT)strlen( (LPSTR)PTR_SEG_TO_LIN(lParam) );
}
break;
......@@ -442,7 +442,7 @@ LRESULT DefWindowProc32A( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
if (wParam && wndPtr->text)
{
lstrcpyn32A( (LPSTR)lParam, wndPtr->text, wParam );
result = (LRESULT)strlen( (LPSTR)lParam ) + 1;
result = (LRESULT)strlen( (LPSTR)lParam );
}
break;
......
......@@ -4,11 +4,13 @@
* Copyright 1993, 1994, 1996 Alexandre Julliard
*/
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "windows.h"
#include "dialog.h"
#include "drive.h"
#include "heap.h"
#include "win.h"
#include "ldt.h"
......@@ -16,6 +18,7 @@
#include "user.h"
#include "winproc.h"
#include "message.h"
#include "sysmetrics.h"
#include "stddebug.h"
#include "debug.h"
......@@ -534,8 +537,22 @@ static HWND DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
{
rect.left += template.x * xUnit / 4;
rect.top += template.y * yUnit / 8;
if ( !(template.style & DS_ABSALIGN) && !(template.style & WS_CHILD) )
ClientToScreen16( owner, (POINT16 *)&rect );
if ( !(template.style & WS_CHILD) )
{
INT16 dX, dY;
if( !(template.style & DS_ABSALIGN) )
ClientToScreen16( owner, (POINT16 *)&rect );
/* try to fit it into the desktop */
if( (dX = rect.left + rect.right + SYSMETRICS_CXDLGFRAME
- SYSMETRICS_CXSCREEN) > 0 ) rect.left -= dX;
if( (dY = rect.top + rect.bottom + SYSMETRICS_CYDLGFRAME
- SYSMETRICS_CYSCREEN) > 0 ) rect.top -= dY;
if( rect.left < 0 ) rect.left = 0;
if( rect.top < 0 ) rect.top = 0;
}
}
if (procType != WIN_PROC_16)
......@@ -569,6 +586,9 @@ static HWND DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
dlgInfo->msgResult = 0; /* This is used to store the default button id */
dlgInfo->hDialogHeap = 0;
if (dlgInfo->hUserFont)
SendMessage32A( hwnd, WM_SETFONT, (WPARAM32)dlgInfo->hUserFont, 0 );
/* Create controls */
if (!DIALOG_CreateControls( wndPtr, dlgTemplate, template.nbItems,
......@@ -581,8 +601,6 @@ static HWND DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
/* Send initialisation messages and set focus */
dlgInfo->hwndFocus = GetNextDlgTabItem32( hwnd, 0, FALSE );
if (dlgInfo->hUserFont)
SendMessage32A( hwnd, WM_SETFONT, (WPARAM32)dlgInfo->hUserFont, 0 );
if (SendMessage32A( hwnd, WM_INITDIALOG,
(WPARAM32)dlgInfo->hwndFocus, param ))
SetFocus32( dlgInfo->hwndFocus );
......@@ -1391,6 +1409,96 @@ static BOOL32 DIALOG_DlgDirSelect( HWND32 hwnd, LPSTR str, INT32 len,
/**********************************************************************
* DIALOG_DlgDirList
*
* Helper function for DlgDirList*
*/
static INT32 DIALOG_DlgDirList( HWND32 hDlg, LPCSTR spec, INT32 idLBox,
INT32 idStatic, UINT32 attrib, BOOL32 combo )
{
int drive;
HWND32 hwnd;
#define SENDMSG(msg,wparam,lparam) \
((attrib & DDL_POSTMSGS) ? PostMessage( hwnd, msg, wparam, lparam ) \
: SendMessage32A( hwnd, msg, wparam, lparam ))
dprintf_dialog( stddeb, "DlgDirList: %04x '%s' %d %d %04x\n",
hDlg, spec ? spec : "NULL", idLBox, idStatic, attrib );
if (spec && spec[0] && (spec[1] == ':'))
{
drive = toupper( spec[0] ) - 'A';
spec += 2;
if (!DRIVE_SetCurrentDrive( drive )) return FALSE;
}
else drive = DRIVE_GetCurrentDrive();
if (idLBox && ((hwnd = GetDlgItem( hDlg, idLBox )) != 0))
{
/* If the path exists and is a directory, chdir to it */
if (!spec || !spec[0] || DRIVE_Chdir( drive, spec )) spec = "*.*";
else
{
const char *p, *p2;
p = spec;
if ((p2 = strrchr( p, '\\' ))) p = p2 + 1;
if ((p2 = strrchr( p, '/' ))) p = p2 + 1;
if (p != spec)
{
BOOL32 ret = FALSE;
char *dir = HeapAlloc( SystemHeap, 0, p - spec );
if (dir)
{
lstrcpyn32A( dir, spec, p - spec );
ret = DRIVE_Chdir( drive, dir );
HeapFree( SystemHeap, 0, dir );
}
if (!ret) return FALSE;
spec = p;
}
}
dprintf_dialog( stddeb, "ListBoxDirectory: path=%c:\\%s mask=%s\n",
'A' + drive, DRIVE_GetDosCwd(drive), spec );
SENDMSG( combo ? CB_RESETCONTENT32 : LB_RESETCONTENT32, 0, 0 );
if ((attrib & DDL_DIRECTORY) && !(attrib & DDL_EXCLUSIVE))
{
if (SENDMSG( combo ? CB_DIR32 : LB_DIR32,
attrib & ~(DDL_DIRECTORY | DDL_DRIVES),
(LPARAM)spec ) == LB_ERR)
return FALSE;
if (SENDMSG( combo ? CB_DIR32 : LB_DIR32,
(attrib & (DDL_DIRECTORY | DDL_DRIVES)) | DDL_EXCLUSIVE,
(LPARAM)"*.*" ) == LB_ERR)
return FALSE;
}
else
{
if (SENDMSG( combo ? CB_DIR32 : LB_DIR32, attrib,
(LPARAM)spec ) == LB_ERR)
return FALSE;
}
}
if (idStatic && ((hwnd = GetDlgItem( hDlg, idStatic )) != 0))
{
char temp[512];
int drive = DRIVE_GetCurrentDrive();
strcpy( temp, "A:\\" );
temp[0] += drive;
lstrcpyn32A( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
AnsiLower( temp );
/* Can't use PostMessage() here, because the string is on the stack */
SetDlgItemText32A( hDlg, idStatic, temp );
}
return TRUE;
#undef SENDMSG
}
/**********************************************************************
* DlgDirSelect (USER.99)
*/
BOOL16 DlgDirSelect( HWND16 hwnd, LPSTR str, INT16 id )
......@@ -1460,3 +1568,73 @@ BOOL32 DlgDirSelectComboBoxEx32W( HWND32 hwnd, LPWSTR str, INT32 len, INT32 id)
{
return DIALOG_DlgDirSelect( hwnd, (LPSTR)str, len, id, TRUE, TRUE, TRUE );
}
/**********************************************************************
* DlgDirList16 (USER.100)
*/
INT16 DlgDirList16( HWND16 hDlg, LPCSTR spec, INT16 idLBox, INT16 idStatic,
UINT16 attrib )
{
return DIALOG_DlgDirList( hDlg, spec, idLBox, idStatic, attrib, FALSE );
}
/**********************************************************************
* DlgDirList32A (USER32.142)
*/
INT32 DlgDirList32A( HWND32 hDlg, LPCSTR spec, INT32 idLBox, INT32 idStatic,
UINT32 attrib )
{
return DIALOG_DlgDirList( hDlg, spec, idLBox, idStatic, attrib, FALSE );
}
/**********************************************************************
* DlgDirList32W (USER32.145)
*/
INT32 DlgDirList32W( HWND32 hDlg, LPCWSTR spec, INT32 idLBox, INT32 idStatic,
UINT32 attrib )
{
INT32 ret;
LPSTR specA = NULL;
if (spec) specA = STRING32_DupUniToAnsi(spec);
ret = DIALOG_DlgDirList( hDlg, specA, idLBox, idStatic, attrib, FALSE );
if (specA) free( specA );
return ret;
}
/**********************************************************************
* DlgDirListComboBox16 (USER.195)
*/
INT16 DlgDirListComboBox16( HWND16 hDlg, LPCSTR spec, INT16 idCBox,
INT16 idStatic, UINT16 attrib )
{
return DIALOG_DlgDirList( hDlg, spec, idCBox, idStatic, attrib, TRUE );
}
/**********************************************************************
* DlgDirListComboBox32A (USER32.143)
*/
INT32 DlgDirListComboBox32A( HWND32 hDlg, LPCSTR spec, INT32 idCBox,
INT32 idStatic, UINT32 attrib )
{
return DIALOG_DlgDirList( hDlg, spec, idCBox, idStatic, attrib, TRUE );
}
/**********************************************************************
* DlgDirListComboBox32W (USER32.144)
*/
INT32 DlgDirListComboBox32W( HWND32 hDlg, LPCWSTR spec, INT32 idCBox,
INT32 idStatic, UINT32 attrib )
{
INT32 ret;
LPSTR specA = NULL;
if (spec) specA = STRING32_DupUniToAnsi(spec);
ret = DIALOG_DlgDirList( hDlg, specA, idCBox, idStatic, attrib, FALSE );
if (specA) free( specA );
return ret;
}
......@@ -37,6 +37,7 @@
#include "shell.h"
#include "registers.h"
#include "xmalloc.h"
#include "keyboard.h"
#include "stddebug.h"
#include "debug.h"
#include "dde_proc.h"
......@@ -62,13 +63,9 @@ static XContext winContext = 0;
/* State variables */
BOOL MouseButtonsStates[NB_BUTTONS];
BOOL AsyncMouseButtonsStates[NB_BUTTONS];
BYTE KeyStateTable[256];
BYTE AsyncKeyStateTable[256];
BYTE InputKeyStateTable[256];
WPARAM16 lastEventChar = 0; /* this will have to be changed once
* ToAscii starts working */
static HWND32 captureWnd = 0;
static BOOL32 InputEnabled = TRUE;
......@@ -128,8 +125,8 @@ typedef union
unsigned long count : 16;
unsigned long code : 8;
unsigned long extended : 1;
unsigned long : 2;
unsigned long reserved : 2;
unsigned long unused : 2;
unsigned long win_internal : 2;
unsigned long context : 1;
unsigned long previous : 1;
unsigned long transition : 1;
......@@ -188,7 +185,7 @@ void EVENT_ProcessEvent( XEvent *event )
{
WND *pWnd;
if (XFindContext( display, ((XAnyEvent *)event)->window, winContext,
if (XFindContext( display, event->xany.window, winContext,
(char **)&pWnd ) != 0)
return; /* Not for a registered window */
......@@ -521,8 +518,16 @@ static void EVENT_key( XKeyEvent *event )
int ascii_chars = XLookupString(event, Str, 1, &keysym, &cs);
Str[ascii_chars] = '\0';
dprintf_key(stddeb,"WM_KEY??? : keysym=%lX, ascii chars=%u / %X / '%s'\n",
keysym, ascii_chars, Str[0], Str);
if (debugging_key)
{
char *ksname;
ksname = XKeysymToString(keysym);
if (!ksname)
ksname = "No Name";
fprintf(stddeb, "WM_KEY??? : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n",
keysym, ksname, ascii_chars, Str[0], Str);
}
/* Ctrl-Alt-Return enters the debugger */
if ((keysym == XK_Return) && (event->type == KeyPress) &&
......@@ -556,6 +561,27 @@ static void EVENT_key( XKeyEvent *event )
vkey = modifier_key[key - 0xE1];
else if (key == 0xFF) /* DEL key */
vkey = VK_DELETE;
/* extended must also be set for ALT_R, CTRL_R,
INS, DEL, HOME, END, PAGE_UP, PAGE_DOWN, ARROW keys,
keypad / and keypad ENTER (SDK 3.1 Vol.3 p 138) */
switch (keysym)
{
case XK_Control_R :
case XK_Alt_R :
case XK_Insert :
case XK_Delete :
case XK_Home :
case XK_End :
case XK_Page_Up :
case XK_Page_Down :
case XK_Left :
case XK_Up :
case XK_Right :
case XK_Down :
case XK_KP_Divide :
case XK_KP_Enter :
extended = 1;
}
}
else if (key_type == 0) /* character key */
{
......@@ -568,24 +594,7 @@ static void EVENT_key( XKeyEvent *event )
{
#define vkcase(k,val) case k: vkey = val; break;
#define vkcase2(k1,k2,val) case k1: case k2: vkey = val; break;
/* I wish I had a bit-paired keyboard! */
vkcase('!','1'); vkcase('@','2'); vkcase('#','3');
vkcase('$','4'); vkcase('%','5'); vkcase('^','6');
vkcase('&','7'); vkcase('*','8'); vkcase('(','9');
vkcase(')','0');
vkcase2('`','~',0xc0);
vkcase2('-','_',0xbd);
vkcase2('=','+',0xbb);
vkcase2('[','{',0xdb);
vkcase2(']','}',0xdd);
vkcase2(';',':',0xba);
vkcase2('\'','\"',0xde);
vkcase2(',','<',0xbc);
vkcase2('.','>',0xbe);
vkcase2('/','?',0xbf);
vkcase2('\\','|',0xdc);
WINE_VKEY_MAPPINGS
#undef vkcase
#undef vkcase2
default:
......@@ -596,50 +605,41 @@ static void EVENT_key( XKeyEvent *event )
if (event->type == KeyPress)
{
if (!(KeyStateTable[vkey] & 0x80))
KeyStateTable[vkey] ^= 0x01;
KeyStateTable[vkey] |= 0x80;
if (!(InputKeyStateTable[vkey] & 0x80))
InputKeyStateTable[vkey] ^= 0x01;
InputKeyStateTable[vkey] |= 0x80;
keylp.lp1.count = 1;
keylp.lp1.code = LOBYTE(event->keycode) - 8;
keylp.lp1.extended = (extended ? 1 : 0);
keylp.lp1.reserved = (ascii_chars ? 1 : 0);
keylp.lp1.win_internal = 0;
keylp.lp1.context = ( (event->state & Mod1Mask) ||
(KeyStateTable[VK_MENU] & 0x80)) ? 1 : 0;
(InputKeyStateTable[VK_MENU] & 0x80)) ? 1 : 0;
keylp.lp1.previous = (KeyDown ? 0 : 1);
keylp.lp1.transition = 0;
dprintf_key(stddeb," wParam=%X, lParam=%lX\n",
vkey, keylp.lp2 );
dprintf_key(stddeb," KeyState=%X\n", KeyStateTable[vkey]);
hardware_event( KeyStateTable[VK_MENU] & 0x80 ? WM_SYSKEYDOWN : WM_KEYDOWN,
dprintf_key(stddeb," InputKeyState=%X\n", InputKeyStateTable[vkey]);
hardware_event( InputKeyStateTable[VK_MENU] & 0x80 ? WM_SYSKEYDOWN : WM_KEYDOWN,
vkey, keylp.lp2,
event->x_root - desktopX, event->y_root - desktopY,
event->time - MSG_WineStartTicks, 0 );
KeyDown = TRUE;
/* Currently we use reserved field in the scan-code byte to
* make it possible for TranslateMessage to recognize character keys
* and get them from lastEventChar global variable.
*
* ToAscii should handle it.
*/
if( ascii_chars ) lastEventChar = Str[0];
}
else
{
UINT sysKey = KeyStateTable[VK_MENU];
UINT sysKey = InputKeyStateTable[VK_MENU];
KeyStateTable[vkey] &= ~0x80;
InputKeyStateTable[vkey] &= ~0x80;
keylp.lp1.count = 1;
keylp.lp1.code = LOBYTE(event->keycode) - 8;
keylp.lp1.extended = (extended ? 1 : 0);
keylp.lp1.reserved = 0;
keylp.lp1.win_internal = 0;
keylp.lp1.context = (event->state & Mod1Mask ? 1 : 0);
keylp.lp1.previous = 1;
keylp.lp1.transition = 1;
dprintf_key(stddeb," wParam=%X, lParam=%lX\n",
vkey, keylp.lp2 );
dprintf_key(stddeb," KeyState=%X\n", KeyStateTable[vkey]);
dprintf_key(stddeb," InputKeyState=%X\n", InputKeyStateTable[vkey]);
hardware_event( sysKey & 0x80 ? WM_SYSKEYUP : WM_KEYUP,
vkey, keylp.lp2,
event->x_root - desktopX, event->y_root - desktopY,
......
......@@ -834,7 +834,7 @@ void DrawFocusRect16( HDC16 hdc, const RECT16* rc )
{
RECT32 rect32;
CONV_RECT16TO32( rc, &rect32 );
return DrawFocusRect32( hdc, &rect32 );
DrawFocusRect32( hdc, &rect32 );
}
......
......@@ -133,7 +133,6 @@ static HANDLE16 HOOK_SetHook( INT16 id, HOOKPROC16 proc, HINSTANCE16 hInst,
data->ownerQueue = hQueue;
data->ownerModule = hInst;
data->inHookProc = 0;
dprintf_hook( stddeb, "Setting hook %d: ret=%04x\n", id, handle );
/* Insert it in the correct linked list */
......@@ -148,6 +147,8 @@ static HANDLE16 HOOK_SetHook( INT16 id, HOOKPROC16 proc, HINSTANCE16 hInst,
data->next = HOOK_systemHooks[id - WH_MINHOOK];
HOOK_systemHooks[id - WH_MINHOOK] = handle;
}
dprintf_hook( stddeb, "Setting hook %d: ret=%04x [next=%04x]\n",
id, handle, data->next );
return handle;
}
......@@ -188,7 +189,7 @@ static BOOL32 HOOK_RemoveHook( HANDLE16 hook )
while (*prevHook && *prevHook != hook)
prevHook = &((HOOKDATA *)USER_HEAP_LIN_ADDR(*prevHook))->next;
if (!*prevHook) return FALSE;
if (!*prevHook) return FALSE;
*prevHook = data->next;
USER_HEAP_FREE( hook );
return TRUE;
......@@ -251,6 +252,33 @@ LRESULT HOOK_CallHooks( INT16 id, INT16 code, WPARAM16 wParam, LPARAM lParam )
/***********************************************************************
* HOOK_ResetQueueHooks
*/
void HOOK_ResetQueueHooks( HQUEUE16 hQueue )
{
MESSAGEQUEUE *queue;
if ((queue = (MESSAGEQUEUE *)GlobalLock16( hQueue )) != NULL)
{
HOOKDATA* data;
HHOOK hook;
int id;
for( id = WH_MINHOOK; id <= WH_MAXHOOK; id++ )
{
hook = queue->hooks[id - WH_MINHOOK];
while( hook )
{
if( (data = (HOOKDATA *)USER_HEAP_LIN_ADDR(hook)) )
{
data->ownerQueue = hQueue;
hook = data->next;
} else break;
}
}
}
}
/***********************************************************************
* HOOK_FreeModuleHooks
*/
void HOOK_FreeModuleHooks( HMODULE16 hModule )
......
......@@ -3,47 +3,60 @@
*
* Copyright 1993 Bob Amstadt
*/
#include <stdio.h>
#include <string.h>
#include "win.h"
#include "windows.h"
#include "debug.h"
extern BOOL MouseButtonsStates[3];
extern BOOL AsyncMouseButtonsStates[3];
extern BYTE KeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
extern BYTE InputKeyStateTable[256];
BYTE AsyncKeyStateTable[256];
extern BYTE QueueKeyStateTable[256];
/**********************************************************************
* GetKeyState [USER.106]
* An application calls the GetKeyState function in response to a
* keyboard-input message. This function retrieves the state of the key
* at the time the input message was generated. (SDK 3.1 Vol 2. p 390)
*/
INT GetKeyState(INT keycode)
{
INT retval;
if (keycode >= 'a' && keycode <= 'z')
keycode += 'A' - 'a';
switch(keycode) {
case VK_LBUTTON:
return MouseButtonsStates[0];
retval = MouseButtonsStates[0];
case VK_MBUTTON:
return MouseButtonsStates[1];
retval = MouseButtonsStates[1];
case VK_RBUTTON:
return MouseButtonsStates[2];
retval = MouseButtonsStates[2];
default:
retval = ( (INT)(KeyStateTable[keycode] & 0x80) << 8 ) |
(INT)(KeyStateTable[keycode] & 0x01);
retval = ( (INT)(QueueKeyStateTable[keycode] & 0x80) << 8 ) |
(INT)(QueueKeyStateTable[keycode] & 0x01);
}
dprintf_key(stddeb, "GetKeyState(%x) -> %x\n", keycode, retval);
return retval;
}
/**********************************************************************
* GetKeyboardState [USER.222]
* An application calls the GetKeyboardState function in response to a
* keyboard-input message. This function retrieves the state of the keyboard
* at the time the input message was generated. (SDK 3.1 Vol 2. p 387)
*/
void GetKeyboardState(BYTE *lpKeyState)
{
if (lpKeyState != NULL) {
KeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] >> 8;
KeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] >> 8;
KeyStateTable[VK_RBUTTON] = MouseButtonsStates[2] >> 8;
memcpy(lpKeyState, KeyStateTable, 256);
QueueKeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] >> 8;
QueueKeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] >> 8;
QueueKeyStateTable[VK_RBUTTON] = MouseButtonsStates[2] >> 8;
memcpy(lpKeyState, QueueKeyStateTable, 256);
}
}
......@@ -53,10 +66,10 @@ void GetKeyboardState(BYTE *lpKeyState)
void SetKeyboardState(BYTE *lpKeyState)
{
if (lpKeyState != NULL) {
memcpy(KeyStateTable, lpKeyState, 256);
MouseButtonsStates[0] = KeyStateTable[VK_LBUTTON]? 0x8000: 0;
MouseButtonsStates[1] = KeyStateTable[VK_MBUTTON]? 0x8000: 0;
MouseButtonsStates[2] = KeyStateTable[VK_RBUTTON]? 0x8000: 0;
memcpy(QueueKeyStateTable, lpKeyState, 256);
MouseButtonsStates[0] = QueueKeyStateTable[VK_LBUTTON]? 0x8000: 0;
MouseButtonsStates[1] = QueueKeyStateTable[VK_MBUTTON]? 0x8000: 0;
MouseButtonsStates[2] = QueueKeyStateTable[VK_RBUTTON]? 0x8000: 0;
}
}
......@@ -92,13 +105,13 @@ int GetAsyncKeyState(int nKey)
break;
default:
retval = AsyncKeyStateTable[nKey] |
(KeyStateTable[nKey] ? 0x8000 : 0);
(InputKeyStateTable[nKey] ? 0x8000 : 0);
break;
}
memset( AsyncMouseButtonsStates, 0, 3 ); /* all states to false */
memset( AsyncKeyStateTable, 0, 256 );
dprintf_key(stddeb, "GetAsyncKeyState(%x) -> %x\n", nKey, retval);
return retval;
}
......@@ -32,16 +32,15 @@
#define HWND_BROADCAST16 ((HWND16)0xffff)
#define HWND_BROADCAST32 ((HWND32)0xffffffff)
#define ASCII_CHAR_HACK 0x0800
typedef enum { SYSQ_MSG_ABANDON, SYSQ_MSG_SKIP, SYSQ_MSG_ACCEPT } SYSQ_STATUS;
extern WPARAM16 lastEventChar; /* event.c */
extern BOOL MouseButtonsStates[3];
extern BOOL AsyncMouseButtonsStates[3];
extern BYTE KeyStateTable[256];
extern BYTE InputKeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
BYTE QueueKeyStateTable[256];
extern MESSAGEQUEUE *pCursorQueue; /* queue.c */
extern MESSAGEQUEUE *pActiveQueue;
......@@ -292,24 +291,10 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
SEGPTR_FREE(event);
}
/*****************************************************************
* MSG_JournalPlayBackIsAscii
*/
static BOOL MSG_JournalPlayBackIsAscii(WPARAM16 wParam)
{
return ((wParam>VK_HELP && wParam<VK_F1) ||
wParam == VK_SPACE ||
wParam == VK_ESCAPE ||
wParam == VK_RETURN ||
wParam == VK_TAB ||
wParam == VK_BACK);
}
/***********************************************************************
* MSG_JournalPlayBackMsg
*
* Get an EVENTMSG struct via call JOURNALPAYBACK hook function
* Get an EVENTMSG struct via call JOURNALPLAYBACK hook function
*/
static int MSG_JournalPlayBackMsg(void)
{
......@@ -332,29 +317,18 @@ static int MSG_JournalPlayBackMsg(void)
if (tmpMsg->message == WM_KEYDOWN || tmpMsg->message == WM_SYSKEYDOWN)
{
for (keyDown=i=0; i<256 && !keyDown; i++)
if (KeyStateTable[i] & 0x80)
if (InputKeyStateTable[i] & 0x80)
keyDown++;
if (!keyDown)
lParam |= 0x40000000;
AsyncKeyStateTable[wParam]=KeyStateTable[wParam] |= 0x80;
if (MSG_JournalPlayBackIsAscii(wParam))
{
lastEventChar= wParam; /* control TranslateMessage() */
lParam |= (LONG)((LONG)ASCII_CHAR_HACK*0x10000L);
if (!(KeyStateTable[VK_SHIFT] & 0x80) &&
!(KeyStateTable[VK_CAPITAL] & 0x80))
lastEventChar= tolower(lastEventChar);
if (KeyStateTable[VK_CONTROL] & 0x80)
lastEventChar&=0x1f;
}
AsyncKeyStateTable[wParam]=InputKeyStateTable[wParam] |= 0x80;
}
else /* WM_KEYUP, WM_SYSKEYUP */
{
lParam |= 0xC0000000;
AsyncKeyStateTable[wParam]=KeyStateTable[wParam] &= ~0x80;
AsyncKeyStateTable[wParam]=InputKeyStateTable[wParam] &= ~0x80;
}
if (KeyStateTable[VK_MENU] & 0x80)
if (InputKeyStateTable[VK_MENU] & 0x80)
lParam |= 0x20000000;
if (tmpMsg->paramH & 0x8000) /*special_key bit*/
lParam |= 0x01000000;
......@@ -373,9 +347,9 @@ static int MSG_JournalPlayBackMsg(void)
case WM_RBUTTONDOWN:MouseButtonsStates[2]=AsyncMouseButtonsStates[2]=1;break;
case WM_RBUTTONUP: MouseButtonsStates[2]=AsyncMouseButtonsStates[2]=0;break;
}
AsyncKeyStateTable[VK_LBUTTON]= KeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] << 8;
AsyncKeyStateTable[VK_MBUTTON]= KeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] << 8;
AsyncKeyStateTable[VK_RBUTTON]= KeyStateTable[VK_RBUTTON] = MouseButtonsStates[2] << 8;
AsyncKeyStateTable[VK_LBUTTON]= InputKeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] << 8;
AsyncKeyStateTable[VK_MBUTTON]= InputKeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] << 8;
AsyncKeyStateTable[VK_RBUTTON]= InputKeyStateTable[VK_RBUTTON] = MouseButtonsStates[2] << 8;
SetCursorPos(tmpMsg->paramL,tmpMsg->paramH);
lParam=MAKELONG(tmpMsg->paramL,tmpMsg->paramH);
wParam=0;
......@@ -644,7 +618,7 @@ static BOOL MSG_PeekMessage( LPMSG16 msg, HWND hwnd, WORD first, WORD last,
/* First handle a message put by SendMessage() */
if (msgQueue->wakeBits & QS_SENDMESSAGE)
while (msgQueue->wakeBits & QS_SENDMESSAGE)
QUEUE_ReceiveMessage( msgQueue );
/* Now handle a WM_QUIT message
......@@ -661,6 +635,7 @@ static BOOL MSG_PeekMessage( LPMSG16 msg, HWND hwnd, WORD first, WORD last,
msg->message = WM_QUIT;
msg->wParam = msgQueue->wExitCode;
msg->lParam = 0;
if( !peek ) msgQueue->wPostQMsg = 0;
break;
}
......@@ -695,7 +670,7 @@ static BOOL MSG_PeekMessage( LPMSG16 msg, HWND hwnd, WORD first, WORD last,
/* Check again for SendMessage */
if (msgQueue->wakeBits & QS_SENDMESSAGE)
while (msgQueue->wakeBits & QS_SENDMESSAGE)
QUEUE_ReceiveMessage( msgQueue );
/* Now find a WM_PAINT message */
......@@ -734,7 +709,7 @@ static BOOL MSG_PeekMessage( LPMSG16 msg, HWND hwnd, WORD first, WORD last,
if (!(flags & PM_NOYIELD))
{
UserYield();
if (msgQueue->wakeBits & QS_SENDMESSAGE)
while (msgQueue->wakeBits & QS_SENDMESSAGE)
QUEUE_ReceiveMessage( msgQueue );
}
if ((msgQueue->wakeBits & mask) & QS_TIMER)
......@@ -752,6 +727,21 @@ static BOOL MSG_PeekMessage( LPMSG16 msg, HWND hwnd, WORD first, WORD last,
}
/* We got a message */
if (flags & PM_REMOVE)
{
WORD message = msg->message;
if (message == WM_KEYDOWN || message == WM_SYSKEYDOWN)
{
BYTE *p = &QueueKeyStateTable[msg->wParam & 0xff];
if (!(*p & 0x80))
*p ^= 0x01;
*p |= 0x80;
}
else if (message == WM_KEYUP || message == WM_SYSKEYUP)
QueueKeyStateTable[msg->wParam & 0xff] &= ~0x80;
}
if (peek) return TRUE;
else return (msg->message != WM_QUIT);
}
......@@ -1013,7 +1003,7 @@ LRESULT SendMessage32A(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
if (WINPROC_MapMsg32ATo16( msg, wParam, &msg16, &wParam16, &lParam ) == -1)
return 0;
ret = SendMessage16( hwnd, msg16, wParam16, lParam );
WINPROC_UnmapMsg32ATo16( msg16, wParam16, lParam );
WINPROC_UnmapMsg32ATo16( msg, wParam16, lParam );
return ret;
}
......@@ -1088,32 +1078,42 @@ void WaitMessage( void )
/***********************************************************************
* TranslateMessage (USER.113)
*
* This should call ToAscii but it is currently broken
* TranlateMessage translate virtual-key messages into character-messages,
* as follows :
* WM_KEYDOWN/WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message.
* ditto replacing WM_* with WM_SYS*
* This produces WM_CHAR messages only for keys mapped to ASCII characters
* by the keyboard driver.
*/
BOOL TranslateMessage( LPMSG16 msg )
{
UINT message = msg->message;
/* BYTE wparam[2]; */
BYTE wparam[2];
if ((message == WM_KEYDOWN) || (message == WM_KEYUP) ||
(message == WM_SYSKEYDOWN) || (message == WM_SYSKEYUP))
if ((debugging_msg
&& message != WM_MOUSEMOVE && message != WM_TIMER)
|| (debugging_key
&& message >= WM_KEYFIRST && message <= WM_KEYLAST))
fprintf(stddeb, "TranslateMessage(%s, %04x, %08lx)\n",
SPY_GetMsgName(msg->message), msg->wParam, msg->lParam);
if ((message == WM_KEYDOWN) || (message == WM_SYSKEYDOWN))
{
dprintf_msg(stddeb, "Translating key %04x, scancode %04x\n", msg->wParam,
HIWORD(msg->lParam) );
if( HIWORD(msg->lParam) & ASCII_CHAR_HACK )
if (debugging_msg || debugging_key)
fprintf(stddeb, "Translating key %04x, scancode %04x\n",
msg->wParam, HIWORD(msg->lParam) );
/* if( ToAscii( msg->wParam, HIWORD(msg->lParam), (LPSTR)&KeyStateTable,
wparam, 0 ) )
*/
/* FIXME : should handle ToAscii yielding 2 */
if (ToAscii(msg->wParam, HIWORD(msg->lParam), (LPSTR)&QueueKeyStateTable,
wparam, 0))
{
message += 2 - (message & 0x0001);
/* Map WM_KEY* to WM_*CHAR */
message += 2 - (message & 0x0001);
PostMessage( msg->hwnd, message, lastEventChar, msg->lParam );
PostMessage( msg->hwnd, message, wparam[0], msg->lParam );
return TRUE;
return TRUE;
}
}
return FALSE;
......
......@@ -590,20 +590,28 @@ INT16 GetUpdateRgn( HWND32 hwnd, HRGN32 hrgn, BOOL32 erase )
*/
INT16 ExcludeUpdateRgn( HDC32 hdc, HWND32 hwnd )
{
INT32 retval = ERROR;
HRGN32 hrgn;
RECT16 rect;
WND * wndPtr;
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return ERROR;
if ((hrgn = CreateRectRgn32( 0, 0, 0, 0 )) != 0)
if (wndPtr->hrgnUpdate)
{
retval = CombineRgn32( hrgn, InquireVisRgn(hdc),
(wndPtr->hrgnUpdate>1) ? wndPtr->hrgnUpdate : 0,
(wndPtr->hrgnUpdate>1) ? RGN_DIFF : RGN_COPY );
if (retval) SelectVisRgn( hdc, hrgn );
INT16 ret;
HRGN32 hrgn = CreateRectRgn32(wndPtr->rectWindow.left - wndPtr->rectClient.left,
wndPtr->rectWindow.top - wndPtr->rectClient.top,
wndPtr->rectClient.right - wndPtr->rectClient.left,
wndPtr->rectClient.bottom - wndPtr->rectClient.top);
if( wndPtr->hrgnUpdate > 1 )
CombineRgn32(hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY);
/* do ugly coordinate translations in dce.c */
ret = DCE_ExcludeRgn( hdc, wndPtr, hrgn );
DeleteObject32( hrgn );
}
return retval;
return ret;
}
return GetClipBox16(hdc, &rect);
}
......@@ -5,10 +5,12 @@
*/
#include <stdlib.h>
#include <signal.h>
#include "module.h"
#include "queue.h"
#include "task.h"
#include "win.h"
#include "hook.h"
#include "stddebug.h"
#include "debug.h"
......@@ -22,6 +24,8 @@ static MESSAGEQUEUE *sysMsgQueue = NULL;
static MESSAGEQUEUE *pMouseQueue = NULL; /* Queue for last mouse message */
static MESSAGEQUEUE *pKbdQueue = NULL; /* Queue for last kbd message */
extern void SIGNAL_MaskAsyncEvents(BOOL32);
MESSAGEQUEUE *pCursorQueue = NULL;
MESSAGEQUEUE *pActiveQueue = NULL;
......@@ -137,6 +141,9 @@ static HQUEUE16 QUEUE_CreateMsgQueue( int size )
* QUEUE_DeleteMsgQueue
*
* Unlinks and deletes a message queue.
*
* Note: We need to mask asynchronous events to make sure PostMessage works
* even in the signal handler.
*/
BOOL32 QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
{
......@@ -165,6 +172,8 @@ BOOL32 QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
senderQ = sq->hPrevSendingTask;
}
SIGNAL_MaskAsyncEvents( TRUE );
pPrev = &hFirstQueue;
while (*pPrev && (*pPrev != hQueue))
{
......@@ -173,6 +182,9 @@ BOOL32 QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
}
if (*pPrev) *pPrev = msgQueue->next;
msgQueue->self = 0;
SIGNAL_MaskAsyncEvents( FALSE );
GlobalFree16( hQueue );
return 1;
}
......@@ -333,6 +345,39 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue )
dprintf_msg(stddeb,"ReceiveMessage: done!\n");
}
/***********************************************************************
* QUEUE_FlushMessage
*
* Try to reply to all pending sent messages on exit.
*/
void QUEUE_FlushMessages( HQUEUE16 hQueue )
{
MESSAGEQUEUE *queue = (MESSAGEQUEUE*)GlobalLock16( hQueue );
if( queue )
{
MESSAGEQUEUE *senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask);
QSMCTRL* CtrlPtr = queue->smResultCurrent;
while( senderQ )
{
if( !(queue->hSendingTask = senderQ->hPrevSendingTask) )
queue->wakeBits &= ~QS_SENDMESSAGE;
QUEUE_SetWakeBit( senderQ, QS_SMPARAMSFREE );
queue->smResultCurrent = CtrlPtr;
while( senderQ->wakeBits & QS_SMRESULT ) OldYield();
senderQ->SendMessageReturn = 0;
senderQ->smResult = queue->smResultCurrent;
QUEUE_SetWakeBit( senderQ, QS_SMRESULT);
if( (senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask)) )
CtrlPtr = senderQ->smResultInit;
}
queue->InSendMessageHandle = 0;
}
}
/***********************************************************************
* QUEUE_AddMsg
......@@ -344,12 +389,15 @@ BOOL32 QUEUE_AddMsg( HQUEUE16 hQueue, MSG16 * msg, DWORD extraInfo )
int pos;
MESSAGEQUEUE *msgQueue;
SIGNAL_MaskAsyncEvents( TRUE );
if (!(msgQueue = (MESSAGEQUEUE *)GlobalLock16( hQueue ))) return FALSE;
pos = msgQueue->nextFreeMessage;
/* Check if queue is full */
if ((pos == msgQueue->nextMessage) && (msgQueue->msgCount > 0))
{
SIGNAL_MaskAsyncEvents( FALSE );
fprintf(stderr,"MSG_AddMsg // queue is full !\n");
return FALSE;
}
......@@ -361,6 +409,9 @@ BOOL32 QUEUE_AddMsg( HQUEUE16 hQueue, MSG16 * msg, DWORD extraInfo )
else pos = 0;
msgQueue->nextFreeMessage = pos;
msgQueue->msgCount++;
SIGNAL_MaskAsyncEvents( FALSE );
QUEUE_SetWakeBit( msgQueue, QS_POSTMESSAGE );
return TRUE;
}
......@@ -403,6 +454,8 @@ int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND32 hwnd, int first, int last )
*/
void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos )
{
SIGNAL_MaskAsyncEvents( TRUE );
if (pos >= msgQueue->nextMessage)
{
for ( ; pos > msgQueue->nextMessage; pos--)
......@@ -420,6 +473,8 @@ void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos )
}
msgQueue->msgCount--;
if (!msgQueue->msgCount) msgQueue->wakeBits &= ~QS_POSTMESSAGE;
SIGNAL_MaskAsyncEvents( FALSE );
}
......@@ -633,12 +688,18 @@ BOOL SetMessageQueue( int size )
}
queuePtr = (MESSAGEQUEUE *)GlobalLock16( hNewQueue );
SIGNAL_MaskAsyncEvents( TRUE );
/* Copy data and free the old message queue */
if ((hQueue = GetTaskQueue(0)) != 0)
{
MESSAGEQUEUE *oldQ = (MESSAGEQUEUE *)GlobalLock16( hQueue );
memcpy( &queuePtr->reserved2, &oldQ->reserved2,
(int)oldQ->messages - (int)(&oldQ->reserved2) );
HOOK_ResetQueueHooks( hNewQueue );
if( WIN_GetDesktop()->hmemTaskQ == hQueue )
WIN_GetDesktop()->hmemTaskQ = hNewQueue;
WIN_ResetQueueWindows( WIN_GetDesktop()->child, hQueue, hNewQueue );
QUEUE_DeleteMsgQueue( hQueue );
}
......@@ -648,8 +709,9 @@ BOOL SetMessageQueue( int size )
hFirstQueue = hNewQueue;
if( !queuePtr->next ) pCursorQueue = queuePtr;
SetTaskQueue( 0, hNewQueue );
SIGNAL_MaskAsyncEvents( FALSE );
return TRUE;
}
......
......@@ -162,7 +162,7 @@ BOOL32 ScrollDC32( HDC32 hdc, INT32 dx, INT32 dy, const RECT32 *rc,
if( rectClip.left >= rectClip.right || rectClip.top >= rectClip.bottom )
return FALSE;
hrgnClip = GetClipRgn(hdc);
hrgnClip = GetClipRgn16(hdc);
hrgnScrollClip = CreateRectRgnIndirect32(&rectClip);
if( hrgnClip )
......
......@@ -137,7 +137,7 @@ void SYSCOLOR_Init(void)
for (i = 0, p = DefSysColors; i < NUM_SYS_COLORS; i++, p += 2)
{
GetProfileString( "colors", p[0], p[1], buffer, 100 );
GetProfileString32A( "colors", p[0], p[1], buffer, 100 );
if (!sscanf( buffer, " %d %d %d", &r, &g, &b )) r = g = b = 0;
SYSCOLOR_SetColor( i, RGB(r,g,b) );
}
......
......@@ -51,15 +51,15 @@ void SYSMETRICS_Init(void)
sysMetrics[SM_CYMIN] = SYSMETRICS_CYMIN;
sysMetrics[SM_CXSIZE] = SYSMETRICS_CXSIZE;
sysMetrics[SM_CYSIZE] = SYSMETRICS_CYSIZE;
sysMetrics[SM_CXFRAME] = GetProfileInt( "windows", "BorderWidth", 4 );
sysMetrics[SM_CXFRAME] = GetProfileInt32A( "windows", "BorderWidth", 4 );
sysMetrics[SM_CYFRAME] = sysMetrics[SM_CXFRAME];
sysMetrics[SM_CXMINTRACK] = SYSMETRICS_CXMINTRACK;
sysMetrics[SM_CYMINTRACK] = SYSMETRICS_CYMINTRACK;
sysMetrics[SM_CXDOUBLECLK] = (GetProfileInt( "windows","DoubleClickWidth", 4) + 1) & ~1;
sysMetrics[SM_CYDOUBLECLK] = (GetProfileInt( "windows","DoubleClickHeight", 4) + 1) & ~1;
sysMetrics[SM_CXICONSPACING] = GetProfileInt( "desktop","IconSpacing", 75);
sysMetrics[SM_CYICONSPACING] = GetProfileInt( "desktop","IconVerticalSpacing", 72);
sysMetrics[SM_MENUDROPALIGNMENT] = GetProfileInt( "windows","MenuDropAlignment", 0 );
sysMetrics[SM_CXDOUBLECLK] = (GetProfileInt32A( "windows","DoubleClickWidth", 4) + 1) & ~1;
sysMetrics[SM_CYDOUBLECLK] = (GetProfileInt32A( "windows","DoubleClickHeight", 4) + 1) & ~1;
sysMetrics[SM_CXICONSPACING] = GetProfileInt32A( "desktop","IconSpacing", 75);
sysMetrics[SM_CYICONSPACING] = GetProfileInt32A( "desktop","IconVerticalSpacing", 72);
sysMetrics[SM_MENUDROPALIGNMENT] = GetProfileInt32A( "windows","MenuDropAlignment", 0 );
sysMetrics[SM_PENWINDOWS] = 0;
sysMetrics[SM_DBCSENABLED] = 0;
sysMetrics[SM_CMETRICS] = SM_CMETRICS;
......
......@@ -374,24 +374,24 @@ static void WIN_DestroyWindow( WND* wndPtr )
USER_HEAP_FREE( hwnd );
}
/***********************************************************************
* WIN_DestroyQueueWindows
* WIN_ResetQueueWindows
*/
void WIN_DestroyQueueWindows( WND* wnd, HQUEUE16 hQueue )
void WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew )
{
WND* next;
while (wnd)
{
next = wnd->next;
if (wnd->hmemTaskQ == hQueue) DestroyWindow( wnd->hwndSelf );
else WIN_DestroyQueueWindows( wnd->child, hQueue );
if (wnd->hmemTaskQ == hQueue)
if( hNew ) wnd->hmemTaskQ = hNew;
else DestroyWindow( wnd->hwndSelf );
else WIN_ResetQueueWindows( wnd->child, hQueue, hNew );
wnd = next;
}
}
/***********************************************************************
* WIN_CreateDesktopWindow
*
......@@ -736,8 +736,12 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
}
else wndPtr->wIDmenu = (UINT)cs->hMenu;
/* Send the WM_CREATE message */
/* Send the WM_CREATE message
* Perhaps we shouldn't allow width/height changes as well.
* See p327 in "Internals".
*/
maxPos.x = wndPtr->rectWindow.left; maxPos.y = wndPtr->rectWindow.top;
if (unicode)
{
if (!SendMessage32W( hwnd, WM_NCCREATE, 0, (LPARAM)cs)) wmcreate = -1;
......@@ -745,6 +749,8 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
{
WINPOS_SendNCCalcSize( hwnd, FALSE, &wndPtr->rectWindow,
NULL, NULL, 0, &wndPtr->rectClient );
OffsetRect16(&wndPtr->rectWindow, maxPos.x - wndPtr->rectWindow.left,
maxPos.y - wndPtr->rectWindow.top);
wmcreate = SendMessage32W( hwnd, WM_CREATE, 0, (LPARAM)cs );
}
}
......@@ -755,6 +761,8 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
{
WINPOS_SendNCCalcSize( hwnd, FALSE, &wndPtr->rectWindow,
NULL, NULL, 0, &wndPtr->rectClient );
OffsetRect16(&wndPtr->rectWindow, maxPos.x - wndPtr->rectWindow.left,
maxPos.y - wndPtr->rectWindow.top);
wmcreate = SendMessage32A( hwnd, WM_CREATE, 0, (LPARAM)cs );
}
}
......@@ -799,7 +807,6 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
{
/* MinMaximize(hwnd, SW_SHOWMAXIMIZED, 1) */
POINT16 maxSize, maxPos, minTrack, maxTrack;
NC_GetMinMaxInfo( wndPtr, &maxSize, &maxPos, &minTrack, &maxTrack );
SetWindowPos( hwnd, 0, maxPos.x, maxPos.y, maxSize.x, maxSize.y,
((GetActiveWindow())? SWP_NOACTIVATE : 0) | SWP_FRAMECHANGED );
......
......@@ -964,6 +964,82 @@ INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
case BM_SETSTYLE32:
*pmsg16 = (UINT16)msg32 + (BM_GETCHECK16 - BM_GETCHECK32);
return 0;
case LB_CARETOFF32:
case LB_CARETON32:
case LB_DELETESTRING32:
case LB_GETANCHORINDEX32:
case LB_GETCARETINDEX32:
case LB_GETCOUNT32:
case LB_GETCURSEL32:
case LB_GETHORIZONTALEXTENT32:
case LB_GETITEMDATA32:
case LB_GETITEMHEIGHT32:
case LB_GETSEL32:
case LB_GETSELCOUNT32:
case LB_GETTEXTLEN32:
case LB_GETTOPINDEX32:
case LB_RESETCONTENT32:
case LB_SELITEMRANGE32:
case LB_SELITEMRANGEEX32:
case LB_SETANCHORINDEX32:
case LB_SETCARETINDEX32:
case LB_SETCOLUMNWIDTH32:
case LB_SETCURSEL32:
case LB_SETHORIZONTALEXTENT32:
case LB_SETITEMDATA32:
case LB_SETITEMHEIGHT32:
case LB_SETSEL32:
case LB_SETTOPINDEX32:
*pmsg16 = (UINT16)msg32 + (LB_ADDSTRING16 - LB_ADDSTRING32);
return 0;
case LB_ADDSTRING32:
case LB_FINDSTRING32:
case LB_FINDSTRINGEXACT32:
case LB_INSERTSTRING32:
case LB_SELECTSTRING32:
case LB_DIR32:
case LB_ADDFILE32:
/* case LB_GETTEXT32: FIXME */
{
LPSTR str = SEGPTR_STRDUP( (LPSTR)*plparam );
if (!str) return -1;
*plparam = (LPARAM)SEGPTR_GET(str);
}
*pmsg16 = (UINT16)msg32 + (LB_ADDSTRING16 - LB_ADDSTRING32);
return 1;
case LB_GETITEMRECT32:
{
RECT16 *rect;
rect = (RECT16 *)SEGPTR_ALLOC( sizeof(RECT16) + sizeof(LPARAM) );
if (!rect) return -1;
*(LPARAM *)(rect + 1) = *plparam; /* Store the previous lParam */
*plparam = (LPARAM)SEGPTR_GET(rect);
}
return 1;
case LB_GETSELITEMS32:
{
LPINT16 items;
*pwparam16 = (WPARAM16)MIN( wParam32, 0x7f80 ); /* Must be < 64K */
if (!(items = SEGPTR_ALLOC( *pwparam16 * sizeof(INT16)
+ sizeof(LPARAM)))) return -1;
*((LPARAM *)items)++ = *plparam; /* Store the previous lParam */
*plparam = (LPARAM)SEGPTR_GET(items);
}
return 1;
case LB_SETTABSTOPS32:
if (wParam32)
{
INT32 i;
LPINT16 stops;
*pwparam16 = (WPARAM16)MIN( wParam32, 0x7f80 ); /* Must be < 64K */
if (!(stops = SEGPTR_ALLOC( *pwparam16 * sizeof(INT16)
+ sizeof(LPARAM)))) return -1;
for (i = 0; i < *pwparam16; i++) stops[i] = *((LPINT32)*plparam+i);
*plparam = (LPARAM)SEGPTR_GET(stops);
return 1;
}
*pmsg16 = LB_SETTABSTOPS16;
return 0;
case WM_ACTIVATE:
case WM_CHARTOITEM:
case WM_COMMAND:
......@@ -1173,15 +1249,41 @@ INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
*
* Unmap a message that was mapped from 32-bit Ansi to 16-bit.
*/
void WINPROC_UnmapMsg32ATo16( UINT16 msg, WPARAM16 wParam, LPARAM lParam )
void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam, LPARAM lParam )
{
switch(msg)
{
case LB_ADDFILE32:
case LB_ADDSTRING32:
case LB_DIR32:
case LB_FINDSTRING32:
case LB_FINDSTRINGEXACT32:
case LB_INSERTSTRING32:
case LB_SELECTSTRING32:
case LB_SETTABSTOPS32:
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DRAWITEM:
case WM_SETTEXT:
SEGPTR_FREE( PTR_SEG_TO_LIN(lParam) );
break;
case LB_GETITEMRECT32:
{
RECT16 *rect = (RECT16 *)PTR_SEG_TO_LIN(lParam);
lParam = *(LPARAM *)(rect + 1);
CONV_RECT16TO32( rect, (RECT32 *)lParam );
SEGPTR_FREE( rect );
}
break;
case LB_GETSELITEMS32:
{
INT32 i;
LPINT16 items = (LPINT16)PTR_SEG_TO_LIN(lParam);
lParam = *((LPARAM *)items - 1);
for (i = 0; i < wParam; i++) *((LPINT32)lParam + i) = items[i];
SEGPTR_FREE( (LPARAM *)items - 1 );
}
break;
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT16 *mis = (MEASUREITEMSTRUCT16 *)PTR_SEG_TO_LIN(lParam);
......@@ -1242,9 +1344,6 @@ void WINPROC_UnmapMsg32ATo16( UINT16 msg, WPARAM16 wParam, LPARAM lParam )
SEGPTR_FREE( cs );
}
break;
case WM_SETTEXT:
SEGPTR_FREE( PTR_SEG_TO_LIN(lParam) );
break;
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
{
......@@ -1269,6 +1368,22 @@ INT32 WINPROC_MapMsg32WTo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
{
switch(msg32)
{
case LB_ADDSTRING32:
case LB_FINDSTRING32:
case LB_FINDSTRINGEXACT32:
case LB_INSERTSTRING32:
case LB_SELECTSTRING32:
case LB_DIR32:
case LB_ADDFILE32:
{
LPSTR str = SEGPTR_ALLOC( lstrlen32W((LPWSTR)*plparam) + 1 );
if (!str) return -1;
STRING32_UniToAnsi( str, (LPWSTR)*plparam );
*pmsg16 = (UINT16)msg32 + (LB_ADDSTRING16 - LB_ADDSTRING32);
*pwparam16 = (WPARAM16)LOWORD(wParam32);
*plparam = (LPARAM)SEGPTR_GET(str);
}
return 1;
case WM_NCCREATE:
case WM_CREATE:
{
......@@ -1344,7 +1459,7 @@ INT32 WINPROC_MapMsg32WTo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
*
* Unmap a message that was mapped from 32-bit Unicode to 16-bit.
*/
void WINPROC_UnmapMsg32WTo16( UINT16 msg, WPARAM16 wParam, LPARAM lParam )
void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM16 wParam, LPARAM lParam )
{
switch(msg)
{
......@@ -1461,7 +1576,7 @@ static LRESULT WINPROC_CallProc32ATo16( WNDPROC16 func, HWND32 hwnd,
if (wndPtr) CURRENT_DS = wndPtr->hInstance;
result = CallWndProc16( func, hwnd, msg16, wParam16, lParam );
CURRENT_DS = ds;
WINPROC_UnmapMsg32ATo16( msg16, wParam16, lParam );
WINPROC_UnmapMsg32ATo16( msg, wParam16, lParam );
return result;
}
......@@ -1486,7 +1601,7 @@ static LRESULT WINPROC_CallProc32WTo16( WNDPROC16 func, HWND32 hwnd,
if (wndPtr) CURRENT_DS = wndPtr->hInstance;
result = CallWndProc16( func, hwnd, msg16, wParam16, lParam );
CURRENT_DS = ds;
WINPROC_UnmapMsg32WTo16( msg16, wParam16, lParam );
WINPROC_UnmapMsg32WTo16( msg, wParam16, lParam );
return result;
}
......
......@@ -9,7 +9,7 @@ wine \- run Windows programs under Unix
]
.I program_name
[
.I arguments
.I program_name...
]
.SH DESCRIPTION
.B wine
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment