Release 940420

Wed Apr 20 14:53:35 1994  Bob Amstadt  (bob@pooh)

	* [tools/build.c] [if1632/call.S] [if1632/Imakefile]
	Fixed bug for non-Linux systems.

Apr 18, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [windows/win.c]
	Bug fixed in CreateWindowEx() : Now use SetMenu() for menubar setup.
	New empty stub for function SetSysModalWindow().

	* [misc/exec.c]
	New empty stub for function ExitWindows().

	* [objects/font.c]
	New empty stub for function EnumFonts().

	* New file [misc/property.c]
	New functions RemoveProp(), GetProp(), SetProp() & EnumProps().

	* New file [misc/shell.c]
	New empty stubs for function RegisterShellProc(), 
			ShellExecute() & ShellProc().

	* New files [loader/task.c] & [include/task.h]
	Move functions GetWindowTask(), GetNumTask(), EnumTaskWindows()
		from 'loader/library.c'.

	* [if1632/user.c] [if1632/kernel.c]
	Put Atoms functions entries.

	* [controls/combo.c]
	New functions DirDlgSelectComboBox() & DirDlgListComboBox().

	* [controls/listbox.c]
	New functions DirDlgSelect() & DirDlgList().

Sun Apr 17 20:57:59 1994  Erik Bos (erik@trashcan.hacktic.nl)

	* [objects/test.c]
	GrayString() added.

	* [if1632/callback.c]
	CallGrayStringProc() added.

	* [if1632/relay.c] [if1632/mmsystem.spec]
	Added.

	* [if1632/kernel.spec] [if1632/user.spec]
	Added forgotten specs for atom functions.

Tue Apr 12 00:05:31 1994  Bob Amstadt  (bob@pooh)

	* misc/spy.c (SpyInit): Added more message types

	* [windows/mdi.c] [include/mdi.h]
	Maximizing and restoring child windows.
	Tiling of child windows.

Mon Apr 11 20:48:28 1994  Alexandre Julliard  (julliard@lamisun.epfl.ch)

	* [windows/winpos.c]
	Revert focus and activation to previous window when hiding a window.

	* [windows/syscolor.c]
	Implemented system color objects (brushes and pens created at
	SetSysColor() time for better performance).

	* [windows/graphics.c] [windows/nonclient.c] [controls/button.c]
	Changed painting code to use system color objects.

	* [windows/message.c]
	New function MSG_InternalGetMessage() for internal messages
	loops (e.g. for dialogs or menus).

	* [windows/hook.c] [include/hook.h]  (New files)
	Beginning of the window hooks implementation.

	* [windows/dialog.c]
	Use new function MSG_InternalGetMessage() in DialogBox().

	* [if1632/callback.c]
	Added function CallHookProc().

Apr 11, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [windows/event.c]
	Bug fix : WM_CHARs are sent to focused window like WM_KEY???.

	* [misc/exec.c]
	Nothing much more than a stub for LoadModule(), I saw there a lot
		to be done in that corner, I will come back later ...

	* [loader/library.c]
	New functions GetWindowTask(), GetNumTask(), EnumTaskWindows() 
			and associated modules & tasks linked-lists.
	(it's only an 'emerging bud', more to come next weeks).

	* [loader/wine.c]
	Use LoadLibrary() instead of LoadImage() for 'sysres.dll'.

	* [control/menu.c]
	You can now click outside menu region without problem.
	Keyboard navig more smootly, even if a child has the focus.
	Bug fix in InsertItem(), (bad linklist when insert point not found).
	change Realloc for Free & Alloc in ModifyItem().
	MF_STRING now set BLACK_PEN to fix bug of bad color of the underscores 
		done by DrawText(), (maybe it should done in DrawText() itself ?).

Sun Apr 10 14:06:08 1994  Erik Bos (erik@trashcan.hacktic.nl)

	* [misc/profile.c]
	.INI files will now be stored in / loaded from the windows dir
	if no path is supplied.

	* [if1632/kernel.spec]
	Fixed GetDriveType's prototype.

	* [if1632/winsock.spec] [include/winsock.h] [misc/winsocket.c]
	Fixed prototypes: winsock uses a word as socket handle not an int.

	* [misc/winsocket.c]
	Added heap allocation for returned structures.
	Added non-blocking WSAAsyncGetXbyY() functions as blocking ones.

	* [loader/wine.c]
	Added IsDLLLoaded(), used in LoadImage() to prevent loading
	a dll multiple times.
	Directory is added to wine's path when a fullpath is supplied when
	starting wine.
	LoadImage(): DLL filename used instead DLL's own internal name,
	fixes 'Bad DLL name' errors.

Sat Apr  9 08:26:03 1994  David Metcalfe <david@prism.demon.co.uk>

	* [controls/edit.c] [controls/widgets.c]
	First release of edit control.
This commit is contained in:
Alexandre Julliard 1994-04-21 01:20:00 +00:00
parent 8d24ae6d31
commit 5819953c2a
126 changed files with 15468 additions and 4071 deletions

4
BUGS
View File

@ -1,5 +1,5 @@
- EBP and ESP are sometimes corrupted while running 16-bit code.
- Dialog Boxes created by WM_CREATE handler aren't visible
- RegisterClass() with hbrBackground = COLOR_APPWORKSPACE+1 does not work.
- MDI client area needs to resize when frame does
- Need to generate WM_CHILDACTIVATE
- MDI does not send WM_GETMINMAX message.
- InitializeLoadedDLLs() can't init LZEXPAND.DLL. (cs:ip => 0:0)

141
ChangeLog
View File

@ -1,3 +1,144 @@
Wed Apr 20 14:53:35 1994 Bob Amstadt (bob@pooh)
* [tools/build.c] [if1632/call.S] [if1632/Imakefile]
Fixed bug for non-Linux systems.
Apr 18, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [windows/win.c]
Bug fixed in CreateWindowEx() : Now use SetMenu() for menubar setup.
New empty stub for function SetSysModalWindow().
* [misc/exec.c]
New empty stub for function ExitWindows().
* [objects/font.c]
New empty stub for function EnumFonts().
* New file [misc/property.c]
New functions RemoveProp(), GetProp(), SetProp() & EnumProps().
* New file [misc/shell.c]
New empty stubs for function RegisterShellProc(),
ShellExecute() & ShellProc().
* New files [loader/task.c] & [include/task.h]
Move functions GetWindowTask(), GetNumTask(), EnumTaskWindows()
from 'loader/library.c'.
* [loader/library.c]
* [if1632/user.c] [if1632/kernel.c]
Put Atoms functions entries.
* [controls/combo.c]
New functions DirDlgSelectComboBox() & DirDlgListComboBox().
* [controls/listbox.c]
New functions DirDlgSelect() & DirDlgList().
Sun Apr 17 20:57:59 1994 Erik Bos (erik@trashcan.hacktic.nl)
* [objects/test.c]
GrayString() added.
* [if1632/callback.c]
CallGrayStringProc() added.
* [if1632/relay.c] [if1632/mmsystem.spec]
Added.
* [if1632/kernel.spec] [if1632/user.spec]
Added forgotten specs for atom functions.
----------------------------------------------------------------------
Tue Apr 12 00:05:31 1994 Bob Amstadt (bob@pooh)
* misc/spy.c (SpyInit): Added more message types
* [windows/mdi.c] [include/mdi.h]
Maximizing and restoring child windows.
Tiling of child windows.
Mon Apr 11 20:48:28 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [windows/winpos.c]
Revert focus and activation to previous window when hiding a window.
* [windows/syscolor.c]
Implemented system color objects (brushes and pens created at
SetSysColor() time for better performance).
* [windows/graphics.c] [windows/nonclient.c] [controls/button.c]
Changed painting code to use system color objects.
* [windows/message.c]
New function MSG_InternalGetMessage() for internal messages
loops (e.g. for dialogs or menus).
* [windows/hook.c] [include/hook.h] (New files)
Beginning of the window hooks implementation.
* [windows/dialog.c]
Use new function MSG_InternalGetMessage() in DialogBox().
* [if1632/callback.c]
Added function CallHookProc().
Apr 11, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [windows/event.c]
Bug fix : WM_CHARs are sent to focused window like WM_KEY???.
* [misc/exec.c]
Nothing much more than a stub for LoadModule(), I saw there a lot
to be done in that corner, I will come back later ...
* [loader/library.c]
New functions GetWindowTask(), GetNumTask(), EnumTaskWindows()
and associated modules & tasks linked-lists.
(it's only an 'emerging bud', more to come next weeks).
* [loader/wine.c]
Use LoadLibrary() instead of LoadImage() for 'sysres.dll'.
* [control/menu.c]
You can now click outside menu region without problem.
Keyboard navig more smootly, even if a child has the focus.
Bug fix in InsertItem(), (bad linklist when insert point not found).
change Realloc for Free & Alloc in ModifyItem().
MF_STRING now set BLACK_PEN to fix bug of bad color of the underscores
done by DrawText(), (maybe it should done in DrawText() itself ?).
Sun Apr 10 14:06:08 1994 Erik Bos (erik@trashcan.hacktic.nl)
* [misc/profile.c]
.INI files will now be stored in / loaded from the windows dir
if no path is supplied.
* [if1632/kernel.spec]
Fixed GetDriveType's prototype.
* [if1632/winsock.spec] [include/winsock.h] [misc/winsocket.c]
Fixed prototypes: winsock uses a word as socket handle not an int.
* [misc/winsocket.c]
Added heap allocation for returned structures.
Added non-blocking WSAAsyncGetXbyY() functions as blocking ones.
* [loader/wine.c]
Added IsDLLLoaded(), used in LoadImage() to prevent loading
a dll multiple times.
Directory is added to wine's path when a fullpath is supplied when
starting wine.
LoadImage(): DLL filename used instead DLL's own internal name,
fixes 'Bad DLL name' errors.
Sat Apr 9 08:26:03 1994 David Metcalfe <david@prism.demon.co.uk>
* [controls/edit.c] [controls/widgets.c]
First release of edit control.
----------------------------------------------------------------------
Tue Apr 5 14:36:59 1994 Bob Amstadt (bob@pooh)

0
Configure Executable file → Normal file
View File

View File

@ -1,29 +0,0 @@
You may without charge, royalty or other payment, copy and
distribute copies of this work and derivative works of this work
in source or binary form provided that: (1)
you appropriately publish on each copy an appropriate copyright
notice; (2) faithfully reproduce all prior copyright notices
included in the original work (you may also add your own
copyright notice); and (3) agree to indemnify and hold all prior
authors, copyright holders and licensors of the work harmless
from and against all damages arising from use of the work.
You may distribute sources of derivative works of the work
provided that (1) (a) all source files of the original work that
have been modified, (b) all source files of the derivative work
that contain any party of the original work, and (c) all source
files of the derivative work that are necessary to compile, link
and run the derivative work without unresolved external calls and
with the same functionality of the original work ("Necessary
Sources") carry a prominent notice explaining the nature and date
of the modification and/or creation. You are encouraged to make
the Necessary Sources available under this license in order to
further the development and acceptance of the work.
EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED
WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING
BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS
OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR
LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

17
README
View File

@ -115,6 +115,9 @@ For example: to run Windows' solitaire:
wine /usr/windows/sol.exe (using a unixfilename)
note: the path of the file will also be added to the path when
a full name is supplied on the commandline.
Have a nice game of solitaire, but be careful. Emulation isn't perfect.
So, occassionally it will crash.
@ -168,6 +171,20 @@ bob@amscons.com
7. WHAT'S NEW
WHAT'S NEW with Wine-940420: (see ChangeLog for details)
- new property functions
- new listbox and combo box functions
- GrayString() and CallGrayStringProc()
- and many many bug fixes!
WHAT'S NEW with Wine-940412: (see ChangeLog for details)
- menuing improvements
- drawing performance improvements
- beginnings of hooks
- MDI maximizing and tiling
- improvements in winsock implementation
- and many many bug fixes!
WHAT'S NEW with Wine-940405: (see ChangeLog for details)
- Mouse activation of menus working again
- GetprocAddress()

View File

@ -1,45 +0,0 @@
Status of MS Windows 3.1 Applets
September 13, 1993
I copied the following DLLs from my Windows (3.1) directory to my Wine
directory. Below I show how most of the programs included with
Windows 3.1 died.
commdlg.dll olesvr.dll recorder.dll
olecli.dll pbrush.dll toolhelp.dll
Scott Laird (lair@midway.uchicago.edu)
calc.exe dies no USER.89 (CreateDialog)
calendar.exe dies no KERNEL.60 (FindResource)
cardfile.exe cannot read relocation info
charmap.exe dies no USER.89 (CreateDialog)
clipbrd.exe dies no error
clock.exe dies no KERNEL.60 (FindResource)
control.exe dies no KERNEL.90 (lstrlen)
drwatson.exe dies no KERNEL.36 (GetCurrentTask)
mplayer.exe no MMSYSTEM.dll
notepad.exe dies no error
nwpopup.exe dies no KERNEL.47 (GetModuleHandle)
packager.exe cannot read relocation info
pbrush.exe cannot read relocation info
pifedit.exe dies no KERNEL.60 (FindResource)
printman.exe dies no KERNEL.107 (SetErrorMode)
progman.exe dies no error
recorder.exe cannot read relocation info
regedit.exe dies no KERNEL.90 (lstrlen)
sol.exe ** RUNS **
soundrec.exe no MMSYSTEM.dll
sysedit.exe dies no USER.159 (GetSubMenu)
terminal.exe dies int21 2a
winfile.exe DOS ax=2fdf, dies no KERNEL.107
winhelp.exe dies no KERNEL.60 (FindResource)
winmine.exe dies no USER.256 (GetDesktopWindow)
winpopup.exe no NETAPI
wintutor.exe 'Cannot load WINTUTOR.DAT' (file present)
write.exe cannot read relocation info

Binary file not shown.

View File

@ -1,2 +1,6 @@
/* autoconf.h generated automatically. Run Configure. */
#error You must run Configure before you can build the makefiles.
#define WINE_INI_GLOBAL "/home/alex/wine/wine.conf"
#define AutoDefines

View File

@ -9,6 +9,7 @@ SRCS = \
menu.c \
scroll.c \
static.c \
edit.o \
desktop.c \
widgets.c

View File

@ -10,12 +10,10 @@ static char Copyright2[] = "Copyright David Metcalfe, 1993";
#include <windows.h>
#include "win.h"
#include "user.h"
#include "syscolor.h"
LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam);
static COLORREF color_windowtext, color_windowframe, color_btnface,
color_btnshadow, color_btntext, color_btnhighlight;
static BOOL pressed;
#define NOTIFY_PARENT(hWndCntrl, wNotifyCode) \
@ -203,14 +201,6 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
lResult = -1L;
else
{
/* initialise colours used for button rendering: */
color_windowtext = GetSysColor(COLOR_WINDOWTEXT);
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_btnface = GetSysColor(COLOR_BTNFACE);
color_btnshadow = GetSysColor(COLOR_BTNSHADOW);
color_btntext = GetSysColor(COLOR_BTNTEXT);
color_btnhighlight = GetSysColor(COLOR_BTNHIGHLIGHT);
(WORD)(*(wndPtr->wExtra)) = 0;
pressed = FALSE;
lResult = 0L;
@ -246,12 +236,6 @@ LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_SYSCOLORCHANGE:
color_windowtext = GetSysColor(COLOR_WINDOWTEXT);
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_btnface = GetSysColor(COLOR_BTNFACE);
color_btnshadow = GetSysColor(COLOR_BTNSHADOW);
color_btntext = GetSysColor(COLOR_BTNTEXT);
color_btnhighlight = GetSysColor(COLOR_BTNHIGHLIGHT);
InvalidateRect(hWnd, NULL, TRUE);
break;
@ -296,7 +280,7 @@ static LONG PB_Paint(HWND hWnd)
static LONG PB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
{
/* SetFocus(hWnd); */
SetFocus(hWnd);
SetCapture(hWnd);
pressed = TRUE;
InvalidateRect(hWnd, NULL, FALSE);
@ -334,8 +318,8 @@ static LONG PB_KillFocus(HWND hWnd)
static void DrawRaisedPushButton(HDC hDC, HWND hButton, RECT rc)
{
HPEN hOldPen, hFramePen;
HBRUSH hOldBrush, hShadowBrush, hHighlightBrush, hBackgrndBrush;
HPEN hOldPen;
HBRUSH hOldBrush;
HRGN rgn1, rgn2, rgn;
int len;
static char text[50+1];
@ -343,13 +327,9 @@ static void DrawRaisedPushButton(HDC hDC, HWND hButton, RECT rc)
DWORD dwTextSize;
int delta;
TEXTMETRIC tm;
int i;
hFramePen = CreatePen(PS_SOLID, 1, color_windowframe);
hBackgrndBrush = CreateSolidBrush(color_btnface);
hOldPen = (HPEN)SelectObject(hDC, (HANDLE)hFramePen);
hOldBrush = (HBRUSH)SelectObject(hDC, (HANDLE)hBackgrndBrush);
hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowFrame);
hOldBrush = (HBRUSH)SelectObject(hDC, sysColorObjects.hbrushBtnFace);
SetBkMode(hDC, TRANSPARENT);
rgn = CreateRectRgn(0, 0, 0, 0);
@ -380,10 +360,9 @@ static void DrawRaisedPushButton(HDC hDC, HWND hButton, RECT rc)
points[4].y = rc.top+1;
points[5].x = rc.left+2;
points[5].y = rc.top+1;
hHighlightBrush = CreateSolidBrush(color_btnhighlight);
rgn2 = CreatePolygonRgn(points, DIM(points), ALTERNATE);
CombineRgn(rgn, rgn1, rgn2, RGN_AND);
FillRgn(hDC, rgn2, hHighlightBrush);
FillRgn(hDC, rgn2, sysColorObjects.hbrushBtnHighlight);
/* draw button shadow: */
points[0].x = rc.left+2;
@ -398,10 +377,9 @@ static void DrawRaisedPushButton(HDC hDC, HWND hButton, RECT rc)
points[4].y = rc.top;
points[5].x = rc.right-1;
points[5].y = rc.bottom;
hShadowBrush = CreateSolidBrush(color_btnshadow);
rgn2 = CreatePolygonRgn(points, DIM(points), ALTERNATE);
CombineRgn(rgn, rgn1, rgn2, RGN_AND);
FillRgn(hDC, rgn2, hShadowBrush);
FillRgn(hDC, rgn2, sysColorObjects.hbrushBtnShadow);
/* do we have the focus? */
if (len >= 1 && GetFocus() == hButton) {
@ -416,9 +394,6 @@ static void DrawRaisedPushButton(HDC hDC, HWND hButton, RECT rc)
SelectObject(hDC, (HANDLE)hOldPen);
SelectObject(hDC, (HANDLE)hOldBrush);
DeleteObject((HANDLE)hFramePen);
DeleteObject((HANDLE)hShadowBrush);
DeleteObject((HANDLE)hBackgrndBrush);
DeleteObject((HANDLE)rgn1);
DeleteObject((HANDLE)rgn2);
DeleteObject((HANDLE)rgn);
@ -427,20 +402,16 @@ static void DrawRaisedPushButton(HDC hDC, HWND hButton, RECT rc)
static void DrawPressedPushButton(HDC hDC, HWND hButton, RECT rc)
{
HPEN hOldPen, hShadowPen, hFramePen;
HBRUSH hOldBrush, hBackgrndBrush;
HRGN rgn1, rgn2, rgn;
HPEN hOldPen;
HBRUSH hOldBrush;
int len;
static char text[50+1];
DWORD dwTextSize;
int delta;
TEXTMETRIC tm;
hFramePen = CreatePen(PS_SOLID, 1, color_windowframe);
hBackgrndBrush = CreateSolidBrush(color_btnface);
hOldBrush = (HBRUSH)SelectObject(hDC, (HANDLE)hBackgrndBrush);
hOldPen = (HPEN)SelectObject(hDC, (HANDLE)hFramePen);
hOldBrush = (HBRUSH)SelectObject(hDC, sysColorObjects.hbrushBtnFace);
hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowFrame);
SetBkMode(hDC, TRANSPARENT);
/* give parent a chance to alter parameters: */
@ -449,11 +420,9 @@ static void DrawPressedPushButton(HDC hDC, HWND hButton, RECT rc)
Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom);
/* draw button shadow: */
hShadowPen = CreatePen(PS_SOLID, 1, color_btnshadow);
SelectObject(hDC, (HANDLE)hShadowPen);
MoveTo(hDC, rc.left+1, rc.bottom-1);
LineTo(hDC, rc.left+1, rc.top+1);
LineTo(hDC, rc.right-1, rc.top+1);
SelectObject(hDC, sysColorObjects.hbrushBtnShadow );
PatBlt(hDC, rc.left+1, rc.top+1, 1, rc.bottom-rc.top-2, PATCOPY );
PatBlt(hDC, rc.left+1, rc.top+1, rc.right-rc.left-2, 1, PATCOPY );
/* draw button label, if any: */
len = GetWindowText(hButton, text, sizeof text);
@ -476,9 +445,6 @@ static void DrawPressedPushButton(HDC hDC, HWND hButton, RECT rc)
SelectObject(hDC, (HANDLE)hOldPen);
SelectObject(hDC, (HANDLE)hOldBrush);
DeleteObject((HANDLE)hBackgrndBrush);
DeleteObject(SelectObject(hDC, (HANDLE)hFramePen));
DeleteObject(SelectObject(hDC, (HANDLE)hShadowPen));
}
@ -491,7 +457,7 @@ static LONG CB_Paint(HWND hWnd)
PAINTSTRUCT ps;
RECT rc, rc3;
HDC hDC;
HPEN hPen, hOldPen;
HPEN hOldPen;
HBRUSH hBrush, hGrayBrush;
int textlen, delta;
char *text;
@ -503,8 +469,7 @@ static LONG CB_Paint(HWND hWnd)
hDC = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rc);
hPen = CreatePen(PS_SOLID, 1, color_windowtext);
hOldPen = (HPEN)SelectObject(hDC, (HANDLE)hPen);
hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowText);
hGrayBrush = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
@ -555,6 +520,7 @@ static LONG CB_Paint(HWND hWnd)
DrawFocusRect(hDC, &rc);
}
SelectObject(hDC, hOldPen);
USER_HEAP_FREE(hText);
GlobalUnlock(hWnd);
EndPaint(hWnd, &ps);
@ -577,7 +543,7 @@ static LONG CB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
rc.right = tm.tmHeight;
if (PtInRect(&rc, MAKEPOINT(lParam)))
{
/* SetFocus(hWnd); */
SetFocus(hWnd);
SetCapture(hWnd);
pressed = TRUE;
InvalidateRect(hWnd, NULL, FALSE);
@ -704,7 +670,7 @@ static LONG RB_Paint(HWND hWnd)
PAINTSTRUCT ps;
RECT rc;
HDC hDC;
HPEN hPen, hOldPen;
HPEN hOldPen;
HBRUSH hBrush, hOldBrush;
int textlen, delta;
char *text;
@ -716,8 +682,7 @@ static LONG RB_Paint(HWND hWnd)
hDC = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rc);
hPen = CreatePen(PS_SOLID, 1, color_windowtext);
hOldPen = (HPEN)SelectObject(hDC, (HANDLE)hPen);
hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowText);
hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
MAKELPARAM(hWnd, CTLCOLOR_BTN));
@ -737,7 +702,7 @@ static LONG RB_Paint(HWND hWnd)
if ((WORD)(*(wndPtr->wExtra)) == 1)
{
hBrush = CreateSolidBrush(color_windowtext);
hBrush = CreateSolidBrush( GetNearestColor(hDC, GetSysColor(COLOR_WINDOWTEXT)));
hOldBrush = (HBRUSH)SelectObject(hDC, (HANDLE)hBrush);
Ellipse(hDC, 3, rc.top + delta + 3, tm.tmHeight - 3,
tm.tmHeight + delta -3);
@ -759,6 +724,7 @@ static LONG RB_Paint(HWND hWnd)
DrawFocusRect(hDC, &rc);
}
SelectObject(hDC, hOldPen );
USER_HEAP_FREE(hText);
GlobalUnlock(hWnd);
EndPaint(hWnd, &ps);
@ -781,7 +747,7 @@ static LONG RB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
rc.right = tm.tmHeight;
if (PtInRect(&rc, MAKEPOINT(lParam)))
{
/* SetFocus(hWnd); */
SetFocus(hWnd);
SetCapture(hWnd);
pressed = TRUE;
InvalidateRect(hWnd, NULL, FALSE);
@ -880,7 +846,7 @@ static LONG GB_Paint(HWND hWnd)
PAINTSTRUCT ps;
RECT rc;
HDC hDC;
HPEN hPen, hOldPen;
HPEN hOldPen;
HBRUSH hBrush;
int textlen;
char *text;
@ -890,8 +856,7 @@ static LONG GB_Paint(HWND hWnd)
hDC = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rc);
hPen = CreatePen(PS_SOLID, 1, color_windowtext);
hOldPen = (HPEN)SelectObject(hDC, (HANDLE)hPen);
hOldPen = (HPEN)SelectObject(hDC, sysColorObjects.hpenWindowText);
hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC,
MAKELPARAM(hWnd, CTLCOLOR_BTN));
@ -911,6 +876,7 @@ static LONG GB_Paint(HWND hWnd)
rc.bottom = size.cy;
DrawText(hDC, text, textlen, &rc, DT_SINGLELINE);
SelectObject(hDC, hOldPen );
USER_HEAP_FREE(hText);
EndPaint(hWnd, &ps);
}
@ -947,7 +913,7 @@ static LONG UB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
{
RECT rc;
/* SetFocus(hWnd); */
SetFocus(hWnd);
SetCapture(hWnd);
GetClientRect(hWnd, &rc);
if (PtInRect(&rc, MAKEPOINT(lParam)))
@ -1013,7 +979,7 @@ static LONG OB_LButtonDown(HWND hWnd, WORD wParam, LONG lParam)
HANDLE hDis;
LPDRAWITEMSTRUCT lpdis;
WND *wndPtr = WIN_FindWndPtr(hWnd);
/* SetFocus(hWnd); */
SetFocus(hWnd);
SetCapture(hWnd);
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rc);

View File

@ -61,13 +61,12 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
width = rect.right - rect.left;
height = rect.bottom - rect.top;
SetWindowPos(hwnd, 0, 0, 0, width + bm.bmHeight, bm.bmHeight,
SWP_NOMOVE | SWP_NOZORDER);
SWP_NOMOVE | SWP_NOZORDER);
CreateComboStruct(hwnd);
lphc = ComboGetStorageHeader(hwnd);
if (lphc == NULL) return 0;
if (wndPtr->dwStyle & CBS_SIMPLE)
/* lphc->hWndEdit = CreateWindow("EDIT", "", */
lphc->hWndEdit = CreateWindow("STATIC", "",
lphc->hWndEdit = CreateWindow("EDIT", "",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | SS_LEFT,
0, 0, width - bm.bmHeight, bm.bmHeight,
hwnd, 1, wndPtr->hInstance, 0L);
@ -370,3 +369,30 @@ int CreateComboStruct(HWND hwnd)
/************************************************************************
* DlgDirSelectComboBox [USER.194]
*/
BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, int nIDLBox)
{
printf("DlgDirSelectComboBox(%04X, '%s', %d) \n", hDlg, lpStr, nIDLBox);
}
/************************************************************************
* DlgDirListComboBox [USER.195]
*/
int DlgDirListComboBox(HWND hDlg, LPSTR lpPathSpec,
int nIDLBox, int nIDStat, WORD wType)
{
HWND hWnd;
LPHEADCOMBO lphc;
printf("DlgDirListComboBox(%04X, '%s', %d, %d, %04X) \n",
hDlg, lpPathSpec, nIDLBox, nIDStat, wType);
hWnd = GetDlgItem(hDlg, nIDLBox);
lphc = ComboGetStorageHeader(hWnd);
SendMessage(lphc->hWndLBox, LB_RESETCONTENT, 0, 0L);
return SendMessage(lphc->hWndLBox, LB_DIR, wType, (DWORD)lpPathSpec);
}

2384
controls/edit.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1260,3 +1260,28 @@ int ListBoxFindNextMatch(HWND hwnd, WORD wChar)
}
/************************************************************************
* DlgDirSelect [USER.99]
*/
BOOL DlgDirSelect(HWND hDlg, LPSTR lpStr, int nIDLBox)
{
printf("DlgDirSelect(%04X, '%s', %d) \n", hDlg, lpStr, nIDLBox);
}
/************************************************************************
* DlgDirList [USER.100]
*/
int DlgDirList(HWND hDlg, LPSTR lpPathSpec,
int nIDLBox, int nIDStat, WORD wType)
{
HWND hWnd;
printf("DlgDirList(%04X, '%s', %d, %d, %04X) \n",
hDlg, lpPathSpec, nIDLBox, nIDStat, wType);
hWnd = GetDlgItem(hDlg, nIDLBox);
ListBoxResetContent(hWnd);
return ListBoxDirectory(hWnd, wType, lpPathSpec);
}

View File

