Commit 01d6346a authored by Alexandre Julliard's avatar Alexandre Julliard

Release 970120

Sun Jan 19 11:46:48 1997 Alexandre Julliard <julliard@lrc.epfl.ch> * [loader/module.c] Fixed LoadModule() to always call the DLL initialization code. * [windows/event.c] Moved all the keyboard stuff to windows/keyboard.c * [tools/build.c] Fixed Win32 register functions. Sat Jan 18 22:24:41 1997 David Makepeace <D.Makepeace@mailbox.uq.oz.au> * [tools/makedep.c] Fixed bug which causes SEGV on Solaris x86. Fri Jan 17 18:32:27 1997 Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl> * [controls/edit.c] Implemented WM_UNDO, WM_CONTEXTMENU (temporary using WM_RBUTTONUP), WM_COMMAND, WM_INITPOPUPMENU, WM_SYSKEYDOWN. Fixed EM_SETSEL and some minor bugs (features). Hence: fully functional undo and a win95 menu with the right mouse button. * [include/resources.h] [resources/TODO] [resources/sysres_??.rc] Added a context menu for the edit control. Translations, please ... Fri Jan 17 08:29:52 1997 David Faure <david.faure@ifhamy.insa-lyon.fr> * [windows/event.c] Move EVENT_ToAscii to windows/keyboard.c (where name ToAscii) Fixed Keypad keys 0-9 and . in EVENT_event_to_vkey. Added 3-state handling of toggle keys (CapsLock, NumLock) in order to make them work with any X server. Toggle keys now generate WM_KEYDOWN and WM_KEYUP on each pressing. * [include/keyboard.h] Totally replaced the file (formerly containing the vkcase definitions) by the declaration of 'extern' variables contained by event.c and used by keyboard.c * [windows/keyboard.c] Started to rewrite VkKeyScan and MapVirtualKey, to make them use the table keyc2vkey or X functions only. ToAscii : added keypad 0-9 and . special case. Changed toggle keys active mask from 0x80 to 0x1. * [misc/keyboard.c] File deleted. Contents moved to windows/keyboard.c. * [misc/main.c] Added putenv XKB_DISABLE to disable XKB extension (which, when present, causes AltGr to change keyboard group instead of being a modifier). Tue Jan 14 22:56:43 1997 Philippe De Muyter <phdm@info.ucl.ac.be> * [windows/event.c] Do not assume NumLockMask is Mod2Mask, but compute it by scanning output of XGetModifierMapping for XK_Num_Lock. Tue Jan 14 15:49:49 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [loader/pe_*.c] [include/peexe.h] [include/resource32.h] [debugger/*.c] General clean up. Changed defines/structures to match Windows NT SDK. * [loader/main.c] Don't crash on empty command-line. * [windows/winpos.c] winpos.c made win32 clean. * [misc/ntdll.c] Some string conversion additions. * [files/file.c] GetFileAttributes/GetTempFileName fixed. * [misc/ver.c] VerInstallFile implemented. Mon Jan 13 15:03:11 1997 Philippe De Muyter <phdm@info.ucl.ac.be> * [tools/build.c]: Use PREFIX also in stabs messages. Mon Jan 13 10:40:33 1997 John Harvey <john@division.co.uk> * [graphics/win16drv/*] [include/win16drv.h] Many fixes and some new features. * [graphics/x11drv/font.c] [graphics/x11drv/init.c] [include/x11drv.h] [objects/font.c] GetTextMetrics() moved to graphics driver. * [if1632/gdi.spec] [misc/fontengine.c] [misc/Makefile.in] New dummy EngineEnumerateFont, EngineRealizeFont functions. * [include/windows.h] TEXTFORM16 and FONTINFO16 structure definitions moved here from include/win16drv.h
parent c6c09442
This is release 970112 of Wine, the MS Windows emulator. This is still a
This is release 970120 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-970112: (see ChangeLog for details)
- Better support for non-US keyboards.
- Support for VFAT filesystem short names.
- Many improvements to the built-in debugger.
- More Win32 stuff.
WHAT'S NEW with Wine-970120: (see ChangeLog for details)
- More keyboard improvements.
- Some new printer driver functions.
- Many fixes to Win32 loader.
- Better edit control.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -18,10 +18,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970112.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970112.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970112.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-970112.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970120.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970120.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970120.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-970120.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sun Jan 19 11:46:48 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/module.c]
Fixed LoadModule() to always call the DLL initialization code.
* [windows/event.c]
Moved all the keyboard stuff to windows/keyboard.c
* [tools/build.c]
Fixed Win32 register functions.
Sat Jan 18 22:24:41 1997 David Makepeace <D.Makepeace@mailbox.uq.oz.au>
* [tools/makedep.c]
Fixed bug which causes SEGV on Solaris x86.
Fri Jan 17 18:32:27 1997 Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
* [controls/edit.c]
Implemented WM_UNDO, WM_CONTEXTMENU (temporary using WM_RBUTTONUP),
WM_COMMAND, WM_INITPOPUPMENU, WM_SYSKEYDOWN.
Fixed EM_SETSEL and some minor bugs (features).
Hence: fully functional undo and a win95 menu with the right mouse
button.
* [include/resources.h] [resources/TODO] [resources/sysres_??.rc]
Added a context menu for the edit control.
Translations, please ...
Fri Jan 17 08:29:52 1997 David Faure <david.faure@ifhamy.insa-lyon.fr>
* [windows/event.c]
Move EVENT_ToAscii to windows/keyboard.c (where name ToAscii)
Fixed Keypad keys 0-9 and . in EVENT_event_to_vkey.
Added 3-state handling of toggle keys (CapsLock, NumLock) in order
to make them work with any X server.
Toggle keys now generate WM_KEYDOWN and WM_KEYUP on each pressing.
* [include/keyboard.h]
Totally replaced the file (formerly containing the vkcase definitions)
by the declaration of 'extern' variables contained by event.c and used
by keyboard.c
* [windows/keyboard.c]
Started to rewrite VkKeyScan and MapVirtualKey, to make them use the
table keyc2vkey or X functions only.
ToAscii : added keypad 0-9 and . special case.
Changed toggle keys active mask from 0x80 to 0x1.
* [misc/keyboard.c]
File deleted. Contents moved to windows/keyboard.c.
* [misc/main.c]
Added putenv XKB_DISABLE to disable XKB extension (which, when
present, causes AltGr to change keyboard group instead of being a
modifier).
Tue Jan 14 22:56:43 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* [windows/event.c]
Do not assume NumLockMask is Mod2Mask, but compute it by scanning
output of XGetModifierMapping for XK_Num_Lock.
Tue Jan 14 15:49:49 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_*.c] [include/peexe.h] [include/resource32.h]
[debugger/*.c]
General clean up.
Changed defines/structures to match Windows NT SDK.
* [loader/main.c]
Don't crash on empty command-line.
* [windows/winpos.c]
winpos.c made win32 clean.
* [misc/ntdll.c]
Some string conversion additions.
* [files/file.c]
GetFileAttributes/GetTempFileName fixed.
* [misc/ver.c]
VerInstallFile implemented.
Mon Jan 13 15:03:11 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* [tools/build.c]: Use PREFIX also in stabs messages.
Mon Jan 13 10:40:33 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/*] [include/win16drv.h]
Many fixes and some new features.
* [graphics/x11drv/font.c] [graphics/x11drv/init.c]
[include/x11drv.h] [objects/font.c]
GetTextMetrics() moved to graphics driver.
* [if1632/gdi.spec] [misc/fontengine.c] [misc/Makefile.in]
New dummy EngineEnumerateFont, EngineRealizeFont functions.
* [include/windows.h]
TEXTFORM16 and FONTINFO16 structure definitions moved here from
include/win16drv.h
----------------------------------------------------------------------
Sat Jan 11 18:17:59 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/menu.c]
......
......@@ -159,7 +159,7 @@ static LRESULT CBCreate(HWND hwnd, WPARAM16 wParam, LPARAM lParam)
lphc->RectButton = rect;
lphc->RectButton.left = lphc->RectButton.right - 6 - CBitWidth;
lphc->RectButton.bottom = lphc->RectButton.top + lphl->StdItemHeight;
SetWindowPos(hwnd, 0, 0, 0, rect.right -rect.left + 2*SYSMETRICS_CXBORDER,
SetWindowPos32(hwnd, 0, 0, 0, rect.right -rect.left + 2*SYSMETRICS_CXBORDER,
lphl->StdItemHeight + 2*SYSMETRICS_CYBORDER,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOACTIVATE);
dprintf_combo(stddeb,(cstyle & 3)==CBS_DROPDOWN ? "CBS_DROPDOWN\n": "CBS_DROPDOWNLIST\n");
......@@ -209,8 +209,8 @@ static LRESULT CBDestroy(HWND hwnd, WPARAM16 wParam, LPARAM lParam)
{
LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
if (lphc->hWndEdit) DestroyWindow( lphc->hWndEdit );
if (lphc->hWndLBox) DestroyWindow( lphc->hWndLBox );
if (lphc->hWndEdit) DestroyWindow32( lphc->hWndEdit );
if (lphc->hWndLBox) DestroyWindow32( lphc->hWndLBox );
return 0;
}
......@@ -248,7 +248,7 @@ static LRESULT CBPaint(HWND hwnd, WPARAM16 wParam, LPARAM lParam)
lphc->RectButton.left + 2,lphc->RectButton.top + 2,
0, 0, CBitWidth, CBitHeight );
}
if (!IsWindowVisible(hwnd) || !lphl->bRedrawFlag
if (!IsWindowVisible16(hwnd) || !lphl->bRedrawFlag
|| (lphc->dwStyle & 3) != CBS_DROPDOWNLIST)
{
/* we don't want to draw an entry when there is an edit control */
......@@ -616,7 +616,7 @@ static LRESULT CBShowDropDown(HWND hwnd, WPARAM16 wParam, LPARAM lParam)
if (wParam != lphc->DropDownVisible) {
lphc->DropDownVisible = wParam;
GetWindowRect32(hwnd,&rect);
SetWindowPos(lphc->hWndLBox, 0, rect.left, rect.top+lphc->LBoxTop, 0, 0,
SetWindowPos32(lphc->hWndLBox, 0, rect.left, rect.top+lphc->LBoxTop, 0, 0,
SWP_NOSIZE | SWP_NOACTIVATE |
(wParam ? SWP_SHOWWINDOW : SWP_HIDEWINDOW));
if (!wParam) SetFocus32(hwnd);
......@@ -648,7 +648,7 @@ static BOOL CBCheckSize(HWND hwnd)
if ((cRect.bottom - cRect.top) >
(lphl->StdItemHeight + 2*SYSMETRICS_CYBORDER)) {
SetWindowPos(hwnd, 0, 0, 0,
SetWindowPos32(hwnd, 0, 0, 0,
cRect.right-cRect.left,
lphl->StdItemHeight+2*SYSMETRICS_CYBORDER,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE );
......@@ -673,12 +673,12 @@ static BOOL CBCheckSize(HWND hwnd)
}
/* otherwise we need to make the client include the button */
else
SetWindowPos(hwnd, 0, 0, 0, lphc->RectButton.right,
SetWindowPos32(hwnd, 0, 0, 0, lphc->RectButton.right,
lphl->StdItemHeight+2*SYSMETRICS_CYBORDER,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE);
if ((lphc->dwStyle & 3) != CBS_DROPDOWNLIST)
SetWindowPos(lphc->hWndEdit, 0, 0, 0, lphc->RectButton.left,
SetWindowPos32(lphc->hWndEdit, 0, 0, 0, lphc->RectButton.left,
lphl->StdItemHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
}
......@@ -934,7 +934,7 @@ static LRESULT CBLPaint( HWND hwnd, WPARAM16 wParam, LPARAM lParam )
top = 0;
hdc = BeginPaint16( hwnd, &ps );
if (!IsWindowVisible(hwnd) || !lphl->bRedrawFlag) {
if (!IsWindowVisible16(hwnd) || !lphl->bRedrawFlag) {
EndPaint16(hwnd, &ps);
return 0;
}
......@@ -1202,7 +1202,7 @@ static BOOL CBLCheckSize(HWND hwnd)
if ((lRect.bottom-lRect.top < 3*lphl->StdItemHeight) || dw) {
dprintf_combo(stddeb," Changing; totHeight %d StdItemHght %d dw %d\n",
totheight,lphl->StdItemHeight,dw);
SetWindowPos(hWndLBox, 0, lRect.left, lRect.top,
SetWindowPos32(hWndLBox, 0, lRect.left, lRect.top,
lwRect.right-lwRect.left+dw, totheight+2*SYSMETRICS_CYBORDER,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE );
}
......
......@@ -310,11 +310,11 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
dprintf_listbox(stddeb, "Listbox %04x: changing height %d -> %d\n",
wnd->hwndSelf, descr->height,
descr->height - descr->height%descr->item_height );
SetWindowPos( wnd->hwndSelf, 0, 0, 0,
wnd->rectWindow.right - wnd->rectWindow.left,
wnd->rectWindow.bottom - wnd->rectWindow.top -
(descr->height % descr->item_height),
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE );
SetWindowPos32( wnd->hwndSelf, 0, 0, 0,
wnd->rectWindow.right - wnd->rectWindow.left,
wnd->rectWindow.bottom - wnd->rectWindow.top -
(descr->height % descr->item_height),
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE );
return;
}
}
......
......@@ -650,7 +650,7 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
if (lpitem->item_flags & MF_BITMAP)
{
GRAPH_DrawBitmap( hdc, (HBITMAP16)(UINT32)lpitem->text,
GRAPH_DrawBitmap( hdc, (HBITMAP32)lpitem->text,
rect.left, rect.top, 0, 0,
rect.right-rect.left, rect.bottom-rect.top );
return;
......@@ -864,12 +864,12 @@ static BOOL32 MENU_ShowPopup( HWND32 hwndOwner, HMENU32 hmenu, UINT32 id,
wndPtr = WIN_FindWndPtr( menu->hWnd );
SetWindowPos(menu->hWnd, 0, x, y, width, height,
SetWindowPos32(menu->hWnd, 0, x, y, width, height,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW);
/* Display the window */
SetWindowPos( menu->hWnd, HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
SetWindowPos32( menu->hWnd, HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
UpdateWindow( menu->hWnd );
return TRUE;
}
......@@ -1015,8 +1015,8 @@ static BOOL32 MENU_SetItemData( MENUITEM *item, UINT32 flags, UINT32 id,
item->text = text;
}
}
else if ((flags & MF_BITMAP) || (flags & MF_OWNERDRAW))
item->text = (LPSTR)str;
else if (flags & MF_BITMAP) item->text = (LPSTR)(HBITMAP32)LOWORD(str);
else if (flags & MF_OWNERDRAW) item->text = (LPSTR)str;
else item->text = NULL;
item->item_flags = flags & ~(MF_HILITE | MF_MOUSESELECT);
......@@ -1191,12 +1191,12 @@ static void MENU_HideSubPopups( HWND32 hwndOwner, HMENU32 hmenu,
MENU_SelectItem( hwndOwner, hsubmenu, NO_SELECTED_ITEM, sendMenuSelect );
if (submenu->hWnd == pTopPWnd->hwndSelf )
{
ShowWindow( submenu->hWnd, SW_HIDE );
ShowWindow32( submenu->hWnd, SW_HIDE );
uSubPWndLevel = 0;
}
else
{
DestroyWindow( submenu->hWnd );
DestroyWindow32( submenu->hWnd );
submenu->hWnd = 0;
}
}
......@@ -1485,10 +1485,10 @@ static LRESULT MENU_DoNextMenu( HWND32* hwndOwner, HMENU32* hmenu,
if( (menu->wFlags & (MF_POPUP | MF_SYSMENU)) == (MF_POPUP | MF_SYSMENU) )
{
ShowWindow( menu->hWnd, SW_HIDE );
ShowWindow32( menu->hWnd, SW_HIDE );
uSubPWndLevel = 0;
if( !IsIconic( *hwndOwner ) )
if( !IsIconic32( *hwndOwner ) )
{
HDC32 hdc = GetDCEx32( *hwndOwner, 0, DCX_CACHE | DCX_WINDOW);
NC_DrawSysButton( *hwndOwner, hdc, FALSE );
......@@ -1523,7 +1523,7 @@ static LRESULT MENU_DoNextMenu( HWND32* hwndOwner, HMENU32* hmenu,
MENU_ShowPopup( *hwndOwner, *hmenu, 0, rect.left, rect.bottom,
SYSMETRICS_CXSIZE, SYSMETRICS_CYSIZE );
if( !IsIconic( *hwndOwner ) )
if( !IsIconic32( *hwndOwner ) )
{
HDC32 hdc = GetDCEx32( *hwndOwner, 0, DCX_CACHE | DCX_WINDOW);
NC_DrawSysButton( *hwndOwner, hdc, TRUE );
......@@ -1818,7 +1818,7 @@ static BOOL32 MENU_TrackMenu( HMENU32 hmenu, UINT32 wFlags, INT32 x, INT32 y,
menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( hmenu );
if (menu && menu->wFlags & MF_POPUP)
{
ShowWindow( menu->hWnd, SW_HIDE );
ShowWindow32( menu->hWnd, SW_HIDE );
uSubPWndLevel = 0;
}
MENU_SelectItem( hwnd, hmenu, NO_SELECTED_ITEM, FALSE );
......@@ -2702,7 +2702,7 @@ BOOL32 DestroyMenu32( HMENU32 hMenu )
if ((lppop->wFlags & MF_POPUP) &&
lppop->hWnd &&
(!pTopPWnd || (lppop->hWnd != pTopPWnd->hwndSelf)))
DestroyWindow( lppop->hWnd );
DestroyWindow32( lppop->hWnd );
if (lppop->items)
{
......@@ -2824,9 +2824,9 @@ BOOL32 SetMenu32( HWND32 hWnd, HMENU32 hMenu )
lpmenu->wFlags &= ~MF_POPUP; /* Can't be a popup */
lpmenu->Height = 0; /* Make sure we recalculate the size */
}
if (IsWindowVisible(hWnd))
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
if (IsWindowVisible32(hWnd))
SetWindowPos32( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return TRUE;
}
......@@ -2877,8 +2877,8 @@ BOOL32 DrawMenuBar32( HWND32 hWnd )
if (lppop == NULL) return FALSE;
lppop->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
SetWindowPos32( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return TRUE;
}
return FALSE;
......
......@@ -778,24 +778,24 @@ LRESULT ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if (lpCreat->style & SBS_VERT)
{
if (lpCreat->style & SBS_LEFTALIGN)
MoveWindow( hwnd, lpCreat->x, lpCreat->y,
SYSMETRICS_CXVSCROLL+1, lpCreat->cy, FALSE );
MoveWindow32( hwnd, lpCreat->x, lpCreat->y,
SYSMETRICS_CXVSCROLL+1, lpCreat->cy, FALSE );
else if (lpCreat->style & SBS_RIGHTALIGN)
MoveWindow( hwnd,
lpCreat->x+lpCreat->cx-SYSMETRICS_CXVSCROLL-1,
lpCreat->y,
SYSMETRICS_CXVSCROLL + 1, lpCreat->cy, FALSE );
MoveWindow32( hwnd,
lpCreat->x+lpCreat->cx-SYSMETRICS_CXVSCROLL-1,
lpCreat->y,
SYSMETRICS_CXVSCROLL+1, lpCreat->cy, FALSE );
}
else /* SBS_HORZ */
{
if (lpCreat->style & SBS_TOPALIGN)
MoveWindow( hwnd, lpCreat->x, lpCreat->y,
lpCreat->cx, SYSMETRICS_CYHSCROLL+1, FALSE );
MoveWindow32( hwnd, lpCreat->x, lpCreat->y,
lpCreat->cx, SYSMETRICS_CYHSCROLL+1, FALSE );
else if (lpCreat->style & SBS_BOTTOMALIGN)
MoveWindow( hwnd,
lpCreat->x,
lpCreat->y+lpCreat->cy-SYSMETRICS_CYHSCROLL-1,
lpCreat->cx, SYSMETRICS_CYHSCROLL+1, FALSE );
MoveWindow32( hwnd,
lpCreat->x,
lpCreat->y+lpCreat->cy-SYSMETRICS_CYHSCROLL-1,
lpCreat->cx, SYSMETRICS_CYHSCROLL+1, FALSE );
}
}
if (!hUpArrow) SCROLL_LoadBitmaps();
......@@ -1210,7 +1210,7 @@ BOOL32 ShowScrollBar32( HWND32 hwnd, INT32 nBar, BOOL32 fShow )
switch(nBar)
{
case SB_CTL:
ShowWindow( hwnd, fShow ? SW_SHOW : SW_HIDE );
ShowWindow32( hwnd, fShow ? SW_SHOW : SW_HIDE );
return TRUE;
case SB_HORZ:
......@@ -1257,8 +1257,8 @@ BOOL32 ShowScrollBar32( HWND32 hwnd, INT32 nBar, BOOL32 fShow )
default:
return TRUE; /* Nothing to do! */
}
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE
| SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
SetWindowPos32( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE
| SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return TRUE;
}
......
......@@ -56,8 +56,8 @@ static HICON16 STATIC_SetIcon( WND *wndPtr, HICON16 hicon )
if (hicon)
{
CURSORICONINFO *info = (CURSORICONINFO *) GlobalLock16( hicon );
SetWindowPos( wndPtr->hwndSelf, 0, 0, 0, info->nWidth, info->nHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
SetWindowPos32( wndPtr->hwndSelf, 0, 0, 0, info->nWidth, info->nHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
GlobalUnlock16( hicon );
}
return prevIcon;
......
......@@ -85,7 +85,7 @@ static BOOL32 SW_Refresh( HWND32 hwnd, HDC32 hdc, STATUSWINDOWINFO *self )
{
int i;
if (!IsWindowVisible(hwnd)) {
if (!IsWindowVisible32(hwnd)) {
return (TRUE);
}
......@@ -284,7 +284,7 @@ SW_Create(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
GetClientRect32(parent, &rect);
width = rect.right - rect.left;
height = (self->textHeight * 3)/2;
MoveWindow(hwnd, lpCreate->x, lpCreate->y-1, width, height, FALSE);
MoveWindow32(hwnd, lpCreate->x, lpCreate->y-1, width, height, FALSE);
SW_SetPartBounds(hwnd, self);
return 0;
}
......@@ -400,8 +400,8 @@ SW_Size(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - height;
MoveWindow(hwnd, parent_rect.left, parent_rect.bottom - height - 1,
width, height, TRUE);
MoveWindow32(hwnd, parent_rect.left, parent_rect.bottom - height - 1,
width, height, TRUE);
SW_SetPartBounds(hwnd, self);
}
return 0;
......
This is the core of the Wine debugger. Many pieces have been
shamelessly stolen - the reverse assember was stolen from Mach more or
less intact. It turns out that there are two variables that are set
differently if you are reverse assembling 16 bit code, and on the
whole it seems to work.
This is the core of the Wine debugger. The reverse assember
was stolen from Mach more or less intact. It turns out that there are
two variables that are set differently if you are reverse assembling
16 bit code, and on the whole it seems to work.
NEWS:
......@@ -63,6 +62,16 @@ will be slightly different, but the content should be fundamentally the same.
automatic display expressions. An example is at the end of this file. The
syntax and usage should be identical to that of gdb.
8) Type casts can be made from within the debugger, but they currently
don't work with typedef'ed types. They only work with builtin types and
named structures unions, etc. The problem is that internally we don't always
record the typedefed names of structures, so we have no guarantee that we
would know what each type is. This can be fixed, of course - it just takes
more memory. Note that in some cases, typedefed structures could be cast
using '(struct typedfname)' instead of '(typedfname)'. Technically this
isn't quite correct, but if and when the rest of this stuff gets fixed,
this would need to get corrected too.
NOTES:
If it weren't for the fact that gdb doesn't grok the Win32 debug
......@@ -73,16 +82,6 @@ together as if it were one large (very large) entity.
LIMITATIONS AND DIFFERENCES FROM GDB:
You cannot use type casts in expressions that you give to the
debugger. The hardest part about adding support for this is fixing
the parser/lexer to know when it is handling a type cast, and when it
is handling any other type of parenthesized expression. With lexer
states, it may be possible to keep track of what we would expect at
any given moment, but it would be tedious to go through and make sure
that the state is set up correctly for all of the different operators
and characters that we accept, and I am not yet convinced that this would
even work.
You cannot set a breakpoint by file and line number as you can
with gdb. Adding support for this wouldn't be all that tough, I guess, but
it would be a nuisance. You can set a breakpoint given a function and
......@@ -348,11 +347,6 @@ are displayed in the expected manner.
You can use the set command to set more or less anything. Note
however that you cannot use enumerated types on the RHS of the expression.
Finally, type casts are not yet supported in the expression
handling. There is sufficient information stored internally to be
able to handle this - the main challenge is that the parser would
need to be fixed to correctly parse the type cast.
*******************************************************************
......
......@@ -3,10 +3,9 @@ way or another. No commitment to actually do these, but these sound
possible to me right now. In no particular order. If someone else
wants to dig in, feel free.
1) Some kind of watchpoint capability. Pretty easy once we have a
single step capability, but we end up running the program
really slowly one instruction at a time. Use hardware debug
registers for this???
1) Some kind of watchpoint capability. Pretty easy, but we end up
running the program really slowly one instruction at a time.
Use hardware debug registers for this (much harder)???
2) Some kind of .wdbinit file.
......@@ -31,14 +30,6 @@ wants to dig in, feel free.
8) Some of the newer displays are still a little bit sparse on information.
Make these more like gdb.
9) Don't bother to disassemble an instruction when we stop at a breakpoint
and if we have a valid source line we are displaying.
10) Add support for '/i', etc in display command. Make sure 'display/i $eip'
does the correct thing, and then skip automatic disassembly completely.
11) Limit amount of information displayed with print command.
12) Make sure operator precedence works OK.
9) Make sure operator precedence works OK.
****************
......@@ -252,6 +252,13 @@ void DEBUG_DelBreakpoint( int num )
fprintf( stderr, "Invalid breakpoint number %d\n", num );
return;
}
if( breakpoints[num].condition != NULL )
{
DEBUG_FreeExpr(breakpoints[num].condition);
breakpoints[num].condition = NULL;
}
breakpoints[num].enabled = FALSE;
breakpoints[num].in_use = FALSE;
breakpoints[num].skipcount = 0;
......
......@@ -41,6 +41,7 @@ int yyerror(char *);
int integer;
struct list_id listing;
struct expr * expression;
struct datatype * type;
}
%token tCONT tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tINFO tWALK tUP tDOWN
......@@ -48,12 +49,15 @@ int yyerror(char *);
%token tCLASS tMODULE tSTACK tSEGMENTS tREGS tWND tQUEUE tLOCAL
%token tEOL tSTRING
%token tFRAME tSHARE tCOND tDISPLAY tUNDISPLAY
%token tSTEPI tNEXTI tFINISH tSHOW tDIR
%token tSTEPI tNEXTI tFINISH tSHOW tDIR
%token <string> tPATH
%token <string> tIDENTIFIER tSTRING
%token <integer> tNUM tFORMAT
%token <reg> tREG
%token tCHAR tSHORT tINT tLONG tFLOAT tDOUBLE tUNSIGNED tSIGNED
%token tSTRUCT tUNION tENUM
/* %left ',' */
/* %left '=' OP_OR_EQUAL OP_XOR_EQUAL OP_AND_EQUAL OP_SHL_EQUAL \
OP_SHR_EQUAL OP_PLUS_EQUAL OP_MINUS_EQUAL \
......@@ -66,14 +70,15 @@ int yyerror(char *);
%left '&'
%left OP_EQ OP_NE
%left '<' '>' OP_LE OP_GE
%left OP_SHL OP_SHR OP_DRF
%left OP_SHL OP_SHR
%left '+' '-'
%left '*' '/' '%'
%left OP_SIGN '!' '~' OP_DEREF /* OP_INC OP_DEC OP_ADDR */
%left '.' '['
%left '.' '[' OP_DRF
%nonassoc ':'
%type <expression> expr lval lvalue
%type <expression> expr lval lvalue
%type <type> type_cast type_expr
%type <address> expr_addr lval_addr
%type <integer> expr_value
%type <string> pathname
......@@ -129,7 +134,9 @@ command:
| tSHOW tDIR tEOL { DEBUG_ShowDir(); }
| tDIR pathname tEOL { DEBUG_AddPath( $2 ); }
| tDIR tEOL { DEBUG_NukePath(); }
| tDISPLAY expr tEOL { DEBUG_AddDisplay($2); }
| tDISPLAY tEOL { DEBUG_InfoDisplay(); }
| tDISPLAY expr tEOL { DEBUG_AddDisplay($2, 1, 0); }
| tDISPLAY tFORMAT expr tEOL { DEBUG_AddDisplay($3, $2 >> 8, $2 & 0xff); }
| tDELETE tDISPLAY tNUM tEOL { DEBUG_DelDisplay( $3 ); }
| tDELETE tDISPLAY tEOL { DEBUG_DelDisplay( -1 ); }
| tUNDISPLAY tNUM tEOL { DEBUG_DelDisplay( $2 ); }
......@@ -257,6 +264,30 @@ walk_command:
| tWALK tWND tEOL { WIN_WalkWindows( 0, 0 ); }
| tWALK tWND tNUM tEOL { WIN_WalkWindows( $3, 0 ); }
type_cast:
'(' type_expr ')' { $$ = $2; }
type_expr:
type_expr '*' { $$ = DEBUG_FindOrMakePointerType($1); }
| tINT { $$ = DEBUG_TypeCast(BASIC, "int"); }
| tCHAR { $$ = DEBUG_TypeCast(BASIC, "char"); }
| tLONG tINT { $$ = DEBUG_TypeCast(BASIC, "long int"); }
| tUNSIGNED tINT { $$ = DEBUG_TypeCast(BASIC, "unsigned int"); }
| tLONG tUNSIGNED tINT { $$ = DEBUG_TypeCast(BASIC, "long unsigned int"); }
| tLONG tLONG tINT { $$ = DEBUG_TypeCast(BASIC, "long long int"); }
| tLONG tLONG tUNSIGNED tINT { $$ = DEBUG_TypeCast(BASIC, "long long unsigned int"); }
| tSHORT tINT { $$ = DEBUG_TypeCast(BASIC, "short int"); }
| tSHORT tUNSIGNED tINT { $$ = DEBUG_TypeCast(BASIC, "short unsigned int"); }
| tSIGNED tCHAR { $$ = DEBUG_TypeCast(BASIC, "signed char"); }
| tUNSIGNED tCHAR { $$ = DEBUG_TypeCast(BASIC, "unsigned char"); }
| tFLOAT { $$ = DEBUG_TypeCast(BASIC, "float"); }
| tDOUBLE { $$ = DEBUG_TypeCast(BASIC, "double"); }
| tLONG tDOUBLE { $$ = DEBUG_TypeCast(BASIC, "long double"); }
| tSTRUCT tIDENTIFIER { $$ = DEBUG_TypeCast(STRUCT, $2); }
| tUNION tIDENTIFIER { $$ = DEBUG_TypeCast(STRUCT, $2); }
| tENUM tIDENTIFIER { $$ = DEBUG_TypeCast(ENUM, $2); }
expr_addr:
expr { $$ = DEBUG_EvalExpr($1) }
......@@ -310,6 +341,7 @@ expr:
| '(' expr ')' { $$ = $2; }
| '*' expr %prec OP_DEREF { $$ = DEBUG_UnopExpr(EXP_OP_DEREF, $2); }
| '&' expr %prec OP_DEREF { $$ = DEBUG_UnopExpr(EXP_OP_ADDR, $2); }
| type_cast expr %prec OP_DEREF { $$ = DEBUG_TypeCastExpr($1, $2); }
/*
* The lvalue rule builds an expression tree. This is a limited form
......@@ -460,15 +492,18 @@ static void DEBUG_Main( int signal )
DEBUG_SilentBackTrace();
}
/* Show where we crashed */
curr_frame = 0;
DEBUG_PrintAddress( &addr, dbg_mode, TRUE );
fprintf(stderr,": ");
if (DBG_CHECK_READ_PTR( &addr, 1 ))
{
DEBUG_Disasm( &addr, TRUE );
fprintf(stderr,"\n");
}
if( signal != SIGTRAP )
{
/* Show where we crashed */
curr_frame = 0;
DEBUG_PrintAddress( &addr, dbg_mode, TRUE );
fprintf(stderr,": ");
if (DBG_CHECK_READ_PTR( &addr, 1 ))
{
DEBUG_Disasm( &addr, TRUE );
fprintf(stderr,"\n");
}
}
ret_ok = 0;
do
......
......@@ -6,15 +6,16 @@
#include <signal.h>
#include <ldt.h>
#include <windows.h>
#include <toolhelp.h>
#include <module.h>
#include <debugger.h>
#include <class.h>
#include "windows.h"
#include "toolhelp.h"
#include "module.h"
#include "debugger.h"
#include "class.h"
#include <X11/Xlib.h>
#include "debugger.h"
#include "peexe.h"
#include "pe_image.h"
ldt_copy_entry ldt_copy[LDT_SIZE];
unsigned char ldt_flags_copy[LDT_SIZE];
......@@ -171,7 +172,7 @@ struct deferred_debug_info
int dbg_size;
struct PE_Debug_dir * dbgdir;
struct pe_data * pe;
struct pe_segment_table * sectp;
LPIMAGE_SECTION_HEADER sectp;
int nsect;
short int dbg_index;
char loaded;
......@@ -190,7 +191,7 @@ test_pdbstuff()
struct deferred_debug_info deefer;
struct PE_Debug_dir dinfo;
struct CodeViewDebug cdebug;
struct pe_segment_table sects[10];
IMAGE_SECTION_HEADER sects[10];
memset(&deefer, 0, sizeof(deefer));
memset(&dinfo, 0, sizeof(dinfo));
......@@ -201,7 +202,7 @@ test_pdbstuff()
dinfo.timestamp = 812932395;
cdebug.cv_timestamp = 833392137 /* 841951397 */;
deefer.dbgdir = &dinfo;
deefer.sectp = &sects;
deefer.sectp = sects;
deefer.nsect = 10;
DEBUG_InitTypes();
......
......@@ -113,7 +113,7 @@ $gs { yylval.reg = REG_GS; return tREG; }
<INITIAL>list|lis|li|l { BEGIN(PATH_EXPECTED); return tLIST; }
<INITIAL>enable|enabl|enab|ena { BEGIN(NOCMD); return tENABLE;}
<INITIAL>disable|disabl|disab|disa|dis { BEGIN(NOCMD); return tDISABLE; }
<INITIAL,INFO_CMD,DEL_CMD>display|displa|displ|disp { BEGIN(NOCMD); return tDISPLAY; }
<INITIAL,INFO_CMD,DEL_CMD>display|displa|displ|disp { BEGIN(FORMAT_EXPECTED); return tDISPLAY; }
<INITIAL>undisplay|undispla|undispl|undisp|undis|undi|und { BEGIN(NOCMD); return tUNDISPLAY; }
<INITIAL>delete|delet|dele|del { BEGIN(DEL_CMD); return tDELETE; }
<INITIAL>quit|qui|qu|q { BEGIN(NOCMD); return tQUIT; }
......@@ -155,11 +155,22 @@ $gs { yylval.reg = REG_GS; return tREG; }
<INITIAL,SHOW_CMD>directories|directorie|directori|director|directo|direct|direc|direc|dir {
BEGIN(PATH_EXPECTED); return tDIR; }
char { return tCHAR; }
short { return tSHORT; }
int { return tINT; }
long { return tLONG; }
float { return tFLOAT; }
double { return tDOUBLE; }
unsigned { return tUNSIGNED; }
signed { return tSIGNED; }
struct { return tSTRUCT; }
union { return tUNION; }
enum { return tENUM; }
{IDENTIFIER} { yylval.string = make_symbol(yytext); return tIDENTIFIER; }
<PATH_EXPECTED>{PATHNAME} { yylval.string = make_symbol(yytext); return tPATH; }
[ \t]+ /* Eat up whitespace */
. { if (syntax_error == 0)
......
......@@ -20,10 +20,18 @@
#include <stdarg.h>
#define MAX_DISPLAY 25
static struct expr * displaypoints[MAX_DISPLAY];
struct display
{
struct expr * exp;
int count;
char format;
};
static struct display displaypoints[MAX_DISPLAY];
int
DEBUG_AddDisplay(struct expr * exp)
DEBUG_AddDisplay(struct expr * exp, int count, char format)
{
int i;
......@@ -32,9 +40,11 @@ DEBUG_AddDisplay(struct expr * exp)
*/
for(i=0; i < MAX_DISPLAY; i++ )
{
if( displaypoints[i] == NULL )
if( displaypoints[i].exp == NULL )
{
displaypoints[i] = DEBUG_CloneExpr(exp);
displaypoints[i].exp = DEBUG_CloneExpr(exp);
displaypoints[i].count = count;
displaypoints[i].format = format;
break;
}
}
......@@ -52,10 +62,10 @@ DEBUG_InfoDisplay()
*/
for(i=0; i < MAX_DISPLAY; i++ )
{
if( displaypoints[i] != NULL )
if( displaypoints[i].exp != NULL )
{
fprintf(stderr, "%d : ", i+1);
DEBUG_DisplayExpr(displaypoints[i]);
DEBUG_DisplayExpr(displaypoints[i].exp);
fprintf(stderr, "\n");
}
}
......@@ -74,22 +84,33 @@ DEBUG_DoDisplay()
*/
for(i=0; i < MAX_DISPLAY; i++ )
{
if( displaypoints[i] != NULL )
if( displaypoints[i].exp != NULL )
{
addr = DEBUG_EvalExpr(displaypoints[i]);
addr = DEBUG_EvalExpr(displaypoints[i].exp);
if( addr.type == NULL )
{
fprintf(stderr, "Unable to evaluate expression ");
DEBUG_DisplayExpr(displaypoints[i]);
DEBUG_DisplayExpr(displaypoints[i].exp);
fprintf(stderr, "\nDisabling...\n");
DEBUG_DelDisplay(i);
}
else
{
fprintf(stderr, "%d : ", i + 1);
DEBUG_DisplayExpr(displaypoints[i]);
DEBUG_DisplayExpr(displaypoints[i].exp);
fprintf(stderr, " = ");
DEBUG_Print( &addr, 1, 0, 0);
if( displaypoints[i].format == 'i' )
{
DEBUG_ExamineMemory( &addr,
displaypoints[i].count,
displaypoints[i].format);
}
else
{
DEBUG_Print( &addr,
displaypoints[i].count,
displaypoints[i].format, 0);
}
}
}
}
......@@ -111,17 +132,17 @@ DEBUG_DelDisplay(int displaynum)
{
for(i=0; i < MAX_DISPLAY; i++ )
{
if( displaypoints[i] != NULL )
if( displaypoints[i].exp != NULL )
{
DEBUG_FreeExpr(displaypoints[i]);
displaypoints[i] = NULL;
DEBUG_FreeExpr(displaypoints[i].exp);
displaypoints[i].exp = NULL;
}
}
}
else if( displaypoints[displaynum - 1] != NULL )
else if( displaypoints[displaynum - 1].exp != NULL )
{
DEBUG_FreeExpr(displaypoints[displaynum - 1]);
displaypoints[displaynum - 1] = NULL;
DEBUG_FreeExpr(displaypoints[displaynum - 1].exp);
displaypoints[displaynum - 1].exp = NULL;
}
return TRUE;
}
......@@ -70,6 +70,12 @@ struct expr
struct
{
struct datatype * cast;
struct expr * expr;
} cast;
struct
{
struct expr * exp1;
const char * element_name;
int result;
......@@ -103,6 +109,7 @@ struct expr
#define EXPR_TYPE_ARRAY 8
#define EXPR_TYPE_CALL 9
#define EXPR_TYPE_STRING 10
#define EXPR_TYPE_CAST 11
static char expr_list[4096];
static int next_expr_free = 0;
......@@ -132,6 +139,18 @@ DEBUG_FreeExprMem()
next_expr_free = 0;
}
struct expr *
DEBUG_TypeCastExpr(struct datatype * dt, struct expr * exp)
{
struct expr * ex;
ex = DEBUG_GetFreeExpr();
ex->type = EXPR_TYPE_CAST;
ex->un.cast.cast = dt;
ex->un.cast.expr = exp;
return ex;
}
struct expr *
DEBUG_RegisterExpr(enum debug_regs regno)
......@@ -294,6 +313,10 @@ DEBUG_EvalExpr(struct expr * exp)
switch(exp->type)
{
case EXPR_TYPE_CAST:
rtn = DEBUG_EvalExpr(exp->un.cast.expr);
rtn.type = exp->un.cast.cast;
break;
case EXPR_TYPE_STRING:
rtn.type = DEBUG_TypeString;
rtn.off = (unsigned int) &exp->un.string.str;
......@@ -620,6 +643,13 @@ DEBUG_DisplayExpr(struct expr * exp)
switch(exp->type)
{
case EXPR_TYPE_CAST:
fprintf(stderr, "((");
DEBUG_PrintTypeCast(exp->un.cast.cast);
fprintf(stderr, ")");
DEBUG_DisplayExpr(exp->un.cast.expr);
fprintf(stderr, ")");
break;
case EXPR_TYPE_REGISTER:
DEBUG_PrintRegister(exp->un.rgister.reg);
break;
......@@ -780,6 +810,9 @@ DEBUG_CloneExpr(struct expr * exp)
switch(exp->type)
{
case EXPR_TYPE_CAST:
rtn->un.cast.expr = DEBUG_CloneExpr(exp->un.cast.expr);
break;
case EXPR_TYPE_REGISTER:
case EXPR_TYPE_US_CONST:
case EXPR_TYPE_CONST:
......@@ -834,6 +867,9 @@ DEBUG_FreeExpr(struct expr * exp)
switch(exp->type)
{
case EXPR_TYPE_CAST:
DEBUG_FreeExpr(exp->un.cast.expr);
break;
case EXPR_TYPE_REGISTER:
case EXPR_TYPE_US_CONST:
case EXPR_TYPE_CONST:
......
......@@ -18,6 +18,9 @@
#include "xmalloc.h"
#define NR_NAME_HASH 16384
#ifndef PATH_MAX
#define PATH_MAX _MAX_PATH
#endif
static char * reg_name[] =
{
......
......@@ -17,10 +17,10 @@
*/
void DEBUG_PrintBasic( const DBG_ADDR *addr, int count, char format )
{
char * default_format;
char * default_format;
long long int value;
if( addr->type == NULL )
if( addr->type == NULL )
{
fprintf(stderr, "Unable to evaluate expression\n");
return;
......@@ -32,16 +32,22 @@ void DEBUG_PrintBasic( const DBG_ADDR *addr, int count, char format )
switch(format)
{
case 'x':
if (addr->seg) fprintf( stderr, "0x%04lx", (long unsigned int) value );
else fprintf( stderr, "0x%08lx", (long unsigned int) value );
if (addr->seg)
{
DEBUG_nchar += fprintf( stderr, "0x%04lx", (long unsigned int) value );
}
else
{
DEBUG_nchar += fprintf( stderr, "0x%08lx", (long unsigned int) value );
}
break;
case 'd':
fprintf( stderr, "%ld\n", (long int) value );
DEBUG_nchar += fprintf( stderr, "%ld\n", (long int) value );
break;
case 'c':
fprintf( stderr, "%d = '%c'",
DEBUG_nchar += fprintf( stderr, "%d = '%c'",
(char)(value & 0xff), (char)(value & 0xff) );
break;
......@@ -53,11 +59,10 @@ void DEBUG_PrintBasic( const DBG_ADDR *addr, int count, char format )
case 0:
if( default_format != NULL )
{
fprintf( stderr, default_format, value );
DEBUG_nchar += fprintf( stderr, default_format, value );
}
break;
}
}
......
......@@ -512,9 +512,9 @@ struct deferred_debug_info
char * module_name;
char * dbg_info;
int dbg_size;
struct PE_Debug_dir * dbgdir;
LPIMAGE_DEBUG_DIRECTORY dbgdir;
struct pe_data * pe;
struct pe_segment_table * sectp;
LPIMAGE_SECTION_HEADER sectp;
int nsect;
short int dbg_index;
char loaded;
......@@ -747,17 +747,24 @@ DEBUG_ParseTypeTable(char * table, int len)
}
memset(symname, 0, sizeof(symname));
memcpy(symname, type->structure.name, type->structure.namelen);
typeptr = DEBUG_NewDataType(STRUCT, symname);
if( strcmp(symname, "__unnamed") == 0 )
{
typeptr = DEBUG_NewDataType(STRUCT, NULL);
}
else
{
typeptr = DEBUG_NewDataType(STRUCT, symname);
}
cv_defined_types[curr_type - 0x1000] = typeptr;
/*
* Now copy the relevant bits from the fieldlist that we specified.
*/
subtype = DEBUG_GetCVType(type->structure.fieldlist);
DEBUG_SetStructSize(typeptr, type->structure.structlen);
if( subtype != NULL )
{
DEBUG_SetStructSize(typeptr, type->structure.structlen);
DEBUG_CopyFieldlist(typeptr, subtype);
}
break;
......@@ -773,17 +780,26 @@ DEBUG_ParseTypeTable(char * table, int len)
}
memset(symname, 0, sizeof(symname));
memcpy(symname, type->t_union.name, type->t_union.namelen);
typeptr = DEBUG_NewDataType(STRUCT, symname);
if( strcmp(symname, "__unnamed") == 0 )
{
typeptr = DEBUG_NewDataType(STRUCT, NULL);
}
else
{
typeptr = DEBUG_NewDataType(STRUCT, symname);
}
cv_defined_types[curr_type - 0x1000] = typeptr;
/*
* Now copy the relevant bits from the fieldlist that we specified.
*/
subtype = DEBUG_GetCVType(type->t_union.field);
DEBUG_SetStructSize(typeptr, type->t_union.un_len);
if( subtype != NULL )
{
DEBUG_SetStructSize(typeptr, type->t_union.un_len);
DEBUG_CopyFieldlist(typeptr, subtype);
}
break;
......@@ -874,14 +890,14 @@ DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
int has_codeview = FALSE;
int rtn = FALSE;
int orig_size;
struct PE_Debug_dir * dbgptr;
LPIMAGE_DEBUG_DIRECTORY dbgptr;
struct deferred_debug_info * deefer;
orig_size = size;
dbgptr = (struct PE_Debug_dir *) (load_addr + v_addr);
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (load_addr + v_addr);
for(; size > 0; size -= sizeof(*dbgptr), dbgptr++ )
{
switch(dbgptr->type)
switch(dbgptr->Type)
{
case IMAGE_DEBUG_TYPE_CODEVIEW:
case IMAGE_DEBUG_TYPE_MISC:
......@@ -891,10 +907,10 @@ DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
}
size = orig_size;
dbgptr = (struct PE_Debug_dir *) (load_addr + v_addr);
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (load_addr + v_addr);
for(; size > 0; size -= sizeof(*dbgptr), dbgptr++ )
{
switch(dbgptr->type)
switch(dbgptr->Type)
{
case IMAGE_DEBUG_TYPE_COFF:
/*
......@@ -921,8 +937,8 @@ DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
* means that this entry points to a .DBG file. Otherwise,
* it just points to itself, and we can ignore this.
*/
if( (dbgptr->type == IMAGE_DEBUG_TYPE_MISC)
&& (pe->pe_header->coff.Characteristics & IMAGE_FILE_DEBUG_STRIPPED) == 0 )
if( (dbgptr->Type == IMAGE_DEBUG_TYPE_MISC)
&& (pe->pe_header->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED) == 0 )
{
break;
}
......@@ -938,9 +954,9 @@ DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
* upon the type, but this is always enough so we are able
* to proceed if we know what we need to do next.
*/
deefer->dbg_size = dbgptr->dbgsize;
deefer->dbg_info = (char *) xmalloc(dbgptr->dbgsize);
lseek(fd, dbgptr->dbgoff, SEEK_SET);
deefer->dbg_size = dbgptr->SizeOfData;
deefer->dbg_info = (char *) xmalloc(dbgptr->SizeOfData);
lseek(fd, dbgptr->PointerToRawData, SEEK_SET);
read(fd, deefer->dbg_info, deefer->dbg_size);
deefer->load_addr = (char *) load_addr;
......@@ -951,7 +967,7 @@ DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
deefer->module_name = xstrdup(DEBUG_curr_module);
deefer->sectp = pe->pe_seg;
deefer->nsect = pe->pe_header->coff.NumberOfSections;
deefer->nsect = pe->pe_header->FileHeader.NumberOfSections;
dbglist = deefer;
break;
......@@ -1538,7 +1554,7 @@ DEBUG_SnarfCodeView( struct deferred_debug_info * deefer,
DBG_ADDR new_addr;
int nsect;
union any_size ptr;
struct pe_segment_table * sectp;
IMAGE_SECTION_HEADER * sectp;
union codeview_symbol * sym;
char symname[PATH_MAX];
struct name_hash * thunk_sym = NULL;
......@@ -1601,7 +1617,7 @@ DEBUG_SnarfCodeView( struct deferred_debug_info * deefer,
new_addr.seg = 0;
new_addr.type = DEBUG_GetCVType(sym->data.symtype);
new_addr.off = (unsigned int) deefer->load_addr +
sectp[sym->data.seg - 1].Virtual_Address +
sectp[sym->data.seg - 1].VirtualAddress +
sym->data.offset;
DEBUG_AddSymbol( symname, &new_addr, NULL, SYM_WIN32 | SYM_DATA );
break;
......@@ -1615,7 +1631,7 @@ DEBUG_SnarfCodeView( struct deferred_debug_info * deefer,
new_addr.seg = 0;
new_addr.type = NULL;
new_addr.off = (unsigned int) deefer->load_addr +
sectp[sym->thunk.segment - 1].Virtual_Address +
sectp[sym->thunk.segment - 1].VirtualAddress +
sym->thunk.offset;
thunk_sym = DEBUG_AddSymbol( symname, &new_addr, NULL,
SYM_WIN32 | SYM_FUNC);
......@@ -1630,7 +1646,7 @@ DEBUG_SnarfCodeView( struct deferred_debug_info * deefer,
new_addr.seg = 0;
new_addr.type = DEBUG_GetCVType(sym->proc.proctype);
new_addr.off = (unsigned int) deefer->load_addr +
sectp[sym->proc.segment - 1].Virtual_Address +
sectp[sym->proc.segment - 1].VirtualAddress +
sym->proc.offset;
/*
* See if we can find a segment that this goes with. If so,
......@@ -1640,10 +1656,10 @@ DEBUG_SnarfCodeView( struct deferred_debug_info * deefer,
for(i=0; linetab[i].linetab != NULL; i++)
{
if( ((unsigned int) deefer->load_addr
+ sectp[linetab[i].segno - 1].Virtual_Address
+ sectp[linetab[i].segno - 1].VirtualAddress
+ linetab[i].start <= new_addr.off)
&& ((unsigned int) deefer->load_addr
+ sectp[linetab[i].segno - 1].Virtual_Address
+ sectp[linetab[i].segno - 1].VirtualAddress
+ linetab[i].end > new_addr.off) )
{
break;
......@@ -2119,8 +2135,8 @@ DEBUG_ProcessDBGFile(struct deferred_debug_info * deefer, char * filename)
int j;
struct codeview_linetab_hdr * linetab;
int nsect;
struct PE_DBG_FileHeader * pdbg = NULL;
struct pe_segment_table * sectp;
LPIMAGE_SEPARATE_DEBUG_HEADER pdbg = NULL;
IMAGE_SECTION_HEADER * sectp;
struct stat statbuf;
int status;
......@@ -2148,9 +2164,9 @@ DEBUG_ProcessDBGFile(struct deferred_debug_info * deefer, char * filename)
addr = mmap(0, statbuf.st_size, PROT_READ,
MAP_PRIVATE, fd, 0);
pdbg = (struct PE_DBG_FileHeader *) addr;
pdbg = (LPIMAGE_SEPARATE_DEBUG_HEADER) addr;
if( pdbg->TimeDateStamp != deefer->dbgdir->timestamp )
if( pdbg->TimeDateStamp != deefer->dbgdir->TimeDateStamp )
{
fprintf(stderr, "Warning - %s has incorrect internal timestamp\n",
filename);
......@@ -2160,10 +2176,10 @@ DEBUG_ProcessDBGFile(struct deferred_debug_info * deefer, char * filename)
fprintf(stderr, "Processing symbols from %s...\n", filename);
dbghdr = (struct PE_Debug_dir *) ( addr + sizeof(*pdbg)
+ pdbg->NumberOfSections * sizeof(struct pe_segment_table)
+ pdbg->NumberOfSections * sizeof(IMAGE_SECTION_HEADER)
+ pdbg->ExportedNamesSize);
sectp = (struct pe_segment_table *) ((char *) pdbg + sizeof(*pdbg));
sectp = (LPIMAGE_SECTION_HEADER) ((char *) pdbg + sizeof(*pdbg));
nsect = pdbg->NumberOfSections;
for( i=0; i < pdbg->DebugDirectorySize / sizeof(*pdbg); i++, dbghdr++ )
......@@ -2300,7 +2316,7 @@ DEBUG_ProcessDeferredDebug()
last_proc = deefer->dbg_index;
}
switch(deefer->dbgdir->type)
switch(deefer->dbgdir->Type)
{
case IMAGE_DEBUG_TYPE_COFF:
/*
......
......@@ -188,7 +188,7 @@ extern void DEBUG_GetSigContext( SIGCONTEXT *sigcontext )
#ifdef GS_sig
GS_sig(sigcontext) = GS_reg(&DEBUG_context);
#else
__asm__("movw %w0,%%gs"::"r" (FS_reg(&DEBUG_context)));
__asm__("movw %w0,%%gs"::"r" (GS_reg(&DEBUG_context)));
#endif
}
......
......@@ -93,7 +93,7 @@ DEBUG_NukePath()
}
static
void
int
DEBUG_DisplaySource(char * sourcefile, int start, int end)
{
char * addr;
......@@ -103,6 +103,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
struct open_filelist * ol;
int nlines;
char * pnt;
int rtn;
struct searchlist * sl;
struct stat statbuf;
int status;
......@@ -217,7 +218,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
ol->linelist = NULL;
ofiles = ol;
fprintf(stderr,"Unable to open file %s\n", tmppath);
return;
return FALSE;
}
}
}
......@@ -239,13 +240,13 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
fd = open(tmppath, O_RDONLY);
if( fd == -1 )
{
return;
return FALSE;
}
addr = mmap(0, statbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if( addr == (char *) -1 )
{
return;
return FALSE;
}
/*
......@@ -285,19 +286,20 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
fd = open(ol->real_path, O_RDONLY);
if( fd == -1 )
{
return;
return FALSE;
}
addr = mmap(0, ol->size, PROT_READ, MAP_PRIVATE, fd, 0);
if( addr == (char *) -1 )
{
return;
return FALSE;
}
}
/*
* All we need to do is to display the source lines here.
*/
rtn = FALSE;
for(i=start - 1; i <= end - 1; i++)
{
if( i < 0 || i >= ol->nlines - 1)
......@@ -305,6 +307,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
continue;
}
rtn = TRUE;
memset(&buffer, 0, sizeof(buffer));
if( ol->linelist[i+1] != ol->linelist[i] )
{
......@@ -317,6 +320,8 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
munmap(addr, ol->size);
close(fd);
return rtn;
}
void
......@@ -324,6 +329,7 @@ DEBUG_List(struct list_id * source1, struct list_id * source2,
int delta)
{
int end;
int rtn;
int start;
char * sourcefile;
......@@ -406,7 +412,7 @@ DEBUG_List(struct list_id * source1, struct list_id * source2,
/*
* Now call this function to do the dirty work.
*/
DEBUG_DisplaySource(sourcefile, start, end);
rtn = DEBUG_DisplaySource(sourcefile, start, end);
if( sourcefile != (char *) &DEBUG_current_sourcefile )
{
......
......@@ -11,8 +11,11 @@
#include <stdlib.h>
#include <assert.h>
#ifndef __EMX__
#include <sys/mman.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <strings.h>
......@@ -28,6 +31,9 @@
#define NR_TYPE_HASH 521
int DEBUG_nchar;
static int DEBUG_maxchar = 1024;
struct en_values
{
struct en_values* next;
......@@ -177,23 +183,11 @@ DEBUG_InitBasic(int type, char * name, int size, int b_signed,
return dt;
}
static
struct datatype *
DEBUG_NewDataType(enum debug_type xtype, const char * typename)
DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename)
{
struct datatype * dt = NULL;
int hash;
/*
* The last bucket is special, and is used to hold typeless names.
*/
if( typename == NULL )
{
hash = NR_TYPE_HASH;
}
else
{
hash = type_hash(typename);
}
if( typename != NULL )
{
......@@ -212,6 +206,29 @@ DEBUG_NewDataType(enum debug_type xtype, const char * typename)
}
}
return dt;
}
struct datatype *
DEBUG_NewDataType(enum debug_type xtype, const char * typename)
{
struct datatype * dt = NULL;
int hash;
/*
* The last bucket is special, and is used to hold typeless names.
*/
if( typename == NULL )
{
hash = NR_TYPE_HASH;
}
else
{
hash = type_hash(typename);
}
dt = DEBUG_LookupDataType(xtype, hash, typename);
if( dt == NULL )
{
dt = (struct datatype *) xmalloc(sizeof(struct datatype));
......@@ -347,6 +364,11 @@ DEBUG_GetExprValue(DBG_ADDR * addr, char ** format)
switch(addr->type->type)
{
case BASIC:
if (!DBG_CHECK_READ_PTR( addr, addr->type->un.basic.basic_size))
{
return 0;
}
memcpy(&rtn, (char *) addr->off, addr->type->un.basic.basic_size);
if( (addr->type->un.basic.b_signed)
&& ((addr->type->un.basic.basic_size & 3) != 0)
......@@ -495,6 +517,12 @@ int
DEBUG_SetStructSize(struct datatype * dt, int size)
{
assert(dt->type == STRUCT);
if( dt->un.structure.members != NULL )
{
return FALSE;
}
dt->un.structure.size = size;
dt->un.structure.members = NULL;
......@@ -710,7 +738,8 @@ DEBUG_ArrayIndex(DBG_ADDR * addr, DBG_ADDR * result, int index)
*
* Implementation of the 'print' command.
*/
void DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
void
DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
{
DBG_ADDR addr1;
int i;
......@@ -728,9 +757,20 @@ void DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
if( addr->type == NULL )
{
fprintf(stderr, "Unable to evaluate expression\n");
return;
goto leave;
}
if( level == 0 )
{
DEBUG_nchar = 0;
}
if( DEBUG_nchar > DEBUG_maxchar )
{
fprintf(stderr, "...");
goto leave;
}
if( format == 'i' || format == 's' || format == 'w' || format == 'b' )
{
fprintf( stderr, "Format specifier '%c' is meaningless in 'print' command\n", format );
......@@ -746,20 +786,25 @@ void DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
DEBUG_PrintBasic(addr, 1, format);
break;
case STRUCT:
fprintf(stderr, "{");
DEBUG_nchar += fprintf(stderr, "{");
for(m = addr->type->un.structure.members; m; m = m->next)
{
addr1 = *addr;
DEBUG_FindStructElement(&addr1, m->name,
(int *) &value);
fprintf(stderr, "%s=", m->name);
DEBUG_nchar += fprintf(stderr, "%s=", m->name);
DEBUG_Print(&addr1, 1, format, level + 1);
if( m->next != NULL )
{
fprintf(stderr, ", ");
DEBUG_nchar += fprintf(stderr, ", ");
}
if( DEBUG_nchar > DEBUG_maxchar )
{
fprintf(stderr, "...}");
goto leave;
}
}
fprintf(stderr, "}");
DEBUG_nchar += fprintf(stderr, "}");
break;
case ARRAY:
/*
......@@ -772,28 +817,39 @@ void DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
* Special handling for character arrays.
*/
pnt = (char *) addr->off;
fprintf(stderr, "\"");
DEBUG_nchar += fprintf(stderr, "\"");
for( i=addr->type->un.array.start; i < addr->type->un.array.end; i++ )
{
fputc(*pnt++, stderr);
DEBUG_nchar++;
if( DEBUG_nchar > DEBUG_maxchar )
{
fprintf(stderr, "...\"");
goto leave;
}
}
fprintf(stderr, "\"");
DEBUG_nchar += fprintf(stderr, "\"");
break;
}
addr1 = *addr;
addr1.type = addr->type->un.array.basictype;
fprintf(stderr, "{");
DEBUG_nchar += fprintf(stderr, "{");
for( i=addr->type->un.array.start; i <= addr->type->un.array.end; i++ )
{
DEBUG_Print(&addr1, 1, format, level + 1);
addr1.off += size;
if( i == addr->type->un.array.end )
{
fprintf(stderr, "}");
DEBUG_nchar += fprintf(stderr, "}");
}
else
{
fprintf(stderr, ", ");
DEBUG_nchar += fprintf(stderr, ", ");
}
if( DEBUG_nchar > DEBUG_maxchar )
{
fprintf(stderr, "...}");
goto leave;
}
}
break;
......@@ -802,8 +858,157 @@ void DEBUG_Print( const DBG_ADDR *addr, int count, char format, int level )
break;
}
leave:
if( level == 0 )
{
fprintf(stderr, "\n");
DEBUG_nchar += fprintf(stderr, "\n");
}
return;
}
int
DEBUG_DumpTypes()
{
struct datatype * dt = NULL;
struct member * m;
int hash;
int nm;
char * name;
char * member_name;
for(hash = 0; hash < NR_TYPE_HASH + 1; hash++)
{
for( dt = type_hash_table[hash]; dt; dt = dt->next )
{
name = "none";
if( dt->name != NULL )
{
name = dt->name;
}
switch(dt->type)
{
case BASIC:
fprintf(stderr, "0x%p - BASIC(%s)\n",
dt, name);
break;
case POINTER:
fprintf(stderr, "0x%p - POINTER(%s)(%p)\n",
dt, name, dt->un.pointer.pointsto);
break;
case STRUCT:
member_name = "none";
nm = 0;
if( dt->un.structure.members != NULL
&& dt->un.structure.members->name != NULL )
{
member_name = dt->un.structure.members->name;
for( m = dt->un.structure.members; m; m = m->next)
{
nm++;
}
}
fprintf(stderr, "0x%p - STRUCT(%s) %d %d %s\n", dt, name,
dt->un.structure.size, nm, member_name);
break;
case ARRAY:
fprintf(stderr, "0x%p - ARRAY(%s)(%p)\n",
dt, name, dt->un.array.basictype);
break;
case ENUM:
fprintf(stderr, "0x%p - ENUM(%s)\n",
dt, name);
break;
case BITFIELD:
fprintf(stderr, "0x%p - BITFIELD(%s)\n", dt, name);
break;
case FUNC:
fprintf(stderr, "0x%p - FUNC(%s)(%p)\n",
dt, name, dt->un.funct.rettype);
break;
case CONST:
case TYPEDEF:
fprintf(stderr, "What???\n");
break;
}
}
}
return TRUE;
}
enum debug_type DEBUG_GetType(struct datatype * dt)
{
return dt->type;
}
struct datatype *
DEBUG_TypeCast(enum debug_type type, const char * name)
{
int hash;
struct datatype * rtn;
/*
* The last bucket is special, and is used to hold typeless names.
*/
if( name == NULL )
{
hash = NR_TYPE_HASH;
}
else
{
hash = type_hash(name);
}
rtn = DEBUG_LookupDataType(type, hash, name);
return rtn;
}
int
DEBUG_PrintTypeCast(struct datatype * dt)
{
char * name;
name = "none";
if( dt->name != NULL )
{
name = dt->name;
}
switch(dt->type)
{
case BASIC:
fprintf(stderr, "%s", name);
break;
case POINTER:
DEBUG_PrintTypeCast(dt->un.pointer.pointsto);
fprintf(stderr, "*");
break;
case STRUCT:
fprintf(stderr, "struct %s", name);
break;
case ARRAY:
fprintf(stderr, "%s[]", name);
break;
case ENUM:
fprintf(stderr, "enum %s", name);
break;
case BITFIELD:
fprintf(stderr, "unsigned %s", name);
break;
case FUNC:
DEBUG_PrintTypeCast(dt->un.funct.rettype);
fprintf(stderr, "(*%s)()", name);
break;
case CONST:
case TYPEDEF:
fprintf(stderr, "What???\n");
break;
}
return TRUE;
}
......@@ -5,10 +5,11 @@ EMX 0.9c (fix 2)
XFree86 3.2 OS/2 (with development libraries)
bash, gnu make, grep, tar, bison, flex
sed (a working copy of)
xpm
diff and patch are recommended
To compile:
sh
sh
tools/make_os2.sh
make depend
make (make doesn't work yet... I will need to do some others patch, or
......@@ -16,14 +17,25 @@ make (make doesn't work yet... I will need to do some others patch, or
Currently:
- configure and make depend work...
- make doesn't work
- make doesn't work well...
- the selectors numbers (0) are wrong...
- signal handling is horrible... (if any)
- EMX doesn't seem to support mmap
- debugger don't compile at all
- sigcontext.h isn't right (incomplete structure?).
What needs to be redone:
File functions, I/O access (do it!), Interrupt (if int unknow, call
current RealMode one...), verify that everything is thread safe (how
does Win95/NT handle multi-thread?), move X functions in some files
(and make a wrapper, to use PM instead latter), etc...
- File functions,
- I/O access (do it!),
- Communication (modem),
- Interrupt (if int unknow, call current RealMode one...),
- verify that everything is thread safe (how does Win95/NT handle multi-thread?),
- move X functions in some files (and make a wrapper, to use PM instead latter),
- implement mmap (or find something else),
- make debugger work,
- return right CPU type,
- make winsock work
The good things:
- OS/2 have DOS interrupts
......@@ -33,3 +45,4 @@ The good things:
Robert Pouliot <krynos@clic.net>
January 9, 1997

......@@ -1333,8 +1333,7 @@ QueryDosDevice32A(LPCSTR devname,LPSTR target,DWORD bufsize)
}
lstrcpy32A(buffer,"\\DEV\\");
lstrcat32A(buffer,devname);
if (s=strchr(buffer,':'))
*s='\0';
if ((s=strchr(buffer,':'))) *s='\0';
lstrcpyn32A(target,buffer,bufsize);
return strlen(buffer);
}
......
......@@ -19,7 +19,7 @@
#include <sys/mount.h>
#include <sys/errno.h>
#endif
#if defined(__svr4__) || defined(_SCO_DS)
#if defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
#include <sys/statfs.h>
#endif
......@@ -505,7 +505,7 @@ static int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
}
*size = info.f_bsize * info.f_blocks;
#if defined(__svr4__) || defined(_SCO_DS)
#if defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
*available = info.f_bfree * info.f_bsize;
#else
*available = info.f_bavail * info.f_bsize;
......
......@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
......@@ -316,6 +317,8 @@ static void FILE_FillInfo( struct stat *st, BY_HANDLE_FILE_INFORMATION *info )
info->dwFileAttributes = FILE_ATTRIBUTE_ARCHIVE;
if (S_ISDIR(st->st_mode))
info->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
if (!(st->st_mode & S_IWUSR))
info->dwFileAttributes |= FILE_ATTRIBUTE_READONLY;
DOSFS_UnixTimeToFileTime( st->st_mtime, &info->ftCreationTime, 0 );
DOSFS_UnixTimeToFileTime( st->st_mtime, &info->ftLastWriteTime, 0 );
......@@ -510,6 +513,8 @@ UINT32 GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
if (!path) return 0;
strcpy( buffer, path );
p = buffer + strlen(buffer);
/* add a \, if there isn't one ... */
if ((p == buffer) || (p[-1] != '\\')) *p++ = '\\';
*p++ = '~';
for (i = 3; (i > 0) && (*prefix); i--) *p++ = *prefix++;
sprintf( p, "%04x.tmp", num );
......@@ -538,6 +543,8 @@ UINT32 GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
if (DOSFS_GetFullName( buffer, FALSE, &full_name ))
{
/* Check if we have write access in the directory */
if ((p = strrchr( full_name.long_name, '/' ))) *p = '\0';
if (access( full_name.long_name, W_OK ) == -1)
fprintf( stderr,
"Warning: GetTempFileName returns '%s', which doesn't seem to be writeable.\n"
......
......@@ -7,7 +7,8 @@ MODULE = win16drv
C_SRCS = \
font.c \
init.c
init.c \
text.c
all: $(MODULE).o
......
/*
* win16 driver text functions
*
* Copyright 1996 John Harvey
*/
#include <stdlib.h>
#include "windows.h"
#include "win16drv.h"
#include "dc.h"
#include "gdi.h"
#include "stddebug.h"
/* #define DEBUG_WIN16DRV */
#include "debug.h"
/***********************************************************************
* WIN16DRV_ExtTextOut
*/
BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
const RECT32 *lprect, LPCSTR str, UINT32 count,
const INT32 *lpDx )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
BOOL32 bRet = 1;
extern DRAWMODE DrawMode;
LPDRAWMODE lpDrawMode = &DrawMode;
TEXTXFORM16 TextXForm;
LPTEXTXFORM16 lpTextXForm = &TextXForm;
RECT16 rcClipRect;
RECT16 * lpClipRect = &rcClipRect;
RECT16 rcOpaqueRect;
RECT16 *lpOpaqueRect = &rcOpaqueRect;
WORD wOptions = 0;
WORD wCount = count;
static BOOL32 bInit = FALSE;
if (count == 0)
return FALSE;
dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n", dc->hSelf, x, y,
flags, lprect, count > 0 ? count : 8, str, lpDx);
InitTextXForm(lpTextXForm);
if (bInit == FALSE)
{
DWORD dwRet;
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
NULL, " ",
-1, physDev->segptrFontInfo, lpDrawMode,
lpTextXForm, NULL, NULL, 0);
bInit = TRUE;
}
if (dc != NULL)
{
DWORD dwRet;
/*
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
NULL, "0",
-1, physDev->segptrFontInfo, lpDrawMode,
lpTextXForm, NULL, NULL, 0);
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
NULL, str, -wCount,
physDev->segptrFontInfo, lpDrawMode,
lpTextXForm, NULL, NULL, 0);
*/
lpClipRect->left = lprect->left ;
lpClipRect->top = lprect->top;
lpClipRect->right = lprect->right;
lpClipRect->bottom = lprect->bottom;
dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut Clip rect left %d top %d rigt %d bottom %d\n",
lpClipRect->left,lpClipRect->top,lpClipRect->right,lpClipRect->bottom);
lpClipRect->left = 0;
lpClipRect->top = 0;
lpClipRect->right = 0x3fc;
lpClipRect->bottom = 0x630;
dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut Clip rect left %d top %d rigt %d bottom %d\n",
lpClipRect->left,lpClipRect->top,lpClipRect->right,lpClipRect->bottom);
lpOpaqueRect->left = x;
lpOpaqueRect->top = y;
lpOpaqueRect->right = 0x3a1;
lpOpaqueRect->bottom = 0x01;
printf("drawmode ropt 0x%x bkMode 0x%x bkColor 0x%x textColor 0x%x tbbreakExtra 0x%x breakextra 0x%x\n",
lpDrawMode->Rop2, lpDrawMode->bkMode, lpDrawMode->bkColor,
lpDrawMode->TextColor, lpDrawMode->TBreakExtra, lpDrawMode->BreakExtra);
printf("breakerr 0x%x breakrem 0x%x breakcount 0x%x chextra 0x%x lbkcolor 0x%x ltextcolor 0x%x\n",
lpDrawMode->BreakErr, lpDrawMode->BreakRem, lpDrawMode->BreakCount,
lpDrawMode->CharExtra, lpDrawMode->LbkColor, lpDrawMode->LTextColor);
{
RECT16 rcPageSize;
FONTINFO16 *p = (FONTINFO16 *)PTR_SEG_TO_LIN(physDev->segptrFontInfo);
rcPageSize.left = 0;
rcPageSize.right = 0x3c0;
rcPageSize.top = 0;
rcPageSize.bottom = 0x630;
if(y < rcPageSize.top || y + p->dfPixHeight > rcPageSize.bottom)
{
printf("Failed 1 y %d top %d y +height %d bottom %d\n",
y, rcPageSize.top , y + p->dfPixHeight , rcPageSize.bottom);
}
if(x >= rcPageSize.right ||
x + wCount * p->dfPixWidth < rcPageSize.left)
{
printf("Faile 2\n");
}
}
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, x, y,
lpClipRect, str,
wCount, physDev->segptrFontInfo, lpDrawMode,
lpTextXForm, NULL, NULL, wOptions);
/*
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, x, y,
lpClipRect, str,
wCount, physDev->segptrFontInfo, lpDrawMode,
lpTextXForm, lpDx, NULL, flags);
*/
}
return bRet;
}
......@@ -8,7 +8,9 @@
#include <X11/extensions/XShm.h>
#include <sys/types.h>
#include <sys/ipc.h>
#ifndef __EMX__
#include <sys/shm.h>
#endif
#include "windows.h"
#include "bitmap.h"
......
......@@ -25,3 +25,41 @@ BOOL32 X11DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
* dc->wndExtY / dc->vportExtY);
return TRUE;
}
BOOL32 X11DRV_GetTextMetrics(DC *dc, TEXTMETRIC32A *metrics)
{
metrics->tmWeight = dc->u.x.font.metrics.tmWeight;
metrics->tmOverhang = dc->u.x.font.metrics.tmOverhang;
metrics->tmDigitizedAspectX = dc->u.x.font.metrics.tmDigitizedAspectX;
metrics->tmDigitizedAspectY = dc->u.x.font.metrics.tmDigitizedAspectY;
metrics->tmFirstChar = dc->u.x.font.metrics.tmFirstChar;
metrics->tmLastChar = dc->u.x.font.metrics.tmLastChar;
metrics->tmDefaultChar = dc->u.x.font.metrics.tmDefaultChar;
metrics->tmBreakChar = dc->u.x.font.metrics.tmBreakChar;
metrics->tmItalic = dc->u.x.font.metrics.tmItalic;
metrics->tmUnderlined = dc->u.x.font.metrics.tmUnderlined;
metrics->tmStruckOut = dc->u.x.font.metrics.tmStruckOut;
metrics->tmPitchAndFamily = dc->u.x.font.metrics.tmPitchAndFamily;
metrics->tmCharSet = dc->u.x.font.metrics.tmCharSet;
metrics->tmAscent = abs( dc->u.x.font.metrics.tmAscent
* dc->wndExtY / dc->vportExtY );
metrics->tmDescent = abs( dc->u.x.font.metrics.tmDescent
* dc->wndExtY / dc->vportExtY );
metrics->tmHeight = dc->u.x.font.metrics.tmAscent + dc->u.x.font.metrics.tmDescent;
metrics->tmInternalLeading = abs( dc->u.x.font.metrics.tmInternalLeading
* dc->wndExtY / dc->vportExtY );
metrics->tmExternalLeading = abs( dc->u.x.font.metrics.tmExternalLeading
* dc->wndExtY / dc->vportExtY );
metrics->tmMaxCharWidth = abs( dc->u.x.font.metrics.tmMaxCharWidth
* dc->wndExtX / dc->vportExtX );
metrics->tmAveCharWidth = abs( dc->u.x.font.metrics.tmAveCharWidth
* dc->wndExtX / dc->vportExtX );
return TRUE;
}
......@@ -5,6 +5,9 @@
*/
#include <math.h>
#if defined(__EMX__)
#include <float.h>
#endif
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
......
......@@ -30,7 +30,7 @@ static const DC_FUNCTIONS X11DRV_Funcs =
X11DRV_ExtTextOut, /* pExtTextOut */
X11DRV_GetPixel, /* pGetPixel */
X11DRV_GetTextExtentPoint, /* pGetTextExtentPoint */
NULL, /* pGetTextMetrics */
X11DRV_GetTextMetrics, /* pGetTextMetrics */
NULL, /* pIntersectClipRect */
NULL, /* pIntersectVisRect */
X11DRV_LineTo, /* pLineTo */
......
......@@ -41,8 +41,8 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
if (!DC_SetupGCForText( dc )) return TRUE;
font = dc->u.x.font.fstruct;
dprintf_text(stddeb,"ExtTextOut: hdc=%04x %d,%d '%*.*s', %d flags=%d\n",
dc->hSelf, x, y, count, count, str, count, flags);
dprintf_text(stddeb,"ExtTextOut: hdc=%04x %d,%d '%.*s', %d flags=%d\n",
dc->hSelf, x, y, (int)count, str, count, flags);
if (lprect != NULL) dprintf_text(stddeb, "\trect=(%d,%d- %d,%d)\n",
lprect->left, lprect->top,
lprect->right, lprect->bottom );
......
......@@ -111,7 +111,7 @@ base 1
0106 stub OpenBackupEventLogW
0107 stub OpenEventLogA
0108 stub OpenEventLogW
0109 stub OpenProcessToken
0109 stdcall OpenProcessToken(long long ptr) OpenProcessToken
0110 stub OpenSCManagerA
0111 stub OpenSCManagerW
0112 stub OpenServiceA
......@@ -129,7 +129,7 @@ base 1
0124 stub ReadEventLogA
0125 stub ReadEventLogW
0126 stdcall RegCloseKey(long) RegCloseKey
0127 stub RegConnectRegistryA
0127 stdcall RegConnectRegistryA(ptr long ptr) RegConnectRegistry32A
0128 stub RegConnectRegistryW
0129 stdcall RegCreateKeyA(long ptr ptr) RegCreateKey32A
0130 stdcall RegCreateKeyExA(long ptr long ptr long long ptr ptr ptr) RegCreateKeyEx32A
......
......@@ -267,7 +267,7 @@ base 1
262 stub _searchenv
263 stub _seterrormode
264 stub _setjmp
265 stub _setmode
265 cdecl _setmode(long long) CRTDLL__setmode
266 stub _setsystime
267 stub _sleep
268 stub _snprintf
......@@ -295,7 +295,7 @@ base 1
290 stub _strlwr
291 stub _strncnt
292 stub _strnextc
293 stub _strnicmp
293 cdecl _strnicmp(ptr ptr long) lstrncmpi32A
294 stub _strninc
295 stub _strnset
296 stub _strrev
......@@ -347,7 +347,7 @@ base 1
342 cdecl asin(long) CRTDLL_asin
343 cdecl atan(long) CRTDLL_atan
344 cdecl atan2(long long) CRTDLL_atan2
345 stub atexit
345 cdecl atexit(ptr) CRTDLL_atexit
346 cdecl atof(ptr) CRTDLL_atof
347 cdecl atoi(ptr) CRTDLL_atoi
348 cdecl atol(ptr) CRTDLL_atol
......@@ -446,7 +446,7 @@ base 1
441 stub putc
442 cdecl putchar(long) CRTDLL_putchar
443 stub puts
444 stub qsort
444 cdecl qsort(ptr long long ptr) qsort
445 stub raise
446 cdecl rand() CRTDLL_rand
447 cdecl realloc(ptr long) CRTDLL_realloc
......
......@@ -44,7 +44,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
s_word s_word long) StretchBlt16
36 pascal16 Polygon (word ptr word) Polygon16
37 pascal16 Polyline (word ptr word) Polyline16
38 pascal Escape(word word word segptr segptr) Escape
38 pascal Escape(word word word segptr segptr) Escape16
39 pascal16 RestoreDC(word s_word) RestoreDC16
40 pascal16 FillRgn(word word word) FillRgn16
41 pascal16 FrameRgn(word word word word word) FrameRgn16
......@@ -209,9 +209,9 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
281 pascal DrvSetPrinterData(ptr ptr ptr ptr long) DrvSetPrinterData
282 pascal DrvGetPrinterData(ptr ptr ptr ptr long ptr) DrvGetPrinterData
299 stub ENGINEGETCHARWIDTHEX
300 stub ENGINEENUMERATEFONT
300 pascal EnginEnumerateFont(ptr segptr long) EngineEnumerateFont
301 stub ENGINEDELETEFONT
302 stub ENGINEREALIZEFONT
302 pascal EnginRealizeFont(ptr ptr ptr) EngineRealizeFont
303 stub ENGINEGETCHARWIDTH
304 stub ENGINESETFONTCONTEXT
305 stub ENGINEGETGLYPHBMP
......
......@@ -96,7 +96,7 @@ base 1
0088 stub EnumMetaFile
0089 stdcall EnumObjects(long long ptr long) THUNK_EnumObjects32
0090 stdcall EqualRgn(long long) EqualRgn32
0091 stdcall Escape(long long long ptr ptr) Escape
0091 stdcall Escape(long long long ptr ptr) Escape32
0092 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32
0093 stub ExtCreatePen
0094 stub ExtCreateRegion
......
......@@ -63,7 +63,7 @@ type win16
64 pascal16 AccessResource(word word) AccessResource16
65 pascal SizeofResource(word word) SizeofResource16
66 pascal16 AllocResource(word word long) AllocResource16
67 stub SetResourceHandler
67 pascal SetResourceHandler(word ptr ptr) SetResourceHandler
68 pascal16 InitAtomTable(word) InitAtomTable
69 pascal16 FindAtom(segptr) FindAtom
70 pascal16 AddAtom(segptr) AddAtom
......
......@@ -270,7 +270,7 @@ base 0
266 stdcall RtlAllocateHeap(long long long) HeapAlloc
267 stub RtlAnsiCharToUnicodeChar
268 stub RtlAnsiStringToUnicodeSize
269 stub RtlAnsiStringToUnicodeString
269 stdcall RtlAnsiStringToUnicodeString(ptr ptr long) RtlAnsiStringToUnicodeString
270 stub RtlAppendAsciizToString
271 stub RtlAppendStringToString
272 stub RtlAppendUnicodeStringToString
......@@ -345,7 +345,7 @@ base 0
341 stub RtlEnlargedIntegerMultiply
342 stub RtlEnlargedUnsignedDivide
343 stub RtlEnlargedUnsignedMultiply
344 stub RtlEnterCriticalSection
344 stdcall RtlEnterCriticalSection(ptr) EnterCriticalSection
345 stub RtlEnumProcessHeaps
346 stub RtlEnumerateGenericTable
347 stub RtlEnumerateGenericTableWithoutSplaying
......@@ -391,7 +391,7 @@ base 0
387 stub RtlGetGroupSecurityDescriptor
388 stub RtlGetLongestNtPathLength
389 stub RtlGetNtGlobalFlags
390 stub RtlGetNtProductType
390 stdcall RtlGetNtProductType(ptr) RtlGetNtProductType
391 stub RtlGetOwnerSecurityDescriptor
392 stub RtlGetProcessHeaps
393 stub RtlGetSaclSecurityDescriptor
......@@ -403,11 +403,11 @@ base 0
399 stub RtlInitAnsiString
400 stub RtlInitCodePageTable
401 stub RtlInitNlsTables
402 stub RtlInitString
403 stub RtlInitUnicodeString
402 stdcall RtlInitString(ptr ptr) RtlInitString
403 stdcall RtlInitUnicodeString(ptr ptr) RtlInitUnicodeString
404 stub RtlInitializeBitMap
405 stub RtlInitializeContext
406 stub RtlInitializeCriticalSection
406 stdcall RtlInitializeCriticalSection(ptr) InitializeCriticalSection
407 stub RtlInitializeGenericTable
408 stub RtlInitializeRXact
409 stub RtlInitializeResource
......@@ -427,7 +427,7 @@ base 0
423 stub RtlLargeIntegerShiftRight
424 stub RtlLargeIntegerSubtract
425 stub RtlLargeIntegerToChar
426 stub RtlLeaveCriticalSection
426 stdcall RtlLeaveCriticalSection(ptr) LeaveCriticalSection
427 stdcall RtlLengthRequiredSid(long) RtlLengthRequiredSid
428 stub RtlLengthSecurityDescriptor
429 stub RtlLengthSid
......@@ -443,12 +443,12 @@ base 0
439 stub RtlNewSecurityGrantedAccess
440 stub RtlNewSecurityObject
441 stdcall RtlNormalizeProcessParams(ptr) RtlNormalizeProcessParams
442 stub RtlNtStatusToDosError
442 stdcall RtlNtStatusToDosError(long) RtlNtStatusToDosError
443 stub RtlNumberGenericTableElements
444 stub RtlNumberOfClearBits
445 stub RtlNumberOfSetBits
446 stub RtlOemStringToUnicodeSize
447 stub RtlOemStringToUnicodeString
447 stdcall RtlOemStringToUnicodeString(ptr ptr long) RtlOemStringToUnicodeString
448 stdcall RtlOemToUnicodeN(ptr long ptr ptr long) RtlOemToUnicodeN
449 stub RtlOpenCurrentUser
450 stub RtlPcToFileHeader
......@@ -521,7 +521,7 @@ base 0
517 stub RtlUnlockHeap
518 stub RtlUnwind
519 stub RtlUpcaseUnicodeChar
520 stub RtlUpcaseUnicodeString
520 stdcall RtlUpcaseUnicodeString(ptr ptr long) RtlUpcaseUnicodeString
521 stub RtlUpcaseUnicodeStringToAnsiString
522 stub RtlUpcaseUnicodeStringToCountedOemString
523 stub RtlUpcaseUnicodeStringToOemString
......@@ -549,8 +549,8 @@ base 0
545 stub RtlpNtSetValueKey
546 stub RtlpUnWaitCriticalSection
547 stub RtlpWaitForCriticalSection
548 stub RtlxAnsiStringToUnicodeSize
549 stub RtlxOemStringToUnicodeSize
548 stdcall RtlxAnsiStringToUnicodeSize(ptr) RtlxAnsiStringToUnicodeSize
549 stdcall RtlxOemStringToUnicodeSize(ptr) RtlxOemStringToUnicodeSize
550 stub RtlxUnicodeStringToAnsiSize
551 stub RtlxUnicodeStringToOemSize
552 stub SaveEm87Context
......@@ -928,27 +928,27 @@ base 0
924 stdcall strrchr(ptr long) strrchr
925 stub strspn
926 stub strstr
927 stub swprintf
927 stdcall swprintf() CRTDLL_swprintf
928 stub tan
929 stub tolower
930 stub toupper
931 stub towlower
932 stub towupper
933 stub vsprintf
934 stub wcscat
935 stub wcschr
934 stdcall wcscat(ptr ptr) lstrcat32W
935 stdcall wcschr(ptr long) CRTDLL_wcschr
936 stub wcscmp
937 stub wcscpy
937 stdcall wcscpy(ptr ptr) lstrcpy32W
938 stub wcscspn
939 stub wcslen
939 stdcall wcslen(ptr) lstrlen32W
940 stub wcsncat
941 stub wcsncmp
942 stub wcsncpy
942 stdcall wcsncpy(ptr ptr long) lstrcpyn32W
943 stub wcspbrk
944 stub wcsrchr
944 stdcall wcsrchr(ptr long) CRTDLL_wcsrchr
945 stub wcsspn
946 stub wcsstr
946 stdcall wcsstr(ptr ptr) CRTDLL_wcsstr
947 stub wcstok
948 stub wcstol
949 stub wcstombs
949 stdcall wcstombs(ptr ptr) lstrcpyWtoA
950 stub wcstoul
......@@ -232,7 +232,7 @@ void RELAY_DebugCallFrom32( int *stack, int nb_args )
printf( ") ret=%08x\n", stack[1] );
if (nb_args == -1) /* Register function */
{
CONTEXT *context = (CONTEXT *)((BYTE *)stack - sizeof(CONTEXT) - 12);
CONTEXT *context = (CONTEXT *)((BYTE *)stack - sizeof(CONTEXT) - 8);
printf( " EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx ESI=%08lx EDI=%08lx\n",
context->Eax, context->Ebx, context->Ecx, context->Edx,
context->Esi, context->Edi );
......@@ -263,7 +263,7 @@ void RELAY_DebugCallFrom32Ret( int *stack, int nb_args, int ret_val )
BUILTIN_GetEntryPoint32( (void *)stack[-2] ), ret_val, stack[1] );
if (nb_args == -1) /* Register function */
{
CONTEXT *context = (CONTEXT *)((BYTE *)stack - sizeof(CONTEXT) - 12);
CONTEXT *context = (CONTEXT *)((BYTE *)stack - sizeof(CONTEXT) - 8);
printf( " EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx ESI=%08lx EDI=%08lx\n",
context->Eax, context->Ebx, context->Ecx, context->Edx,
context->Esi, context->Edi );
......
......@@ -30,11 +30,11 @@ heap 65520
28 pascal16 ClientToScreen(word ptr) ClientToScreen16
29 pascal16 ScreenToClient(word ptr) ScreenToClient16
30 pascal16 WindowFromPoint(long) WindowFromPoint16
31 pascal16 IsIconic(word) IsIconic
31 pascal16 IsIconic(word) IsIconic16
32 pascal16 GetWindowRect(word ptr) GetWindowRect16
33 pascal16 GetClientRect(word ptr) GetClientRect16
34 pascal16 EnableWindow(word word) EnableWindow
35 pascal16 IsWindowEnabled(word) IsWindowEnabled
34 pascal16 EnableWindow(word word) EnableWindow16
35 pascal16 IsWindowEnabled(word) IsWindowEnabled16
36 pascal16 GetWindowText(word segptr word) GetWindowText16
37 pascal16 SetWindowText(word segptr) SetWindowText16
38 pascal16 GetWindowTextLength(word) GetWindowTextLength16
......@@ -42,25 +42,25 @@ heap 65520
40 pascal16 EndPaint(word ptr) EndPaint16
41 pascal16 CreateWindow(ptr ptr long s_word s_word s_word s_word
word word word segptr) CreateWindow16
42 pascal16 ShowWindow(word word) ShowWindow
42 pascal16 ShowWindow(word word) ShowWindow16
43 pascal16 CloseWindow(word) CloseWindow
44 pascal16 OpenIcon(word) OpenIcon
45 pascal16 BringWindowToTop(word) BringWindowToTop
45 pascal16 BringWindowToTop(word) BringWindowToTop16
46 pascal16 GetParent(word) GetParent16
47 pascal16 IsWindow(word) IsWindow
48 pascal16 IsChild(word word) IsChild
49 pascal16 IsWindowVisible(word) IsWindowVisible
48 pascal16 IsChild(word word) IsChild16
49 pascal16 IsWindowVisible(word) IsWindowVisible16
50 pascal16 FindWindow(segptr ptr) FindWindow16
#51 BEAR51
52 pascal16 AnyPopup() AnyPopup
53 pascal16 DestroyWindow(word) DestroyWindow
53 pascal16 DestroyWindow(word) DestroyWindow16
54 pascal16 EnumWindows(segptr long) THUNK_EnumWindows16
55 pascal16 EnumChildWindows(word segptr long) THUNK_EnumChildWindows16
56 pascal16 MoveWindow(word word word word word word) MoveWindow
56 pascal16 MoveWindow(word word word word word word) MoveWindow16
57 pascal16 RegisterClass(ptr) RegisterClass16
58 pascal16 GetClassName(word ptr word) GetClassName16
59 pascal16 SetActiveWindow(word) SetActiveWindow
60 pascal16 GetActiveWindow() GetActiveWindow
59 pascal16 SetActiveWindow(word) SetActiveWindow16
60 pascal16 GetActiveWindow() GetActiveWindow16
61 pascal16 ScrollWindow(word s_word s_word ptr ptr) ScrollWindow16
62 pascal16 SetScrollPos(word word s_word word) SetScrollPos16
63 pascal16 GetScrollPos(word word) GetScrollPos16
......@@ -90,14 +90,14 @@ heap 65520
88 pascal16 EndDialog(word s_word) EndDialog
89 pascal16 CreateDialog(word segptr word segptr) CreateDialog16
90 pascal16 IsDialogMessage(word ptr) IsDialogMessage
91 pascal16 GetDlgItem(word word) GetDlgItem
91 pascal16 GetDlgItem(word word) GetDlgItem16
92 pascal16 SetDlgItemText(word word segptr) SetDlgItemText16
93 pascal16 GetDlgItemText(word word segptr word) GetDlgItemText16
94 pascal16 SetDlgItemInt(word word word word) SetDlgItemInt16
95 pascal16 GetDlgItemInt(word word ptr word) GetDlgItemInt
96 pascal16 CheckRadioButton(word word word word) CheckRadioButton
97 pascal16 CheckDlgButton(word word word) CheckDlgButton
98 pascal16 IsDlgButtonChecked(word word) IsDlgButtonChecked
95 pascal16 GetDlgItemInt(word s_word ptr word) GetDlgItemInt16
96 pascal16 CheckRadioButton(word word word word) CheckRadioButton16
97 pascal16 CheckDlgButton(word word word) CheckDlgButton16
98 pascal16 IsDlgButtonChecked(word word) IsDlgButtonChecked16
99 pascal16 DlgDirSelect(word ptr word) DlgDirSelect
100 pascal16 DlgDirList(word ptr word word word) DlgDirList16
101 pascal SendDlgItemMessage(word word word word long) SendDlgItemMessage16
......@@ -169,7 +169,7 @@ heap 65520
167 pascal16 ShowCaret(word) ShowCaret
168 pascal16 SetCaretBlinkTime(word) SetCaretBlinkTime
169 pascal16 GetCaretBlinkTime() GetCaretBlinkTime16
170 pascal16 ArrangeIconicWindows(word) ArrangeIconicWindows
170 pascal16 ArrangeIconicWindows(word) ArrangeIconicWindows16
171 pascal16 WinHelp(word ptr word long) WinHelp16
172 stub SwitchToThisWindow
173 pascal16 LoadCursor(word segptr) LoadCursor16
......@@ -229,10 +229,10 @@ heap 65520
226 stub LockInput
227 pascal16 GetNextDlgGroupItem(word word word) GetNextDlgGroupItem16
228 pascal16 GetNextDlgTabItem(word word word) GetNextDlgTabItem16
229 pascal16 GetTopWindow(word) GetTopWindow
230 pascal16 GetNextWindow(word word) GetNextWindow
229 pascal16 GetTopWindow(word) GetTopWindow16
230 pascal16 GetNextWindow(word word) GetNextWindow16
231 stub GetSystemDebugState
232 pascal16 SetWindowPos(word word word word word word word) SetWindowPos
232 pascal16 SetWindowPos(word word word word word word word) SetWindowPos16
233 pascal16 SetParent(word word) SetParent
234 pascal16 UnhookWindowsHook(s_word segptr) THUNK_UnhookWindowsHook16
235 pascal DefHookProc(s_word word long ptr) DefHookProc16
......@@ -261,11 +261,11 @@ heap 65520
256 pascal16 GetDriverInfo(word ptr) GetDriverInfo
257 pascal16 GetNextDriver(word long) GetNextDriver
258 pascal16 MapWindowPoints(word word ptr word) MapWindowPoints16
259 pascal16 BeginDeferWindowPos(s_word) BeginDeferWindowPos
259 pascal16 BeginDeferWindowPos(s_word) BeginDeferWindowPos16
260 pascal16 DeferWindowPos(word word word s_word s_word s_word s_word word)
DeferWindowPos
261 pascal16 EndDeferWindowPos(word) EndDeferWindowPos
262 pascal16 GetWindow(word word) GetWindow
DeferWindowPos16
261 pascal16 EndDeferWindowPos(word) EndDeferWindowPos16
262 pascal16 GetWindow(word word) GetWindow16
263 pascal16 GetMenuItemCount(word) GetMenuItemCount16
264 pascal16 GetMenuItemID(word word) GetMenuItemID16
265 pascal16 ShowOwnedPopups(word word) ShowOwnedPopups
......@@ -275,12 +275,12 @@ heap 65520
269 pascal16 GlobalDeleteAtom(word) GlobalDeleteAtom
270 pascal16 GlobalFindAtom(segptr) GlobalFindAtom16
271 pascal16 GlobalGetAtomName(word ptr s_word) GlobalGetAtomName16
272 pascal16 IsZoomed(word) IsZoomed
272 pascal16 IsZoomed(word) IsZoomed16
273 stub ControlPanelInfo
274 stub GetNextQueueWindow
275 stub RepaintScreen
276 stub LockMyTask
277 pascal16 GetDlgCtrlID(word) GetDlgCtrlID
277 pascal16 GetDlgCtrlID(word) GetDlgCtrlID16
278 pascal16 GetDesktopHwnd() GetDesktopHwnd
279 stub OldSetDeskPattern
280 pascal16 SetSystemMenu(word word) SetSystemMenu16
......
......@@ -8,11 +8,11 @@ base 1
0003 stub AnyPopup
0004 stdcall AppendMenuA(long long long ptr) AppendMenu32A
0005 stdcall AppendMenuW(long long long ptr) AppendMenu32W
0006 stub ArrangeIconicWindows
0006 stdcall ArrangeIconicWindows(long) ArrangeIconicWindows32
0007 stub AttachThreadInput
0008 stdcall BeginDeferWindowPos(long) BeginDeferWindowPos
0008 stdcall BeginDeferWindowPos(long) BeginDeferWindowPos32
0009 stdcall BeginPaint(long ptr) BeginPaint32
0010 stdcall BringWindowToTop(long) BringWindowToTop
0010 stdcall BringWindowToTop(long) BringWindowToTop32
0011 stub BroadcastSystemMessage
0012 stub CalcChildScroll
0013 stub CallMsgFilter
......@@ -46,10 +46,10 @@ base 1
0041 stdcall CharUpperBuffA(ptr long) CharUpperBuff32A
0042 stdcall CharUpperBuffW(ptr long) CharUpperBuff32W
0043 stdcall CharUpperW(ptr) CharUpper32W
0044 stdcall CheckDlgButton(long long long) CheckDlgButton
0044 stdcall CheckDlgButton(long long long) CheckDlgButton32
0045 stdcall CheckMenuItem(long long long) CheckMenuItem32
0046 stub CheckMenuRadioItem
0047 stdcall CheckRadioButton(long long long long) CheckRadioButton
0047 stdcall CheckRadioButton(long long long long) CheckRadioButton32
0048 stdcall ChildWindowFromPoint(long long long) ChildWindowFromPoint32
0049 stub ChildWindowFromPointEx
0050 stub ClientThreadConnect
......@@ -106,7 +106,7 @@ base 1
0099 stub DdeFreeDataHandle
0100 stub DdeFreeStringHandle
0101 stub DdeGetData
0102 stub DdeGetLastError
0102 return DdeGetLastError 4 0
0103 stub DdeGetQualityOfService
0104 stub DdeImpersonateClient
0105 return DdeInitializeA 16 0
......@@ -131,14 +131,14 @@ base 1
0124 stdcall DefMDIChildProcW(long long long long) DefMDIChildProc32W
0125 stdcall DefWindowProcA(long long long long) DefWindowProc32A
0126 stdcall DefWindowProcW(long long long long) DefWindowProc32W
0127 stdcall DeferWindowPos(long long long long long long long long) DeferWindowPos
0127 stdcall DeferWindowPos(long long long long long long long long) DeferWindowPos32
0128 stdcall DeleteMenu(long long long) DeleteMenu32
0129 stub DestroyAcceleratorTable
0130 stdcall DestroyCaret() DestroyCaret
0131 stub DestroyCursor
0132 stub DestroyIcon
0133 stdcall DestroyMenu(long) DestroyMenu32
0134 stdcall DestroyWindow(long) DestroyWindow
0134 stdcall DestroyWindow(long) DestroyWindow32
0135 stdcall DialogBoxIndirectParamA(long ptr long ptr long) DialogBoxIndirectParam32A
0136 stub DialogBoxIndirectParamAorW
0137 stdcall DialogBoxIndirectParamW(long ptr long ptr long) DialogBoxIndirectParam32W
......@@ -175,8 +175,8 @@ base 1
0168 stdcall EmptyClipboard() EmptyClipboard
0169 stdcall EnableMenuItem(long long long) EnableMenuItem32
0170 stdcall EnableScrollBar(long long long) EnableScrollBar32
0171 stdcall EnableWindow(long long) EnableWindow
0172 stdcall EndDeferWindowPos(long) EndDeferWindowPos
0171 stdcall EnableWindow(long long) EnableWindow32
0172 stdcall EndDeferWindowPos(long) EndDeferWindowPos32
0173 stdcall EndDialog(long long) EndDialog
0174 stdcall EndMenu() EndMenu
0175 stdcall EndPaint(long ptr) EndPaint32
......@@ -208,7 +208,7 @@ base 1
0201 stdcall FlashWindow(long long) FlashWindow
0202 stdcall FrameRect(long ptr long) FrameRect32
0203 stub FreeDDElParam
0204 stdcall GetActiveWindow() GetActiveWindow
0204 stdcall GetActiveWindow() GetActiveWindow32
0205 stdcall GetAppCompatFlags(long) GetAppCompatFlags
0206 stdcall GetAsyncKeyState(long) GetAsyncKeyState
0207 stdcall GetCapture() GetCapture32
......@@ -237,9 +237,9 @@ base 1
0230 stdcall GetDCEx(long long long) GetDCEx32
0231 stdcall GetDesktopWindow() GetDesktopWindow32
0232 stdcall GetDialogBaseUnits() GetDialogBaseUnits
0233 stdcall GetDlgCtrlID(long) GetDlgCtrlID
0234 stdcall GetDlgItem(long long) GetDlgItem
0235 stdcall GetDlgItemInt(long long long long) GetDlgItemInt
0233 stdcall GetDlgCtrlID(long) GetDlgCtrlID32
0234 stdcall GetDlgItem(long long) GetDlgItem32
0235 stdcall GetDlgItemInt(long long ptr long) GetDlgItemInt32
0236 stdcall GetDlgItemTextA(long long ptr long) GetDlgItemText32A
0237 stdcall GetDlgItemTextW(long long ptr long) GetDlgItemText32W
0238 stub GetDoubleClickTime
......@@ -259,7 +259,7 @@ base 1
0252 stub GetKeyboardLayoutNameW
0253 stub GetKeyboardState
0254 stub GetKeyboardType
0255 stub GetLastActivePopup
0255 stdcall GetLastActivePopup(long) GetLastActivePopup
0256 stdcall GetMenu(long) GetMenu32
0257 stdcall GetMenuCheckMarkDimensions() GetMenuCheckMarkDimensions
0258 stub GetMenuContextHelpId
......@@ -299,13 +299,13 @@ base 1
0292 stdcall GetTabbedTextExtentA(long ptr long long ptr) GetTabbedTextExtent
0293 stub GetTabbedTextExtentW
0294 stub GetThreadDesktop
0295 stub GetTopWindow
0295 stdcall GetTopWindow(long) GetTopWindow32
0296 stdcall GetUpdateRect(long ptr long) GetUpdateRect32
0297 stdcall GetUpdateRgn(long long long) GetUpdateRgn
0298 stub GetUserObjectInformationA
0299 stub GetUserObjectInformationW
0300 stub GetUserObjectSecurity
0301 stdcall GetWindow(long long) GetWindow
0301 stdcall GetWindow(long long) GetWindow32
0302 stub GetWindowContextHelpId
0303 stdcall GetWindowDC(long) GetWindowDC32
0304 stdcall GetWindowLongA(long long) GetWindowLong32A
......@@ -342,20 +342,20 @@ base 1
0335 stdcall IsCharLowerW(long) IsCharLower32W
0336 stdcall IsCharUpperA(long) IsCharUpper32A
0337 stdcall IsCharUpperW(long) IsCharUpper32W
0338 stub IsChild
0338 stdcall IsChild(long long) IsChild32
0339 stdcall IsClipboardFormatAvailable(long) IsClipboardFormatAvailable
0340 stub IsDialogMessage
0341 stdcall IsDialogMessageA(long ptr) IsDialogMessage32A
0342 stub IsDialogMessageW
0343 stdcall IsDlgButtonChecked(long long) IsDlgButtonChecked
0344 stdcall IsIconic(long) IsIconic
0343 stdcall IsDlgButtonChecked(long long) IsDlgButtonChecked32
0344 stdcall IsIconic(long) IsIconic32
0345 stdcall IsMenu(long) IsMenu32
0346 stdcall IsRectEmpty(ptr) IsRectEmpty32
0347 stdcall IsWindow(long) IsWindow
0348 stdcall IsWindowEnabled(long) IsWindowEnabled
0348 stdcall IsWindowEnabled(long) IsWindowEnabled32
0349 stdcall IsWindowUnicode(long) IsWindowUnicode
0350 stdcall IsWindowVisible(long) IsWindowVisible
0351 stdcall IsZoomed(long) IsZoomed
0350 stdcall IsWindowVisible(long) IsWindowVisible32
0351 stdcall IsZoomed(long) IsZoomed32
0352 stdcall KillSystemTimer(long long) KillSystemTimer32
0353 stdcall KillTimer(long long) KillTimer32
0354 stdcall LoadAcceleratorsA(long ptr) LoadAccelerators32A
......@@ -402,7 +402,7 @@ base 1
0395 stdcall MessageBoxW(long ptr ptr long) MessageBox32W
0396 stdcall ModifyMenuA(long long long long ptr) ModifyMenu32A
0397 stdcall ModifyMenuW(long long long long ptr) ModifyMenu32W
0398 stdcall MoveWindow(long long long long long long) MoveWindow
0398 stdcall MoveWindow(long long long long long long) MoveWindow32
0399 stub MsgWaitForMultipleObjects
0400 stub OemKeyScan
0401 stdcall OemToCharA(ptr ptr) OemToChar32A
......@@ -466,7 +466,7 @@ base 1
0459 stub SendNotifyMessageA
0460 stub SendNotifyMessageW
0461 stub ServerSetFunctionPointers
0462 stdcall SetActiveWindow(long) SetActiveWindow
0462 stdcall SetActiveWindow(long) SetActiveWindow32
0463 stdcall SetCapture(long) SetCapture32
0464 stdcall SetCaretBlinkTime(long) SetCaretBlinkTime
0465 stdcall SetCaretPos(long long) SetCaretPos
......@@ -523,7 +523,7 @@ base 1
0516 stdcall SetWindowLongA(long long long) SetWindowLong32A
0517 stdcall SetWindowLongW(long long long) SetWindowLong32W
0518 stdcall SetWindowPlacement(long ptr) SetWindowPlacement32
0519 stdcall SetWindowPos(long long long long long long long) SetWindowPos
0519 stdcall SetWindowPos(long long long long long long long) SetWindowPos32
0520 stub SetWindowStationUser
0521 stdcall SetWindowTextA(long ptr) SetWindowText32A
0522 stdcall SetWindowTextW(long ptr) SetWindowText32W
......@@ -537,7 +537,7 @@ base 1
0530 stub ShowOwnedPopups
0531 stdcall ShowScrollBar(long long long) ShowScrollBar32
0532 stub ShowStartGlass
0533 stdcall ShowWindow(long long) ShowWindow
0533 stdcall ShowWindow(long long) ShowWindow32
0534 stub ShowWindowAsync
0535 stdcall SubtractRect(ptr ptr ptr) SubtractRect32
0536 stdcall SwapMouseButton(long) SwapMouseButton
......
......@@ -167,9 +167,9 @@ struct expr * DEBUG_StructPExpr(struct expr *, const char * element);
struct expr * DEBUG_StructExpr(struct expr *, const char * element);
struct expr * DEBUG_ArrayExpr(struct expr *, struct expr * index);
struct expr * DEBUG_CallExpr(const char *, int nargs, ...);
struct expr * DEBUG_TypeCastExpr(struct datatype *, struct expr *);
extern int DEBUG_ExprValue(DBG_ADDR *, unsigned int *);
DBG_ADDR DEBUG_EvalExpr(struct expr *);
extern int DEBUG_AddDisplay(struct expr * exp);
extern int DEBUG_DelDisplay(int displaynum);
extern struct expr * DEBUG_CloneExpr(struct expr * exp);
extern int DEBUG_FreeExpr(struct expr * exp);
......@@ -180,7 +180,7 @@ extern int DEBUG_AddBPCondition(int bpnum, struct expr * exp);
/* debugger/display.c */
extern int DEBUG_DoDisplay(void);
extern int DEBUG_AddDisplay(struct expr * exp);
extern int DEBUG_AddDisplay(struct expr * exp, int count, char format);
extern int DEBUG_DoDisplay(void);
extern int DEBUG_DelDisplay(int displaynum);
extern int DEBUG_InfoDisplay(void);
......@@ -273,6 +273,7 @@ extern void DEBUG_InfoShare(void);
extern void DEBUG_InitCVDataTypes(void);
/* debugger/types.c */
extern int DEBUG_nchar;
extern void DEBUG_InitTypes(void);
extern struct datatype * DEBUG_NewDataType(enum debug_type xtype,
const char * typename);
......@@ -296,7 +297,9 @@ extern long long int DEBUG_GetExprValue(DBG_ADDR * addr, char ** format);
extern int DEBUG_SetBitfieldParams(struct datatype * dt, int offset,
int nbits, struct datatype * dt2);
extern int DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2);
extern enum debug_type DEBUG_GetType(struct datatype * dt);
extern struct datatype * DEBUG_TypeCast(enum debug_type, const char *);
extern int DEBUG_PrintTypeCast(struct datatype *);
/* debugger/source.c */
extern void DEBUG_ShowDir(void);
......
/*
* Keyboard definitions
* Keyboard header file
* Copyright 1997 David Faure
*
*/
#ifndef __WINE_KEYBOARD_H
#define __WINE_KEYBOARD_H
#define WINE_VKEY_MAPPINGS\
vkcase('!', '1')\
vkcase('@', '2')\
vkcase('#', '3')\
vkcase('$', '4')\
vkcase('%', '5')\
vkcase('^', '6')\
vkcase('&', '7')\
vkcase('*', '8')\
vkcase('(', '9')\
vkcase(')', '0')\
vkcase2('`', '~', 0xc0)\
vkcase2('-', '_', 0xbd)\
vkcase2('=', '+', 0xbb)\
vkcase2('[', '{', 0xdb)\
vkcase2(']', '}', 0xdd)\
vkcase2(';', ':', 0xba)\
vkcase2('\'', '"', 0xde)\
vkcase2(',', '<', 0xbc)\
vkcase2('.', '>', 0xbe)\
vkcase2('/', '?', 0xbf)\
vkcase2('\\', '|', 0xdc)
extern BOOL32 MouseButtonsStates[3];
extern BOOL32 AsyncMouseButtonsStates[3];
extern BYTE InputKeyStateTable[256];
extern BYTE QueueKeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
extern BOOL32 KEYBOARD_Init(void);
extern void KEYBOARD_HandleEvent( XKeyEvent *event );
#endif /* __WINE_KEYBOARD_H */
......@@ -120,6 +120,7 @@ extern void MODULE_RegisterModule( NE_MODULE *pModule );
extern HMODULE16 MODULE_FindModule( LPCSTR path );
extern HINSTANCE16 MODULE_GetInstance( HMODULE16 hModule );
extern HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first );
extern WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name );
extern FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern BOOL16 MODULE_SetEntryPoint( HMODULE16 hModule, WORD ordinal,
......
......@@ -3,14 +3,16 @@
#include <sys/types.h>
#include "windows.h"
#include "winnt.h"
#include "peexe.h"
struct pe_data {
struct pe_header_s *pe_header;
struct pe_segment_table *pe_seg;
struct PE_Import_Directory *pe_import;
struct PE_Export_Directory *pe_export;
struct PE_Resource_Directory *pe_resource;
struct PE_Reloc_Block *pe_reloc;
LPIMAGE_NT_HEADERS pe_header;
LPIMAGE_SECTION_HEADER pe_seg;
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
LPIMAGE_EXPORT_DIRECTORY pe_export;
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
LPIMAGE_BASE_RELOCATION pe_reloc;
int base_addr;
int load_addr;
int vma_size;
......
......@@ -22,6 +22,7 @@ struct resource
typedef enum
{
SYSRES_MENU_SYSMENU,
SYSRES_MENU_EDITMENU,
SYSRES_DIALOG_MSGBOX,
SYSRES_DIALOG_SHELL_ABOUT_MSGBOX,
SYSRES_DIALOG_OPEN_FILE,
......
/*
* Win32 functions, structures, and types related to resources
*
* Copyright 1995 Thomas Sandford
*
*/
#ifndef __WINE_RESOURCE32_H
#define __WINE_RESOURCE32_H
#include <stddef.h>
typedef struct _IMAGE_RESOURCE_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
WORD NumberOfNamedEntries;
WORD NumberOfIdEntries;
} IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY;
typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
DWORD Name;
DWORD OffsetToData;
} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY;
typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
DWORD OffsetToData;
DWORD Size;
DWORD CodePage;
DWORD Reserved;
} IMAGE_RESOURCE_DATA_ENTRY, *PIMAGE_RESOURCE_DATA_ENTRY;
typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
WORD Length;
WCHAR NameString[1];
} IMAGE_RESOURCE_DIR_STRING_U, *PIMAGE_RESOURCE_DIR_STRING_U;
#endif /* __WINE_RESOURCE32_H */
......@@ -44,6 +44,11 @@ typedef struct
typedef struct sigcontext SIGCONTEXT;
#endif /* NetBSD */
#ifdef __FreeBSD__
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#endif /* FreeBSD */
#if defined(__svr4__) || defined(_SCO_DS)
#include <signal.h>
#ifdef _SCO_DS
......@@ -53,12 +58,12 @@ typedef struct sigcontext SIGCONTEXT;
typedef struct ucontext SIGCONTEXT;
#endif /* svr4 || SCO_DS */
#ifdef __FreeBSD__
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#endif /* FreeBSD */
#ifdef __EMX__
typedef struct CONTEXTRECORD SIGCONTEXT;
#endif /* __EMX__ */
#if !defined(__svr4__) && !defined(_SCO_DS)
#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__)
#define EAX_sig(context) ((context)->sc_eax)
#define EBX_sig(context) ((context)->sc_ebx)
......@@ -88,7 +93,9 @@ typedef struct sigcontext SIGCONTEXT;
#define EIP_sig(context) ((context)->sc_eip)
#define ESP_sig(context) ((context)->sc_esp)
#else /* __svr4__ || _SCO_DS */
#endif /* linux || __NetBSD__ || __FreeBSD__ */
#if defined(__svr4__) || defined(_SCO_DS)
#ifdef _SCO_DS
#define gregs regs
......@@ -118,8 +125,31 @@ typedef struct sigcontext SIGCONTEXT;
#else
#define ESP_sig(context) ((context)->uc_mcontext.gregs[ESP])
#endif
#endif /* svr4 || SCO_DS */
#endif /* __svr4__ || _SCO_DS */
#ifdef __EMX__
#define EAX_sig(context) ((context)->ctx_RegEax)
#define EBX_sig(context) ((context)->ctx_RegEbx)
#define ECX_sig(context) ((context)->ctx_RegEcx)
#define EDX_sig(context) ((context)->ctx_RegEdx)
#define ESI_sig(context) ((context)->ctx_RegEsi)
#define EDI_sig(context) ((context)->ctx_RegEdi)
#define EBP_sig(context) ((context)->ctx_RegEbp)
#define ESP_sig(context) ((context)->ctx_RegEsp)
#define CS_sig(context) ((context)->ctx_SegCS)
#define DS_sig(context) ((context)->ctx_SegDS)
#define ES_sig(context) ((context)->ctx_SegES)
#define SS_sig(context) ((context)->ctx_SegSS)
#define FS_sig(context) ((context)->ctx_SegFS)
#define GS_sig(context) ((context)->ctx_SegGS)
#define EFL_sig(context) ((context)->ctx_EFlags)
#define EIP_sig(context) ((context)->ctx_RegEip)
#endif /* __EMX__ */
/* Generic definitions */
#define AX_sig(context) (*(WORD*)&EAX_sig(context))
#define BX_sig(context) (*(WORD*)&EBX_sig(context))
......
......@@ -110,23 +110,6 @@ typedef struct PDEVICE_HEADER
typedef short SHORT;
#pragma pack(1)
typedef struct TEXTXFORM
{
SHORT txfHeight;
SHORT txfWidth;
SHORT txfEscapement;
SHORT txfOrientation;
SHORT txfWeight;
CHAR txfItalic;
CHAR txfUnderline;
CHAR txfStrikeOut;
CHAR txfOutPrecision;
CHAR txfClipPrecision;
SHORT txfAccelerator WINE_PACKED;
SHORT txfOverhang WINE_PACKED;
} TEXTXFORM, *LPTEXTXFORM;
#define PCOLOR DWORD
typedef struct DRAWMODE
{
......@@ -144,42 +127,6 @@ typedef struct DRAWMODE
COLORREF LTextColor;
} DRAWMODE, *LPDRAWMODE;
typedef struct FONTINFO
{
SHORT dfType;
SHORT dfPoints;
SHORT dfVertRes;
SHORT dfHorizRes;
SHORT dfAscent;
SHORT dfInternalLeading;
SHORT dfExternalLeading;
CHAR dfItalic;
CHAR dfUnderline;
CHAR dfStrikeOut;
SHORT dfWeight;
CHAR dfCHARSet;
SHORT dfPixWidth;
SHORT dfPixHeight;
CHAR dfPitchAndFamily;
SHORT dfAvgWidth;
SHORT dfMaxWidth;
CHAR dfFirstCHAR;
CHAR dfLastCHAR;
CHAR dfDefaultCHAR;
CHAR dfBreakCHAR;
SHORT dfWidthBytes;
LONG dfDevice;
LONG dfFace;
LONG dfBitsPointer;
LONG dfBitsOffset;
CHAR dfReserved;
LONG dfFlags;
SHORT dfAspace;
SHORT dfBspace;
SHORT dfCspace;
LONG dfColorPointer;
LONG dfReserved1[4];
} FONTINFO, *LPFONTINFO;
#pragma pack(4)
......@@ -211,4 +158,7 @@ extern BOOL32 WIN16DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
LPSIZE32 size );
extern BOOL32 WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics );
extern BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
const RECT32 *lprect, LPCSTR str, UINT32 count,
const INT32 *lpDx );
#endif /* __WINE_WIN16DRV_H */
......@@ -46,6 +46,7 @@ TOP_LEVEL_EXCEPTION_FILTER *SetUnhandledExceptionFilter(TOP_LEVEL_EXCEPTION_FILT
/*WINAPI int SetErrorMode(int);*/
#define STATUS_SUCCESS 0x00000000
#define STATUS_WAIT_0 0x00000000
#define STATUS_ABANDONED_WAIT_0 0x00000080
#define STATUS_USER_APC 0x000000C0
......@@ -55,10 +56,12 @@ TOP_LEVEL_EXCEPTION_FILTER *SetUnhandledExceptionFilter(TOP_LEVEL_EXCEPTION_FILT
#define STATUS_DATATYPE_MISALIGNMENT 0x80000002
#define STATUS_BREAKPOINT 0x80000003
#define STATUS_SINGLE_STEP 0x80000004
#define STATUS_BUFFER_OVERFLOW 0x80000005
#define STATUS_ACCESS_VIOLATION 0xC0000005
#define STATUS_IN_PAGE_ERROR 0xC0000006
#define STATUS_NO_MEMORY 0xC0000017
#define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
#define STATUS_BUFFER_TOO_SMALL 0xC0000023
#define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
#define STATUS_INVALID_DISPOSITION 0xC0000026
#define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
......@@ -72,6 +75,7 @@ TOP_LEVEL_EXCEPTION_FILTER *SetUnhandledExceptionFilter(TOP_LEVEL_EXCEPTION_FILT
#define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
#define STATUS_INTEGER_OVERFLOW 0xC0000095
#define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
#define STATUS_INVALID_PARAMETER_2 0xC00000F0
#define STATUS_STACK_OVERFLOW 0xC00000FD
#define STATUS_CONTROL_C_EXIT 0xC000013A
......
......@@ -20,6 +20,7 @@ extern int WIN32_LastError;
#define ERROR_BAD_FORMAT 11
#define ERROR_OUTOFMEMORY 14
#define ERROR_NO_MORE_FILES 18
#define ERROR_SHARING_VIOLATION 32
#define ERROR_FILE_EXISTS 80
#define ERROR_INVALID_PARAMETER 87
#define ERROR_BROKEN_PIPE 109
......
......@@ -9,7 +9,7 @@
#include "win.h"
#define DWP_MAGIC 0x5057 /* 'WP' */
#define DWP_MAGIC ((INT32)('W' | ('P' << 8) | ('O' << 16) | ('S' << 24)))
/* undocumented SWP flags - from SDK 3.1 */
#define SWP_NOCLIENTSIZE 0x0800
......@@ -17,12 +17,12 @@
typedef struct
{
WORD actualCount;
WORD suggestedCount;
WORD valid;
WORD wMagic;
INT32 actualCount;
INT32 suggestedCount;
BOOL32 valid;
INT32 wMagic;
HWND32 hwndParent;
WINDOWPOS16 winPos[1];
WINDOWPOS32 winPos[1];
} DWP;
extern void WINPOS_FindIconPos( HWND32 hwnd );
......
......@@ -55,6 +55,7 @@ extern BOOL32 X11DRV_BitBlt( struct tagDC *dcDst, INT32 xDst, INT32 yDst,
INT32 xSrc, INT32 ySrc, DWORD rop );
extern BOOL32 X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCSTR str,
INT32 count, LPSIZE32 size );
extern BOOL32 X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRIC32A *metrics);
extern BOOL32 X11DRV_PatBlt( struct tagDC *dc, INT32 left, INT32 top,
INT32 width, INT32 height, DWORD rop );
extern VOID X11DRV_SetDeviceClipping(struct tagDC *dc);
......
......@@ -25,6 +25,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "file.h"
#include "gdi.h"
#include "heap.h"
#include "keyboard.h"
#include "miscemu.h"
#include "neexe.h"
#include "options.h"
......@@ -32,7 +33,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "task.h"
#include "user.h"
#include "dce.h"
#include "pe_image.h"
#include "shell.h"
#include "winproc.h"
#include "stddebug.h"
......@@ -123,6 +123,9 @@ int MAIN_Init(void)
/* Create the DCEs */
DCE_Init();
/* Initialize keyboard */
if (!KEYBOARD_Init()) return 0;
/* Initialize window procedures */
if (!WINPROC_Init()) return 0;
......@@ -164,7 +167,7 @@ int main(int argc, char *argv[] )
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
extern char * DEBUG_argv0;
int i;
int i,loaded;
HINSTANCE16 handle;
/*
......@@ -176,6 +179,7 @@ int main(int argc, char *argv[] )
if (!MAIN_WineInit( &argc, argv )) return 1;
if (!MAIN_Init()) return 1;
loaded=0;
for (i = 1; i < argc; i++)
{
if ((handle = WinExec32( argv[i], SW_SHOWNORMAL )) < 32)
......@@ -190,6 +194,13 @@ int main(int argc, char *argv[] )
}
return 1;
}
loaded++;
}
if (!loaded) { /* nothing loaded */
extern void MAIN_Usage(char*);
MAIN_Usage(argv[0]);
return 1;
}
if (Options.debug) DEBUG_SetBreakpoints( TRUE ); /* Setup breakpoints */
......
......@@ -1008,9 +1008,11 @@ static void MODULE_FreeModule( HMODULE16 hModule )
/**********************************************************************
* LoadModule (KERNEL.45)
* MODULE_Load
*
* Implementation of LoadModule()
*/
HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
{
HMODULE16 hModule;
HINSTANCE16 hInstance, hPrevInstance;
......@@ -1021,7 +1023,7 @@ HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
WORD *pModRef, *pDLLs;
HFILE32 hFile;
int i;
extern char * DEBUG_curr_module;
extern const char * DEBUG_curr_module;
hModule = MODULE_FindModule( name );
......@@ -1089,8 +1091,9 @@ HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
/* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL;
if ((hDLL = LoadModule( buffer, (LPVOID)-1 )) == 2) /* file not found */
if ((hDLL = MODULE_Load( buffer, (LPVOID)-1, FALSE )) == 2)
{
/* file not found */
char *p;
/* Try with prepending the path of the current module */
......@@ -1098,7 +1101,7 @@ HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = LoadModule( buffer, (LPVOID)-1 );
hDLL = MODULE_Load( buffer, (LPVOID)-1, FALSE );
}
if (hDLL < 32)
{
......@@ -1212,6 +1215,9 @@ HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
/* the module, even if it contains circular DLL references */
pModule->count = 1;
if (first && (pModule->flags & NE_FFLAGS_LIBMODULE))
NE_InitializeDLLs( hModule );
}
else
{
......@@ -1256,6 +1262,15 @@ HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
/**********************************************************************
* LoadModule (KERNEL.45)
*/
HINSTANCE16 LoadModule( LPCSTR name, LPVOID paramBlock )
{
return MODULE_Load( name, paramBlock, TRUE );
}
/**********************************************************************
* FreeModule16 (KERNEL.46)
*/
BOOL16 FreeModule16( HMODULE16 hModule )
......@@ -1382,17 +1397,14 @@ HINSTANCE16 LoadLibrary16( LPCSTR libname )
* therefore cause crashes on FreeLibrary calls.
if ((handle = MODULE_FindModule( libname )) != 0) return handle;
*/
handle = LoadModule( libname, (LPVOID)-1 );
handle = MODULE_Load( libname, (LPVOID)-1, TRUE );
if (handle == (HINSTANCE16)2) /* file not found */
{
char buffer[256];
lstrcpyn32A( buffer, libname, 252 );
strcat( buffer, ".dll" );
handle = LoadModule( buffer, (LPVOID)-1 );
handle = MODULE_Load( buffer, (LPVOID)-1, TRUE );
}
#ifndef WINELIB
if (handle >= (HINSTANCE16)32) NE_InitializeDLLs( GetExePtr(handle) );
#endif
return handle;
}
......
......@@ -20,7 +20,6 @@
#include "heap.h"
#include "handle32.h"
#include "libres.h"
#include "resource32.h"
#include "stackframe.h"
#include "neexe.h"
#include "accel.h"
......@@ -42,48 +41,47 @@
* Helper function - goes down one level of PE resource tree
*
*/
PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr,
LPCWSTR name,
DWORD root)
LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY resdirptr,
LPCWSTR name,DWORD root)
{
int entrynum;
PIMAGE_RESOURCE_DIRECTORY_ENTRY entryTable;
int namelen;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY entryTable;
int namelen;
if (HIWORD(name)) {
/* FIXME: what about #xxx names? */
entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
entryTable = (LPIMAGE_RESOURCE_DIRECTORY_ENTRY) (
(BYTE *) resdirptr +
sizeof(IMAGE_RESOURCE_DIRECTORY));
namelen = lstrlen32W(name);
for (entrynum = 0; entrynum < resdirptr->NumberOfNamedEntries; entrynum++)
{
PIMAGE_RESOURCE_DIR_STRING_U str =
(PIMAGE_RESOURCE_DIR_STRING_U) (root +
(entryTable[entrynum].Name & 0x7fffffff));
LPIMAGE_RESOURCE_DIR_STRING_U str =
(LPIMAGE_RESOURCE_DIR_STRING_U) (root +
entryTable[entrynum].u1.s.NameOffset);
if(namelen != str->Length)
continue;
if(lstrncmpi32W(name,str->NameString,str->Length)==0)
return (PIMAGE_RESOURCE_DIRECTORY) (
return (LPIMAGE_RESOURCE_DIRECTORY) (
root +
(entryTable[entrynum].OffsetToData & 0x7fffffff));
entryTable[entrynum].u2.s.OffsetToDirectory);
}
return NULL;
} else {
entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
entryTable = (LPIMAGE_RESOURCE_DIRECTORY_ENTRY) (
(BYTE *) resdirptr +
sizeof(IMAGE_RESOURCE_DIRECTORY) +
resdirptr->NumberOfNamedEntries * sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
for (entrynum = 0; entrynum < resdirptr->NumberOfIdEntries; entrynum++)
if ((DWORD)entryTable[entrynum].Name == (DWORD)name)
return (PIMAGE_RESOURCE_DIRECTORY) (
if ((DWORD)entryTable[entrynum].u1.Name == (DWORD)name)
return (LPIMAGE_RESOURCE_DIRECTORY) (
root +
(entryTable[entrynum].OffsetToData & 0x7fffffff));
entryTable[entrynum].u2.s.OffsetToDirectory);
/* just use first entry if no default can be found */
if (!name && resdirptr->NumberOfIdEntries)
return (PIMAGE_RESOURCE_DIRECTORY) (
return (LPIMAGE_RESOURCE_DIRECTORY) (
root +
(entryTable[0].OffsetToData & 0x7fffffff));
entryTable[0].u2.s.OffsetToDirectory);
return NULL;
}
}
......@@ -94,12 +92,12 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr,
* Helper function - goes down one level of PE resource tree
*
*/
PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY resdirptr,
LPCSTR name,
DWORD root)
LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(LPIMAGE_RESOURCE_DIRECTORY resdirptr,
LPCSTR name,
DWORD root)
{
LPWSTR xname;
PIMAGE_RESOURCE_DIRECTORY ret;
LPIMAGE_RESOURCE_DIRECTORY ret;
if (HIWORD((DWORD)name))
xname = HEAP_strdupAtoW( GetProcessHeap(), 0, name );
......@@ -115,13 +113,12 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY resdirptr,
/**********************************************************************
* PE_FindResourceEx32W
*/
HANDLE32 PE_FindResourceEx32W(
HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type, WORD lang
)
{
HANDLE32 PE_FindResourceEx32W(
HINSTANCE32 hModule,LPCWSTR name,LPCWSTR type,WORD lang
) {
PE_MODULE *pe;
NE_MODULE *pModule;
PIMAGE_RESOURCE_DIRECTORY resdirptr;
LPIMAGE_RESOURCE_DIRECTORY resdirptr;
DWORD root;
HANDLE32 result;
......@@ -135,7 +132,7 @@ HANDLE32 PE_FindResourceEx32W(
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0; /* FIXME? */
if (!(pe = pModule->pe_module) || !pe->pe_resource) return 0;
resdirptr = (PIMAGE_RESOURCE_DIRECTORY) pe->pe_resource;
resdirptr = pe->pe_resource;
root = (DWORD) resdirptr;
if ((resdirptr = GetResDirEntryW(resdirptr, type, root)) == NULL)
return 0;
......@@ -166,6 +163,6 @@ HANDLE32 PE_LoadResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0; /* FIXME? */
if (!(pe = pModule->pe_module) || !pe->pe_resource) return 0;
return (HANDLE32) (pe->load_addr+((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
return (HANDLE32) (pe->load_addr+((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
}
#endif
......@@ -731,3 +731,16 @@ INT32 LoadMessage32W( HINSTANCE32 instance, UINT32 id, WORD lang,
return retval;
}
/**********************************************************************
* SetResourceHandler (KERNEL.43)
*/
FARPROC16
SetResourceHandler(HINSTANCE16 instance,LPSTR s,FARPROC16 farproc)
{
if (HIWORD(s))
fprintf(stderr,"SetResourceHandler(%04x,%s,%p), empty STUB!\n",instance,s,farproc);
else
fprintf(stderr,"SetResourceHandler(%04x,0x%04x,%p), empty STUB!\n",instance,LOWORD(s),farproc);
return NULL;
}
......@@ -12,8 +12,8 @@
#include <sys/types.h>
#include <sys/wait.h>
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__svr4__) || defined(_SCO_DS)
#ifndef _SCO_DS
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
#if !defined(_SCO_DS) && !defined(__EMX__)
#include <sys/syscall.h>
#endif
#include <sys/param.h>
......@@ -143,6 +143,7 @@ static void SIGNAL_fault(int signal, void *siginfo, SIGCONTEXT *context)
static void SIGNAL_fault(int signal, int code, SIGCONTEXT *context)
{
#endif
#ifndef __EMX__ /* FIXME: XX_sig(constext)=pointer to incomplete type (EMX) */
if (CS_sig(context) == WINE_CODE_SELECTOR)
{
fprintf( stderr, "Segmentation fault in Wine program (%x:%lx)."
......@@ -156,6 +157,7 @@ static void SIGNAL_fault(int signal, int code, SIGCONTEXT *context)
CS_sig(context), EIP_sig(context) );
}
wine_debug( signal, context );
#endif
}
......@@ -257,7 +259,9 @@ BOOL32 SIGNAL_Init(void)
#ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait, 1); /* For IPC */
#endif
#ifndef __EMX__ /* FIXME */
SIGNAL_SetHandler( SIGIO, (void (*)())WINSOCK_sigio, 0);
#endif
return TRUE;
}
......@@ -269,6 +273,7 @@ BOOL32 SIGNAL_Init(void)
*/
void SIGNAL_StartBIOSTimer(void)
{
#ifndef __EMX__ /* FIXME: Time don't work... Use BIOS directly instead */
struct itimerval vt_timer;
static int timer_started = 0;
......@@ -279,6 +284,7 @@ void SIGNAL_StartBIOSTimer(void)
vt_timer.it_value = vt_timer.it_interval;
setitimer(ITIMER_REAL, &vt_timer, NULL);
#endif
}
/**********************************************************************
......@@ -288,7 +294,9 @@ void SIGNAL_MaskAsyncEvents( BOOL32 flag )
{
sigset_t set;
sigemptyset(&set);
#ifndef __EMX__ /* FIXME */
sigaddset(&set, SIGIO);
#endif
sigaddset(&set, SIGUSR1);
#ifdef CONFIG_IPC
sigaddset(&set, SIGUSR2);
......
......@@ -368,7 +368,7 @@ static void TASK_CallToStart(void)
__asm__ __volatile__("movw %w0,%%fs"::"r" (pCurrentThread->teb_sel));
PE_InitializeDLLs( pTask->hModule );
exit_code = CallTaskStart32((FARPROC32)(pModule->pe_module->load_addr +
pModule->pe_module->pe_header->opt_coff.AddressOfEntryPoint) );
pModule->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint) );
TASK_KillCurrentTask( exit_code );
}
else
......@@ -593,7 +593,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
if (pModule->flags & NE_FFLAGS_WIN32)
{
DBG_ADDR addr = { NULL, 0, pModule->pe_module->load_addr +
pModule->pe_module->pe_header->opt_coff.AddressOfEntryPoint };
pModule->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint };
fprintf( stderr, "Win32 task '%s': ", name );
DEBUG_AddBreakpoint( &addr );
}
......
......@@ -15,7 +15,7 @@ C_SRCS = \
driver.c \
exec.c \
escape.c \
keyboard.c \
fontengine.c \
lstr.c \
lzexpand.c \
main.c \
......
......@@ -160,7 +160,7 @@ void CLIPBOARD_DeleteRecord(LPCLIPFORMAT lpFormat)
*/
BOOL CLIPBOARD_RequestXSelection()
{
HWND hWnd = (hWndClipWindow) ? hWndClipWindow : GetActiveWindow();
HWND hWnd = (hWndClipWindow) ? hWndClipWindow : GetActiveWindow16();
if( !hWnd ) return FALSE;
......
......@@ -848,3 +848,23 @@ LPWSTR CRTDLL_wcsrchr(LPWSTR str,WCHAR xchar)
return NULL;
}
/*********************************************************************
* _setmode (CRTDLL.265)
* FIXME: dunno what this is.
*/
DWORD
CRTDLL__setmode(LPVOID x,INT32 y) {
/* FIXME */
fprintf(stdnimp,"CRTDLL._setmode(%p,%d), STUB.\n",x,y);
return 0;
}
/*********************************************************************
* atexit (CRTDLL.345)
*/
INT32
CRTDLL_atexit(LPVOID x) {
/* FIXME */
fprintf(stdnimp,"CRTDLL.atexit(%p), STUB.\n",x);
return 0; /* successful */
}
......@@ -4,21 +4,25 @@
* Copyright 1994 Bob Amstadt
*/
#include <stdlib.h>
#define NO_TRANSITION_TYPES
#include <stdio.h>
#include "windows.h"
#include "gdi.h"
#include "dc.h"
INT Escape( HDC16 hdc, INT nEscape, INT cbInput,
SEGPTR lpszInData, SEGPTR lpvOutData )
INT16 Escape16( HDC16 hdc, INT16 nEscape, INT16 cbInput,
SEGPTR lpszInData, SEGPTR lpvOutData )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return 0;
}
if (!dc->funcs->pEscape) return 0;
DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pEscape) return 0;
return dc->funcs->pEscape( dc, nEscape, cbInput, lpszInData, lpvOutData );
}
INT32 Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
LPVOID lpszInData, LPVOID lpvOutData )
{
DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pEscape) return 0;
return dc->funcs->pEscape( dc, nEscape, cbInput,
(SEGPTR)lpszInData, (SEGPTR)lpvOutData );
}
/*
* True Type font engine support
*
* Copyright 1996 John Harvey
*/
#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
/* GDI 300 */
WORD
EngineEnumerateFont(LPSTR fontname, FARPROC16 proc, DWORD data )
{
printf("In engineEnumerateFont for %s\n",fontname);
return 0;
}
#ifdef NOTDEF
/* GDI 301 */
WORD
EngineDeleteFont(LPFONTINFO16 lpFontInfo)
{
return 0
}
#endif
/* GDI 302 */
WORD
EngineRealizeFont(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
{
printf("In EngineRealizeFont\n");
return 0;
}
#ifdef NOTDEF
/* GDI 303 */
WORD
EngineGetCharWidth(LPFONTINFO16 lpFontInfo, BYTE, BYTE, LPINT16)
{
return 0;
}
/* GDI 304 */
WORD
EngineSetFontContext(LPFONTINFO lpFontInfo, WORD data)
{
}
/* GDI 305 */
WORD
EngineGetGlyphBMP(WORD word, LPFONTINFO lpFontInfo, WORD, WORD, LPSTR string, DWORD dword, LPBITMAPMETRICS16 metrics)
{
return 0;
}
/* GDI 306 */
DWORD
EngineMakeFontDir(HDC16 hdc, LPFONTDIR fontdir, LPCSTR string)
{
return 0;
}
/* GDI 314 */
WORD
EngineExtTextOut()
{
}
#endif
......@@ -176,7 +176,7 @@ static XrmOptionDescRec optionsTable[] =
* MAIN_Usage
*/
#ifndef WINELIB32
static void MAIN_Usage( char *name )
void MAIN_Usage( char *name )
{
fprintf( stderr, USAGE, name );
exit(1);
......@@ -642,7 +642,9 @@ BOOL32 MAIN_WineInit( int *argc, char *argv[] )
MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
XrmInitialize();
putenv("XKB_DISABLE="); /* Disable XKB extension if present. */
MAIN_ParseOptions( argc, argv );
if (Options.desktopGeometry && Options.managed)
......
......@@ -7,16 +7,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#include "win.h"
#include "windows.h"
#include "heap.h"
#include "stddebug.h"
#include "debug.h"
#include "module.h"
#include "xmalloc.h"
#include "heap.h"
/**************************************************************************
......@@ -74,12 +73,55 @@ RtlSubAuthorityCountSid(LPSID lpsid) {
DWORD
RtlCopySid(DWORD len,LPSID to,LPSID from) {
if (len<(from->SubAuthorityCount*4+8))
return 0xC0000023;
return STATUS_BUFFER_TOO_SMALL;
memmove(to,from,from->SubAuthorityCount*4+8);
return 0;
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlAnsiStringToUnicodeString [NTDLL]
*/
DWORD /* NTSTATUS */
RtlAnsiStringToUnicodeString(LPUNICODE_STRING uni,LPANSI_STRING ansi,BOOL32 doalloc) {
DWORD unilen = (ansi->Length+1)*sizeof(WCHAR);
if (unilen>0xFFFF)
return STATUS_INVALID_PARAMETER_2;
uni->Length = unilen;
if (doalloc) {
uni->MaximumLength = unilen;
uni->Buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,unilen);
if (!uni->Buffer)
return STATUS_NO_MEMORY;
}
if (unilen>uni->MaximumLength)
return STATUS_BUFFER_OVERFLOW;
lstrcpynAtoW(uni->Buffer,ansi->Buffer,unilen/2);
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlOemStringToUnicodeString [NTDLL]
*/
DWORD /* NTSTATUS */
RtlOemStringToUnicodeString(LPUNICODE_STRING uni,LPSTRING ansi,BOOL32 doalloc) {
DWORD unilen = (ansi->Length+1)*sizeof(WCHAR);
if (unilen>0xFFFF)
return STATUS_INVALID_PARAMETER_2;
uni->Length = unilen;
if (doalloc) {
uni->MaximumLength = unilen;
uni->Buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,unilen);
if (!uni->Buffer)
return STATUS_NO_MEMORY;
}
if (unilen>uni->MaximumLength)
return STATUS_BUFFER_OVERFLOW;
lstrcpynAtoW(uni->Buffer,ansi->Buffer,unilen/2);
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlOemToUnicodeN [NTDLL]
*/
DWORD /* NTSTATUS */
......@@ -90,7 +132,7 @@ RtlOemToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oe
len = oemlen;
if (unilen/2 < len)
len = unilen/2;
x=(LPWSTR)xmalloc((len+1)*sizeof(WCHAR));
x=(LPWSTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(len+1)*sizeof(WCHAR));
lstrcpynAtoW(x,oemstr,len+1);
memcpy(unistr,x,len*2);
if (reslen) *reslen = len*2;
......@@ -98,6 +140,44 @@ RtlOemToUnicodeN(LPWSTR unistr,DWORD unilen,LPDWORD reslen,LPSTR oemstr,DWORD oe
}
/**************************************************************************
* RtlInitString [NTDLL]
*/
VOID
RtlInitAnsiString(LPANSI_STRING target,LPCSTR source) {
target->Length = target->MaximumLength = 0;
target->Buffer = (LPSTR)source;
if (!source)
return;
target->Length = lstrlen32A(target->Buffer);
target->MaximumLength = target->Length+1;
}
/**************************************************************************
* RtlInitString [NTDLL]
*/
VOID
RtlInitString(LPSTRING target,LPCSTR source) {
target->Length = target->MaximumLength = 0;
target->Buffer = (LPSTR)source;
if (!source)
return;
target->Length = lstrlen32A(target->Buffer);
target->MaximumLength = target->Length+1;
}
/**************************************************************************
* RtlInitUnicodeString [NTDLL]
*/
VOID
RtlInitUnicodeString(LPUNICODE_STRING target,LPCWSTR source) {
target->Length = target->MaximumLength = 0;
target->Buffer = (LPWSTR)source;
if (!source)
return;
target->Length = lstrlen32W(target->Buffer)*2;
target->MaximumLength = target->Length+2;
}
/**************************************************************************
* RtlUnicodeToOemN [NTDLL]
*/
DWORD /* NTSTATUS */
......@@ -108,7 +188,7 @@ RtlUnicodeToOemN(LPSTR oemstr,DWORD oemlen,LPDWORD reslen,LPWSTR unistr,DWORD un
len = oemlen;
if (unilen/2 < len)
len = unilen/2;
x=(LPSTR)xmalloc(len+1);
x=(LPSTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,len+1);
lstrcpynWtoA(x,unistr,len+1);
memcpy(oemstr,x,len);
if (reslen) *reslen = len;
......@@ -122,10 +202,71 @@ DWORD /* NTSTATUS */
RtlUnicodeStringToOemString(LPUNICODE_STRING uni,LPANSI_STRING oem,BOOL32 alloc)
{
if (alloc) {
oem->Buffer = (LPSTR)xmalloc(uni->Length/2)+1;
oem->Buffer = (LPSTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,uni->Length/2)+1;
oem->MaximumLength = uni->Length/2+1;
}
oem->Length = uni->Length/2;
lstrcpynWtoA(oem->Buffer,uni->Buffer,uni->Length/2+1);
return 0;
}
/**************************************************************************
* RtlNtStatusToDosErro [NTDLL]
*/
DWORD
RtlNtStatusToDosError(DWORD error) {
/* FIXME: map STATUS_ to ERROR_ */
return error;
}
/**************************************************************************
* RtlGetNtProductType [NTDLL]
*/
DWORD
RtlGetNtProductType(LPVOID x) {
/* FIXME : find documentation for this one */
return 0;
}
/**************************************************************************
* RtlUpcaseUnicodeString [NTDLL]
*/
DWORD
RtlUpcaseUnicodeString(LPUNICODE_STRING dest,LPUNICODE_STRING src,BOOL32 doalloc) {
LPWSTR s,t;
DWORD i,len;
len = src->Length;
if (doalloc) {
dest->MaximumLength = len;
dest->Buffer = (LPWSTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,len);
if (!dest->Buffer)
return STATUS_NO_MEMORY;
}
if (dest->MaximumLength < len)
return STATUS_BUFFER_OVERFLOW;
s=dest->Buffer;t=src->Buffer;
for (i=0;i<len;i++) {
s[i]=toupper(t[i]);
s++;
t++;
}
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlxOemStringToUnicodeSize [NTDLL]
*/
UINT32
RtlxOemStringToUnicodeSize(LPSTRING str) {
return str->Length*2+2;
}
/**************************************************************************
* RtlxAnsiStringToUnicodeSize [NTDLL]
*/
UINT32
RtlxAnsiStringToUnicodeSize(LPANSI_STRING str) {
return str->Length*2+2;
}
......@@ -3015,3 +3015,10 @@ DWORD RegQueryInfoKey32A(
free(lpszClassW);
return ret;
}
/* RegConnectRegistryA [ADVAPI32.127] */
DWORD RegConnectRegistry32A(LPCSTR machine,HKEY hkey,LPHKEY reskey) {
fprintf(stderr,"RegConnectRegistry32A(%s,%08lx,%p), STUB.\n",
machine,hkey,reskey
);
return ERROR_FILE_NOT_FOUND; /* FIXME */
}
......@@ -370,7 +370,7 @@ LRESULT AboutDlgProc32( HWND32 hWnd, UINT32 msg, WPARAM32 wParam,
GetWindowText32A( hWnd, Template, sizeof(Template) );
sprintf( AppTitle, Template, info->szApp );
SetWindowText32A( hWnd, AppTitle );
SetWindowText32A( GetDlgItem(hWnd,100), info->szOtherStuff );
SetWindowText32A( GetDlgItem32(hWnd,100), info->szOtherStuff );
}
}
return 1;
......
......@@ -3,7 +3,6 @@
*
* Copyright 1996 Marcus Meissner
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
......@@ -40,6 +39,7 @@ read_ne_header(HFILE32 lzfd,struct ne_header_s *nehd) {
LZSeek32(lzfd,mzh.ne_offset,SEEK_SET);
return 1;
}
fprintf(stderr,"misc/ver.c:read_ne_header:can't handle PE files yet.\n");
/* must handle PE files too. Later. */
return 0;
}
......@@ -442,37 +442,222 @@ VerFindFile32W(
DWORD
VerInstallFile16(
UINT16 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT16 *tmpfilelen
) {
dprintf_ver(stddeb,"VerInstallFile(%x,%s,%s,%s,%s,%p,%d)\n",
flags,srcfilename,destfilename,srcdir,destdir,tmpfile,*tmpfilelen
);
LPCSTR destdir,LPCSTR curdir,LPSTR tmpfile,UINT16 *tmpfilelen )
{
UINT32 filelen;
DWORD ret= VerInstallFile32A(flags,srcfilename,destfilename,srcdir,
destdir,curdir,tmpfile,&filelen);
/* FIXME: Implementation still missing .... */
*tmpfilelen = filelen;
return ret;
}
return VIF_SRCOLD;
/* VerInstallFileA [VERSION.7] */
static LPBYTE
_fetch_versioninfo(LPSTR fn) {
DWORD alloclen;
LPBYTE buf;
DWORD ret;
alloclen = 1000;
buf= xmalloc(alloclen);
while (1) {
ret = GetFileVersionInfo32A(fn,0,alloclen,buf);
if (!ret) {
free(buf);
return 0;
}
if (alloclen<*(WORD*)buf) {
free(buf);
alloclen = *(WORD*)buf;
buf = xmalloc(alloclen);
} else
return buf;
}
}
static DWORD
_error2vif(DWORD error) {
switch (error) {
case ERROR_ACCESS_DENIED:
return VIF_ACCESSVIOLATION;
case ERROR_SHARING_VIOLATION:
return VIF_SHARINGVIOLATION;
default:
return 0;
}
}
/* VerFindFileA [VERSION.5] */
DWORD
VerInstallFile32A(
UINT32 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT32 *tmpfilelen )
LPCSTR destdir,LPCSTR curdir,LPSTR tmpfile,UINT32 *tmpfilelen )
{
UINT16 filelen;
DWORD ret= VerInstallFile16(flags,srcfilename,destfilename,srcdir,
destdir,tmpfile,&filelen);
*tmpfilelen = filelen;
return ret;
char destfn[260],tmpfn[260],srcfn[260];
HFILE32 hfsrc,hfdst;
DWORD attr,ret,xret,tmplast;
LPBYTE buf1,buf2;
OFSTRUCT ofs;
fprintf(stddeb,"VerInstallFile(%x,%s,%s,%s,%s,%s,%p,%d)\n",
flags,srcfilename,destfilename,srcdir,destdir,curdir,tmpfile,*tmpfilelen
);
xret = 0;
sprintf(srcfn,"%s\\%s",srcdir,srcfilename);
sprintf(destfn,"%s\\%s",destdir,destfilename);
hfsrc=LZOpenFile32A(srcfn,&ofs,OF_READ);
if (hfsrc==HFILE_ERROR32)
return VIF_CANNOTREADSRC;
sprintf(tmpfn,"%s\\%s",destdir,destfilename);
tmplast=strlen(destdir)+1;
attr = GetFileAttributes32A(tmpfn);
if (attr!=-1) {
if (attr & FILE_ATTRIBUTE_READONLY) {
LZClose32(hfsrc);
return VIF_WRITEPROT;
}
/* FIXME: check if file currently in use and return VIF_FILEINUSE */
}
attr = -1;
if (flags & VIFF_FORCEINSTALL) {
if (tmpfile[0]) {
sprintf(tmpfn,"%s\\%s",destdir,tmpfile);
tmplast = strlen(destdir)+1;
attr = GetFileAttributes32A(tmpfn);
/* if it exists, it has been copied by the call before.
* we jump over the copy part...
*/
}
}
if (attr == -1) {
char *s;
GetTempFileName32A(destdir,"ver",0,tmpfn); /* should not fail ... */
s=strrchr(tmpfn,'\\');
if (s)
tmplast = s-tmpfn;
else
tmplast = 0;
hfdst = OpenFile32(tmpfn,&ofs,OF_CREATE);
if (hfdst == HFILE_ERROR32) {
LZClose32(hfsrc);
return VIF_CANNOTCREATE; /* | translated dos error */
}
ret = LZCopy32(hfsrc,hfdst);
_lclose32(hfdst);
if (ret<0) {
/* translate LZ errors into VIF_xxx */
switch (ret) {
case LZERROR_BADINHANDLE:
case LZERROR_READ:
case LZERROR_BADVALUE:
case LZERROR_UNKNOWNALG:
ret = VIF_CANNOTREADSRC;
break;
case LZERROR_BADOUTHANDLE:
case LZERROR_WRITE:
ret = VIF_OUTOFMEMORY; /* FIXME: correct? */
break;
case LZERROR_GLOBALLOC:
case LZERROR_GLOBLOCK:
ret = VIF_OUTOFSPACE;
break;
default: /* unknown error, should not happen */
ret = 0;
break;
}
if (ret) {
LZClose32(hfsrc);
return ret;
}
}
}
xret = 0;
if (!(flags & VIFF_FORCEINSTALL)) {
buf1 = _fetch_versioninfo(destfn);
if (buf1) {
buf2 = _fetch_versioninfo(tmpfn);
if (!buf2) {
char *tbuf1,*tbuf2;
VS_FIXEDFILEINFO *destvffi,*tmpvffi;
UINT32 len1,len2;
destvffi= (VS_FIXEDFILEINFO*)(buf1+0x14);
tmpvffi = (VS_FIXEDFILEINFO*)(buf2+0x14);
len1=len2=40;
/* compare file versions */
if ((destvffi->dwFileVersionMS > tmpvffi->dwFileVersionMS)||
((destvffi->dwFileVersionMS==tmpvffi->dwFileVersionMS)&&
(destvffi->dwFileVersionLS > tmpvffi->dwFileVersionLS)
)
)
xret |= VIF_MISMATCH|VIF_SRCOLD;
/* compare filetypes and filesubtypes */
if ((destvffi->dwFileType!=tmpvffi->dwFileType) ||
(destvffi->dwFileSubtype!=tmpvffi->dwFileSubtype)
)
xret |= VIF_MISMATCH|VIF_DIFFTYPE;
if (VerQueryValue32A(buf1,"\\VarFileInfo\\Translation",(LPVOID*)&tbuf1,&len1) &&
VerQueryValue32A(buf2,"\\VarFileInfo\\Translation",(LPVOID*)&tbuf2,&len2)
) {
/* irgendwas mit tbuf1 und tbuf2 machen
* generiert DIFFLANG|MISMATCH
*/
}
free(buf2);
} else
xret=VIF_MISMATCH|VIF_SRCOLD;
free(buf1);
}
}
if (xret) {
if (*tmpfilelen<strlen(tmpfn+tmplast)) {
xret|=VIF_BUFTOSMALL;
DeleteFile32A(tmpfn);
} else {
strcpy(tmpfile,tmpfn+tmplast);
*tmpfilelen = strlen(tmpfn+tmplast)+1;
xret|=VIF_TEMPFILE;
}
} else {
if (-1!=GetFileAttributes32A(destfn))
if (!DeleteFile32A(destfn)) {
xret|=_error2vif(GetLastError())|VIF_CANNOTDELETE;
DeleteFile32A(tmpfn);
LZClose32(hfsrc);
return xret;
}
if ((!(flags & VIFF_DONTDELETEOLD)) &&
curdir &&
*curdir &&
lstrcmpi32A(curdir,destdir)
) {
char curfn[260];
sprintf(curfn,"%s\\%s",curdir,destfilename);
if (-1!=GetFileAttributes32A(curfn)) {
/* FIXME: check if in use ... if it is, VIF_CANNOTDELETECUR */
if (!DeleteFile32A(curfn))
xret|=_error2vif(GetLastError())|VIF_CANNOTDELETECUR;
}
}
if (!MoveFile32A(tmpfn,destfn)) {
xret|=_error2vif(GetLastError())|VIF_CANNOTRENAME;
DeleteFile32A(tmpfn);
}
}
LZClose32(hfsrc);
return xret;
}
/* VerFindFileW [VERSION.6] */
/* VerInstallFileW [VERSION.8] */
DWORD
VerInstallFile32W(
UINT32 flags,LPCWSTR srcfilename,LPCWSTR destfilename,LPCWSTR srcdir,
LPCWSTR destdir,LPWSTR tmpfile,UINT32 *tmpfilelen )
LPCWSTR destdir,LPCWSTR curdir,LPWSTR tmpfile,UINT32 *tmpfilelen )
{
LPSTR wsrcf,wsrcd,wdestf,wdestd,wtmpf;
LPSTR wsrcf,wsrcd,wdestf,wdestd,wtmpf,wcurd;
DWORD ret;
wsrcf = HEAP_strdupWtoA( GetProcessHeap(), 0, srcfilename );
......@@ -480,18 +665,23 @@ VerInstallFile32W(
wdestf = HEAP_strdupWtoA( GetProcessHeap(), 0, destfilename );
wdestd = HEAP_strdupWtoA( GetProcessHeap(), 0, destdir );
wtmpf = HEAP_strdupWtoA( GetProcessHeap(), 0, tmpfile );
ret = VerInstallFile32A(flags,wsrcf,wdestf,wsrcd,wdestd,wtmpf,tmpfilelen);
wcurd = HEAP_strdupWtoA( GetProcessHeap(), 0, curdir );
ret = VerInstallFile32A(flags,wsrcf,wdestf,wsrcd,wdestd,wcurd,wtmpf,tmpfilelen);
if (!ret)
lstrcpynAtoW(tmpfile,wtmpf,*tmpfilelen);
HeapFree( GetProcessHeap(), 0, wsrcf );
HeapFree( GetProcessHeap(), 0, wsrcd );
HeapFree( GetProcessHeap(), 0, wdestf );
HeapFree( GetProcessHeap(), 0, wdestd );
HeapFree( GetProcessHeap(), 0, wtmpf );
if (wcurd)
HeapFree( GetProcessHeap(), 0, wcurd );
return ret;
}
/* FIXME: This table should, of course, be language dependend */
static const struct map_id2str {
UINT langid;
UINT16 langid;
const char *langname;
} languages[]={
{0x0401,"Arabisch"},
......
......@@ -16,6 +16,9 @@
#include <sys/ioccom.h>
#include <sys/sockio.h>
#endif
#if defined(__EMX__)
#include <sys/so_ioctl.h>
#endif
#include <sys/msg.h>
#include <sys/wait.h>
#include <sys/socket.h>
......
......@@ -127,7 +127,7 @@ BOOL32 DOSMEM_Init(void)
* this feels more like a hack to me than this current implementation is.
* If you find another, better, method, just change it. -Marcus Meissner
*/
DOSMEM_dosmem = VirtualAlloc(NULL,0x1000000,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
DOSMEM_dosmem = VirtualAlloc(NULL,0x100000,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
if (!DOSMEM_dosmem)
{
fprintf( stderr, "Could not allocate DOS memory.\n" );
......
......@@ -827,11 +827,10 @@ DWORD mciSendCommand(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2)
*/
UINT mciGetDeviceID (LPCSTR lpstrName)
{
char str[128];
dprintf_mci(stddeb, "mciGetDeviceID(%s)\n", lpstrName);
if (lpstrName && !lstrcmpi32A(lpstrName, "ALL"))
return MCI_ALL_DEVICE_ID;
return 0;
dprintf_mci(stddeb, "mciGetDeviceID(%s)\n", lpstrName);
if (lpstrName && !lstrcmpi32A(lpstrName, "ALL"))
return MCI_ALL_DEVICE_ID;
return 0;
}
/**************************************************************************
......
......@@ -842,12 +842,12 @@ static BOOL CURSORICON_SetCursor( HCURSOR16 hCursor )
else
{
/* Set the same cursor for all top-level windows */
HWND hwnd = GetWindow( GetDesktopWindow32(), GW_CHILD );
HWND hwnd = GetWindow32( GetDesktopWindow32(), GW_CHILD );
while(hwnd)
{
Window win = WIN_GetXWindow( hwnd );
if (win) XDefineCursor( display, win, cursor );
hwnd = GetWindow( hwnd, GW_HWNDNEXT );
hwnd = GetWindow32( hwnd, GW_HWNDNEXT );
}
}
return TRUE;
......
......@@ -1027,24 +1027,48 @@ BOOL32 GetTextExtentExPoint32W( HDC32 hdc, LPCWSTR str, INT32 count,
*/
BOOL16 GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
memcpy( metrics, &dc->u.x.font.metrics, sizeof(*metrics) );
metrics->tmAscent = abs( metrics->tmAscent
* dc->wndExtY / dc->vportExtY );
metrics->tmDescent = abs( metrics->tmDescent
* dc->wndExtY / dc->vportExtY );
metrics->tmHeight = metrics->tmAscent + metrics->tmDescent;
metrics->tmInternalLeading = abs( metrics->tmInternalLeading
* dc->wndExtY / dc->vportExtY );
metrics->tmExternalLeading = abs( metrics->tmExternalLeading
* dc->wndExtY / dc->vportExtY );
metrics->tmMaxCharWidth = abs( metrics->tmMaxCharWidth
* dc->wndExtX / dc->vportExtX );
metrics->tmAveCharWidth = abs( metrics->tmAveCharWidth
* dc->wndExtX / dc->vportExtX );
TEXTMETRIC32A tm;
if (!GetTextMetrics32A( (HDC32)hdc, &tm )) return FALSE;
metrics->tmHeight = tm.tmHeight;
metrics->tmAscent = tm.tmAscent;
metrics->tmDescent = tm.tmDescent;
metrics->tmInternalLeading = tm.tmInternalLeading;
metrics->tmExternalLeading = tm.tmExternalLeading;
metrics->tmAveCharWidth = tm.tmAveCharWidth;
metrics->tmMaxCharWidth = tm.tmMaxCharWidth;
metrics->tmWeight = tm.tmWeight;
metrics->tmOverhang = tm.tmOverhang;
metrics->tmDigitizedAspectX = tm.tmDigitizedAspectX;
metrics->tmDigitizedAspectY = tm.tmDigitizedAspectY;
metrics->tmFirstChar = tm.tmFirstChar;
metrics->tmLastChar = tm.tmLastChar;
metrics->tmDefaultChar = tm.tmDefaultChar;
metrics->tmBreakChar = tm.tmBreakChar;
metrics->tmItalic = tm.tmItalic;
metrics->tmUnderlined = tm.tmUnderlined;
metrics->tmStruckOut = tm.tmStruckOut;
metrics->tmPitchAndFamily = tm.tmPitchAndFamily;
metrics->tmCharSet = tm.tmCharSet;
return TRUE;
}
/***********************************************************************
* GetTextMetrics32A (GDI32.236)
*/
BOOL32 GetTextMetrics32A( HDC32 hdc, TEXTMETRIC32A *metrics )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
if (!(dc = (DC *)GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC )))
return FALSE;
}
if (!dc->funcs->pGetTextMetrics ||
!dc->funcs->pGetTextMetrics( dc,metrics ))
return FALSE;
dprintf_font(stdnimp,"text metrics:\n
InternalLeading = %i
ExternalLeading = %i
......@@ -1066,58 +1090,26 @@ BOOL16 GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
Ascent = %i
Descent = %i
Height = %i\n",
metrics->tmInternalLeading,
metrics->tmExternalLeading,
metrics->tmMaxCharWidth,
metrics->tmWeight,
metrics->tmItalic,
metrics->tmUnderlined,
metrics->tmStruckOut,
metrics->tmFirstChar,
metrics->tmLastChar,
metrics->tmDefaultChar,
metrics->tmBreakChar,
metrics->tmCharSet,
metrics->tmOverhang,
metrics->tmDigitizedAspectX,
metrics->tmDigitizedAspectY,
metrics->tmAveCharWidth,
metrics->tmMaxCharWidth,
metrics->tmAscent,
metrics->tmDescent,
metrics->tmHeight);
return TRUE;
}
/***********************************************************************
* GetTextMetrics32A (GDI32.236)
*/
BOOL32 GetTextMetrics32A( HDC32 hdc, TEXTMETRIC32A *metrics )
{
TEXTMETRIC16 tm;
if (!GetTextMetrics16( (HDC16)hdc, &tm )) return FALSE;
metrics->tmHeight = tm.tmHeight;
metrics->tmAscent = tm.tmAscent;
metrics->tmDescent = tm.tmDescent;
metrics->tmInternalLeading = tm.tmInternalLeading;
metrics->tmExternalLeading = tm.tmExternalLeading;
metrics->tmAveCharWidth = tm.tmAveCharWidth;
metrics->tmMaxCharWidth = tm.tmMaxCharWidth;
metrics->tmWeight = tm.tmWeight;
metrics->tmOverhang = tm.tmOverhang;
metrics->tmDigitizedAspectX = tm.tmDigitizedAspectX;
metrics->tmDigitizedAspectY = tm.tmDigitizedAspectY;
metrics->tmFirstChar = tm.tmFirstChar;
metrics->tmLastChar = tm.tmLastChar;
metrics->tmDefaultChar = tm.tmDefaultChar;
metrics->tmBreakChar = tm.tmBreakChar;
metrics->tmItalic = tm.tmItalic;
metrics->tmUnderlined = tm.tmUnderlined;
metrics->tmStruckOut = tm.tmStruckOut;
metrics->tmPitchAndFamily = tm.tmPitchAndFamily;
metrics->tmCharSet = tm.tmCharSet;
metrics->tmInternalLeading,
metrics->tmExternalLeading,
metrics->tmMaxCharWidth,
metrics->tmWeight,
metrics->tmItalic,
metrics->tmUnderlined,
metrics->tmStruckOut,
metrics->tmFirstChar,
metrics->tmLastChar,
metrics->tmDefaultChar,
metrics->tmBreakChar,
metrics->tmCharSet,
metrics->tmOverhang,
metrics->tmDigitizedAspectX,
metrics->tmDigitizedAspectY,
metrics->tmAveCharWidth,
metrics->tmMaxCharWidth,
metrics->tmAscent,
metrics->tmDescent,
metrics->tmHeight);
return TRUE;
}
......@@ -1127,8 +1119,8 @@ BOOL32 GetTextMetrics32A( HDC32 hdc, TEXTMETRIC32A *metrics )
*/
BOOL32 GetTextMetrics32W( HDC32 hdc, TEXTMETRIC32W *metrics )
{
TEXTMETRIC16 tm;
if (!GetTextMetrics16( (HDC16)hdc, &tm )) return FALSE;
TEXTMETRIC32A tm;
if (!GetTextMetrics32A( (HDC16)hdc, &tm )) return FALSE;
metrics->tmHeight = tm.tmHeight;
metrics->tmAscent = tm.tmAscent;
metrics->tmDescent = tm.tmDescent;
......
......@@ -416,11 +416,11 @@ HPALETTE16 SelectPalette( HDC16 hDC, HPALETTE16 hPal, BOOL bForceBackground )
if( hPal != STOCK_DEFAULT_PALETTE )
{
HWND32 hWnd = WindowFromDC32( hDC );
HWND32 hActive = GetActiveWindow();
HWND32 hActive = GetActiveWindow32();
/* set primary palette if it's related to current active */
if((!hWnd || (hActive == hWnd || IsChild(hActive,hWnd))) &&
if((!hWnd || (hActive == hWnd || IsChild16(hActive,hWnd))) &&
!bForceBackground )
wBkgPalette = 0;
}
......
......@@ -306,7 +306,9 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
WINHELP_InitFonts(win->hMainWnd);
SetWindowText(win->hMainWnd, page->file->lpszTitle);
if (page) {
SetWindowText(win->hMainWnd, page->file->lpszTitle);
}
WINHELP_SetupText(win->hTextWnd);
InvalidateRect(win->hTextWnd, NULL, TRUE);
......
......@@ -72,3 +72,26 @@ Thank you.
Albrecht Kleine
kleine@ak.sax.de
**************************************************************
1997, January
Subject: EDITMENU
There now is a resource EDITMENU. It is the menu that is displayed when you
click the right mouse button within an edit control. I included an English
version in all sysres_??.rc files, which needs translation in your language.
This has now been done for:
* English
.....
Note: I picked the IDs of the menuitems "at random". When someone wants to
find out the "real" (win95) values, feel free to change them. However, you
should change _all_ sysres_??.rc files and subsequently the function
EDIT_WM_Command() in controls/edit.c. This is a matter of minutes (i.e. no
programming skills required).
Bye,
Frans van Dorsselaer
dorssel@rulhm1.LeidenUniv.nl
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&O programu WINE", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&Om WINE ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&ber WINE ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&About WINE ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&Pri WINE ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -14,6 +14,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&Acerca de WINE...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&Tietoja WINEista...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -14,6 +14,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "A propos de &Wine ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&Info su WINE ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "와인에 관하여 ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -13,6 +13,21 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
MENUITEM "&Om WINE ...", 61761
}
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
POPUP ""
BEGIN
MENUITEM "&Undo", EM_UNDO32
MENUITEM SEPARATOR
MENUITEM "Cu&t", WM_CUT
MENUITEM "&Copy", WM_COPY
MENUITEM "&Paste", WM_PASTE
MENUITEM "&Delete", WM_CLEAR
MENUITEM SEPARATOR
MENUITEM "Select &All", EM_SETSEL32
END
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
......
......@@ -1325,7 +1325,7 @@ static void BuildCall32LargeStack( FILE *outfile )
fprintf( outfile, "\n\t.align 4\n" );
#ifdef __GNUC__
fprintf( outfile, ".stabs \"CallTo32_LargeStack:F1\",36,0,0,CallTo32_LargeStack\n");
fprintf( outfile, ".stabs \"CallTo32_LargeStack:F1\",36,0,0," PREFIX "CallTo32_LargeStack\n");
#endif
fprintf( outfile, "\t.globl " PREFIX "CallTo32_LargeStack\n" );
fprintf( outfile, PREFIX "CallTo32_LargeStack:\n" );
......@@ -1604,7 +1604,7 @@ static void BuildCallFrom16Func( FILE *outfile, char *profile )
fprintf( outfile, "\n\t.align 4\n" );
#ifdef __GNUC__
fprintf( outfile, ".stabs \"CallFrom16_%s:F1\",36,0,0,CallFrom16_%s\n",
fprintf( outfile, ".stabs \"CallFrom16_%s:F1\",36,0,0," PREFIX "CallFrom16_%s\n",
profile, profile);
#endif
fprintf( outfile, "\t.globl " PREFIX "CallFrom16_%s\n", profile );
......@@ -1823,7 +1823,7 @@ static void BuildCallTo16Func( FILE *outfile, char *profile )
fprintf( outfile, "\n\t.align 4\n" );
#ifdef __GNUC__
fprintf( outfile, ".stabs \"CallTo16_%s:F1\",36,0,0,CallTo16_%s\n",
fprintf( outfile, ".stabs \"CallTo16_%s:F1\",36,0,0," PREFIX "CallTo16_%s\n",
profile, profile);
#endif
fprintf( outfile, "\t.globl " PREFIX "CallTo16_%s\n", profile );
......@@ -2073,13 +2073,15 @@ static void RestoreContext32( FILE *outfile )
{
/* Restore the context structure */
fprintf( outfile, "\tleal %d(%%ebp),%%esp\n", -sizeof(CONTEXT)-12 );
fprintf( outfile, "\tleal %d(%%ebp),%%esp\n", -sizeof(CONTEXT)-8 );
fprintf( outfile, "\tfrstor %d(%%esp)\n", CONTEXTOFFSET(FloatSave) );
fprintf( outfile, "\tmovl %d(%%esp),%%eax\n", CONTEXTOFFSET(Eip) );
fprintf( outfile, "\tmovl %%eax,4(%%ebp)\n" ); /* %eip at time of call */
fprintf( outfile, "\tmovl %d(%%esp),%%eax\n", CONTEXTOFFSET(Ebp) );
fprintf( outfile, "\tmovl %%eax,0(%%ebp)\n" ); /* %ebp at time of call */
/* Store flags over the relay addr */
fprintf( outfile, "\tmovl %d(%%esp),%%eax\n", CONTEXTOFFSET(EFlags) );
fprintf( outfile, "\tmovl %%eax,%d(%%esp)\n", sizeof(CONTEXT) );
......@@ -2152,7 +2154,7 @@ static void BuildCallFrom32Func( FILE *outfile, const char *profile )
fprintf( outfile, "\n\t.align 4\n" );
#ifdef __GNUC__
fprintf( outfile, ".stabs \"CallFrom32_%s:F1\",36,0,0,CallFrom32_%s\n",
fprintf( outfile, ".stabs \"CallFrom32_%s:F1\",36,0,0," PREFIX "CallFrom32_%s\n",
profile, profile);
#endif
fprintf( outfile, "\t.globl " PREFIX "CallFrom32_%s\n", profile );
......@@ -2243,7 +2245,7 @@ static void BuildCallTo32Func( FILE *outfile, int args )
fprintf( outfile, "\n\t.align 4\n" );
#ifdef __GNUC__
fprintf( outfile, ".stabs \"CallTo32_%d:F1\",36,0,0,CallTo32_%d\n",
fprintf( outfile, ".stabs \"CallTo32_%d:F1\",36,0,0," PREFIX "CallTo32_%d\n",
args, args);
#endif
fprintf( outfile, "\t.globl " PREFIX "CallTo32_%d\n", args );
......
......@@ -271,6 +271,7 @@ static void output_dependencies(void)
while (fgets( buffer, sizeof(buffer), file ))
if (!strncmp( buffer, Separator, strlen(Separator) )) break;
ftruncate( fileno(file), ftell(file) );
fseek( file, 0L, SEEK_END );
}
if (!file)
{
......
......@@ -123,7 +123,11 @@ BOOL32 SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION tzinfo)
struct timezone tz;
tz.tz_minuteswest = tzinfo->Bias;
#ifdef __EMX__ /* FIXME */
tz.tz_dsttime = 0;
#else
tz.tz_dsttime = DST_NONE;
#endif
return !settimeofday(NULL, &tz);
}
......
......@@ -273,7 +273,7 @@ static HRGN32 DCE_ClipWindows( WND *pWndStart, WND *pWndEnd,
* clipped by the client area of all ancestors, and then optionally
* by siblings and children.
*/
HRGN32 DCE_GetVisRgn( HWND hwnd, WORD flags )
HRGN32 DCE_GetVisRgn( HWND32 hwnd, WORD flags )
{
RECT16 rect;
HRGN32 hrgn;
......
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