Commit e2bfa4c7 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 960516

Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
parent 1285c2f9
This is release 960506 of Wine the MS Windows emulator. This is still a
This is release 960516 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960506: (see ChangeLog for details)
- Moveable and discardable blocks in local heap.
- Comboboxes improvements.
- Winhelp clone using Winelib.
WHAT'S NEW with Wine-960516: (see ChangeLog for details)
- Tons of Win32 support.
- Several local heap fixes.
- Window management improvements.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960506.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960506.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960506.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960506.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960516.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960516.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960516.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960516.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [*/*.c]
Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and
SIZE16. Implemented Win32 version of most functions that take
these types as parameters.
* [configure]
Patched autoconf to attempt to correctly detect -lnsl and
-lsocket. Please check this out.
* [controls/button.c]
Added support for Win32 BM_* messages.
* [controls/menu.c]
Avoid sending extra WM_MENUSELECT messages. This avoids crashes
with Excel.
* [memory.heap.c] [include/heap.h]
Added support for SEGPTRs in Win32 heaps. Added a few macros to
make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR,
but they work with Win32.
* [memory/atom.c]
Implemented Win32 atom functions.
* [memory/local.c]
Fixed LocalReAlloc() changes to avoid copying the whole block twice.
* [win32/memory.c]
Use /dev/zero instead of MAP_ANON for VirtualAlloc().
* [windows/class.c]
Properly implemented the Win32 class functions.
* [windows/winproc.c] (New file)
New file handling the message translation between Win16 and Win32.
Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/mdi.c] [windows/menu.c]
Improved WM_MDICREATE and WM_MDICASCADE handling.
* [windows/event.c] [objects/bitblt.c]
Handle GraphicsExpose event for BitBlt from screen to screen.
* [windows/event.c] [windows/win.c] [windows/nonclient.c]
Bunch of fixes for problems with -managed.
* [windows/win.c] [windows/winpos.c]
Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO
in CreateWindow.
* [windows/win.c] [windows/queue.c] [misc/user.c]
Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL
on window creation/destruction.
* [objects/palette.c]
Crude RealizePalette(). At least something is visible in LviewPro.
Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/gdi32.spec]
Added Rectangle (use win16 version).
* [if1632/kernel32.spec]
Added GetWindowsDirectoryA (use win16 GetWindowsDirectory).
* [if1632/user32.spec]
Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16
versions).
Added SetWindowsHookExA (empty stub for now).
* [include/handle32.h]
Changed #include <malloc.h> to #include <stdlib.h> to prevent
hate message from FreeBSD compiler.
* [win32/newfns.c]
Added new function SetWindowsHookEx32A (empty stub for now).
* [win32/user32.c]
Removed redundant debugging printf statement.
Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [memory/local.c]
Avoid creating adjacent free blocks.
Free the block in LocalReAlloc() before allocating a new one.
Fixed LocalReAlloc() for discarded blocks.
Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [resources/sysres_Fi.rc]
ChooseFont and ChooseColor dialogs updated.
Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c,if1632/kernel.spec]
GetCurrentDirectory(),SetCurrentDirectory() implemented.
* [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec]
[include/windows.h] [include/winreg.h] [loader/main.c]
[misc/main.c] [misc/shell.c] [misc/registry.c]
Registry fixes:
- loads win95 registry databases,
- save only updated keys on default,
- now adhers to the new function naming standard,
- minor cleanups.
Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de>
* [combo.c]
Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX
and synchronized mine with Greg Kreider's works.
* [commdlg.c]
Bugfix in ChooseFont: font size handling.
----------------------------------------------------------------------
Mon May 6 12:56:26 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [DEVELOPERS-HINTS]
......
......@@ -25,6 +25,11 @@ To build Wine, first do a "./configure" and then a "make depend; make".
The executable "wine" will be built. "wine" will load and run 16-bit
Windows executables.
To build Winelib, do a "./configure --with-library", and then a "make
depend; make". The library "winelib.a" will be built, allowing to
compile Windows source code under Unix. If you have an ELF compiler,
you can use "./configure --with-dll" instead to build a shared library.
To upgrade to a new release by using a patch file, first cd to the
top-level directory of the release (the one containing this README
file). Then do a "make clean", and patch the release with:
......
......@@ -78,8 +78,8 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename )
*/
static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
{
RECT rect;
GetClientRect( hwnd, &rect );
RECT16 rect;
GetClientRect16( hwnd, &rect );
/* Paint desktop pattern (only if wall paper does not cover everything) */
......@@ -90,7 +90,7 @@ static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
/* Set colors in case pattern is a monochrome bitmap */
SetBkColor( hdc, RGB(0,0,0) );
SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) );
FillRect( hdc, &rect, infoPtr->hbrushPattern );
FillRect16( hdc, &rect, infoPtr->hbrushPattern );
}
/* Paint wall paper */
......
......@@ -125,7 +125,7 @@ static void EDIT_DelLeft(WND *wndPtr);
static void EDIT_DelRight(WND *wndPtr);
static UINT EDIT_GetAveCharWidth(WND *wndPtr);
static UINT EDIT_GetLineHeight(WND *wndPtr);
static void EDIT_GetLineRect(WND *wndPtr, UINT line, UINT scol, UINT ecol, LPRECT rc);
static void EDIT_GetLineRect(WND *wndPtr, UINT line, UINT scol, UINT ecol, LPRECT16 rc);
static char * EDIT_GetPointer(WND *wndPtr);
static LRESULT EDIT_GetRect(WND *wndPtr, WPARAM wParam, LPARAM lParam);
static BOOL EDIT_GetRedraw(WND *wndPtr);
......@@ -725,7 +725,7 @@ static UINT EDIT_GetLineHeight(WND *wndPtr)
* column to an ending column.
*
*/
static void EDIT_GetLineRect(WND *wndPtr, UINT line, UINT scol, UINT ecol, LPRECT rc)
static void EDIT_GetLineRect(WND *wndPtr, UINT line, UINT scol, UINT ecol, LPRECT16 rc)
{
rc->top = EDIT_WndYFromLine(wndPtr, line);
rc->bottom = rc->top + EDIT_GetLineHeight(wndPtr);
......@@ -764,7 +764,7 @@ static char *EDIT_GetPointer(WND *wndPtr)
*/
static LRESULT EDIT_GetRect(WND *wndPtr, WPARAM wParam, LPARAM lParam)
{
GetClientRect(wndPtr->hwndSelf, (LPRECT)lParam);
GetClientRect16( wndPtr->hwndSelf, (LPRECT16)lParam );
return 0L;
}
......@@ -802,7 +802,7 @@ static UINT EDIT_GetTextWidth(WND *wndPtr)
*/
static UINT EDIT_GetVisibleLineCount(WND *wndPtr)
{
RECT rc;
RECT16 rc;
EDIT_GetRect(wndPtr, 0, (LPARAM)&rc);
return MAX(1, MAX(rc.bottom - rc.top, 0) / EDIT_GetLineHeight(wndPtr));
......@@ -816,7 +816,7 @@ static UINT EDIT_GetVisibleLineCount(WND *wndPtr)
*/
static UINT EDIT_GetWndWidth(WND *wndPtr)
{
RECT rc;
RECT16 rc;
EDIT_GetRect(wndPtr, 0, (LPARAM)&rc);
return rc.right - rc.left;
......@@ -855,9 +855,9 @@ static void EDIT_InvalidateText(WND *wndPtr, UINT start, UINT end)
UINT el;
UINT sc;
UINT ec;
RECT rcWnd;
RECT rcLine;
RECT rcUpdate;
RECT16 rcWnd;
RECT16 rcLine;
RECT16 rcUpdate;
UINT l;
if (end == start )
......@@ -885,26 +885,26 @@ static void EDIT_InvalidateText(WND *wndPtr, UINT start, UINT end)
EDIT_GetRect(wndPtr, 0, (LPARAM)&rcWnd);
if (sl == el) {
EDIT_GetLineRect(wndPtr, sl, sc, ec, &rcLine);
if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect(wndPtr->hwndSelf, &rcUpdate, FALSE);
if (IntersectRect16(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect16( wndPtr->hwndSelf, &rcUpdate, FALSE );
} else {
EDIT_GetLineRect(wndPtr, sl, sc,
(UINT)EDIT_EM_LineLength(wndPtr,
(UINT)EDIT_EM_LineIndex(wndPtr, sl, 0L), 0L),
&rcLine);
if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect(wndPtr->hwndSelf, &rcUpdate, FALSE);
if (IntersectRect16(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect16( wndPtr->hwndSelf, &rcUpdate, FALSE );
for (l = sl + 1 ; l < el ; l++) {
EDIT_GetLineRect(wndPtr, l, 0,
(UINT)EDIT_EM_LineLength(wndPtr,
(UINT)EDIT_EM_LineIndex(wndPtr, l, 0L), 0L),
&rcLine);
if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect(wndPtr->hwndSelf, &rcUpdate, FALSE);
if (IntersectRect16(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect16(wndPtr->hwndSelf, &rcUpdate, FALSE);
}
EDIT_GetLineRect(wndPtr, el, 0, ec, &rcLine);
if (IntersectRect(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect(wndPtr->hwndSelf, &rcUpdate, FALSE);
if (IntersectRect16(&rcUpdate, &rcWnd, &rcLine))
InvalidateRect16( wndPtr->hwndSelf, &rcUpdate, FALSE );
}
}
......@@ -1348,7 +1348,7 @@ static LRESULT EDIT_ReplaceSel(WND *wndPtr, WPARAM wParam, LPARAM lParam)
EDIT_NOTIFY_PARENT(wndPtr, EN_UPDATE);
EDIT_WM_SetRedraw(wndPtr, redraw, 0L);
if (redraw) {
InvalidateRect(wndPtr->hwndSelf, NULL, TRUE);
InvalidateRect32( wndPtr->hwndSelf, NULL, TRUE );
EDIT_NOTIFY_PARENT(wndPtr, EN_CHANGE);
}
return 0L;
......@@ -1805,7 +1805,7 @@ static LRESULT EDIT_EM_LineScroll(WND *wndPtr, WPARAM wParam, LPARAM lParam)
UINT tw = EDIT_GetTextWidth(wndPtr);
INT dx;
INT dy;
POINT pos;
POINT16 pos;
HRGN hRgn;
if (nfv >= lc)
......@@ -1823,7 +1823,7 @@ static LRESULT EDIT_EM_LineScroll(WND *wndPtr, WPARAM wParam, LPARAM lParam)
GetUpdateRgn(wndPtr->hwndSelf, hRgn, FALSE);
ValidateRgn(wndPtr->hwndSelf, 0);
OffsetRgn(hRgn, dx, dy);
InvalidateRgn(wndPtr->hwndSelf, hRgn, TRUE);
InvalidateRgn( wndPtr->hwndSelf, hRgn, TRUE );
DeleteObject(hRgn);
ScrollWindow(wndPtr->hwndSelf, dx, dy, NULL, NULL);
}
......@@ -1836,7 +1836,7 @@ static LRESULT EDIT_EM_LineScroll(WND *wndPtr, WPARAM wParam, LPARAM lParam)
SetScrollPos(wndPtr->hwndSelf, SB_HORZ,
EDIT_WM_HScroll(wndPtr, EM_GETTHUMB, 0L), TRUE);
if (wndPtr->hwndSelf == GetFocus()) {
GetCaretPos(&pos);
GetCaretPos16(&pos);
SetCaretPos(pos.x + dx, pos.y + dy);
ShowCaret(wndPtr->hwndSelf);
}
......@@ -1894,7 +1894,7 @@ static LRESULT EDIT_EM_SetHandle(WND *wndPtr, WPARAM wParam, LPARAM lParam)
EDIT_EM_SetModify(wndPtr, FALSE, 0L);
EDIT_BuildLineDefs(wndPtr);
if (EDIT_GetRedraw(wndPtr))
InvalidateRect(wndPtr->hwndSelf, NULL, TRUE);
InvalidateRect32( wndPtr->hwndSelf, NULL, TRUE );
EDIT_ScrollIntoView(wndPtr);
}
return 0L;
......@@ -2130,7 +2130,7 @@ static LRESULT EDIT_WM_Clear(WND *wndPtr, WPARAM wParam, LPARAM lParam)
EDIT_NOTIFY_PARENT(wndPtr, EN_UPDATE);
EDIT_WM_SetRedraw(wndPtr, redraw, 0L);
if (redraw) {
InvalidateRect(wndPtr->hwndSelf, NULL, TRUE);
InvalidateRect32( wndPtr->hwndSelf, NULL, TRUE );
EDIT_NOTIFY_PARENT(wndPtr, EN_CHANGE);
}
}
......@@ -2179,7 +2179,7 @@ static LRESULT EDIT_WM_Copy(WND *wndPtr, WPARAM wParam, LPARAM lParam)
*/
static LRESULT EDIT_WM_Create(WND *wndPtr, WPARAM wParam, LPARAM lParam)
{
CREATESTRUCT *cs = (CREATESTRUCT *)PTR_SEG_TO_LIN(lParam);
CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
EDITSTATE *es;
char *text;
......@@ -2207,7 +2207,8 @@ static LRESULT EDIT_WM_Create(WND *wndPtr, WPARAM wParam, LPARAM lParam)
es->PasswordChar = (cs->style & ES_PASSWORD) ? '*' : '\0';
}
if (!LOCAL_HeapSize(wndPtr->hInstance)) {
if (!LocalInit(wndPtr->hInstance, 0, GlobalSize(wndPtr->hInstance))) {
if (!LocalInit(wndPtr->hInstance, 0,
GlobalSize16(wndPtr->hInstance))) {
fprintf(stderr, "edit: WM_CREATE: could not initialize local heap\n");
return -1L;
}
......@@ -2282,22 +2283,22 @@ static LRESULT EDIT_WM_Enable(WND *wndPtr, WPARAM wParam, LPARAM lParam)
static LRESULT EDIT_WM_EraseBkGnd(WND *wndPtr, WPARAM wParam, LPARAM lParam)
{
HBRUSH hBrush;
RECT rc;
RECT16 rc;
hBrush = (HBRUSH)EDIT_SEND_CTLCOLOR(wndPtr, wParam);
if (!hBrush)
hBrush = (HBRUSH)GetStockObject(WHITE_BRUSH);
GetClientRect(wndPtr->hwndSelf, &rc);
GetClientRect16(wndPtr->hwndSelf, &rc);
IntersectClipRect((HDC)wParam, rc.left, rc.top, rc.right, rc.bottom);
GetClipBox((HDC)wParam, &rc);
GetClipBox16((HDC)wParam, &rc);
/*
* FIXME: specs say that we should UnrealizeObject() the brush,
* but the specs of UnrealizeObject() say that we shouldn't
* unrealize a stock object. The default brush that
* DefWndProc() returns is ... a stock object.
*/
FillRect((HDC)wParam, &rc, hBrush);
FillRect16((HDC)wParam, &rc, hBrush);
return -1L;
}
......@@ -2642,23 +2643,23 @@ static LRESULT EDIT_WM_MouseMove(WND *wndPtr, WPARAM wParam, LPARAM lParam)
*/
static LRESULT EDIT_WM_Paint(WND *wndPtr, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
PAINTSTRUCT16 ps;
UINT i;
UINT fv = (UINT)EDIT_EM_GetFirstVisibleLine(wndPtr, 0, 0L);
UINT vlc = EDIT_GetVisibleLineCount(wndPtr);
UINT lc = (UINT)EDIT_EM_GetLineCount(wndPtr, 0, 0L);
HDC hdc;
HDC16 hdc;
HFONT hFont;
HFONT oldFont = 0;
RECT rc;
RECT rcLine;
RECT rcRgn;
RECT16 rc;
RECT16 rcLine;
RECT16 rcRgn;
BOOL rev = IsWindowEnabled(wndPtr->hwndSelf) &&
((GetFocus() == wndPtr->hwndSelf) ||
(wndPtr->dwStyle & ES_NOHIDESEL));
hdc = BeginPaint(wndPtr->hwndSelf, &ps);
GetClientRect(wndPtr->hwndSelf, &rc);
hdc = BeginPaint16(wndPtr->hwndSelf, &ps);
GetClientRect16(wndPtr->hwndSelf, &rc);
IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom);
hFont = EDIT_WM_GetFont(wndPtr, 0, 0L);
if (hFont)
......@@ -2666,15 +2667,15 @@ static LRESULT EDIT_WM_Paint(WND *wndPtr, WPARAM wParam, LPARAM lParam)
EDIT_SEND_CTLCOLOR(wndPtr, hdc);
if (!IsWindowEnabled(wndPtr->hwndSelf))
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
GetClipBox(hdc, &rcRgn);
GetClipBox16(hdc, &rcRgn);
for (i = fv ; i <= MIN(fv + vlc, fv + lc - 1) ; i++ ) {
EDIT_GetLineRect(wndPtr, i, 0, -1, &rcLine);
if (IntersectRect(&rc, &rcRgn, &rcLine))
if (IntersectRect16(&rc, &rcRgn, &rcLine))
EDIT_PaintLine(wndPtr, hdc, i, rev);
}
if (hFont)
SelectObject(hdc, oldFont);
EndPaint(wndPtr->hwndSelf, &ps);
EndPaint16(wndPtr->hwndSelf, &ps);
return 0L;
}
......@@ -2760,7 +2761,7 @@ static LRESULT EDIT_WM_SetFont(WND *wndPtr, WPARAM wParam, LPARAM lParam)
ReleaseDC(wndPtr->hwndSelf, hdc);
EDIT_BuildLineDefs(wndPtr);
if ((BOOL)lParam && EDIT_GetRedraw(wndPtr))
InvalidateRect(wndPtr->hwndSelf, NULL, TRUE);
InvalidateRect32( wndPtr->hwndSelf, NULL, TRUE );
if (wndPtr->hwndSelf == GetFocus()) {
DestroyCaret();
CreateCaret(wndPtr->hwndSelf, 0, 2, EDIT_GetLineHeight(wndPtr));
......@@ -2815,7 +2816,7 @@ static LRESULT EDIT_WM_Size(WND *wndPtr, WPARAM wParam, LPARAM lParam)
(wParam == SIZE_RESTORED))) {
if (IsMultiLine(wndPtr) && IsWordWrap(wndPtr))
EDIT_BuildLineDefs(wndPtr);
InvalidateRect(wndPtr->hwndSelf, NULL, TRUE);
InvalidateRect32( wndPtr->hwndSelf, NULL, TRUE );
}
return 0L;
}
......
......@@ -146,7 +146,7 @@ static SCROLLINFO *SCROLL_GetScrollInfo( HWND hwnd, int nBar )
* the thumb relative to the left or to the top.
* Return TRUE if the scrollbar is vertical, FALSE if horizontal.
*/
static BOOL SCROLL_GetScrollBarRect( HWND hwnd, int nBar, RECT *lprect,
static BOOL SCROLL_GetScrollBarRect( HWND hwnd, int nBar, RECT16 *lprect,
WORD *arrowSize, WORD *thumbPos )
{
int pixels;
......@@ -172,7 +172,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, int nBar, RECT *lprect,
break;
case SB_CTL:
GetClientRect( hwnd, lprect );
GetClientRect16( hwnd, lprect );
vertical = ((wndPtr->dwStyle & SBS_VERT) != 0);
break;
......@@ -215,7 +215,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, int nBar, RECT *lprect,
* Compute the current scroll position based on the thumb position in pixels
* from the top of the scroll-bar.
*/
static UINT SCROLL_GetThumbVal( SCROLLINFO *infoPtr, RECT *rect,
static UINT SCROLL_GetThumbVal( SCROLLINFO *infoPtr, RECT16 *rect,
BOOL vertical, WORD pos )
{
int pixels = vertical ? rect->bottom-rect->top : rect->right-rect->left;
......@@ -237,14 +237,14 @@ static UINT SCROLL_GetThumbVal( SCROLLINFO *infoPtr, RECT *rect,
*
* Scroll-bar hit testing (don't confuse this with WM_NCHITTEST!).
*/
static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, int nBar, POINT pt )
static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, int nBar, POINT16 pt )
{
WORD arrowSize, thumbPos;
RECT rect;
RECT16 rect;
BOOL vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect,
&arrowSize, &thumbPos );
if (!PtInRect( &rect, pt )) return SCROLL_NOWHERE;
if (!PtInRect16( &rect, pt )) return SCROLL_NOWHERE;
if (vertical)
{
......@@ -274,7 +274,7 @@ static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, int nBar, POINT pt )
*
* Draw the scroll bar arrows.
*/
static void SCROLL_DrawArrows( HDC hdc, SCROLLINFO *infoPtr, RECT *rect,
static void SCROLL_DrawArrows( HDC hdc, SCROLLINFO *infoPtr, RECT16 *rect,
WORD arrowSize, BOOL vertical,
BOOL top_pressed, BOOL bottom_pressed )
{
......@@ -315,10 +315,10 @@ static void SCROLL_DrawArrows( HDC hdc, SCROLLINFO *infoPtr, RECT *rect,
*
* Draw the moving thumb rectangle.
*/
static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
static void SCROLL_DrawMovingThumb( HDC hdc, RECT16 *rect, BOOL vertical,
WORD arrowSize, WORD thumbPos )
{
RECT r = *rect;
RECT16 r = *rect;
if (vertical)
{
r.top += thumbPos;
......@@ -335,8 +335,8 @@ static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
r.left = rect->right - arrowSize - SYSMETRICS_CXVSCROLL - 1;
r.right = r.left + SYSMETRICS_CXVSCROLL + 1;
}
InflateRect( &r, -1, -1 );
DrawFocusRect( hdc, &r );
InflateRect16( &r, -1, -1 );
DrawFocusRect16( hdc, &r );
}
......@@ -345,12 +345,12 @@ static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
*
* Draw the scroll bar interior (everything except the arrows).
*/
static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT16 *rect,
WORD arrowSize, WORD thumbPos, WORD flags,
BOOL vertical, BOOL top_selected,
BOOL bottom_selected )
{
RECT r;
RECT16 r;
/* Select the correct brush and pen */
......@@ -438,7 +438,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
SelectObject( hdc, sysColorObjects.hbrushBtnFace );
Rectangle( hdc, r.left, r.top, r.right, r.bottom );
InflateRect( &r, -1, -1 );
InflateRect16( &r, -1, -1 );
GRAPH_DrawReliefRect( hdc, &r, 1, 2, FALSE );
if ((hwndTracking == hwnd) && (nBarTracking == nBar))
SCROLL_DrawMovingThumb( hdc, rect, vertical, arrowSize, uTrackingPos);
......@@ -453,7 +453,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT *rect,
void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar )
{
WORD arrowSize, thumbPos;
RECT rect;
RECT16 rect;
BOOL vertical;
WND *wndPtr = WIN_FindWndPtr( hwnd );
SCROLLINFO *infoPtr = SCROLL_GetPtrScrollInfo( wndPtr, nBar );
......@@ -483,7 +483,7 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar )
static void SCROLL_RefreshScrollBar( HWND hwnd, int nBar )
{
WORD arrowSize, thumbPos;
RECT rect;
RECT16 rect;
BOOL vertical;
HDC hdc;
WND *wndPtr = WIN_FindWndPtr( hwnd );
......@@ -543,10 +543,10 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WORD wParam )
* 'pt' is the location of the mouse event in client (for SB_CTL) or
* windows coordinates.
*/
void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
{
/* Previous mouse position for timer events */
static POINT prevPt;
static POINT16 prevPt;
/* Hit test code of the last button-down event */
static enum SCROLL_HITTEST trackHitTest;
/* Thumb position when tracking started. */
......@@ -560,7 +560,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
HWND hwndOwner, hwndCtl;
BOOL vertical;
WORD arrowSize, thumbPos;
RECT rect;
RECT16 rect;
HDC hdc;
SCROLLINFO *infoPtr = SCROLL_GetScrollInfo( hwnd, nBar );
......@@ -675,7 +675,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
{
UINT pos, val;
if (!PtInRect( &rect, pt )) pos = lastClickPos;
if (!PtInRect16( &rect, pt )) pos = lastClickPos;
else pos = vertical ? (pt.y - rect.top) : (pt.x - rect.left);
if (pos != lastMousePos)
{
......@@ -779,15 +779,11 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT pt )
*/
LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
{
POINT Pt;
Pt.x = LOWORD(lParam); Pt.y = HIWORD(lParam);
/* ^ Can't use MAKEPOINT macro in WINELIB32 */
switch(message)
{
case WM_CREATE:
{
CREATESTRUCT *lpCreat = (CREATESTRUCT *)PTR_SEG_TO_LIN(lParam);
CREATESTRUCT16 *lpCreat = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
if (lpCreat->style & SBS_SIZEBOX)
{
fprintf( stdnimp, "Unimplemented style SBS_SIZEBOX.\n" );
......@@ -825,7 +821,7 @@ LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
case WM_LBUTTONUP:
case WM_MOUSEMOVE:
case WM_SYSTIMER:
SCROLL_HandleScrollEvent( hwnd, SB_CTL, message, Pt );
SCROLL_HandleScrollEvent( hwnd, SB_CTL, message, MAKEPOINT16(lParam) );
break;
case WM_KEYDOWN:
......@@ -840,10 +836,10 @@ LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint( hwnd, &ps );
PAINTSTRUCT16 ps;
HDC16 hdc = BeginPaint16( hwnd, &ps );
SCROLL_DrawScrollBar( hwnd, hdc, SB_CTL );
EndPaint( hwnd, &ps );
EndPaint16( hwnd, &ps );
}
break;
......
......@@ -79,19 +79,18 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg) {
case WM_ENABLE:
InvalidateRect(hWnd, NULL, FALSE);
InvalidateRect32( hWnd, NULL, FALSE );
break;
case WM_NCCREATE:
if (style == SS_ICON)
{
CREATESTRUCT * createStruct = (CREATESTRUCT *)PTR_SEG_TO_LIN(lParam);
if (createStruct->lpszName)
CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
if (cs->lpszName)
{
HICON hicon = LoadIcon( createStruct->hInstance,
createStruct->lpszName );
HICON hicon = LoadIcon( cs->hInstance, cs->lpszName );
if (!hicon) /* Try OEM icon (FIXME: is this right?) */
hicon = LoadIcon( 0, createStruct->lpszName );
hicon = LoadIcon( 0, cs->lpszName );
STATIC_SetIcon( wndPtr, hicon );
}
return 1;
......@@ -120,11 +119,11 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_PAINT:
{
PAINTSTRUCT ps;
BeginPaint( hWnd, &ps );
PAINTSTRUCT16 ps;
BeginPaint16( hWnd, &ps );
if (staticPaintFunc[style])
(staticPaintFunc[style])( wndPtr, ps.hdc );
EndPaint( hWnd, &ps );
EndPaint16( hWnd, &ps );
}
break;
......@@ -132,7 +131,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_background = GetSysColor(COLOR_BACKGROUND);
color_window = GetSysColor(COLOR_WINDOW);
InvalidateRect(hWnd, NULL, TRUE);
InvalidateRect32( hWnd, NULL, TRUE );
break;
case WM_SETTEXT:
......@@ -142,7 +141,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
(SEGPTR)lParam ));
else
DEFWND_SetText( wndPtr, (LPSTR)PTR_SEG_TO_LIN(lParam) );
InvalidateRect( hWnd, NULL, FALSE );
InvalidateRect32( hWnd, NULL, FALSE );
UpdateWindow( hWnd );
break;
......@@ -151,7 +150,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
infoPtr->hFont = (HFONT)wParam;
if (LOWORD(lParam))
{
InvalidateRect( hWnd, NULL, FALSE );
InvalidateRect32( hWnd, NULL, FALSE );
UpdateWindow( hWnd );
}
break;
......@@ -170,7 +169,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case STM_SETICON:
lResult = STATIC_SetIcon( wndPtr, (HICON)wParam );
InvalidateRect( hWnd, NULL, FALSE );
InvalidateRect32( hWnd, NULL, FALSE );
UpdateWindow( hWnd );
break;
......@@ -185,7 +184,7 @@ LONG StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
{
RECT rc;
RECT16 rc;
HBRUSH hBrush;
char *text;
WORD wFormat;
......@@ -193,7 +192,7 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
LONG style = wndPtr->dwStyle;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect( wndPtr->hwndSelf, &rc);
GetClientRect16( wndPtr->hwndSelf, &rc);
text = USER_HEAP_LIN_ADDR( wndPtr->hText );
switch (style & 0x0000000F)
......@@ -234,42 +233,42 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif
if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
FillRect(hdc, &rc, hBrush);
if (text) DrawText( hdc, text, -1, &rc, wFormat );
FillRect16(hdc, &rc, hBrush);
if (text) DrawText16( hdc, text, -1, &rc, wFormat );
}
static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc )
{
RECT rc;
RECT16 rc;
HBRUSH hBrush;
GetClientRect( wndPtr->hwndSelf, &rc);
GetClientRect16( wndPtr->hwndSelf, &rc);
switch (wndPtr->dwStyle & 0x0f)
{
case SS_BLACKRECT:
hBrush = CreateSolidBrush(color_windowframe);
FillRect( hdc, &rc, hBrush );
FillRect16( hdc, &rc, hBrush );
break;
case SS_GRAYRECT:
hBrush = CreateSolidBrush(color_background);
FillRect( hdc, &rc, hBrush );
FillRect16( hdc, &rc, hBrush );
break;
case SS_WHITERECT:
hBrush = CreateSolidBrush(color_window);
FillRect( hdc, &rc, hBrush );
FillRect16( hdc, &rc, hBrush );
break;
case SS_BLACKFRAME:
hBrush = CreateSolidBrush(color_windowframe);
FrameRect( hdc, &rc, hBrush );
FrameRect16( hdc, &rc, hBrush );
break;
case SS_GRAYFRAME:
hBrush = CreateSolidBrush(color_background);
FrameRect( hdc, &rc, hBrush );
FrameRect16( hdc, &rc, hBrush );
break;
case SS_WHITEFRAME:
hBrush = CreateSolidBrush(color_window);
FrameRect( hdc, &rc, hBrush );
FrameRect16( hdc, &rc, hBrush );
break;
default:
return;
......@@ -280,11 +279,11 @@ static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc )
static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc )
{
RECT rc;
RECT16 rc;
HBRUSH hbrush;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect( wndPtr->hwndSelf, &rc);
GetClientRect16( wndPtr->hwndSelf, &rc);
#ifdef WINELIB32
hbrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
......@@ -292,6 +291,6 @@ static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc )
hbrush = SendMessage( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif
FillRect( hdc, &rc, hbrush );
FillRect16( hdc, &rc, hbrush );
if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon );
}
......@@ -13,38 +13,38 @@
#include "gdi.h"
#include "user.h"
#include "module.h"
#include "stackframe.h"
#include "heap.h"
static WNDCLASS16 WIDGETS_BuiltinClasses[] =
{
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
(WNDPROC)"ButtonWndProc", 0, sizeof(BUTTONINFO),
(WNDPROC16)"ButtonWndProc", 0, sizeof(BUTTONINFO),
0, 0, 0, 0, 0, (SEGPTR)"BUTTON" },
{ CS_GLOBALCLASS | CS_PARENTDC,
(WNDPROC)"StaticWndProc", 0, sizeof(STATICINFO),
(WNDPROC16)"StaticWndProc", 0, sizeof(STATICINFO),
0, 0, 0, 0, 0, (SEGPTR)"STATIC" },
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
(WNDPROC)"ScrollBarWndProc", 0, sizeof(SCROLLINFO),
(WNDPROC16)"ScrollBarWndProc", 0, sizeof(SCROLLINFO),
0, 0, 0, 0, 0, (SEGPTR)"SCROLLBAR" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
(WNDPROC)"ListBoxWndProc", 0, 8,
(WNDPROC16)"ListBoxWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)"LISTBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
(WNDPROC)"ComboBoxWndProc", 0, 8,
(WNDPROC16)"ComboBoxWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)"COMBOBOX" },
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
(WNDPROC)"ComboLBoxWndProc", 0, 8,
(WNDPROC16)"ComboLBoxWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)"COMBOLBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
(WNDPROC)"EditWndProc", 0, sizeof(DWORD),
(WNDPROC16)"EditWndProc", 0, sizeof(DWORD),
0, 0, 0, 0, 0, (SEGPTR)"EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0, 8,
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC16)"PopupMenuWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC)"DesktopWndProc", 0, sizeof(DESKTOPINFO),
{ CS_GLOBALCLASS, (WNDPROC16)"DesktopWndProc", 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, 0, (SEGPTR)DESKTOP_CLASS_NAME },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"DefDlgProc", 0, DLGWINDOWEXTRA,
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC16)"DefDlgProc", 0, DLGWINDOWEXTRA,
0, 0, 0, 0, 0, (SEGPTR)DIALOG_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC)"MDIClientWndProc", 0, sizeof(MDICLIENTINFO),
{ CS_GLOBALCLASS, (WNDPROC16)"MDIClientWndProc", 0, sizeof(MDICLIENTINFO),
0, 0, 0, STOCK_LTGRAY_BRUSH, 0, (SEGPTR)"MDICLIENT" }
};
......@@ -60,16 +60,18 @@ static WNDCLASS16 WIDGETS_BuiltinClasses[] =
BOOL WIDGETS_Init(void)
{
int i;
char name[20];
char *name;
WNDCLASS16 *class = WIDGETS_BuiltinClasses;
if (!(name = SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE;
for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
{
strcpy( name, (char *)class->lpszClassName );
class->lpszClassName = MAKE_SEGPTR(name);
class->lpszClassName = SEGPTR_GET(name);
class->hCursor = LoadCursor( 0, IDC_ARROW );
class->lpfnWndProc = MODULE_GetWndProcEntry16( (char *)class->lpfnWndProc );
if (!RegisterClass16( class )) return FALSE;
}
SEGPTR_FREE(name);
return TRUE;
}
......@@ -474,3 +474,28 @@ WORD GetDriveType( INT drive )
default: return DRIVE_CANNOTDETERMINE;
}
}
/***********************************************************************
* GetCurrentDirectory (KERNEL.411)
*/
UINT32 GetCurrentDirectory( UINT32 buflen, LPSTR buf )
{
const char *s = DRIVE_GetDosCwd( DRIVE_GetCurrentDrive() );
if (!s)
{
*buf = '\0';
return 0;
}
lstrcpyn( buf, s, buflen );
return strlen(s); /* yes */
}
/***********************************************************************
* SetCurrentDirectory (KERNEL.412)
*/
BOOL32 SetCurrentDirectory( LPCSTR dir )
{
return DRIVE_Chdir( DRIVE_GetCurrentDrive(), dir );
}
......@@ -50,8 +50,7 @@ SPEC_FILES = $(DLLS:.spec=.S)
C_SRCS = \
callback.c \
dummy.c \
relay.c \
relay32.c
relay.c
ASM_SRCS = \
$(SPEC_FILES) \
......
......@@ -128,40 +128,40 @@ base 1
0123 stub QueryServiceStatus
0124 stub ReadEventLogA
0125 stub ReadEventLogW
0126 stdcall RegCloseKey(long) RegCloseKey
0126 stdcall RegCloseKey(long) RegCloseKey
0127 stub RegConnectRegistryA
0128 stub RegConnectRegistryW
0129 stdcall RegCreateKeyA(long ptr ptr) RegCreateKeyA
0130 stdcall RegCreateKeyExA(long ptr long ptr long long ptr ptr ptr) RegCreateKeyExA
0131 stdcall RegCreateKeyExW(long ptr long ptr long long ptr ptr ptr) RegCreateKeyExW
0132 stdcall RegCreateKeyW(long ptr ptr) RegCreateKeyW
0133 stdcall RegDeleteKeyA(long ptr) RegDeleteKeyA
0134 stdcall RegDeleteKeyW(long ptr) RegDeleteKeyW
0135 stdcall RegDeleteValueA(long ptr) RegDeleteValueA
0136 stdcall RegDeleteValueW(long ptr) RegDeleteValueW
0137 stdcall RegEnumKeyA(long long ptr long) RegEnumKeyA
0138 stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr) RegEnumKeyExA
0139 stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr) RegEnumKeyExW
0140 stdcall RegEnumKeyW(long long ptr long) RegEnumKeyW
0141 stdcall RegEnumValueA(long long ptr ptr ptr ptr ptr ptr) RegEnumValueA
0142 stdcall RegEnumValueW(long long ptr ptr ptr ptr ptr ptr) RegEnumValueW
0143 stdcall RegFlushKey(long) RegFlushKey
0129 stdcall RegCreateKeyA(long ptr ptr) RegCreateKey32A
0130 stdcall RegCreateKeyExA(long ptr long ptr long long ptr ptr ptr) RegCreateKeyEx32A
0131 stdcall RegCreateKeyExW(long ptr long ptr long long ptr ptr ptr) RegCreateKeyEx32W
0132 stdcall RegCreateKeyW(long ptr ptr) RegCreateKey32W
0133 stdcall RegDeleteKeyA(long ptr) RegDeleteKey32A
0134 stdcall RegDeleteKeyW(long ptr) RegDeleteKey32W
0135 stdcall RegDeleteValueA(long ptr) RegDeleteValue32A
0136 stdcall RegDeleteValueW(long ptr) RegDeleteValue32W
0137 stdcall RegEnumKeyA(long long ptr long) RegEnumKey32A
0138 stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr) RegEnumKeyEx32A
0139 stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr) RegEnumKeyEx32W
0140 stdcall RegEnumKeyW(long long ptr long) RegEnumKey32W
0141 stdcall RegEnumValueA(long long ptr ptr ptr ptr ptr ptr) RegEnumValue32A
0142 stdcall RegEnumValueW(long long ptr ptr ptr ptr ptr ptr) RegEnumValue32W
0143 stdcall RegFlushKey(long) RegFlushKey
0144 stub RegGetKeySecurity
0145 stub RegLoadKeyA
0146 stub RegLoadKeyW
0147 stub RegNotifyChangeKeyValue
0148 stdcall RegOpenKeyA(long ptr ptr) RegOpenKeyA
0149 stdcall RegOpenKeyExA(long ptr long long ptr) RegOpenKeyExA
0150 stdcall RegOpenKeyExW(long ptr long long ptr) RegOpenKeyExW
0151 stdcall RegOpenKeyW(long ptr ptr) RegOpenKeyW
0152 stdcall RegQueryInfoKeyA(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) RegQueryInfoKeyA
0153 stdcall RegQueryInfoKeyW(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) RegQueryInfoKeyW
0148 stdcall RegOpenKeyA(long ptr ptr) RegOpenKey32A
0149 stdcall RegOpenKeyExA(long ptr long long ptr) RegOpenKeyEx32A
0150 stdcall RegOpenKeyExW(long ptr long long ptr) RegOpenKeyEx32W
0151 stdcall RegOpenKeyW(long ptr ptr) RegOpenKey32W
0152 stdcall RegQueryInfoKeyA(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) RegQueryInfoKey32A
0153 stdcall RegQueryInfoKeyW(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) RegQueryInfoKey32W
0154 stub RegQueryMultipleValuesA
0155 stub RegQueryMultipleValuesW
0156 stdcall RegQueryValueA(long ptr ptr ptr) RegQueryValueA
0157 stdcall RegQueryValueExA(long ptr ptr ptr ptr ptr) RegQueryValueExA
0158 stdcall RegQueryValueExW(long ptr ptr ptr ptr ptr) RegQueryValueExW
0159 stdcall RegQueryValueW(long ptr ptr ptr) RegQueryValueW
0156 stdcall RegQueryValueA(long ptr ptr ptr) RegQueryValue32A
0157 stdcall RegQueryValueExA(long ptr ptr ptr ptr ptr) RegQueryValueEx32A
0158 stdcall RegQueryValueExW(long ptr ptr ptr ptr ptr) RegQueryValueEx32W
0159 stdcall RegQueryValueW(long ptr ptr ptr) RegQueryValue32W
0160 stub RegRemapPreDefKey
0161 stub RegReplaceKeyA
0162 stub RegReplaceKeyW
......@@ -170,10 +170,10 @@ base 1
0165 stub RegSaveKeyA
0166 stub RegSaveKeyW
0167 stub RegSetKeySecurity
0168 stdcall RegSetValueA(long ptr long ptr long) RegSetValueA
0169 stdcall RegSetValueExA(long ptr long long ptr long) RegSetValueExA
0170 stdcall RegSetValueExW(long ptr long long ptr long) RegSetValueExW
0171 stdcall RegSetValueW(long ptr long ptr long) RegSetValueW
0168 stdcall RegSetValueA(long ptr long ptr long) RegSetValue32A
0169 stdcall RegSetValueExA(long ptr long long ptr long) RegSetValueEx32A
0170 stdcall RegSetValueExW(long ptr long long ptr long) RegSetValueEx32W
0171 stdcall RegSetValueW(long ptr long ptr long) RegSetValue32W
0172 stub RegUnLoadKeyA
0173 stub RegUnLoadKeyW
0174 stub RegisterEventSourceA
......@@ -202,4 +202,3 @@ base 1
0197 stub StartServiceCtrlDispatcherW
0198 stub StartServiceW
0199 stub UnlockServiceDatabase
......@@ -9,40 +9,11 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "windows.h"
#include "callback.h"
#include "stackframe.h"
#include "win.h"
#include "alias.h"
#include "relay32.h"
#include "stddebug.h"
#include "debug.h"
/**********************************************************************
* CallWindowProc (USER.122)
*/
LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
WORD wParam, LONG lParam )
{
FUNCTIONALIAS *a;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
/* check if we have something better than 16 bit relays */
if(!ALIAS_UseAliases || !(a=ALIAS_LookupAlias((DWORD)func)) ||
(!a->wine && !a->win32))
return CallWndProc( (FARPROC)func, wndPtr->hInstance,
hwnd, message, wParam, lParam );
if(a->wine)
return ((LONG(*)(WORD,WORD,WORD,LONG))(a->wine))
(hwnd,message,wParam,lParam);
if(!a->win32)
fprintf(stderr,"Where is the Win32 callback?\n");
if (UsesLParamPtr(message))
return RELAY32_CallWindowProcConvStruct(a->win32,hwnd,message,wParam,lParam);
return CallWndProc32( (FARPROC)a->win32, hwnd, message, wParam, lParam );
}
/**********************************************************************
* Catch (KERNEL.55)
*/
INT Catch( LPCATCHBUF lpbuf )
......
......@@ -38,13 +38,13 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
30 pascal16 SaveDC(word) SaveDC
31 pascal SetPixel(word s_word s_word long) SetPixel
32 pascal16 OffsetClipRgn(word s_word s_word) OffsetClipRgn
33 pascal16 TextOut(word s_word s_word ptr word) TextOut
33 pascal16 TextOut(word s_word s_word ptr word) TextOut16
34 pascal16 BitBlt( word s_word s_word s_word s_word word s_word s_word long)
BitBlt
35 pascal16 StretchBlt(word s_word s_word s_word s_word word s_word s_word
s_word s_word long) StretchBlt
36 pascal16 Polygon (word ptr word) Polygon
37 pascal16 Polyline (word ptr word) Polyline
36 pascal16 Polygon (word ptr word) Polygon16
37 pascal16 Polyline (word ptr word) Polyline16
38 pascal Escape(word word word ptr ptr) Escape
39 pascal16 RestoreDC(word s_word) RestoreDC
40 pascal16 FillRgn(word word word) FillRgn
......@@ -54,7 +54,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
44 pascal16 SelectClipRgn(word word) SelectClipRgn
45 pascal16 SelectObject(word word) SelectObject
#46 pascal __GP?
47 pascal16 CombineRgn(word word word word) CombineRgn
47 pascal16 CombineRgn(word word word s_word) CombineRgn
48 pascal16 CreateBitmap(word word word word ptr) CreateBitmap
49 pascal16 CreateBitmapIndirect(ptr) CreateBitmapIndirect
50 pascal16 CreateBrushIndirect(ptr) CreateBrushIndirect
......@@ -62,7 +62,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
52 pascal16 CreateCompatibleDC(word) CreateCompatibleDC
53 pascal16 CreateDC(ptr ptr ptr ptr) CreateDC
54 pascal16 CreateEllipticRgn(s_word s_word s_word s_word) CreateEllipticRgn
55 pascal16 CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect
55 pascal16 CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect16
56 pascal16 CreateFont(s_word s_word s_word s_word s_word word word word
word word word word word ptr) CreateFont
57 pascal16 CreateFontIndirect(ptr) CreateFontIndirect
......@@ -70,11 +70,11 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
60 pascal16 CreatePatternBrush(word) CreatePatternBrush
61 pascal16 CreatePen(s_word s_word long) CreatePen
62 pascal16 CreatePenIndirect(ptr) CreatePenIndirect
63 pascal16 CreatePolygonRgn(ptr word word) CreatePolygonRgn
63 pascal16 CreatePolygonRgn(ptr word word) CreatePolygonRgn16
64 pascal16 CreateRectRgn(s_word s_word s_word s_word) CreateRectRgn
65 pascal16 CreateRectRgnIndirect(ptr) CreateRectRgnIndirect
65 pascal16 CreateRectRgnIndirect(ptr) CreateRectRgnIndirect16
66 pascal16 CreateSolidBrush(long) CreateSolidBrush
67 pascal16 DPtoLP(word ptr s_word) DPtoLP
67 pascal16 DPtoLP(word ptr s_word) DPtoLP16
68 pascal16 DeleteDC(word) DeleteDC
69 pascal16 DeleteObject(word) DeleteObject
70 pascal16 EnumFonts(word ptr segptr long) EnumFonts
......@@ -84,7 +84,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
74 pascal GetBitmapBits(word long ptr) GetBitmapBits
75 pascal GetBkColor(word) GetBkColor
76 pascal16 GetBkMode(word) GetBkMode
77 pascal16 GetClipBox(word ptr) GetClipBox
77 pascal16 GetClipBox(word ptr) GetClipBox16
78 pascal GetCurrentPosition(word) GetCurrentPosition
79 pascal GetDCOrg(word) GetDCOrg
80 pascal16 GetDeviceCaps(word s_word) GetDeviceCaps
......@@ -107,12 +107,12 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
97 pascal GetWindowOrg(word) GetWindowOrg
98 pascal16 IntersectVisRect(word s_word s_word s_word s_word)
IntersectVisRect
99 pascal16 LPtoDP(word ptr s_word) LPtoDP
99 pascal16 LPtoDP(word ptr s_word) LPtoDP16
100 pascal16 LineDDA(s_word s_word s_word s_word segptr long) LineDDA
101 pascal16 OffsetRgn(word s_word s_word) OffsetRgn
102 pascal16 OffsetVisRgn(word s_word s_word) OffsetVisRgn
103 pascal16 PtVisible(word s_word s_word) PtVisible
104 pascal16 RectVisibleOld(word ptr) RectVisible
104 pascal16 RectVisibleOld(word ptr) RectVisible16
105 pascal16 SelectVisRgn(word word) SelectVisRgn
106 pascal SetBitmapBits(word long ptr) SetBitmapBits
117 pascal SetDCOrg(word s_word s_word) SetDCOrg
......@@ -130,7 +130,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
131 pascal16 InquireVisRgn(word) InquireVisRgn
132 pascal16 SetEnvironment(ptr ptr word) SetEnvironment
133 pascal16 GetEnvironment(ptr ptr word) GetEnvironment
134 pascal16 GetRgnBox(word ptr) GetRgnBox
134 pascal16 GetRgnBox(word ptr) GetRgnBox16
#135 pascal ScanLr
136 pascal16 RemoveFontResource(ptr) RemoveFontResource
148 pascal SetBrushOrg(word s_word s_word) SetBrushOrg
......@@ -144,8 +144,8 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
159 pascal16 GetMetaFileBits(word) GetMetaFileBits
160 pascal16 SetMetaFileBits(word) SetMetaFileBits
161 pascal16 PtInRegion(word s_word s_word) PtInRegion
162 pascal GetBitmapDimension(word) GetBitmapDimension
163 pascal SetBitmapDimension(word s_word s_word) SetBitmapDimension
162 pascal GetBitmapDimension(word) GetBitmapDimension
163 pascal SetBitmapDimension(word s_word s_word) SetBitmapDimension
169 stub IsDCDirty
170 stub SetDCStatus
172 pascal16 SetRectRgn(word s_word s_word s_word s_word) SetRectRgn
......@@ -154,7 +154,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
176 pascal16 PlayMetaFileRecord(word ptr ptr word) PlayMetaFileRecord
179 pascal16 GetDCState(word) GetDCState
180 pascal16 SetDCState(word word) SetDCState
181 pascal16 RectInRegionOld(word ptr) RectInRegion
181 pascal16 RectInRegionOld(word ptr) RectInRegion16
188 stub GetTextExtentEx
190 stub SetDCHook
191 stub GetDCHook
......@@ -235,7 +235,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
s_word s_word) Chord
349 pascal SetMapperFlags(word long) SetMapperFlags
350 pascal16 GetCharWidth(word word word ptr) GetCharWidth
351 pascal16 ExtTextOut(word s_word s_word word ptr ptr s_word ptr) ExtTextOut
351 pascal16 ExtTextOut(word s_word s_word word ptr ptr s_word ptr) ExtTextOut16
352 stub GetPhysicalFontHandle
353 stub GetAspectRatioFilter
354 stub ShrinkGDIHeap
......@@ -283,37 +283,37 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
CreateRoundRectRgn
445 pascal16 CreateDIBPatternBrush(word word) CreateDIBPatternBrush
449 stub DEVICECOLORMATCH
450 pascal16 PolyPolygon(word ptr ptr word) PolyPolygon
451 pascal16 CreatePolyPolygonRgn(ptr ptr word word) CreatePolyPolygonRgn
450 pascal16 PolyPolygon(word ptr ptr word) PolyPolygon16
451 pascal16 CreatePolyPolygonRgn(ptr ptr word word) CreatePolyPolygonRgn16
452 stub GDISEEGDIDO
460 stub GDITASKTERMINATION
461 return SetObjectOwner 4 0
462 pascal16 IsGDIObject(word) IsGDIObject
463 stub MAKEOBJECTPRIVATE
464 stub FIXUPBOGUSPUBLISHERMETAFILE
465 pascal16 RectVisible(word ptr) RectVisible
466 pascal16 RectInRegion(word ptr) RectInRegion
465 pascal16 RectVisible(word ptr) RectVisible16
466 pascal16 RectInRegion(word ptr) RectInRegion16
467 stub UNICODETOANSI
468 pascal16 GetBitmapDimensionEx(word ptr) GetBitmapDimensionEx
469 pascal16 GetBrushOrgEx(word ptr) GetBrushOrgEx
470 pascal16 GetCurrentPositionEx(word ptr) GetCurrentPositionEx
471 pascal16 GetTextExtentPoint(word ptr s_word ptr) GetTextExtentPoint
472 pascal16 GetViewportExtEx(word ptr) GetViewportExtEx
473 pascal16 GetViewportOrgEx(word ptr) GetViewportOrgEx
474 pascal16 GetWindowExtEx(word ptr) GetWindowExtEx
475 pascal16 GetWindowOrgEx(word ptr) GetWindowOrgEx
476 pascal16 OffsetViewportOrgEx(word s_word s_word ptr) OffsetViewportOrgEx
477 pascal16 OffsetWindowOrgEx(word s_word s_word ptr) OffsetWindowOrgEx
478 pascal16 SetBitmapDimensionEx(word s_word s_word ptr) SetBitmapDimensionEx
479 pascal16 SetViewportExtEx(word s_word s_word ptr) SetViewportExtEx
480 pascal16 SetViewportOrgEx(word s_word s_word ptr) SetViewportOrgEx
481 pascal16 SetWindowExtEx(word s_word s_word ptr) SetWindowExtEx
482 pascal16 SetWindowOrgEx(word s_word s_word ptr) SetWindowOrgEx
483 pascal16 MoveToEx(word s_word s_word ptr) MoveToEx
468 pascal16 GetBitmapDimensionEx(word ptr) GetBitmapDimensionEx16
469 pascal16 GetBrushOrgEx(word ptr) GetBrushOrgEx16
470 pascal16 GetCurrentPositionEx(word ptr) GetCurrentPositionEx16
471 pascal16 GetTextExtentPoint(word ptr s_word ptr) GetTextExtentPoint16
472 pascal16 GetViewportExtEx(word ptr) GetViewportExtEx16
473 pascal16 GetViewportOrgEx(word ptr) GetViewportOrgEx16
474 pascal16 GetWindowExtEx(word ptr) GetWindowExtEx16
475 pascal16 GetWindowOrgEx(word ptr) GetWindowOrgEx16
476 pascal16 OffsetViewportOrgEx(word s_word s_word ptr) OffsetViewportOrgEx16
477 pascal16 OffsetWindowOrgEx(word s_word s_word ptr) OffsetWindowOrgEx16
478 pascal16 SetBitmapDimensionEx(word s_word s_word ptr) SetBitmapDimensionEx16
479 pascal16 SetViewportExtEx(word s_word s_word ptr) SetViewportExtEx16
480 pascal16 SetViewportOrgEx(word s_word s_word ptr) SetViewportOrgEx16
481 pascal16 SetWindowExtEx(word s_word s_word ptr) SetWindowExtEx16
482 pascal16 SetWindowOrgEx(word s_word s_word ptr) SetWindowOrgEx16
483 pascal16 MoveToEx(word s_word s_word ptr) MoveToEx16
484 pascal16 ScaleViewportExtEx(word s_word s_word s_word s_word ptr)
ScaleViewportExtEx
ScaleViewportExtEx16
485 pascal16 ScaleWindowExtEx(word s_word s_word s_word s_word ptr)
ScaleWindowExtEx
ScaleWindowExtEx16
486 stub GETASPECTRATIOFILTEREX
489 stub CreateDIBSection
490 stub CloseEnhMetafile
......
......@@ -41,8 +41,8 @@ base 1
0036 stub CreateDIBSection
0037 stub CreateDIBitmap
0038 stub CreateDiscardableBitmap
0039 stub CreateEllipticRgn
0040 stub CreateEllipticRgnIndirect
0039 stdcall CreateEllipticRgn(long long long long) CreateEllipticRgn
0040 stdcall CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect32
0041 stub CreateEnhMetaFileA
0042 stub CreateEnhMetaFileW
0043 stub CreateFontA
......@@ -62,12 +62,12 @@ base 1
0057 stub CreatePolyPolygonRgn
0058 stub CreatePolygonRgn
0059 stdcall CreateRectRgn(long long long long) CreateRectRgn
0060 stub CreateRectRgnIndirect
0061 stub CreateRoundRectRgn
0060 stdcall CreateRectRgnIndirect(ptr) CreateRectRgnIndirect32
0061 stdcall CreateRoundRectRgn(long long long long long long) CreateRoundRectRgn
0062 stub CreateScalableFontResourceA
0063 stub CreateScalableFontResourceW
0064 stdcall CreateSolidBrush(long) CreateSolidBrush
0065 stub DPtoLP
0065 stdcall DPtoLP(long ptr long) DPtoLP32
0066 stub DeleteColorSpace
0067 stdcall DeleteDC(long) DeleteDC
0068 stub DeleteEnhMetaFile
......@@ -92,7 +92,7 @@ base 1
0087 stub EnumICMProfilesW
0088 stub EnumMetaFile
0089 stub EnumObjects
0090 stub EqualRgn
0090 stdcall EqualRgn(long long) EqualRgn
0091 stub Escape
0092 stub ExcludeClipRect
0093 stub ExtCreatePen
......@@ -100,8 +100,8 @@ base 1
0095 stub ExtEscape
0096 stub ExtFloodFill
0097 stub ExtSelectClipRgn
0098 stub ExtTextOutA
0099 stub ExtTextOutW
0098 stdcall ExtTextOutA(long long long long ptr ptr long ptr) ExtTextOut32A
0099 stdcall ExtTextOutW(long long long long ptr ptr long ptr) ExtTextOut32W
0100 stub FillPath
0101 stub FillRgn
0102 stub FixBrushOrgEx
......@@ -146,7 +146,7 @@ base 1
0141 stub GetArcDirection
0142 stub GetAspectRatioFilterEx
0143 stub GetBitmapBits
0144 stub GetBitmapDimensionEx
0144 stdcall GetBitmapDimensionEx(long ptr) GetBitmapDimensionEx32
0145 stub GetBkColor
0146 stub GetBkMode
0147 stub GetBoundsRect
......@@ -164,7 +164,7 @@ base 1
0159 stub GetCharWidthWOW
0160 stub GetCharacterPlacementA
0161 stub GetCharacterPlacementW
0162 stub GetClipBox
0162 stdcall GetClipBox(long ptr) GetClipBox32
0163 stub GetClipRgn
0164 stub GetColorAdjustment
0165 stub GetColorSpace
......@@ -221,8 +221,8 @@ base 1
0216 stub GetRasterizerCaps
0217 stub GetRegionData
0218 stub GetRelAbs
0219 stub GetRgnBox
0220 stdcall GetStockObject(long) GetStockObject
0219 stdcall GetRgnBox(long ptr) GetRgnBox32
0220 stdcall GetStockObject(long) GetStockObject
0221 stub GetStretchBltMode
0222 stub GetSystemPaletteEntries
0223 stub GetSystemPaletteUse
......@@ -234,8 +234,8 @@ base 1
0229 stub GetTextExtentExPointW
0230 stub GetTextExtentPoint32A
0231 stub GetTextExtentPoint32W
0232 stdcall GetTextExtentPointA(long ptr long ptr) WIN32_GetTextExtentPointA
0233 stub GetTextExtentPointW
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32A
0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32W
0234 stub GetTextFaceA
0235 stub GetTextFaceW
0236 stub GetTextMetricsA
......@@ -249,18 +249,18 @@ base 1
0244 stub GetWorldTransform
0245 stub IntersectClipRect
0246 stub InvertRgn
0247 stub LPtoDP
0247 stdcall LPtoDP(long ptr long) LPtoDP32
0248 stub LineDDA
0249 stdcall LineTo(long long long) LineTo
0250 stub LoadImageColorMatcherA
0251 stub LoadImageColorMatcherW
0252 stub MaskBlt
0253 stub ModifyWorldTransform
0254 stdcall MoveToEx(long long long ptr) WIN32_MoveToEx
0254 stdcall MoveToEx(long long long ptr) MoveToEx32
0255 stub OffsetClipRgn
0256 stub OffsetRgn
0257 stub OffsetViewportOrgEx
0258 stub OffsetWindowOrgEx
0256 stdcall OffsetRgn(long long long) OffsetRgn
0257 stdcall OffsetViewportOrgEx(long long long ptr) OffsetViewportOrgEx32
0258 stdcall OffsetWindowOrgEx(long long long ptr) OffsetWindowOrgEx32
0259 stub PaintRgn
0260 stdcall PatBlt(long long long long long long) PatBlt
0261 stub PathToRegion
......@@ -280,12 +280,12 @@ base 1
0275 stub Polygon
0276 stub Polyline
0277 stub PolylineTo
0278 stub PtInRegion
0278 stdcall PtInRegion(long long long) PtInRegion
0279 stub PtVisible
0280 stub RealizePalette
0281 stub RectInRegion
0282 stub RectVisible
0283 stub Rectangle
0281 stdcall RectInRegion(long ptr) RectInRegion32
0282 stdcall RectVisible(long ptr) RectVisible32
0283 stdcall Rectangle(long long long long long) Rectangle
0284 stub RemoveFontResourceA
0285 stub RemoveFontResourceTracking
0286 stub RemoveFontResourceW
......@@ -295,8 +295,8 @@ base 1
0290 stub RestoreDC
0291 stub RoundRect
0292 stub SaveDC
0293 stub ScaleViewportExtEx
0294 stub ScaleWindowExtEx
0293 stdcall ScaleViewportExtEx(long long long long long ptr) ScaleViewportExtEx32
0294 stdcall ScaleWindowExtEx(long long long long long ptr) ScaleWindowExtEx32
0295 stub SelectBrushLocal
0296 stub SelectClipPath
0297 stub SelectClipRgn
......@@ -306,7 +306,7 @@ base 1
0301 stub SetAbortProc
0302 stub SetArcDirection
0303 stub SetBitmapBits
0304 stub SetBitmapDimensionEx
0304 stdcall SetBitmapDimensionEx(long long long ptr) SetBitmapDimensionEx32
0305 stdcall SetBkColor(long long) SetBkColor
0306 stub SetBkMode
0307 stub SetBoundsRect
......@@ -342,12 +342,12 @@ base 1
0337 stub SetTextCharacterExtra
0338 stdcall SetTextColor(long long) SetTextColor
0339 stub SetTextJustification
0340 stub SetViewportExtEx
0341 stub SetViewportOrgEx
0340 stdcall SetViewportExtEx(long long long ptr) SetViewportExtEx32
0341 stdcall SetViewportOrgEx(long long long ptr) SetViewportOrgEx32
0342 stub SetVirtualResolution
0343 stub SetWinMetaFileBits
0344 stub SetWindowExtEx
0345 stub SetWindowOrgEx
0344 stdcall SetWindowExtEx(long long long ptr) SetWindowExtEx32
0345 stdcall SetWindowOrgEx(long long long ptr) SetWindowOrgEx32
0346 stub SetWorldTransform
0347 stub StartDocA
0348 stub StartDocW
......@@ -357,8 +357,8 @@ base 1
0352 stub StrokeAndFillPath
0353 stub StrokePath
0354 stub SwapBuffers
0355 stdcall TextOutA(long long long ptr long) TextOut
0356 stub TextOutW
0355 stdcall TextOutA(long long long ptr long) TextOut32A
0356 stdcall TextOutW(long long long ptr long) TextOut32W
0357 stub UnloadNetworkFonts
0358 stub UnrealizeObject
0359 stub UpdateColors
......
......@@ -205,17 +205,17 @@ type win16
205 stub CVWBreak
206 pascal16 AllocSelectorArray(word) AllocSelectorArray
207 return IsDBCSLeadByte 2 0
216 pascal RegEnumKey(long long ptr long) RegEnumKey
217 pascal RegOpenKey(long ptr ptr) RegOpenKey
218 pascal RegCreateKey(long ptr ptr) RegCreateKey
219 pascal RegDeleteKey(long ptr) RegDeleteKey
216 pascal RegEnumKey(long long ptr long) RegEnumKey16
217 pascal RegOpenKey(long ptr ptr) RegOpenKey16
218 pascal RegCreateKey(long ptr ptr) RegCreateKey16
219 pascal RegDeleteKey(long ptr) RegDeleteKey16
220 pascal RegCloseKey(long) RegCloseKey
221 pascal RegSetValue(long ptr long ptr long) RegSetValue
222 pascal RegDeleteValue(long ptr) RegDeleteValue
223 pascal RegEnumValue(long long ptr ptr ptr ptr ptr ptr) RegEnumValue
224 pascal RegQueryValue(long ptr ptr ptr) RegQueryValue
225 pascal RegQueryValueEx(long ptr ptr ptr ptr ptr) RegQueryValueEx
226 pascal RegSetValueEx(long ptr long long ptr long) RegSetValueEx
221 pascal RegSetValue(long ptr long ptr long) RegSetValue16
222 pascal RegDeleteValue(long ptr) RegDeleteValue16
223 pascal RegEnumValue(long long ptr ptr ptr ptr ptr ptr) RegEnumValue16
224 pascal RegQueryValue(long ptr ptr ptr) RegQueryValue16
225 pascal RegQueryValueEx(long ptr ptr ptr ptr ptr) RegQueryValueEx16
226 pascal RegSetValueEx(long ptr long long ptr long) RegSetValueEx16
227 pascal RegFlushKey(long) RegFlushKey
#228 K228
#229 K229
......@@ -270,8 +270,8 @@ type win16
404 pascal16 FarGetOwner(word) FarGetOwner
406 stub WritePrivateProfileStruct
407 stub GetPrivateProfileStruct
411 stub GetCurrentDirectory
412 stub SetCurrentDirectory
411 pascal GetCurrentDirectory(long ptr) GetCurrentDirectory
412 pascal16 SetCurrentDirectory(ptr) SetCurrentDirectory
413 stub FindFirstFile
414 stub FindNextFile
415 stub FindClose
......
......@@ -314,20 +314,20 @@ base 1
0308 stub GetVersionExW
0309 stub GetVolumeInformationA
0310 stub GetVolumeInformationW
0311 stub GetWindowsDirectoryA
0311 stdcall GetWindowsDirectoryA(ptr long) GetWindowsDirectory
0312 stub GetWindowsDirectoryW
0313 stdcall GlobalAddAtomA(long) WIN32_GlobalAddAtomA
0314 stub GlobalAddAtomW
0313 stdcall GlobalAddAtomA(ptr) GlobalAddAtom32A
0314 stdcall GlobalAddAtomW(ptr) GlobalAddAtom32W
0315 stdcall GlobalAlloc(long long) GlobalAlloc32
0316 stdcall GlobalCompact(long) GlobalCompact32
0317 stub GlobalDeleteAtom
0318 stub GlobalFindAtomA
0319 stub GlobalFindAtomW
0317 stdcall GlobalDeleteAtom(long) GlobalDeleteAtom
0318 stdcall GlobalFindAtomA(ptr) GlobalFindAtom32A
0319 stdcall GlobalFindAtomW(ptr) GlobalFindAtom32W
0320 stub GlobalFix
0321 stdcall GlobalFlags(long) GlobalFlags32
0322 stdcall GlobalFree(long) GlobalFree32
0323 stub GlobalGetAtomNameA
0324 stub GlobalGetAtomNameW
0323 stdcall GlobalGetAtomNameA(long ptr long) GlobalGetAtomName32A
0324 stdcall GlobalGetAtomNameW(long ptr long) GlobalGetAtomName32W
0325 stdcall GlobalHandle(ptr) GlobalHandle32
0326 stdcall GlobalLock(long) GlobalLock32
0327 stub GlobalMemoryStatus
......
......@@ -5,7 +5,7 @@ type win16
2 pascal SNDPLAYSOUND(ptr word) sndPlaySound
5 pascal MMSYSTEMGETVERSION() mmsystemGetVersion
6 pascal DriverProc(long word word long long) DriverProc
30 pascal OUTPUTDEBUGSTR(ptr) OutputDebugStr
30 pascal16 OutputDebugStr(ptr) OutputDebugString
31 pascal DriverCallback(long word word word long long long)
DriverCallback
#32 pascal STACKENTER
......
/*
* Copyright 1995 Martin von Loewis
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include "windows.h"
#include "callback.h"
#include "module.h"
#include "neexe.h"
#include "peexe.h"
#include "relay32.h"
#include "struct32.h"
#include "stackframe.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
int wParam, LPARAM lParam16)
{
WINDOWPOS32 wp;
union {
MINMAXINFO32 mmi;
NCCALCSIZE_PARAMS32 nccs;
CREATESTRUCT32 cs;
} st;
CREATESTRUCT *lpcs;
LONG result;
void *lParam;
if(!lParam16)
return CallWndProc32(func,hwnd,message,wParam,(int)lParam16);
lParam = PTR_SEG_TO_LIN(lParam16);
switch(message) {
case WM_GETMINMAXINFO:
STRUCT32_MINMAXINFO16to32(lParam,&st.mmi);
result=CallWndProc32(func,hwnd,message,wParam,(int)&st.mmi);
STRUCT32_MINMAXINFO32to16(&st.mmi,lParam);
return result;
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
STRUCT32_WINDOWPOS16to32(lParam,&wp);
result=CallWndProc32(func,hwnd,message,wParam,(int)&wp);
STRUCT32_WINDOWPOS32to16(&wp,lParam);
return result;
case WM_NCCALCSIZE:
STRUCT32_NCCALCSIZE16to32Flat(lParam,&st.nccs);
if(wParam && ((NCCALCSIZE_PARAMS*)lParam)->lppos)
{
STRUCT32_WINDOWPOS16to32(PTR_SEG_TO_LIN(((NCCALCSIZE_PARAMS*)lParam)->lppos),&wp);
st.nccs.lppos=&wp;
}
else st.nccs.lppos= 0;
result=CallWndProc32(func,hwnd,message,wParam,(int)&st.nccs);
STRUCT32_NCCALCSIZE32to16Flat(&st.nccs,lParam);
if(wParam && ((NCCALCSIZE_PARAMS*)lParam)->lppos)
STRUCT32_WINDOWPOS32to16(&wp,PTR_SEG_TO_LIN(((NCCALCSIZE_PARAMS*)lParam)->lppos));
return result;
case WM_NCCREATE:
lpcs = (CREATESTRUCT*)lParam;
STRUCT32_CREATESTRUCT16to32(lParam,&st.cs);
st.cs.lpszName = HIWORD(lpcs->lpszName) ?
PTR_SEG_TO_LIN(lpcs->lpszName) : (char*)lpcs->lpszName;
st.cs.lpszClass = HIWORD(lpcs->lpszClass) ?
PTR_SEG_TO_LIN(lpcs->lpszClass) : (char*)lpcs->lpszClass;
result=CallWndProc32(func,hwnd,message,wParam,(int)&st.cs);
STRUCT32_CREATESTRUCT32to16(&st.cs,lParam);
lpcs->lpszName = HIWORD(st.cs.lpszName) ?
MAKE_SEGPTR(st.cs.lpszName) : (SEGPTR)st.cs.lpszName;
lpcs->lpszClass = HIWORD(st.cs.lpszClass) ?
MAKE_SEGPTR(st.cs.lpszClass) : (SEGPTR)st.cs.lpszClass;
return result;
case WM_GETTEXT:
case WM_SETTEXT:
return CallWndProc32(func,hwnd,message,wParam,(int)lParam);
default:
fprintf(stderr,"No conversion function for message %d\n",message);
}
return CallWndProc32(func,hwnd,message,wParam,(int)lParam);
}
name shell
type win16
1 pascal RegOpenKey(long ptr ptr) RegOpenKey
2 pascal RegCreateKey(long ptr ptr) RegCreateKey
1 pascal RegOpenKey(long ptr ptr) RegOpenKey16
2 pascal RegCreateKey(long ptr ptr) RegCreateKey16
3 pascal RegCloseKey(long) RegCloseKey
4 pascal RegDeleteKey(long ptr) RegDeleteKey
5 pascal RegSetValue(long ptr long ptr long) RegSetValue
6 pascal RegQueryValue(long ptr ptr ptr) RegQueryValue
7 pascal RegEnumKey(long long ptr long) RegEnumKey
4 pascal RegDeleteKey(long ptr) RegDeleteKey16
5 pascal RegSetValue(long ptr long ptr long) RegSetValue16
6 pascal RegQueryValue(long ptr ptr ptr) RegQueryValue16
7 pascal RegEnumKey(long long ptr long) RegEnumKey16
9 pascal16 DragAcceptFiles(word word) DragAcceptFiles
11 pascal16 DragQueryFile(word s_word ptr s_word) DragQueryFile
12 pascal16 DragFinish(word) DragFinish
......
......@@ -15,7 +15,7 @@ typedef struct
GDIOBJHDR header;
BITMAP bitmap;
Pixmap pixmap;
SIZE size; /* For SetBitmapDimension() */
SIZE16 size; /* For SetBitmapDimension() */
} BITMAPOBJ;
/* GCs used for B&W and color bitmap operations */
......
......@@ -64,7 +64,7 @@ extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
CallTo16_long_wwl( func, CURRENT_DS, code, wParam, lParam )
#define CallTimeFuncProc( func, id, msg, dwUser, dw1, dw2 ) \
CallTo16_word_wwlll( func, CURRENT_DS, id, msg, dwUser, dw1, dw2 )
#define CallWndProc( func, ds, hwnd, msg, wParam, lParam ) \
#define CallWndProc16( func, ds, hwnd, msg, wParam, lParam ) \
CallTo16_long_wwwl( func, ds, hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
CallTo16_word_lwww( func, CURRENT_DS, lpch, ichCurrent, cch, code )
......@@ -73,9 +73,9 @@ extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
/* List of the 32-bit callback functions. This list is used */
/* by the build program to generate the file if1632/callto32.S */
extern LONG CallTo32_0( FARPROC );
extern LONG CallTo32_3( FARPROC, DWORD, DWORD, DWORD );
extern LONG CallTo32_4( FARPROC, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_0( FARPROC32 );
extern LONG CallTo32_3( FARPROC32, DWORD, DWORD, DWORD );
extern LONG CallTo32_4( FARPROC32, DWORD, DWORD, DWORD, DWORD );
#define CallTaskStart32( func ) \
CallTo32_0( func )
......@@ -111,11 +111,14 @@ extern LONG CallTo32_4( FARPROC, DWORD, DWORD, DWORD, DWORD );
(*func)( code, wParam, lParam )
#define CallTimeFuncProc( func, id, msg, dwUser, dw1, dw2 ) \
(*func)( id, msg, dwUser, dw1, dw2 )
#define CallWndProc( func, ds, hwnd, msg, wParam, lParam ) \
#define CallWndProc16( func, ds, hwnd, msg, wParam, lParam ) \
(*func)( hwnd, msg, wParam, lParam )
#define CallWndProc32( func, hwnd, msg, wParam, lParam ) \
(*func)( hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
(*func)( lpch, ichCurrent, cch, code )
#endif /* WINELIB */
......
......@@ -17,22 +17,29 @@ typedef struct tagCLASS
UINT32 magic; /* Magic number */
UINT32 cWindows; /* Count of existing windows */
UINT32 style; /* Class style */
UINT32 flags; /* Class flags (see below) */
WNDPROC16 lpfnWndProc; /* 16-bit window procedure */
INT32 cbClsExtra; /* Class extra bytes */
INT32 cbWndExtra; /* Window extra bytes */
SEGPTR lpszMenuName; /* Default menu name */
HANDLE16 hInstance; /* Module that created the task */
LPSTR menuNameA; /* Default menu name (ASCII string) */
LPWSTR menuNameW; /* Default menu name (Unicode) */
HINSTANCE32 hInstance; /* Module that created the task */
HICON16 hIcon; /* Default icon */
HICON16 hIconSm; /* Default small icon */
HCURSOR16 hCursor; /* Default cursor */
HBRUSH16 hbrBackground; /* Default background */
ATOM atomName; /* Name of the class */
HANDLE16 hdce; /* Class DCE (if CS_CLASSDC) */
WORD wExtra[1]; /* Class extra bytes */
LONG wExtra[1]; /* Class extra bytes */
} CLASS;
/* Class flags */
#define CLASS_FLAG_UNICODE 0x0001 /* Window procedure expects Unicode */
extern void CLASS_DumpClass( CLASS *class );
extern void CLASS_WalkClasses(void);
extern void CLASS_FreeModuleClasses( HMODULE hModule );
extern CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE16 hinstance );
extern CLASS * CLASS_FindClassByName( SEGPTR name, HINSTANCE hinstance );
#endif /* CLASS_H */
......@@ -3,7 +3,7 @@
#include "gdi.h"
extern HPALETTE COLOR_Init(void);
extern HPALETTE16 COLOR_Init(void);
extern int COLOR_ToPhysical( DC *dc, COLORREF color );
extern void COLOR_SetMapping( DC *dc, HANDLE map, HANDLE revMap, WORD size );
extern BOOL COLOR_IsSolid( COLORREF color );
......
......@@ -4,16 +4,16 @@
typedef struct {
DWORD dwStyle;
DWORD dwState;
HWND hWndEdit;
HWND hWndLBox;
WORD LBoxTop;
BOOL DropDownVisible;
short LastSel;
RECT RectEdit;
RECT RectButton;
BOOL bRedrawFlag;
DWORD dwStyle;
DWORD dwState;
HWND hWndEdit;
HWND hWndLBox;
WORD LBoxTop;
BOOL DropDownVisible;
short LastSel;
RECT16 RectEdit;
RECT16 RectButton;
BOOL bRedrawFlag;
} HEADCOMBO,*LPHEADCOMBO;
LRESULT ComboBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
......
......@@ -13,7 +13,7 @@ typedef struct
{
HBRUSH hbrushPattern;
HBITMAP hbitmapWallPaper;
SIZE bitmapSize;
SIZE16 bitmapSize;
BOOL fTileWallPaper;
} DESKTOPINFO;
......
......@@ -27,7 +27,7 @@ typedef struct
{
UINT gmBlackBoxX;
UINT gmBlackBoxY;
POINT gmptGlyphOrigin;
POINT16 gmptGlyphOrigin;
int gmCellIncX;
int gmCellIncY;
} GLYPHMETRICS,*LPGLYPHMETRICS;
......
......@@ -90,13 +90,13 @@ typedef struct
HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
HPEN hPen;
HPEN16 hPen;
HBRUSH hBrush;
HFONT hFont;
HBITMAP hBitmap;
HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
HANDLE hDevice;
HPALETTE hPalette;
HPALETTE16 hPalette;
WORD ROPmode;
WORD polyFillMode;
......@@ -214,15 +214,15 @@ typedef struct tagDC
#define STOCK_BLACK_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+BLACK_BRUSH))
#define STOCK_NULL_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+NULL_BRUSH))
#define STOCK_HOLLOW_BRUSH ((HBRUSH)(FIRST_STOCK_HANDLE+HOLLOW_BRUSH))
#define STOCK_WHITE_PEN ((HPEN)(FIRST_STOCK_HANDLE+WHITE_PEN))
#define STOCK_BLACK_PEN ((HPEN)(FIRST_STOCK_HANDLE+BLACK_PEN))
#define STOCK_NULL_PEN ((HPEN)(FIRST_STOCK_HANDLE+NULL_PEN))
#define STOCK_WHITE_PEN ((HPEN16)(FIRST_STOCK_HANDLE+WHITE_PEN))
#define STOCK_BLACK_PEN ((HPEN16)(FIRST_STOCK_HANDLE+BLACK_PEN))
#define STOCK_NULL_PEN ((HPEN16)(FIRST_STOCK_HANDLE+NULL_PEN))
#define STOCK_OEM_FIXED_FONT ((HFONT)(FIRST_STOCK_HANDLE+OEM_FIXED_FONT))
#define STOCK_ANSI_FIXED_FONT ((HFONT)(FIRST_STOCK_HANDLE+ANSI_FIXED_FONT))
#define STOCK_ANSI_VAR_FONT ((HFONT)(FIRST_STOCK_HANDLE+ANSI_VAR_FONT))
#define STOCK_SYSTEM_FONT ((HFONT)(FIRST_STOCK_HANDLE+SYSTEM_FONT))
#define STOCK_DEVICE_DEFAULT_FONT ((HFONT)(FIRST_STOCK_HANDLE+DEVICE_DEFAULT_FONT))
#define STOCK_DEFAULT_PALETTE ((HPALETTE)(FIRST_STOCK_HANDLE+DEFAULT_PALETTE))
#define STOCK_DEFAULT_PALETTE ((HPALETTE16)(FIRST_STOCK_HANDLE+DEFAULT_PALETTE))
#define STOCK_SYSTEM_FIXED_FONT ((HFONT)(FIRST_STOCK_HANDLE+SYSTEM_FIXED_FONT))
#define FIRST_STOCK_FONT STOCK_OEM_FIXED_FONT
......
......@@ -8,7 +8,7 @@
#ifndef __WINE_GRAPHICS_H
#define __WINE_GRAPHICS_H
extern void GRAPH_DrawReliefRect( HDC hdc, RECT *rect, int highlight_size,
extern void GRAPH_DrawReliefRect( HDC hdc, RECT16 *rect, int highlight_size,
int shadow_size, BOOL pressed );
extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest,
int xsrc, int ysrc, int width, int height );
......
#ifndef __WINE_HANDLE32_H
#define __WINE_HANDLE32_H
#include <malloc.h>
#include <stdlib.h>
#include "wintypes.h"
/* The _*_OBJECT structures contain information needed about each
......
......@@ -11,5 +11,23 @@
#include "winnt.h"
extern HANDLE32 SystemHeap;
extern HANDLE32 SegptrHeap;
extern int HEAP_IsInsideHeap( HANDLE32 heap, DWORD flags, LPCVOID ptr );
extern SEGPTR HEAP_GetSegptr( HANDLE32 heap, DWORD flags, LPCVOID ptr );
extern LPSTR HEAP_strdupA( HANDLE32 heap, DWORD flags, LPCSTR str );
/* SEGPTR helper macros */
#define SEGPTR_ALLOC(size) \
(HeapAlloc( SegptrHeap, 0, (size) ))
#define SEGPTR_NEW(type) \
((type *)HeapAlloc( SegptrHeap, 0, sizeof(type) ))
#define SEGPTR_STRDUP(str) \
(HIWORD(str) ? HEAP_strdupA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
#define SEGPTR_GET(ptr) \
(HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, (ptr) ) : (SEGPTR)(ptr))
#define SEGPTR_FREE(ptr) \
(HIWORD(ptr) ? HeapFree( SegptrHeap, 0, (ptr) ) : 0)
#endif /* __WINE_HEAP_H */
......@@ -5,7 +5,7 @@
typedef struct tagLISTSTRUCT {
MEASUREITEMSTRUCT mis;
UINT itemState;
RECT itemRect;
RECT16 itemRect;
HANDLE hData;
char *itemText;
struct tagLISTSTRUCT *lpNext;
......@@ -60,12 +60,12 @@ extern int ListBoxSetCurSel(LPHEADLIST lphl, WORD wIndex);
extern int ListBoxSetSel(LPHEADLIST lphl, WORD wIndex, WORD state);
extern int ListBoxGetSel(LPHEADLIST lphl, WORD wIndex);
extern LONG ListBoxDirectory(LPHEADLIST lphl, UINT attrib, LPCSTR filespec);
extern int ListBoxGetItemRect(LPHEADLIST lphl, WORD wIndex, LPRECT rect);
extern int ListBoxGetItemRect(LPHEADLIST lphl, WORD wIndex, LPRECT16 rect);
extern int ListBoxSetItemHeight(LPHEADLIST lphl, WORD wIndex, long height);
extern int ListBoxFindNextMatch(LPHEADLIST lphl, WORD wChar);
extern void ListBoxDrawItem (HWND hwnd, LPHEADLIST lphl, HDC hdc,
LPLISTSTRUCT lpls, RECT *rect, WORD itemAction,
LPLISTSTRUCT lpls, RECT16 *rect, WORD itemAction,
WORD itemState);
extern int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y);
extern void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls);
......
......@@ -31,17 +31,18 @@ typedef struct tagMDIWCL
typedef struct
{
WORD nActiveChildren;
HWND flagChildMaximized;
HWND hwndActiveChild;
HMENU hWindowMenu;
WORD idFirstChild;
HANDLE hFrameTitle;
WORD sbNeedUpdate;
WORD sbRecalc;
HBITMAP obmClose;
HBITMAP obmRestore;
HWND self;
WORD nActiveChildren;
HWND hwndChildMaximized;
HWND hwndActiveChild;
HMENU hWindowMenu;
WORD idFirstChild;
WORD nTotalCreated;
HANDLE hFrameTitle;
WORD sbNeedUpdate;
WORD sbRecalc;
HBITMAP obmClose;
HBITMAP obmRestore;
HWND self;
} MDICLIENTINFO;
#endif /* MDI_H */
......
......@@ -12,9 +12,9 @@ extern BOOL MENU_Init(void);
extern HMENU MENU_GetDefSysMenu(void);
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
int orgX, int orgY );
extern void MENU_TrackMouseMenuBar( HWND hwnd, POINT pt );
extern void MENU_TrackMouseMenuBar( HWND hwnd, POINT16 pt );
extern void MENU_TrackKbdMenuBar( WND*, UINT wParam, INT vkey);
extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT16 lprect,
HWND hwnd, BOOL suppress_draw );
extern LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam );
......@@ -22,7 +22,7 @@ typedef struct tagMENUITEM
{
WORD item_flags; /* Item flags */
UINT item_id; /* Item or popup id */
RECT rect; /* Item area (relative to menu window) */
RECT16 rect; /* Item area (relative to menu window) */
WORD xTab; /* X position of text after Tab */
HBITMAP hCheckBit; /* Bitmap for checked item */
HBITMAP hUnCheckBit; /* Bitmap for unchecked item */
......
......@@ -28,10 +28,10 @@ BOOL MF_MetaParam8(DC *dc, short func, short param1, short param2,
short param6, short param7, short param8);
BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush);
BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush);
BOOL MF_CreatePenIndirect(DC *dc, HPEN hPen, LOGPEN *logpen);
BOOL MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN *logpen);
BOOL MF_CreateFontIndirect(DC *dc, HFONT hFont, LOGFONT *logfont);
BOOL MF_TextOut(DC *dc, short x, short y, LPSTR str, short count);
BOOL MF_MetaPoly(DC *dc, short func, LPPOINT pt, short count);
BOOL MF_TextOut(DC *dc, short x, short y, LPCSTR str, short count);
BOOL MF_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count);
BOOL MF_BitBlt(DC *dcDest, short xDest, short yDest, short width,
short height, HDC hdcSrc, short xSrc, short ySrc, DWORD rop);
BOOL MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
......
......@@ -1247,16 +1247,16 @@ typedef struct {
typedef struct {
DWORD dwCallback;
#ifdef MCI_USE_OFFEXT
POINT ptOffset;
POINT ptExtent;
POINT16 ptOffset;
POINT16 ptExtent;
#else /* ifdef MCI_USE_OFFEXT */
RECT rc;
RECT16 rc;
#endif /* ifdef MCI_USE_OFFEXT */
} MCI_ANIM_RECT_PARMS, *LPMCI_ANIM_RECT_PARMS;
typedef struct {
DWORD dwCallback;
RECT rc;
RECT16 rc;
HDC hDC;
} MCI_ANIM_UPDATE_PARMS, *LPMCI_ANIM_UPDATE_PARMS;
......@@ -1315,23 +1315,23 @@ typedef struct {
typedef struct {
DWORD dwCallback;
#ifdef MCI_USE_OFFEXT
POINT ptOffset;
POINT ptExtent;
POINT16 ptOffset;
POINT16 ptExtent;
#else /* ifdef MCI_USE_OFFEXT */
RECT rc;
RECT16 rc;
#endif /* ifdef MCI_USE_OFFEXT */
} MCI_OVLY_RECT_PARMS, *LPMCI_OVLY_RECT_PARMS;
typedef struct {
DWORD dwCallback;
LPCSTR lpfilename;
RECT rc;
RECT16 rc;
} MCI_OVLY_SAVE_PARMS, *LPMCI_OVLY_SAVE_PARMS;
typedef struct {
DWORD dwCallback;
LPCSTR lpfilename;
RECT rc;
RECT16 rc;
} MCI_OVLY_LOAD_PARMS, *LPMCI_OVLY_LOAD_PARMS;
......
......@@ -126,8 +126,8 @@ extern HINSTANCE MODULE_GetInstance( HMODULE hModule );
extern WORD MODULE_GetOrdinal( HMODULE hModule, const char *name );
extern SEGPTR MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal );
extern BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset );
extern FARPROC MODULE_GetWndProcEntry16( const char *name );
extern FARPROC MODULE_GetWndProcEntry32( const char *name );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC32 MODULE_GetWndProcEntry32( const char *name );
/* builtin.c */
extern BOOL BUILTIN_Init(void);
......
......@@ -9,17 +9,16 @@
#include "win.h"
extern void NC_GetInsideRect( HWND hwnd, RECT *rect );
extern void NC_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack );
extern void NC_GetMinMaxInfo( HWND hwnd, POINT16 *maxSize, POINT16 *maxPos,
POINT16 *minTrack, POINT16 *maxTrack );
extern void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint );
extern LONG NC_HandleNCPaint( HWND hwnd , HRGN clip);
extern LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam );
extern LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS *params );
extern LONG NC_HandleNCHitTest( HWND hwnd, POINT pt );
extern LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS16 *params );
extern LONG NC_HandleNCHitTest( HWND hwnd, POINT16 pt );
extern LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam );
extern LONG NC_HandleNCLButtonDblClk( WND *pWnd, WPARAM wParam, LPARAM lParam);
extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT pt );
extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT16 pt );
extern LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam );
#endif /* __WINE_NONCLIENT_H */
......@@ -159,7 +159,7 @@ typedef struct _OLESERVERDOCVTBL {
OLESTATUS (*Save)(LPOLESERVERDOC);
OLESTATUS (*Close)(LPOLESERVERDOC);
OLESTATUS (*SetHostNames)(LPOLESERVERDOC,OLE_LPCSTR,OLE_LPCSTR);
OLESTATUS (*SetDocDimensions)(LPOLESERVERDOC,LPRECT);
OLESTATUS (*SetDocDimensions)(LPOLESERVERDOC,LPRECT16);
OLESTATUS (*GetObject)(LPOLESERVERDOC,OLE_LPCSTR,LPOLEOBJECT*,LPOLECLIENT);
OLESTATUS (*Release)(LPOLESERVERDOC);
OLESTATUS (*SetColorScheme)(LPOLESERVERDOC,LPLOGPALETTE);
......@@ -204,7 +204,7 @@ typedef struct _OLEOBJECTVTBL {
OLESTATUS (*GetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE *);
OLESTATUS (*SetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE);
OLESTATUS (*SetTargetDevice)(LPOLEOBJECT,HGLOBAL);
OLESTATUS (*SetBounds)(LPOLEOBJECT,LPRECT);
OLESTATUS (*SetBounds)(LPOLEOBJECT,LPRECT16);
OLESTATUS (*EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
OLESTATUS (*SetColorScheme)(LPOLEOBJECT,LPLOGPALETTE);
OLESTATUS (*Delete)(LPOLEOBJECT);
......@@ -214,8 +214,8 @@ typedef struct _OLEOBJECTVTBL {
OLESTATUS (*CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT *);
OLESTATUS (*Equal)(LPOLEOBJECT,LPOLEOBJECT);
OLESTATUS (*CopyToClipBoard)(LPOLEOBJECT);
OLESTATUS (*Draw)(LPOLEOBJECT,HDC,LPRECT,LPRECT,HDC);
OLESTATUS (*Activate)(LPOLEOBJECT,UINT,BOOL,BOOL,HWND,LPRECT);
OLESTATUS (*Draw)(LPOLEOBJECT,HDC,LPRECT16,LPRECT16,HDC);
OLESTATUS (*Activate)(LPOLEOBJECT,UINT,BOOL,BOOL,HWND,LPRECT16);
OLESTATUS (*Execute)(LPOLEOBJECT,HGLOBAL,UINT);
OLESTATUS (*Close)(LPOLEOBJECT);
OLESTATUS (*Update)(LPOLEOBJECT);
......@@ -226,7 +226,7 @@ typedef struct _OLEOBJECTVTBL {
OLESTATUS (*Rename)(LPOLEOBJECT,OLE_LPCSTR);
OLESTATUS (*QueryName)(LPOLEOBJECT,LPSTR,LPUINT16);
OLESTATUS (*QueryType)(LPOLEOBJECT,LPLONG);
OLESTATUS (*QueryBounds)(LPOLEOBJECT,LPRECT);
OLESTATUS (*QueryBounds)(LPOLEOBJECT,LPRECT16);
OLESTATUS (*QuerySize)(LPOLEOBJECT,LPDWORD);
OLESTATUS (*QueryOpen)(LPOLEOBJECT);
OLESTATUS (*QueryOutOfDate)(LPOLEOBJECT);
......
......@@ -25,6 +25,6 @@ typedef struct
#endif
extern int PEN_GetObject( PENOBJ * pen, int count, LPSTR buffer );
extern HPEN PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen );
extern HPEN16 PEN_SelectObject( DC * dc, HPEN16 hpen, PENOBJ * pen );
#endif /* __WINE_PEN_H */
/* $Id$
*/
#ifndef REGFUNC_H
#define REGFUNC_H
#include "wine.h"
#include "stackframe.h"
#define _CONTEXT ((struct sigcontext_struct *) CURRENT_STACK16->args)
#define _AX (_CONTEXT->sc_eax)
#define _BX (_CONTEXT->sc_ebx)
#define _CX (_CONTEXT->sc_ecx)
#define _DX (_CONTEXT->sc_edx)
#define _SI (_CONTEXT->sc_esi)
#define _DI (_CONTEXT->sc_edi)
#define _DS (_CONTEXT->sc_ds)
#define _ES (_CONTEXT->sc_es)
extern void ReturnFromRegisterFunc(void);
#endif /* REGFUNC_H */
......@@ -18,6 +18,6 @@ typedef struct
extern BOOL REGION_DeleteObject( HRGN hrgn, RGNOBJ * obj );
extern BOOL REGION_FrameRgn(HRGN dest,HRGN src,int x,int y);
extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT32 x, INT32 y );
#endif /* __WINE_REGION_H */
/*
* Relay32 definitions
*
* Copyright 1995 Martin von Loewis
*/
#ifndef __WINE_RELAY32_H
#define __WINE_RELAY32_H
#include "struct32.h"
typedef struct tagWNDCLASSA{
UINT style;
WNDPROC lpfnWndProc;
int cbClsExtra;
int cbWndExtra;
DWORD hInstance;
DWORD hIcon;
DWORD hCursor;
DWORD hbrBackground;
char* lpszMenuName;
char* lpszClassName;
}WNDCLASSA;
ATOM USER32_RegisterClassA(WNDCLASSA *);
LRESULT USER32_DefWindowProcA(DWORD hwnd,DWORD msg,DWORD wParam,DWORD lParam);
BOOL USER32_GetMessageA(MSG32* lpmsg,DWORD hwnd,DWORD min,DWORD max);
HDC USER32_BeginPaint(DWORD hwnd,PAINTSTRUCT32 *lpps);
BOOL USER32_EndPaint(DWORD hwnd,PAINTSTRUCT32 *lpps);
#endif
......@@ -22,6 +22,6 @@ typedef struct
extern LONG ScrollBarWndProc( HWND hwnd, WORD uMsg, WORD wParam, LONG lParam );
extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, int nBar );
extern void SCROLL_HandleScrollEvent( HWND hwnd, int nBar,
WORD msg, POINT pt); /* scroll.c */
WORD msg, POINT16 pt );
#endif /* SCROLL_H */
......@@ -26,7 +26,7 @@ extern void SHELL_Init();
typedef struct { /* structure for dropped files */
WORD wSize;
POINT ptMousePos;
POINT16 ptMousePos;
BOOL fInNonClientArea;
/* memory block with filenames follows */
} DROPFILESTRUCT, *LPDROPFILESTRUCT;
......
......@@ -15,6 +15,7 @@ void STRING32_UniToAnsi(LPSTR dest,LPCWSTR src);
void STRING32_AnsiToUni(LPWSTR dest,LPCSTR src);
LPSTR STRING32_DupUniToAnsi(LPCWSTR src);
LPWSTR STRING32_DupAnsiToUni(LPCSTR src);
LPWSTR STRING32_lstrcpyW(LPWSTR dst, LPCWSTR src);
int STRING32_lstrcmpnW(LPCWSTR a,LPCWSTR b,DWORD len);
int STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len);
DWORD STRING32_lstrlenW(LPCWSTR);
......
......@@ -7,44 +7,23 @@
#pragma pack(1)
#endif
typedef struct tagRECT32
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT32;
void STRUCT32_RECT32to16(const RECT32*,RECT*);
void STRUCT32_RECT16to32(const RECT*,RECT32*);
typedef struct tagPOINT32
{
LONG x;
LONG y;
} POINT32;
typedef struct tagSIZE32
{
LONG cx;
LONG cy;
} SIZE32;
void STRUCT32_POINT32to16(const POINT32*,POINT*);
void STRUCT32_POINT16to32(const POINT*,POINT32*);
void STRUCT32_SIZE16to32(const SIZE* p16, SIZE32* p32);
typedef struct tagMINMAXINFO32
{
POINT32 ptReserved;
POINT32 ptMaxSize;
POINT32 ptMaxPosition;
POINT32 ptMinTrackSize;
POINT32 ptMaxTrackSize;
} MINMAXINFO32;
void STRUCT32_RECT32to16(const RECT32*,RECT16*);
void STRUCT32_RECT16to32(const RECT16*,RECT32*);
void STRUCT32_POINT32to16(const POINT32*,POINT16*);
void STRUCT32_POINT16to32(const POINT16*,POINT32*);
void STRUCT32_SIZE16to32(const SIZE16*, SIZE32*);
extern void STRUCT32_MINMAXINFO32to16( const MINMAXINFO32*, MINMAXINFO16* );
extern void STRUCT32_MINMAXINFO16to32( const MINMAXINFO16*, MINMAXINFO32* );
extern void STRUCT32_WINDOWPOS32to16( const WINDOWPOS32*, WINDOWPOS16* );
extern void STRUCT32_WINDOWPOS16to32( const WINDOWPOS16*, WINDOWPOS32* );
extern void STRUCT32_NCCALCSIZE32to16Flat( const NCCALCSIZE_PARAMS32 *from,
NCCALCSIZE_PARAMS16 *to,
int validRects );
extern void STRUCT32_NCCALCSIZE16to32Flat( const NCCALCSIZE_PARAMS16* from,
NCCALCSIZE_PARAMS32* to,
int validRects );
void STRUCT32_MINMAXINFO32to16(const MINMAXINFO32*,MINMAXINFO*);
void STRUCT32_MINMAXINFO16to32(const MINMAXINFO*,MINMAXINFO32*);
typedef struct {
DWORD style;
......@@ -79,60 +58,8 @@ typedef struct tagMSG32
void STRUCT32_MSG16to32(MSG *msg16,MSG32 *msg32);
void STRUCT32_MSG32to16(MSG32 *msg32,MSG *msg16);
typedef struct tagPAINTSTRUCT32
{
DWORD hdc;
DWORD fErase;
RECT32 rcPaint;
DWORD fRestore;
DWORD fIncUpdate;
BYTE rgbReserved[32];
} PAINTSTRUCT32;
typedef struct tagWINDOWPOS32
{
DWORD hwnd;
DWORD hwndInsertAfter;
LONG x;
LONG y;
LONG cx;
LONG cy;
DWORD flags;
} WINDOWPOS32;
void STRUCT32_WINDOWPOS32to16(const WINDOWPOS32*,WINDOWPOS*);
void STRUCT32_WINDOWPOS16to32(const WINDOWPOS*,WINDOWPOS32*);
typedef struct tagNCCALCSIZE_PARAMS32
{
RECT32 rgrc[3];
WINDOWPOS32 *lppos;
} NCCALCSIZE_PARAMS32;
void STRUCT32_NCCALCSIZE32to16Flat(const NCCALCSIZE_PARAMS32*,
NCCALCSIZE_PARAMS*);
void STRUCT32_NCCALCSIZE16to32Flat(const NCCALCSIZE_PARAMS* from,
NCCALCSIZE_PARAMS32* to);
typedef struct tagCREATESTRUCT32
{
DWORD lpCreateParams;
DWORD hInstance;
DWORD hMenu;
DWORD hwndParent;
LONG cy;
LONG cx;
LONG y;
LONG x;
LONG style;
LPSTR lpszName;
LPSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCT32;
typedef CREATESTRUCT32 CREATESTRUCTA;
void STRUCT32_CREATESTRUCT32to16(const CREATESTRUCT32*,CREATESTRUCT*);
void STRUCT32_CREATESTRUCT16to32(const CREATESTRUCT*,CREATESTRUCT32*);
void STRUCT32_CREATESTRUCT32Ato16(const CREATESTRUCT32A*,CREATESTRUCT16*);
void STRUCT32_CREATESTRUCT16to32A(const CREATESTRUCT16*,CREATESTRUCT32A*);
typedef struct {
BYTE bWidth;
......
......@@ -17,9 +17,9 @@ struct SysColorObjects
HBRUSH hbrushInactiveCaption; /* COLOR_INACTIVECAPTION */
HBRUSH hbrushMenu; /* COLOR_MENU */
HBRUSH hbrushWindow; /* COLOR_WINDOW */
HPEN hpenWindowFrame; /* COLOR_WINDOWFRAME */
HPEN16 hpenWindowFrame; /* COLOR_WINDOWFRAME */
/* COLOR_MENUTEXT */
HPEN hpenWindowText; /* COLOR_WINDOWTEXT */
HPEN16 hpenWindowText; /* COLOR_WINDOWTEXT */
/* COLOR_CAPTIONTEXT */
HBRUSH hbrushActiveBorder; /* COLOR_ACTIVEBORDER */
HBRUSH hbrushInactiveBorder; /* COLOR_INACTIVEBORDER */
......
......@@ -22,7 +22,7 @@
#define ICONTITLE_CLASS_NAME "#32772" /* IconTitle */
#define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
#define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
#define DESKTOP_CLASS_ATOM ((ATOM)32769) /* Desktop */
#define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
#define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
#define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
......@@ -35,13 +35,13 @@ typedef struct tagWND
struct tagWND *owner; /* Window owner */
CLASS *class; /* Window class */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND hwndSelf; /* Handle of this window */
HANDLE hInstance; /* Window hInstance (from CreateWindow) */
RECT rectClient; /* Client area rel. to parent client area */
RECT rectWindow; /* Whole window rel. to parent client area */
RECT rectNormal; /* Window rect. when in normal state */
POINT ptIconPos; /* Icon position */
POINT ptMaxPos; /* Maximized window position */
HWND16 hwndSelf; /* Handle of this window */
HINSTANCE16 hInstance; /* Window hInstance (from CreateWindow) */
RECT16 rectClient; /* Client area rel. to parent client area */
RECT16 rectWindow; /* Whole window rel. to parent client area */
RECT16 rectNormal; /* Window rect. when in normal state */
POINT16 ptIconPos; /* Icon position */
POINT16 ptMaxPos; /* Maximized window position */
HGLOBAL hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HWND hwndLastActive;/* Last active popup hwnd */
......@@ -57,7 +57,7 @@ typedef struct tagWND
Window window; /* X window (only for top-level windows) */
HMENU hSysMenu; /* window's copy of System Menu */
HANDLE hProp; /* Handle of Properties List */
WORD wExtra[1]; /* Window extra bytes */
DWORD wExtra[1]; /* Window extra bytes */
} WND;
/* WND flags values */
......@@ -67,9 +67,10 @@ typedef struct tagWND
#define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
#define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
#define WIN_NO_REDRAW 0x0020 /* WM_SETREDRAW called for this window */
#define WIN_GOT_SIZEMSG 0x0040 /* WM_SIZE has been sent to the window */
#define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
#define WIN_UNICODE 0x0200 /* Window procedure expects Unicode */
/* Window functions */
extern WND *WIN_FindWndPtr( HWND hwnd );
......
......@@ -119,7 +119,7 @@ int WinMain(HINSTANCE, HINSTANCE prev, char *cmd, int show);
#define GMEM_FIXED 0x0000
#define GMEM_MOVEABLE 0x0002
HACCEL LoadAcceleratorsA( HINSTANCE, const char *);
HACCEL32 LoadAcceleratorsA( HINSTANCE, const char *);
#define FreeModule(hLibModule) FreeLibrary((hLibModule))
#define MakeProcInstance(lpProc,hInstance) (lpProc)
#define FreeProcInstance(lpProc) (lpProc)
......
......@@ -18,6 +18,7 @@
#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
#define HEAP_CREATE_ALIGN_16 0x00010000
#define HEAP_CREATE_ENABLE_TRACING 0x00020000
#define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
#define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */
#endif /* __WINE_WINNT_H */
......@@ -22,7 +22,7 @@ typedef struct
WORD valid;
WORD wMagic;
HWND hwndParent;
WINDOWPOS winPos[1];
WINDOWPOS16 winPos[1];
} DWP;
typedef struct
......@@ -36,10 +36,10 @@ extern void WINPOS_FindIconPos( HWND hwnd );
extern BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus);
extern BOOL WINPOS_ChangeActiveWindow( HWND hwnd, BOOL mouseMsg );
extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT *newWindowRect, RECT *oldWindowRect,
RECT *oldClientRect, SEGPTR winpos,
RECT *newClientRect );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos );
extern INT WINPOS_WindowFromPoint( POINT pt, WND **ppWnd );
RECT16 *newWindowRect, RECT16 *oldWindowRect,
RECT16 *oldClientRect, SEGPTR winpos,
RECT16 *newClientRect );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS16 *winpos );
extern INT16 WINPOS_WindowFromPoint( POINT16 pt, WND **ppWnd );
#endif /* __WINE_WINPOS_H */
......@@ -59,6 +59,7 @@
#define REG_OPTION_NON_VOLATILE 0x00000000
#define REG_OPTION_VOLATILE 0x00000001
#define REG_OPTION_CREATE_LINK 0x00000002
#define REG_OPTION_TAINTED 0x80000000
#define REG_CREATED_NEW_KEY 0x00000001
#define REG_OPENED_EXISTING_KEY 0x00000002
......
......@@ -41,8 +41,8 @@
# define WINELIB_NAME_AW(func) func##16
# endif /* WINELIB32 */
#else /* WINELIB */
# define WINELIB_NAME(func) /* nothing */
# define WINELIB_NAME_AW(func) /* nothing */
# define WINELIB_NAME(func) this is a syntax error
# define WINELIB_NAME_AW(func) this is a syntax error
#endif /* WINELIB */
#ifdef WINELIB
......@@ -62,12 +62,13 @@ typedef int INT32;
typedef unsigned int UINT32;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned short BOOL;
typedef unsigned char BYTE;
typedef long LONG;
typedef char CHAR;
/* Some systems might have wchar_t, but we really need 16 bit characters */
typedef unsigned short WCHAR;
typedef unsigned short BOOL16;
typedef int BOOL32;
/* Handles types. These are the same for emulator and library. */
......@@ -186,6 +187,7 @@ DECL_WINELIB_TYPE(INT);
DECL_WINELIB_TYPE(LPINT);
DECL_WINELIB_TYPE(LPUINT);
DECL_WINELIB_TYPE(UINT);
DECL_WINELIB_TYPE(BOOL);
DECL_WINELIB_TYPE(WPARAM);
DECL_WINELIB_TYPE(HACCEL);
......@@ -232,18 +234,15 @@ DECL_WINELIB_TYPE(WNDPROC);
#ifndef WINELIB
typedef INT16 INT;
typedef UINT16 UINT;
typedef BOOL16 BOOL;
typedef WPARAM16 WPARAM;
typedef HANDLE16 HACCEL;
typedef HANDLE16 HANDLE;
typedef HANDLE16 HBITMAP;
typedef HANDLE16 HBRUSH;
typedef HANDLE16 HCURSOR;
typedef HANDLE16 HDC;
typedef HANDLE16 HDROP;
typedef HANDLE16 HDRVR;
typedef HANDLE16 HDWP;
typedef HANDLE16 HFONT;
typedef HANDLE16 HGDIOBJ;
typedef HANDLE16 HGLOBAL;
typedef HANDLE16 HICON;
typedef HANDLE16 HINSTANCE;
......@@ -254,8 +253,6 @@ typedef HANDLE16 HMIDIIN;
typedef HANDLE16 HMIDIOUT;
typedef HANDLE16 HMMIO;
typedef HANDLE16 HMODULE;
typedef HANDLE16 HPALETTE;
typedef HANDLE16 HPEN;
typedef HANDLE16 HQUEUE;
typedef HANDLE16 HRGN;
typedef HANDLE16 HRSRC;
......@@ -335,17 +332,19 @@ typedef FARPROC HOOKPROC;
/* Macros to split words and longs. */
#define LOBYTE(w) ((BYTE)(WORD)(w))
#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
#define LOBYTE(w) ((BYTE)(WORD)(w))
#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
#define LOWORD(l) ((WORD)(DWORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define LOWORD(l) ((WORD)(DWORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
#define SLOWORD(l) ((INT16)(LONG)(l))
#define SHIWORD(l) ((INT16)((LONG)(l) >> 16))
#define SLOWORD(l) ((INT16)(LONG)(l))
#define SHIWORD(l) ((INT16)((LONG)(l) >> 16))
#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
#define MAKELPARAM(low,high) ((LPARAM)MAKELONG(low,high))
#define MAKEWPARAM(low,high) ((WPARAM32)MAKELONG(low,high))
#define SELECTOROF(ptr) (HIWORD(ptr))
#define OFFSETOF(ptr) (LOWORD(ptr))
......
......@@ -86,7 +86,21 @@ typedef struct
HICON32 hIconSm;
} WNDCLASSEX32W, *LPWNDCLASSEX32W;
typedef void WNDCLASSEX16; /* There's no WNDCLASSEX in Win16 */
typedef struct
{
UINT32 cbSize;
UINT32 style;
WNDPROC16 lpfnWndProc;
INT16 cbClsExtra;
INT16 cbWndExtra;
HANDLE16 hInstance;
HICON16 hIcon;
HCURSOR16 hCursor;
HBRUSH16 hbrBackground;
SEGPTR lpszMenuName;
SEGPTR lpszClassName;
HICON16 hIconSm;
} WNDCLASSEX16, *LPWNDCLASSEX16;
DECL_WINELIB_TYPE_AW(WNDCLASS);
DECL_WINELIB_TYPE_AW(LPWNDCLASS);
......@@ -125,23 +139,7 @@ DECL_WINELIB_TYPE_AW(LPWNDCLASSEX);
#define GCW_STYLE (-26)
#define GCL_STYLE GCW_STYLE
#define GCW_ATOM (-32)
#define GCL_HICONSM (-34)
ATOM RegisterClass16(const WNDCLASS16*);
ATOM RegisterClass32A(const WNDCLASS32A *);
ATOM RegisterClass32W(const WNDCLASS32W *);
#define RegisterClass WINELIB_NAME_AW(RegisterClass)
ATOM RegisterClassEx32A(const WNDCLASSEX32A *);
ATOM RegisterClassEx32W(const WNDCLASSEX32W *);
#define RegisterClassEx WINELIB_NAME_AW(RegisterClassEx)
BOOL UnregisterClass16(SEGPTR,HINSTANCE16);
BOOL UnregisterClass32A(LPCSTR,HINSTANCE32);
BOOL UnregisterClass32W(LPCWSTR,HINSTANCE32);
#define UnregisterClass WINELIB_NAME_AW(UnregisterClass)
BOOL GetClassInfo(HANDLE,SEGPTR,WNDCLASS16 *);
LONG GetClassLong(HWND,short);
int GetClassName(HWND,LPSTR,short);
LONG SetClassLong(HWND,short,LONG);
#define GCW_HICONSM (-34)
#define GCL_HICONSM GCW_HICONSM
#endif /* __WINE_WINUSER_H */
......@@ -2,9 +2,7 @@ TOPSRC = @top_srcdir@
MODULE = library
C_SRCS = \
atom.c \
arch.c \
heap.c \
libres.c \
miscstubs.c \
sup.c \
......
/*
* Atom table functions
*
* Copyright 1993, 1994, 1995 Alexandre Julliard
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "windows.h"
#include "xmalloc.h"
#ifdef CONFIG_IPC
#include "dde_atom.h"
#include "options.h"
#endif
#define MIN_STR_ATOM 0xc000
typedef struct
{
WORD refCount;
BYTE length;
char* str;
} ATOMDATA;
typedef struct
{
void* next;
ATOMDATA a2h[16];
} ATOMtoHANDLEtable;
static ATOMtoHANDLEtable* GlobalAtomTable = NULL;
static ATOMtoHANDLEtable* LocalAtomTable = NULL;
/***********************************************************************
* ATOM_Init
*
* Global table initialisation.
*/
BOOL ATOM_Init(void)
{
return TRUE;
}
/***********************************************************************
* ATOM_AddAtom
*/
static ATOM ATOM_AddAtom( ATOMtoHANDLEtable** tableptr, SEGPTR name )
{
ATOMDATA* FirstUnused;
ATOM FirstUnusedIndex;
ATOM Index;
ATOMtoHANDLEtable* table;
int i,len;
char *str;
/* Check for integer atom */
if (!HIWORD(name)) return (ATOM)LOWORD(name);
str = (char*)name;
if (str[0] == '#') return atoi( &str[1] );
if ((len = strlen( str )) > 255) len = 255;
table = *tableptr;
FirstUnused = NULL;
FirstUnusedIndex = 0;
Index = MIN_STR_ATOM;
while (table)
{
for(i=0; i<16; i++, Index++)
{
if (!table->a2h[i].refCount)
{
FirstUnused=&table->a2h[i];
FirstUnusedIndex=Index;
}
else if ((table->a2h[i].length == len) &&
(!lstrncmpi( table->a2h[i].str, str, len )))
{
table->a2h[i].refCount++;
return Index;
}
}
tableptr = (ATOMtoHANDLEtable**)&table->next;
table = table->next;
}
if(!FirstUnused)
{
*tableptr = xmalloc(sizeof(ATOMtoHANDLEtable));
(*tableptr)->next = NULL;
for(i=0; i<16; i++)
{
(*tableptr)->a2h[i].str = NULL;
(*tableptr)->a2h[i].refCount = 0;
}
FirstUnused = (*tableptr)->a2h;
FirstUnusedIndex = Index;
}
if((FirstUnused->str = malloc(len+1)))
{
memcpy( FirstUnused->str, str, len );
FirstUnused->str[len] = 0;
}
else
return 0;
FirstUnused->refCount = 1;
FirstUnused->length = len;
return FirstUnusedIndex;
}
/***********************************************************************
* ATOM_DeleteAtom
*/
static ATOM ATOM_DeleteAtom( ATOMtoHANDLEtable** tableptr, ATOM atom )
{
ATOMtoHANDLEtable* table;
int i;
ATOM Index;
if (atom < MIN_STR_ATOM) return 0; /* Integer atom */
Index = MIN_STR_ATOM;
table = *tableptr;
while (table)
{
if(atom-Index < 16)
{
i=atom-Index;
/* Delete atom */
if (--table->a2h[i].refCount == 0)
{
free(table->a2h[i].str);
table->a2h[i].str=NULL;
}
return 0;
}
else
{
Index+=16;
table = table->next;
}
}
return atom;
}
/***********************************************************************
* ATOM_FindAtom
*/
static ATOM ATOM_FindAtom( ATOMtoHANDLEtable** tableptr, SEGPTR name )
{
ATOM Index;
ATOMtoHANDLEtable* table;
int i,len;
char *str;
/* Check for integer atom */
if (!HIWORD(name)) return (ATOM)LOWORD(name);
str = (char*)name;
if (str[0] == '#') return atoi( &str[1] );
if ((len = strlen( str )) > 255) len = 255;
table=*tableptr;
Index=MIN_STR_ATOM;
while (table)
{
for(i=0; i<16; i++, Index++)
{
if ((table->a2h[i].refCount != 0) &&
(table->a2h[i].length == len) &&
(!lstrncmpi( table->a2h[i].str, str, len )))
return Index;
}
table=table->next;
}
return 0;
}
/***********************************************************************
* ATOM_GetAtomName
*/
static WORD ATOM_GetAtomName( ATOMtoHANDLEtable** tableptr, ATOM atom,
LPSTR buffer, short count )
{
ATOMtoHANDLEtable* table;
ATOM Index;
char * strPtr=NULL;
int i,len=0;
char text[8];
if (!count) return 0;
if (atom < MIN_STR_ATOM)
{
sprintf( text, "#%d", atom );
len = strlen(text);
strPtr = text;
}
else
{
Index = MIN_STR_ATOM;
table = *tableptr;
while (table)
{
if(atom-Index < 16)
{
i=atom-Index;
if (table->a2h[i].refCount == 0)
table=NULL;
else
{
len = table->a2h[i].length;
strPtr = table->a2h[i].str;
}
break;
}
else
{
Index+=16;
table = table->next;
}
}
if(!table)return 0;
}
if (len >= count) len = count-1;
memcpy( buffer, strPtr, len );
buffer[len] = '\0';
return len;
}
/***********************************************************************
* InitAtomTable (KERNEL.68)
*/
WORD InitAtomTable( WORD entries )
{
return entries;
}
/***********************************************************************
* GetAtomHandle (KERNEL.73)
*/
HANDLE GetAtomHandle( ATOM atom )
{
fprintf(stderr,"JBP: GetAtomHandle() called (obsolete).\n");
return 0;
}
/***********************************************************************
* AddAtom (KERNEL.70)
*/
ATOM AddAtom( SEGPTR str )
{
return ATOM_AddAtom( &LocalAtomTable, (SEGPTR)str );
}
/***********************************************************************
* DeleteAtom (KERNEL.71)
*/
ATOM DeleteAtom( ATOM atom )
{
return ATOM_DeleteAtom( &LocalAtomTable, atom );
}
/***********************************************************************
* FindAtom (KERNEL.69)
*/
ATOM FindAtom( SEGPTR str )
{
return ATOM_FindAtom( &LocalAtomTable, str );
}
/***********************************************************************
* GetAtomName (KERNEL.72)
*/
WORD GetAtomName( ATOM atom, LPSTR buffer, short count )
{
return ATOM_GetAtomName( &LocalAtomTable, atom, buffer, count );
}
/***********************************************************************
* GlobalAddAtom (USER.268)
*/
ATOM GlobalAddAtom( SEGPTR str )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalAddAtom( str );
#endif
return ATOM_AddAtom( &GlobalAtomTable, str );
}
/***********************************************************************
* GlobalDeleteAtom (USER.269)
*/
ATOM GlobalDeleteAtom( ATOM atom )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalDeleteAtom( atom );
#endif
return ATOM_DeleteAtom( &GlobalAtomTable, atom );
}
/***********************************************************************
* GlobalFindAtom (USER.270)
*/
ATOM GlobalFindAtom( SEGPTR str )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalFindAtom( str );
#endif
return ATOM_FindAtom( &GlobalAtomTable, str );
}
/***********************************************************************
* GlobalGetAtomName (USER.271)
*/
WORD GlobalGetAtomName( ATOM atom, LPSTR buffer, short count )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalGetAtomName( atom, buffer, count );
#endif
return ATOM_GetAtomName( &GlobalAtomTable, atom, buffer, count );
}
/*
* Memory alllocation for the Wine Library toolkit
*
* Copyright (C) 1994 Miguel de Icaza
*
* All the memory management is being done by the libc malloc and friends.
*/
/* #ifndef __STDC__ */
#include <malloc.h>
#include <stdio.h>
#include <string.h>
/* #endif */
#include "windows.h"
#include "xmalloc.h"
#ifdef WINELIB16
/* Controls the blocks per handle table */
#define MAXBLOCKS 1024
typedef struct handle_table {
struct handle_table *next;
void *blocks [MAXBLOCKS];
} handle_table_t;
static handle_table_t handle_table;
static void **HEAP_GetFreeSlot (HANDLE *hNum)
{
handle_table_t *table, *last;
int i, j;
for (table = &handle_table, j = 0; table; table = table->next, j++){
for (i = 0; i < MAXBLOCKS; i++)
if (!table->blocks [i])
goto AssignBlock;
last = table;
}
/* No free slots */
last->next = xmalloc (sizeof (handle_table_t));
table = last->next;
memset (table, 0, sizeof (handle_table_t));
i = 0;
AssignBlock:
*hNum = j*MAXBLOCKS+i;
return &table->blocks [i];
}
static void HEAP_Handle_is_Zero ()
{
printf ("Warning: Handle is Zero, segmentation fault comming\n");
}
static void **HEAP_FindSlot (HANDLE hNum)
{
handle_table_t *table = &handle_table;
int i, j;
if (!hNum)
HEAP_Handle_is_Zero ();
hNum--;
for (j = hNum; j > MAXBLOCKS; j -= MAXBLOCKS){
table = table->next;
if (!table) return 0;
}
return &table->blocks [hNum%MAXBLOCKS];
}
HANDLE LocalAlloc (WORD flags, WORD bytes)
{
void *m;
void **slot;
HANDLE hMem;
slot = HEAP_GetFreeSlot (&hMem);
if ((m = malloc (bytes)))
{
*slot = m;
if (flags & LMEM_ZEROINIT) memset( m, 0, bytes );
#ifdef DEBUG_HEAP
printf ("Handle %d [%d] = %p\n", hMem+1, bytes, m);
#endif
return hMem+1;
}
return 0;
}
WORD LocalCompact (WORD min_free)
{
return min_free;
}
WORD LocalFlags (HANDLE hMem)
{
return 0;
}
HANDLE LocalFree (HANDLE hMem)
{
void **m;
if(!hMem)
return 0;
m = HEAP_FindSlot (hMem);
free (*m);
*m = 0;
return 0;
}
BOOL LocalInit (WORD segment, WORD start, WORD end)
{
return 1;
}
WORD LocalLock (HANDLE hMem)
{
void **m = HEAP_FindSlot (hMem);
#ifdef DEBUG_HEAP
printf (">%d->%p\n", hMem, *m);
#endif
return m ? *m : 0;
}
HANDLE LocalReAlloc (HANDLE hMem, WORD flags, WORD bytes)
{
void **m = HEAP_FindSlot (hMem);
xrealloc (*m, bytes);
}
WORD LocalSize (HANDLE hMem)
{
/* Not implemented yet */
}
BOOL LocalUnlock (HANDLE hMem)
{
return 0;
}
HANDLE GlobalAlloc (WORD flags, DWORD size)
{
return LocalAlloc (flags, size);
}
HANDLE GlobalFree (HANDLE hMem)
{
return LocalFree (hMem);
}
char *GlobalLock (HANDLE hMem)
{
return LocalLock (hMem);
}
BOOL GlobalUnlock (HANDLE hMem)
{
return LocalUnlock (hMem);
}
WORD GlobalFlags16(HANDLE hMem)
{
return LocalFlags (hMem);
}
DWORD GlobalSize16(HANDLE hMem)
{
return LocalSize (hMem);
}
DWORD GlobalCompact(DWORD desired)
{
if (desired)
return desired;
else
return 0x01000000; /* Should check the available core. */
}
HANDLE GlobalReAlloc16(HANDLE hMem, DWORD new_size, WORD flags)
{
if (!(flags & GMEM_MODIFY))
return LocalReAlloc (hMem, new_size, flags);
}
int HEAP_LocalSize ()
{
return 0;
}
int HEAP_LocalFindHeap ()
{
return 0;
}
#ifdef UNIMPLEMENTED
DWORD int GlobalHandle(WORD selector)
{
}
#endif
#endif /* WINELIB16 */
#if 0
typedef struct { DWORD Size; DWORD Padding[3]; } HeapData;
HANDLE HEAP_Alloc (WORD flags, DWORD bytes)
{
HeapData* m;
bytes+=sizeof(HeapData);
if ((m = malloc (bytes)))
{
if (flags & LMEM_ZEROINIT) memset( m, 0, bytes );
}
m->Size=bytes-sizeof(HeapData);
return (HANDLE)(m+1);
}
HANDLE HEAP_Free (HANDLE hMem)
{
HeapData* m;
if(!hMem)
return 0;
m=(HeapData*)hMem;
free(m-1);
return 0;
}
DWORD HEAP_Size (HANDLE hMem)
{
HeapData* m=(HeapData*)hMem;
return (m-1)->Size;
}
HANDLE HEAP_ReAlloc(HANDLE hMem,DWORD bytes,UINT flags)
{
HeapData* m=(HeapData*)hMem;
if(!bytes)
{
free(m-1);
return 0; /* Inaccurate behavior, but should suffice */
}
m=realloc (m-1, bytes+sizeof(HeapData));
if(flags & LMEM_ZEROINIT && bytes > m->Size)
memset( (char*)m+sizeof(HeapData)+m->Size, 0, bytes-m->Size );
m->Size=bytes;
return (HANDLE)(m+1);
}
HANDLE LocalAlloc (WORD flags, WORD bytes)
{
return HEAP_Alloc(flags,bytes);
}
UINT LocalFlags (HANDLE hMem)
{
return 0;
}
HANDLE LocalFree (HANDLE hMem)
{
return HEAP_Free(hMem);
}
BOOL LocalInit (HANDLE segment, WORD start, WORD end)
{
return TRUE;
}
LPVOID LocalLock (HANDLE hMem)
{
return (LPVOID)hMem;
}
HANDLE LocalReAlloc (HANDLE hMem, WORD new_size, WORD flags)
{
if (!(flags & LMEM_MODIFY))
return HEAP_ReAlloc (hMem, new_size, flags);
else
return hMem;
}
UINT LocalSize (HANDLE hMem)
{
return HEAP_Size(hMem);
}
BOOL LocalUnlock (HANDLE hMem)
{
return 0;
}
HANDLE GlobalAlloc (WORD flags, DWORD size)
{
return HEAP_Alloc (flags,size);
}
HANDLE GlobalFree (HANDLE hMem)
{
return HEAP_Free (hMem);
}
LPVOID GlobalLock (HGLOBAL hMem)
{
return (LPVOID)hMem;
}
BOOL GlobalUnlock (HANDLE hMem)
{
return 0;
}
WORD GlobalFlags32(HANDLE hMem)
{
return LocalFlags (hMem);
}
DWORD GlobalSize32(HANDLE hMem)
{
return HEAP_Size (hMem);
}
HANDLE GlobalReAlloc32(HANDLE hMem, DWORD new_size, WORD flags)
{
if (!(flags & GMEM_MODIFY))
return HEAP_ReAlloc (hMem, new_size, flags);
else
return hMem;
}
#endif
......@@ -10,7 +10,6 @@
#include "dde_mem.h"
#include "windows.h"
#include "global.h"
#include "relay32.h"
#include "debug.h"
#include "xmalloc.h"
......@@ -44,93 +43,6 @@ int CallTo32_LargeStack( int (*func)(), int nbargs, ...)
WORD CallTo16_word_ ( FARPROC func, WORD arg ) { return func(arg); }
#if 0
void GlobalFreeAll(HGLOBAL16 owner)
{
WINELIB_UNIMP("GlobalFreeAll()");
}
SEGPTR WIN16_GlobalLock16(HGLOBAL16 h)
{ return (SEGPTR)h; }
HLOCAL LOCAL_Free(WORD ds, HLOCAL handle)
{ return LocalFree(handle); }
HLOCAL LOCAL_Alloc(WORD ds, WORD flags, WORD size)
{ return LocalAlloc(flags,size); }
HLOCAL LOCAL_ReAlloc(WORD ds, HLOCAL handle, WORD size, WORD flags)
{ return LocalReAlloc(handle,size,flags); }
LPSTR LOCAL_Lock( WORD ds, HLOCAL handle )
{ return LocalLock(handle); }
BOOL LOCAL_Unlock( WORD ds, HLOCAL handle )
{ return LocalUnlock(handle); }
WORD LOCAL_Size( WORD ds, HLOCAL handle )
{ return LocalSize(handle); }
void FarSetOwner(HANDLE a, HANDLE b)
{
WINELIB_UNIMP("FarSetOwner()");
}
#define GLOBAL_MAX_ALLOC_SIZE 0x00ff0000 /* Largest allocation is 16M - 64K */
HGLOBAL GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL hOwner,
BOOL isCode, BOOL is32Bit, BOOL isReadOnly )
{
void *ptr;
HGLOBAL handle;
SHMDATA shmdata;
dprintf_global( stddeb, "GLOBAL_Alloc: %ld flags=%04x\n", size, flags );
/* Fixup the size */
if (size >= GLOBAL_MAX_ALLOC_SIZE - 0x1f) return 0;
if (size == 0) size = 0x20;
else size = (size + 0x1f) & ~0x1f;
/* Allocate the linear memory */
#ifdef CONFIG_IPC
if ((flags & GMEM_DDESHARE) && Options.ipc)
ptr = DDE_malloc(flags, size, &shmdata);
else
#endif /* CONFIG_IPC */
ptr = malloc( size );
if (!ptr) return 0;
/* Allocate the selector(s) */
handle = GLOBAL_CreateBlock( flags, ptr, size, hOwner,
isCode, is32Bit, isReadOnly, &shmdata);
if (!handle)
{
free( ptr );
return 0;
}
if (flags & GMEM_ZEROINIT) memset( ptr, 0, size );
return handle;
}
HGLOBAL GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
HGLOBAL hOwner, BOOL isCode,
BOOL is32Bit, BOOL isReadOnly,
SHMDATA *shmdata)
{
return (HGLOBAL)ptr;
}
BOOL GLOBAL_FreeBlock( HGLOBAL handle )
{
return 1;
}
HGLOBAL GlobalHandle(LPCVOID a)
{
fprintf(stderr,"JBP: GlobalHandle() ignored.\n");
return 0;
}
#endif
extern LRESULT ACTIVATEAPP_callback(HWND,UINT,WPARAM,LPARAM);
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ButtonWndProc(HWND,UINT,WPARAM,LPARAM);
......
......@@ -6,12 +6,6 @@
#include "arch.h"
#include "neexe.h"
LRESULT CallWindowProc (WNDPROC func, HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
return (*func)(hwnd, message, wParam, lParam);
}
/*
* Header loading routines for WineLib.
*/
......
......@@ -13,7 +13,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "windows.h"
#include "alias.h"
#include "module.h"
#include "task.h"
#include "selectors.h"
#include "comm.h"
#include "win.h"
......@@ -37,12 +36,14 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "user.h"
#include "dce.h"
#include "pe_image.h"
#include "shell.h"
#include "stddebug.h"
#include "debug.h"
void init_wine_signals(void);
HANDLE32 SystemHeap = 0;
HANDLE32 SegptrHeap = 0;
/***********************************************************************
* Main initialisation routine
......@@ -53,8 +54,9 @@ int MAIN_Init(void)
int queueSize;
/* Create the system heap */
/* Create the system and SEGPTR heaps */
if (!(SystemHeap = HeapCreate( HEAP_GROWABLE, 0x10000, 0 ))) return 0;
if (!(SegptrHeap = HeapCreate( HEAP_WINE_SEGPTR, 0, 0 ))) return 0;
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return 0;
......@@ -101,6 +103,8 @@ int MAIN_Init(void)
/* Initialize the DOS memory */
if (!INT21_Init()) return 0;
#endif
/* registry initialisation */
SHELL_LoadRegistry();
/* Global atom table initialisation */
if (!ATOM_Init()) return 0;
......
......@@ -759,7 +759,7 @@ BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset )
* Return an entry point from the WPROCS dll.
*/
#ifndef WINELIB
WNDPROC MODULE_GetWndProcEntry16( const char *name )
FARPROC16 MODULE_GetWndProcEntry16( const char *name )
{
WORD ordinal;
static HMODULE hModule = 0;
......@@ -777,7 +777,7 @@ WNDPROC MODULE_GetWndProcEntry16( const char *name )
* Return an entry point from the WPROCS32 dll.
*/
#ifndef WINELIB
WNDPROC MODULE_GetWndProcEntry32( const char *name )
FARPROC32 MODULE_GetWndProcEntry32( const char *name )
{
static HMODULE hModule = 0;
......
......@@ -23,7 +23,6 @@
#include "neexe.h"
#include "peexe.h"
#include "pe_image.h"
#include "relay32.h"
#include "module.h"
#include "alias.h"
#include "global.h"
......
......@@ -171,11 +171,7 @@ void init_wine_signals(void)
#if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigaltstack ss;
#if !defined (__FreeBSD__)
if ((ss.ss_base = malloc(MINSIGSTKSZ)) == NULL) {
#else
if ((ss.ss_sp = malloc(MINSIGSTKSZ)) == NULL) {
#endif
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
MINSIGSTKSZ);
exit(1);
......
......@@ -11,8 +11,6 @@
* have to be changed.
*/
#ifndef WINELIB
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
......@@ -22,6 +20,7 @@
#include "instance.h"
#include "ldt.h"
#include "stackframe.h"
#include "string32.h"
#include "user.h"
#ifdef CONFIG_IPC
......@@ -31,6 +30,7 @@
#define DEFAULT_ATOMTABLE_SIZE 37
#define MIN_STR_ATOM 0xc000
#define MAX_ATOM_LEN 255
#define ATOMTOHANDLE(atom) ((HANDLE)(atom) << 2)
#define HANDLETOATOM(handle) ((ATOM)(0xc000 | ((handle) >> 2)))
......@@ -45,10 +45,10 @@
/***********************************************************************
* ATOM_InitTable
*/
static WORD ATOM_InitTable( WORD selector, WORD entries )
static HANDLE16 ATOM_InitTable( WORD selector, WORD entries )
{
int i;
HANDLE handle;
HANDLE16 handle;
ATOMTABLE *table;
/* Allocate the table */
......@@ -72,9 +72,9 @@ static WORD ATOM_InitTable( WORD selector, WORD entries )
*
* Global table initialisation.
*/
WORD ATOM_Init()
BOOL ATOM_Init(void)
{
return ATOM_InitTable( USER_HeapSel, DEFAULT_ATOMTABLE_SIZE );
return ATOM_InitTable( USER_HeapSel, DEFAULT_ATOMTABLE_SIZE ) != 0;
}
......@@ -124,21 +124,15 @@ static WORD ATOM_Hash( WORD entries, LPCSTR str, WORD len )
/***********************************************************************
* ATOM_AddAtom
*/
static ATOM ATOM_AddAtom( WORD selector, SEGPTR name )
static ATOM ATOM_AddAtom( WORD selector, LPCSTR str )
{
WORD hash;
HANDLE entry;
ATOMENTRY * entryPtr;
ATOMTABLE * table;
int len;
char *str;
/* Check for integer atom */
if (!HIWORD(name)) return (ATOM)LOWORD(name);
str = PTR_SEG_TO_LIN( name );
if (str[0] == '#') return atoi( &str[1] );
if (str[0] == '#') return atoi( &str[1] ); /* Check for integer atom */
if ((len = strlen( str )) > 255) len = 255;
if (!(table = ATOM_GetTable( selector, TRUE ))) return 0;
hash = ATOM_Hash( table->size, str, len );
......@@ -159,7 +153,6 @@ static ATOM ATOM_AddAtom( WORD selector, SEGPTR name )
if (!entry) return 0;
/* Reload the table ptr in case it moved in linear memory */
table = ATOM_GetTable( selector, FALSE );
str = PTR_SEG_TO_LIN( name );
entryPtr = ATOM_MakePtr( selector, entry );
entryPtr->next = table->entries[hash];
entryPtr->refCount = 1;
......@@ -209,20 +202,14 @@ static ATOM ATOM_DeleteAtom( WORD selector, ATOM atom )
/***********************************************************************
* ATOM_FindAtom
*/
static ATOM ATOM_FindAtom( WORD selector, SEGPTR name )
static ATOM ATOM_FindAtom( WORD selector, LPCSTR str )
{
ATOMTABLE * table;
WORD hash;
HANDLE entry;
int len;
char *str;
/* Check for integer atom */
if (!HIWORD(name)) return (ATOM)LOWORD(name);
str = PTR_SEG_TO_LIN( name );
if (str[0] == '#') return atoi( &str[1] );
if (str[0] == '#') return atoi( &str[1] ); /* Check for integer atom */
if ((len = strlen( str )) > 255) len = 255;
if (!(table = ATOM_GetTable( selector, FALSE ))) return 0;
hash = ATOM_Hash( table->size, str, len );
......@@ -242,14 +229,14 @@ static ATOM ATOM_FindAtom( WORD selector, SEGPTR name )
/***********************************************************************
* ATOM_GetAtomName
*/
static WORD ATOM_GetAtomName( WORD selector, ATOM atom,
LPSTR buffer, short count )
static UINT32 ATOM_GetAtomName( WORD selector, ATOM atom,
LPSTR buffer, INT32 count )
{
ATOMTABLE * table;
ATOMENTRY * entryPtr;
HANDLE entry;
char * strPtr;
int len;
UINT32 len;
char text[8];
if (!count) return 0;
......@@ -298,7 +285,20 @@ HANDLE GetAtomHandle( ATOM atom )
*/
ATOM AddAtom( SEGPTR str )
{
return ATOM_AddAtom( CURRENT_DS, str );
ATOM atom;
HANDLE16 ds = CURRENT_DS;
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
if (SELECTOR_TO_ENTRY(LOWORD(str)) == SELECTOR_TO_ENTRY(ds))
{
/* If the string is in the same data segment as the atom table, make */
/* a copy of the string to be sure it doesn't move in linear memory. */
char buffer[256];
lstrcpyn( buffer, (char *)PTR_SEG_TO_LIN(str), sizeof(buffer) );
atom = ATOM_AddAtom( ds, buffer );
}
else atom = ATOM_AddAtom( ds, (LPCSTR)PTR_SEG_TO_LIN(str) );
return atom;
}
......@@ -316,7 +316,8 @@ ATOM DeleteAtom( ATOM atom )
*/
ATOM FindAtom( SEGPTR str )
{
return ATOM_FindAtom( CURRENT_DS, str );
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
return ATOM_FindAtom( CURRENT_DS, (LPCSTR)PTR_SEG_TO_LIN(str) );
}
......@@ -325,24 +326,47 @@ ATOM FindAtom( SEGPTR str )
*/
WORD GetAtomName( ATOM atom, LPSTR buffer, short count )
{
return ATOM_GetAtomName( CURRENT_DS, atom, buffer, count );
return (WORD)ATOM_GetAtomName( CURRENT_DS, atom, buffer, count );
}
/***********************************************************************
* GlobalAddAtom (USER.268)
* GlobalAddAtom16 (USER.268)
*/
ATOM GlobalAddAtom( SEGPTR str )
ATOM GlobalAddAtom16( SEGPTR str )
{
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalAddAtom( str );
#endif
return ATOM_AddAtom( USER_HeapSel, (LPCSTR)PTR_SEG_TO_LIN(str) );
}
/***********************************************************************
* GlobalAddAtom32A (KERNEL32.313)
*/
ATOM GlobalAddAtom32A( LPCSTR str )
{
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
return ATOM_AddAtom( USER_HeapSel, str );
}
/***********************************************************************
* GlobalDeleteAtom (USER.269)
* GlobalAddAtom32W (KERNEL32.314)
*/
ATOM GlobalAddAtom32W( LPCWSTR str )
{
char buffer[MAX_ATOM_LEN+1];
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
STRING32_UniToAnsi( buffer, str ); /* FIXME: 'str' length? */
return ATOM_AddAtom( USER_HeapSel, buffer );
}
/***********************************************************************
* GlobalDeleteAtom (USER.269) (KERNEL32.317)
*/
ATOM GlobalDeleteAtom( ATOM atom )
{
......@@ -354,26 +378,69 @@ ATOM GlobalDeleteAtom( ATOM atom )
/***********************************************************************
* GlobalFindAtom (USER.270)
* GlobalFindAtom16 (USER.270)
*/
ATOM GlobalFindAtom( SEGPTR str )
ATOM GlobalFindAtom16( SEGPTR str )
{
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalFindAtom( str );
#endif
return ATOM_FindAtom( USER_HeapSel, (LPCSTR)PTR_SEG_TO_LIN(str) );
}
/***********************************************************************
* GlobalFindAtom32A (KERNEL32.318)
*/
ATOM GlobalFindAtom32A( LPCSTR str )
{
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
return ATOM_FindAtom( USER_HeapSel, str );
}
/***********************************************************************
* GlobalGetAtomName (USER.271)
* GlobalFindAtom32W (KERNEL32.319)
*/
ATOM GlobalFindAtom32W( LPCWSTR str )
{
char buffer[MAX_ATOM_LEN+1];
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
STRING32_UniToAnsi( buffer, str ); /* FIXME: 'str' length? */
return ATOM_FindAtom( USER_HeapSel, buffer );
}
/***********************************************************************
* GlobalGetAtomName16 (USER.271)
*/
WORD GlobalGetAtomName( ATOM atom, LPSTR buffer, short count )
UINT16 GlobalGetAtomName16( ATOM atom, LPSTR buffer, INT16 count )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalGetAtomName( atom, buffer, count );
#endif
return (UINT16)ATOM_GetAtomName( USER_HeapSel, atom, buffer, count );
}
/***********************************************************************
* GlobalGetAtomName32A (KERNEL32.323)
*/
UINT32 GlobalGetAtomName32A( ATOM atom, LPSTR buffer, INT32 count )
{
return ATOM_GetAtomName( USER_HeapSel, atom, buffer, count );
}
#endif /* WINELIB */
/***********************************************************************
* GlobalGetAtomName32W (KERNEL32.324)
*/
UINT32 GlobalGetAtomName32W( ATOM atom, LPWSTR buffer, INT32 count )
{
UINT32 len;
char tmp[MAX_ATOM_LEN+1];
if (count > sizeof(tmp)) count = sizeof(tmp);
len = ATOM_GetAtomName( USER_HeapSel, atom, tmp, count );
STRING32_AnsiToUni( buffer, tmp ); /* FIXME: len? */
return len;
}
......@@ -441,7 +441,7 @@ LPVOID GlobalLock16( HGLOBAL16 handle )
/***********************************************************************
* GlobalUnlock16 (KERNEL.19)
*/
BOOL GlobalUnlock16( HGLOBAL16 handle )
BOOL16 GlobalUnlock16( HGLOBAL16 handle )
{
dprintf_global( stddeb, "GlobalUnlock16: %04x\n", handle );
return 0;
......@@ -911,7 +911,7 @@ DWORD GlobalSize32( HGLOBAL32 handle )
/***********************************************************************
* GlobalUnlock32 (KERNEL32.332)
*/
BOOL GlobalUnlock32( HGLOBAL32 handle )
BOOL32 GlobalUnlock32( HGLOBAL32 handle )
{
return TRUE;
}
......@@ -10,6 +10,7 @@
#include "windows.h"
#include "debugger.h"
#include "kernel32.h" /* for CRITICAL_SECTION */
#include "selectors.h"
#include "winbase.h"
#include "winerror.h"
#include "winnt.h"
......@@ -72,6 +73,7 @@ typedef struct tagSUBHEAP
struct tagSUBHEAP *next; /* Next sub-heap */
struct tagHEAP *heap; /* Main heap structure */
DWORD magic; /* Magic number */
WORD selector; /* Selector for HEAP_WINE_SEGPTR heaps */
} SUBHEAP;
#define SUBHEAP_MAGIC ((DWORD)('S' | ('U'<<8) | ('B'<<16) | ('H'<<24)))
......@@ -216,7 +218,7 @@ static void HEAP_InsertFreeBlock( HEAP *heap, ARENA_FREE *pArena )
*
* Find the sub-heap containing a given address.
*/
static SUBHEAP *HEAP_FindSubHeap( HEAP *heap, void *ptr )
static SUBHEAP *HEAP_FindSubHeap( HEAP *heap, LPCVOID ptr )
{
SUBHEAP *sub = &heap->subheap;
while (sub)
......@@ -409,16 +411,25 @@ static void HEAP_ShrinkBlock(SUBHEAP *subheap, ARENA_INUSE *pArena, DWORD size)
*
* Create a sub-heap of the given size.
*/
static SUBHEAP *HEAP_CreateSubHeap( DWORD commitSize, DWORD totalSize )
static SUBHEAP *HEAP_CreateSubHeap( DWORD flags, DWORD commitSize,
DWORD totalSize )
{
SUBHEAP *subheap;
WORD selector = 0;
/* Round-up sizes on a 64K boundary */
totalSize = (totalSize + 0xffff) & 0xffff0000;
commitSize = (commitSize + 0xffff) & 0xffff0000;
if (!commitSize) commitSize = 0x10000;
if (totalSize < commitSize) totalSize = commitSize;
if (flags & HEAP_WINE_SEGPTR)
{
totalSize = commitSize = 0x10000; /* Only 64K at a time for SEGPTRs */
}
else
{
totalSize = (totalSize + 0xffff) & 0xffff0000;
commitSize = (commitSize + 0xffff) & 0xffff0000;
if (!commitSize) commitSize = 0x10000;
if (totalSize < commitSize) totalSize = commitSize;
}
/* Allocate the memory block */
......@@ -437,6 +448,21 @@ static SUBHEAP *HEAP_CreateSubHeap( DWORD commitSize, DWORD totalSize )
return NULL;
}
/* Allocate a selector if needed */
if (flags & HEAP_WINE_SEGPTR)
{
selector = SELECTOR_AllocBlock( subheap, totalSize,
(flags & HEAP_WINE_CODESEG) ? SEGMENT_CODE : SEGMENT_DATA,
(flags & HEAP_WINE_CODESEG) != 0, FALSE );
if (!selector)
{
fprintf( stderr, "HEAP_CreateSubHeap: could not allocate selector\n" );
VirtualFree( subheap, 0, MEM_RELEASE );
return NULL;
}
}
/* Fill the sub-heap structure */
subheap->size = totalSize;
......@@ -445,6 +471,7 @@ static SUBHEAP *HEAP_CreateSubHeap( DWORD commitSize, DWORD totalSize )
subheap->next = NULL;
subheap->heap = NULL;
subheap->magic = SUBHEAP_MAGIC;
subheap->selector = selector;
return subheap;
}
......@@ -490,7 +517,8 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, DWORD size,
return NULL;
}
size += sizeof(SUBHEAP) + sizeof(ARENA_FREE);
if (!(subheap = HEAP_CreateSubHeap( size, MAX( HEAP_DEF_SIZE, size ) )))
if (!(subheap = HEAP_CreateSubHeap( heap->flags, size,
MAX( HEAP_DEF_SIZE, size ) )))
return NULL;
/* Insert the new sub-heap in the list */
......@@ -675,6 +703,72 @@ static BOOL HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena )
/***********************************************************************
* HEAP_IsInsideHeap
*
* Check whether the pointer is to a block inside a given heap.
*/
int HEAP_IsInsideHeap( HANDLE32 heap, DWORD flags, LPCVOID ptr )
{
HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap;
int ret;
/* Validate the parameters */
if (!heapPtr) return 0;
flags |= heapPtr->flags;
if (!(flags & HEAP_NO_SERIALIZE)) HeapLock( heap );
ret = (((subheap = HEAP_FindSubHeap( heapPtr, ptr )) != NULL) &&
(((char *)ptr >= (char *)subheap + subheap->headerSize
+ sizeof(ARENA_INUSE))));
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
return ret;
}
/***********************************************************************
* HEAP_GetSegptr
*
* Transform a linear pointer into a SEGPTR. The pointer must have been
* allocated from a HEAP_WINE_SEGPTR heap.
*/
SEGPTR HEAP_GetSegptr( HANDLE32 heap, DWORD flags, LPCVOID ptr )
{
HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap;
SEGPTR ret;
/* Validate the parameters */
if (!heapPtr) return 0;
flags |= heapPtr->flags;
if (!(flags & HEAP_WINE_SEGPTR))
{
fprintf( stderr, "HEAP_GetSegptr: heap %08x is not a SEGPTR heap\n",
heap );
return 0;
}
if (!(flags & HEAP_NO_SERIALIZE)) HeapLock( heap );
/* Get the subheap */
if (!(subheap = HEAP_FindSubHeap( heapPtr, ptr )))
{
fprintf( stderr, "HEAP_GetSegptr: %p is not inside heap %08x\n",
ptr, heap );
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
return 0;
}
/* Build the SEGPTR */
ret = PTR_SEG_OFF_TO_SEGPTR(subheap->selector, (DWORD)ptr-(DWORD)subheap);
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
return ret;
}
/***********************************************************************
* HeapCreate (KERNEL32.336)
*/
HANDLE32 HeapCreate( DWORD flags, DWORD initialSize, DWORD maxSize )
......@@ -691,7 +785,7 @@ HANDLE32 HeapCreate( DWORD flags, DWORD initialSize, DWORD maxSize )
maxSize = HEAP_DEF_SIZE;
flags |= HEAP_GROWABLE;
}
if (!(subheap = HEAP_CreateSubHeap( initialSize, maxSize )))
if (!(subheap = HEAP_CreateSubHeap( flags, initialSize, maxSize )))
{
SetLastError( ERROR_OUTOFMEMORY );
return 0;
......@@ -1095,5 +1189,18 @@ BOOL HeapValidate( HANDLE32 heap, DWORD flags, LPVOID block )
*/
BOOL HeapWalk( HANDLE32 heap, void *entry )
{
fprintf( stderr, "HeapWalk(%08x): not implemented\n", heap );
return FALSE;
}
/***********************************************************************
* HEAP_strdupA
*/
LPSTR HEAP_strdupA( HANDLE32 heap, DWORD flags, LPCSTR str )
{
INT32 len = lstrlen(str) + 1;
LPSTR p = HeapAlloc( heap, flags, len );
if (p) strcpy( p, str );
return p;
}
......@@ -111,7 +111,6 @@ BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
{
static WORD WM_WINHELP=0;
HWND hDest;
char szBuf[20];
LPWINHELP lpwh;
HANDLE hwh;
void *data=0;
......@@ -122,13 +121,11 @@ BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
/* FIXME: Should be directed yield, to let winhelp open the window */
Yield();
if(!WM_WINHELP) {
strcpy(szBuf,"WM_WINHELP");
WM_WINHELP=RegisterWindowMessage(MAKE_SEGPTR(szBuf));
WM_WINHELP=RegisterWindowMessage32A("WM_WINHELP");
if(!WM_WINHELP)
return FALSE;
}
strcpy(szBuf,"MS_WINHELP");
hDest = FindWindow(MAKE_SEGPTR(szBuf),0);
hDest = FindWindow32A( "MS_WINHELP", NULL );
if(!hDest)
return FALSE;
switch(wCommand)
......
......@@ -564,9 +564,6 @@ int main( int argc, char *argv[] )
MAIN_ParseOptions( &argc, argv );
SHELL_Init();
SHELL_LoadRegistry();
screen = DefaultScreenOfDisplay( display );
screenWidth = WidthOfScreen( screen );
screenHeight = HeightOfScreen( screen );
......@@ -892,38 +889,45 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
break;
case SPI_GETBORDER:
*(INT *) lpvParam = 1;
*(INT *)lpvParam = GetSystemMetrics( SM_CXFRAME );
break;
case SPI_GETFASTTASKSWITCH:
*(BOOL *) lpvParam = FALSE;
/* FIXME GetProfileInt( "windows", "CoolSwitch", 1 ) */
break;
case SPI_GETGRIDGRANULARITY:
*(INT *) lpvParam = 1;
/* FIXME GetProfileInt( "desktop", "GridGranularity", 1 ) */
break;
case SPI_GETICONTITLEWRAP:
*(BOOL *) lpvParam = FALSE;
/* FIXME GetProfileInt( "desktop", "?", True ) */
break;
case SPI_GETKEYBOARDDELAY:
*(INT *) lpvParam = 1;
/* FIXME */
break;
case SPI_GETKEYBOARDSPEED:
*(WORD *) lpvParam = 30;
/* FIXME */
break;
case SPI_GETMENUDROPALIGNMENT:
*(BOOL *) lpvParam = FALSE;
*(BOOL *) lpvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); /* XXX check this */
break;
case SPI_GETSCREENSAVEACTIVE:
/* FIXME GetProfileInt( "windows", "ScreenSaveActive", 1 ); */
*(BOOL *) lpvParam = FALSE;
break;
case SPI_GETSCREENSAVETIMEOUT:
/* FIXME GetProfileInt( "windows", "ScreenSaveTimeout", 300 ); */
XGetScreenSaver(display, &timeout, &temp,&temp,&temp);
*(INT *) lpvParam = timeout * 1000;
break;
......@@ -932,14 +936,14 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
if (lpvParam == NULL)
fprintf(stderr, "SystemParametersInfo: Horizontal icon spacing set to %d\n.", uParam);
else
*(INT *) lpvParam = 50;
*(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 = 50;
*(INT *) lpvParam = GetSystemMetrics( SM_CYICONSPACING );
break;
case SPI_SETBEEP:
......@@ -979,6 +983,7 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
case SPI_GETICONTITLELOGFONT:
{
/* FIXME GetProfileString( "?", "?", "?" ) */
LPLOGFONT lpLogFont = (LPLOGFONT)lpvParam;
lpLogFont->lfHeight = 10;
lpLogFont->lfWidth = 0;
......
......@@ -17,6 +17,7 @@
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "winreg.h"
extern HANDLE CURSORICON_LoadHandler( HANDLE, HINSTANCE, BOOL);
extern WORD GetIconID( HANDLE hResource, DWORD resType );
......@@ -37,7 +38,7 @@ void DragAcceptFiles(HWND hWnd, BOOL b)
/*************************************************************************
* DragQueryFile [SHELL.11]
*/
UINT DragQueryFile(HDROP hDrop, WORD wFile, LPSTR lpszFile, WORD wLength)
UINT DragQueryFile(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, WORD wLength)
{
/* hDrop is a global memory block allocated with GMEM_SHARE
* with DROPFILESTRUCT as a header and filenames following
......@@ -81,7 +82,7 @@ UINT DragQueryFile(HDROP hDrop, WORD wFile, LPSTR lpszFile, WORD wLength)
/*************************************************************************
* DragFinish [SHELL.12]
*/
void DragFinish(HDROP h)
void DragFinish(HDROP16 h)
{
GlobalFree16((HGLOBAL16)h);
}
......@@ -90,14 +91,14 @@ void DragFinish(HDROP h)
/*************************************************************************
* DragQueryPoint [SHELL.13]
*/
BOOL DragQueryPoint(HDROP hDrop, POINT *p)
BOOL DragQueryPoint(HDROP16 hDrop, POINT16 *p)
{
LPDROPFILESTRUCT lpDropFileStruct;
BOOL bRet;
lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock16(hDrop);
memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT));
memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT16));
bRet = lpDropFileStruct->fInNonClientArea;
GlobalUnlock16(hDrop);
......@@ -145,7 +146,7 @@ HINSTANCE ShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPSTR lpPar
}
} else {
len=200;
if (RegQueryValue((HKEY)HKEY_CLASSES_ROOT,p,subclass,&len)==SHELL_ERROR_SUCCESS) {
if (RegQueryValue16((HKEY)HKEY_CLASSES_ROOT,p,subclass,&len)==SHELL_ERROR_SUCCESS) {
if (len>20)
fprintf(stddeb,"ShellExecute:subclass with len %ld? (%s), please report.\n",len,subclass);
subclass[len]='\0';
......@@ -154,7 +155,7 @@ HINSTANCE ShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPSTR lpPar
strcat(subclass,"\\command");
dprintf_exec(stddeb,"ShellExecute:looking for %s.\n",subclass);
len=400;
if (RegQueryValue((HKEY)HKEY_CLASSES_ROOT,subclass,cmd,&len)==SHELL_ERROR_SUCCESS) {
if (RegQueryValue16((HKEY)HKEY_CLASSES_ROOT,subclass,cmd,&len)==SHELL_ERROR_SUCCESS) {
char *t;
dprintf_exec(stddeb,"ShellExecute:...got %s\n",cmd);
cmd[len]='\0';
......@@ -196,10 +197,131 @@ HINSTANCE ShellExecute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPSTR lpPar
*/
HINSTANCE FindExecutable(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult)
{
fprintf(stdnimp, "FindExecutable: someone has to fix me and this is YOUR turn! :-)\n");
char *extension = NULL; /* pointer to file extension */
char tmpext[5]; /* local copy to mung as we please */
char filetype[256]; /* registry name for this filetype */
LONG filetypelen=256; /* length of above */
char command[256]; /* command from registry */
LONG commandlen=256; /* This is the most DOS can handle :) */
char buffer[256]; /* Used to GetProfileString */
HINSTANCE retval=31; /* default - 'No association was found' */
char *tok; /* token pointer */
int i; /* random counter */
dprintf_exec(stddeb, "FindExecutable: File %s, Dir %s\n",
(lpFile != NULL?lpFile:"-"),
(lpDirectory != NULL?lpDirectory:"-"));
lpResult[0]='\0'; /* Start off with an empty return string */
/* trap NULL parameters on entry */
if (( lpFile == NULL ) || ( lpDirectory == NULL ) ||
( lpResult == NULL ))
{
/* FIXME - should throw a warning, perhaps! */
return 2; /* File not found. Close enough, I guess. */
}
/* First thing we need is the file's extension */
extension = strchr( lpFile, '.' ); /* Assumes first "." is the one... */
if ((extension == NULL) || (extension == &lpFile[strlen(lpFile)]))
{
return 31; /* no association */
}
/* Make local copy & lowercase it for reg & 'programs=' lookup */
strncpy( tmpext, extension, 5 );
if (strlen(extension)<=4)
tmpext[strlen(extension)]='\0';
else
tmpext[4]='\0';
for (i=0;i<strlen(tmpext);i++) tmpext[i]=tolower(tmpext[i]);
dprintf_exec(stddeb, "FindExecutable: %s file\n", tmpext);
/* Three places to check: */
/* 1. win.ini, [windows], programs (NB no leading '.') */
/* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
/* 3. win.ini, [extensions], extension (NB no leading '.' */
/* All I know of the order is that registry is checked before */
/* 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, lpFile); /* Need to perhaps check that */
/* the file has a path attached */
dprintf_exec(stddeb, "FindExecutable: found %s\n", lpResult);
return 33; /* Greater than 32 to indicate success FIXME */
/* what are the correct values here? */
}
tok=strtok(NULL, " \t");
}
/* Check registry */
if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, tmpext, filetype,
&filetypelen ) == SHELL_ERROR_SUCCESS )
{
filetype[filetypelen]='\0';
dprintf_exec(stddeb, "File type: %s\n", filetype);
/* Looking for ...buffer\shell\open\command */
strcat( filetype, "\\shell\\open\\command" );
if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, filetype, command,
&commandlen ) == SHELL_ERROR_SUCCESS )
{
/* Is there a replace() function anywhere? */
command[commandlen]='\0';
strcpy( lpResult, command );
tok=strstr( lpResult, "%1" );
if (tok != NULL)
{
tok[0]='\0'; /* truncate string at the percent */
strcat( lpResult, lpFile ); /* what if no dir in lpFile? */
tok=strstr( command, "%1" );
if ((tok!=NULL) && (strlen(tok)>2))
{
strcat( lpResult, &tok[2] );
}
}
retval=33;
}
}
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, lpFile ); /* what if no dir in lpFile? */
tok=strstr( command, "^" ); /* see above */
if ((tok != NULL) && (strlen(tok)>5))
{
strcat( lpResult, &tok[5]);
}
}
retval=33;
}
}
lpResult[0]='\0';
return 31; /* no association */
dprintf_exec(stddeb, "FindExecutable: returning %s\n", lpResult);
return retval;
}
static char AppName[128], AppMisc[1536];
......@@ -466,7 +588,7 @@ LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
UINT l = strlen(entry);
for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
{
if( strncasecmp(lpEnv, entry, l) ) continue;
if( lstrncmpi(lpEnv, entry, l) ) continue;
if( !*(lpEnv+l) )
return (lpEnv + l); /* empty entry */
......
......@@ -149,7 +149,14 @@ static const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x00F0 - Win32 Buttons */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"BM_GETCHECK32", /* 0x00f0 */
"BM_SETCHECK32", /* 0x00f1 */
"BM_GETSTATE32", /* 0x00f2 */
"BM_SETSTATE32", /* 0x00f3 */
"BM_SETSTYLE32", /* 0x00f4 */
"BM_CLICK32", /* 0x00f5 */
"BM_GETIMAGE32", /* 0x00f6 */
"BM_SETIMAGE32", /* 0x00f7 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"WM_KEYDOWN", /* 0x0100 */
......
......@@ -21,8 +21,9 @@ WORD USER_HeapSel = 0;
#ifndef WINELIB
extern void TIMER_NukeTimers(HWND, HQUEUE );
extern void TIMER_NukeTimers(HWND, HQUEUE);
extern HTASK TASK_GetNextTask(HTASK);
extern void QUEUE_SetDoomedQueue(HQUEUE);
/***********************************************************************
* GetFreeSystemResources (USER.284)
......@@ -130,10 +131,14 @@ void USER_AppExit(HTASK hTask, HINSTANCE hInstance, HQUEUE hQueue)
HOOK_FreeQueueHooks( hQueue );
QUEUE_SetDoomedQueue( hQueue );
/* Nuke orphaned windows */
WIN_DestroyQueueWindows( desktop->child, hQueue );
QUEUE_SetDoomedQueue( 0 );
/* Free the message queue */
QUEUE_DeleteMsgQueue( hQueue );
......
......@@ -59,8 +59,8 @@ find_ne_resource(
dprintf_resource(stderr,"shiftcount is %d\n",shiftcount);
dprintf_resource(stderr,"reading resource typeinfo dir.\n");
if (!HIWORD(typeid)) typeid = (SEGPTR)((WORD)typeid | 0x8000);
if (!HIWORD(resid)) resid = (SEGPTR)((WORD)resid | 0x8000);
if (!HIWORD(typeid)) typeid = (SEGPTR)(LOWORD(typeid) | 0x8000);
if (!HIWORD(resid)) resid = (SEGPTR)(LOWORD(resid) | 0x8000);
while (1) {
int skipflag;
......
......@@ -25,7 +25,7 @@
#include <unistd.h>
#include "winsock.h"
#include "toolhelp.h"
#include "global.h"
#include "stddebug.h"
#include "debug.h"
......
......@@ -196,14 +196,6 @@ LRESULT DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
}
/**************************************************************************
* OutputDebugStr [MMSYSTEM.30]
*/
void OutputDebugStr(LPCSTR str)
{
fprintf(stdnimp, "EMPTY STUB !!! OutputDebugStr('%s');\n", str);
}
/**************************************************************************
* DriverCallback [MMSYSTEM.31]
*/
BOOL DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
......
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