@ -29,7 +29,8 @@ static BOOL MenuHasFocus = FALSE;
LPPOPUPMENU PopupMenuGetStorageHeader(HWND hwnd);
LPPOPUPMENU PopupMenuGetWindowAndStorage(HWND hwnd, WND **wndPtr);
void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop);
void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
BOOL suppress_draw);
BOOL MenuButtonDown(HWND hWnd, LPPOPUPMENU lppop, int x, int y);
void MenuButtonUp(HWND hWnd, LPPOPUPMENU lppop, int x, int y);
void MenuMouseMove(HWND hWnd, LPPOPUPMENU lppop, WORD wParam, int x, int y);
@ -39,7 +40,7 @@ BOOL ExecFocusedMenuItem(HWND hWnd, LPPOPUPMENU lppop);
void MenuItemSelect(HWND hWnd, LPPOPUPMENU lppop, WORD wIndex);
LPMENUITEM MenuFindItem(LPPOPUPMENU lppop, int x, int y, WORD *lpRet);
LPMENUITEM MenuFindItemBySelKey(LPPOPUPMENU lppop, WORD key, WORD *lpRet);
BOOL ActivateMenuFocus(HWND hWnd);
BOOL ActivateMenuBarFocus(HWND hWnd);
BOOL MenuFocusLoop(HWND hWnd, LPPOPUPMENU lpmenu);
void PopupMenuCalcSize(HWND hwnd);
void MenuBarCalcSize(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop);
@ -87,6 +88,9 @@ LONG PopupMenuWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
hStdCheck = LoadBitmap((HANDLE)NULL, (LPSTR)OBM_CHECK);
if (hStdMnArrow == (HBITMAP)NULL)
hStdMnArrow = LoadBitmap((HANDLE)NULL, (LPSTR)OBM_MNARROW);
#ifdef DEBUG_MENU
printf("PopupMenu End of WM_CREATE !\n");
#endif
return 0;
case WM_DESTROY:
lppop = PopupMenuGetWindowAndStorage(hwnd, &wndPtr);
@ -137,6 +141,7 @@ LONG PopupMenuWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
#endif
if (lppop->SysFlag) MenuHasFocus = FALSE;
SetFocus(lppop->hWndPrev);
if (GetCapture() != 0) ReleaseCapture();
break;
}
lppop->FocusedItem = (WORD)-1;
@ -271,55 +276,61 @@ ProceedSPACE: lppop = PopupMenuGetWindowAndStorage(hwnd, &wndPtr);
printf("PopupMenuWndProc hWnd=%04X WM_CHAR wParam=%04X !\n", hwnd, wParam);
#endif
if (lParam < 0L) break;
hwnd = GetFocus();
lppop = PopupMenuGetWindowAndStorage(hwnd, &wndPtr);
if (lppop == NULL) break;
if (wParam == VK_ESCAPE) {
if (lppop->BarFlag) {
switch(wParam) {
case VK_ESCAPE:
if (lppop->BarFlag) {
#ifdef DEBUG_MENU
printf("VK_ESCAPE // Unselect all MenuBar's Items !\n");
printf("VK_ESCAPE // Unselect all MenuBar's Items !\n");
#endif
if (lppop->FocusedItem != (WORD)-1)
MenuItemSelect(hwnd, lppop, -1);
}
if (lppop->SysFlag) {
if (lppop->FocusedItem != (WORD)-1)
MenuItemSelect(hwnd, lppop, -1);
}
if (lppop->SysFlag) {
#ifdef DEBUG_MENU
printf("VK_ESCAPE // SysMenu !\n");
printf("VK_ESCAPE // SysMenu !\n");
#endif
ShowWindow(hwnd, SW_HIDE);
ShowWindow(hwnd, SW_HIDE);
break;
}
if (lppop->hWndParent != 0) {
#ifdef DEBUG_MENU
printf("VK_ESCAPE // Hide only SubPopup !\n");
#endif
lppop2 = PopupMenuGetWindowAndStorage(lppop->hWndParent, &wndPtr);
if (lppop2 == NULL) break;
HideAllSubPopupMenu(lppop2);
break;
}
else {
#ifdef DEBUG_MENU
printf("VK_ESCAPE // Hide Root Popup !\n");
#endif
ShowWindow(hwnd, SW_HIDE);
MenuHasFocus = FALSE;
}
break;
}
if (lppop->hWndParent != 0) {
#ifdef DEBUG_MENU
printf("VK_ESCAPE // Hide only SubPopup !\n");
#endif
lppop2 = PopupMenuGetWindowAndStorage(lppop->hWndParent, &wndPtr);
if (lppop2 == NULL) break;
HideAllSubPopupMenu(lppop2);
default:
if (wParam >= 'a' && wParam <= 'z') wParam -= 'a' - 'A';
lpitem = MenuFindItemBySelKey(lppop, wParam, &wRet);
if (lpitem != NULL) {
printf("ShortKey Found wRet=%d !\n", wRet);
MenuItemSelect(hwnd, lppop, wRet);
lppop->FocusedItem = wRet;
goto ProceedSPACE;
}
printf("ShortKey Not Found wParam=%04X wRet=%d lpitem=%08X !\n",
wParam, wRet, lpitem);
if (lppop->hWndParent != (HWND)NULL)
SendMessage(lppop->hWndParent, WM_MENUCHAR, wParam,
MAKELONG(0, 0));
else
SendMessage(lppop->ownerWnd, WM_MENUCHAR, wParam,
MAKELONG(0, 0));
break;
}
else {
#ifdef DEBUG_MENU
printf("VK_ESCAPE // Hide Root Popup !\n");
#endif
ShowWindow(hwnd, SW_HIDE);
MenuHasFocus = FALSE;
}
break;
}
if (wParam >= 'a' && wParam <= 'z') wParam -= 'a' - 'A';
lpitem = MenuFindItemBySelKey(lppop, wParam, &wRet);
if (lpitem != NULL) {
printf("Found wRet=%d !\n", wRet);
MenuItemSelect(hwnd, lppop, wRet);
lppop->FocusedItem = wRet;
goto ProceedSPACE;
}
if (lppop->hWndParent != (HWND)NULL)
SendMessage(lppop->hWndParent, WM_MENUCHAR, wParam,
MAKELONG(0, 0));
else
SendMessage(lppop->ownerWnd, WM_MENUCHAR, wParam,
MAKELONG(0, 0));
break;
case WM_PAINT:
#ifdef DEBUG_MENU
@ -352,7 +363,6 @@ BOOL ExecFocusedMenuItem(HWND hWnd, LPPOPUPMENU lppop)
lppop2 = (LPPOPUPMENU) GlobalLock(hSubMenu);
if (lppop2 == NULL) return FALSE;
lppop2->hWndParent = hWnd;
lppop2->hWndPrev = GetFocus();
GetClientRect(hWnd, &rect);
if (lppop->BarFlag) {
GetWindowRect(hWnd, &rect);
@ -398,9 +408,11 @@ BOOL MenuButtonDown(HWND hWnd, LPPOPUPMENU lppop, int x, int y)
LPPOPUPMENU lppop2;
if (lppop == NULL) return;
lpitem = MenuFindItem(lppop, x, y, &wRet);
printf("MenuButtonDown hWnd=%04X x=%d y=%d // wRet=%d lpitem=%08X !\n",
hWnd, x, y, wRet, lpitem);
#ifdef DEBUG_MENU
printf("MenuButtonDown // x=%d y=%d // wRet=%d lpitem=%08X !\n",
x, y, wRet, lpitem);
printf("MenuButtonDown hWnd=%04X x=%d y=%d // wRet=%d lpitem=%08X !\n",
hWnd, x, y, wRet, lpitem);
#endif
if (lpitem != NULL) {
MenuItemSelect(hWnd, lppop, wRet);
@ -409,7 +421,6 @@ BOOL MenuButtonDown(HWND hWnd, LPPOPUPMENU lppop, int x, int y)
lppop2 = (LPPOPUPMENU) GlobalLock(hSubMenu);
if (lppop2 == NULL) return;
lppop2->hWndParent = hWnd;
lppop2->hWndPrev = GetFocus();
if (lppop->BarFlag) {
GetWindowRect(hWnd, &rect);
y = rect.top + lppop->rect.bottom;
@ -517,7 +528,6 @@ void MenuMouseMove(HWND hWnd, LPPOPUPMENU lppop, WORD wParam, int x, int y)
}
if (lppop->BarFlag) {
lppop2->hWndParent = hWnd;
lppop2->hWndPrev = GetFocus();
GetWindowRect(hWnd, &rect);
rect.top += lppop->rect.bottom;
TrackPopupMenu(hSubMenu, TPM_LEFTBUTTON,
@ -534,7 +544,6 @@ void MenuMouseMove(HWND hWnd, LPPOPUPMENU lppop, WORD wParam, int x, int y)
void ResetHiliteFlags(LPPOPUPMENU lppop)
{
HDC hDC;
LPMENUITEM lpitem;
int i;
if (lppop == NULL) return;
@ -731,6 +740,7 @@ void StdDrawPopupMenu(HWND hwnd)
FillRect(hDC, &rect3, GetStockObject(BLACK_BRUSH));
InflateRect(&rect3, 0, -2);
rect3.left += lppop->CheckWidth;
hOldPen = SelectObject(hDC, GetStockObject(BLACK_PEN));
if ((x = GetShortCutPos(lpitem->item_text)) != (WORD)-1) {
DrawText(hDC, lpitem->item_text, x, &rect3,
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
@ -740,6 +750,7 @@ void StdDrawPopupMenu(HWND hwnd)
else
DrawText(hDC, lpitem->item_text, -1, &rect3,
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
SelectObject(hDC, hOldPen);
SetTextColor(hDC, OldTextColor);
SetBkMode(hDC, OldBkMode);
SelectObject(hDC, hOldFont);
@ -764,7 +775,8 @@ EndOfPaint:
void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
BOOL suppress_draw)
{
LPMENUITEM lpitem;
HBRUSH hBrush;
@ -782,7 +794,11 @@ void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
printf("StdDrawMenuBar(%04X, %08X, %08X); !\n", hDC, lprect, lppop);
#endif
MenuBarCalcSize(hDC, lprect, lppop);
if (suppress_draw)
return;
hOldFont = SelectObject(hDC, GetStockObject(SYSTEM_FONT));
hOldPen = SelectObject(hDC, GetStockObject(BLACK_PEN));
hBrush = GetStockObject(WHITE_BRUSH);
CopyRect(&rect, lprect);
FillRect(hDC, &rect, hBrush);
@ -850,6 +866,7 @@ void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
lpitem = (LPMENUITEM)lpitem->next;
}
EndOfPaint:
SelectObject(hDC, hOldPen);
SelectObject(hDC, hOldFont);
}
@ -886,12 +903,13 @@ LPMENUITEM MenuFindItemBySelKey(LPPOPUPMENU lppop, WORD key, WORD *lpRet)
LPMENUITEM lpitem;
UINT i;
if (lppop == NULL) return NULL;
if (lppop->nItems == 0) return NULL;
lpitem = lppop->firstItem;
for(i = 0; i < lppop->nItems; i++) {
if (lpitem == NULL) return NULL;
#ifdef DEBUG_MENUFINDITEM
printf("FindItemBySelKey // key=%d lpitem->sel_key=%d\n",
printf("FindItemBySelKey // key=%04X lpitem->sel_key=%04X\n",
key, lpitem->sel_key);
#endif
if (key == lpitem->sel_key) {
@ -1289,6 +1307,7 @@ BOOL InsertMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewIt
menu = (LPPOPUPMENU) GlobalLock(hMenu);
if (menu == NULL) return FALSE;
lpitem = FindMenuItem(hMenu, nPos, wFlags);
if (lpitem == NULL) lpitem = menu->firstItem;
hNewItem = GlobalAlloc(GMEM_MOVEABLE, sizeof(MENUITEM));
if (hNewItem == 0) {
GlobalUnlock(hMenu);
@ -1303,21 +1322,31 @@ BOOL InsertMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewIt
lpitem2->item_flags = wFlags;
lpitem2->item_id = wItemID;
if (!(wFlags & (MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
lpitem2->item_text = GlobalQuickAlloc(strlen(lpNewItem) + 1);
strcpy(lpitem2->item_text, lpNewItem);
MF_MENUBREAK | MF_SEPARATOR))) {
/* lpitem2->item_text = GlobalQuickAlloc(strlen(lpNewItem) + 1); */
lpitem2->item_text = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, strlen(lpNewItem) + 1));
if (lpitem2->item_text != NULL)
strcpy(lpitem2->item_text, lpNewItem);
else {
printf("InsertMenu // Bad Alloc !\n");
return FALSE;
}
lpitem2->sel_key = GetSelectionKey(lpitem2->item_text);
}
else {
lpitem2->item_text = lpNewItem;
}
lpitem2->prev = lpitem;
if (lpitem->next != NULL)
lpitem2->next = lpitem->next;
else
lpitem2->item_text = lpNewItem;
}
if (lpitem == NULL) {
menu->firstItem = lpitem2;
lpitem2->prev = NULL;
lpitem2->next = NULL;
lpitem->next = lpitem2;
}
else {
lpitem2->prev = lpitem;
lpitem2->next = lpitem->next;
if (lpitem2->next != NULL) lpitem2->next->prev = lpitem2;
lpitem->next = lpitem2;
}
lpitem2->child = NULL;
lpitem2->parent = NULL;
menu->nItems++;
@ -1338,10 +1367,10 @@ BOOL AppendMenu(HMENU hMenu, WORD wFlags, WORD wItemID, LPSTR lpNewItem)
#ifdef DEBUG_MENU
if ((wFlags & (MF_BITMAP | MF_SEPARATOR | MF_MENUBREAK | MF_OWNERDRAW)) == 0)
printf("AppendMenu (%04X, %04X, %04X, '%s') !\n",
hMenu, wFlags, wItemID, lpNewItem);
hMenu, wFlags, wItemID, lpNewItem);
else
printf("AppendMenu (%04X, %04X, %04X, %08X) !\n",
hMenu, wFlags, wItemID, lpNewItem);
hMenu, wFlags, wItemID, lpNewItem);
#endif
menu = (LPPOPUPMENU) GlobalLock(hMenu);
if (menu == NULL) return FALSE;
@ -1365,15 +1394,20 @@ BOOL AppendMenu(HMENU hMenu, WORD wFlags, WORD wItemID, LPSTR lpNewItem)
lpitem2->item_flags = wFlags;
lpitem2->item_id = wItemID;
if (!(wFlags & (MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
lpitem2->item_text = GlobalQuickAlloc(strlen(lpNewItem) + 1);
strcpy(lpitem2->item_text, lpNewItem);
MF_MENUBREAK | MF_SEPARATOR))) {
/* lpitem2->item_text = GlobalQuickAlloc(strlen(lpNewItem) + 1); */
lpitem2->item_text = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, strlen(lpNewItem) + 1));
if (lpitem2->item_text != NULL)
strcpy(lpitem2->item_text, lpNewItem);
else {
printf("AppendMenu // Bad Alloc !\n");
return FALSE;
}
lpitem2->sel_key = GetSelectionKey(lpitem2->item_text);
}
else {
lpitem2->item_text = lpNewItem;
}
lpitem2->item_text = lpNewItem;
}
if (lpitem == NULL)
menu->firstItem = lpitem2;
else
@ -1411,10 +1445,10 @@ BOOL RemoveMenu(HMENU hMenu, WORD nPos, WORD wFlags)
lpitem->prev->next = lpitem->next;
lpitem->next->prev = lpitem->prev;
if (!(lpitem->item_flags &
(MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
GlobalFree(lpitem->item_text);
}
(MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
GlobalFree((HANDLE)lpitem->item_text);
}
GlobalFree(lpitem);
GlobalUnlock(hMenu);
return TRUE;
@ -1433,42 +1467,34 @@ BOOL RemoveMenu(HMENU hMenu, WORD nPos, WORD wFlags)
*/
BOOL DeleteMenu(HMENU hMenu, WORD nPos, WORD wFlags)
{
LPPOPUPMENU menu;
LPMENUITEM lpitem;
int i;
LPPOPUPMENU menu;
LPMENUITEM lpitem;
int i;
#ifdef DEBUG_MENU
printf("DeleteMenu (%04X, %04X, %04X) !\n", hMenu, nPos, wFlags);
printf("DeleteMenu (%04X, %04X, %04X) !\n", hMenu, nPos, wFlags);
#endif
menu = (LPPOPUPMENU) GlobalLock(hMenu);
if (menu == NULL)
{
menu = (LPPOPUPMENU) GlobalLock(hMenu);
if (menu == NULL) {
GlobalUnlock(hMenu);
return FALSE;
}
lpitem = FindMenuItem(hMenu, nPos, wFlags);
if (lpitem != NULL) {
if ((lpitem->item_flags & MF_POPUP) == MF_POPUP)
DestroyMenu((HMENU)lpitem->item_id);
if (!(lpitem->item_flags &
(MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
GlobalFree((HANDLE)lpitem->item_text);
}
if (lpitem->prev) lpitem->prev->next = lpitem->next;
if (lpitem->next) lpitem->next->prev = lpitem->prev;
GlobalFree(lpitem);
GlobalUnlock(hMenu);
return TRUE;
}
GlobalUnlock(hMenu);
return FALSE;
}
lpitem = FindMenuItem(hMenu, nPos, wFlags);
if (lpitem != NULL)
{
if ((lpitem->item_flags & MF_POPUP) == MF_POPUP)
DestroyMenu((HMENU)lpitem->item_id);
if (!(lpitem->item_flags &
(MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR)))
{
GlobalFree(lpitem->item_text);
}
if (lpitem->prev)
lpitem->prev->next = lpitem->next;
if (lpitem->next)
lpitem->next->prev = lpitem->prev;
GlobalFree(lpitem);
GlobalUnlock(hMenu);
return TRUE;
}
GlobalUnlock(hMenu);
return FALSE;
}
@ -1477,37 +1503,42 @@ BOOL DeleteMenu(HMENU hMenu, WORD nPos, WORD wFlags)
*/
BOOL ModifyMenu(HMENU hMenu, WORD nPos, WORD wFlags, WORD wItemID, LPSTR lpNewItem)
{
WND *wndPtr;
LPPOPUPMENU menu;
LPMENUITEM lpitem;
int i;
WND *wndPtr;
LPPOPUPMENU menu;
LPMENUITEM lpitem;
int i;
#ifdef DEBUG_MENU
printf("ModifyMenu (%04X, %04X, %04X, %04X, %08X) !\n",
hMenu, nPos, wFlags, wItemID, lpNewItem);
printf("ModifyMenu (%04X, %04X, %04X, %04X, %08X) !\n",
hMenu, nPos, wFlags, wItemID, lpNewItem);
#endif
menu = (LPPOPUPMENU) GlobalLock(hMenu);
if (menu == NULL) return FALSE;
lpitem = menu->firstItem;
for (i = 0; i < menu->nItems; i++) {
if (lpitem == NULL) break;
if (i == nPos) {
lpitem->item_flags = wFlags;
lpitem->item_id = wItemID;
if (!(lpitem->item_flags &
(MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
lpitem->item_text = GlobalReAlloc(lpitem->item_text,
strlen(lpNewItem) + 1,
GLOBAL_FLAGS_MOVEABLE);
strcpy(lpitem->item_text, lpNewItem);
}
else
lpitem->item_text = lpNewItem;
GlobalUnlock(hMenu);
return(TRUE);
}
lpitem = (LPMENUITEM)lpitem->next;
}
menu = (LPPOPUPMENU) GlobalLock(hMenu);
if (menu == NULL) return FALSE;
lpitem = menu->firstItem;
for (i = 0; i < menu->nItems; i++) {
if (lpitem == NULL) break;
if (i == nPos) {
lpitem->item_flags = wFlags;
lpitem->item_id = wItemID;
if (!(lpitem->item_flags &
(MF_BITMAP | MF_OWNERDRAW | MF_MENUBARBREAK |
MF_MENUBREAK | MF_SEPARATOR))) {
GlobalFree((HANDLE)lpitem->item_text);
/* lpitem->item_text = GlobalQuickAlloc(strlen(lpNewItem) + 1); */
lpitem->item_text = GlobalLock(GlobalAlloc(GMEM_MOVEABLE, strlen(lpNewItem) + 1));
printf("ModifyMenu %08X %08X '%s') !\n",
lpitem->item_text, lpNewItem, lpNewItem);
if (lpitem->item_text != NULL)
strcpy(lpitem->item_text, lpNewItem);
else
printf("ModifyMenu // Bad Alloc !\n");
}
else
lpitem->item_text = lpNewItem;
GlobalUnlock(hMenu);
return(TRUE);
}
lpitem = (LPMENUITEM)lpitem->next;
}
GlobalUnlock(hMenu);
return FALSE;
}
@ -1561,13 +1592,25 @@ BOOL TrackPopupMenu(HMENU hMenu, WORD wFlags, short x, short y,
hMenu, wFlags, x, y, nReserved, hWnd, lpRect);
#endif
lppop = (LPPOPUPMENU) GlobalLock(hMenu);
if (lppop == NULL) return FALSE;
if (lppop == NULL) {
printf("TrackPopupMenu // Bad menu handle %04X !\n", hMenu);
return FALSE;
}
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
printf("TrackPopupMenu // Bad window handle %04X !\n", hWnd);
return FALSE;
}
lppop->ownerWnd = hWnd;
lppop->hWndPrev = GetFocus();
if (lppop->hWnd == (HWND)NULL) {
lppop->hWnd = CreateWindow("POPUPMENU", "", WS_POPUP | WS_VISIBLE,
x, y, lppop->Width, lppop->Height, (HWND)NULL, 0,
wndPtr->hInstance, (LPSTR)lppop);
if (lppop->hWnd == 0) {
printf("TrackPopupMenu // Can't create PopupMenu window !\n");
return FALSE;
}
}
else {
ShowWindow(lppop->hWnd, SW_SHOW);
@ -1581,12 +1624,12 @@ BOOL TrackPopupMenu(HMENU hMenu, WORD wFlags, short x, short y,
SetWindowPos(lppop->hWnd, 0, x, y, lppop->Width + 2, lppop->Height,
SWP_NOZORDER);
}
SetFocus(lppop->hWnd);
if (!MenuHasFocus) {
#ifdef DEBUG_MENU
printf("TrackPopupMenu // before MenuFocusLoop !\n");
#endif
MenuFocusLoop(hWnd, NULL);
/* ActivateMenuFocus(hWnd); */
#ifdef DEBUG_MENU
printf("TrackPopupMenu // after MenuFocusLoop !\n");
#endif
@ -1596,23 +1639,32 @@ BOOL TrackPopupMenu(HMENU hMenu, WORD wFlags, short x, short y,
}
BOOL ActivateMenuFocus(HWND hWnd)
BOOL ActivateMenuBarFocus(HWND hWnd)
{
WND *wndPtr;
LPPOPUPMENU lpmenu;
BOOL bRet;
MSG msg;
if (MenuHasFocus) return FALSE;
wndPtr = WIN_FindWndPtr(hWnd);
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) return FALSE;
#ifdef DEBUG_MENU
printf("ActivateMenuFocus (%04X) !\n", hWnd);
printf("ActivateMenuBarFocus (%04X) !\n", hWnd);
#endif
while((wndPtr->dwStyle & WS_CHILD) == WS_CHILD) {
hWnd = GetParent(hWnd);
printf("ActivateMenuBarFocus // next Parent=%04X !\n", hWnd);
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) return FALSE;
}
if ((wndPtr->dwStyle & WS_CHILD) == 0 && wndPtr->wIDmenu != 0) {
lpmenu = (LPPOPUPMENU) GlobalLock(wndPtr->wIDmenu);
if (lpmenu == NULL) return FALSE;
lpmenu->hWndPrev = GetFocus();
SetFocus(hWnd);
MenuItemSelect(hWnd, lpmenu, 0);
bRet = MenuFocusLoop(hWnd, lpmenu);
if (lpmenu != NULL) GlobalUnlock(wndPtr->wIDmenu);
GlobalUnlock(wndPtr->wIDmenu);
return bRet;
}
return FALSE;
@ -1688,7 +1740,6 @@ void NC_TrackSysMenu(HWND hWnd)
lpsys->hWndParent = hWnd;
if (!IsWindowVisible(lpsys->hWnd)) {
GetWindowRect(hWnd, &rect);
lpsys->hWndPrev = GetFocus();
#ifdef DEBUG_MENU
printf("NC_TrackSysMenu lpsys->hWnd=%04X !\n", lpsys->hWnd);
#endif
@ -1707,7 +1758,6 @@ void NC_TrackSysMenu(HWND hWnd)
printf("NC_TrackSysMenu // before MenuFocusLoop !\n");
#endif
MenuFocusLoop(hWnd, NULL);
/* ActivateMenuFocus(hWnd); */
#ifdef DEBUG_MENU
printf("NC_TrackSysMenu // after MenuFocusLoop !\n");
#endif
@ -1890,18 +1940,23 @@ HMENU GetMenu(HWND hWnd)
*/
BOOL SetMenu(HWND hWnd, HMENU hMenu)
{
LPPOPUPMENU lppop;
LPPOPUPMENU lpmenu;
WND * wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) return FALSE;
if (wndPtr == NULL) {
printf("SetMenu(%04X, %04X) // Bad window handle !\n", hWnd, hMenu);
return FALSE;
}
#ifdef DEBUG_MENU
printf("SetMenu(%04X, %04X);\n", hWnd, hMenu);
#endif
wndPtr->wIDmenu = hMenu;
if (hMenu == 0) return TRUE;
lppop = (LPPOPUPMENU) GlobalLock(hMenu);
if (lppop == NULL) return FALSE;
lppop->ownerWnd = hWnd;
ResetHiliteFlags(lppop);
lpmenu = (LPPOPUPMENU) GlobalLock(hMenu);
if (lpmenu == NULL) {
printf("SetMenu(%04X, %04X) // Bad menu handle !\n", hWnd, hMenu);
return FALSE;
}
lpmenu->ownerWnd = hWnd;
ResetHiliteFlags(lpmenu);
GlobalUnlock(hMenu);
return TRUE;
}
@ -1961,7 +2016,7 @@ void DrawMenuBar(HWND hWnd)
if (lppop == NULL) return;
if ((lppop->rect.bottom - lppop->rect.top) != 0) {
hDC = GetWindowDC(hWnd);
StdDrawMenuBar(hDC, &lppop->rect, lppop);
StdDrawMenuBar(hDC, &lppop->rect, lppop, FALSE);
ReleaseDC(hWnd, hDC);
}
else

View File

@ -16,6 +16,7 @@ LONG StaticWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG ListBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG ComboBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG EditWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG PopupMenuWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG MDIClientWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
@ -33,6 +34,8 @@ static WNDCLASS WIDGETS_BuiltinClasses[] =
0, 0, 0, 0, NULL, "LISTBOX" },
{ CS_GLOBALCLASS, (LONG(*)())ComboBoxWndProc, 0, 8,
0, 0, 0, 0, NULL, "COMBOBOX" },
{ CS_GLOBALCLASS, (LONG(*)())EditWndProc, 0, 2,
0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS, (LONG(*)())PopupMenuWndProc, 0, 8,
0, 0, 0, 0, NULL, "POPUPMENU" },
{ CS_GLOBALCLASS, (LONG(*)())DesktopWndProc, 0, sizeof(DESKTOPINFO),

File diff suppressed because it is too large Load Diff

83
debugger/break.c Normal file
View File

@ -0,0 +1,83 @@
#include <stdio.h>
#define N_BP 25
struct wine_bp{
unsigned long addr;
char in_use;
char enabled;
unsigned char databyte;
};
static struct wine_bp wbp[N_BP] = {{0,},};
void info_break()
{
int j;
fprintf(stderr,"Breakpoint status\n");
for(j=0; j<N_BP; j++)
if(wbp[j].in_use)
fprintf(stderr,"%d: %c %8.8x\n", j, (wbp[j].enabled ? 'y' : 'n'),
wbp[j].addr);
}
void disable_break(int bpnum)
{
if(bpnum >= N_BP || bpnum < 0)
fprintf(stderr,"Breakpoint number out of range\n");
wbp[bpnum].enabled = 0;
}
void enable_break(int bpnum)
{
if(bpnum >= N_BP || bpnum < 0)
fprintf(stderr,"Breakpoint number out of range\n");
wbp[bpnum].enabled = 1;
}
void add_break(unsigned long addr)
{
int j;
for(j=0; j<N_BP; j++)
if(!wbp[j].in_use)
{
wbp[j].in_use = 1;
wbp[j].enabled = 1;
wbp[j].addr = addr;
return;
}
fprintf(stderr,"No more breakpoints\n");
}
void insert_break(int flag)
{
unsigned char * pnt;
int j;
for(j=0; j<N_BP; j++)
if(wbp[j].enabled)
{
pnt = (unsigned char *) wbp[j].addr;
if(flag) {
wbp[j].databyte = *pnt;
*pnt = 0xcc; /* Change to an int 3 instruction */
} else {
*pnt = wbp[j].databyte;
}
}
}
/* Get the breakpoint number that we broke upon */
int get_bpnum(unsigned int addr)
{
int j;
for(j=0; j<N_BP; j++)
if(wbp[j].enabled)
if(wbp[j].addr == addr) return j;
return -1;
}

View File

@ -1,818 +0,0 @@
/* Basic, host-specific, and target-specific definitions for GDB.
Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (DEFS_H)
#define DEFS_H 1
#include <stdio.h>
/* First include ansidecl.h so we can use the various macro definitions
here and in all subsequent file inclusions. */
#include "ansidecl.h"
/* An address in the program being debugged. Host byte order. */
typedef unsigned int CORE_ADDR;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
/* The character C++ uses to build identifiers that must be unique from
the program's identifiers (such as $this and $$vptr). */
#define CPLUS_MARKER '$' /* May be overridden to '.' for SysV */
#include <errno.h> /* System call error return status */
extern int quit_flag;
extern int immediate_quit;
extern void
quit PARAMS ((void));
#define QUIT { if (quit_flag) quit (); }
/* Command classes are top-level categories into which commands are broken
down for "help" purposes.
Notes on classes: class_alias is for alias commands which are not
abbreviations of the original command. class-pseudo is for commands
which are not really commands nor help topics ("stop"). */
enum command_class
{
/* Special args to help_list */
all_classes = -2, all_commands = -1,
/* Classes of commands */
no_class = -1, class_run = 0, class_vars, class_stack,
class_files, class_support, class_info, class_breakpoint,
class_alias, class_obscure, class_user, class_maintenance,
class_pseudo
};
/* the cleanup list records things that have to be undone
if an error happens (descriptors to be closed, memory to be freed, etc.)
Each link in the chain records a function to call and an
argument to give it.
Use make_cleanup to add an element to the cleanup chain.
Use do_cleanups to do all cleanup actions back to a given
point in the chain. Use discard_cleanups to remove cleanups
from the chain back to a given point, not doing them. */
struct cleanup
{
struct cleanup *next;
void (*function) PARAMS ((PTR));
PTR arg;
};
/* From blockframe.c */
extern int
inside_entry_func PARAMS ((CORE_ADDR));
extern int
inside_entry_file PARAMS ((CORE_ADDR addr));
extern int
inside_main_func PARAMS ((CORE_ADDR pc));
/* From cplus-dem.c */
extern char *
cplus_demangle PARAMS ((const char *, int));
extern char *
cplus_mangle_opname PARAMS ((char *, int));
/* From libmmalloc.a (memory mapped malloc library) */
extern PTR
mmalloc_attach PARAMS ((int, PTR));
extern PTR
mmalloc_detach PARAMS ((PTR));
extern PTR
mmalloc PARAMS ((PTR, long));
extern PTR
mrealloc PARAMS ((PTR, PTR, long));
extern void
mfree PARAMS ((PTR, PTR));
extern int
mmalloc_setkey PARAMS ((PTR, int, PTR));
extern PTR
mmalloc_getkey PARAMS ((PTR, int));
/* From utils.c */
extern char *
demangle_and_match PARAMS ((const char *, const char *, int));
extern int
strcmp_iw PARAMS ((const char *, const char *));
extern char *
safe_strerror PARAMS ((int));
extern char *
safe_strsignal PARAMS ((int));
extern void
init_malloc PARAMS ((PTR));
extern void
request_quit PARAMS ((int));
extern void
do_cleanups PARAMS ((struct cleanup *));
extern void
discard_cleanups PARAMS ((struct cleanup *));
/* The bare make_cleanup function is one of those rare beasts that
takes almost any type of function as the first arg and anything that
will fit in a "void *" as the second arg.
Should be, once all calls and called-functions are cleaned up:
extern struct cleanup *
make_cleanup PARAMS ((void (*function) (PTR), PTR));
Until then, lint and/or various type-checking compiler options will
complain about make_cleanup calls. It'd be wrong to just cast things,
since the type actually passed when the function is called would be
wrong. */
extern struct cleanup *
make_cleanup ();
extern struct cleanup *
save_cleanups PARAMS ((void));
extern void
restore_cleanups PARAMS ((struct cleanup *));
extern void
free_current_contents PARAMS ((char **));
extern void
null_cleanup PARAMS ((char **));
extern int
myread PARAMS ((int, char *, int));
extern int
query ();
extern void
wrap_here PARAMS ((char *));
extern void
reinitialize_more_filter PARAMS ((void));
extern int
print_insn PARAMS ((CORE_ADDR, CORE_ADDR, FILE *, int));
extern void
fputs_filtered PARAMS ((const char *, FILE *));
extern void
puts_filtered PARAMS ((char *));
extern void
vfprintf_filtered ();
extern void
fprintf_filtered ();
extern void
fprintfi_filtered ();
extern void
printf_filtered ();
extern void
printfi_filtered ();
extern void
print_spaces PARAMS ((int, FILE *));
extern void
print_spaces_filtered PARAMS ((int, FILE *));
extern char *
n_spaces PARAMS ((int));
extern void
printchar PARAMS ((int, FILE *, int));
extern char *
strdup_demangled PARAMS ((const char *));
extern void
fprint_symbol PARAMS ((FILE *, char *));
extern void
fputs_demangled PARAMS ((char *, FILE *, int));
extern void
perror_with_name PARAMS ((char *));
extern void
print_sys_errmsg PARAMS ((char *, int));
/* From regex.c */
extern char *
re_comp PARAMS ((char *));
/* From symfile.c */
extern void
symbol_file_command PARAMS ((char *, int));
/* From main.c */
extern char *
skip_quoted PARAMS ((char *));
extern char *
gdb_readline PARAMS ((char *));
extern char *
command_line_input PARAMS ((char *, int));
extern void
print_prompt PARAMS ((void));
extern int
batch_mode PARAMS ((void));
extern int
input_from_terminal_p PARAMS ((void));
extern int
catch_errors PARAMS ((int (*) (char *), char *, char *));
/* From printcmd.c */
extern void
set_next_address PARAMS ((CORE_ADDR));
extern void
print_address_symbolic PARAMS ((CORE_ADDR, FILE *, int, char *));
extern void
print_address PARAMS ((CORE_ADDR, FILE *));
/* From source.c */
extern int
openp PARAMS ((char *, int, char *, int, int, char **));
extern void
mod_path PARAMS ((char *, char **));
extern void
directory_command PARAMS ((char *, int));
extern void
init_source_path PARAMS ((void));
/* From findvar.c */
extern int
read_relative_register_raw_bytes PARAMS ((int, char *));
/* From readline (but not in any readline .h files). */
extern char *
tilde_expand PARAMS ((char *));
/* Structure for saved commands lines
(for breakpoints, defined commands, etc). */
struct command_line
{
struct command_line *next;
char *line;
};
extern struct command_line *
read_command_lines PARAMS ((void));
extern void
free_command_lines PARAMS ((struct command_line **));
/* String containing the current directory (what getwd would return). */
extern char *current_directory;
/* Default radixes for input and output. Only some values supported. */
extern unsigned input_radix;
extern unsigned output_radix;
/* Baud rate specified for communication with serial target systems. */
extern char *baud_rate;
/* Languages represented in the symbol table and elsewhere. */
enum language
{
language_unknown, /* Language not known */
language_auto, /* Placeholder for automatic setting */
language_c, /* C */
language_cplus, /* C++ */
language_m2 /* Modula-2 */
};
/* Return a format string for printf that will print a number in the local
(language-specific) hexadecimal format. Result is static and is
overwritten by the next call. local_hex_format_custom takes printf
options like "08" or "l" (to produce e.g. %08x or %lx). */
#define local_hex_format() (current_language->la_hex_format)
extern char *
local_hex_format_custom PARAMS ((char *)); /* language.c */
/* Return a string that contains a number formatted in the local
(language-specific) hexadecimal format. Result is static and is
overwritten by the next call. local_hex_string_custom takes printf
options like "08" or "l". */
extern char *
local_hex_string PARAMS ((int)); /* language.c */
extern char *
local_hex_string_custom PARAMS ((int, char *)); /* language.c */
/* Host machine definition. This will be a symlink to one of the
xm-*.h files, built by the `configure' script. */
#include "xm.h"
/* If the xm.h file did not define the mode string used to open the
files, assume that binary files are opened the same way as text
files */
#ifndef FOPEN_RB
#include "fopen-same.h"
#endif
/*
* Allow things in gdb to be declared "const". If compiling ANSI, it
* just works. If compiling with gcc but non-ansi, redefine to __const__.
* If non-ansi, non-gcc, then eliminate "const" entirely, making those
* objects be read-write rather than read-only.
*/
#ifndef const
#ifndef __STDC__
# ifdef __GNUC__
# define const __const__
# else
# define const /*nothing*/
# endif /* GNUC */
#endif /* STDC */
#endif /* const */
#ifndef volatile
#ifndef __STDC__
# ifdef __GNUC__
# define volatile __volatile__
# else
# define volatile /*nothing*/
# endif /* GNUC */
#endif /* STDC */
#endif /* volatile */
/* Some compilers (many AT&T SVR4 compilers for instance), do not accept
declarations of functions that never return (exit for instance) as
"volatile void". For such compilers "NORETURN" can be defined away
to keep them happy */
#ifndef NORETURN
# ifdef __lucid
# define NORETURN /*nothing*/
# else
# define NORETURN volatile
# endif
#endif
/* Defaults for system-wide constants (if not defined by xm.h, we fake it). */
#if !defined (UINT_MAX)
#define UINT_MAX 0xffffffff
#endif
#if !defined (LONG_MAX)
#define LONG_MAX 0x7fffffff
#endif
#if !defined (INT_MAX)
#define INT_MAX 0x7fffffff
#endif
#if !defined (INT_MIN)
/* Two's complement, 32 bit. */
#define INT_MIN -0x80000000
#endif
/* Number of bits in a char or unsigned char for the target machine.
Just like CHAR_BIT in <limits.h> but describes the target machine. */
#if !defined (TARGET_CHAR_BIT)
#define TARGET_CHAR_BIT 8
#endif
/* Number of bits in a short or unsigned short for the target machine. */
#if !defined (TARGET_SHORT_BIT)
#define TARGET_SHORT_BIT (sizeof (short) * TARGET_CHAR_BIT)
#endif
/* Number of bits in an int or unsigned int for the target machine. */
#if !defined (TARGET_INT_BIT)
#define TARGET_INT_BIT (sizeof (int) * TARGET_CHAR_BIT)
#endif
/* Number of bits in a long or unsigned long for the target machine. */
#if !defined (TARGET_LONG_BIT)
#define TARGET_LONG_BIT (sizeof (long) * TARGET_CHAR_BIT)
#endif
/* Number of bits in a long long or unsigned long long for the target machine. */
#if !defined (TARGET_LONG_LONG_BIT)
#define TARGET_LONG_LONG_BIT (2 * TARGET_LONG_BIT)
#endif
/* Number of bits in a float for the target machine. */
#if !defined (TARGET_FLOAT_BIT)
#define TARGET_FLOAT_BIT (sizeof (float) * TARGET_CHAR_BIT)
#endif
/* Number of bits in a double for the target machine. */
#if !defined (TARGET_DOUBLE_BIT)
#define TARGET_DOUBLE_BIT (sizeof (double) * TARGET_CHAR_BIT)
#endif
/* Number of bits in a long double for the target machine. */
#if !defined (TARGET_LONG_DOUBLE_BIT)
#define TARGET_LONG_DOUBLE_BIT (2 * TARGET_DOUBLE_BIT)
#endif
/* Number of bits in a "complex" for the target machine. */
#if !defined (TARGET_COMPLEX_BIT)
#define TARGET_COMPLEX_BIT (2 * TARGET_FLOAT_BIT)
#endif
/* Number of bits in a "double complex" for the target machine. */
#if !defined (TARGET_DOUBLE_COMPLEX_BIT)
#define TARGET_DOUBLE_COMPLEX_BIT (2 * TARGET_DOUBLE_BIT)
#endif
/* Number of bits in a pointer for the target machine */
#if !defined (TARGET_PTR_BIT)
#define TARGET_PTR_BIT TARGET_INT_BIT
#endif
/* Convert a LONGEST to an int. This is used in contexts (e.g. number
of arguments to a function, number in a value history, register
number, etc.) where the value must not be larger than can fit
in an int. */
#if !defined (longest_to_int)
#if defined (LONG_LONG)
#define longest_to_int(x) (((x) > INT_MAX || (x) < INT_MIN) \
? (error ("Value out of range."),0) : (int) (x))
#else /* No LONG_LONG. */
/* Assume sizeof (int) == sizeof (long). */
#define longest_to_int(x) ((int) (x))
#endif /* No LONG_LONG. */
#endif /* No longest_to_int. */
/* This should not be a typedef, because "unsigned LONGEST" needs
to work. LONG_LONG is defined if the host has "long long". */
#ifndef LONGEST
# ifdef LONG_LONG
# define LONGEST long long
# else
# define LONGEST long
# endif
#endif
/* Assorted functions we can declare, now that const and volatile are
defined. */
extern char *
savestring PARAMS ((const char *, int));
extern char *
msavestring PARAMS ((void *, const char *, int));
extern char *
strsave PARAMS ((const char *));
extern char *
mstrsave PARAMS ((void *, const char *));
extern char *
concat PARAMS ((char *, ...));
extern PTR
xmalloc PARAMS ((long));
extern PTR
xrealloc PARAMS ((PTR, long));
extern PTR
xmmalloc PARAMS ((PTR, long));
extern PTR
xmrealloc PARAMS ((PTR, PTR, long));
extern PTR
mmalloc PARAMS ((PTR, long));
extern PTR
mrealloc PARAMS ((PTR, PTR, long));
extern void
mfree PARAMS ((PTR, PTR));
extern int
mmcheck PARAMS ((PTR, void (*) (void)));
extern int
mmtrace PARAMS ((void));
extern int
parse_escape PARAMS ((char **));
extern const char * const reg_names[];
extern NORETURN void /* Does not return to the caller. */
error ();
extern NORETURN void /* Does not return to the caller. */
fatal ();
extern NORETURN void /* Not specified as volatile in ... */
exit PARAMS ((int)); /* 4.10.4.3 */
extern NORETURN void /* Does not return to the caller. */
nomem PARAMS ((long));
extern NORETURN void /* Does not return to the caller. */
return_to_top_level PARAMS ((void));
extern void
warning_setup PARAMS ((void));
extern void
warning ();
/* Global functions from other, non-gdb GNU thingies (libiberty for
instance) */
extern char *
basename PARAMS ((char *));
extern char *
getenv PARAMS ((const char *));
extern char **
buildargv PARAMS ((char *));
extern void
freeargv PARAMS ((char **));
extern char *
strerrno PARAMS ((int));
extern char *
strsigno PARAMS ((int));
extern int
errno_max PARAMS ((void));
extern int
signo_max PARAMS ((void));
extern int
strtoerrno PARAMS ((char *));
extern int
strtosigno PARAMS ((char *));
extern char *
strsignal PARAMS ((int));
/* From other system libraries */
#ifndef PSIGNAL_IN_SIGNAL_H
extern void
psignal PARAMS ((unsigned, char *));
#endif
/* For now, we can't include <stdlib.h> because it conflicts with
"../include/getopt.h". (FIXME)
However, if a function is defined in the ANSI C standard and a prototype
for that function is defined and visible in any header file in an ANSI
conforming environment, then that prototype must match the definition in
the ANSI standard. So we can just duplicate them here without conflict,
since they must be the same in all conforming ANSI environments. If
these cause problems, then the environment is not ANSI conformant. */
#ifdef __STDC__
#include <stddef.h>
#endif
extern int
fclose PARAMS ((FILE *stream)); /* 4.9.5.1 */
extern void
perror PARAMS ((const char *)); /* 4.9.10.4 */
extern double
atof PARAMS ((const char *nptr)); /* 4.10.1.1 */
extern int
atoi PARAMS ((const char *)); /* 4.10.1.2 */
#ifndef MALLOC_INCOMPATIBLE
extern PTR
malloc PARAMS ((size_t size)); /* 4.10.3.3 */
extern PTR
realloc PARAMS ((void *ptr, size_t size)); /* 4.10.3.4 */
extern void
free PARAMS ((void *)); /* 4.10.3.2 */
#endif /* MALLOC_INCOMPATIBLE */
extern void
qsort PARAMS ((void *base, size_t nmemb, /* 4.10.5.2 */
size_t size,
int (*comp)(const void *, const void *)));
#ifndef MEM_FNS_DECLARED /* Some non-ANSI use void *, not char *. */
extern PTR
memcpy PARAMS ((void *, const void *, size_t)); /* 4.11.2.1 */
#endif
extern int
memcmp PARAMS ((const void *, const void *, size_t)); /* 4.11.4.1 */
extern char *
strchr PARAMS ((const char *, int)); /* 4.11.5.2 */
extern char *
strrchr PARAMS ((const char *, int)); /* 4.11.5.5 */
extern char *
strstr PARAMS ((const char *, const char *)); /* 4.11.5.7 */
extern char *
strtok PARAMS ((char *, const char *)); /* 4.11.5.8 */
#ifndef MEM_FNS_DECLARED /* Some non-ANSI use void *, not char *. */
extern PTR
memset PARAMS ((void *, int, size_t)); /* 4.11.6.1 */
#endif
extern char *
strerror PARAMS ((int)); /* 4.11.6.2 */
/* Various possibilities for alloca. */
#ifndef alloca
# ifdef __GNUC__
# define alloca __builtin_alloca
# else
# ifdef sparc
# include <alloca.h> /* NOTE: Doesn't declare alloca() */
# endif
# ifdef __STDC__
extern void *alloca (size_t);
# else /* __STDC__ */
extern char *alloca ();
# endif
# endif
#endif
/* TARGET_BYTE_ORDER and HOST_BYTE_ORDER must be defined to one of these. */
#if !defined (BIG_ENDIAN)
#define BIG_ENDIAN 4321
#endif
#if !defined (LITTLE_ENDIAN)
#define LITTLE_ENDIAN 1234
#endif
/* Target-system-dependent parameters for GDB.
The standard thing is to include defs.h. However, files that are
specific to a particular target can define TM_FILE_OVERRIDE before
including defs.h, then can include any particular tm-file they desire. */
/* Target machine definition. This will be a symlink to one of the
tm-*.h files, built by the `configure' script. */
#ifndef TM_FILE_OVERRIDE
#include "tm.h"
#endif
/* The bit byte-order has to do just with numbering of bits in
debugging symbols and such. Conceptually, it's quite separate
from byte/word byte order. */
#if !defined (BITS_BIG_ENDIAN)
#if TARGET_BYTE_ORDER == BIG_ENDIAN
#define BITS_BIG_ENDIAN 1
#endif /* Big endian. */
#if TARGET_BYTE_ORDER == LITTLE_ENDIAN
#define BITS_BIG_ENDIAN 0
#endif /* Little endian. */
#endif /* BITS_BIG_ENDIAN not defined. */
/* Swap LEN bytes at BUFFER between target and host byte-order. */
#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
#define SWAP_TARGET_AND_HOST(buffer,len)
#else /* Target and host byte order differ. */
#define SWAP_TARGET_AND_HOST(buffer,len) \
{ \
char tmp; \
char *p = (char *)(buffer); \
char *q = ((char *)(buffer)) + len - 1; \
for (; p < q; p++, q--) \
{ \
tmp = *q; \
*q = *p; \
*p = tmp; \
} \
}
#endif /* Target and host byte order differ. */
/* On some machines there are bits in addresses which are not really
part of the address, but are used by the kernel, the hardware, etc.
for special purposes. ADDR_BITS_REMOVE takes out any such bits
so we get a "real" address such as one would find in a symbol
table. ADDR_BITS_SET sets those bits the way the system wants
them. */
#if !defined (ADDR_BITS_REMOVE)
#define ADDR_BITS_REMOVE(addr) (addr)
#define ADDR_BITS_SET(addr) (addr)
#endif /* No ADDR_BITS_REMOVE. */
/* From valops.c */
extern CORE_ADDR
push_bytes PARAMS ((CORE_ADDR, char *, int));
/* In some modules, we don't have a definition of REGISTER_TYPE yet, so we
must avoid prototyping this function for now. FIXME. Should be:
extern CORE_ADDR
push_word PARAMS ((CORE_ADDR, REGISTER_TYPE));
*/
extern CORE_ADDR
push_word ();
/* Some parts of gdb might be considered optional, in the sense that they
are not essential for being able to build a working, usable debugger
for a specific environment. For example, the maintenance commands
are there for the benefit of gdb maintainers. As another example,
some environments really don't need gdb's that are able to read N
different object file formats. In order to make it possible (but
not necessarily recommended) to build "stripped down" versions of
gdb, the following defines control selective compilation of those
parts of gdb which can be safely left out when necessary. Note that
the default is to include everything. */
#ifndef MAINTENANCE_CMDS
#define MAINTENANCE_CMDS 1
#endif
#endif /* !defined (DEFS_H) */

View File

@ -1,27 +0,0 @@
/* Macros for the 'type' part of an fopen, freopen or fdopen.
<Read|Write>[Update]<Binary file|text file>
This version is for "same" systems, where text and binary files are
the same. An example is Unix. Many Unix systems could also add a
"b" to the string, indicating binary files, but some reject this
(and thereby don't conform to ANSI C, but what else is new?).
This file is designed for inclusion by host-dependent .h files. No
user application should include it directly, since that would make
the application unable to be configured for both "same" and "binary"
variant systems. */
#define FOPEN_RB "r"
#define FOPEN_WB "w"
#define FOPEN_AB "a"
#define FOPEN_RUB "r+"
#define FOPEN_WUB "w+"
#define FOPEN_AUB "a+"
#define FOPEN_RT "r"
#define FOPEN_WT "w"
#define FOPEN_AT "a"
#define FOPEN_RUT "r+"
#define FOPEN_WUT "w+"
#define FOPEN_AUT "a+"

View File

@ -1,119 +0,0 @@
/* Machine independent variables that describe the core file under GDB.
Copyright 1986, 1987, 1989, 1990, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Interface routines for core, executable, etc. */
#if !defined (GDBCORE_H)
#define GDBCORE_H 1
#include "bfd.h" /* Binary File Description */
/* Return the name of the executable file as a string.
ERR nonzero means get error if there is none specified;
otherwise return 0 in that case. */
extern char *
get_exec_file PARAMS ((int err));
/* Nonzero if there is a core file. */
extern int
have_core_file_p PARAMS ((void));
/* Read "memory data" from whatever target or inferior we have.
Returns zero if successful, errno value if not. EIO is used
for address out of bounds. If breakpoints are inserted, returns
shadow contents, not the breakpoints themselves. From breakpoint.c. */
extern int
read_memory_nobpt PARAMS ((CORE_ADDR memaddr, char *myaddr, unsigned len));
/* Report a memory error with error(). */
extern void
memory_error PARAMS ((int status, CORE_ADDR memaddr));
/* Like target_read_memory, but report an error if can't read. */
extern void
read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
/* Read an integer from debugged memory, given address and number of bytes. */
extern long
read_memory_integer PARAMS ((CORE_ADDR memaddr, int len));
/* If this is prototyped, need to deal with void* vs. char*. */
extern void
write_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
/* Hook for `exec_file_command' command to call. */
extern void (*exec_file_display_hook) PARAMS ((char *filename));
extern void
specify_exec_file_hook PARAMS ((void (*hook) (char *filename)));
/* Binary File Diddlers for the exec and core files */
extern bfd *core_bfd;
extern bfd *exec_bfd;
/* Whether to open exec and core files read-only or read-write. */
extern int write_files;
extern void
core_file_command PARAMS ((char *filename, int from_tty));
extern void
exec_file_command PARAMS ((char *filename, int from_tty));
extern void
validate_files PARAMS ((void));
extern unsigned int
register_addr PARAMS ((int regno, int blockend));
extern int
xfer_core_file PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
extern void
fetch_core_registers PARAMS ((char *core_reg_sect, unsigned core_reg_size,
int which, unsigned int reg_addr));
extern void
registers_fetched PARAMS ((void));
#if !defined (KERNEL_U_ADDR)
extern CORE_ADDR kernel_u_addr;
#define KERNEL_U_ADDR kernel_u_addr
#endif
/* The target vector for core files */
extern struct target_ops core_ops;
/* target vector functions called directly from elsewhere */
void
core_open PARAMS ((char *, int));
void
core_detach PARAMS ((char *, int));
#endif /* !defined (GDBCORE_H) */

View File

@ -0,0 +1,29 @@
#include "../../Wine.tmpl"
MODULE = opcodes
#ifdef i386
#define xi386 1
#undef i386
#endif
SRCS = \
dis-buf.c \
i386-dis.c
OBJS = \
dis-buf.o \
i386-dis.o
#ifdef xi386
#define i386 1
#undef xi386
#endif
WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
includes::
install::

View File

@ -1,5 +1,5 @@
/* ANSI and traditional C compatability macros
Copyright 1991 Free Software Foundation, Inc.
Copyright 1991, 1992 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@ -24,12 +24,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
----- ---- - ---------- ----------- - ----------
PTR `void *' `char *'
LONG_DOUBLE `long double' `double'
CONST `const' `'
VOLATILE `volatile' `'
SIGNED `signed' `'
PTRCONST `void *const' `char *'
ANSI_PROTOTYPES 1 not defined
DEFUN(name, arglist, args)
CONST is also defined, but is obsolete. Just use const.
DEFUN (name, arglist, args)
Defines function NAME.
@ -41,19 +43,38 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
be separated with `AND'. For functions with a variable number of
arguments, the last thing listed should be `DOTS'.
DEFUN_VOID(name)
DEFUN_VOID (name)
Defines a function NAME, which takes no arguments.
EXFUN(name, prototype)
obsolete -- EXFUN (name, (prototype)) -- obsolete.
Is used in an external function declaration.
In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in
Replaced by PARAMS. Do not use; will disappear someday soon.
Was used in external function declarations.
In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
parentheses). In traditional C it is `NAME()'.
For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'.
For a function that takes no arguments, PROTOTYPE should be `(void)'.
PARAMS ((args))
We could use the EXFUN macro to handle prototype declarations, but
the name is misleading and the result is ugly. So we just define a
simple macro to handle the parameter lists, as in:
static int foo PARAMS ((int, char));
This produces: `static int foo();' or `static int foo (int, char);'
EXFUN would have done it like this:
static int EXFUN (foo, (int, char));
but the function is not external...and it's hard to visually parse
the function name out of the mess. EXFUN should be considered
obsolete; new code should be written to use PARAMS.
For example:
extern int EXFUN(printf, (CONST char *format DOTS));
extern int printf PARAMS ((CONST char *format DOTS));
int DEFUN(fprintf, (stream, format),
FILE *stream AND CONST char *format DOTS) { ... }
void DEFUN_VOID(abort) { ... }
@ -69,7 +90,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* LINTLIBRARY */
#ifdef __STDC__
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4))
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
#define PTR void *
#define PTRCONST void *CONST
@ -84,24 +108,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define EXFUN(name, proto) name proto
#define DEFUN(name, arglist, args) name(args)
#define DEFUN_VOID(name) name(NOARGS)
#define DEFUN_VOID(name) name(void)
#define PROTO(type, name, arglist) type name arglist
/* We could use the EXFUN macro to handle prototypes, but
the name is misleading and the result is ugly. So just define a
simple macro to handle the parameter lists, as in:
static int foo PARAMS ((int, char));
EXFUN would do it like this:
static int EXFUN (foo, (int, char));
but the function is not external... EXFUN should be considered
obsolete, and new code written to use PARAMS. */
#define PARAMS(paramlist) paramlist
#define PROTO(type, name, arglist) type name arglist
#define PARAMS(paramlist) paramlist
#define ANSI_PROTOTYPES 1
#else /* Not ANSI C. */
@ -112,6 +123,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define AND ;
#define NOARGS
#define CONST
#ifndef const /* some systems define it in header files for non-ansi mode */
#define const
#endif
#define VOLATILE
#define SIGNED
#define DOTS

2171
debugger/opcodes/bfd.h Normal file

File diff suppressed because it is too large Load Diff

179
debugger/opcodes/dis-asm.h Normal file
View File

@ -0,0 +1,179 @@
/* Interface between the opcode library and its callers.
Written by Cygnus Support, 1993.
The opcode library (libopcodes.a) provides instruction decoders for
a large variety of instruction sets, callable with an identical
interface, for making instruction-processing programs more independent
of the instruction set being processed. */
#include <stdio.h>
#include "bfd.h"
typedef int (*fprintf_ftype) PARAMS((FILE*, const char*, ...));
enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */
dis_nonbranch, /* Not a branch instruction */
dis_branch, /* Unconditional branch */
dis_condbranch, /* Conditional branch */
dis_jsr, /* Jump to subroutine */
dis_condjsr, /* Conditional jump to subroutine */
dis_dref, /* Data reference instruction */
dis_dref2 /* Two data references in instruction */
};
/* This struct is passed into the instruction decoding routine,
and is passed back out into each callback. The various fields are used
for conveying information from your main routine into your callbacks,
for passing information into the instruction decoders (such as the
addresses of the callback functions), or for passing information
back from the instruction decoders to their callers.
It must be initialized before it is first passed; this can be done
by hand, or using one of the initialization macros below. */
typedef struct disassemble_info {
fprintf_ftype fprintf_func;
FILE *stream;
PTR application_data;
/* For use by the disassembler. */
int flags;
PTR private_data;
/* Function used to get bytes to disassemble. MEMADDR is the
address of the stuff to be disassembled, MYADDR is the address to
put the bytes in, and LENGTH is the number of bytes to read.
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length,
struct disassemble_info *info));
/* Function which should be called if we get an error that we can't
recover from. STATUS is the errno value from read_memory_func and
MEMADDR is the address that we were trying to read. INFO is a
pointer to this struct. */
void (*memory_error_func)
PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));
/* Function called to print ADDR. */
void (*print_address_func)
PARAMS ((bfd_vma addr, struct disassemble_info *info));
/* These are for buffer_read_memory. */
bfd_byte *buffer;
bfd_vma buffer_vma;
int buffer_length;
/* Results from instruction decoders. Not all decoders yet support
this information. This info is set each time an instruction is
decoded, and is only valid for the last such instruction.
To determine whether this decoder supports this information, set
insn_info_valid to 0, decode an instruction, then check it. */
char insn_info_valid; /* Branch info has been set. */
char branch_delay_insns; /* How many sequential insn's will run before
a branch takes effect. (0 = normal) */
char data_size; /* Size of data reference in insn, in bytes */
enum dis_insn_type insn_type; /* Type of instruction */
bfd_vma target; /* Target address of branch or dref, if known;
zero if unknown. */
bfd_vma target2; /* Second target address for dref2 */
} disassemble_info;
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of bytes processed. */
typedef int (*disassembler_ftype)
PARAMS((bfd_vma, disassemble_info *));
extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_mips PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i286 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i386 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_m68k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z8001 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z8002 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8300 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8300h PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8500 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_alpha PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_sparc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_big_a29k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_a29k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i960 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_sh PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_hppa PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_m88k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_big_powerpc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_powerpc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*));
/* Fetch the disassembler for a given BFD, if that support is available. */
extern disassembler_ftype disassembler PARAMS ((bfd *));
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
extern int buffer_read_memory
PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *));
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));
/* Just print the address is hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
extern void generic_print_address
PARAMS ((bfd_vma, struct disassemble_info *));
#define INIT_DISASSEMBLE_INFO(INFO, STREAM) \
(INFO).fprintf_func = (fprintf_ftype)fprintf, \
(INFO).stream = (STREAM), \
(INFO).buffer = NULL, \
(INFO).buffer_vma = 0, \
(INFO).buffer_length = 0, \
(INFO).read_memory_func = buffer_read_memory, \
(INFO).memory_error_func = perror_memory, \
(INFO).print_address_func = generic_print_address, \
(INFO).insn_info_valid = 0
/* This block of definitions is for calling the instruction decoders
from GDB. */
/* GDB--Like target_read_memory, but slightly different parameters. */
extern int
dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int len,
disassemble_info *info));
/* GDB--Like memory_error with slightly different parameters. */
extern void
dis_asm_memory_error
PARAMS ((int status, bfd_vma memaddr, disassemble_info *info));
/* GDB--Like print_address with slightly different parameters. */
extern void
dis_asm_print_address PARAMS ((bfd_vma addr, disassemble_info *info));
#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
(INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
(INFO).stream = (STREAM), \
(INFO).read_memory_func = dis_asm_read_memory, \
(INFO).memory_error_func = dis_asm_memory_error, \
(INFO).print_address_func = dis_asm_print_address, \
(INFO).insn_info_valid = 0

View File

@ -0,0 +1,178 @@
/* Interface between the opcode library and its callers.
Written by Cygnus Support, 1993.
The opcode library (libopcodes.a) provides instruction decoders for
a large variety of instruction sets, callable with an identical
interface, for making instruction-processing programs more independent
of the instruction set being processed. */
#include <stdio.h>
#include "bfd.h"
typedef int (*fprintf_ftype) PARAMS((FILE*, const char*, ...));
enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */
dis_nonbranch, /* Not a branch instruction */
dis_branch, /* Unconditional branch */
dis_condbranch, /* Conditional branch */
dis_jsr, /* Jump to subroutine */
dis_condjsr, /* Conditional jump to subroutine */
dis_dref, /* Data reference instruction */
dis_dref2 /* Two data references in instruction */
};
/* This struct is passed into the instruction decoding routine,
and is passed back out into each callback. The various fields are used
for conveying information from your main routine into your callbacks,
for passing information into the instruction decoders (such as the
addresses of the callback functions), or for passing information
back from the instruction decoders to their callers.
It must be initialized before it is first passed; this can be done
by hand, or using one of the initialization macros below. */
typedef struct disassemble_info {
fprintf_ftype fprintf_func;
FILE *stream;
PTR application_data;
/* For use by the disassembler. */
int flags;
PTR private_data;
/* Function used to get bytes to disassemble. MEMADDR is the
address of the stuff to be disassembled, MYADDR is the address to
put the bytes in, and LENGTH is the number of bytes to read.
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length,
struct disassemble_info *info));
/* Function which should be called if we get an error that we can't
recover from. STATUS is the errno value from read_memory_func and
MEMADDR is the address that we were trying to read. INFO is a
pointer to this struct. */
void (*memory_error_func)
PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));
/* Function called to print ADDR. */
void (*print_address_func)
PARAMS ((bfd_vma addr, struct disassemble_info *info));
/* These are for buffer_read_memory. */
bfd_byte *buffer;
bfd_vma buffer_vma;
int buffer_length;
/* Results from instruction decoders. Not all decoders yet support
this information. This info is set each time an instruction is
decoded, and is only valid for the last such instruction.
To determine whether this decoder supports this information, set
insn_info_valid to 0, decode an instruction, then check it. */
char insn_info_valid; /* Branch info has been set. */
char branch_delay_insns; /* How many sequential insn's will run before
a branch takes effect. (0 = normal) */
char data_size; /* Size of data reference in insn, in bytes */
enum dis_insn_type insn_type; /* Type of instruction */
bfd_vma target; /* Target address of branch or dref, if known;
zero if unknown. */
bfd_vma target2; /* Second target address for dref2 */
} disassemble_info;
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of bytes processed. */
typedef int (*disassembler_ftype)
PARAMS((bfd_vma, disassemble_info *));
extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_mips PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i386 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_m68k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z8001 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_z8002 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8300 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8300h PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_h8500 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_alpha PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_sparc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_big_a29k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_a29k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_i960 PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_sh PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_hppa PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_m88k PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_big_powerpc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_little_powerpc PARAMS ((bfd_vma, disassemble_info*));
extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*));
/* Fetch the disassembler for a given BFD, if that support is available. */
extern disassembler_ftype disassembler PARAMS ((bfd *));
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
extern int buffer_read_memory
PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *));
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));
/* Just print the address is hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
extern void generic_print_address
PARAMS ((bfd_vma, struct disassemble_info *));
#define INIT_DISASSEMBLE_INFO(INFO, STREAM) \
(INFO).fprintf_func = (fprintf_ftype)fprintf, \
(INFO).stream = (STREAM), \
(INFO).buffer = NULL, \
(INFO).buffer_vma = 0, \
(INFO).buffer_length = 0, \
(INFO).read_memory_func = buffer_read_memory, \
(INFO).memory_error_func = perror_memory, \
(INFO).print_address_func = generic_print_address, \
(INFO).insn_info_valid = 0
/* This block of definitions is for calling the instruction decoders
from GDB. */
/* GDB--Like target_read_memory, but slightly different parameters. */
extern int
dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int len,
disassemble_info *info));
/* GDB--Like memory_error with slightly different parameters. */
extern void
dis_asm_memory_error
PARAMS ((int status, bfd_vma memaddr, disassemble_info *info));
/* GDB--Like print_address with slightly different parameters. */
extern void
dis_asm_print_address PARAMS ((bfd_vma addr, disassemble_info *info));
#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
(INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
(INFO).stream = (STREAM), \
(INFO).read_memory_func = dis_asm_read_memory, \
(INFO).memory_error_func = dis_asm_memory_error, \
(INFO).print_address_func = dis_asm_print_address, \
(INFO).insn_info_valid = 0

View File

@ -0,0 +1,70 @@
/* Disassemble from a buffer, for GNU.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "dis-asm.h"
#include "sysdep.h"
#include <errno.h>
/* Get LENGTH bytes from info's buffer, at target address memaddr.
Transfer them to myaddr. */
int
buffer_read_memory (memaddr, myaddr, length, info)
bfd_vma memaddr;
bfd_byte *myaddr;
int length;
struct disassemble_info *info;
{
if (memaddr < info->buffer_vma
|| memaddr + length > info->buffer_vma + info->buffer_length)
/* Out of bounds. Use EIO because GDB uses it. */
return EIO;
memcpy (myaddr, info->buffer + (memaddr - info->buffer_vma), length);
return 0;
}
/* Print an error message. We can assume that this is in response to
an error return from buffer_read_memory. */
void
perror_memory (status, memaddr, info)
int status;
bfd_vma memaddr;
struct disassemble_info *info;
{
if (status != EIO)
/* Can't happen. */
(*info->fprintf_func) (info->stream, "Unknown error %d\n", status);
else
/* Actually, address between memaddr and memaddr + len was
out of bounds. */
(*info->fprintf_func) (info->stream,
"Address 0x%x is out of bounds.\n", memaddr);
}
/* This could be in a separate file, to save miniscule amounts of space
in statically linked executables. */
/* Just print the address is hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
void
generic_print_address (addr, info)
bfd_vma addr;
struct disassemble_info *info;
{
(*info->fprintf_func) (info->stream, "0x%x", addr);
}

2029
debugger/opcodes/i386-dis.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Print i386 instructions for GDB, the GNU debugger.
Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
Copyright (C) 1988, 1989, 1991, 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
@ -20,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
* July 1988
* modified by John Hassey (hassey@dg-rtp.dg.com)
*/
/*
@ -31,12 +32,51 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
* the Intel manual for details.
*/
#include "defs.h"
#include "dis-asm.h"
#include "sysdep.h"
#include <ctype.h>
#define MAXLEN 20
/* For the GDB interface at the bottom of the file... */
#include "gdbcore.h"
#include <setjmp.h>
struct dis_private
{
/* Points to first byte not fetched. */
bfd_byte *max_fetched;
bfd_byte the_buffer[MAXLEN];
bfd_vma insn_start;
jmp_buf bailout;
};
/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
to ADDR (exclusive) are valid. Returns 1 for success, longjmps
on error. */
#define FETCH_DATA(info, addr) \
((addr) <= ((struct dis_private *)(info->private_data))->max_fetched \
? 1 : fetch_data ((info), (addr)))
static int
fetch_data (info, addr)
struct disassemble_info *info;
bfd_byte *addr;
{
int status;
struct dis_private *priv = (struct dis_private *)info->private_data;
bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
status = (*info->read_memory_func) (start,
priv->max_fetched,
addr - priv->max_fetched,
info);
if (status != 0)
{
(*info->memory_error_func) (status, start, info);
longjmp (priv->bailout, 1);
}
else
priv->max_fetched = addr;
return 1;
}
#define Eb OP_E, b_mode
#define indirEb OP_indirE, b_mode
@ -376,8 +416,8 @@ struct dis386 dis386[] = {
{ "stosS", Yv, eAX },
{ "lodsb", AL, Xb },
{ "lodsS", eAX, Xv },
{ "scasb", AL, Xb },
{ "scasS", eAX, Xv },
{ "scasb", AL, Yb },
{ "scasS", eAX, Yv },
/* b0 */
{ "movb", AL, Ib },
{ "movb", CL, Ib },
@ -481,7 +521,9 @@ struct dis386 dis386_twobyte[] = {
{ "clts" },
{ "(bad)" },
/* 08 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "invd" },
{ "wbinvd" },
{ "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
/* 10 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
@ -587,8 +629,8 @@ struct dis386 dis386_twobyte[] = {
{ "(bad)" },
{ "imulS", Gv, Ev },
/* b0 */
{ "(bad)" },
{ "(bad)" },
{ "cmpxchgb", Eb, Gb },
{ "cmpxchgS", Ev, Gv },
{ "lssS", Gv, Mp }, /* 386 lists only Mp */
{ "btrS", Ev, Gv },
{ "lfsS", Gv, Mp }, /* 386 lists only Mp */
@ -605,11 +647,19 @@ struct dis386 dis386_twobyte[] = {
{ "movsbS", Gv, Eb },
{ "movswS", Gv, Ew },
/* c0 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "xaddb", Eb, Gb },
{ "xaddS", Ev, Gv },
{ "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
/* c8 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "bswap", eAX },
{ "bswap", eCX },
{ "bswap", eDX },
{ "bswap", eBX },
{ "bswap", eSP },
{ "bswap", eBP },
{ "bswap", eSI },
{ "bswap", eDI },
/* d0 */
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
@ -635,6 +685,7 @@ static char *obufp;
static char scratchbuf[100];
static unsigned char *start_codep;
static unsigned char *codep;
static disassemble_info *the_info;
static int mod;
static int rm;
static int reg;
@ -817,7 +868,7 @@ struct dis386 grps[][8] = {
{ "smsw", Ew },
{ "(bad)" },
{ "lmsw", Ew },
{ "(bad)" },
{ "invlpg", Ew },
},
/* GRP8 */
{
@ -853,6 +904,7 @@ ckprefix ()
prefixes = 0;
while (1)
{
FETCH_DATA (the_info, codep + 1);
switch (*codep)
{
case 0xf3:
@ -904,27 +956,21 @@ static int aflag;
static char op1out[100], op2out[100], op3out[100];
static int op_address[3], op_ad, op_index[3];
static int start_pc;
extern void fputs_filtered ();
/*
* disassemble the first instruction in 'inbuf'. You have to make
* sure all of the bytes of the instruction are filled in.
* On the 386's of 1988, the maximum length of an instruction is 15 bytes.
* (see topic "Redundant prefixes" in the "Differences from 8086"
* section of the "Virtual 8086 Mode" chapter.)
* 'pc' should be the address of this instruction, it will
* be used to print the target address if this is a relative jump or call
* 'outbuf' gets filled in with the disassembled instruction. it should
* be long enough to hold the longest disassembled instruction.
* 100 bytes is certainly enough, unless symbol printing is added later
* The function returns the length of this instruction in bytes.
*/
int
i386dis (pc, inbuf, stream)
int pc;
unsigned char *inbuf;
FILE *stream;
print_insn_i386 (pc, info)
bfd_vma pc;
disassemble_info *info;
{
struct dis386 *dp;
int i;
@ -932,19 +978,31 @@ i386dis (pc, inbuf, stream)
char *first, *second, *third;
int needcomma;
struct dis_private priv;
bfd_byte *inbuf = priv.the_buffer;
info->private_data = (PTR) &priv;
priv.max_fetched = priv.the_buffer;
priv.insn_start = pc;
if (setjmp (priv.bailout) != 0)
/* Error return. */
return -1;
obuf[0] = 0;
op1out[0] = 0;
op2out[0] = 0;
op3out[0] = 0;
op_index[0] = op_index[1] = op_index[2] = -1;
the_info = info;
start_pc = pc;
start_codep = inbuf;
codep = inbuf;
ckprefix ();
FETCH_DATA (info, codep + 1);
if (*codep == 0xc8)
enter_instruction = 1;
else
@ -963,12 +1021,14 @@ i386dis (pc, inbuf, stream)
&& ((*codep < 0xd8) || (*codep > 0xdf)))
{
/* fwait not followed by floating point instruction */
fputs_filtered ("fwait", stream);
(*info->fprintf_func) (info->stream, "fwait");
return (1);
}
/* these would be initialized to 0 if disassembling for 8086 or 286 */
dflag = 1;
aflag = 1;
if (prefixes & PREFIX_DATA)
dflag ^= 1;
@ -979,14 +1039,24 @@ i386dis (pc, inbuf, stream)
}
if (*codep == 0x0f)
dp = &dis386_twobyte[*++codep];
{
FETCH_DATA (info, codep + 2);
dp = &dis386_twobyte[*++codep];
}
else
dp = &dis386[*codep];
codep++;
/* Fetch the mod/reg/rm byte. FIXME: We should be only fetching
this if we need it. As it is, this code loses if there is a
one-byte instruction (without a mod/reg/rm byte) at the end of
the address space. */
FETCH_DATA (info, codep + 1);
mod = (*codep >> 6) & 3;
reg = (*codep >> 3) & 7;
rm = *codep & 7;
if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
{
dofloat ();
@ -1018,7 +1088,7 @@ i386dis (pc, inbuf, stream)
for (i = strlen (obuf); i < 6; i++)
oappend (" ");
oappend (" ");
fputs_filtered (obuf, stream);
(*info->fprintf_func) (info->stream, "%s", obuf);
/* enter instruction is printed with operands in the
* same order as the intel book; everything else
@ -1043,29 +1113,29 @@ i386dis (pc, inbuf, stream)
if (*first)
{
if (op_index[0] != -1)
print_address (op_address[op_index[0]], stream);
(*info->print_address_func) (op_address[op_index[0]], info);
else
fputs_filtered (first, stream);
(*info->fprintf_func) (info->stream, "%s", first);
needcomma = 1;
}
if (*second)
{
if (needcomma)
fputs_filtered (",", stream);
(*info->fprintf_func) (info->stream, ",");
if (op_index[1] != -1)
print_address (op_address[op_index[1]], stream);
(*info->print_address_func) (op_address[op_index[1]], info);
else
fputs_filtered (second, stream);
(*info->fprintf_func) (info->stream, "%s", second);
needcomma = 1;
}
if (*third)
{
if (needcomma)
fputs_filtered (",", stream);
(*info->fprintf_func) (info->stream, ",");
if (op_index[2] != -1)
print_address (op_address[op_index[2]], stream);
(*info->print_address_func) (op_address[op_index[2]], info);
else
fputs_filtered (third, stream);
(*info->fprintf_func) (info->stream, "%s", third);
}
return (codep - inbuf);
}
@ -1321,7 +1391,9 @@ dofloat ()
{
putop (fgrps[dp->bytemode1][rm]);
/* instruction fnstsw is only one with strange arg */
if (floatop == 0xdf && *codep == 0xe0)
if (floatop == 0xdf
&& FETCH_DATA (the_info, codep + 1)
&& *codep == 0xe0)
strcpy (op1out, "%eax");
}
else
@ -1467,61 +1539,11 @@ OP_E (bytemode)
}
append_prefix ();
if (bytemode == w_mode || (bytemode == v_mode && !dflag))
{
if (mod == 0 && rm == 6)
{
sprintf(scratchbuf, "%04.4x", get16());
oappend(scratchbuf);
return 0;
}
disp = 0;
if (mod == 1)
disp = *(char *)codep++;
else if (mod == 2)
disp = get16();
if (disp != 0)
{
sprintf(scratchbuf, "0x%x", disp);
oappend(scratchbuf);
}
switch (rm)
{
case 0:
oappend("(%bx,%si)");
break;
case 1:
oappend("(%bx,%di)");
break;
case 2:
oappend("(%bp,%si)");
break;
case 3:
oappend("(%bp,%di)");
break;
case 4:
oappend("(%si)");
break;
case 5:
oappend("(%di)");
break;
case 6:
oappend("(%bp)");
break;
case 7:
oappend("(%bx)");
break;
}
return 0;
}
if (rm == 4)
{
havesib = 1;
havebase = 1;
FETCH_DATA (the_info, codep + 1);
scale = (*codep >> 6) & 3;
index = (*codep >> 3) & 7;
base = *codep & 7;
@ -1550,6 +1572,7 @@ OP_E (bytemode)
}
break;
case 1:
FETCH_DATA (the_info, codep + 1);
disp = *(char *)codep++;
if (rm != 4)
{
@ -1625,7 +1648,8 @@ static int
get32 ()
{
int x = 0;
FETCH_DATA (the_info, codep + 4);
x = *codep++ & 0xff;
x |= (*codep++ & 0xff) << 8;
x |= (*codep++ & 0xff) << 16;
@ -1637,7 +1661,8 @@ static int
get16 ()
{
int x = 0;
FETCH_DATA (the_info, codep + 2);
x = *codep++ & 0xff;
x |= (*codep++ & 0xff) << 8;
return (x);
@ -1696,6 +1721,7 @@ OP_I (bytemode)
switch (bytemode)
{
case b_mode:
FETCH_DATA (the_info, codep + 1);
op = *codep++ & 0xff;
break;
case v_mode:
@ -1725,6 +1751,7 @@ OP_sI (bytemode)
switch (bytemode)
{
case b_mode:
FETCH_DATA (the_info, codep + 1);
op = *(char *)codep++;
break;
case v_mode:
@ -1755,6 +1782,7 @@ OP_J (bytemode)
switch (bytemode)
{
case b_mode:
FETCH_DATA (the_info, codep + 1);
disp = *(char *)codep++;
break;
case v_mode:
@ -1929,28 +1957,3 @@ OP_rm (bytemode)
}
return (0);
}
#define MAXLEN 20
int
print_insn (realmemaddr, memaddr, stream, addrlen)
CORE_ADDR memaddr, realmemaddr;
FILE *stream;
int addrlen;
{
unsigned char buffer[MAXLEN];
if(addrlen == 32){
dflag = 1;
aflag = 1;
} else {
dflag = 0;
aflag = 0;
};
read_memory (memaddr, (char *) buffer, MAXLEN);
return (i386dis ((int)realmemaddr, buffer, stream));
}

View File

@ -1,17 +1,17 @@
/* obstack.h - object stack macros
Copyright (C) 1988 Free Software Foundation, Inc.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
under the terms of the GNU Library General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU Library General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
@ -41,7 +41,7 @@ as the first argument.
One motivation for this package is the problem of growing char strings
in symbol tables. Unless you are "fascist pig with a read-only mind"
[Gosper's immortal quote from HAKMEM item 154, out of context] you
--Gosper's immortal quote from HAKMEM item 154, out of context--you
would not like to put any arbitrary upper limit on the length of your
symbols.
@ -92,7 +92,7 @@ Summary:
Exactly one object is growing in an obstack at any one time.
You can run one obstack per control block.
You may have as many control blocks as you dare.
Because of the way we do it, you can `unwind' a obstack
Because of the way we do it, you can `unwind' an obstack
back to a previous state. (You may remove objects much
as you would with a stack.)
*/
@ -100,8 +100,8 @@ Summary:
/* Don't do the contents of this file more than once. */
#ifndef __OBSTACKS__
#define __OBSTACKS__
#ifndef __OBSTACK_H__
#define __OBSTACK_H__
/* We use subtraction of (char *)0 instead of casting to int
because on word-addressable machines a simple cast to int
@ -115,6 +115,29 @@ Summary:
#define __INT_TO_PTR(P) ((P) + (char *)0)
#endif
/* We need the type of the resulting object. In ANSI C it is ptrdiff_t
but in traditional C it is usually long. If we are in ANSI C and
don't already have ptrdiff_t get it. */
#if defined (__STDC__) && ! defined (offsetof)
#if defined (__GNUC__) && defined (IN_GCC)
/* On Next machine, the system's stddef.h screws up if included
after we have defined just ptrdiff_t, so include all of stddef.h.
Otherwise, define just ptrdiff_t, which is all we need. */
#ifndef __NeXT__
#define __need_ptrdiff_t
#endif
#endif
#include <stddef.h>
#endif
#ifdef __STDC__
#define PTR_INT_TYPE ptrdiff_t
#else
#define PTR_INT_TYPE long
#endif
struct _obstack_chunk /* Lives at front of each chunk. */
{
char *limit; /* 1 past end of this chunk */
@ -129,39 +152,33 @@ struct obstack /* control current object in current chunk */
char *object_base; /* address of object we are building */
char *next_free; /* where to add next char to current object */
char *chunk_limit; /* address of char after current chunk */
int temp; /* Temporary for some macros. */
PTR_INT_TYPE temp; /* Temporary for some macros. */
int alignment_mask; /* Mask of alignment for each object. */
struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
void (*freefun) (); /* User's function to free a chunk. */
void *area_id; /* Select which region to alloc/free in */
int flags; /* Miscellaneous special purpose flags */
char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
unsigned maybe_empty_object:1;/* There is a possibility that the current
chunk contains a zero-length object. This
prevents freeing the chunk if we allocate
a bigger chunk to replace it. */
unsigned alloc_failed:1; /* chunk alloc func returned 0 */
};
/* Declare bits for flags word. */
/* Means there is a possibility the current chunk contains a zero-length
object. This prevents freeing the chunk if we allocate a bigger chunk
to replace it. */
#define OBSTACK_MAYBE_EMPTY_OBJECT (1 << 0)
/* Means that the allocation and deallocation functions take two arguments,
ala the mmalloc package. The first argument is a generic pointer that
is saved in the area_id member of the obstack struct. */
#define OBSTACK_MMALLOC_LIKE (1 << 1)
/* Declare the external functions we use; they are in obstack.c. */
#ifdef __STDC__
extern void _obstack_newchunk (struct obstack *, int);
extern void _obstack_free (struct obstack *, void *);
extern void _obstack_begin (struct obstack *, int, int,
void *(*) (int), void (*) (int), void *, int);
extern void _obstack_newchunk (struct obstack *, int);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *, int, int,
void *(*) (), void (*) ());
extern int _obstack_begin_1 (struct obstack *, int, int,
void *(*) (), void (*) (), void *);
#else
extern void _obstack_newchunk ();
extern void _obstack_free ();
extern void _obstack_begin ();
extern void _obstack_newchunk ();
extern void _obstack_free ();
extern int _obstack_begin ();
extern int _obstack_begin_1 ();
#endif
#ifdef __STDC__
@ -211,7 +228,7 @@ int obstack_chunk_size (struct obstack *obstack);
Note that this might not be the final address of the object
because a new chunk might be needed to hold the final size. */
#define obstack_base(h) ((h)->object_base)
#define obstack_base(h) ((h)->alloc_failed ? 0 : (h)->object_base)
/* Size for allocating ordinary chunks. */
@ -219,7 +236,7 @@ int obstack_chunk_size (struct obstack *obstack);
/* Pointer to next byte not yet allocated in current chunk. */
#define obstack_next_free(h) ((h)->next_free)
#define obstack_next_free(h) ((h)->alloc_failed ? 0 : (h)->next_free)
/* Mask specifying low bits that should be clear in address of an object. */
@ -227,16 +244,19 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) ()) obstack_chunk_alloc, (void (*) ())obstack_chunk_free, (void *) 0, 0)
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
#define obstack_begin(h, size) \
_obstack_begin ((h), (size), 0, \
(void *(*) ()) obstack_chunk_alloc, (void (*) ())obstack_chunk_free, (void *) 0, 0)
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
#define obstack_full_begin(h,size,alignment,chunkfun,freefun,area_id,flags) \
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
_obstack_begin ((h), (size), (alignment), \
(void *(*) ()) (chunkfun), (void (*) ()) (freefun), \
(area_id), (flags))
(void *(*) ()) (chunkfun), (void (*) ()) (freefun))
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
(void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
@ -261,6 +281,7 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_object_size(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
__o->alloc_failed ? 0 : \
(unsigned) (__o->next_free - __o->object_base); })
#define obstack_room(OBSTACK) \
@ -268,38 +289,40 @@ int obstack_chunk_size (struct obstack *obstack);
({ struct obstack *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
so that we can avoid having void expressions
in the arms of the conditional expression.
Casting the third operand to void was tried before,
but some compilers won't accept it. */
#define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
((__o->next_free + __len > __o->chunk_limit) \
? (_obstack_newchunk (__o, __len), 0) : 0); \
bcopy (where, __o->next_free, __len); \
__o->next_free += __len; \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
if (!__o->alloc_failed) \
{ \
bcopy (where, __o->next_free, __len); \
__o->next_free += __len; \
} \
(void) 0; })
#define obstack_grow0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
((__o->next_free + __len + 1 > __o->chunk_limit) \
? (_obstack_newchunk (__o, __len + 1), 0) : 0), \
bcopy (where, __o->next_free, __len), \
__o->next_free += __len, \
*(__o->next_free)++ = 0; \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
if (!__o->alloc_failed) \
{ \
bcopy (where, __o->next_free, __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
} \
(void) 0; })
#define obstack_1grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
((__o->next_free + 1 > __o->chunk_limit) \
? (_obstack_newchunk (__o, 1), 0) : 0), \
*(__o->next_free)++ = (datum); \
if (__o->next_free + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, 1); \
if (!__o->alloc_failed) \
*(__o->next_free)++ = (datum); \
(void) 0; })
/* These assume that the obstack alignment is good enough for pointers or ints,
@ -309,29 +332,32 @@ __extension__ \
#define obstack_ptr_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
((__o->next_free + sizeof (void *) > __o->chunk_limit) \
? (_obstack_newchunk (__o, sizeof (void *)), 0) : 0), \
*(*(void ***)&__o->next_free)++ = ((void *)datum); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
if (!__o->alloc_failed) \
*((void **)__o->next_free)++ = ((void *)datum); \
(void) 0; })
#define obstack_int_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
((__o->next_free + sizeof (int) > __o->chunk_limit) \
? (_obstack_newchunk (__o, sizeof (int)), 0) : 0), \
*(*(int **)&__o->next_free)++ = ((int)datum); \
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (int)); \
if (!__o->alloc_failed) \
*((int *)__o->next_free)++ = ((int)datum); \
(void) 0; })
#define obstack_ptr_grow_fast(h,aptr) (*(*(void ***)&(h)->next_free)++ = (void *)aptr)
#define obstack_int_grow_fast(h,aint) (*(*(int **)&(h)->next_free)++ = (int)aint)
#define obstack_ptr_grow_fast(h,aptr) (*((void **)(h)->next_free)++ = (void *)aptr)
#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint)
#define obstack_blank(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
((__o->chunk_limit - __o->next_free < __len) \
? (_obstack_newchunk (__o, __len), 0) : 0); \
__o->next_free += __len; \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
if (!__o->alloc_failed) \
__o->next_free += __len; \
(void) 0; })
#define obstack_alloc(OBSTACK,length) \
@ -357,16 +383,22 @@ __extension__ \
#define obstack_finish(OBSTACK) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
void *value = (void *) __o1->object_base; \
if (__o1->next_free == value) \
__o1->flags |= OBSTACK_MAYBE_EMPTY_OBJECT; \
__o1->next_free \
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
& ~ (__o1->alignment_mask)); \
((__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
? (__o1->next_free = __o1->chunk_limit) : 0); \
__o1->object_base = __o1->next_free; \
void *value; \
if (__o1->alloc_failed) \
value = 0; \
else \
{ \
value = (void *) __o1->object_base; \
if (__o1->next_free == value) \
__o1->maybe_empty_object = 1; \
__o1->next_free \
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
& ~ (__o1->alignment_mask)); \
if (__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
__o1->next_free = __o1->chunk_limit; \
__o1->object_base = __o1->next_free; \
} \
value; })
#define obstack_free(OBSTACK, OBJ) \
@ -380,48 +412,61 @@ __extension__ \
#else /* not __GNUC__ or not __STDC__ */
#define obstack_object_size(h) \
(unsigned) ((h)->next_free - (h)->object_base)
(unsigned) ((h)->alloc_failed ? 0 : (h)->next_free - (h)->object_base)
#define obstack_room(h) \
(unsigned) ((h)->chunk_limit - (h)->next_free)
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
so that we can avoid having void expressions
in the arms of the conditional expression.
Casting the third operand to void was tried before,
but some compilers won't accept it. */
#define obstack_grow(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
bcopy (where, (h)->next_free, (h)->temp), \
(h)->next_free += (h)->temp)
((h)->alloc_failed ? 0 : \
(bcopy (where, (h)->next_free, (h)->temp), \
(h)->next_free += (h)->temp)))
#define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
bcopy (where, (h)->next_free, (h)->temp), \
((h)->alloc_failed ? 0 : \
(bcopy (where, (h)->next_free, (h)->temp), \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)
*((h)->next_free)++ = 0)))
#define obstack_1grow(h,datum) \
( (((h)->next_free + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), 1), 0) : 0), \
*((h)->next_free)++ = (datum))
((h)->alloc_failed ? 0 : \
(*((h)->next_free)++ = (datum))))
#define obstack_ptr_grow(h,datum) \
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
*(*(char ***)&(h)->next_free)++ = ((char *)datum))
((h)->alloc_failed ? 0 : \
(*((char **)(((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *)datum))))
#define obstack_int_grow(h,datum) \
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
*(*(int **)&(h)->next_free)++ = ((int)datum))
((h)->alloc_failed ? 0 : \
(*((int *)(((h)->next_free+=sizeof(int))-sizeof(int))) = ((int)datum))))
#define obstack_ptr_grow_fast(h,aptr) (*((char **)(h)->next_free)++ = (char *)aptr)
#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint)
#define obstack_ptr_grow_fast(h,aptr) (*(*(char ***)&(h)->next_free)++ = (char *)aptr)
#define obstack_int_grow_fast(h,aint) (*(*(int **)&(h)->next_free)++ = (int)aint)
#define obstack_blank(h,length) \
( (h)->temp = (length), \
(((h)->chunk_limit - (h)->next_free < (h)->temp) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
(h)->next_free += (h)->temp)
((h)->alloc_failed ? 0 : \
((h)->next_free += (h)->temp)))
#define obstack_alloc(h,length) \
(obstack_blank ((h), (length)), obstack_finish ((h)))
@ -433,8 +478,9 @@ __extension__ \
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
#define obstack_finish(h) \
( ((h)->next_free == (h)->object_base \
? (((h)->flags |= OBSTACK_MAYBE_EMPTY_OBJECT), 0) \
( (h)->alloc_failed ? 0 : \
(((h)->next_free == (h)->object_base \
? (((h)->maybe_empty_object = 1), 0) \
: 0), \
(h)->temp = __PTR_TO_INT ((h)->object_base), \
(h)->next_free \
@ -444,7 +490,7 @@ __extension__ \
> (h)->chunk_limit - (char *)(h)->chunk) \
? ((h)->next_free = (h)->chunk_limit) : 0), \
(h)->object_base = (h)->next_free, \
__INT_TO_PTR ((h)->temp))
__INT_TO_PTR ((h)->temp)))
#ifdef __STDC__
#define obstack_free(h,obj) \
@ -464,4 +510,4 @@ __extension__ \
#endif /* not __GNUC__ or not __STDC__ */
#endif /* not __OBSTACKS__ */
#endif /* not __OBSTACK_H__ */

View File

@ -1,324 +0,0 @@
/* Macro definitions for i386, Unix System V.
Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (TM_I386V_H)
#define TM_I386V_H 1
/*
* Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
* July 1988
*/
#define TARGET_BYTE_ORDER LITTLE_ENDIAN
/* define this if you don't have the extension to coff that allows
* file names to appear in the string table
* (aux.x_file.x_foff)
*/
#define COFF_NO_LONG_FILE_NAMES
/* turn this on when rest of gdb is ready */
#define IEEE_FLOAT
/* Define this if the C compiler puts an underscore at the front
of external names before giving them to the linker. */
/* #define NAMES_HAVE_UNDERSCORE */
/* number of traps that happen between exec'ing the shell
* to run an inferior, and when we finally get to
* the inferior code. This is 2 on most implementations.
*/
#ifndef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 4
#endif
/* Offset from address of function to start of its code.
Zero on most machines. */
#define FUNCTION_START_OFFSET 0
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
extern int
i386_skip_prologue PARAMS ((int));
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
the new frame is not set up until the new function executes
some instructions. */
#define SAVED_PC_AFTER_CALL(frame) \
(read_memory_integer (read_register (SP_REGNUM), 4))
/* Address of end of stack space. */
#define STACK_END_ADDR 0x80000000
/* Stack grows downward. */
#define INNER_THAN <
/* Sequence of bytes for breakpoint instruction. */
#define BREAKPOINT {0xcc}
/* Amount PC must be decremented by after a breakpoint.
This is often the number of bytes in BREAKPOINT
but not always. */
#ifndef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 1
#endif
/* Nonzero if instruction at PC is a return instruction. */
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
/* Return 1 if P points to an invalid floating point value.
LEN is the length in bytes -- not relevant on the 386. */
#define INVALID_FLOAT(p, len) (0)
/* Say how long (ordinary) registers are. */
#define REGISTER_TYPE long
/* Number of machine registers */
#define NUM_REGS 16
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
/* the order of the first 8 registers must match the compiler's
* numbering scheme (which is the same as the 386 scheme)
* also, this table must match regmap in i386-pinsn.c.
*/
#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
"esp", "ebp", "esi", "edi", \
"eip", "ps", "cs", "ss", \
"ds", "es", "fs", "gs", \
}
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,
and some are "phony" register numbers which are too large
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
#define FP_REGNUM 5 /* Contains address of executing stack frame */
#define SP_REGNUM 4 /* Contains address of top of stack */
#define PC_REGNUM 8
#define PS_REGNUM 9
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (NUM_REGS * 4)
/* Index within `registers' of the first byte of the space for
register N. */
#define REGISTER_BYTE(N) ((N)*4)
/* Number of bytes of storage in the actual machine representation
for register N. */
#define REGISTER_RAW_SIZE(N) (4)
/* Number of bytes of storage in the program's representation
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) (4)
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_RAW_SIZE 4
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#define MAX_REGISTER_VIRTUAL_SIZE 4
/* Nonzero if register N requires conversion
from raw format to virtual format. */
#define REGISTER_CONVERTIBLE(N) (0)
/* Convert data from raw format for register REGNUM
to virtual format for register REGNUM. */
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
{memcpy ((TO), (FROM), 4);}
/* Convert data from virtual format for register REGNUM
to raw format for register REGNUM. */
#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
{memcpy ((TO), (FROM), 4);}
/* Return the GDB type object for the "standard" data type
of data in register N. */
/* Perhaps si and di should go here, but potentially they could be
used for things other than address. */
#define REGISTER_VIRTUAL_TYPE(N) \
((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \
lookup_pointer_type (builtin_type_void) : builtin_type_int)
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function. */
#define STORE_STRUCT_RETURN(ADDR, SP) \
{ (SP) -= sizeof (ADDR); \
write_memory ((SP), (char *) &(ADDR), sizeof (ADDR)); }
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
memcpy ((VALBUF), (REGBUF), TYPE_LENGTH (TYPE))
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer. */
#define FRAME_CHAIN(thisframe) \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
#ifdef __STDC__ /* Forward decl's for prototypes */
struct frame_info;
struct frame_saved_regs;
#endif
extern int
i386_frame_num_args PARAMS ((struct frame_info *));
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 8
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
{ i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
extern void
i386_frame_find_saved_regs PARAMS ((struct frame_info *,
struct frame_saved_regs *));
/* Things needed for making the inferior call functions. */
/* Push an empty stack frame, to record the current PC, etc. */
#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
extern void
i386_push_dummy_frame PARAMS ((void));
/* Discard from the stack the innermost frame, restoring all registers. */
#define POP_FRAME { i386_pop_frame (); }
extern void
i386_pop_frame PARAMS ((void));
/* this is
* call 11223344 (32 bit relative)
* int3
*/
#define CALL_DUMMY { 0x223344e8, 0xcc11 }
#define CALL_DUMMY_LENGTH 8
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME. */
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
{ \
int from, to, delta, loc; \
loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
from = loc + 5; \
to = (int)(fun); \
delta = to - from; \
*((char *)(dummyname) + 1) = (delta & 0xff); \
*((char *)(dummyname) + 2) = ((delta >> 8) & 0xff); \
*((char *)(dummyname) + 3) = ((delta >> 16) & 0xff); \
*((char *)(dummyname) + 4) = ((delta >> 24) & 0xff); \
}
extern void
print_387_control_word PARAMS ((unsigned int));
extern void
print_387_status_word PARAMS ((unsigned int));
/* Offset from SP to first arg on stack at first instruction of a function */
#define SP_ARG0 (1 * 4)
#endif /* !defined (TM_I386V_H) */

View File

@ -1,27 +0,0 @@
/* Macro definitions for linux.
Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (TM_LINUX_H)
#define TM_LINUX_H 1
/* number of traps that happen between exec'ing the shell
* to run an inferior, and when we finally get to
* the inferior code. This is 2 on most implementations.
*/
#define START_INFERIOR_TRAPS_EXPECTED 2
#include "tm-i386v.h"
/* Define this if the C compiler puts an underscore at the front
of external names before giving them to the linker. */
#define NAMES_HAVE_UNDERSCORE
#endif /* !defined (TM_LINUX_H) */

View File

@ -1,45 +0,0 @@
/* Host support for i386.
Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define HOST_BYTE_ORDER LITTLE_ENDIAN
/* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
Sys V/386 3.2.
On some machines, gdb crashes when it's starting up while calling the
vendor's termio tgetent() routine. It always works when run under
itself (actually, under 3.2, it's not an infinitely recursive bug.)
After some poking around, it appears that depending on the environment
size, or whether you're running YP, or the phase of the moon or something,
the stack is not always long-aligned when main() is called, and tgetent()
takes strong offense at that. On some machines this bug never appears, but
on those where it does, it occurs quite reliably. */
#define ALIGN_STACK_ON_STARTUP
/* define USG if you are using sys5 /usr/include's */
#define USG
#define HAVE_TERMIO
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0xe0000000

View File

@ -1,26 +0,0 @@
/* Native support for linux, for GDB, the GNU debugger.
Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "xm-i386v.h"
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
#undef KERNEL_U_ADDR
#define KERNEL_U_ADDR 0x0
#define PSIGNAL_IN_SIGNAL_H

26
etc/commdlg-ordinals Normal file
View File

@ -0,0 +1,26 @@
1 2 0c17 GETOPENFILENAME exported, shared data
2 2 0c48 GETSAVEFILENAME exported, shared data
5 1 0ea1 CHOOSECOLOR exported, shared data
6 2 42a3 FILEOPENDLGPROC exported, shared data
7 2 446a FILESAVEDLGPROC exported, shared data
8 1 0197 COLORDLGPROC exported, shared data
9 6 0000 LOADALTERBITMAP exported, shared data
11 5 0000 FINDTEXT exported, shared data
12 5 019c REPLACETEXT exported, shared data
13 5 036d FINDTEXTDLGPROC exported, shared data
14 5 0582 REPLACETEXTDLGPROC exported, shared data
15 4 0000 CHOOSEFONT exported, shared data
16 4 02b0 FORMATCHARDLGPROC exported, shared data
18 4 184e FONTSTYLEENUMPROC exported, shared data
19 4 1096 FONTFAMILYENUMPROC exported, shared data
20 3 0c94 PRINTDLG exported, shared data
21 3 371f PRINTDLGPROC exported, shared data
22 3 307a PRINTSETUPDLGPROC exported, shared data
23 3 0000 EDITINTEGERONLY exported, shared data
25 1 1b46 WANTARROWS exported, shared data
26 6 01e7 COMMDLGEXTENDEDERROR exported, shared data
27 2 0c79 GETFILETITLE exported, shared data
28 6 01ad WEP exported, shared data
29 2 10a5 DWLBSUBCLASS exported, shared data
30 3 0056 DWUPARROWHACK exported, shared data
31 2 100f DWOKSUBCLASS exported, shared data

38
etc/ddeml-ordinals Normal file
View File

@ -0,0 +1,38 @@
1 2 002c WEP exported, shared data
2 1 0010 DDEINITIALIZE exported, shared data
3 1 03ae DDEUNINITIALIZE exported, shared data
4 1 068a DDECONNECTLIST exported, shared data
5 1 0948 DDEQUERYNEXTSERVER exported, shared data
6 1 0a46 DDEDISCONNECTLIST exported, shared data
7 1 0aac DDECONNECT exported, shared data
8 1 0b4a DDEDISCONNECT exported, shared data
9 1 0dac DDEQUERYCONVINFO exported, shared data
10 1 1020 DDESETUSERHANDLE exported, shared data
11 1 1204 DDECLIENTTRANSACTION exported, shared data
12 1 1bf0 DDEABANDONTRANSACTION exported, shared data
13 1 1118 DDEPOSTADVISE exported, shared data
14 1 14e8 DDECREATEDATAHANDLE exported, shared data
15 1 1598 DDEADDDATA exported, shared data
16 1 17a8 DDEGETDATA exported, shared data
17 1 188a DDEACCESSDATA exported, shared data
18 1 1916 DDEUNACCESSDATA exported, shared data
19 1 1946 DDEFREEDATAHANDLE exported, shared data
20 1 14a8 DDEGETLASTERROR exported, shared data
21 1 19a4 DDECREATESTRINGHANDLE exported, shared data
22 1 1a40 DDEFREESTRINGHANDLE exported, shared data
23 1 1b14 DDEQUERYSTRING exported, shared data
24 1 1aac DDEKEEPSTRINGHANDLE exported, shared data
26 1 1d98 DDEENABLECALLBACK exported, shared data
27 1 1ed4 DDENAMESERVICE exported, shared data
28 1 4614 CLIENTWNDPROC exported, shared data
29 1 523a SERVERWNDPROC exported, shared data
30 1 5480 SUBFRAMEWNDPROC exported, shared data
31 1 5558 DMGWNDPROC exported, shared data
32 1 5758 CONVLISTWNDPROC exported, shared data
33 1 35f2 MONITORWNDPROC exported, shared data
34 1 2fb0 DDESENDHOOKPROC exported, shared data
35 1 309e DDEPOSTHOOKPROC exported, shared data
36 1 1bb0 DDECMPSTRINGHANDLES exported, shared data
37 1 0be0 DDERECONNECT exported, shared data
38 1 6b8a INITENUM exported, shared data
39 1 036a TERMDLGPROC exported, shared data

12
etc/lzexpand-ordinals Normal file
View File

@ -0,0 +1,12 @@
1 4 015c LZCOPY exported, shared data
2 2 0262 LZOPENFILE exported, shared data
3 2 0000 LZINIT exported, shared data
4 2 02ee LZSEEK exported, shared data
5 2 03d6 LZREAD exported, shared data
6 2 06f0 LZCLOSE exported, shared data
7 4 0000 LZSTART exported, shared data
8 4 013a COPYLZFILE exported, shared data
9 4 00a6 LZDONE exported, shared data
10 2 01bc GETEXPANDEDNAME exported, shared data
11 3 0000 WEP exported, shared data
12 11 035e ___EXPORTEDSTUB exported, shared data

136
etc/mmsystem-ordinals Normal file
View File

@ -0,0 +1,136 @@
1 2 0014 WEP exported, shared data
2 4 0000 SNDPLAYSOUND exported, shared data
5 2 02b0 MMSYSTEMGETVERSION exported, shared data
6 4 0028 DRIVERPROC exported, shared data
30 1 030a OUTPUTDEBUGSTR exported, shared data
31 1 03ab DRIVERCALLBACK exported, shared data
32 1 0312 STACKENTER exported, shared data
33 1 0370 STACKLEAVE exported, shared data
34 2 0484 MMDRVINSTALL exported, shared data
101 8 005d JOYGETNUMDEVS exported, shared data
102 8 001a JOYGETDEVCAPS exported, shared data
103 8 0073 JOYGETPOS exported, shared data
104 8 00b5 JOYGETTHRESHOLD exported, shared data
105 8 00ec JOYRELEASECAPTURE exported, shared data
106 8 013e JOYSETCAPTURE exported, shared data
107 8 021d JOYSETTHRESHOLD exported, shared data
109 8 0251 JOYSETCALIBRATION exported, shared data
1100 4 057e DRVOPEN exported, shared data
1101 4 0583 DRVCLOSE exported, shared data
1102 4 058d DRVSENDMESSAGE exported, shared data
1103 4 0588 DRVGETMODULEHANDLE exported, shared data
1104 4 0592 DRVDEFDRIVERPROC exported, shared data
1210 7 02a5 MMIOOPEN exported, shared data
1211 7 0457 MMIOCLOSE exported, shared data
1212 7 04b4 MMIOREAD exported, shared data
1213 7 062b MMIOWRITE exported, shared data
1214 7 07e9 MMIOSEEK exported, shared data
1215 7 0929 MMIOGETINFO exported, shared data
1216 7 0996 MMIOSETINFO exported, shared data
1217 7 0a68 MMIOSETBUFFER exported, shared data
1218 7 0cd8 MMIOFLUSH exported, shared data
1219 7 0da7 MMIOADVANCE exported, shared data
1220 7 0ed3 MMIOSTRINGTOFOURCC exported, shared data
1221 7 0f6e MMIOINSTALLIOPROC exported, shared data
1222 7 1073 MMIOSENDMESSAGE exported, shared data
1223 7 1360 MMIODESCEND exported, shared data
1224 7 1562 MMIOASCEND exported, shared data
1225 7 16a5 MMIOCREATECHUNK exported, shared data
1226 7 01d2 MMIORENAME exported, shared data
201 6 015f MIDIOUTGETNUMDEVS exported, shared data
202 6 016a MIDIOUTGETDEVCAPS exported, shared data
203 6 0266 MIDIOUTGETERRORTEXT exported, shared data
204 6 02a7 MIDIOUTOPEN exported, shared data
205 6 03c4 MIDIOUTCLOSE exported, shared data
206 6 0410 MIDIOUTPREPAREHEADER exported, shared data
207 6 0485 MIDIOUTUNPREPAREHEADER exported, shared data
208 1 0121 MIDIOUTSHORTMSG exported, shared data
209 1 0156 MIDIOUTLONGMSG exported, shared data
210 1 01b4 MIDIOUTRESET exported, shared data
211 6 01b6 MIDIOUTGETVOLUME exported, shared data
212 6 01f7 MIDIOUTSETVOLUME exported, shared data
213 6 04ff MIDIOUTCACHEPATCHES exported, shared data
214 6 0571 MIDIOUTCACHEDRUMPATCHES exported, shared data
215 6 0a5c MIDIOUTGETID exported, shared data
216 1 00eb MIDIOUTMESSAGE exported, shared data
301 6 05e3 MIDIINGETNUMDEVS exported, shared data
302 6 0625 MIDIINGETDEVCAPS exported, shared data
303 6 0671 MIDIINGETERRORTEXT exported, shared data
304 6 06b2 MIDIINOPEN exported, shared data
305 6 07cf MIDIINCLOSE exported, shared data
306 6 081b MIDIINPREPAREHEADER exported, shared data
307 6 0890 MIDIINUNPREPAREHEADER exported, shared data
308 6 090a MIDIINADDBUFFER exported, shared data
309 6 0976 MIDIINSTART exported, shared data
310 6 09aa MIDIINSTOP exported, shared data
311 6 09de MIDIINRESET exported, shared data
312 6 0a12 MIDIINGETID exported, shared data
313 6 05ee MIDIINMESSAGE exported, shared data
350 8 0531 AUXGETNUMDEVS exported, shared data
351 8 053c AUXGETDEVCAPS exported, shared data
352 8 0582 AUXGETVOLUME exported, shared data
353 8 05bd AUXSETVOLUME exported, shared data
354 8 04df AUXOUTMESSAGE exported, shared data
401 3 0866 WAVEOUTGETNUMDEVS exported, shared data
402 3 08a6 WAVEOUTGETDEVCAPS exported, shared data
403 3 09a2 WAVEOUTGETERRORTEXT exported, shared data
404 3 09e3 WAVEOUTOPEN exported, shared data
405 3 0b81 WAVEOUTCLOSE exported, shared data
406 3 0bc8 WAVEOUTPREPAREHEADER exported, shared data
407 3 0c54 WAVEOUTUNPREPAREHEADER exported, shared data
408 3 0cdd WAVEOUTWRITE exported, shared data
409 3 0d4a WAVEOUTPAUSE exported, shared data
410 3 0d7c WAVEOUTRESTART exported, shared data
411 3 0dae WAVEOUTRESET exported, shared data
412 3 0e12 WAVEOUTGETPOSITION exported, shared data
413 3 0e62 WAVEOUTGETPITCH exported, shared data
414 3 0eb0 WAVEOUTSETPITCH exported, shared data
415 3 08f2 WAVEOUTGETVOLUME exported, shared data
416 3 0933 WAVEOUTSETVOLUME exported, shared data
417 3 0ee4 WAVEOUTGETPLAYBACKRATE exported, shared data
418 3 0f32 WAVEOUTSETPLAYBACKRATE exported, shared data
419 3 0de0 WAVEOUTBREAKLOOP exported, shared data
420 3 14bf WAVEOUTGETID exported, shared data
421 3 0871 WAVEOUTMESSAGE exported, shared data
501 3 0f66 WAVEINGETNUMDEVS exported, shared data
502 3 0fa6 WAVEINGETDEVCAPS exported, shared data
503 3 0ff2 WAVEINGETERRORTEXT exported, shared data
504 3 1033 WAVEINOPEN exported, shared data
505 3 11d1 WAVEINCLOSE exported, shared data
506 3 1218 WAVEINPREPAREHEADER exported, shared data
507 3 129c WAVEINUNPREPAREHEADER exported, shared data
508 3 1325 WAVEINADDBUFFER exported, shared data
509 3 138f WAVEINSTART exported, shared data
510 3 13c1 WAVEINSTOP exported, shared data
511 3 13f3 WAVEINRESET exported, shared data
512 3 1425 WAVEINGETPOSITION exported, shared data
513 3 1475 WAVEINGETID exported, shared data
514 3 0f71 WAVEINMESSAGE exported, shared data
601 1 0000 TIMEGETSYSTEMTIME exported, shared data
602 1 0029 TIMESETEVENT exported, shared data
603 1 0292 TIMEKILLEVENT exported, shared data
604 8 0000 TIMEGETDEVCAPS exported, shared data
605 1 0288 TIMEBEGINPERIOD exported, shared data
606 1 028d TIMEENDPERIOD exported, shared data
607 1 029a TIMEGETTIME exported, shared data
701 5 04af MCISENDCOMMAND exported, shared data
702 5 1258 MCISENDSTRING exported, shared data
703 5 1588 MCIGETDEVICEID exported, shared data
704 5 3994 MCIPARSECOMMAND exported, shared data
705 5 2d4c MCILOADCOMMANDRESOURCE exported, shared data
706 5 136f MCIGETERRORSTRING exported, shared data
707 5 2a1d MCISETDRIVERDATA exported, shared data
708 5 29d3 MCIGETDRIVERDATA exported, shared data
710 5 2a6f MCIDRIVERYIELD exported, shared data
711 1 0275 MCIDRIVERNOTIFY exported, shared data
712 5 1293 MCIEXECUTE exported, shared data
713 5 2fb9 MCIFREECOMMANDRESOURCE exported, shared data
714 5 2acd MCISETYIELDPROC exported, shared data
715 5 1454 MCIGETDEVICEIDFROMELEMENTID exported, shared data
716 5 2b3c MCIGETYIELDPROC exported, shared data
717 5 15a5 MCIGETCREATORTASK exported, shared data
900 4 05fa MMTASKCREATE exported, shared data
902 4 05be MMTASKBLOCK exported, shared data
903 1 0264 MMTASKSIGNAL exported, shared data
904 4 05b9 MMGETCURRENTTASK exported, shared data
905 4 0598 MMTASKYIELD exported, shared data

146
etc/netapi20-ordinals Normal file
View File

@ -0,0 +1,146 @@
1 3 0000 NETACCESSADD exported, shared data
2 3 0128 NETACCESSDEL exported, shared data
3 3 01ea NETACCESSENUM exported, shared data
4 3 0318 NETACCESSGETINFO exported, shared data
5 3 042a NETACCESSSETINFO exported, shared data
6 4 0030 NETALERTRAISE exported, shared data
7 4 0000 NETALERTSTART exported, shared data
8 4 0018 NETALERTSTOP exported, shared data
9 10 00f4 NETAUDITCLEAR exported, shared data
10 10 024a NETAUDITOPEN exported, shared data
11 10 0000 NETAUDITWRITE exported, shared data
12 3 0110 NETACCESSCHECK exported, shared data
13 12 0000 NETBIOSCLOSE exported, shared data
14 12 0018 NETBIOSENUM exported, shared data
15 12 0030 NETBIOSGETINFO exported, shared data
16 12 0048 NETBIOSOPEN exported, shared data
17 12 0060 NETBIOSSUBMIT exported, shared data
18 7 0000 NETCHARDEVCONTROL exported, shared data
19 7 0056 NETCHARDEVENUM exported, shared data
20 7 00f2 NETCHARDEVGETINFO exported, shared data
21 7 016e NETCHARDEVQENUM exported, shared data
22 7 043c NETCHARDEVQGETINFO exported, shared data
23 7 04b2 NETCHARDEVQPURGE exported, shared data
24 7 0562 NETCHARDEVQSETINFO exported, shared data
25 6 0330 NETCONFIGGET exported, shared data
26 6 0150 NETCONFIGGETALL exported, shared data
27 18 0000 NETCONNECTIONENUM exported, shared data
28 1 00a8 WEP exported, shared data
29 10 0030 NETERRORLOGCLEAR exported, shared data
30 10 01c0 NETERRORLOGOPEN exported, shared data
31 10 0018 NETERRORLOGWRITE exported, shared data
32 18 0256 NETFILECLOSE exported, shared data
33 18 044a NETFILEENUM exported, shared data
34 18 0516 NETFILEGETINFO exported, shared data
35 3 05f8 NETGROUPADD exported, shared data
36 3 067e NETGROUPADDUSER exported, shared data
37 3 06dc NETGROUPDEL exported, shared data
38 3 073a NETGROUPDELUSER exported, shared data
39 3 0798 NETGROUPENUM exported, shared data
40 3 0894 NETGROUPGETUSERS exported, shared data
43 11 01cc NETMESSAGELOGFILEGET exported, shared data
44 11 0338 NETMESSAGELOGFILESET exported, shared data
45 11 0718 NETMESSAGENAMEADD exported, shared data
46 11 0844 NETMESSAGENAMEDEL exported, shared data
47 11 096c NETMESSAGENAMEENUM exported, shared data
48 11 0d2a NETMESSAGENAMEFWD exported, shared data
49 11 0b00 NETMESSAGENAMEGETINFO exported, shared data
50 11 0d7a NETMESSAGENAMEUNFWD exported, shared data
51 13 0000 NETPROFILELOAD exported, shared data
52 13 037e NETPROFILESAVE exported, shared data
53 18 0b98 NETSERVERADMINCOMMAND exported, shared data
54 18 00b8 NETSERVERDISKENUM exported, shared data
55 18 0c62 NETSERVERGETINFO exported, shared data
56 18 0cf2 NETSERVERSETINFO exported, shared data
57 19 0134 NETSERVICECONTROL exported, shared data
58 19 02f0 NETSERVICEENUM exported, shared data
59 19 044a NETSERVICEINSTALL exported, shared data
60 19 011c NETSERVICESTATUS exported, shared data
61 18 0676 NETSESSIONDEL exported, shared data
62 18 05c4 NETSESSIONENUM exported, shared data
63 18 06dc NETSESSIONGETINFO exported, shared data
64 18 0798 NETSHAREADD exported, shared data
65 18 0968 NETSHARECHECK exported, shared data
66 18 082a NETSHAREDEL exported, shared data
67 18 09d6 NETSHAREENUM exported, shared data
68 18 0ab6 NETSHAREGETINFO exported, shared data
69 18 08a2 NETSHARESETINFO exported, shared data
70 18 0d88 NETSTATISTICSCLEAR exported, shared data
71 18 0de0 NETSTATISTICSGET exported, shared data
72 16 06f2 NETREMOTETOD exported, shared data
73 21 0000 NETUSEADD exported, shared data
74 21 032a NETUSEDEL exported, shared data
75 21 0502 NETUSEENUM exported, shared data
76 21 0664 NETUSEGETINFO exported, shared data
77 3 0ab8 NETUSERADD exported, shared data
78 3 0c26 NETUSERDEL exported, shared data
79 3 0c84 NETUSERENUM exported, shared data
80 3 0f9a NETUSERGETGROUPS exported, shared data
81 3 0ef4 NETUSERGETINFO exported, shared data
82 3 1132 NETUSERPASSWORDSET exported, shared data
83 3 0d2c NETUSERSETINFO exported, shared data
84 9 0858 NETWKSTAGETINFO exported, shared data
85 9 0a22 NETWKSTASETINFO exported, shared data
86 9 0000 NETWKSTASETUID exported, shared data
91 16 0380 NETREMOTEMOVE exported, shared data
92 16 0000 NETREMOTECOPY exported, shared data
93 16 0368 NETREMOTEEXEC exported, shared data
105 3 1570 NETUSERVALIDATE exported, shared data
116 19 0000 NETSERVICEGETINFO exported, shared data
117 7 050a NETCHARDEVQPURGESELF exported, shared data
172 3 0506 NETACCESSGETUSERPERMS exported, shared data
174 7 0226 NETHANDLEGETINFO exported, shared data
175 7 0326 NETHANDLESETINFO exported, shared data
176 3 0974 NETGROUPSETUSERS exported, shared data
177 3 0816 NETGROUPGETINFO exported, shared data
178 3 08fe NETGROUPSETINFO exported, shared data
179 3 1404 NETUSERSETGROUPS exported, shared data
182 3 1588 NETUSERVALIDATE2 exported, shared data
184 3 1004 NETUSERMODALSGET exported, shared data
185 3 10a2 NETUSERMODALSSET exported, shared data
186 3 0d14 NETUSERINIT exported, shared data
189 26 0000 NETGETDCNAME exported, shared data
196 6 01e0 NETCONFIGGET2 exported, shared data
197 6 0000 NETCONFIGGETALL2 exported, shared data
198 18 0e5e NETSTATISTICSGET2 exported, shared data
199 10 02f4 NETERRORLOGREAD exported, shared data
200 10 04b2 NETAUDITREAD exported, shared data
201 18 02ae NETFILEENUM2 exported, shared data
259 17 0000 NETUSERRESTRICT exported, shared data
266 26 06dc NETLOGONENUM exported, shared data
277 9 027c NETWKSTASETUID2 exported, shared data
280 18 0f9e NETFILEGETINFO2 exported, shared data
282 18 0f40 NETFILECLOSE2 exported, shared data
299 25 0b34 I_NETPATHTYPE exported, shared data
300 25 0000 I_NETPATHCANONICALIZE exported, shared data
301 25 0932 I_NETPATHCOMPARE exported, shared data
302 25 1afe I_NETNAMEVALIDATE exported, shared data
303 25 173e I_NETNAMECANONICALIZE exported, shared data
304 25 196e I_NETNAMECOMPARE exported, shared data
305 25 1cee I_NETLISTCANONICALIZE exported, shared data
306 25 22c2 I_NETLISTTRAVERSE exported, shared data
501 8 0000 DOSDELETEMAILSLOT exported, shared data
502 8 0072 DOSMAILSLOTINFO exported, shared data
503 8 00ec DOSMAKEMAILSLOT exported, shared data
504 8 0320 DOSPEEKMAILSLOT exported, shared data
523 8 0454 DOSREADMAILSLOT exported, shared data
524 8 058a DOSWRITEMAILSLOT exported, shared data
525 11 0000 NETMESSAGEBUFFERSEND exported, shared data
526 11 0e1e NETMESSAGEFILESEND exported, shared data
527 5 0000 NETSERVERENUM exported, shared data
528 5 013a NETSERVERENUM2 exported, shared data
529 20 0000 NETSPECIALSMB exported, shared data
530 2 0010 DOSMAKENMPIPE exported, shared data
531 2 004c DOSCONNECTNMPIPE exported, shared data
532 2 002e DOSDISCONNECTNMPIPE exported, shared data
533 2 006a DOSSETNMPHANDSTATE exported, shared data
534 2 010a DOSWAITNMPIPE exported, shared data
535 2 01d2 DOSTRANSACTNMPIPE exported, shared data
536 2 02e5 DOSQNMPHANDSTATE exported, shared data
537 2 0388 DOSQNMPIPEINFO exported, shared data
538 2 044d DOSPEEKNMPIPE exported, shared data
539 2 057d DOSCALLNMPIPE exported, shared data
540 2 06cf DOSRAWREADNMPIPE exported, shared data
541 2 07b6 DOSRAWWRITENMPIPE exported, shared data
542 2 0b4f DOSREADASYNCNMPIPE exported, shared data
543 2 0d73 DOSWRITEASYNCNMPIPE exported, shared data

178
etc/olecli-ordinals Normal file
View File

@ -0,0 +1,178 @@
1 1 0000 WEP exported, shared data
2 3 004e OLEDELETE exported, shared data
3 3 00c6 OLESAVETOSTREAM exported, shared data
4 3 0122 OLELOADFROMSTREAM exported, shared data
6 3 0400 OLECLONE exported, shared data
7 3 04ec OLECOPYFROMLINK exported, shared data
8 3 0606 OLEEQUAL exported, shared data
9 3 0674 OLEQUERYLINKFROMCLIP exported, shared data
10 3 06a0 OLEQUERYCREATEFROMCLIP exported, shared data
11 3 06cc OLECREATELINKFROMCLIP exported, shared data
12 3 08a2 OLECREATEFROMCLIP exported, shared data
13 3 0b52 OLECOPYTOCLIPBOARD exported, shared data
14 3 1d48 OLEQUERYTYPE exported, shared data
15 3 0b8e OLESETHOSTNAMES exported, shared data
16 3 0c04 OLESETTARGETDEVICE exported, shared data
17 3 0c84 OLESETBOUNDS exported, shared data
18 3 0ce0 OLEQUERYBOUNDS exported, shared data
19 3 0da0 OLEDRAW exported, shared data
20 3 0e24 OLEQUERYOPEN exported, shared data
21 3 0e60 OLEACTIVATE exported, shared data
22 3 0eea OLEUPDATE exported, shared data
23 3 0f26 OLERECONNECT exported, shared data
24 3 0f62 OLEGETLINKUPDATEOPTIONS exported, shared data
25 3 0fbe OLESETLINKUPDATEOPTIONS exported, shared data
26 3 0ffc OLEENUMFORMATS exported, shared data
27 3 0eae OLECLOSE exported, shared data
28 3 107e OLEGETDATA exported, shared data
29 3 10dc OLESETDATA exported, shared data
30 3 0010 OLEQUERYPROTOCOL exported, shared data
31 3 111e OLEQUERYOUTOFDATE exported, shared data
32 3 115a OLEOBJECTCONVERT exported, shared data
33 3 121a OLECREATEFROMTEMPLATE exported, shared data
34 3 13b4 OLECREATE exported, shared data
35 3 1ba6 OLEQUERYRELEASESTATUS exported, shared data
36 3 1c04 OLEQUERYRELEASEERROR exported, shared data
37 3 1c40 OLEQUERYRELEASEMETHOD exported, shared data
38 3 16fa OLECREATEFROMFILE exported, shared data
39 3 190a OLECREATELINKFROMFILE exported, shared data
40 3 008a OLERELEASE exported, shared data
41 2 093e OLEREGISTERCLIENTDOC exported, shared data
42 2 0a9e OLEREVOKECLIENTDOC exported, shared data
43 2 0bb6 OLERENAMECLIENTDOC exported, shared data
44 2 0c8e OLEREVERTCLIENTDOC exported, shared data
45 2 0cc8 OLESAVEDCLIENTDOC exported, shared data
46 3 1c7c OLERENAME exported, shared data
47 2 0cf6 OLEENUMOBJECTS exported, shared data
48 3 1d00 OLEQUERYNAME exported, shared data
49 3 0c42 OLESETCOLORSCHEME exported, shared data
50 3 1034 OLEREQUESTDATA exported, shared data
54 4 0000 OLELOCKSERVER exported, shared data
55 4 025a OLEUNLOCKSERVER exported, shared data
56 3 0d3c OLEQUERYSIZE exported, shared data
57 3 1cbe OLEEXECUTE exported, shared data
58 3 152e OLECREATEINVISIBLE exported, shared data
59 3 1da4 OLEQUERYCLIENTVERSION exported, shared data
60 3 46d4 OLEISDCMETA exported, shared data
100 4 0c28 DOCWNDPROC exported, shared data
101 4 0d2c SRVRWNDPROC exported, shared data
102 14 0838 MFCALLBACKFUNC exported, shared data
110 5 0000 DEFLOADFROMSTREAM exported, shared data
111 5 00fe DEFCREATEFROMCLIP exported, shared data
112 5 0180 DEFCREATELINKFROMCLIP exported, shared data
113 5 01be DEFCREATEFROMTEMPLATE exported, shared data
114 5 01fe DEFCREATE exported, shared data
115 5 023e DEFCREATEFROMFILE exported, shared data
116 5 028e DEFCREATELINKFROMFILE exported, shared data
117 5 02e0 DEFCREATEINVISIBLE exported, shared data
200 4 04e0 LERELEASE exported, shared data
201 4 1e52 LESHOW exported, shared data
202 3 2508 LEGETDATA exported, shared data
203 4 3a54 LESETDATA exported, shared data
204 4 37ee LESETHOSTNAMES exported, shared data
205 4 386e LESETTARGETDEVICE exported, shared data
206 4 3922 LESETBOUNDS exported, shared data
207 3 27be LESAVETOSTREAM exported, shared data
208 3 1fde LECLONE exported, shared data
209 4 052a LECOPYFROMLINK exported, shared data
210 6 0134 LEEQUAL exported, shared data
211 3 227a LECOPY exported, shared data
212 3 2e00 LEQUERYTYPE exported, shared data
213 3 2370 LEQUERYBOUNDS exported, shared data
214 3 23fc LEDRAW exported, shared data
215 4 2108 LEQUERYOPEN exported, shared data
216 4 219a LEACTIVATE exported, shared data
218 4 2200 LEUPDATE exported, shared data
219 4 2cb4 LERECONNECT exported, shared data
220 3 2454 LEENUMFORMAT exported, shared data
221 6 00c8 LEQUERYPROTOCOL exported, shared data
222 3 2638 LEQUERYOUTOFDATE exported, shared data
223 6 01c2 LEOBJECTCONVERT exported, shared data
224 4 07fa LECHANGEDATA exported, shared data
225 4 2c16 LECLOSE exported, shared data
226 3 2e72 LEGETUPDATEOPTIONS exported, shared data
227 4 337a LESETUPDATEOPTIONS exported, shared data
228 4 4a44 LEEXECUTE exported, shared data
229 6 0000 LEOBJECTLONG exported, shared data
230 4 322c LECREATEINVISIBLE exported, shared data
300 9 0000 MFRELEASE exported, shared data
301 9 0258 MFGETDATA exported, shared data
302 3 42f2 MFSAVETOSTREAM exported, shared data
303 9 0082 MFCLONE exported, shared data
304 9 0174 MFEQUAL exported, shared data
305 9 01f0 MFCOPY exported, shared data
307 3 446a MFQUERYBOUNDS exported, shared data
308 14 05cc MFDRAW exported, shared data
309 9 0234 MFENUMFORMAT exported, shared data
310 9 0302 MFCHANGEDATA exported, shared data
400 11 0000 BMRELEASE exported, shared data
401 11 0254 BMGETDATA exported, shared data
402 3 4b92 BMSAVETOSTREAM exported, shared data
403 11 006e BMCLONE exported, shared data
404 11 00e4 BMEQUAL exported, shared data
405 3 4c8c BMCOPY exported, shared data
407 3 4ce0 BMQUERYBOUNDS exported, shared data
408 14 0000 BMDRAW exported, shared data
409 11 0230 BMENUMFORMAT exported, shared data
410 3 5004 BMCHANGEDATA exported, shared data
500 12 0000 DIBRELEASE exported, shared data
501 12 01ea DIBGETDATA exported, shared data
502 3 536c DIBSAVETOSTREAM exported, shared data
503 12 006e DIBCLONE exported, shared data
504 12 00e4 DIBEQUAL exported, shared data
505 12 011c DIBCOPY exported, shared data
507 12 016c DIBQUERYBOUNDS exported, shared data
508 14 02f2 DIBDRAW exported, shared data
509 12 01c6 DIBENUMFORMAT exported, shared data
510 12 028a DIBCHANGEDATA exported, shared data
600 10 0000 GENRELEASE exported, shared data
601 10 049e GENGETDATA exported, shared data
602 10 0438 GENSETDATA exported, shared data
603 3 4750 GENSAVETOSTREAM exported, shared data
604 10 0082 GENCLONE exported, shared data
605 10 012e GENEQUAL exported, shared data
606 10 0164 GENCOPY exported, shared data
608 3 4b60 GENQUERYBOUNDS exported, shared data
609 14 05b2 GENDRAW exported, shared data
610 10 04e0 GENENUMFORMAT exported, shared data
611 10 0222 GENCHANGEDATA exported, shared data
701 13 0034 ERRSHOW exported, shared data
702 13 0186 ERRSETDATA exported, shared data
703 13 0082 ERRSETHOSTNAMES exported, shared data
704 13 009c ERRSETTARGETDEVICE exported, shared data
705 13 00d0 ERRSETBOUNDS exported, shared data
706 13 0068 ERRCOPYFROMLINK exported, shared data
707 13 00ea ERRQUERYOPEN exported, shared data
708 13 0104 ERRACTIVATE exported, shared data
709 13 0138 ERRCLOSE exported, shared data
710 13 0152 ERRUPDATE exported, shared data
711 13 016c ERRRECONNECT exported, shared data
712 13 0222 ERRQUERYPROTOCOL exported, shared data
713 13 01ba ERRQUERYOUTOFDATE exported, shared data
714 13 01d4 ERROBJECTCONVERT exported, shared data
715 13 01ee ERRGETUPDATEOPTIONS exported, shared data
716 13 0208 ERRSETUPDATEOPTIONS exported, shared data
717 13 0256 ERREXECUTE exported, shared data
718 13 0270 ERROBJECTLONG exported, shared data
800 7 0000 PBLOADFROMSTREAM exported, shared data
801 7 00ac PBCREATEFROMCLIP exported, shared data
802 7 017a PBCREATELINKFROMCLIP exported, shared data
803 7 0212 PBCREATEFROMTEMPLATE exported, shared data
804 7 02a8 PBCREATE exported, shared data
805 7 06f4 PBDRAW exported, shared data
806 7 0626 PBQUERYBOUNDS exported, shared data
807 7 0818 PBCOPYTOCLIPBOARD exported, shared data
808 7 033e PBCREATEFROMFILE exported, shared data
809 7 03e0 PBCREATELINKFROMFILE exported, shared data
810 7 0768 PBENUMFORMATS exported, shared data
811 7 07a8 PBGETDATA exported, shared data
812 7 0492 PBCREATEINVISIBLE exported, shared data
910 3 3e50 OBJQUERYNAME exported, shared data
911 3 3f06 OBJRENAME exported, shared data
912 3 410e OBJQUERYTYPE exported, shared data
913 3 4154 OBJQUERYSIZE exported, shared data
950 8 0456 CONNECTDLGPROC exported, shared data
951 8 0000 SETNETNAME exported, shared data
952 8 011a CHECKNETDRIVE exported, shared data
953 8 025c SETNEXTNETDRIVE exported, shared data
954 8 0696 GETTASKVISIBLEWINDOW exported, shared data

23
etc/olesvr-ordinals Normal file
View File

@ -0,0 +1,23 @@
1 1 0000 WEP exported, shared data
2 3 036e OLEREGISTERSERVER exported, shared data
3 3 05f0 OLEREVOKESERVER exported, shared data
4 3 3d46 OLEBLOCKSERVER exported, shared data
5 3 3d92 OLEUNBLOCKSERVER exported, shared data
6 3 1108 OLEREGISTERSERVERDOC exported, shared data
7 3 12dc OLEREVOKESERVERDOC exported, shared data
8 3 13a2 OLERENAMESERVERDOC exported, shared data
9 3 1528 OLEREVERTSERVERDOC exported, shared data
10 3 14ba OLESAVEDSERVERDOC exported, shared data
11 3 2140 OLEREVOKEOBJECT exported, shared data
12 3 0354 OLEQUERYSERVERVERSION exported, shared data
21 3 07a2 SRVRWNDPROC exported, shared data
22 3 1728 DOCWNDPROC exported, shared data
23 3 23b2 ITEMWNDPROC exported, shared data
24 3 2d3c SENDDATAMSG exported, shared data
25 3 22ac FINDITEMWND exported, shared data
26 3 2a5c ITEMCALLBACK exported, shared data
27 3 0752 TERMINATECLIENTS exported, shared data
28 3 1554 TERMINATEDOCCLIENTS exported, shared data
29 3 222e DELETECLIENTINFO exported, shared data
30 3 2cbc SENDRENAMEMSG exported, shared data
31 3 2c5e ENUMFORTERMINATE exported, shared data

26
etc/shell-ordinals Normal file
View File

@ -0,0 +1,26 @@
1 2 15cc REGOPENKEY exported, shared data
2 2 15fa REGCREATEKEY exported, shared data
3 2 1670 REGCLOSEKEY exported, shared data
4 2 1628 REGDELETEKEY exported, shared data
5 2 16f4 REGSETVALUE exported, shared data
6 2 168e REGQUERYVALUE exported, shared data
7 2 14dc REGENUMKEY exported, shared data
8 7 0000 WEP exported, shared data
9 6 0052 DRAGACCEPTFILES exported, shared data
11 6 0094 DRAGQUERYFILE exported, shared data
12 6 0142 DRAGFINISH exported, shared data
13 6 0000 DRAGQUERYPOINT exported, shared data
20 4 110a SHELLEXECUTE exported, shared data
21 4 1154 FINDEXECUTABLE exported, shared data
22 9 0000 SHELLABOUT exported, shared data
32 9 0829 WCI exported, shared data
33 9 0136 ABOUTDLGPROC exported, shared data
34 10 021a EXTRACTICON exported, shared data
36 10 08dc EXTRACTASSOCIATEDICON exported, shared data
37 5 00ae DOENVIRONMENTSUBST exported, shared data
38 5 0000 FINDENVIRONMENTSTRING exported, shared data
39 10 026e INTERNALEXTRACTICON exported, shared data
100 4 0550 HERETHARBETYGARS exported, shared data
101 8 010e FINDEXEDLGPROC exported, shared data
102 4 128c REGISTERSHELLHOOK exported, shared data
103 4 11ca SHELLHOOKPROC exported, shared data

35
etc/toolhelp-ordinals Normal file
View File

@ -0,0 +1,35 @@
1 1 018a WEP exported, shared data
50 1 057b GLOBALHANDLETOSEL exported, shared data
51 1 0318 GLOBALFIRST exported, shared data
52 1 0399 GLOBALNEXT exported, shared data
53 1 02a2 GLOBALINFO exported, shared data
54 1 0417 GLOBALENTRYHANDLE exported, shared data
55 1 04a9 GLOBALENTRYMODULE exported, shared data
56 1 090e LOCALINFO exported, shared data
57 1 095e LOCALFIRST exported, shared data
58 1 09e9 LOCALNEXT exported, shared data
59 1 0a90 MODULEFIRST exported, shared data
60 1 0ad9 MODULENEXT exported, shared data
61 1 0b15 MODULEFINDNAME exported, shared data
62 1 0b8c MODULEFINDHANDLE exported, shared data
63 1 0caa TASKFIRST exported, shared data
64 1 0ced TASKNEXT exported, shared data
65 1 0d2e TASKFINDHANDLE exported, shared data
66 1 0f1c STACKTRACEFIRST exported, shared data
67 1 0f67 STACKTRACECSIPFIRST exported, shared data
68 1 0fca STACKTRACENEXT exported, shared data
69 1 28b0 CLASSFIRST exported, shared data
70 1 2925 CLASSNEXT exported, shared data
71 1 11ce SYSTEMHEAPINFO exported, shared data
72 1 13f4 MEMMANINFO exported, shared data
73 1 1b72 NOTIFYREGISTER exported, shared data
74 1 1c29 NOTIFYUNREGISTER exported, shared data
75 1 2060 INTERRUPTREGISTER exported, shared data
76 1 2111 INTERRUPTUNREGISTER exported, shared data
77 1 26ea TERMINATEAPP exported, shared data
78 1 29c4 MEMORYREAD exported, shared data
79 1 2b6c MEMORYWRITE exported, shared data
80 1 2dae TIMERCOUNT exported, shared data
81 1 0d68 TASKSETCSIP exported, shared data
82 1 0d97 TASKGETCSIP exported, shared data
83 1 0dc0 TASKSWITCH exported, shared data

5
etc/win87em-ordinals Normal file
View File

@ -0,0 +1,5 @@
1 1 002a __FPMATH exported
2 1 0089 WEP exported
3 1 01ab __WIN87EMINFO exported
4 1 0220 __WIN87EMRESTORE exported
5 1 01e3 __WIN87EMSAVE exported

View File

@ -46,9 +46,13 @@ WineRelocatableTarget($(TOP)/$(MODULE),,$(OBJS))
DependTarget()
CleanTarget()
pop.h: $(TOP)/tools/build
$(TOP)/tools/build -p
includes::
install::
clean::
$(RM) dll* dtb*
$(RM) dll* dtb* pop.h
touch pop.h

View File

@ -361,18 +361,7 @@ _ReturnFromRegisterFunc:
* address again.
*/
add $6,%esp /* argument count, return address */
popw %gs
add $2,%esp
popw %fs
add $2,%esp
popw %es
add $2,%esp
popw %ds
add $2,%esp
popal
add $16,%esp /* trapno, err, eip, cs */
popfl
add $20,%esp /* esp, ss, i387, oldmask, cr2 */
#include "pop.h" /* restore context */
/*
* Return to original caller.

View File

@ -142,6 +142,8 @@ void FreeProcInstance(FARPROC func)
LONG CallWindowProc( FARPROC func, HWND hwnd, WORD message,
WORD wParam, LONG lParam )
{
SpyMessage(hwnd, message, wParam, lParam);
if (Is16bitAddress(func))
{
PushOn16( CALLBACK_SIZE_WORD, hwnd );
@ -176,6 +178,44 @@ void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam)
}
}
/**********************************************************************
* CallHookProc
*/
DWORD CallHookProc( HOOKPROC func, short code, WPARAM wParam, LPARAM lParam )
{
if (Is16bitAddress(func))
{
PushOn16( CALLBACK_SIZE_WORD, code );
PushOn16( CALLBACK_SIZE_WORD, wParam );
PushOn16( CALLBACK_SIZE_LONG, lParam );
return CallTo16((unsigned int) func,
FindDataSegmentForCode((unsigned long) func));
}
else
{
return (*func)( code, wParam, lParam );
}
}
/**********************************************************************
* CallGrayStringProc
*/
BOOL CallGrayStringProc(FARPROC func, HDC hdc, LPARAM lParam, INT cch )
{
if (Is16bitAddress(func))
{
PushOn16( CALLBACK_SIZE_WORD, hdc );
PushOn16( CALLBACK_SIZE_LONG, lParam );
PushOn16( CALLBACK_SIZE_WORD, cch );
return CallTo16((unsigned int) func,
FindDataSegmentForCode((unsigned long) func));
}
else
{
return (*func)( hdc, lParam, cch );
}
}
/* ------------------------------------------------------------------------ */
/*
* The following functions realize the Catch/Throw functionality.

0
if1632/findfunc Executable file → Normal file
View File

View File

@ -80,6 +80,7 @@ length 490
67 pascal DPtoLP(word ptr s_word) DPtoLP(1 2 3)
68 pascal DeleteDC(word) DeleteDC(1)
69 pascal DeleteObject(word) DeleteObject(1)
70 pascal EnumFonts(word ptr ptr ptr) EnumFonts(1 2 3 4)
72 pascal EqualRgn(word word) EqualRgn(1 2)
73 pascal ExcludeVisRect(word s_word s_word s_word s_word)
ExcludeVisRect(1 2 3 4 5)

View File

@ -5,7 +5,6 @@ id 1
length 415
3 pascal GetVersion() GetVersion()
#return GetVersion 0 0x301
4 pascal LocalInit(word word word) WIN16_LocalInit(1 2 3)
5 pascal LocalAlloc(word word) WIN16_LocalAlloc(1 2)
6 pascal LocalReAlloc(word word word) WIN16_LocalReAlloc(1 2 3)
@ -28,10 +27,12 @@ length 415
23 pascal LockSegment(s_word) KERNEL_LockSegment(1)
24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1)
25 pascal GlobalCompact(long) GlobalCompact(1)
#29 pascal Yield() Yield()
30 pascal WaitEvent(word) KERNEL_WaitEvent(1)
34 pascal SetTaskQueue(word word) SetTaskQueue(1 2)
35 pascal GetTaskQueue(word) GetTaskQueue(1)
36 pascal GetCurrentTask() GetCurrentTask()
45 pascal LoadModule(ptr ptr) LoadModule(1 2)
47 pascal GetModuleHandle(ptr) GetModuleHandle(1)
48 pascal GetModuleUsage(word) GetModuleUsage(1)
49 pascal GetModuleFileName(word ptr s_word) GetModuleFileName(1 2 3)
@ -46,6 +47,12 @@ length 415
62 pascal LockResource(word) LockResource(1)
63 pascal FreeResource(word) FreeResource(1)
64 pascal AccessResource(word word) AccessResource(1 2)
68 pascal InitAtomTable(word) InitAtomTable(1)
69 pascal FindAtom(ptr) FindAtom(1)
70 pascal AddAtom(ptr) AddAtom(1)
71 pascal DeleteAtom(word) DeleteAtom(1)
72 pascal GetAtomName(word ptr word) GetAtomName(1 2 3)
73 pascal GetAtomHandle(word) GetAtomHandle(1)
74 pascal OpenFile(ptr ptr word) OpenFile(1 2 3)
81 pascal _lclose(word) _lclose(1)
82 pascal _lread(word ptr word) _lread(1 2 3)
@ -82,9 +89,9 @@ length 415
#132 return GetWinFlags 0 0x413
134 pascal GetWindowsDirectory(ptr word) GetWindowsDirectory(1 2)
135 pascal GetSystemDirectory(ptr word) GetSystemDirectory(1 2)
136 pascal GetDriveType(byte) GetWindowsDirectory(1)
136 pascal GetDriveType(byte) GetDriveType(1)
137 pascal FatalAppExit(word ptr) FatalAppExit(1 2)
152 return GetNumTasks 0 1
152 pascal GetNumTasks() GetNumTasks()
154 return GlobalNotify 4 0
163 pascal GlobalLRUOldest(word) ReturnArg(1)
164 pascal GlobalLRUNewest(word) ReturnArg(1)
@ -105,4 +112,11 @@ length 415
57 pascal GetProfileInt(ptr ptr word) GetProfileInt(1 2 3)
58 pascal GetProfileString(ptr ptr ptr ptr word) GetProfileString(1 2 3 4 5)
199 pascal SetHandleCount(word) SetHandleCount(1)
68 pascal InitAtomTable(word) InitAtomTable(1)
69 pascal FindAtom(ptr) FindAtom(1)
70 pascal AddAtom(ptr) AddAtom(1)
71 pascal DeleteAtom(word) DeleteAtom(1)
72 pascal GetAtomName(word ptr s_word) GetAtomName(1 2 3)
73 pascal GetAtomHandle(word) GetAtomHandle(1)
353 pascal lstrcpyn(ptr ptr word) lstrcpyn(1 2 3)

74
if1632/mmsystem.spec Normal file
View File

@ -0,0 +1,74 @@
# $Id: mmsystem.spec,v 1.3 1993/07/04 04:04:21 root Exp root $
#
name mmsystem
id 11
length 706
1 pascal LIBMAIN(word word word ptr) MCI_LibMain(1 2 3 4)
2 pascal SNDPLAYSOUND(ptr word) sndPlaySound(1 2)
5 pascal MMSYSTEMGETVERSION() mmsystemGetVersion()
30 pascal OUTPUTDEBUGSTR(ptr) OutputDebugStr(1)
201 pascal MIDIOUTGETNUMDEVS() midiOutGetNumDevs()
202 pascal MIDIOUTGETDEVCAPS(word ptr word) midiOutGetDevCaps(1 2 3)
203 pascal MIDIOUTGETERRORTEXT(word ptr word) midiOutGetErrorText(1 2 3)
204 pascal MIDIOUTOPEN(ptr word ptr long long long) midiOutOpen(1 2 3 4 5 6)
205 pascal MIDIOUTCLOSE(word) midiOutClose(1)
206 pascal MIDIOUTPREPAREHEADER(word ptr word) midiOutPrepareHeader(1 2 3)
207 pascal MIDIOUTUNPREPAREHEADER(word ptr word) midiOutUnprepareHeader(1 2 3)
208 pascal MIDIOUTSHORTMSG(word long) midiOutShortMsg(1 2)
209 pascal MIDIOUTLONGMSG(word ptr word) midiOutLongMsg(1 2 3)
210 pascal MIDIOUTRESET(word) midiOutReset(1)
211 pascal MIDIOUTGETVOLUME(word ptr) midiOutGetVolume(1 2)
212 pascal MIDIOUTSETVOLUME(word long) midiOutSetVolume(1 2)
215 pascal MIDIOUTGETID(word ptr) midiOutGetID(1 2)
301 pascal MIDIINGETNUMDEVS() midiInGetNumDevs()
302 pascal MIDIINGETDEVCAPS(word ptr word) midiInGetDevCaps(1 2 3)
303 pascal MIDIINGETERRORTEXT(word ptr word) midiInGetErrorText(1 2 3)
304 pascal MIDIINOPEN(ptr word ptr long long long) midiInOpen(1 2 3 4 5 6)
305 pascal MIDIINCLOSE(word) midiInClose(1)
306 pascal MIDIINPREPAREHEADER(word ptr word) midiInPrepareHeader(1 2 3)
307 pascal MIDIINUNPREPAREHEADER(word ptr word) midiInUnprepareHeader(1 2 3)
309 pascal MIDIINSTART(word) midiInStart(1)
310 pascal MIDIINSTOP(word) midiInStop(1)
311 pascal MIDIINRESET(word) midiInReset(1)
312 pascal MIDIINGETID(word ptr) midiInGetID(1 2)
350 pascal AUXGETNUMDEVS() auxGetNumDevs()
351 pascal AUXGETDEVCAPS(word ptr word) auxGetDevCaps(1 2 3)
352 pascal AUXGETVOLUME(word ptr) auxGetVolume(1 2)
353 pascal AUXSETVOLUME(word long) auxSetVolume(1 2)
401 pascal WAVEOUTGETNUMDEVS() waveOutGetNumDevs()
402 pascal WAVEOUTGETDEVCAPS(word ptr word) waveOutGetDevCaps(1 2 3)
403 pascal WAVEOUTGETERRORTEXT(word ptr word) waveOutGetErrorText(1 2 3)
404 pascal WAVEOUTOPEN(ptr word ptr long long long) waveOutOpen(1 2 3 4 5 6)
405 pascal WAVEOUTCLOSE(word) waveOutClose(1)
406 pascal WAVEOUTPREPAREHEADER(word ptr word) waveOutPrepareHeader(1 2 3)
407 pascal WAVEOUTUNPREPAREHEADER(word ptr word) waveOutUnprepareHeader(1 2 3)
408 pascal WAVEOUTWRITE(word ptr word) waveOutWrite(1 2 3)
409 pascal WAVEOUTPAUSE(word) waveOutPause(1)
410 pascal WAVEOUTRESTART(word) waveOutRestart(1)
411 pascal WAVEOUTRESET(word) waveOutReset(1)
412 pascal WAVEOUTGETPOSITION(word ptr word) waveOutGetPosition(1 2 3)
413 pascal WAVEOUTGETPITCH(word ptr) waveOutGetPitch(1 2)
414 pascal WAVEOUTSETPITCH(word long) waveOutSetPitch(1 2)
415 pascal WAVEOUTGETVOLUME(word ptr) waveOutGetVolume(1 2)
416 pascal WAVEOUTSETVOLUME(word long) waveOutSetVolume(1 2)
417 pascal WAVEOUTGETPLAYBACKRATE(word ptr) waveOutGetPlaybackRate(1 2)
418 pascal WAVEOUTSETPLAYBACKRATE(word long) waveOutSetPlaybackRate(1 2)
419 pascal WAVEOUTBREAKLOOP(word) waveOutBreakLoop(1)
420 pascal WAVEOUTGETID(word ptr) waveOutGetID(1 2)
501 pascal WAVEINGETNUMDEVS() waveInGetNumDevs()
502 pascal WAVEINGETDEVCAPS(word ptr word) waveInGetDevCaps(1 2 3)
503 pascal WAVEINGETERRORTEXT(word ptr word) waveInGetErrorText(1 2 3)
504 pascal WAVEINOPEN(ptr word ptr long long long) waveInOpen(1 2 3 4 5 6)
505 pascal WAVEINCLOSE(word) waveInClose(1)
506 pascal WAVEINPREPAREHEADER(word ptr word) waveInPrepareHeader(1 2 3)
507 pascal WAVEINUNPREPAREHEADER(word ptr word) waveInUnprepareHeader(1 2 3)
508 pascal WAVEINADDBUFFER(word ptr word) waveInAddBuffer(1 2 3)
509 pascal WAVEINSTART(word) waveInStart(1)
510 pascal WAVEINSTOP(word) waveInStop(1)
511 pascal WAVEINRESET(word) waveInReset(1)
513 pascal WAVEINGETID(word ptr) waveInGetID(1 2)
701 pascal MCISENDCOMMAND(word word long long) mciSendCommand(1 2 3 4)
702 pascal MCISENDSTRING(ptr ptr word word) mciSendString(1 2 3 4)
703 pascal MCIGETDEVICEID(ptr) mciSendCommand(1)
706 pascal MCIGETERRORSTRING(long ptr word) mciGetErrorString(1 2 3)

16
if1632/pop.h Normal file
View File

@ -0,0 +1,16 @@
add $8,%esp
popw %es
add $2,%esp
popw %ds
add $2,%esp
popl %edi
popl %esi
popl %ebp
add $4,%esp
popl %ebx
popl %edx
popl %ecx
popl %eax
add $16,%esp
popfl
add $20,%esp

View File

@ -3,3 +3,39 @@
name shell
id 6
length 256
#
# WARNING ! These functions are not documented, so I didn't look for
# proper parameters. It's just to have stub for PROGMAN.EXE ...
#
1 pascal RegOpenKey() RegOpenKey()
2 pascal RegCreateKey() RegCreateKey()
3 pascal RegCloseKey() RegCloseKey()
4 pascal RegDeleteKey() RegDeleteKey()
20 pascal ShellExecute(ptr) ShellExecute(1)
102 pascal RegisterShellHook(ptr) RegisterShellHook(1)
103 pascal ShellHookProc() ShellHookProc()
# 8 7 0000 WEP exported, shared data
# 33 9 0136 ABOUTDLGPROC exported, shared data
# 34 10 021a EXTRACTICON exported, shared data
# 21 4 1154 FINDEXECUTABLE exported, shared data
# 9 6 0052 DRAGACCEPTFILES exported, shared data
#100 4 0550 HERETHARBETYGARS exported, shared data
# 38 5 0000 FINDENVIRONMENTSTRING exported, shared data
# 7 2 14dc REGENUMKEY exported, shared data
# 37 5 00ae DOENVIRONMENTSUBST exported, shared data
# 20 4 110a SHELLEXECUTE exported, shared data
#101 8 010e FINDEXEDLGPROC exported, shared data
# 11 6 0094 DRAGQUERYFILE exported, shared data
# 13 6 0000 DRAGQUERYPOINT exported, shared data
# 5 2 16f4 REGSETVALUE exported, shared data
# 39 10 026e INTERNALEXTRACTICON exported, shared data
# 22 9 0000 SHELLABOUT exported, shared data
# 6 2 168e REGQUERYVALUE exported, shared data
# 32 9 0829 WCI exported, shared data
# 36 10 08dc EXTRACTASSOCIATEDICON exported, shared data
# 12 6 0142 DRAGFINISH exported, shared data

3
if1632/system.spec Normal file
View File

@ -0,0 +1,3 @@
name system
id 12
length 20

3
if1632/toolhelp.spec Normal file
View File

@ -0,0 +1,3 @@
name toolhelp
id 13
length 83

View File

@ -7,6 +7,7 @@ length 540
1 pascal MessageBox(word ptr ptr word) MessageBox(1 2 3 4)
5 pascal InitApp(word) USER_InitApp(1)
6 pascal PostQuitMessage(word) PostQuitMessage(1)
7 pascal ExitWindows(long word) ExitWindows(1 2)
10 pascal SetTimer(word word word ptr) SetTimer(1 2 3 4)
11 pascal SetSystemTimer(word word word ptr) SetSystemTimer(1 2 3 4)
12 pascal KillTimer(word word) KillTimer(1 2)
@ -21,6 +22,10 @@ length 540
21 pascal GetDoubleClickTime() GetDoubleClickTime()
22 pascal SetFocus(word) SetFocus(1)
23 pascal GetFocus() GetFocus()
24 pascal RemoveProp(word ptr) RemoveProp(1 2)
25 pascal GetProp(word ptr) GetProp(1 2)
26 pascal SetProp(word ptr word) SetProp(1 2 3)
27 pascal EnumProps(word ptr) EnumProps(1 2)
28 pascal ClientToScreen(word ptr) ClientToScreen(1 2)
29 pascal ScreenToClient(word ptr) ScreenToClient(1 2)
30 pascal WindowFromPoint(long) WindowFromPoint(1)
@ -91,6 +96,8 @@ length 540
96 pascal CheckRadioButton(word word word word) CheckRadioButton(1 2 3 4)
97 pascal CheckDlgButton(word word word) CheckDlgButton(1 2 3)
98 pascal IsDlgButtonChecked(word word) IsDlgButtonChecked(1 2)
99 pascal DlgDirSelect(word ptr word) DlgDirSelect(1 2 3)
100 pascal DlgDirList(word ptr word word word) DlgDirList(1 2 3 4 5)
101 pascal SendDlgItemMessage(word word word word long)
SendDlgItemMessage(1 2 3 4 5)
102 pascal AdjustWindowRect(ptr long word) AdjustWindowRect(1 2 3)
@ -107,7 +114,9 @@ length 540
118 pascal RegisterWindowMessage(ptr) RegisterWindowMessage(1)
119 pascal GetMessagePos() GetMessagePos()
120 pascal GetMessageTime() GetMessageTime()
121 pascal SetWindowsHook(s_word ptr) SetWindowsHook(1 2)
122 pascal CallWindowProc(ptr word word word long) CallWindowProc(1 2 3 4 5)
123 pascal CallMsgFilter(ptr s_word) CallMsgFilter(1 2)
124 pascal UpdateWindow(word) UpdateWindow(1)
125 pascal InvalidateRect(word ptr word) InvalidateRect(1 2 3)
126 pascal InvalidateRgn(word word word) InvalidateRgn(1 2 3)
@ -164,9 +173,14 @@ length 540
181 pascal SetSysColors(word ptr ptr) SetSysColors(1 2 3)
182 pascal KillSystemTimer(word word) KillSystemTimer(1 2)
183 pascal GetCaretPos(ptr) GetCaretPos(1)
185 pascal GrayString(word word ptr ptr word word word word word)
GrayString(1 2 3 4 5 6 7 8 9)
188 pascal SetSysModalWindow(word) SetSysModalWindow(1)
190 pascal GetUpdateRect(word ptr word) GetUpdateRect(1 2 3)
191 pascal ChildWindowFromPoint(word long) ChildWindowFromPoint(1 2)
193 pascal IsClipboardFormatAvailable(word) IsClipboardFormatAvailable(1)
194 pascal DlgDirSelectComboBox(word ptr word) DlgDirSelectComboBox(1 2 3)
195 pascal DlgDirListComboBox(word ptr word word word) DlgDirListComboBox(1 2 3 4 5)
200 pascal OpenComm(ptr word word) OpenComm(1 2 3)
201 pascal SetCommState(ptr) SetCommState(1)
202 pascal GetCommState(word ptr) GetCommState(1 2)
@ -189,12 +203,16 @@ length 540
220 pascal LoadMenuIndirect(ptr) LoadMenuIndirect(1)
221 pascal ScrollDC(word s_word s_word ptr ptr word ptr)
ScrollDC(1 2 3 4 5 6 7)
224 pascal GetWindowTask(word) GetWindowTask(1)
225 pascal EnumTaskWindows(word ptr long) EnumTaskWindows(1 2 3)
227 pascal GetNextDlgGroupItem(word word word) GetNextDlgGroupItem(1 2 3)
228 pascal GetNextDlgTabItem(word word word) GetNextDlgTabItem(1 2 3)
229 pascal GetTopWindow(word) GetTopWindow(1)
230 pascal GetNextWindow(word word) GetNextWindow(1 2)
232 pascal SetWindowPos(word word word word word word word)
SetWindowPos(1 2 3 4 5 6 7)
234 pascal UnhookWindowsHook(s_word ptr) UnhookWindowsHook(1 2)
235 pascal DefHookProc(s_word word long ptr) DefHookProc(1 2 3 4)
236 pascal GetCapture() GetCapture()
237 pascal GetUpdateRgn(word word word) GetUpdateRgn(1 2 3)
238 pascal ExcludeUpdateRgn(word word) ExcludeUpdateRgn(1 2)
@ -205,12 +223,17 @@ length 540
CreateDialogParam(1 2 3 4 5)
242 pascal CreateDialogIndirectParam(word ptr word ptr long)
CreateDialogIndirectParam(1 2 3 4 5)
243 pascal GetDialogBaseUnits() GetDialogBaseUnits()
244 pascal EqualRect(ptr ptr) EqualRect(1 2)
248 pascal GetOpenClipboardWindow() GetOpenClipboardWindow()
258 pascal MapWindowPoints(word word ptr word) MapWindowPoints(1 2 3 4)
262 pascal GetWindow(word word) GetWindow(1 2)
266 pascal SetMessageQueue(word) SetMessageQueue(1)
267 pascal ShowScrollBar(word word word) ShowScrollBar(1 2 3)
268 pascal GlobalAddAtom(ptr) GlobalAddAtom(1)
269 pascal GlobalDeleteAtom(word) GlobalDeleteAtom(1)
270 pascal GlobalFindAtom(ptr) GlobalFindAtom(1)
271 pascal GlobalGetAtomName(word ptr s_word) GlobalGetAtomName(1 2 3)
272 pascal IsZoomed(word) IsZoomed(1)
277 pascal GetDlgCtrlID(word) GetDlgCtrlID(1)
282 pascal SelectPalette(word word word) SelectPalette(1 2 3)
@ -219,6 +242,9 @@ length 540
286 pascal GetDesktopWindow() GetDesktopWindow()
288 pascal GetMessageExtraInfo() GetMessageExtraInfo()
290 pascal RedrawWindow(word ptr word word) RedrawWindow(1 2 3 4)
291 pascal SetWindowsHookEx(s_word ptr word word) SetWindowsHookEx(1 2 3 4)
292 pascal UnhookWindowsHookEx(ptr) UnhookWindowsHookEx(1)
293 pascal CallNextHookEx(ptr s_word word long) CallNextHookEx(1 2 3 4)
308 pascal DefDlgProc(word word word long) DefDlgProc(1 2 3 4)
319 pascal ScrollWindowEx(word s_word s_word ptr ptr word ptr word)
ScrollWindowEx(1 2 3 4 5 6 7 8)

View File

@ -7,44 +7,44 @@ name winsock
id 9
length 155
1 pascal accept(long ptr ptr) Winsock_accept(1 2 3)
2 pascal bind(long ptr word) Winsock_bind(1 2 3)
3 pascal closesocket(long) Winsock_closesocket(1)
4 pascal connect(long ptr word) Winsock_connect(1 2 3)
5 pascal getpeername(long ptr ptr) Winsock_getpeername(1 2 3)
6 pascal getsockname(long ptr ptr) Winsock_getsockname(1 2 3)
7 pascal getsockopt(long word word ptr ptr)
1 pascal accept(word ptr ptr) Winsock_accept(1 2 3)
2 pascal bind(word ptr word) Winsock_bind(1 2 3)
3 pascal closesocket(word) Winsock_closesocket(1)
4 pascal connect(word ptr word) Winsock_connect(1 2 3)
5 pascal getpeername(word ptr ptr) Winsock_getpeername(1 2 3)
6 pascal getsockname(word ptr ptr) Winsock_getsockname(1 2 3)
7 pascal getsockopt(word word word ptr ptr)
Winsock_getsockopt(1 2 3 4 5)
8 pascal htonl(long) Winsock_htonl(1)
9 pascal htons(word) Winsock_htons(1)
10 pascal inet_addr(ptr) Winsock_inet_addr(1)
10 pascal inet_addr(long) Winsock_inet_addr(1)
11 pascal inet_ntoa(long) Winsock_inet_ntoa(1)
12 pascal ioctlsocket(long long ptr) Winsock_ioctlsocket(1 2 3)
13 pascal listen(long word) Winsock_listen(1 2)
12 pascal ioctlsocket(word long ptr) Winsock_ioctlsocket(1 2 3)
13 pascal listen(word word) Winsock_listen(1 2)
14 pascal ntohl(long) Winsock_ntohl(1)
15 pascal ntohs(word) Winsock_ntohs(1)
16 pascal recv(long ptr word word) Winsock_recv(1 2 3 4)
17 pascal recvfrom(long ptr word word ptr ptr)
16 pascal recv(word ptr word word) Winsock_recv(1 2 3 4)
17 pascal recvfrom(word ptr word word ptr ptr)
Winsock_recvfrom(1 2 3 4 5 6)
18 pascal select(word ptr ptr ptr ptr word)
Winsock_select(1 2 3 4 5 6)
19 pascal send(long ptr word word) Winsock_send(1 2 3 4)
20 pascal sendto(long ptr word word ptr ptr)
19 pascal send(word ptr word word) Winsock_send(1 2 3 4)
20 pascal sendto(word ptr word word ptr ptr)
Winsock_sendto(1 2 3 4 5 6)
21 pascal setsockopt(long word word ptr word)
21 pascal setsockopt(word word word ptr word)
Winsock_setsockopt(1 2 3 4 5)
22 pascal shutdown(long word) Winsock_shutdown(1 2)
22 pascal shutdown(word word) Winsock_shutdown(1 2)
23 pascal socket(word word word) Winsock_socket(1 2 3)
51 pascal gethostbyaddr(ptr word word) Winsock_gethostbyaddr(1 2 3)
52 pascal gethostbyname(ptr) Winsock_gethostbyname(1)
53 pascal getprotobyname(ptr) Winsock_getprotobyname(1)
54 pascal getprotobynumber(word) Winsock_getprotobynumber(1)
55 pascal getservbyname(ptr) Winsock_getservbyname(1)
55 pascal getservbyname(ptr ptr) Winsock_getservbyname(1 2)
56 pascal getservbyport(word ptr) Winsock_getservbyport(1 2)
57 pascal gethostname(ptr word) Winsock_gethostname(1 2)
101 pascal WSAAsyncSelect(long word word long)
101 pascal WSAAsyncSelect(word word word long)
WSAAsyncSelect(1 2 3 4)
102 pascal WSAAsyncGetHostByAddr(word word ptr word word ptr word)
WSAAsyncGetHostByAddr(1 2 3 4 5 6 7)
@ -68,4 +68,4 @@ length 155
115 pascal WSAStartup(word ptr) WSAStartup(1 2)
116 pascal WSACleanup() WSACleanup()
151 pascal __WSAFDIsSet(long ptr) WSAFDIsSet(1 2)
151 pascal __WSAFDIsSet(word ptr) WSAFDIsSet(1 2)

70
include/driver.h Normal file
View File

@ -0,0 +1,70 @@
/*
* Drivers definitions
*/
#define DRV_LOAD 0x0001
#define DRV_ENABLE 0x0002
#define DRV_OPEN 0x0003
#define DRV_CLOSE 0x0004
#define DRV_DISABLE 0x0005
#define DRV_FREE 0x0006
#define DRV_CONFIGURE 0x0007
#define DRV_QUERYCONFIGURE 0x0008
#define DRV_INSTALL 0x0009
#define DRV_REMOVE 0x000A
#define DRV_EXITSESSION 0x000B
#define DRV_EXITAPPLICATION 0x000C
#define DRV_POWER 0x000F
#define DRV_RESERVED 0x0800
#define DRV_USER 0x4000
#define DRVCNF_CANCEL 0x0000
#define DRVCNF_OK 0x0001
#define DRVCNF_RESTART 0x0002
#define DRVEA_NORMALEXIT 0x0001
#define DRVEA_ABNORMALEXIT 0x0002
#define GND_FIRSTINSTANCEONLY 0x00000001
#define GND_FORWARD 0x00000000
#define GND_REVERSE 0x00000002
typedef struct {
DWORD dwDCISize;
LPCSTR lpszDCISectionName;
LPCSTR lpszDCIAliasName;
} DRVCONFIGINFO;
typedef DRVCONFIGINFO FAR* LPDRVCONFIGINFO;
typedef struct {
UINT length;
HDRVR hDriver;
HINSTANCE hModule;
char szAliasName[128];
} DRIVERINFOSTRUCT;
typedef DRIVERINFOSTRUCT FAR* LPDRIVERINFOSTRUCT;
typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
typedef struct {
DRIVERINFOSTRUCT dis;
WORD count;
void *lpPrevItem;
void *lpNextItem;
DRIVERPROC lpDrvProc;
} DRIVERITEM;
typedef DRIVERITEM FAR* LPDRIVERITEM;
LRESULT DefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2);
HDRVR WINAPI OpenDriver(LPSTR szDriverName, LPSTR szSectionName, LPARAM lParam2);
LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
LRESULT WINAPI SendDriverMessage(HDRVR hDriver, WORD message, LPARAM lParam1, LPARAM lParam2);
HINSTANCE WINAPI GetDriverModuleHandle(HDRVR hDriver);
HDRVR WINAPI GetNextDriver(HDRVR, DWORD);
BOOL WINAPI GetDriverInfo(HDRVR, DRIVERINFOSTRUCT FAR*);

View File

@ -290,8 +290,9 @@ typedef struct tagDC
extern MDESC *GDI_Heap;
#define GDI_HEAP_ALLOC(f,size) ((int)HEAP_Alloc(&GDI_Heap,f,size) & 0xffff)
#define GDI_HEAP_ADDR(handle) ((void *)((handle)|((int)GDI_Heap & 0xffff0000)))
#define GDI_HEAP_FREE(handle) (HEAP_Free(&GDI_Heap,GDI_HEAP_ADDR(handle)))
#define GDI_HEAP_ADDR(handle) \
((void *)((handle) ? ((handle) | ((int)GDI_Heap & 0xffff0000)) : 0))
#endif

42
include/hook.h Normal file
View File

@ -0,0 +1,42 @@
/*
* Windows hook definitions
*
* Copyright 1994 Alexandre Julliard
*/
#ifndef HOOK_H
#define HOOK_H
#include "windows.h"
#include "user.h"
/* Hook data (pointed to by a HHOOK) */
typedef struct
{
HHOOK next; /* Next hook in chain */
HOOKPROC proc; /* Hook procedure */
short id; /* Hook id (WH_???) */
HTASK htask; /* Task owning this hook */
} HOOKDATA;
#define FIRST_HOOK WH_MSGFILTER
#define LAST_HOOK WH_SHELL
#define SYSTEM_HOOK(id) (systemHooks[(id)-FIRST_HOOK])
#define TASK_HOOK(id) (taskHooks[(id)-FIRST_HOOK])
#define INTERNAL_CALL_HOOK(hhook,code,wparam,lparam) \
((hhook) ? CallHookProc(((HOOKDATA*)(hhook))->proc,code,wparam,lparam) : 0)
#define CALL_SYSTEM_HOOK(id,code,wparam,lparam) \
INTERNAL_CALL_HOOK(SYSTEM_HOOK(id),code,wparam,lparam)
#define CALL_TASK_HOOK(id,code,wparam,lparam) \
INTERNAL_CALL_HOOK(TASK_HOOK(id),code,wparam,lparam)
extern DWORD CallHookProc( HOOKPROC func, short code,
WPARAM wParam, LPARAM lParam ); /* callback.c */
extern HHOOK systemHooks[];
extern HHOOK taskHooks[];
#endif /* HOOK_H */

View File

@ -28,6 +28,8 @@ typedef struct
HWND hwndHitTest;
BOOL flagMenuAltered;
BOOL flagChildMaximized;
RECT rectMaximize;
RECT rectRestore;
} MDICLIENTINFO;
#endif /* MDI_H */

View File

@ -65,7 +65,8 @@ typedef struct
char item_text[1]; /* Text for menu item */
} MENUITEMTEMPLATE;
void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop);
void StdDrawMenuBar(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop,
BOOL suppress_draw);
BOOL MenuButtonDown(HWND hWnd, LPPOPUPMENU lppop, int x, int y);
void MenuButtonUp(HWND hWnd, LPPOPUPMENU lppop, int x, int y);
void MenuMouseMove(HWND hWnd, LPPOPUPMENU lppop, WORD wParam, int x, int y);

View File

@ -53,5 +53,7 @@ extern BOOL MSG_CreateSysMsgQueue( int size );
extern void hardware_event( WORD message, WORD wParam, LONG lParam,
int xPos, int yPos, DWORD time, DWORD extraInfo );
extern BOOL MSG_GetHardwareMessage( LPMSG msg );
extern BOOL MSG_InternalGetMessage( LPMSG msg, HWND hwnd,
short code, BOOL sendIdle );
#endif /* MESSAGE_H */

45
include/metafile.h Normal file
View File

@ -0,0 +1,45 @@
/*
* Metafile definitions
*
* Copyright David W. Metcalfe, 1994
*/
#ifndef METAFILE_H
#define METAFILE_H
#include "windows.h"
#define MFHEADERSIZE (sizeof(METAHEADER))
#define MFVERSION 0x300
#define META_EOF 0x0000
typedef struct tagMETAFILE
{
WORD wMagic; /* `PO' */
char Filename[80]; /* metafile name, if disk based */
int hFile; /* MSDOS file handle for metafile */
HANDLE hMetaHdr; /* handle of metafile header */
int MetaOffset; /* offset of current record in metafile */
HANDLE hBuffer; /* handle of buffer for disk based metafiles */
} METAFILE;
typedef METAFILE *LPMETAFILE;
BOOL MF_WriteRecord(HMETAFILE hmf, METARECORD *mr, WORD rlen);
BOOL MF_MetaParam1(DC *dc, short func, short param1);
BOOL MF_MetaParam2(DC *dc, short func, short param1, short param2);
BOOL MF_MetaParam4(DC *dc, short func, short param1, short param2,
short param3, short param4);
BOOL MF_MetaParam6(DC *dc, short func, short param1, short param2,
short param3, short param4, short param5, short param6);
BOOL MF_MetaParam8(DC *dc, short func, short param1, short param2,
short param3, short param4, short param5,
short param6, short param7, short param8);
BOOL MF_CreateBrushIndirect(DC *dc, LOGBRUSH *logbrush);
BOOL MF_CreatePatternBrush(DC *dc, LOGBRUSH *logbrush);
BOOL MF_CreatePenIndirect(DC *dc, LOGPEN *logpen);
BOOL MF_TextOut(DC *dc, short x, short y, LPSTR str, short count);
BOOL MF_MetaPoly(DC *dc, short func, LPPOINT pt, short count);
#endif /* METAFILE_H */

1390
include/mmsystem.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@ struct dosdirent {
};
#define DOSVERSION 0x0330;
#define MAX_DOS_DRIVES 26
#define EAX context->sc_eax
#define EBX context->sc_ebx

View File

@ -4,19 +4,21 @@
#ifndef REGFUNC_H
#define REGFUNC_H
#include "wine.h"
extern unsigned short *Stack16Frame;
#define _CONTEXT &Stack16Frame[12]
#define _AX Stack16Frame[34]
#define _BX Stack16Frame[28]
#define _CX Stack16Frame[32]
#define _DX Stack16Frame[30]
#define _SP Stack16Frame[26]
#define _BP Stack16Frame[24]
#define _SI Stack16Frame[22]
#define _DI Stack16Frame[20]
#define _DS Stack16Frame[18]
#define _ES Stack16Frame[16]
#define _CONTEXT ((struct sigcontext_struct *) &Stack16Frame[12])
#define _AX (_CONTEXT->sc_eax)
#define _BX (_CONTEXT->sc_ebx)
#define _CX (_CONTEXT->sc_ecx)
#define _DX (_CONTEXT->sc_edx)
#define _SP (_CONTEXT->sc_esp)
#define _BP (_CONTEXT->sc_ebp)
#define _SI (_CONTEXT->sc_esi)
#define _DI (_CONTEXT->sc_edi)
#define _DS (_CONTEXT->sc_ds)
#define _ES (_CONTEXT->sc_es)
extern void ReturnFromRegisterFunc(void);

40
include/shell.h Normal file
View File

@ -0,0 +1,40 @@
/*
* Shell Library definitions
*/
#define ERROR_SUCCESS 0L
#define ERROR_BADDB 1L
#define ERROR_BADKEY 2L
#define ERROR_CANTOPEN 3L
#define ERROR_CANTREAD 4L
#define ERROR_CANTWRITE 5L
#define ERROR_OUTOFMEMORY 6L
#define ERROR_INVALID_PARAMETER 7L
#define ERROR_ACCESS_DENIED 8L
#define REG_SZ 1 /* string type */
#define HKEY_CLASSES_ROOT 1
typedef DWORD HKEY;
typedef HKEY FAR* LPHKEY;
typedef struct tagKEYSTRUCT {
HKEY hKey;
LPSTR lpSubKey;
DWORD dwType;
LPSTR lpValue;
struct tagKEYSTRUCT *lpPrevKey;
struct tagKEYSTRUCT *lpNextKey;
struct tagKEYSTRUCT *lpSubLvl;
} KEYSTRUCT;
typedef KEYSTRUCT *LPKEYSTRUCT;
#define SE_ERR_SHARE 26
#define SE_ERR_ASSOCINCOMPLETE 27
#define SE_ERR_DDETIMEOUT 28
#define SE_ERR_DDEFAIL 29
#define SE_ERR_DDEBUSY 30
#define SE_ERR_NOASSOC 31

39
include/syscolor.h Normal file
View File

@ -0,0 +1,39 @@
/*
* System color objects
*
* Copyright Alexandre Julliard, 1994
*/
#ifndef SYSCOLOR_H
#define SYSCOLOR_H
#include "gdi.h"
struct SysColorObjects
{
HBRUSH hbrushScrollbar; /* COLOR_SCROLLBAR */
/* COLOR_BACKGROUND */
HBRUSH hbrushActiveCaption; /* COLOR_ACTIVECAPTION */
HBRUSH hbrushInactiveCaption; /* COLOR_INACTIVECAPTION */
/* COLOR_MENU */
HBRUSH hbrushWindow; /* COLOR_WINDOW */
HPEN hpenWindowFrame; /* COLOR_WINDOWFRAME */
/* COLOR_MENUTEXT */
HPEN hpenWindowText; /* COLOR_WINDOWTEXT */
/* COLOR_CAPTIONTEXT */
HBRUSH hbrushActiveBorder; /* COLOR_ACTIVEBORDER */
HBRUSH hbrushInactiveBorder; /* COLOR_INACTIVEBORDER */
/* COLOR_APPWORKSPACE */
/* COLOR_HIGHLIGHT */
/* COLOR_HIGHLIGHTTEXT */
HBRUSH hbrushBtnFace; /* COLOR_BTNFACE */
HBRUSH hbrushBtnShadow; /* COLOR_BTNSHADOW */
/* COLOR_GRAYTEXT */
/* COLOR_BTNTEXT */
/* COLOR_INACTIVECAPTIONTEXT */
HBRUSH hbrushBtnHighlight; /* COLOR_BTNHIGHLIGHT */
};
extern struct SysColorObjects sysColorObjects;
#endif /* SYSCOLOR_H */

27
include/task.h Normal file
View File

@ -0,0 +1,27 @@
/*
* Task definitions
*/
#ifndef TASK_H
#define TASK_H
typedef struct {
HANDLE hTask;
HANDLE hModule;
HINSTANCE hInst;
int unix_pid;
HICON hIcon;
HWND *lpWndList;
void *lpPrevTask;
void *lpNextTask;
} TASKENTRY;
typedef TASKENTRY *LPTASKENTRY;
#define MAXWIN_PER_TASK 256
HANDLE CreateNewTask(HINSTANCE hInst);
BOOL RemoveWindowFromTask(HTASK hTask, HWND hWnd);
BOOL AddWindowToTask(HTASK hTask, HWND hWnd);
#endif /* TASK_H */

View File

@ -25,8 +25,9 @@ extern MDESC *USER_Heap;
#define USER_HEAP_ALLOC(f,size) ((int)HEAP_Alloc(&USER_Heap,f,size) & 0xffff)
#define USER_HEAP_REALLOC(handle,size,f) ((int)HEAP_ReAlloc(&USER_Heap, \
USER_HEAP_ADDR(handle),size,f) & 0xffff)
#define USER_HEAP_ADDR(handle) ((void *)((handle)|((int)USER_Heap&0xffff0000)))
#define USER_HEAP_FREE(handle) (HEAP_Free(&USER_Heap,USER_HEAP_ADDR(handle)))
#define USER_HEAP_ADDR(handle) \
((void *)((handle) ? ((handle) | ((int)USER_Heap & 0xffff0000)) : 0))
#endif /* WINELIB */

View File

@ -36,19 +36,21 @@ typedef struct tagWND
POINT ptMaxPos; /* Maximized window position */
HANDLE hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HWND hwndPrevActive; /* Previous active top-level window */
HWND hwndLastActive; /* Last active popup hwnd */
FARPROC lpfnWndProc; /* Window procedure */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HMENU hmenuSystem; /* System menu */
void *VScroll; /* Vertical ScrollBar Struct Pointer */
void *HScroll; /* Horizontal ScrollBar Struct Pointer */
void *VScroll; /* Vertical ScrollBar Struct Pointer */
void *HScroll; /* Horizontal ScrollBar Struct Pointer */
WORD wIDmenu; /* ID or hmenu (from CreateWindow) */
HANDLE hText; /* Handle of window text */
WORD flags; /* Misc. flags (see below) */
Window window; /* X window */
HMENU hSysMenu; /* window's copy of System Menu */
HMENU hSysMenu; /* window's copy of System Menu */
HANDLE hProp; /* Handle of Properties List */
HTASK hTask; /* Task Handle of the owner */
WORD wExtra[1]; /* Window extra bytes */
} WND;

View File

@ -9,15 +9,24 @@ typedef short INT;
typedef unsigned short UINT;
typedef unsigned short WORD;
typedef unsigned long DWORD;
#ifndef _WINMAIN
typedef unsigned short BOOL;
typedef unsigned char BYTE;
#endif
typedef char *LPSTR;
typedef const char *LPCSTR;
typedef char *NPSTR;
typedef INT *LPINT;
typedef void *LPVOID;
typedef long (*FARPROC)();
typedef FARPROC DLGPROC;
typedef int CATCHBUF[9];
typedef int *LPCATCHBUF;
typedef FARPROC HOOKPROC;
typedef long LONG;
typedef UINT WPARAM;
typedef LONG LPARAM;
typedef LONG LRESULT;
typedef WORD HANDLE;
typedef DWORD HHOOK;
#define DECLARE_HANDLE(a) typedef HANDLE a;
DECLARE_HANDLE(HTASK);
@ -37,19 +46,10 @@ DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HBRUSH);
DECLARE_HANDLE(LOCALHANDLE);
typedef char *LPSTR;
typedef const char *LPCSTR;
typedef char *NPSTR;
typedef short *LPINT;
typedef void *LPVOID;
typedef long (*FARPROC)();
typedef FARPROC DLGPROC;
typedef int CATCHBUF[9];
typedef int *LPCATCHBUF;
#define TRUE 1
#define FALSE 0
#define CW_USEDEFAULT ((short)0x8000)
#define CW_USEDEFAULT ((INT)0x8000)
#define FAR
#define NEAR
#define PASCAL
@ -113,15 +113,15 @@ typedef int *LPCATCHBUF;
#endif
*/
typedef struct { short x, y; } POINT;
typedef struct { INT x, y; } POINT;
typedef POINT *PPOINT;
typedef POINT *NPPOINT;
typedef POINT *LPPOINT;
typedef struct
{
short cx;
short cy;
INT cx;
INT cy;
} SIZE, *LPSIZE;
#define MAKEPOINT(l) (*((POINT *)&(l)))
@ -129,7 +129,7 @@ typedef struct
#define MAKELPARAM(low, high) ((LONG)(((WORD)(low)) | \
(((DWORD)((WORD)(high))) << 16)))
typedef struct { short left, top, right, bottom; } RECT;
typedef struct { INT left, top, right, bottom; } RECT;
typedef RECT *LPRECT;
typedef RECT *NPRECT;
typedef RECT *PRECT;
@ -167,7 +167,7 @@ typedef struct {
#else
LONG (*lpfnWndProc)() WINE_PACKED;
#endif
short cbClsExtra, cbWndExtra;
INT cbClsExtra, cbWndExtra;
HANDLE hInstance;
HICON hIcon;
HCURSOR hCursor;
@ -209,10 +209,10 @@ typedef struct {
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
short cy;
short cx;
short y;
short x;
INT cy;
INT cx;
INT y;
INT x;
LONG style WINE_PACKED;
char * lpszName WINE_PACKED;
char * lpszClass WINE_PACKED;
@ -230,10 +230,10 @@ typedef struct
LPSTR szClass;
LPSTR szTitle;
HANDLE hOwner;
short x;
short y;
short cx;
short cy;
INT x;
INT y;
INT cx;
INT cy;
LONG style WINE_PACKED;
LONG lParam WINE_PACKED;
} MDICREATESTRUCT, *LPMDICREATESTRUCT;
@ -380,7 +380,118 @@ typedef struct
#define SC_SCREENSAVE 0xf140
#define SC_HOTKEY 0xf150
/* Dialogs */
/***** Window hooks *****/
/* Hook values */
#define WH_JOURNALRECORD 0
#define WH_JOURNALPLAYBACK 1
#define WH_KEYBOARD 2
#define WH_GETMESSAGE 3
#define WH_CALLWNDPROC 4
#define WH_CBT 5
#define WH_SYSMSGFILTER 6
#define WH_MOUSE 7
#define WH_HARDWARE 8
#define WH_DEBUG 9
#define WH_SHELL 10
#define WH_MSGFILTER (-1)
/* Hook action codes */
#define HC_ACTION 0
#define HC_GETNEXT 1
#define HC_SKIP 2
#define HC_NOREMOVE 3
#define HC_NOREM HC_NOREMOVE
#define HC_SYSMODALON 4
#define HC_SYSMODALOFF 5
/* CallMsgFilter() values */
#define MSGF_DIALOGBOX 0
#define MSGF_MENU 2
#define MSGF_MOVE 3
#define MSGF_SIZE 4
#define MSGF_SCROLLBAR 5
#define MSGF_NEXTWINDOW 6
#define MSGF_MAINLOOP 8
#define MSGF_USER 4096
/* Journalling hook values */
#define HC_GETNEXT 1
#define HC_SKIP 2
#define HC_NOREMOVE 3
#define HC_NOREM HC_NOREMOVE
#define HC_SYSMODALON 4
#define HC_SYSMODALOFF 5
/* Journalling hook structure */
typedef struct tagEVENTMSG
{
UINT message;
UINT paramL;
UINT paramH;
DWORD time WINE_PACKED;
} EVENTMSG, *LPEVENTMSG;
/* Mouse hook structure */
typedef struct tagMOUSEHOOKSTRUCT
{
POINT pt;
HWND hwnd;
WORD wHitTestCode;
DWORD dwExtraInfo;
} MOUSEHOOKSTRUCT, *LPMOUSEHOOKSTRUCT;
/* Hardware hook structure */
typedef struct tagHARDWAREHOOKSTRUCT
{
HWND hWnd;
UINT wMessage;
WPARAM wParam;
LPARAM lParam WINE_PACKED;
} HARDWAREHOOKSTRUCT;
/* CBT hook values */
#define HCBT_MOVESIZE 0
#define HCBT_MINMAX 1
#define HCBT_QS 2
#define HCBT_CREATEWND 3
#define HCBT_DESTROYWND 4
#define HCBT_ACTIVATE 5
#define HCBT_CLICKSKIPPED 6
#define HCBT_KEYSKIPPED 7
#define HCBT_SYSCOMMAND 8
#define HCBT_SETFOCUS 9
/* CBT hook structures */
typedef struct tagCBT_CREATEWND
{
CREATESTRUCT *lpcs;
HWND hwndInsertAfter;
} CBT_CREATEWND, *LPCBT_CREATEWND;
typedef struct tagCBTACTIVATESTRUCT
{
BOOL fMouse;
HWND hWndActive;
} CBTACTIVATESTRUCT;
/* Shell hook values */
#define HSHELL_WINDOWCREATED 1
#define HSHELL_WINDOWDESTROYED 2
#define HSHELL_ACTIVATESHELLWINDOW 3
/* Debug hook structure */
typedef struct tagDEBUGHOOKINFO
{
HANDLE hModuleHook;
LPARAM reserved WINE_PACKED;
LPARAM lParam WINE_PACKED;
WPARAM wParam;
short code;
} DEBUGHOOKINFO, *LPDEBUGHOOKINFO;
/***** Dialogs *****/
/* cbWndExtra bytes for dialog class */
#define DLGWINDOWEXTRA 30
@ -529,10 +640,10 @@ typedef DWORD COLORREF;
typedef struct tagBITMAP
{
short bmType;
short bmWidth;
short bmHeight;
short bmWidthBytes;
INT bmType;
INT bmWidth;
INT bmHeight;
INT bmWidthBytes;
BYTE bmPlanes;
BYTE bmBitsPixel;
void * bmBits WINE_PACKED;
@ -548,7 +659,7 @@ typedef struct tagLOGBRUSH
{
WORD lbStyle;
COLORREF lbColor WINE_PACKED;
short lbHatch;
INT lbHatch;
} LOGBRUSH, *PLOGBRUSH, *NPLOGBRUSH, *LPLOGBRUSH;
/* Brush styles */
@ -573,7 +684,7 @@ typedef struct tagLOGBRUSH
#define LF_FACESIZE 32
typedef struct tagLOGFONT
{
short lfHeight, lfWidth, lfEscapement, lfOrientation, lfWeight;
INT lfHeight, lfWidth, lfEscapement, lfOrientation, lfWeight;
BYTE lfItalic, lfUnderline, lfStrikeOut, lfCharSet;
BYTE lfOutPrecision, lfClipPrecision, lfQuality, lfPitchAndFamily;
BYTE lfFaceName[LF_FACESIZE] WINE_PACKED;
@ -640,14 +751,14 @@ typedef struct tagLOGFONT
typedef struct tagTEXTMETRIC
{
short tmHeight;
short tmAscent;
short tmDescent;
short tmInternalLeading;
short tmExternalLeading;
short tmAveCharWidth;
short tmMaxCharWidth;
short tmWeight;
INT tmHeight;
INT tmAscent;
INT tmDescent;
INT tmInternalLeading;
INT tmExternalLeading;
INT tmAveCharWidth;
INT tmMaxCharWidth;
INT tmWeight;
BYTE tmItalic;
BYTE tmUnderlined;
BYTE tmStruckOut;
@ -657,9 +768,9 @@ typedef struct tagTEXTMETRIC
BYTE tmBreakChar;
BYTE tmPitchAndFamily;
BYTE tmCharSet;
short tmOverhang;
short tmDigitizedAspectX;
short tmDigitizedAspectY;
INT tmOverhang;
INT tmDigitizedAspectX;
INT tmDigitizedAspectY;
} TEXTMETRIC, *PTEXTMETRIC, *NPTEXTMETRIC, *LPTEXTMETRIC;
/* tmPitchAndFamily values */
@ -966,10 +1077,10 @@ typedef BITMAPINFO *PBITMAPINFO;
typedef struct tagBITMAPCOREHEADER
{
unsigned long bcSize;
unsigned short bcWidth;
unsigned short bcHeight;
unsigned short bcPlanes;
unsigned short bcBitCount;
UINT bcWidth;
UINT bcHeight;
UINT bcPlanes;
UINT bcBitCount;
} BITMAPCOREHEADER;
#define DIB_RGB_COLORS 0
@ -2214,9 +2325,9 @@ Fa(ATOM,RegisterClass,LPWNDCLASS,a)
Fa(BOOL,TranslateMessage,LPMSG,a)
Fa(void,PostQuitMessage,int,a)
Fa(BOOL,SetMessageQueue,int,a)
Fa(int,_lclose,int,a)
Fb(int,_lopen,LPSTR,a,int,b)
Fa(int,lstrlen,LPCSTR,a)
Fa(INT,_lclose,INT,a)
Fb(INT,_lopen,LPSTR,a,INT,b)
Fa(INT,lstrlen,LPCSTR,a)
Fa(LONG,DispatchMessage,LPMSG,msg)
Fa(void,UpdateWindow,HWND,a)
Fa(ATOM,AddAtom,LPCSTR,a)
@ -2257,6 +2368,7 @@ Fa(BOOL,RemoveFontResource,LPSTR,a)
Fa(BOOL,SetDeskWallPaper,LPSTR,a)
Fa(BOOL,SetErrorMode,WORD,a)
Fa(BOOL,SwapMouseButton,BOOL,a)
Fa(BOOL,UnhookWindowsHookEx,HHOOK,a)
Fa(BOOL,UnrealizeObject,HBRUSH,a)
Fa(BYTE,GetTempDrive,BYTE,a)
Fa(DWORD,GetAspectRatioFilter,HDC,a)
@ -2351,7 +2463,7 @@ Fa(WORD,AllocSelector,WORD,a)
Fa(WORD,ArrangeIconicWindows,HWND,a)
Fa(WORD,EnumClipboardFormats,WORD,a)
Fa(WORD,FreeSelector,WORD,a)
Fa(WORD,GetDriveType,int,a)
Fa(WORD,GetDriveType,INT,a)
Fa(WORD,GetMenuItemCount,HMENU,a)
Fa(WORD,GetTaskQueue,HANDLE,a)
Fa(WORD,GetTextAlign,HDC,a)
@ -2423,14 +2535,14 @@ Fb(BOOL,ShowWindow,HWND,a,int,b)
Fb(HDC,BeginPaint,HWND,a,LPPAINTSTRUCT,b)
Fb(LPSTR,lstrcat,LPSTR,a,LPCSTR,b )
Fb(LPSTR,lstrcpy,LPSTR,a,LPCSTR,b )
Fb(int,_lcreat,LPSTR,a,int,b)
Fb(int,lstrcmp,LPCSTR,a,LPCSTR,b )
Fb(int,lstrcmpi,LPCSTR,a,LPCSTR,b )
Fb(INT,_lcreat,LPSTR,a,INT,b)
Fb(INT,lstrcmp,LPCSTR,a,LPCSTR,b )
Fb(INT,lstrcmpi,LPCSTR,a,LPCSTR,b )
Fb(void,EndPaint,HWND,a,LPPAINTSTRUCT,b)
Fb(void,GetClientRect,HWND,a,LPRECT,b)
Fb(void,SetDCState,HDC,a,HDC,b)
Fb(BOOL,UnregisterClass,LPSTR,a,HANDLE,b)
Fb(BOOL,CallMsgFilter,LPMSG,a,int,b)
Fb(BOOL,CallMsgFilter,LPMSG,a,short,b)
Fb(BOOL,ChangeClipboardChain,HWND,a,HWND,b)
Fb(BOOL,EnableWindow,HWND,a,BOOL,b)
Fb(BOOL,EnumWindows,FARPROC,a,LONG,b)
@ -2454,14 +2566,14 @@ Fb(BOOL,RestoreDC,HDC,a,short,b)
Fb(BOOL,SetConvertParams,int,a,int,b)
Fb(BOOL,SetMenu,HWND,a,HMENU,b)
Fb(BOOL,TranslateMDISysAccel,HWND,a,LPMSG,b)
Fb(BOOL,UnhookWindowsHook,int,a,FARPROC,b)
Fb(BOOL,UnhookWindowsHook,short,a,HHOOK,b)
Fb(DWORD,GetNearestColor,HDC,a,DWORD,b)
Fb(DWORD,SetBkColor,HDC,a,COLORREF,b)
Fb(DWORD,SetMapperFlags,HDC,a,DWORD,b)
Fb(DWORD,SetTextColor,HDC,a,DWORD,b)
Fb(FARPROC,GetProcAddress,HANDLE,a,LPSTR,b)
Fb(FARPROC,MakeProcInstance,FARPROC,a,HANDLE,b)
Fb(FARPROC,SetWindowsHook,int,a,FARPROC,b)
Fb(HHOOK,SetWindowsHook,short,a,HOOKPROC,b)
Fb(HANDLE,CopyMetaFile,HANDLE,a,LPSTR,b)
Fb(HANDLE,GetProp,HWND,a,LPSTR,b)
#ifndef GLOBAL_SOURCE
@ -2524,7 +2636,7 @@ Fb(WORD,SetTextAlign,HDC,a,WORD,b)
Fb(WORD,SizeofResource,HANDLE,a,HANDLE,b)
Fb(WORD,WinExec,LPSTR,a,WORD,b)
Fb(int,AccessResource,HANDLE,a,HANDLE,b)
Fb(int,AnsiToOem,LPSTR,a,LPSTR,b)
Fb(INT,AnsiToOem,LPSTR,a,LPSTR,b)
Fb(int,BuildCommDCB,LPSTR,a,DCB*,b)
Fb(int,ConvertRequest,HWND,a,LPKANJISTRUCT,b)
Fb(void,CopyRect,LPRECT,a,LPRECT,b)
@ -2567,9 +2679,9 @@ Fb(void,ValidateRect,HWND,a,LPRECT,b)
Fb(void,ValidateRgn,HWND,a,HRGN,b)
Fc(BOOL,LineTo,HDC,a,short,b,short,c)
Fc(WORD,GetInternalWindowPos,HWND,a,LPRECT,b,LPPOINT,c)
Fc(LONG,_llseek,int,a,long,b,int,c)
Fc(WORD,_lread,int,a,LPSTR,b,int,c)
Fc(WORD,_lwrite,int,a,LPSTR,b,int,c)
Fc(LONG,_llseek,INT,a,LONG,b,INT,c)
Fc(WORD,_lread,INT,a,LPSTR,b,INT,c)
Fc(WORD,_lwrite,INT,a,LPSTR,b,INT,c)
Fc(int,FillRect,HDC,a,LPRECT,b,HBRUSH,c)
Fc(DWORD,MoveTo,HDC,a,short,b,short,c)
Fc(BOOL,CheckMenuItem,HMENU,a,WORD,b,WORD,c)
@ -2645,7 +2757,7 @@ Fc(int,MulDiv,int,a,int,b,int,c)
Fc(int,OffsetClipRgn,HDC,a,short,b,short,c)
Fc(int,OffsetRgn,HRGN,a,short,b,short,c)
Fc(int,OpenComm,LPSTR,a,WORD,b,WORD,c)
Fc(int,OpenFile,LPSTR,a,LPOFSTRUCT,b,WORD,c)
Fc(INT,OpenFile,LPSTR,a,LPOFSTRUCT,b,WORD,c)
Fc(int,ReadComm,int,a,LPSTR,b,int,c)
Fc(int,SetEnvironment,LPSTR,a,LPSTR,b,WORD,c)
Fc(int,SetVoiceEnvelope,int,a,int,b,int,c)
@ -2655,12 +2767,12 @@ Fc(int,WriteComm,int,a,LPSTR,b,int,c)
Fc(int,wvsprintf,LPSTR,a,LPSTR,b,LPSTR,c)
Fc(short,SetTextJustification,HDC,a,short,b,short,c)
Fc(void,AdjustWindowRect,LPRECT,a,DWORD,b,BOOL,c)
Fc(void,AnsiToOemBuff,LPSTR,a,LPSTR,b,int,c)
Fc(void,AnsiToOemBuff,LPSTR,a,LPSTR,b,INT,c)
Fc(void,CheckDlgButton,HWND,a,WORD,b,WORD,c)
Fc(void,InflateRect,LPRECT,a,short,b,short,c)
Fc(void,InvalidateRect,HWND,a,LPRECT,b,BOOL,c)
Fc(void,InvalidateRgn,HWND,a,HRGN,b,BOOL,c)
Fc(void,OemToAnsiBuff,LPSTR,a,LPSTR,b,int,c)
Fc(void,OemToAnsiBuff,LPSTR,a,LPSTR,b,INT,c)
Fc(void,OffsetRect,LPRECT,a,short,b,short,c)
Fc(void,SetDlgItemText,HWND,a,WORD,b,LPSTR,c)
Fc(void,SetSysColors,int,a,LPINT,b,COLORREF*,c)
@ -2683,10 +2795,12 @@ Fd(BOOL,RedrawWindow,HWND,a,LPRECT,b,HRGN,c,UINT,d)
Fd(BOOL,SetBitmapDimensionEx,HBITMAP,a,short,b,short,c,LPSIZE,d)
Fd(BOOL,WinHelp,HWND,hwndMain,LPSTR,lpszHelp,WORD,usCommand,DWORD,ulData)
Fd(BOOL,WritePrivateProfileString,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d)
Fd(DWORD,DefHookProc,int,a,WORD,b,DWORD,c,FARPROC FAR*,d)
Fd(DWORD,DefHookProc,short,a,WORD,b,DWORD,c,HHOOK FAR*,d)
Fd(DWORD,CallNextHookEx,HHOOK,a,short,b,WPARAM,c,LPARAM,d)
Fd(COLORREF,SetPixel,HDC,a,short,b,short,c,COLORREF,d)
Fd(HDC,CreateDC,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d)
Fd(HDC,CreateIC,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d)
Fd(HHOOK,SetWindowsHookEx,short,a,HOOKPROC,b,HINSTANCE,c,HTASK,d)
Fd(HRGN,CreateEllipticRgn,short,a,short,b,short,c,short,d)
Fd(HRGN,CreatePolyPolygonRgn,LPPOINT,a,LPINT,b,short,c,short,d)
Fd(HRGN,CreateRectRgn,short,a,short,b,short,c,short,d)
@ -2713,7 +2827,7 @@ Fd(int,DialogBoxIndirect,HANDLE,a,HANDLE,b,HWND,c,FARPROC,d)
Fd(int,EnumFonts,HDC,a,LPSTR,b,FARPROC,c,LPSTR,d)
Fd(int,EnumObjects,HDC,a,int,b,FARPROC,c,LPSTR,d)
Fd(int,GetDlgItemText,HWND,a,WORD,b,LPSTR,c,WORD,d)
Fd(int,GetTempFileName,BYTE,a,LPCSTR,b,UINT,c,LPSTR,d)
Fd(INT,GetTempFileName,BYTE,a,LPCSTR,b,UINT,c,LPSTR,d)
Fd(int,LoadString,HANDLE,a,WORD,b,LPSTR,c,int,d)
Fd(int,MessageBox,HWND,a,LPSTR,b,LPSTR,c,WORD,d)
Fd(int,SetScrollPos,HWND,a,int,b,int,c,BOOL,d)
@ -2789,7 +2903,7 @@ Fh(int,ScrollWindowEx,HWND,a,short,b,short,c,LPRECT,d,LPRECT,e,HRGN,f,LPRECT,g,W
Fi(BOOL,Arc,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
Fi(BOOL,Chord,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
Fi(BOOL,BitBlt,HDC,a,short,b,short,c,short,d,short,e,HDC,f,short,g,short,h,DWORD,i)
Fi(BOOL,GrayString,HDC,a,HBRUSH,b,FARPROC,c,DWORD,d,int,e,int,f,int,g,int,h,int,i)
Fi(BOOL,GrayString,HDC,a,HBRUSH,b,FARPROC,gsprc,LPARAM,lParam,INT,cch,INT,x,INT,y,INT,cx,INT,cy)
Fi(BOOL,Pie,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom,int,xStart,int,yStart,int,xEnd,int,yEnd)
Fk(HWND,CreateWindow,LPSTR,szAppName,LPSTR,Label,DWORD,ol,short,x,short,y,short,w,short,h,HWND,d,HMENU,e,,HANDLE i,LPSTR,g)
Fk(BOOL,StretchBlt,HDC,a,short,b,short,c,short,d,short,e,HDC,f,short,g,short,h,short,i,short,j,DWORD,k)

View File

@ -32,7 +32,8 @@ struct w_files
extern struct w_files * wine_files;
#define MAX_DOS_DRIVES 26
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
#define WINE_INI WineIniFileName()
#define WIN_INI WinIniFileName()

View File

@ -79,7 +79,9 @@ struct sockproto {
* Maximum queue length specifiable by listen.
*/
#define SOMAXCONN 5
#define MSG_DONTROUTE 0x4 /* send without using routing tables */
#define MSG_MAXIOVLEN 16
/*
@ -188,51 +190,6 @@ struct sockproto {
/* no address, look for MX record */
#define WSANO_ADDRESS WSANO_DATA
/*
* Windows Sockets errors redefined as regular Berkeley error constants
* AAARGH! *
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS
#define EALREADY WSAEALREADY
#define ENOTSOCK WSAENOTSOCK
#define EDESTADDRREQ WSAEDESTADDRREQ
#define EMSGSIZE WSAEMSGSIZE
#define EPROTOTYPE WSAEPROTOTYPE
#define ENOPROTOOPT WSAENOPROTOOPT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
#define EOPNOTSUPP WSAEOPNOTSUPP
#define EPFNOSUPPORT WSAEPFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EADDRINUSE WSAEADDRINUSE
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define ENETDOWN WSAENETDOWN
#define ENETUNREACH WSAENETUNREACH
#define ENETRESET WSAENETRESET
#define ECONNABORTED WSAECONNABORTED
#define ECONNRESET WSAECONNRESET
#define ENOBUFS WSAENOBUFS
#define EISCONN WSAEISCONN
#define ENOTCONN WSAENOTCONN
#define ESHUTDOWN WSAESHUTDOWN
#define ETOOMANYREFS WSAETOOMANYREFS
#define ETIMEDOUT WSAETIMEDOUT
#define ECONNREFUSED WSAECONNREFUSED
#define ELOOP WSAELOOP
#define ENAMETOOLONG WSAENAMETOOLONG
#define EHOSTDOWN WSAEHOSTDOWN
#define EHOSTUNREACH WSAEHOSTUNREACH
#define ENOTEMPTY WSAENOTEMPTY
#define EPROCLIM WSAEPROCLIM
#define EUSERS WSAEUSERS
#define EDQUOT WSAEDQUOT
#define ESTALE WSAESTALE
#define EREMOTE WSAEREMOTE
*/
/* Socket function prototypes */
#ifdef __cplusplus
@ -241,51 +198,50 @@ extern "C" {
/* Microsoft Windows Extension function prototypes */
int PASCAL FAR WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData);
INT PASCAL FAR WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData);
int PASCAL FAR WSACleanup(void);
INT PASCAL FAR WSACleanup(void);
void PASCAL FAR WSASetLastError(int iError);
void PASCAL FAR WSASetLastError(INT iError);
int PASCAL FAR WSAGetLastError(void);
INT PASCAL FAR WSAGetLastError(void);
BOOL PASCAL FAR WSAIsBlocking(void);
int PASCAL FAR WSAUnhookBlockingHook(void);
INT PASCAL FAR WSAUnhookBlockingHook(void);
FARPROC PASCAL FAR WSASetBlockingHook(FARPROC lpBlockFunc);
int PASCAL FAR WSACancelBlockingCall(void);
INT PASCAL FAR WSACancelBlockingCall(void);
HANDLE PASCAL FAR WSAAsyncGetServByName(HWND hWnd, u_int wMsg,
const char FAR * name,
const char FAR * proto,
char FAR * buf, int buflen);
const char FAR *name,
const char FAR *proto,
char FAR *buf, INT buflen);
HANDLE PASCAL FAR WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port,
const char FAR * proto, char FAR * buf,
int buflen);
HANDLE PASCAL FAR WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, INT port,
const char FAR *proto, char FAR *buf,
INT buflen);
HANDLE PASCAL FAR WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg,
const char FAR * name, char FAR * buf,
int buflen);
const char FAR *name, char FAR *buf,
INT buflen);
HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg,
int number, char FAR * buf,
int buflen);
INT number, char FAR *buf,
INT buflen);
HANDLE PASCAL FAR WSAAsyncGetHostByName(HWND hWnd, u_int wMsg,
const char FAR * name, char FAR * buf,
int buflen);
const char FAR *name, char FAR *buf,
INT buflen);
HANDLE PASCAL FAR WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg,
const char FAR * addr, int len, int type,
const char FAR * buf, int buflen);
const char FAR *addr, INT len, INT type,
char FAR *buf, INT buflen);
int PASCAL FAR WSACancelAsyncRequest(HANDLE hAsyncTaskHandle);
INT PASCAL FAR WSACancelAsyncRequest(HANDLE hAsyncTaskHandle);
int PASCAL FAR WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg,
long lEvent);
INT PASCAL FAR WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, long lEvent);
#ifdef __cplusplus
}

View File

@ -10,6 +10,7 @@ SRCS = \
signal.c \
library.c \
resource.c \
task.c \
wine.c
OBJS = $(SRCS:.c=.o)

View File

@ -1,3 +1,8 @@
/*
* Modules & Libraries functions
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#ifndef WINELIB
#include <stdio.h>
#include <stdlib.h>
@ -10,30 +15,25 @@
#include "windows.h"
#include "wine.h"
#include "dlls.h"
#include "task.h"
typedef struct module_table_entry
{
typedef struct {
LPSTR ModuleName;
LPSTR FileName;
WORD Count;
HANDLE hModule;
HINSTANCE hInst;
LPSTR name;
WORD count;
void *lpPrevModule;
void *lpNextModule;
} MODULEENTRY;
typedef MODULEENTRY *LPMODULEENTRY;
static LPMODULEENTRY lpModList = NULL;
extern struct w_files * wine_files;
#define N_BUILTINS 10
extern struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS];
/**********************************************************************
* GetCurrentTask [KERNEL.36]
*/
HTASK GetCurrentTask()
{
int pid = getpid();
printf("GetCurrentTask() returned %d !\n", pid);
return pid;
}
/**********************************************************************
* GetModuleHandle [KERNEL.47]
@ -69,11 +69,11 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
*/
int GetModuleUsage(HANDLE hModule)
{
struct w_files *w;
printf("GetModuleUsage(%04X);\n", hModule);
w = GetFileInfo(hModule);
/* return w->Usage; */
return 1;
struct w_files *w;
printf("GetModuleUsage(%04X);\n", hModule);
w = GetFileInfo(hModule);
/* return w->Usage; */
return 1;
}
@ -100,10 +100,44 @@ int GetModuleFileName(HANDLE hModule, LPSTR lpFileName, short nSize)
HANDLE LoadLibrary(LPSTR libname)
{
HANDLE hModule;
LPMODULEENTRY lpMod = lpModList;
LPMODULEENTRY lpNewMod;
printf("LoadLibrary '%s'\n", libname);
hModule = LoadImage(libname, DLL);
printf("LoadLibrary returned hModule=%04X\n", hModule);
return hModule;
if (lpMod != NULL) {
while (TRUE) {
if (strcmp(libname, lpMod->FileName) == 0) {
lpMod->Count++;
printf("LoadLibrary // already loaded hInst=%04X\n", lpMod->hInst);
return lpMod->hInst;
}
if (lpMod->lpNextModule == NULL) break;
lpMod = lpMod->lpNextModule;
}
}
hModule = GlobalAlloc(GMEM_MOVEABLE, sizeof(MODULEENTRY));
lpNewMod = (LPMODULEENTRY) GlobalLock(hModule);
#ifdef DEBUG_LIBRARY
printf("LoadLibrary // creating new module entry %08X\n", lpNewMod);
#endif
if (lpNewMod == NULL) return 0;
if (lpModList == NULL) {
lpModList = lpNewMod;
lpNewMod->lpPrevModule = NULL;
}
else {
lpMod->lpNextModule = lpNewMod;
lpNewMod->lpPrevModule = lpMod;
}
lpNewMod->lpNextModule = NULL;
lpNewMod->hModule = hModule;
lpNewMod->ModuleName = NULL;
lpNewMod->FileName = (LPSTR) malloc(strlen(libname));
if (lpNewMod->FileName != NULL) strcpy(lpNewMod->FileName, libname);
lpNewMod->hInst = LoadImage(libname, DLL);
lpNewMod->Count = 1;
printf("LoadLibrary returned Library hInst=%04X\n", lpNewMod->hInst);
GlobalUnlock(hModule);
return lpNewMod->hInst;
}
@ -112,8 +146,24 @@ HANDLE LoadLibrary(LPSTR libname)
*/
void FreeLibrary(HANDLE hLib)
{
LPMODULEENTRY lpMod = lpModList;
printf("FreeLibrary(%04X);\n", hLib);
if (hLib != (HANDLE)NULL) GlobalFree(hLib);
while (lpMod != NULL) {
if (lpMod->hInst == hLib) {
if (lpMod->Count == 1) {
if (hLib != (HANDLE)NULL) GlobalFree(hLib);
if (lpMod->ModuleName != NULL) free(lpMod->ModuleName);
if (lpMod->FileName != NULL) free(lpMod->FileName);
GlobalFree(lpMod->hModule);
printf("FreeLibrary // freed !\n");
return;
}
lpMod->Count--;
printf("FreeLibrary // Count decremented !\n");
return;
}
lpMod = lpMod->lpNextModule;
}
}
@ -128,26 +178,39 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
int ordinal, len;
char * cpnt;
char C[128];
if (hModule == 0) {
printf("GetProcAddress: Bad Module handle=%#04X\n", hModule);
return NULL;
}
HTASK hTask;
LPTASKENTRY lpTask;
if (hModule >= 0xF000) {
if ((int) proc_name & 0xffff0000) {
printf("GetProcAddress: builtin %#04x, '%s'\n", hModule, proc_name);
printf("GetProcAddress: builtin %#04X, '%s'\n",
hModule, proc_name);
/* wOrdin = FindOrdinalFromName(struct dll_table_entry_s *dll_table, proc_name); */
}
else {
printf("GetProcAddress: builtin %#04x, %d\n", hModule, (int) proc_name);
printf("GetProcAddress: builtin %#04X, %d\n",
hModule, (int)proc_name);
}
return NULL;
}
if (hModule == 0) {
hTask = GetCurrentTask();
printf("GetProcAddress // GetCurrentTask()=%04X\n", hTask);
lpTask = (LPTASKENTRY) GlobalLock(hTask);
if (lpTask == NULL) {
printf("GetProcAddress: can't find current module handle !\n");
return NULL;
}
hModule = lpTask->hInst;
printf("GetProcAddress: current module=%04X instance=%04X!\n",
lpTask->hModule, lpTask->hInst);
GlobalUnlock(hTask);
}
while (w && w->hinstance != hModule) w = w->next;
printf("GetProcAddress // Module Found ! w->filename='%s'\n", w->filename);
if (w == NULL) return NULL;
if ((int) proc_name & 0xffff0000) {
printf("GetProcAddress // Module Found ! w->filename='%s'\n", w->filename);
if ((int)proc_name & 0xFFFF0000) {
AnsiUpper(proc_name);
printf("GetProcAddress: %#04x, '%s'\n", hModule, proc_name);
printf("GetProcAddress: %04X, '%s'\n", hModule, proc_name);
cpnt = w->nrname_table;
while(TRUE) {
if (((int) cpnt) - ((int)w->nrname_table) >
@ -155,11 +218,19 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
len = *cpnt++;
strncpy(C, cpnt, len);
C[len] = '\0';
#ifdef DEBUG_MODULE
printf("pointing Function '%s' !\n", C);
if (strncmp(cpnt, proc_name, len) == 0) break;
#endif
if (strncmp(cpnt, proc_name, len) == 0) {
ordinal = *((unsigned short *) (cpnt + len));
break;
}
cpnt += len + 2;
};
ordinal = *((unsigned short *) (cpnt + len));
if (ordinal == 0) {
printf("GetProcAddress // function '%s' not found !\n", proc_name);
return NULL;
}
}
else {
printf("GetProcAddress: %#04x, %d\n", hModule, (int) proc_name);
@ -167,13 +238,13 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
}
ret = GetEntryPointFromOrdinal(w, ordinal);
if (ret == -1) {
printf("GetProcAddress // Function not found !\n");
printf("GetProcAddress // Function #%d not found !\n", ordinal);
return NULL;
}
addr = ret & 0xffff;
sel = (ret >> 16);
printf("GetProcAddress // ret=%08X sel=%04X addr=%04X\n", ret, sel, addr);
return ret;
return (FARPROC) ret;
}
#endif /* ifndef WINELIB */

159
loader/task.c Normal file
View File

@ -0,0 +1,159 @@
/*
* Tasks functions
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "windows.h"
#include "wine.h"
#include "task.h"
static LPTASKENTRY lpTaskList = NULL;
static int nTaskCount = 0;
/**********************************************************************
* GetCurrentTask [KERNEL.36]
*/
HTASK GetCurrentTask()
{
LPTASKENTRY lpTask = lpTaskList;
int pid = getpid();
printf("GetCurrentTask() // unix_pid=%08X !\n", pid);
if (lpTask == NULL) return 0;
while (TRUE) {
printf("GetCurrentTask() // searching lpTask->unix_pid=%08 !\n", lpTask->unix_pid);
if (lpTask->unix_pid == pid) break;
if (lpTask->lpNextTask == NULL) return 0;
lpTask = lpTask->lpNextTask;
}
printf("GetCurrentTask() returned hTask=%04X !\n", lpTask->hTask);
return lpTask->hTask;
}
/**********************************************************************
* GetNumTasks [KERNEL.152]
*/
WORD GetNumTasks()
{
printf("GetNumTasks() returned %d !\n", nTaskCount);
return nTaskCount;
}
/**********************************************************************
* GetWindowTask [USER.224]
*/
HTASK GetWindowTask(HWND hWnd)
{
printf("GetWindowTask(%04X) !\n", hWnd);
return 0;
}
/**********************************************************************
* EnumTaskWindows [USER.225]
*/
BOOL EnumTaskWindows(HANDLE hTask, FARPROC lpEnumFunc, LONG lParam)
{
printf("EnumTaskWindows(%04X, %08X, %08X) !\n", hTask, lpEnumFunc, lParam);
return FALSE;
}
/**********************************************************************
* CreateNewTask [internal]
*/
HANDLE CreateNewTask(HINSTANCE hInst)
{
HANDLE hTask;
LPTASKENTRY lpTask = lpTaskList;
LPTASKENTRY lpNewTask;
if (lpTask != NULL) {
while (TRUE) {
if (lpTask->lpNextTask == NULL) break;
lpTask = lpTask->lpNextTask;
}
}
hTask = GlobalAlloc(GMEM_MOVEABLE, sizeof(TASKENTRY));
lpNewTask = (LPTASKENTRY) GlobalLock(hTask);
#ifdef DEBUG_TASK
printf("CreateNewTask entry allocated %08X\n", lpNewTask);
#endif
if (lpNewTask == NULL) return 0;
if (lpTaskList == NULL) {
lpTaskList = lpNewTask;
lpNewTask->lpPrevTask = NULL;
}
else {
lpTask->lpNextTask = lpNewTask;
lpNewTask->lpPrevTask = lpTask;
}
lpNewTask->lpNextTask = NULL;
lpNewTask->hIcon = 0;
lpNewTask->hModule = 0;
lpNewTask->hTask = hTask;
lpNewTask->lpWndList = (HWND *) malloc(MAXWIN_PER_TASK * sizeof(HWND));
if (lpNewTask->lpWndList != NULL)
memset((LPSTR)lpNewTask->lpWndList, 0, MAXWIN_PER_TASK * sizeof(HWND));
lpNewTask->hInst = hInst;
lpNewTask->unix_pid = getpid();
printf("CreateNewTask // unix_pid=%08X return hTask=%04X\n",
lpNewTask->unix_pid, hTask);
GlobalUnlock(hTask);
return hTask;
}
/**********************************************************************
* AddWindowToTask [internal]
*/
BOOL AddWindowToTask(HTASK hTask, HWND hWnd)
{
HWND *wptr;
int count = 0;
LPTASKENTRY lpTask = lpTaskList;
printf("AddWindowToTask(%04X, %04X); !\n", hTask, hWnd);
while (TRUE) {
if (lpTask->hTask == hTask) break;
if (lpTask == NULL) return FALSE;
lpTask = lpTask->lpNextTask;
}
wptr = lpTask->lpWndList;
if (wptr == NULL) return FALSE;
while (*(wptr++) != 0) {
if (++count >= MAXWIN_PER_TASK) return FALSE;
}
*wptr = hWnd;
return TRUE;
}
/**********************************************************************
* RemoveWindowFromTask [internal]
*/
BOOL RemoveWindowFromTask(HTASK hTask, HWND hWnd)
{
HWND *wptr;
int count = 0;
LPTASKENTRY lpTask = lpTaskList;
printf("AddWindowToTask(%04X, %04X); !\n", hTask, hWnd);
while (TRUE) {
if (lpTask->hTask == hTask) break;
if (lpTask == NULL) return FALSE;
lpTask = lpTask->lpNextTask;
}
wptr = lpTask->lpWndList;
if (wptr == NULL) return FALSE;
while (*(wptr++) != hWnd) {
if (++count >= MAXWIN_PER_TASK) return FALSE;
}
*wptr = 0;
return TRUE;
}

View File

@ -49,6 +49,7 @@ HINSTANCE hSysRes;
static char *DLL_Extensions[] = { "dll", "exe", NULL };
static char *EXE_Extensions[] = { "exe", NULL };
static char *WinePath = NULL;
FILE *SpyFp = NULL;
@ -154,7 +155,6 @@ HINSTANCE LoadImage(char *modulename, int filetype)
wpnt1->next = wpnt;
};
wpnt->next = NULL;
wpnt->resnamtab = (RESNAMTAB *) -1;
/*
* Open file for reading.
@ -248,6 +248,8 @@ HINSTANCE LoadImage(char *modulename, int filetype)
*/
for(i=0; i<wpnt->ne_header->n_mod_ref_tab; i++){
char buff[14];
char buff2[256];
int fd, j;
GetModuleName(wpnt, i + 1, buff);
#ifndef WINELIB
@ -263,27 +265,38 @@ return(wpnt->hinstance);
}
#ifndef WINELIB
/**********************************************************************
* main
*/
int _WinMain(int argc, char **argv)
_WinMain(int argc, char **argv)
{
int segment;
char *p;
char *sysresname;
char filename[100];
char syspath[256];
char exe_path[256];
#ifdef WINESTAT
char * cp;
#endif
struct w_files * wpnt;
int cs_reg, ds_reg, ss_reg, ip_reg, sp_reg;
int i;
int rv;
Argc = argc - 1;
Argv = argv + 1;
if (LoadImage(Argv[0], EXE) == (HINSTANCE) NULL ) {
WinePath = malloc(1024);
getcwd(WinePath, 512);
if ((p = getenv("WINEPATH")) != NULL) {
strcat(WinePath, ";");
strcat(WinePath, p);
}
if ((hInstMain = LoadImage(Argv[0], EXE)) == (HINSTANCE) NULL ) {
fprintf(stderr, "wine: can't find %s!.\n", Argv[0]);
exit(1);
}
@ -380,7 +393,6 @@ void InitializeLoadedDLLs()
}
}
}
#endif
/**********************************************************************
@ -390,8 +402,10 @@ char *
GetImportedName(int fd, struct mz_header_s *mz_header,
struct ne_header_s *ne_header, int name_offset, char *buffer)
{
char *p;
int length;
int status;
int i;
status = lseek(fd, mz_header->ne_offset + ne_header->iname_tab_offset +
name_offset, SEEK_SET);
@ -412,6 +426,7 @@ GetModuleName(struct w_files * wpnt, int index, char *buffer)
int fd = wpnt->fd;
struct mz_header_s *mz_header = wpnt->mz_header;
struct ne_header_s *ne_header = wpnt->ne_header;
char *p;
int length;
WORD name_offset, status;
int i;
@ -699,4 +714,16 @@ FixupSegment(struct w_files * wpnt, int segment_num)
return 0;
}
/**********************************************************************
* GetProcAddress
*/
FARPROC GetProcAddress(HINSTANCE hinstance, char *proc_name)
{
if ((int) proc_name & 0xffff0000)
printf("GetProcAddress: %#04x, '%s'\n", hinstance, proc_name);
else
printf("GetProcAddress: %#04x, %d\n", hinstance, (int) proc_name);
return NULL;
}
#endif

View File

@ -15,7 +15,9 @@ SRCS = \
main.c \
message.c \
profile.c \
property.c \
rect.c \
shell.c \
sound.c \
spy.c \
stress.c \

97
misc/audio.c Normal file
View File

@ -0,0 +1,97 @@
/*
* Sample Wine Driver for Linux
*
* Copyright 1994 Martin Ayotte
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "stdio.h"
#include "windows.h"
#include "win.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
/**************************************************************************
* DriverProc [sample driver]
*/
LRESULT DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
switch(wMsg) {
case DRV_LOAD:
return (LRESULT)1L;
case DRV_FREE:
return (LRESULT)1L;
case DRV_OPEN:
return (LRESULT)1L;
case DRV_CLOSE:
return (LRESULT)1L;
case DRV_ENABLE:
return (LRESULT)1L;
case DRV_DISABLE:
return (LRESULT)1L;
case DRV_QUERYCONFIGURE:
return (LRESULT)1L;
case DRV_CONFIGURE:
MessageBox((HWND)NULL, "Sample MultiMedia Linux Driver !",
"MMLinux Driver", MB_OK);
return (LRESULT)1L;
case DRV_INSTALL:
return (LRESULT)DRVCNF_RESTART;
case DRV_REMOVE:
return (LRESULT)DRVCNF_RESTART;
default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
}
/**************************************************************************
* wodMessage [sample driver]
*/
DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
}
/**************************************************************************
* widMessage [sample driver]
*/
DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
}
/**************************************************************************
* auxMessage [sample driver]
*/
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
}
/**************************************************************************
* midMessage [sample driver]
*/
DWORD midMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
}
/**************************************************************************
* modMessage [sample driver]
*/
DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
}
/*
BOOL DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
*/

View File

@ -572,8 +572,6 @@ fprintf(stderr,"FindFile: looking for %s\n", filename);
strncat(buffer, "/", buflen - strlen(buffer));
strncat(buffer, f->d_name, buflen - strlen(buffer));
fprintf(stderr,"$$%s$$\n", buffer);
stat(buffer, &filestat);
if (S_ISREG(filestat.st_mode)) {
closedir(d);

181
misc/driver.c Normal file
View File

@ -0,0 +1,181 @@
/*
* Wine Drivers functions
*
* Copyright 1994 Martin Ayotte
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "stdio.h"
#include "windows.h"
#include "win.h"
#include "user.h"
#include "driver.h"
LPDRIVERITEM lpDrvItemList = NULL;
/**************************************************************************
* SendDriverMessage [USER.251]
*/
LRESULT WINAPI SendDriverMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM lParam2)
{
printf("SendDriverMessage(%04X, %04X, %08X, %08X);\n",
hDriver, msg, lParam1, lParam2);
}
/**************************************************************************
* OpenDriver [USER.252]
*/
HDRVR OpenDriver(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam)
{
HDRVR hDrvr;
LPDRIVERITEM lpnewdrv;
LPDRIVERITEM lpdrv = lpDrvItemList;
char DrvName[128];
printf("OpenDriver('%s', '%s', %08X);\n",
lpDriverName, lpSectionName, lParam);
if (lpSectionName == NULL) lpSectionName = "drivers";
GetPrivateProfileString(lpSectionName, lpDriverName,
"", DrvName, sizeof(DrvName), "SYSTEM.INI");
printf("OpenDriver // DrvName='%s'\n", DrvName);
if (strlen(DrvName) < 1) return 0;
while (lpdrv != NULL) {
if (lpdrv->lpNextItem == NULL) break;
lpdrv = lpdrv->lpNextItem;
}
hDrvr = GlobalAlloc(GMEM_MOVEABLE, sizeof(DRIVERITEM));
lpnewdrv = (LPDRIVERITEM) GlobalLock(hDrvr);
if (lpnewdrv == NULL) return 0;
lpnewdrv->dis.length = sizeof(DRIVERINFOSTRUCT);
lpnewdrv->dis.hModule = LoadImage("DrvName", DLL);
if (lpnewdrv->dis.hModule == 0) {
GlobalUnlock(hDrvr);
GlobalFree(hDrvr);
return 0;
}
lpnewdrv->dis.hDriver = hDrvr;
strcpy(lpnewdrv->dis.szAliasName, lpDriverName);
lpnewdrv->count = 0;
lpnewdrv->lpNextItem = NULL;
if (lpDrvItemList == NULL || lpdrv == NULL) {
lpDrvItemList = lpnewdrv;
lpnewdrv->lpPrevItem = NULL;
}
else {
lpdrv->lpNextItem = lpnewdrv;
lpnewdrv->lpPrevItem = lpdrv;
}
lpnewdrv->lpDrvProc = NULL;
printf("OpenDriver // hDrvr=%04X loaded !\n", hDrvr);
return hDrvr;
}
/**************************************************************************
* CloseDriver [USER.253]
*/
LRESULT CloseDriver(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2)
{
LPDRIVERITEM lpdrv;
printf("CloseDriver(%04X, %08X, %08X);\n", hDrvr, lParam1, lParam2);
lpdrv = (LPDRIVERITEM) GlobalLock(hDrvr);
if (lpdrv != NULL && lpdrv->dis.hDriver == hDrvr) {
if (lpdrv->lpPrevItem)
((LPDRIVERITEM)lpdrv->lpPrevItem)->lpNextItem = lpdrv->lpNextItem;
if (lpdrv->lpNextItem)
((LPDRIVERITEM)lpdrv->lpNextItem)->lpPrevItem = lpdrv->lpPrevItem;
GlobalUnlock(hDrvr);
GlobalFree(hDrvr);
printf("CloseDriver // hDrvr=%04X closed !\n", hDrvr);
return TRUE;
}
return FALSE;
}
/**************************************************************************
* GetDriverModuleHandle [USER.254]
*/
HANDLE GetDriverModuleHandle(HDRVR hDrvr)
{
LPDRIVERITEM lpdrv;
HANDLE hModule = 0;
printf("GetDriverModuleHandle(%04X);\n", hDrvr);
lpdrv = (LPDRIVERITEM) GlobalLock(hDrvr);
if (lpdrv != NULL) {
hModule = lpdrv->dis.hModule;
GlobalUnlock(hDrvr);
}
return hModule;
}
/**************************************************************************
* DefDriverProc [USER.255]
*/
LRESULT DefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
switch(wMsg) {
case DRV_LOAD:
return (LRESULT)0L;
case DRV_FREE:
return (LRESULT)0L;
case DRV_OPEN:
return (LRESULT)0L;
case DRV_CLOSE:
return (LRESULT)0L;
case DRV_ENABLE:
return (LRESULT)0L;
case DRV_DISABLE:
return (LRESULT)0L;
case DRV_QUERYCONFIGURE:
return (LRESULT)0L;
case DRV_CONFIGURE:
MessageBox((HWND)NULL, "Driver isn't configurable !",
"Wine Driver", MB_OK);
return (LRESULT)0L;
case DRV_INSTALL:
return (LRESULT)DRVCNF_RESTART;
case DRV_REMOVE:
return (LRESULT)DRVCNF_RESTART;
default:
return (LRESULT)0L;
}
}
/**************************************************************************
* GetDriverInfo [USER.256]
*/
BOOL GetDriverInfo(HDRVR hDrvr, LPDRIVERINFOSTRUCT lpDrvInfo)
{
LPDRIVERITEM lpdrv;
printf("GetDriverInfo(%04X, %08X);\n", hDrvr, lpDrvInfo);
if (lpDrvInfo == NULL) return FALSE;
lpdrv = (LPDRIVERITEM) GlobalLock(hDrvr);
if (lpdrv == NULL) return FALSE;
memcpy(lpDrvInfo, &lpdrv->dis, sizeof(DRIVERINFOSTRUCT));
GlobalUnlock(hDrvr);
return TRUE;
}
/**************************************************************************
* GetNextDriver [USER.257]
*/
HDRVR GetNextDriver(HDRVR hDrvr, DWORD dwFlags)
{
LPDRIVERITEM lpdrv;
HDRVR hRetDrv = 0;
printf("GetNextDriver(%04X, %08X);\n", hDrvr, dwFlags);
lpdrv = (LPDRIVERITEM) GlobalLock(hDrvr);
if (lpdrv != NULL) {
if (dwFlags & GND_REVERSE)
if (lpdrv->lpPrevItem)
hRetDrv = ((LPDRIVERITEM)lpdrv->lpPrevItem)->dis.hDriver;
if (dwFlags & GND_FORWARD)
if (lpdrv->lpNextItem)
hRetDrv = ((LPDRIVERITEM)lpdrv->lpNextItem)->dis.hDriver;
GlobalUnlock(hDrvr);
}
return hRetDrv;
}

View File

@ -24,11 +24,37 @@
#define HELP_MULTIKEY 0x0201
#define HELP_SETWINPOS 0x0203
typedef struct {
WORD wEnvSeg;
LPSTR lpCmdLine;
LPVOID lpCmdShow;
DWORD dwReserved;
} PARAMBLOCK;
HANDLE CreateNewTask(HINSTANCE hInst);
/**********************************************************************
* LoadModule [KERNEL.45]
*/
HANDLE LoadModule(LPSTR modulefile, LPVOID lpParamBlk)
{
PARAMBLOCK *pblk = lpParamBlk;
WORD *lpCmdShow;
printf("LoadModule '%s' %08X\n", modulefile, lpParamBlk);
if (lpParamBlk == NULL) return 0;
lpCmdShow = (WORD *)pblk->lpCmdShow;
return WinExec(pblk->lpCmdLine, lpCmdShow[1]);
}
/**********************************************************************
* WinExec [KERNEL.166]
*/
WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow)
{
int X, X2, C;
char *ArgV[20];
HANDLE hTask = 0;
printf("WinExec('%s', %04X)\n", lpCmdLine, nCmdShow);
ArgV[0] = "wine";
C = 1;
@ -38,35 +64,47 @@ WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow)
strncpy(ArgV[C], &lpCmdLine[X2], X - X2);
ArgV[C][X - X2] = '\0';
C++; X2 = X + 1;
}
}
}
}
ArgV[C] = NULL;
for (C = 0; ; C++) {
if (ArgV[C] == NULL) break;
printf("--> '%s' \n", ArgV[C]);
}
}
switch(fork()) {
case -1:
printf("Can't 'fork' process !\n");
break;
case 0:
printf("New process started !\n");
execvp(ArgV[0], ArgV);
printf("Child process died !\n");
exit(1);
break;
default:
printf("Main process stay alive !\n");
break;
}
case -1:
printf("Can't 'fork' process !\n");
break;
case 0:
hTask = CreateNewTask(0);
printf("WinExec // New Task hTask=%04X !\n", hTask);
execvp(ArgV[0], ArgV);
printf("Child process died !\n");
exit(1);
default:
printf("WinExec (Main process stay alive) hTask=%04X !\n", hTask);
break;
}
for (C = 0; ; C++) {
if (ArgV[C] == NULL) break;
free(ArgV[C]);
}
return(TRUE);
}
return hTask;
}
/**********************************************************************
* ExitWindows [USER.7]
*/
BOOL ExitWindows(DWORD dwReserved, WORD wRetCode)
{
printf("EMPTY STUB !!! ExitWindows(%08X, %04X) !\n", dwReserved, wRetCode);
}
/**********************************************************************
* WinHelp [USER.171]
*/
BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
{
char str[256];

View File

@ -17,7 +17,7 @@
*
************************************************************************/
#define DEBUG_FILE
/* #define DEBUG_FILE */
#include <stdio.h>
#include <fcntl.h>
@ -34,7 +34,7 @@ char WindowsDirectory[256], SystemDirectory[256], TempDirectory[256];
Emulate the _lopen windows call
***************************************************************************/
int _lopen (LPSTR lpPathName, int iReadWrite)
INT _lopen (LPSTR lpPathName, INT iReadWrite)
{
int handle;
char *UnixFileName;
@ -61,7 +61,7 @@ int _lopen (LPSTR lpPathName, int iReadWrite)
/***************************************************************************
_lread
***************************************************************************/
WORD _lread (int hFile, LPSTR lpBuffer, int wBytes)
WORD _lread (INT hFile, LPSTR lpBuffer, INT wBytes)
{
int result;
@ -81,7 +81,7 @@ WORD _lread (int hFile, LPSTR lpBuffer, int wBytes)
/****************************************************************************
_lwrite
****************************************************************************/
WORD _lwrite (int hFile, LPSTR lpBuffer, int wBytes)
WORD _lwrite (INT hFile, LPSTR lpBuffer, INT wBytes)
{
int result;
@ -100,7 +100,7 @@ WORD _lwrite (int hFile, LPSTR lpBuffer, int wBytes)
/***************************************************************************
_lclose
***************************************************************************/
int _lclose (int hFile)
INT _lclose (INT hFile)
{
#ifdef DEBUG_FILE
fprintf(stderr, "_lclose: handle %d\n", hFile);
@ -117,7 +117,7 @@ int _lclose (int hFile)
Warning: This is nearly totally untested. It compiles, that's it...
-SL 9/13/93
**************************************************************************/
int OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
{
int base,flags;
@ -168,7 +168,7 @@ WORD SetHandleCount (WORD wNumber)
/***************************************************************************
_llseek
***************************************************************************/
LONG _llseek (int hFile, LONG lOffset, int nOrigin)
LONG _llseek (INT hFile, LONG lOffset, INT nOrigin)
{
int origin;
@ -191,7 +191,7 @@ LONG _llseek (int hFile, LONG lOffset, int nOrigin)
/***************************************************************************
_lcreate
***************************************************************************/
LONG _lcreate (LPSTR lpszFilename, int fnAttribute)
INT _lcreate (LPSTR lpszFilename, INT fnAttribute)
{
int handle;
char *UnixFileName;
@ -215,7 +215,7 @@ LONG _lcreate (LPSTR lpszFilename, int fnAttribute)
/***************************************************************************
GetDriveType
***************************************************************************/
UINT GetDriveType(int drive)
UINT GetDriveType(INT drive)
{
#ifdef DEBUG_FILE
@ -228,7 +228,7 @@ UINT GetDriveType(int drive)
if (drive == 0 || drive == 1)
return DRIVE_REMOVABLE;
return DRIVE_REMOVABLE;
return DRIVE_FIXED;
}
/***************************************************************************
@ -279,7 +279,7 @@ UINT GetSystemDirectory(LPSTR lpszSysPath, UINT cbSysPath)
/***************************************************************************
GetTempFileName
***************************************************************************/
int GetTempFileName(BYTE bDriveLetter, LPCSTR lpszPrefixString, UINT uUnique, LPSTR lpszTempFileName)
INT GetTempFileName(BYTE bDriveLetter, LPCSTR lpszPrefixString, UINT uUnique, LPSTR lpszTempFileName)
{
int unique;
char tempname[256];
@ -292,7 +292,7 @@ int GetTempFileName(BYTE bDriveLetter, LPCSTR lpszPrefixString, UINT uUnique, LP
strcpy(tempname,lpszPrefixString);
tempname[3]='\0';
sprintf(lpszTempFileName,"%s\\%s%d.tmp",WindowsDirectory, tempname,
sprintf(lpszTempFileName,"%s\\%s%d.tmp", TempDirectory, tempname,
unique);
ToDos(lpszTempFileName);
@ -318,46 +318,12 @@ WORD SetErrorMode(WORD x)
***************************************************************************/
long _hread(int hf, void FAR *hpvBuffer, long cbBuffer)
{
long dataread = 0;
size_t status, size;
while (cbBuffer)
{
size = cbBuffer < 30000 ? cbBuffer : 30000;
status = read(hf, hpvBuffer, size);
if (status == -1)
return HFILE_ERROR;
if (status == 0)
return dataread;
dataread += status;
hpvBuffer += status;
cbBuffer -= status;
}
return dataread;
return read(hf, hpvBuffer, cbBuffer);
}
/***************************************************************************
_hwrite
***************************************************************************/
long _hwrite(int hf, const void FAR *hpvBuffer, long cbBuffer)
{
long datawritten = 0;
size_t status, size;
while (cbBuffer)
{
size = cbBuffer < 30000 ? cbBuffer : 30000;
status = write(hf, hpvBuffer, size);
if (status == -1)
return HFILE_ERROR;
if (status == 0)
return datawritten;
datawritten += status;
hpvBuffer += status;
cbBuffer -= status;
}
return datawritten;
return write(hf, hpvBuffer, cbBuffer);
}

View File

@ -23,13 +23,13 @@ LPSTR lstrcat(LPSTR target,LPCSTR source)
}
/* USER.430 */
int lstrcmp(LPCSTR str1,LPCSTR str2)
INT lstrcmp(LPCSTR str1,LPCSTR str2)
{
return strcmp(str1,str2);
}
/* USER.471 */
int lstrcmpi(LPCSTR str1,LPCSTR str2)
INT lstrcmpi(LPCSTR str1,LPCSTR str2)
{
int i;
i=0;
@ -51,7 +51,7 @@ LPSTR lstrcpyn(LPSTR target,LPCSTR source,int n)
}
/* KERNEL.90 */
int lstrlen(LPCSTR str)
INT lstrlen(LPCSTR str)
{
return strlen(str);
}
@ -148,7 +148,7 @@ BOOL IsCharLower(char ch)
static char Oem2Ansi[256];
static char Ansi2Oem[256];
void InitOemAnsiTranslations()
void InitOemAnsiTranslations(void)
{
static int inited=0; /* should called called in some init function*/
int transfile,i;
@ -173,7 +173,7 @@ void InitOemAnsiTranslations()
}
/* AnsiToOem Keyboard.5 */
int AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr) /* why is this int ??? */
INT AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr) /* why is this int ??? */
{
InitOemAnsiTranslations(); /* should called called in some init function*/
while(*lpAnsiStr){
@ -193,7 +193,7 @@ BOOL OemToAnsi(LPSTR lpOemStr, LPSTR lpAnsiStr) /* why is this BOOL ???? */
}
/* AnsiToOemBuff Keyboard.134 */
void AnsiToOemBuff(LPSTR lpAnsiStr, LPSTR lpOemStr, int nLength)
void AnsiToOemBuff(LPSTR lpAnsiStr, LPSTR lpOemStr, INT nLength)
{
int i;
InitOemAnsiTranslations(); /* should called called in some init function*/
@ -202,7 +202,7 @@ void AnsiToOemBuff(LPSTR lpAnsiStr, LPSTR lpOemStr, int nLength)
}
/* OemToAnsi Keyboard.135 */
void OemToAnsiBuff(LPSTR lpOemStr, LPSTR lpAnsiStr, int nLength)
void OemToAnsiBuff(LPSTR lpOemStr, LPSTR lpAnsiStr, INT nLength)
{
int i;
InitOemAnsiTranslations(); /* should called called in some init function*/

View File

@ -494,17 +494,7 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, void FAR *lpvParam, UINT f
*/
void hmemcpy(void FAR *hpvDest, const void FAR *hpvSource, long cbCopy)
{
size_t copysize;
while (cbCopy)
{
copysize = cbCopy < 30000 ? cbCopy : 30000;
memcpy(hpvDest, hpvSource, copysize);
hpvDest += copysize;
hpvSource += copysize;
cbCopy -= copysize;
}
memcpy(hpvDest, hpvSource, cbCopy);
}
/***********************************************************************

View File

@ -50,17 +50,22 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
WND *wndPtr;
WNDCLASS wndClass;
MSG msg;
MSGBOX mb;
DWORD dwStyle;
MSGBOX mb;
DWORD dwStyle;
HINSTANCE hInst;
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
hInst = hSysRes;
#ifdef DEBUG_MSGBOX
printf( "MessageBox: '%s'\n", str );
printf("MessageBox(NULL, '%s', '%s', %04X)\n", str, title, type);
#endif
if (wndPtr == NULL)
hInst = hSysRes;
else
hInst = wndPtr->hInstance;
}
else {
hInst = wndPtr->hInstance;
#ifdef DEBUG_MSGBOX
printf("MessageBox(%04X, '%s', '%s', %04X)\n", hWnd, str, title, type);
#endif
}
wndClass.style = CS_HREDRAW | CS_VREDRAW ;
wndClass.lpfnWndProc = (WNDPROC)SystemMessageBoxProc;
wndClass.cbClsExtra = 0;
@ -71,7 +76,10 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
wndClass.hbrBackground = GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = "MESSAGEBOX";
if (!RegisterClass(&wndClass)) return 0;
if (!RegisterClass(&wndClass)) {
printf("Unable to Register class 'MESSAGEBOX' !\n");
return 0;
}
memset(&mb, 0, sizeof(MSGBOX));
mb.Title = title;
mb.Str = str;
@ -82,11 +90,28 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
hWndOld = GetFocus();
hDlg = CreateWindow("MESSAGEBOX", title, dwStyle, 100, 150, 400, 120,
(HWND)NULL, (HMENU)NULL, hInst, (LPSTR)&mb);
if (hDlg == 0) return 0;
if (hDlg == 0) {
printf("Unable to create 'MESSAGEBOX' window !\n");
return 0;
}
#ifdef DEBUG_MSGBOX
printf( "MessageBox // before Msg Loop !\n");
#endif
while(TRUE) {
if (!mb.ActiveFlg) break;
if (!GetMessage(&msg, (HWND)NULL, 0, 0)) break;
TranslateMessage(&msg);
if ((type & (MB_SYSTEMMODAL | MB_TASKMODAL)) != 0 &&
msg.hwnd != hDlg) {
switch(msg.message) {
case WM_KEYDOWN:
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
MessageBeep(0);
break;
}
}
DispatchMessage(&msg);
}
SetFocus(hWndOld);
@ -97,6 +122,7 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
return(mb.wRetVal);
}
LPMSGBOX MsgBoxGetStorageHeader(HWND hwnd)
{
WND *wndPtr;
@ -119,6 +145,7 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
CREATESTRUCT *createStruct;
PAINTSTRUCT ps;
HDC hDC;
DWORD OldTextColor;
RECT rect;
LPMSGBOX lpmb;
LPMSGBOX lpmbInit;
@ -225,21 +252,26 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam)
break;
case WM_PAINT:
#ifdef DEBUG_MSGBOX
printf("MessageBox WM_PAINT !\n");
printf("MessageBox WM_PAINT !\n");
#endif
lpmb = MsgBoxGetStorageHeader(hWnd);
CopyRect(&rect, &lpmb->rectStr);
hDC = BeginPaint(hWnd, &ps);
if (lpmb->hIcon)
DrawIcon(hDC, lpmb->rectIcon.left,
lpmb->rectIcon.top, lpmb->hIcon);
DrawText(hDC, lpmb->Str, -1, &rect,
DT_CALCRECT | DT_CENTER | DT_WORDBREAK);
rect.top = lpmb->rectStr.bottom / 2 - rect.bottom / 2;
rect.bottom = lpmb->rectStr.bottom / 2 + rect.bottom / 2;
DrawText(hDC, lpmb->Str, -1, &rect, DT_CENTER | DT_WORDBREAK);
EndPaint(hWnd, &ps);
break;
lpmb = MsgBoxGetStorageHeader(hWnd);
CopyRect(&rect, &lpmb->rectStr);
hDC = BeginPaint(hWnd, &ps);
OldTextColor = SetTextColor(hDC, 0x00000000);
if (lpmb->hIcon)
DrawIcon(hDC, lpmb->rectIcon.left,
lpmb->rectIcon.top, lpmb->hIcon);
DrawText(hDC, lpmb->Str, -1, &rect,
DT_CALCRECT | DT_CENTER | DT_WORDBREAK);
rect.top = lpmb->rectStr.bottom / 2 - rect.bottom / 2;
rect.bottom = lpmb->rectStr.bottom / 2 + rect.bottom / 2;
DrawText(hDC, lpmb->Str, -1, &rect, DT_CENTER | DT_WORDBREAK);
SetTextColor(hDC, OldTextColor);
EndPaint(hWnd, &ps);
#ifdef DEBUG_MSGBOX
printf("MessageBox End of WM_PAINT !\n");
#endif
break;
case WM_DESTROY:
#ifdef DEBUG_MSGBOX
printf("MessageBox WM_DESTROY !\n");

1031
misc/mmsystem.c Normal file

File diff suppressed because it is too large Load Diff

119
misc/network.c Normal file
View File

@ -0,0 +1,119 @@
/*
* Network functions
*/
#include "stdio.h"
#include "windows.h"
#include "win.h"
#include "user.h"
#define WN_SUCCESS 0x0000
#define WN_NOT_SUPPORTED 0x0001
#define WN_NET_ERROR 0x0002
#define WN_MORE_DATA 0x0003
#define WN_BAD_POINTER 0x0004
#define WN_BAD_VALUE 0x0005
#define WN_BAD_PASSWORD 0x0006
#define WN_ACCESS_DENIED 0x0007
#define WN_FUNCTION_BUSY 0x0008
#define WN_WINDOWS_ERROR 0x0009
#define WN_BAD_USER 0x000A
#define WN_OUT_OF_MEMORY 0x000B
#define WN_CANCEL 0x000C
#define WN_CONTINUE 0x000D
#define WN_NOT_CONNECTED 0x0030
#define WN_OPEN_FILES 0x0031
#define WN_BAD_NETNAME 0x0032
#define WN_BAD_LOCALNAME 0x0033
#define WN_ALREADY_CONNECTED 0x0034
#define WN_DEVICE_ERROR 0x0035
#define WN_CONNECTION_CLOSED 0x0036
typedef LPSTR LPNETRESOURCE;
/**************************************************************************
* WNetGetConnection [USER.512]
*/
int WNetGetConnection(LPSTR lpLocalName,
LPSTR lpRemoteName, UINT FAR *cbRemoteName)
{
printf("EMPTY STUB !!! WNetGetConnection('%s', %08X, %08X);\n",
lpLocalName, lpRemoteName, cbRemoteName);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetUser [USER.516]
*/
UINT WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
{
printf("EMPTY STUB !!! WNetGetUser('%s', %08X, %08X);\n",
lpLocalName, lpUserName, lpSize);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetAddConnection [USER.517]
*/
UINT WNetAddConnection(LPSTR lpNetPath, LPSTR lpPassWord, LPSTR lpLocalName)
{
printf("EMPTY STUB !!! WNetAddConnection('%s', %08X, '%s');\n",
lpNetPath, lpPassWord, lpLocalName);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetCancelConnection [USER.518]
*/
UINT WNetCancelConnection(LPSTR lpName, BOOL bForce)
{
printf("EMPTY STUB !!! WNetCancelConnection('%s', %04X);\n",
lpName, bForce);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetAddConnection2 [USER.???]
*/
UINT WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
LPSTR lpLocalName, LPSTR lpUserName)
{
printf("EMPTY STUB !!! WNetAddConnection2('%s', %08X, '%s', '%s');\n",
lpNetPath, lpPassWord, lpLocalName, lpUserName);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetCloseEnum [USER.???]
*/
UINT WNetCloseEnum(HANDLE hEnum)
{
printf("EMPTY STUB !!! WNetCloseEnum(%04X);\n", hEnum);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetEnumResource [USER.???]
*/
UINT WNetEnumResource(HANDLE hEnum, DWORD cRequ,
DWORD *lpCount, LPVOID lpBuf)
{
printf("EMPTY STUB !!! WNetEnumResource(%04X, %08X, %08X, %08X);\n",
hEnum, cRequ, lpCount, lpBuf);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetOpenEnum [USER.???]
*/
UINT WNetOpenEnum(DWORD dwScope, DWORD dwType,
LPNETRESOURCE lpNet, HANDLE FAR *lphEnum)
{
printf("EMPTY STUB !!! WNetOpenEnum(%08X, %08X, %08X, %08X);\n",
dwScope, dwType, lpNet, lphEnum);
return WN_NET_ERROR;
}

View File

@ -64,15 +64,34 @@ static TSecHeader *is_loaded (char *FileName)
return 0;
}
static TSecHeader *load (char *file)
static char *GetIniFileName(char *name)
{
char temp[256];
if (strchr(name, '/'))
return name;
if (strchr(name, '\\'))
return GetUnixFileName(name);
GetWindowsDirectory(temp, sizeof(temp) );
strcat(temp, "\\");
strcat(temp, name);
return GetUnixFileName(name);
}
static TSecHeader *load (char *filename)
{
FILE *f;
int state;
TSecHeader *SecHeader = 0;
char CharBuffer [STRSIZE];
char *next;
char *next, *file;
char c;
file = GetIniFileName(filename);
#ifdef DEBUG
printf("Load %s\n", file);
#endif
@ -82,6 +101,8 @@ static TSecHeader *load (char *file)
#ifdef DEBUG
printf("Loading %s\n", file);
#endif
state = FirstBrace;
while ((c = getc (f)) != EOF){
if (c == '\r') /* Ignore Carriage Return */
@ -337,13 +358,13 @@ static void dump_profile (TProfile *p)
if (!p)
return;
dump_profile (p->link);
if ((profile = fopen (p->FileName, "w")) != NULL){
if ((profile = fopen (GetIniFileName(p->FileName), "w")) != NULL){
dump_sections (profile, p->Section);
fclose (profile);
}
}
void sync_profiles ()
void sync_profiles (void)
{
dump_profile (Base);
}

197
misc/property.c Normal file
View File

@ -0,0 +1,197 @@
/*
* Windows Properties Functions
*/
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#define DEBUG_PROP
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "windows.h"
#include "heap.h"
#include "win.h"
typedef struct {
LPSTR PropName;
WORD Atom;
HANDLE hData;
void *lpPrevProp;
void *lpNextProp;
} PROPENTRY;
typedef PROPENTRY *LPPROPENTRY;
/*************************************************************************
* RemoveProp [USER.24]
*/
HANDLE RemoveProp(HWND hWnd, LPSTR lpStr)
{
WND *wndPtr;
LPPROPENTRY lpProp;
HANDLE hOldData;
#ifdef DEBUG_PROP
if (((DWORD)lpStr & 0xFFFF0000) == 0L)
printf("RemoveProp(%04X, Atom %04X)\n", hWnd, LOWORD((DWORD)lpStr));
else
printf("RemoveProp(%04X, '%s')\n", hWnd, lpStr);
#endif
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
printf("RemoveProp // Bad Window handle !\n");
return FALSE;
}
lpProp = (LPPROPENTRY) GlobalLock(wndPtr->hProp);
if (lpProp == NULL) return 0;
while (TRUE) {
if (strcmp(lpProp->PropName, lpStr) == 0) {
printf("RemoveProp // Property found ! hData=%04X\n", lpProp->hData);
hOldData = lpProp->hData;
if (lpProp->lpPrevProp != NULL)
((LPPROPENTRY)lpProp->lpPrevProp)->lpNextProp =
lpProp->lpNextProp;
if (lpProp->lpNextProp != NULL)
((LPPROPENTRY)lpProp->lpNextProp)->lpPrevProp =
lpProp->lpPrevProp;
free(lpProp->PropName);
free(lpProp);
GlobalUnlock(wndPtr->hProp);
return hOldData;
}
if (lpProp->lpNextProp == NULL) break;
lpProp = lpProp->lpNextProp;
}
GlobalUnlock(wndPtr->hProp);
printf("RemoveProp // Property not found !\n");
return 0;
}
/*************************************************************************
* GetProp [USER.25]
*/
HANDLE GetProp(HWND hWnd, LPSTR lpStr)
{
WND *wndPtr;
LPPROPENTRY lpProp;
#ifdef DEBUG_PROP
if (((DWORD)lpStr & 0xFFFF0000) == 0L)
printf("GetProp(%04X, Atom %04X)\n", hWnd, LOWORD((DWORD)lpStr));
else
printf("GetProp(%04X, '%s')\n", hWnd, lpStr);
#endif
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
printf("GetProp // Bad Window handle !\n");
return FALSE;
}
lpProp = (LPPROPENTRY) GlobalLock(wndPtr->hProp);
if (lpProp == NULL) return 0;
while (TRUE) {
if ((((DWORD)lpStr & 0xFFFF0000) == 0L &&
lpProp->Atom == LOWORD((DWORD)lpStr)) ||
(((DWORD)lpStr & 0xFFFF0000) != 0L &&
strcmp(lpProp->PropName, lpStr) == 0)) {
printf("GetProp // Property found ! hData=%04X\n", lpProp->hData);
GlobalUnlock(wndPtr->hProp);
return lpProp->hData;
}
if (lpProp->lpNextProp == NULL) break;
lpProp = lpProp->lpNextProp;
}
printf("GetProp // Property not found !\n");
GlobalUnlock(wndPtr->hProp);
return 0;
}
/*************************************************************************
* SetProp [USER.26]
*/
BOOL SetProp(HWND hWnd, LPSTR lpStr, HANDLE hData)
{
WND *wndPtr;
HANDLE hNewProp;
LPPROPENTRY lpNewProp;
LPPROPENTRY lpProp;
#ifdef DEBUG_PROP
if (((DWORD)lpStr & 0xFFFF0000) == 0L)
printf("SetProp(%04X, Atom %04X, %04X)\n",
hWnd, LOWORD((DWORD)lpStr), hData);
else
printf("SetProp(%04X, '%s', %04X)\n", hWnd, lpStr, hData);
#endif
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
printf("SetProp // Bad Window handle !\n");
return FALSE;
}
lpProp = (LPPROPENTRY) GlobalLock(wndPtr->hProp);
if (lpProp != NULL) {
while (TRUE) {
if (strcmp(lpProp->PropName, lpStr) == 0) {
#ifdef DEBUG_PROP
printf("SetProp // change already exinsting property !\n");
#endif
lpProp->hData = hData;
GlobalUnlock(wndPtr->hProp);
return TRUE;
}
if (lpProp->lpNextProp == NULL) break;
lpProp = lpProp->lpNextProp;
}
}
hNewProp = GlobalAlloc(GMEM_MOVEABLE, sizeof(PROPENTRY));
lpNewProp = (LPPROPENTRY) GlobalLock(hNewProp);
if (lpNewProp == NULL) {
printf("SetProp // Can't allocate Property entry !\n");
GlobalUnlock(wndPtr->hProp);
return FALSE;
}
#ifdef DEBUG_PROP
printf("SetProp // entry allocated %08X\n", lpNewProp);
#endif
if (lpProp == NULL) {
wndPtr->hProp = hNewProp;
lpNewProp->lpPrevProp = NULL;
#ifdef DEBUG_PROP
printf("SetProp // first entry \n");
#endif
}
else {
lpProp->lpNextProp = lpNewProp;
lpNewProp->lpPrevProp = lpProp;
}
lpNewProp->lpNextProp = NULL;
lpNewProp->hData = hData;
if (((DWORD)lpStr & 0xFFFF0000) == 0L) {
lpNewProp->PropName = NULL;
lpNewProp->Atom = LOWORD((DWORD)lpStr);
}
else {
lpNewProp->Atom = 0;
lpNewProp->PropName = malloc(strlen(lpStr));
if (lpNewProp->PropName == NULL) {
printf("SetProp // Can't allocate memory for Property Name !\n");
GlobalUnlock(wndPtr->hProp);
return FALSE;
}
strcpy(lpNewProp->PropName, lpStr);
}
GlobalUnlock(hNewProp);
GlobalUnlock(wndPtr->hProp);
return TRUE;
}
/*************************************************************************
* EnumProps [USER.27]
*/
int EnumProps(HWND hWnd, FARPROC lpEnumFunc)
{
printf("EMPTY STUB !!! EnumProps(%04X, %08X)\n", hWnd, lpEnumFunc);
return -1;
}

71
misc/shell.c Normal file
View File

@ -0,0 +1,71 @@
/*
* Shell Library Functions
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "windows.h"
/*************************************************************************
* RegOpenKey [SHELL.1]
*/
int RegOpenKey(void)
{
printf("RegOpenKey : Empty Stub !!!\n");
}
/*************************************************************************
* RegCreateKey [SHELL.2]
*/
int RegCreateKey(void)
{
printf("RegCreateKey : Empty Stub !!!\n");
}
/*************************************************************************
* RegCloseKey [SHELL.3]
*/
int RegCloseKey(void)
{
printf("RegCloseKey : Empty Stub !!!\n");
}
/*************************************************************************
* RegDeleteKey [SHELL.4]
*/
int RegDeleteKey(void)
{
printf("RegDeleteKey : Empty Stub !!!\n");
}
/*************************************************************************
* ShellExecute [SHELL.20]
*/
int ShellExecute(LPSTR ptr)
{
printf("ShellExecute : Empty Stub !!!\n");
}
/*************************************************************************
* RegisterShellHook [SHELL.102]
*/
int RegisterShellHook(void *ptr)
{
printf("RegisterShellHook : Empty Stub !!!\n");
}
/*************************************************************************
* ShellHookProc [SHELL.103]
*/
int ShellHookProc(void)
{
printf("ShellHookProc : Empty Stub !!!\n");
}

View File

@ -104,8 +104,17 @@ const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x00A0 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"WM_NCMOUSEMOVE", /* 0x00A0 */
"WM_NCLBUTTONDOWN", /* 0x00A1 */
"WM_NCLBUTTONUP", /* 0x00A2 */
"WM_NCLBUTTONDBLCLK", /* 0x00A3 */
"WM_NCRBUTTONDOWN", /* 0x00A4 */
"WM_NCRBUTTONUP", /* 0x00A5 */
"WM_NCRBUTTONDBLCLK", /* 0x00A6 */
"WM_NCMBUTTONDOWN", /* 0x00A7 */
"WM_NCMBUTTONUP", /* 0x00A8 */
"WM_NCMBUTTONDBLCLK", /* 0x00A9 */
NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x00B0 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@ -248,7 +257,7 @@ void SpyMessage(HWND hwnd, WORD msg, WORD wParam, LONG lParam)
return;
if (msg > SPY_MAX_MSGNUM || MessageTypeNames[msg] == NULL)
msg_name[0] = '\0';
sprintf(msg_name, "%04x", msg);
else
strcpy(msg_name, MessageTypeNames[msg]);

View File

@ -11,112 +11,206 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <errno.h>
#include <netdb.h>
#include <unistd.h>
#include "heap.h"
#include "winsock.h"
#define DEBUG_WINSOCK
/* XXX per task */
WORD wsa_errno;
int wsa_initted;
static WORD wsa_errno;
static int wsa_initted;
WORD errno_to_wsaerrno(int errno)
#define dump_sockaddr(a) \
fprintf(stderr, "sockaddr_in: family %d, address %s, port %d\n", \
((struct sockaddr_in *)a)->sin_family, \
inet_ntoa(((struct sockaddr_in *)a)->sin_addr), \
ntohs(((struct sockaddr_in *)a)->sin_port))
struct WinSockHeap {
char ntoa_buffer[32];
struct hostent hostent_addr;
struct hostent hostent_name;
struct protoent protoent_name;
struct protoent protoent_number;
struct servent servent_name;
struct servent servent_port;
struct hostent WSAhostent_addr;
struct hostent WSAhostent_name;
struct protoent WSAprotoent_name;
struct protoent WSAprotoent_number;
struct servent WSAservent_name;
struct servent WSAservent_port;
};
static struct WinSockHeap *heap;
static WORD wsaerrno(void)
{
switch(errno) {
case ENETDOWN:
return WSAENETDOWN;
case EAFNOSUPPORT:
return WSAEAFNOSUPPORT;
case EMFILE:
return WSAEMFILE;
case ENOBUFS:
return WSAENOBUFS;
case EPROTONOSUPPORT:
return EPROTONOSUPPORT;
case EPROTOTYPE:
return WSAEPROTOTYPE;
case EBADF:
case ENOTSOCK:
return WSAENOTSOCK;
default:
#ifdef DEBUG_WINSOCK
#ifndef sun
#if defined(__FreeBSD__)
fprintf(stderr, "winsock: errno_to_wsaerrno translation failure.\n\t: %s (%d)\n",
sys_errlist[errno], errno);
fprintf(stderr, "winsock: errno %d, (%s).\n",
errno, sys_errlist[errno]);
#else
fprintf(stderr, "winsock: errno_to_wsaerrno translation failure.\n\t: %s (%d)\n",
strerror[errno], errno);
fprintf(stderr, "winsock: errno %d, (%s).\n",
errno, strerror(errno));
#endif
#else
fprintf (stderr, "winsock: errno_to_wsaerrno translation failure.\n");
fprintf(stderr, "winsock: errno %d\n", errno);
#endif
return WSAENETDOWN;
}
#endif
switch(errno)
{
case EINTR: return WSAEINTR;
case EACCES: return WSAEACCES;
case EFAULT: return WSAEFAULT;
case EINVAL: return WSAEINVAL;
case EMFILE: return WSAEMFILE;
case EWOULDBLOCK: return WSAEWOULDBLOCK;
case EINPROGRESS: return WSAEINPROGRESS;
case EALREADY: return WSAEALREADY;
case EBADF:
case ENOTSOCK: return WSAENOTSOCK;
case EDESTADDRREQ: return WSAEDESTADDRREQ;
case EMSGSIZE: return WSAEMSGSIZE;
case EPROTOTYPE: return WSAEPROTOTYPE;
case ENOPROTOOPT: return WSAENOPROTOOPT;
case EPROTONOSUPPORT: return WSAEPROTONOSUPPORT;
case ESOCKTNOSUPPORT: return WSAESOCKTNOSUPPORT;
case EOPNOTSUPP: return WSAEOPNOTSUPP;
case EPFNOSUPPORT: return WSAEPFNOSUPPORT;
case EAFNOSUPPORT: return WSAEAFNOSUPPORT;
case EADDRINUSE: return WSAEADDRINUSE;
case EADDRNOTAVAIL: return WSAEADDRNOTAVAIL;
case ENETDOWN: return WSAENETDOWN;
case ENETUNREACH: return WSAENETUNREACH;
case ENETRESET: return WSAENETRESET;
case ECONNABORTED: return WSAECONNABORTED;
case ECONNRESET: return WSAECONNRESET;
case ENOBUFS: return WSAENOBUFS;
case EISCONN: return WSAEISCONN;
case ENOTCONN: return WSAENOTCONN;
case ESHUTDOWN: return WSAESHUTDOWN;
case ETOOMANYREFS: return WSAETOOMANYREFS;
case ETIMEDOUT: return WSAETIMEDOUT;
case ECONNREFUSED: return WSAECONNREFUSED;
case ELOOP: return WSAELOOP;
case ENAMETOOLONG: return WSAENAMETOOLONG;
case EHOSTDOWN: return WSAEHOSTDOWN;
case EHOSTUNREACH: return WSAEHOSTUNREACH;
case ENOTEMPTY: return WSAENOTEMPTY;
/* case EPROCLIM: return WSAEPROCLIM; */
case EUSERS: return WSAEUSERS;
case EDQUOT: return WSAEDQUOT;
case ESTALE: return WSAESTALE;
case EREMOTE: return WSAEREMOTE;
default:
fprintf(stderr, "winsock: unknown error!\n");
return WSAEOPNOTSUPP;
}
}
static WORD errno_to_wsaerrno(void)
{
wsa_errno = wsaerrno();
}
SOCKET Winsock_accept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen)
SOCKET Winsock_accept(SOCKET s, struct sockaddr FAR *addr, INT FAR *addrlen)
{
int sock;
if ((sock = accept(s, addr, addrlen)) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_accept: socket %d, ptr %8x, length %d\n", s, (int) addr, addrlen);
#endif
if ((sock = accept(s, addr, (int *) addrlen)) < 0) {
errno_to_wsaerrno();
return INVALID_SOCKET;
}
return sock;
}
int Winsock_bind(SOCKET s, struct sockaddr FAR *name, int namelen)
INT Winsock_bind(SOCKET s, struct sockaddr FAR *name, INT namelen)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_bind: socket %d, ptr %8x, length %d\n", s, (int) name, namelen);
dump_sockaddr(name);
#endif
if (bind(s, name, namelen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_closesocket(SOCKET s)
INT Winsock_closesocket(SOCKET s)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_closesocket: socket %d\n", s);
#endif
if (close(s) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_connect(SOCKET s, struct sockaddr FAR *name, int namelen)
INT Winsock_connect(SOCKET s, struct sockaddr FAR *name, INT namelen)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_connect: socket %d, ptr %8x, length %d\n", s, (int) name, namelen);
dump_sockaddr(name);
#endif
if (connect(s, name, namelen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_getpeername(SOCKET s, struct sockaddr FAR *name, int FAR *namelen)
INT Winsock_getpeername(SOCKET s, struct sockaddr FAR *name, INT FAR *namelen)
{
if (getpeername(s, name, namelen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getpeername: socket: %d, ptr %8x, ptr %8x\n", s, (int) name, *namelen);
dump_sockaddr(name);
#endif
if (getpeername(s, name, (int *) namelen) < 0) {
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_getsockname(SOCKET s, struct sockaddr FAR *name, int FAR *namelen)
INT Winsock_getsockname(SOCKET s, struct sockaddr FAR *name, INT FAR *namelen)
{
if (getsockname(s, name, namelen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getsockname: socket: %d, ptr %8x, ptr %8x\n", s, (int) name, (int) *namelen);
#endif
if (getsockname(s, name, (int *) namelen) < 0) {
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_getsockopt(SOCKET s, int loptname, char FAR *optval, int FAR *optlen)
INT Winsock_getsockopt(SOCKET s, INT loptname, char FAR *optval, INT FAR *optlen)
{
if (getsockopt(s, 0, loptname, optval, optlen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getsockopt: socket: %d, opt %d, ptr %8x, ptr %8x\n", s, loptname, (int) optval, (int) *optlen);
#endif
if (getsockopt(s, 0, (int) loptname, optval, (int *) optlen) < 0) {
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
@ -141,26 +235,41 @@ char *Winsock_inet_ntoa(struct in_addr in)
{
char *s;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_inet_ntoa: %8x\n", in);
#endif
if ((s = inet_ntoa(in)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return NULL;
}
return s;
strncpy(heap->ntoa_buffer, s, sizeof(heap->ntoa_buffer) );
return (char *) &heap->ntoa_buffer;
}
int Winsock_ioctlsocket(SOCKET s, long cmd, u_long FAR *argp)
INT Winsock_ioctlsocket(SOCKET s, long cmd, u_long FAR *argp)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_ioctl: socket %d, cmd %d, ptr %8x\n", s, cmd, (int) argp);
#endif
if (ioctl(s, cmd, argp) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_listen(SOCKET s, int backlog)
INT Winsock_listen(SOCKET s, INT backlog)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_listen: socket %d, backlog %d\n", s, backlog);
#endif
if (listen(s, backlog) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
@ -176,125 +285,174 @@ u_short Winsock_ntohs(u_short netshort)
return( ntohs(netshort) );
}
int Winsock_recv(SOCKET s, char FAR *buf, int len, int flags)
INT Winsock_recv(SOCKET s, char FAR *buf, INT len, INT flags)
{
int length;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_recv: socket %d, ptr %8x, length %d, flags %d\n", s, (int) buf, len, flags);
#endif
if ((length = recv(s, buf, len, flags)) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return length;
}
int Winsock_recvfrom(SOCKET s, char FAR *buf, int len, int flags,
INT Winsock_recvfrom(SOCKET s, char FAR *buf, INT len, INT flags,
struct sockaddr FAR *from, int FAR *fromlen)
{
int length;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_recvfrom: socket %d, ptr %8x, length %d, flags %d\n", s, buf, len, flags);
#endif
if ((length = recvfrom(s, buf, len, flags, from, fromlen)) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return length;
}
int Winsock_select(int nfds, fd_set FAR *readfds, fd_set FAR *writefds,
INT Winsock_select(INT nfds, fd_set FAR *readfds, fd_set FAR *writefds,
fd_set FAR *exceptfds, struct timeval FAR *timeout)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_select: fd # %d, ptr %8x, ptr %8x, ptr %*X\n", nfds, readfds, writefds, exceptfds);
#endif
return(select(nfds, readfds, writefds, exceptfds, timeout));
}
int Winsock_send(SOCKET s, char FAR *buf, int len, int flags)
INT Winsock_send(SOCKET s, char FAR *buf, INT len, INT flags)
{
int length;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_send: socket %d, ptr %8x, length %d, flags %d\n", s, buf, len, flags);
#endif
if ((length = send(s, buf, len, flags)) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return length;
}
int Winsock_sendto(SOCKET s, char FAR *buf, int len, int flags,
struct sockaddr FAR *to, int tolen)
INT Winsock_sendto(SOCKET s, char FAR *buf, INT len, INT flags,
struct sockaddr FAR *to, INT tolen)
{
int length;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_sendto: socket %d, ptr %8x, length %d, flags %d\n", s, buf, len, flags);
#endif
if ((length = sendto(s, buf, len, flags, to, tolen)) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return length;
}
int Winsock_setsockopt(SOCKET s, int level, int optname, const char FAR *optval,
int optlen)
INT Winsock_setsockopt(SOCKET s, INT level, INT optname, const char FAR *optval,
INT optlen)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_setsockopt: socket %d, level %d, opt %d, ptr %8x, len %d\n", s, level, optname, (int) optval, optlen);
#endif
if (setsockopt(s, level, optname, optval, optlen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
int Winsock_shutdown(SOCKET s, int how)
INT Winsock_shutdown(SOCKET s, INT how)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_shutdown: socket s %d, how %d\n", s, how);
#endif
if (shutdown(s, how) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
}
SOCKET Winsock_socket(WORD af, WORD type, WORD protocol)
SOCKET Winsock_socket(INT af, INT type, INT protocol)
{
int sock;
#ifdef DEBUG_WINSOCK
printf("Winsock_socket: af=%d type=%d protocol=%d\n", af, type, protocol);
fprintf(stderr, "WSA_socket: af=%d type=%d protocol=%d\n", af, type, protocol);
#endif
/* let the kernel do the dirty work..
if (!wsa_initted) {
wsa_errno = WSANOTINITIALISED;
return INVALID_SOCKET;
}
*/
if ((sock = socket(af, type, protocol)) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_socket: failed !\n");
#endif
return INVALID_SOCKET;
}
if (sock > 0xffff) {
wsa_errno = WSAEMFILE;
return INVALID_SOCKET;
}
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_socket: fd %d\n", sock);
#endif
return sock;
}
struct hostent *Winsock_gethostbyaddr(const char FAR *addr, int len, int type)
struct hostent *Winsock_gethostbyaddr(const char FAR *addr, INT len, INT type)
{
struct hostent *host;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_gethostbyaddr: ptr %8x, len %d, type %d\n", (int) addr, len, type);
#endif
if ((host = gethostbyaddr(addr, len, type)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return NULL;
}
return host;
memcpy(&heap->hostent_addr, host, sizeof(struct hostent));
return (struct hostent *) &heap->hostent_addr;
}
struct hostent *Winsock_gethostbyname(const char FAR *name)
{
struct hostent *host;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_gethostbyname: name %s\n", name);
#endif
if ((host = gethostbyname(name)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return NULL;
}
return host;
memcpy(&heap->hostent_name, host, sizeof(struct hostent));
return (struct hostent *) &heap->hostent_name;
}
int Winsock_gethostname(char FAR *name, int namelen)
int Winsock_gethostname(char FAR *name, INT namelen)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_gethostname: name %d, len %d\n", name, namelen);
#endif
if (gethostname(name, namelen) < 0) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return SOCKET_ERROR;
}
return 0;
@ -304,125 +462,238 @@ struct protoent *Winsock_getprotobyname(char FAR *name)
{
struct protoent *proto;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getprotobyname: name %s\n", name);
#endif
if ((proto = getprotobyname(name)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return NULL;
}
return proto;
memcpy(&heap->protoent_name, proto, sizeof(struct protoent));
return (struct protoent *) &heap->protoent_name;
}
struct protoent *Winsock_getprotobynumber(int number)
struct protoent *Winsock_getprotobynumber(INT number)
{
struct protoent *proto;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getprotobynumber: num %d\n", number);
#endif
if ((proto = getprotobynumber(number)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return NULL;
}
return proto;
memcpy(&heap->protoent_number, proto, sizeof(struct protoent));
return (struct protoent *) &heap->protoent_number;
}
struct servent *Winsock_getservbyname(const char FAR *name, const char FAR *proto)
{
struct servent *service;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getservbyname: name %s, proto %s\n", name, proto);
#endif
if ((service = getservbyname(name, proto)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
errno_to_wsaerrno();
return NULL;
}
return service;
memcpy(&heap->servent_name, service, sizeof(struct servent));
return (struct servent *) &heap->servent_name;
}
struct servent *Winsock_getservbyport(int port, const char FAR *proto)
struct servent *Winsock_getservbyport(INT port, const char FAR *proto)
{
struct servent *service;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_getservbyport: port %d, name %s\n", port, proto);
#endif
if ((service = getservbyport(port, proto)) == NULL) {
errno_to_wsaerrno();
return NULL;
}
memcpy(&heap->servent_port, service, sizeof(struct servent));
return (struct servent *) &heap->servent_port;
}
/******************** winsock specific functions ************************/
HANDLE WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg, const char FAR *addr,
INT len, INT type, char FAR *buf, INT buflen)
{
struct hostent *host;
if ((host = gethostbyaddr(addr, len, type)) == NULL) {
PostMessage(hWnd, wMsg, 1, wsaerrno() << 8);
return 1;
}
memcpy(buf, host, buflen);
PostMessage(hWnd, wMsg, 1, 0);
return 1;
}
HANDLE WSAAsyncGetHostByName(HWND hWnd, u_int wMsg, const char FAR *name,
char FAR *buf, INT buflen)
{
struct hostent *host;
if ((host = gethostbyname(name)) == NULL) {
PostMessage(hWnd, wMsg, 2, wsaerrno() << 8);
return 2;
}
memcpy(buf, host, buflen);
PostMessage(hWnd, wMsg, 2, 0);
return 2;
}
HANDLE WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg, const char FAR *name,
char FAR *buf, INT buflen)
{
struct protoent *proto;
if ((proto = getprotobyname(name)) == NULL) {
PostMessage(hWnd, wMsg, 3, wsaerrno() << 8);
return 3;
}
memcpy(buf, proto, buflen);
PostMessage(hWnd, wMsg, 3, 0);
return 3;
}
HANDLE WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg, INT number,
char FAR *buf, INT buflen)
{
struct protoent *proto;
if ((proto = getprotobynumber(number)) == NULL) {
PostMessage(hWnd, wMsg, 4, wsaerrno() << 8);
return 4;
}
memcpy(buf, proto, buflen);
PostMessage(hWnd, wMsg, 4, 0);
return 4;
}
HANDLE WSAAsyncGetServByName(HWND hWnd, u_int wMsg, const char FAR *name,
const char FAR *proto, char FAR *buf, INT buflen)
{
struct servent *service;
if ((service = getservbyname(name, proto)) == NULL) {
PostMessage(hWnd, wMsg, 5, wsaerrno() << 8);
return 5;
}
memcpy(buf, service, buflen);
PostMessage(hWnd, wMsg, 5, 0);
return 5;
}
HANDLE WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, INT port, const char FAR
*proto, char FAR *buf, INT buflen)
{
struct servent *service;
if ((service = getservbyport(port, proto)) == NULL) {
wsa_errno = errno_to_wsaerrno(errno);
return NULL;
PostMessage(hWnd, wMsg, 6, wsaerrno() << 8);
return 6;
}
return service;
memcpy(buf, service, buflen);
PostMessage(hWnd, wMsg, 6, 0);
return 6;
}
HANDLE WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg, const char FAR *addr,
int len, int type, const char FAR *buf, int buflen)
INT WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, long lEvent)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_AsyncSelect: socket %d, HWND %d, wMsg %d, event %d\n", s, hWnd, wMsg, lEvent);
#endif
fcntl(s, F_SETFL, O_NONBLOCK);
}
HANDLE WSAAsyncGetHostByName(HWND hWnd, u_int wMsg, const char FAR *name,
char FAR *buf, int buflen)
{
}
HANDLE WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg, const char FAR *name,
char FAR *buf, int buflen)
{
return 0;
}
HANDLE WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg, int number,
char FAR *buf, int buflen)
{
}
HANDLE WSAAsyncGetServByName(HWND hWnd, u_int wMsg, const char FAR *name,
const char FAR *proto, char FAR *buf, int buflen)
{
}
HANDLE WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port, const char FAR
*proto, char FAR *buf, int buflen)
{
}
int WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, long lEvent)
{
}
int WSAFDIsSet(int fd, fd_set *set)
INT WSAFDIsSet(INT fd, fd_set *set)
{
return( FD_ISSET(fd, set) );
}
WSACancelAsyncRequest(HANDLE hAsyncTaskHandle)
INT WSACancelAsyncRequest(HANDLE hAsyncTaskHandle)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_AsyncRequest: handle %d\n", hAsyncTaskHandle);
#endif
return 0;
}
WSACancelBlockingCall ( void )
INT WSACancelBlockingCall(void)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_CancelBlockCall\n");
#endif
return 0;
}
int WSAGetLastError(void)
INT WSAGetLastError(void)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_GetLastError\n");
#endif
return wsa_errno;
}
void WSASetLastError(int iError)
void WSASetLastError(INT iError)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_SetLastErorr %d\n", iError);
#endif
wsa_errno = iError;
}
BOOL WSAIsBlocking (void)
BOOL WSAIsBlocking(void)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_IsBlocking\n");
#endif
}
FARPROC WSASetBlockingHook(FARPROC lpBlockFunc)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_SetBlockHook\n %8x", lpBlockFunc);
#endif
}
int WSAUnhookBlockingHook(void)
INT WSAUnhookBlockingHook(void)
{
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSA_UnhookBlockingHook\n");
#endif
}
WSADATA Winsock_data = {
@ -443,8 +714,11 @@ WSADATA Winsock_data = {
NULL
};
int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
INT WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
{
int HeapHandle;
MDESC *MyHeap;
#ifdef DEBUG_WINSOCK
fprintf(stderr, "WSAStartup: verReq=%x\n", wVersionRequested);
#endif
@ -452,10 +726,16 @@ int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
if (LOBYTE(wVersionRequested) < 1 ||
(LOBYTE(wVersionRequested) == 1 &&
HIBYTE(wVersionRequested) < 1))
return WSAVERNOTSUPPORTED;
return WSAVERNOTSUPPORTED;
if (!lpWSAData)
return WSAEINVAL;
if ((HeapHandle = GlobalAlloc(GMEM_FIXED,sizeof(struct WinSockHeap))) == 0)
return WSASYSNOTREADY;
heap = (struct WinSockHeap *) GlobalLock(HeapHandle);
HEAP_Init(&MyHeap, heap, sizeof(struct WinSockHeap));
bcopy(&Winsock_data, lpWSAData, sizeof(Winsock_data));
@ -464,7 +744,7 @@ int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
return(0);
}
int WSACleanup(void)
INT WSACleanup(void)
{
wsa_initted = 0;
return 0;

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"

View File

@ -1,5 +1,6 @@
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"

View File

@ -1246,7 +1246,9 @@ int do_int21(struct sigcontext_struct * context)
EBX = DOSVERSION;
EDX = 0x00;
break;
default:
Barf(context);
break;
}
break;
@ -1505,6 +1507,10 @@ int do_int21(struct sigcontext_struct * context)
}
break;
case 0x67: /* SET HANDLE COUNT */
ResetCflag;
break;
case 0x68: /* "FFLUSH" - COMMIT FILE */
ResetCflag;
break;
@ -1525,9 +1531,6 @@ int do_int21(struct sigcontext_struct * context)
ResetCflag;
break;
case 0x67: /* SET HANDLE COUNT */
ResetCflag;
break;
default:
Barf(context);

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"
@ -15,15 +16,12 @@ int do_int25(struct sigcontext_struct *context)
dataptr = (BYTE *) getdword(&dataptr[6]);
fprintf(stderr, "int25: abs diskread, drive %d, sector %d, "
"count %d, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
} else {
begin = EDX & 0xffff;
length = ECX & 0xffff;
}
begin = EDX & 0xffff;
length = ECX & 0xffff;
fprintf(stderr,"int25: abs diskread-2, drive %d, sector %d, count %d,"
" buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
fprintf(stderr, "int25: abs diskread, drive %d, sector %d, "
"count %d, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
ResetCflag;
return 1;

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"
@ -13,14 +14,12 @@ int do_int26(struct sigcontext_struct *context)
length = getword(&dataptr[4]);
dataptr = (BYTE *) getdword(&dataptr[6]);
fprintf(stderr, "int26: abs diskread, drive %d, sector %d, "
"count %d, buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
} else {
begin = EDX & 0xffff;
length = ECX & 0xffff;
}
begin = EDX & 0xffff;
length = ECX & 0xffff;
fprintf(stderr,"int26: abs diskread-2, drive %d, sector %d, count %d,"
fprintf(stderr,"int26: abs diskwrite, drive %d, sector %d, count %d,"
" buffer %d\n", EAX & 0xff, begin, length, (int) dataptr);
ResetCflag;

26
miscemu/int2f.c Normal file
View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"
static void Barf(struct sigcontext_struct *context)
{
fprintf(stderr, "int2f: unknown/not implemented parameters:\n");
fprintf(stderr, "int2f: AX %04x, BX %04x, CX %04x, DX %04x, "
"SI %04x, DI %04x, DS %04x, ES %04x\n",
AX, BX, CX, DX, SI, DI, DS, ES);
}
int do_int2f(struct sigcontext_struct *context)
{
switch(context->sc_eax & 0xffff)
{
case 0x1600: /* windows enhanced mode install check */
/* don't return anything as we're running in standard mode */
break;
default:
Barf(context);
};
return 1;
}

Some files were not shown because too many files have changed in this diff Show More