Release 960712

Fri Jul 12 17:43:05 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/scroll.c]
	Use Win32 heap functions to allocate scroll-bar info structure.

	* [debugger/dbg.y] [debugger/registers.c]
	Added support for FS and GS segment registers.
	Check that segment registers value are OK before returning from
	the signal handler.

	* [tools/build.c] [if1632/relay.c] [loader/builtin.c]
	Changed relay debugging for Win32 function: the relay code now
	passes the entry point address instead of the function name.

	* [tools/build.c] [miscemu/*.c]
	Added support for data entry points in Win32 DLLs.
	Added 'cdecl' function type for Win32.
	For 'register' function, the relay code now passes a pointer to
	the SIGCONTEXT structure.
	
	* [include/registers.h] [include/wine.h]
	Moved SIGCONTEXT structure definition in registers.h.

	* [loader/pe_image.c]
	Don't die at once if some Win32 entry points cannot be found, but
	set them to NULL, just like we do for Win16. This allows some
	programs to go further before crashing.

	* [loader/task.c] [loader/main.c]
	Moved global initializations from InitTask() to MAIN_Init(), as
	they no longer need a task context with the new SEGPTR heap functions.

	* [memory/string.c]
	Added lstrcpynAtoW and lstrcpynWtoA; not real API functions, but
 	very convenient.

	* [windows/graphics.c]
	Partially implemented DrawEdge().

	* [windows/timer.c] [windows/caret.c]
	Implemented Win32 timer handling. Updated caret management to use
	Win32 timers (avoids having to use a Win16 callback).

	* [windows/win.c]
	Prevent programs from setting some style bits with
	SetWindowLong(). This should fix some BadMatch crashes.
	Link new windows at the end of the linked list.

	* [windows/winpos.c]
	Don't try to activate a child window in ShowWindow().

	* [windows/winproc.c]
	Added a 32->32 thunk to support Ansi-Unicode translation.

Wed Jul 10 22:11:12 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [files/directory.c]
	Additional (undocumented) return value for GetTempDrive() added.

	* [files/dos_fs.c] [files/file.c] [include/windows.h]
	GetTempFileName32* added.
	GetShortPathName* added.

	* [memory/string.c]
	Win16 lstrcpy() can get NULL ptrs as argument and survive.

	* [misc/lzexpand.c]
	LZOpenFile(): also try opening with compressed filename if normal
 	open fails.

	* [misc/ole2nls.c] [misc/lstr.c] [include/windows.h]
	Char* added.
	CompareString* added.

Sun Jul  7 01:22:14 1996  Jukka Iivonen <iivonen@cc.helsinki.fi>

	* [objects/font.c] [if1632/gdi32.spec]
	CreateFontIndirect32A and CreateFontIndirect32W added.

	* [misc/ole2nls.c]
	GetUserDefaultLCID return values updated for new languages.
	Finnish support added for GetLocaleInfoA.

	* [object/palette] [gdi32.spec]
	RealizePalette32 and SelectPalette32 added.
	
Sat Jul  6 17:27:30 1996  Ronan Waide  <root@waider.ie>

	* [misc/shell.c]
	Fixup for SHELL_FindExecutable so that File->Run from progman
	works once more. Still needs some more fixups - grep for FIXME in
	this file.
This commit is contained in:
Alexandre Julliard 1996-07-12 19:02:39 +00:00
parent 3051b64489
commit ca22b33dad
133 changed files with 3044 additions and 2173 deletions

View File

@ -1,12 +1,13 @@
This is release 960705 of Wine, the MS Windows emulator. This is still a
This is release 960712 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960705: (see ChangeLog for details)
- New window procedure thunks.
WHAT'S NEW with Wine-960712: (see ChangeLog for details)
- Many built-in debugger improvements.
- Some more Win32 functions.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -15,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960705.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960705.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960705.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960705.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960712.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960712.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960712.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960712.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

View File

@ -1,3 +1,97 @@
----------------------------------------------------------------------
Fri Jul 12 17:43:05 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/scroll.c]
Use Win32 heap functions to allocate scroll-bar info structure.
* [debugger/dbg.y] [debugger/registers.c]
Added support for FS and GS segment registers.
Check that segment registers value are OK before returning from
the signal handler.
* [tools/build.c] [if1632/relay.c] [loader/builtin.c]
Changed relay debugging for Win32 function: the relay code now
passes the entry point address instead of the function name.
* [tools/build.c] [miscemu/*.c]
Added support for data entry points in Win32 DLLs.
Added 'cdecl' function type for Win32.
For 'register' function, the relay code now passes a pointer to
the SIGCONTEXT structure.
* [include/registers.h] [include/wine.h]
Moved SIGCONTEXT structure definition in registers.h.
* [loader/pe_image.c]
Don't die at once if some Win32 entry points cannot be found, but
set them to NULL, just like we do for Win16. This allows some
programs to go further before crashing.
* [loader/task.c] [loader/main.c]
Moved global initializations from InitTask() to MAIN_Init(), as
they no longer need a task context with the new SEGPTR heap functions.
* [memory/string.c]
Added lstrcpynAtoW and lstrcpynWtoA; not real API functions, but
very convenient.
* [windows/graphics.c]
Partially implemented DrawEdge().
* [windows/timer.c] [windows/caret.c]
Implemented Win32 timer handling. Updated caret management to use
Win32 timers (avoids having to use a Win16 callback).
* [windows/win.c]
Prevent programs from setting some style bits with
SetWindowLong(). This should fix some BadMatch crashes.
Link new windows at the end of the linked list.
* [windows/winpos.c]
Don't try to activate a child window in ShowWindow().
* [windows/winproc.c]
Added a 32->32 thunk to support Ansi-Unicode translation.
Wed Jul 10 22:11:12 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/directory.c]
Additional (undocumented) return value for GetTempDrive() added.
* [files/dos_fs.c] [files/file.c] [include/windows.h]
GetTempFileName32* added.
GetShortPathName* added.
* [memory/string.c]
Win16 lstrcpy() can get NULL ptrs as argument and survive.
* [misc/lzexpand.c]
LZOpenFile(): also try opening with compressed filename if normal
open fails.
* [misc/ole2nls.c] [misc/lstr.c] [include/windows.h]
Char* added.
CompareString* added.
Sun Jul 7 01:22:14 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [objects/font.c] [if1632/gdi32.spec]
CreateFontIndirect32A and CreateFontIndirect32W added.
* [misc/ole2nls.c]
GetUserDefaultLCID return values updated for new languages.
Finnish support added for GetLocaleInfoA.
* [object/palette] [gdi32.spec]
RealizePalette32 and SelectPalette32 added.
Sat Jul 6 17:27:30 1996 Ronan Waide <root@waider.ie>
* [misc/shell.c]
Fixup for SHELL_FindExecutable so that File->Run from progman
works once more. Still needs some more fixups - grep for FIXME in
this file.
----------------------------------------------------------------------
Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
@ -461,7 +555,7 @@ Thu May 23 19:35:38 1996 Greg Kreider <kreider@natlab.research.philips.com>
* [misc/main.c]
Result of option "-fixedmap" is to turn flag on.
Thu May 23 19:15:41 1996 Waider <root@waider.ie>
Thu May 23 19:15:41 1996 Ronan Waide <root@waider.ie>
* [misc/shell.c]
ShellExecute and FindExecutable now both use common code to

View File

@ -124,12 +124,10 @@ address offsets and must have the arguments translated and moved to
Wines 32-bit stack. This task is handled by the code in the "if1632"
directory. To define a new API entry point handler you must place a
new entry in the appropriate API specification file. These files are
named *.spec. For example, the API specification file for the USER DLL
is contained in the file user.spec. These entries are processed by
the "build" program to create dll_*.s and dll_tab_*.c. The dll_*.s
files contain the entry point code for each API call, and the dll_tab_*.s
files contain tables used by relay.c to translate arguments and transfer
control to the proper handler. The format of the *.spec files is
named *.spec. For example, the API specification file for the USER
DLL is contained in the file user.spec. These entries are processed
by the "build" program to create an assembly file containing the entry
point code for each API call. The format of the *.spec files is
documented in the file "tools/build-spec.txt".

View File

@ -256,12 +256,7 @@ static LRESULT CBPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
hOldFont = SelectObject(hdc, lphl->hFont);
#ifdef WINELIB32
hBrush = SendMessage32A(lphl->hParent, WM_CTLCOLORLISTBOX, hdc, hwnd);
#else
hBrush = SendMessage16(lphl->hParent, WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
#endif
hBrush = SendMessage32A( lphl->hParent, WM_CTLCOLORLISTBOX, hdc, hwnd );
if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
lpls = ListBoxGetItem(lphl,lphl->ItemFocused);

View File

@ -85,31 +85,18 @@ typedef struct
#define EDITSTATEPTR(wndPtr) (*(EDITSTATE **)((wndPtr)->wExtra))
#ifdef WINELIB32
#define EDIT_SEND_CTLCOLOR(wndPtr,hdc) \
SendMessage32A((wndPtr)->parent->hwndSelf, WM_CTLCOLOREDIT, \
(WPARAM)(hdc), (LPARAM)(wndPtr)->hwndSelf)
(SendMessage32A((wndPtr)->parent->hwndSelf, WM_CTLCOLOREDIT, \
(WPARAM)(hdc), (LPARAM)(wndPtr)->hwndSelf ))
#define EDIT_NOTIFY_PARENT(wndPtr, wNotifyCode) \
SendMessage32A((wndPtr)->parent->hwndSelf, WM_COMMAND, \
MAKEWPARAM((wndPtr)->wIDmenu, wNotifyCode), \
(LPARAM)(wndPtr)->hwndSelf )
(SendMessage32A((wndPtr)->parent->hwndSelf, WM_COMMAND, \
MAKEWPARAM((wndPtr)->wIDmenu, wNotifyCode), \
(LPARAM)(wndPtr)->hwndSelf ))
#define DPRINTF_EDIT_MSG(str) \
dprintf_edit(stddeb, \
"edit: " str ": hwnd=%08x, wParam=%08x, lParam=%08lx\n", \
(UINT)hwnd, (UINT)wParam, (DWORD)lParam)
#else
#define EDIT_SEND_CTLCOLOR(wndPtr,hdc) \
SendMessage16((wndPtr)->parent->hwndSelf, WM_CTLCOLOR, \
(WPARAM)(hdc), MAKELPARAM((wndPtr)->hwndSelf, CTLCOLOR_EDIT))
#define EDIT_NOTIFY_PARENT(wndPtr, wNotifyCode) \
SendMessage16((wndPtr)->parent->hwndSelf, WM_COMMAND, \
(wndPtr)->wIDmenu, \
MAKELPARAM((wndPtr)->hwndSelf, wNotifyCode))
#define DPRINTF_EDIT_MSG(str) \
dprintf_edit(stddeb, \
"edit: " str ": hwnd=%04x, wParam=%04x, lParam=%08lx\n", \
(UINT)hwnd, (UINT)wParam, (DWORD)lParam)
#endif
dprintf_edit(stddeb, \
"edit: " str ": hwnd=%04x, wParam=%04x, lParam=%08x\n", \
(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
/*********************************************************************
*

View File

@ -19,7 +19,6 @@
#include <string.h>
#include <ctype.h>
#include "windows.h"
#include "user.h"
#include "win.h"
#include "gdi.h"
#include "msdos.h"
@ -32,34 +31,12 @@
#include "debug.h"
#include "xmalloc.h"
#if 0
#define LIST_HEAP_ALLOC(lphl,f,size) ((int)HEAP_Alloc(&lphl->Heap,f,size) & 0xffff)
#define LIST_HEAP_FREE(lphl,handle) (HEAP_Free(&lphl->Heap,LIST_HEAP_ADDR(lphl,handle)))
#define LIST_HEAP_ADDR(lphl,handle) \
((void *)((handle) ? ((handle) | ((int)lphl->Heap & 0xffff0000)) : 0))
#else
/* FIXME: shouldn't each listbox have its own heap? */
#if 0
#define LIST_HEAP_ALLOC(lphl,f,size) USER_HEAP_ALLOC(size)
#define LIST_HEAP_FREE(lphl,handle) USER_HEAP_FREE(handle)
#define LIST_HEAP_ADDR(lphl,handle) USER_HEAP_LIN_ADDR(handle)
#define LIST_HEAP_SEG_ADDR(lphl,handle) USER_HEAP_SEG_ADDR(handle)
#else
/* Something like this maybe ? */
#define LIST_HEAP_ALLOC(lphl,f,size) \
LOCAL_Alloc( lphl->HeapSel, LMEM_FIXED, (size) )
#if 0
#define LIST_HEAP_REALLOC(handle,size) \
LOCAL_ReAlloc( USER_HeapSel, (handle), (size), LMEM_FIXED )
#endif
LOCAL_Alloc( lphl->HeapSel, LMEM_FIXED, (size) )
#define LIST_HEAP_FREE(lphl,handle) \
LOCAL_Free( lphl->HeapSel, (handle) )
LOCAL_Free( lphl->HeapSel, (handle) )
#define LIST_HEAP_ADDR(lphl,handle) \
((handle) ? PTR_SEG_OFF_TO_LIN(lphl->HeapSel, (handle)) : NULL)
#define LIST_HEAP_SEG_ADDR(lphl,handle) \
((handle) ? MAKELONG((handle), lphl->HeapSel) : 0)
#endif
#endif
((handle) ? PTR_SEG_OFF_TO_LIN(lphl->HeapSel, (handle)) : NULL)
#define LIST_HEAP_SIZE 0x10000
@ -128,13 +105,8 @@ void CreateListBoxStruct(HWND hwnd, WORD CtlType, LONG styles, HWND parent)
ListBoxAskMeasure(lphl,&dummyls);
}
/* WINELIBS list boxes do not operate on local heaps */
#ifndef WINELIB
lphl->HeapSel = GlobalAlloc16(GMEM_FIXED,LIST_HEAP_SIZE);
LocalInit( lphl->HeapSel, 0, LIST_HEAP_SIZE-1);
#else
lphl->HeapSel = 0;
#endif
}
void DestroyListBoxStruct(LPHEADLIST lphl)
@ -154,13 +126,8 @@ static LPHEADLIST ListBoxGetStorageHeader(HWND hwnd)
void ListBoxSendNotification(LPHEADLIST lphl, WORD code)
{
if (lphl->dwStyle & LBS_NOTIFY)
#ifdef WINELIB32
SendMessage32A(lphl->hParent, WM_COMMAND,
MAKEWPARAM(lphl->CtlID,code), (LPARAM)lphl->hSelf);
#else
SendMessage16(lphl->hParent, WM_COMMAND,
lphl->CtlID, MAKELONG(lphl->hSelf, code));
#endif
SendMessage32A( lphl->hParent, WM_COMMAND,
MAKEWPARAM( lphl->CtlID, code), (LPARAM)lphl->hSelf );
}
@ -303,25 +270,20 @@ int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y)
void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls)
{
HANDLE hTemp = USER_HEAP_ALLOC( sizeof(MEASUREITEMSTRUCT16) );
MEASUREITEMSTRUCT16 *lpmeasure = (MEASUREITEMSTRUCT16 *) USER_HEAP_LIN_ADDR(hTemp);
MEASUREITEMSTRUCT16 *lpmeasure = SEGPTR_NEW(MEASUREITEMSTRUCT16);
if (!lpmeasure) return;
*lpmeasure = lpls->mis;
lpmeasure->itemHeight = lphl->StdItemHeight;
SendMessage16( lphl->hParent, WM_MEASUREITEM, lphl->CtlID,
(LPARAM)SEGPTR_GET(lpmeasure) );
if (lpmeasure == NULL) {
fprintf(stdnimp,"ListBoxAskMeasure() out of memory !\n");
return;
}
*lpmeasure = lpls->mis;
lpmeasure->itemHeight = lphl->StdItemHeight;
SendMessage16(lphl->hParent, WM_MEASUREITEM, lphl->CtlID, (LPARAM)USER_HEAP_SEG_ADDR(hTemp));
if (lphl->dwStyle & LBS_OWNERDRAWFIXED) {
if (lpmeasure->itemHeight > lphl->StdItemHeight)
lphl->StdItemHeight = lpmeasure->itemHeight;
lpls->mis.itemHeight = lpmeasure->itemHeight;
}
USER_HEAP_FREE(hTemp);
if (lphl->dwStyle & LBS_OWNERDRAWFIXED)
{
if (lpmeasure->itemHeight > lphl->StdItemHeight)
lphl->StdItemHeight = lpmeasure->itemHeight;
lpls->mis.itemHeight = lpmeasure->itemHeight;
}
SEGPTR_FREE(lpmeasure);
}
/* -------------------- strings and item data ---------------------- */
@ -975,11 +937,9 @@ static LONG LBLButtonDown(HWND hwnd, WORD wParam, LONG lParam)
InvalidateRect16( hwnd, &rectsel, TRUE );
}
#ifndef WINELIB
if (GetWindowLong32A(lphl->hSelf,GWL_EXSTYLE) & WS_EX_DRAGDETECT)
if( DragDetect(lphl->hSelf,MAKEPOINT16(lParam)) )
SendMessage16(lphl->hParent, WM_BEGINDRAG,0,0L);
#endif
return 0;
}
@ -1005,15 +965,8 @@ static LONG LBRButtonUp(HWND hwnd, WORD wParam, LONG lParam)
{
LPHEADLIST lphl = ListBoxGetStorageHeader(hwnd);
#ifdef WINELIB32
SendMessage32A(lphl->hParent, WM_COMMAND,
MAKEWPARAM(GetWindowWord(hwnd,GWW_ID),LBN_DBLCLK),
(LPARAM)hwnd);
#else
SendMessage16(lphl->hParent, WM_COMMAND, GetWindowWord(hwnd,GWW_ID),
MAKELONG(hwnd, LBN_DBLCLK));
#endif
return 0;
}
@ -1311,14 +1264,8 @@ static LONG LBPaint(HWND hwnd, WORD wParam, LONG lParam)
hOldFont = SelectObject(hdc, lphl->hFont);
#ifdef WINELIB32
hBrush = (HBRUSH) SendMessage16(lphl->hParent, WM_CTLCOLORLISTBOX, (WPARAM)hdc,
(LPARAM)hwnd);
#else
hBrush = SendMessage16(lphl->hParent, WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
#endif
hBrush = (HBRUSH)SendMessage32A( lphl->hParent, WM_CTLCOLORLISTBOX,
(WPARAM)hdc, (LPARAM)hwnd);
if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
FillRect16(hdc, &rect, hBrush);

View File

@ -303,13 +303,8 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, UINT key )
if (p && (p[1] != '&') && (toupper(p[1]) == key)) return i;
}
}
#ifdef WINELIB32
menuchar = SendMessage32A( hwndOwner, WM_MENUCHAR,
MAKEWPARAM(key,menu->wFlags), hmenu );
#else
menuchar = SendMessage16( hwndOwner, WM_MENUCHAR, key,
MAKELONG( menu->wFlags, hmenu ) );
#endif
MAKEWPARAM( key, menu->wFlags ), hmenu );
if (HIWORD(menuchar) == 2) return LOWORD(menuchar);
if (HIWORD(menuchar) == 1) return -2;
return -1;
@ -860,17 +855,9 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
{
NC_DrawSysButton( lppop->hWnd, hdc, TRUE );
if (sendMenuSelect)
#ifdef WINELIB32
/* FIX: LostInfo */
SendMessage32A( hwndOwner, WM_MENUSELECT,
MAKEWPARAM( WIN_FindWndPtr(lppop->hWnd)->hSysMenu,
lppop->wFlags | MF_MOUSESELECT ),
(LPARAM)hmenu );
#else
SendMessage16( hwndOwner, WM_MENUSELECT,
WIN_FindWndPtr(lppop->hWnd)->hSysMenu,
MAKELONG(lppop->wFlags | MF_MOUSESELECT, hmenu));
#endif
}
else
{
@ -878,30 +865,14 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex,
MENU_DrawMenuItem( lppop->hWnd, hdc, &lppop->items[lppop->FocusedItem],
lppop->Height, !(lppop->wFlags & MF_POPUP) );
if (sendMenuSelect)
#ifdef WINELIB32
SendMessage32A( hwndOwner, WM_MENUSELECT,
MAKEWPARAM( lppop->items[lppop->FocusedItem].item_id,
lppop->items[lppop->FocusedItem].item_flags|
MF_MOUSESELECT ),
(LPARAM) hmenu );
#else
SendMessage16( hwndOwner, WM_MENUSELECT,
lppop->items[lppop->FocusedItem].item_id,
MAKELONG( lppop->items[lppop->FocusedItem].item_flags | MF_MOUSESELECT, hmenu));
#endif
}
}
#ifdef WINELIB32
/* FIX: Lost Info */
else if (sendMenuSelect)
SendMessage32A( hwndOwner, WM_MENUSELECT,
MAKEWPARAM( (DWORD)hmenu, lppop->wFlags | MF_MOUSESELECT),
hmenu );
#else
else if (sendMenuSelect)
SendMessage16( hwndOwner, WM_MENUSELECT, hmenu,
MAKELONG( lppop->wFlags | MF_MOUSESELECT, hmenu ) );
#endif
MAKELONG( lppop->wFlags | MF_MOUSESELECT, hmenu ) );
ReleaseDC( lppop->hWnd, hdc );
}

View File

@ -16,11 +16,10 @@
#include "syscolor.h"
#include "sysmetrics.h"
#include "scroll.h"
#include "user.h"
#include "graphics.h"
#include "heap.h"
#include "win.h"
#include "stddebug.h"
/* #define DEBUG_SCROLL */
#include "debug.h"
@ -94,38 +93,39 @@ static void SCROLL_LoadBitmaps(void)
hRgArrowI = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_RGARROWI));
}
/***********************************************************************
* SCROLL_GetPtrScrollInfo
*/
static SCROLLINFO *SCROLL_GetPtrScrollInfo( WND* wndPtr, int nBar )
{
HANDLE handle;
SCROLLINFO *infoPtr;
if (!wndPtr) return NULL;
switch(nBar)
{
case SB_HORZ: handle = wndPtr->hHScroll; break;
case SB_VERT: handle = wndPtr->hVScroll; break;
case SB_CTL: return (SCROLLINFO *)wndPtr->wExtra;
case SB_HORZ: infoPtr = (SCROLLINFO *)wndPtr->pHScroll; break;
case SB_VERT: infoPtr = (SCROLLINFO *)wndPtr->pVScroll; break;
case SB_CTL: infoPtr = (SCROLLINFO *)wndPtr->wExtra; break;
default: return NULL;
}
if (!handle) /* Create the info structure if needed */
if (!infoPtr) /* Create the info structure if needed */
{
if ((handle = USER_HEAP_ALLOC( sizeof(SCROLLINFO) )))
if ((infoPtr = HeapAlloc( SystemHeap, 0, sizeof(SCROLLINFO) )))
{
SCROLLINFO *infoPtr = (SCROLLINFO *) USER_HEAP_LIN_ADDR( handle );
infoPtr->MinVal = infoPtr->CurVal = 0;
infoPtr->MaxVal = 100;
infoPtr->flags = ESB_ENABLE_BOTH;
if (nBar == SB_HORZ) wndPtr->hHScroll = handle;
else wndPtr->hVScroll = handle;
if (nBar == SB_HORZ) wndPtr->pHScroll = infoPtr;
else wndPtr->pVScroll = infoPtr;
}
if (!hUpArrow) SCROLL_LoadBitmaps();
}
return (SCROLLINFO *) USER_HEAP_LIN_ADDR( handle );
return infoPtr;
}
/***********************************************************************
* SCROLL_GetScrollInfo
*/
@ -364,13 +364,8 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT16 *rect,
{
if (nBar == SB_CTL) /* Only scrollbar controls send WM_CTLCOLOR */
{
#ifdef WINELIB32
HBRUSH hbrush = SendMessage32A( GetParent(hwnd), WM_CTLCOLORSCROLLBAR,
hdc, hwnd );
#else
HBRUSH hbrush = SendMessage16( GetParent(hwnd), WM_CTLCOLOR, hdc,
MAKELONG(hwnd, CTLCOLOR_SCROLLBAR) );
#endif
HBRUSH hbrush = SendMessage32A( GetParent(hwnd),
WM_CTLCOLORSCROLLBAR, hdc, hwnd );
SelectObject( hdc, hbrush );
}
else SelectObject( hdc, sysColorObjects.hbrushScrollbar );
@ -524,15 +519,9 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WORD wParam )
default:
return;
}
#ifdef WINELIB32
SendMessage32A( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, hwnd );
#else
SendMessage16( GetParent(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, MAKELONG( 0, hwnd ));
#endif
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, hwnd );
}
@ -619,19 +608,14 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
{
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEUP, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
SB_LINEUP, hwndCtl );
SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(TIMERPROC32)0 );
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
else KillSystemTimer32( hwnd, SCROLL_TIMER );
break;
case SCROLL_TOP_RECT:
@ -642,19 +626,14 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
{
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEUP, hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEUP, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
SB_PAGEUP, hwndCtl );
SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(TIMERPROC32)0 );
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
else KillSystemTimer32( hwnd, SCROLL_TIMER );
break;
case SCROLL_THUMB:
@ -686,13 +665,8 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
trackThumbPos + lastMousePos - lastClickPos );
/* Save tracking info */
uTrackingPos = trackThumbPos + pos - lastClickPos;
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM(SB_THUMBTRACK,val), hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_THUMBTRACK, MAKELONG( val, hwndCtl ));
#endif
MAKEWPARAM( SB_THUMBTRACK, val ), hwndCtl );
SCROLL_DrawMovingThumb( hdc, &rect, vertical,
arrowSize, uTrackingPos );
}
@ -707,19 +681,14 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
{
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEDOWN, hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_PAGEDOWN, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
SB_PAGEDOWN, hwndCtl );
SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(TIMERPROC32)0 );
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
else KillSystemTimer32( hwnd, SCROLL_TIMER );
break;
case SCROLL_BOTTOM_ARROW:
@ -729,19 +698,14 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
{
if ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))
{
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEDOWN, hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_LINEDOWN, MAKELONG( 0, hwndCtl ));
#endif
SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(FARPROC)0 );
SB_LINEDOWN, hwndCtl );
SetSystemTimer32( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY,
(TIMERPROC32)0 );
}
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
else KillSystemTimer32( hwnd, SCROLL_TIMER );
break;
}
@ -751,22 +715,12 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
{
UINT val = SCROLL_GetThumbVal( infoPtr, &rect, vertical,
trackThumbPos + lastMousePos - lastClickPos );
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
MAKEWPARAM(SB_THUMBPOSITION,val), hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_THUMBPOSITION, MAKELONG( val, hwndCtl ) );
#endif
MAKEWPARAM( SB_THUMBPOSITION, val ), hwndCtl );
}
else
#ifdef WINELIB32
SendMessage32A( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_ENDSCROLL, hwndCtl );
#else
SendMessage16( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL,
SB_ENDSCROLL, MAKELONG( 0, hwndCtl ) );
#endif
SB_ENDSCROLL, hwndCtl );
trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */
}

View File

@ -222,13 +222,8 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
wFormat |= DT_NOPREFIX;
if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont );
#ifdef WINELIB32
hBrush = SendMessage32A( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
#else
hBrush = SendMessage16( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, (WORD)hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif
if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
FillRect16(hdc, &rc, hBrush);
if (wndPtr->text) DrawText16( hdc, wndPtr->text, -1, &rc, wFormat );
@ -281,13 +276,8 @@ static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc )
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect16( wndPtr->hwndSelf, &rc);
#ifdef WINELIB32
hbrush = SendMessage32A( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
#else
hbrush = SendMessage16( GetParent(wndPtr->hwndSelf), WM_CTLCOLOR, hdc,
MAKELONG(wndPtr->hwndSelf, CTLCOLOR_STATIC));
#endif
FillRect16( hdc, &rc, hbrush );
if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon );
}

View File

@ -37,31 +37,25 @@ static int next_bp = 1; /* breakpoint 0 is reserved for step-over */
*/
static void DEBUG_SetOpcode( const DBG_ADDR *addr, BYTE op )
{
if (addr->seg)
BYTE *ptr;
if (addr->seg) ptr = (BYTE *)PTR_SEG_OFF_TO_LIN( addr->seg, addr->off );
else ptr = (BYTE *)addr->off;
/* There are a couple of problems with this. On Linux prior to
1.1.62, this call fails (ENOACCESS) due to a bug in fs/exec.c.
This code is currently not tested at all on BSD.
How do I get the old protection in order to restore it later on?
*/
if (mprotect((caddr_t)((int)ptr & (~4095)), 4096,
PROT_READ | PROT_WRITE | PROT_EXEC) == -1)
{
*(BYTE *)PTR_SEG_OFF_TO_LIN( addr->seg, addr->off ) = op;
}
else /* 32-bit code, so we have to change the protection first */
{
/* There are a couple of problems with this. On Linux prior to
1.1.62, this call fails (ENOACCESS) due to a bug in fs/exec.c.
This code is currently not tested at all on BSD.
How do I determine the page size in a more symbolic manner?
And why does mprotect need that start address of the page
in the first place?
Not that portability matters, this code is i386 only anyways...
How do I get the old protection in order to restore it later on?
*/
if (mprotect((caddr_t)(addr->off & (~4095)), 4096,
PROT_READ | PROT_WRITE | PROT_EXEC) == -1)
{
perror( "Can't set break point" );
return;
}
*(BYTE *)addr->off = op;
mprotect((caddr_t)(addr->off & ~4095), 4096,
PROT_READ | PROT_EXEC );
perror( "Can't set break point" );
return;
}
*ptr = op;
/* mprotect((caddr_t)(addr->off & ~4095), 4096,
PROT_READ | PROT_EXEC ); */
}

View File

@ -234,6 +234,7 @@ void wine_debug( int signal, SIGCONTEXT *regs )
static int loaded_symbols = 0;
char SymbolTableFile[256];
int instr_len = 0, newmode;
BOOL32 ret_ok;
#ifdef YYDEBUG
yydebug = 0;
#endif
@ -295,6 +296,7 @@ void wine_debug( int signal, SIGCONTEXT *regs )
instr_len = addr.off - EIP_reg(DEBUG_context);
}
ret_ok = 0;
do
{
issue_prompt();
@ -303,7 +305,9 @@ void wine_debug( int signal, SIGCONTEXT *regs )
addr.seg = CS_reg(DEBUG_context);
addr.off = EIP_reg(DEBUG_context);
DBG_FIX_ADDR_SEG( &addr, 0 );
} while (!DBG_CHECK_READ_PTR( &addr, 1 ));
ret_ok = DEBUG_ValidateRegisters();
if (ret_ok) ret_ok = DBG_CHECK_READ_PTR( &addr, 1 );
} while (!ret_ok);
}
DEBUG_RestartExecution( regs, dbg_exec_mode, instr_len );

View File

@ -80,6 +80,8 @@ $es { yylval.reg = REG_ES; return tREG; }
$ds { yylval.reg = REG_DS; return tREG; }
$cs { yylval.reg = REG_CS; return tREG; }
$ss { yylval.reg = REG_SS; return tREG; }
$fs { yylval.reg = REG_FS; return tREG; }
$gs { yylval.reg = REG_GS; return tREG; }
info|inf|in { return tINFO; }
show|sho|sh { return tINFO; }
@ -169,7 +171,11 @@ static int dbg_read(char * buf, int size)
{
flush_symbols();
line = readline ("Wine-dbg>");
if (!line) exit(0);
if (!line)
{
fprintf( stderr, "\n" );
exit(0);
}
/* Remove leading and trailing whitespace from the line */

View File

@ -212,7 +212,7 @@ void DEBUG_LoadEntryPoints(void)
DBG_ADDR addr;
char buffer[256];
unsigned char *cpnt, *name;
unsigned int address;
FARPROC16 address;
BOOL ok;
for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry))

View File

@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
#include "debugger.h"

View File

@ -7,11 +7,8 @@
#include <stdio.h>
#include "debugger.h"
SIGCONTEXT *DEBUG_context;
/***********************************************************************
* DEBUG_SetRegister
*
@ -45,6 +42,20 @@ void DEBUG_SetRegister( enum debug_regs reg, int val )
case REG_DS: DS_reg(DEBUG_context) = val; break;
case REG_ES: ES_reg(DEBUG_context) = val; break;
case REG_SS: SS_reg(DEBUG_context) = val; break;
#ifdef FS_reg
case REG_FS: FS_reg(DEBUG_context) = val; break;
#else
case REG_FS:
fprintf( stderr, "Register %fs not supported on this system\n ");
break;
#endif
#ifdef GS_reg
case REG_GS: GS_reg(DEBUG_context) = val; break;
#else
case REG_GS:
fprintf( stderr, "Register %gs not supported on this system\n ");
break;
#endif
}
}
@ -82,6 +93,20 @@ int DEBUG_GetRegister( enum debug_regs reg )
case REG_DS: return DS_reg(DEBUG_context);
case REG_ES: return ES_reg(DEBUG_context);
case REG_SS: return SS_reg(DEBUG_context);
#ifdef FS_reg
case REG_FS: return FS_reg(DEBUG_context);
#else
case REG_FS:
fprintf( stderr, "Register %fs not supported on this system\n ");
return 0;
#endif
#ifdef GS_reg
case REG_GS: return GS_reg(DEBUG_context);
#else
case REG_GS:
fprintf( stderr, "Register %gs not supported on this system\n ");
return 0;
#endif
}
return 0; /* should not happen */
}
@ -98,13 +123,18 @@ void DEBUG_InfoRegisters(void)
fprintf(stderr,"Register dump:\n");
/* First get the segment registers out of the way */
fprintf( stderr," CS:%04x SS:%04x DS:%04x ES:%04x\n",
fprintf( stderr," CS:%04x SS:%04x DS:%04x ES:%04x",
CS_reg(DEBUG_context), SS_reg(DEBUG_context),
DS_reg(DEBUG_context), ES_reg(DEBUG_context) );
#ifdef FS_reg
fprintf( stderr, " FS:%04x", FS_reg(DEBUG_context) );
#endif
#ifdef GS_reg
fprintf( stderr, " GS:%04x", GS_reg(DEBUG_context) );
#endif
if (dbg_mode == 16)
{
fprintf( stderr," IP:%04x SP:%04x BP:%04x FLAGS:%04x\n",
fprintf( stderr,"\n IP:%04x SP:%04x BP:%04x FLAGS:%04x\n",
IP_reg(DEBUG_context), SP_reg(DEBUG_context),
BP_reg(DEBUG_context), FL_reg(DEBUG_context) );
fprintf( stderr," AX:%04x BX:%04x CX:%04x DX:%04x SI:%04x DI:%04x\n",
@ -114,7 +144,7 @@ void DEBUG_InfoRegisters(void)
}
else /* 32-bit mode */
{
fprintf( stderr, " EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx\n",
fprintf( stderr, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx\n",
EIP_reg(DEBUG_context), ESP_reg(DEBUG_context),
EBP_reg(DEBUG_context), EFL_reg(DEBUG_context) );
fprintf( stderr, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
@ -125,3 +155,52 @@ void DEBUG_InfoRegisters(void)
}
}
/***********************************************************************
* DEBUG_ValidateRegisters
*
* Make sure all registers have a correct value for returning from
* the signal handler.
*/
BOOL32 DEBUG_ValidateRegisters(void)
{
/* Check that a selector is a valid ring-3 LDT selector, or a NULL selector */
#define CHECK_SEG(seg,name) \
if (((seg) & ~3) && \
((((seg) & 7) != 7) || IS_LDT_ENTRY_FREE(SELECTOR_TO_ENTRY(seg)))) \
{ \
fprintf( stderr, "*** Invalid value for %s register: %04x\n", \
(name), (seg) ); \
return FALSE; \
}
if (CS_reg(DEBUG_context) != WINE_CODE_SELECTOR)
CHECK_SEG( CS_reg(DEBUG_context), "CS" );
if (SS_reg(DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( SS_reg(DEBUG_context), "SS" );
if (DS_reg(DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( DS_reg(DEBUG_context), "DS" );
if (ES_reg(DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( ES_reg(DEBUG_context), "ES" );
if (FS_reg(DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( FS_reg(DEBUG_context), "FS" );
if (GS_reg(DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( GS_reg(DEBUG_context), "GS" );
/* Check that CS and SS are not NULL */
if (!(CS_reg(DEBUG_context) & ~3))
{
fprintf( stderr, "*** Invalid value for CS register: %04x\n",
CS_reg(DEBUG_context) );
return FALSE;
}
if (!(SS_reg(DEBUG_context) & ~3))
{
fprintf( stderr, "*** Invalid value for SS register: %04x\n",
SS_reg(DEBUG_context) );
return FALSE;
}
return TRUE;
#undef CHECK_SEG
}

View File

@ -248,10 +248,24 @@ UINT DIR_GetDosPath( int element, LPSTR path, UINT count )
*/
BYTE GetTempDrive( BYTE ignored )
{
/* FIXME: apparently Windows does something with the ignored byte */
return DIR_TempDosDir[0];
}
UINT32 WIN16_GetTempDrive( BYTE ignored )
{
/* A closer look at krnl386.exe shows what the SDK doesn't mention:
*
* returns:
* AL: driveletter
* AH: ':' - yes, some kernel code even does stosw with
* the returned AX.
* DX: 1 for success
*/
return MAKELONG( GetTempDrive(ignored) | (':' << 8), 1 );
}
/***********************************************************************
* GetWindowsDirectory (KERNEL.134)
*/

View File

@ -24,6 +24,8 @@
#include "msdos.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "string32.h"
/* Chars we don't want to see in DOS file names */
#define INVALID_DOS_CHARS "*?<>|\"+=,;[] \345"
@ -716,3 +718,32 @@ int DOSFS_FindNext( const char *path, const char *mask, int drive,
dir = NULL;
return 0; /* End of directory */
}
/***********************************************************************
* GetShortPathNameA (KERNEL32.271)
*/
DWORD GetShortPathName32A( LPCSTR longpath, LPSTR shortpath, DWORD shortlen )
{
LPCSTR dostruename;
dprintf_dosfs( stddeb, "GetShortPathName32A(%s,%p,%ld)\n",
longpath, shortpath, shortlen );
dostruename = DOSFS_GetDosTrueName( longpath, 0 );
lstrcpyn32A( shortpath, dostruename, shortlen );
return strlen(dostruename);
}
/***********************************************************************
* GetShortPathNameW (KERNEL32.272)
*/
DWORD GetShortPathName32W( LPCWSTR longpath, LPWSTR shortpath, DWORD shortlen )
{
LPSTR longpatha = STRING32_DupUniToAnsi( longpath );
LPCSTR dostruename = DOSFS_GetDosTrueName( longpatha, 0 );
free( longpatha );
lstrcpynAtoW( shortpath, dostruename, shortlen );
return strlen(dostruename);
}

View File

@ -11,7 +11,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__linux__) || defined(sun)
#if defined(__linux__) || defined(sun) || defined(hpux)
#include <sys/vfs.h>
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)

View File

@ -526,13 +526,12 @@ INT32 FILE_Read( HFILE hFile, LPVOID buffer, UINT32 count )
/***********************************************************************
* GetTempFileName (KERNEL.97)
* GetTempFileName16 (KERNEL.97)
*/
INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
UINT16 GetTempFileName16( BYTE drive, LPCSTR prefix, UINT16 unique,
LPSTR buffer )
{
int i;
UINT num = unique ? (unique & 0xffff) : time(NULL) & 0xffff;
char *p;
char temppath[144];
if ((drive & TF_FORCEDRIVE) &&
!DRIVE_IsValid( toupper(drive & ~TF_FORCEDRIVE) - 'A' ))
@ -543,15 +542,28 @@ INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
}
if (drive & TF_FORCEDRIVE)
{
sprintf( buffer, "%c:", drive & ~TF_FORCEDRIVE );
}
sprintf(temppath,"%c:", drive & ~TF_FORCEDRIVE );
else
{
GetTempPath32A( 132, buffer ); /* buffer must be at least 144 */
strcat( buffer, "\\" );
GetTempPath32A( 132, temppath );
strcat( temppath, "\\" );
}
return (UINT16)GetTempFileName32A( temppath, prefix, unique, buffer );
}
/***********************************************************************
* GetTempFileName32A (KERNEL32.290)
*/
UINT32 GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
LPSTR buffer)
{
LPSTR p;
int i;
UINT32 num = unique ? (unique & 0xffff) : time(NULL) & 0xffff;
if (!path) return 0;
strcpy( buffer, path );
p = buffer + strlen(buffer);
*p++ = '~';
for (i = 3; (i > 0) && (*prefix); i--) *p++ = *prefix++;
@ -587,9 +599,30 @@ INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
/***********************************************************************
* OpenFile (KERNEL.74)
* GetTempFileName32W (KERNEL32.291)
*/
HFILE OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
UINT32 GetTempFileName32W( LPCWSTR path, LPCWSTR prefix, UINT32 unique,
LPWSTR buffer )
{
LPSTR patha,prefixa;
char buffera[144];
UINT32 ret;
if (!path) return 0;
patha = STRING32_DupUniToAnsi(path);
prefixa = STRING32_DupUniToAnsi(prefix);
ret = GetTempFileName32A( patha, prefixa, unique, buffera );
STRING32_AnsiToUni( buffer, buffera );
free(patha);
free(prefixa);
return ret;
}
/***********************************************************************
* OpenFile (KERNEL.74) (KERNEL32.396)
*/
HFILE OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode )
{
DOS_FILE *file;
HFILE hFileRet;
@ -771,7 +804,7 @@ error: /* We get here if there was an error opening the file */
/***********************************************************************
* _lclose (KERNEL.81)
* _lclose (KERNEL.81) (KERNEL32.592)
*/
HFILE _lclose( HFILE hFile )
{
@ -795,9 +828,9 @@ INT _lread( HFILE hFile, SEGPTR buffer, WORD count )
/***********************************************************************
* _lcreat (KERNEL.83)
* _lcreat (KERNEL.83) (KERNEL32.593)
*/
HFILE _lcreat( LPCSTR path, INT attr )
HFILE _lcreat( LPCSTR path, INT32 attr )
{
DOS_FILE *file;
HFILE handle;
@ -856,9 +889,9 @@ LONG _llseek( HFILE hFile, LONG lOffset, INT nOrigin )
/***********************************************************************
* _lopen (KERNEL.85)
* _lopen (KERNEL.85) (KERNEL32.595)
*/
HFILE _lopen( LPCSTR path, INT mode )
HFILE _lopen( LPCSTR path, INT32 mode )
{
DOS_FILE *file;
int unixMode;

View File

@ -79,7 +79,7 @@ callfrom16.S: $(SPEC_FILES)
$(BUILD) -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq` > callfrom16.S
callfrom32.S: $(SPEC_FILES)
$(BUILD) -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\([0-9]*\)/\1/' | sort | uniq` > callfrom32.S
$(BUILD) -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\(.*\)/\1/' | sort | uniq` > callfrom32.S
callto16.S: $(TOPSRC)/include/callback.h $(BUILD)
$(BUILD) -callto16 `cat $(TOPSRC)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > callto16.S

View File

@ -1,18 +0,0 @@
#ifndef WINELIB
/*
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
#include "callback.h"
#include "stackframe.h"
#include "stddebug.h"
#include "debug.h"
#endif /* !WINELIB */

View File

@ -60,7 +60,7 @@ base 1
056 stub _clearfp
057 stub _close
058 stub _commit
059 stub _commode_dll
059 long _commode_dll(0)
060 stub _control87
061 stub _controlfp
062 stub _copysign
@ -105,7 +105,7 @@ base 1
101 stub _finite
102 stub _flsbuf
103 stub _flushall
104 stub _fmode_dll
104 long _fmode_dll(0)
105 stub _fpclass
106 stub _fpieee_flt
107 stub _fpreset

View File

@ -65,7 +65,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
55 pascal16 CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect16
56 pascal16 CreateFont(s_word s_word s_word s_word s_word word word word
word word word word word ptr) CreateFont
57 pascal16 CreateFontIndirect(ptr) CreateFontIndirect
57 pascal16 CreateFontIndirect(ptr) CreateFontIndirect16
58 pascal16 CreateHatchBrush(word long) CreateHatchBrush
60 pascal16 CreatePatternBrush(word) CreatePatternBrush
61 pascal16 CreatePen(s_word s_word long) CreatePen

View File

@ -4,7 +4,7 @@ base 1
0000 stub AbortDoc
0001 stub AbortPath
0002 stub AddFontResourceA
0002 stdcall AddFontResourceA(ptr) AddFontResource
0003 stub AddFontResourceTracking
0004 stub AddFontResourceW
0005 stub AngleArc
@ -36,7 +36,7 @@ base 1
0031 stdcall CreateCompatibleDC(long) CreateCompatibleDC
0032 stub CreateDCA
0033 stub CreateDCW
0034 stub CreateDIBPatternBrush
0034 stdcall CreateDIBPatternBrush(long long) CreateDIBPatternBrush
0035 stub CreateDIBPatternBrushPt
0036 stub CreateDIBSection
0037 stub CreateDIBitmap
@ -46,8 +46,8 @@ base 1
0041 stub CreateEnhMetaFileA
0042 stub CreateEnhMetaFileW
0043 stub CreateFontA
0044 stub CreateFontIndirectA
0045 stub CreateFontIndirectW
0044 stdcall CreateFontIndirectA(ptr) CreateFontIndirect32A
0045 stdcall CreateFontIndirectW(ptr) CreateFontIndirect32W
0046 stub CreateFontW
0047 stub CreateHalftonePalette
0048 stub CreateHatchBrush
@ -98,7 +98,7 @@ base 1
0093 stub ExtCreatePen
0094 stub ExtCreateRegion
0095 stub ExtEscape
0096 stub ExtFloodFill
0096 stdcall ExtFloodFill(long long long long long) ExtFloodFill
0097 stub ExtSelectClipRgn
0098 stdcall ExtTextOutA(long long long long ptr ptr long ptr) ExtTextOut32A
0099 stdcall ExtTextOutW(long long long long ptr ptr long ptr) ExtTextOut32W
@ -106,7 +106,7 @@ base 1
0101 stub FillRgn
0102 stub FixBrushOrgEx
0103 stub FlattenPath
0104 stub FloodFill
0104 stdcall FloodFill(long long long long) FloodFill
0105 stub FrameRgn
0106 stub FreeImageColorMatcher
0107 stub GdiAssociateObject
@ -224,7 +224,7 @@ base 1
0219 stdcall GetRgnBox(long ptr) GetRgnBox32
0220 stdcall GetStockObject(long) GetStockObject
0221 stub GetStretchBltMode
0222 stub GetSystemPaletteEntries
0222 stdcall GetSystemPaletteEntries(long long long ptr) GetSystemPaletteEntries
0223 stub GetSystemPaletteUse
0224 stub GetTextAlign
0225 stub GetTextCharacterExtra
@ -282,7 +282,7 @@ base 1
0277 stub PolylineTo
0278 stdcall PtInRegion(long long long) PtInRegion
0279 stub PtVisible
0280 stub RealizePalette
0280 stdcall RealizePalette(long) RealizePalette32
0281 stdcall RectInRegion(long ptr) RectInRegion32
0282 stdcall RectVisible(long ptr) RectVisible32
0283 stdcall Rectangle(long long long long long) Rectangle
@ -302,13 +302,13 @@ base 1
0297 stub SelectClipRgn
0298 stub SelectFontLocal
0299 stdcall SelectObject(long long) SelectObject
0300 stub SelectPalette
0300 stdcall SelectPalette(long long long) SelectPalette32
0301 stub SetAbortProc
0302 stub SetArcDirection
0303 stdcall SetBitmapBits(long long ptr) SetBitmapBits
0304 stdcall SetBitmapDimensionEx(long long long ptr) SetBitmapDimensionEx32
0305 stdcall SetBkColor(long long) SetBkColor
0306 stub SetBkMode
0306 stdcall SetBkMode(long long) SetBkMode
0307 stub SetBoundsRect
0308 stub SetBrushOrgEx
0309 stub SetColorAdjustment

View File

@ -46,7 +46,7 @@ type win16
47 pascal16 GetModuleHandle(segptr) WIN16_GetModuleHandle
48 pascal16 GetModuleUsage(word) GetModuleUsage
49 pascal16 GetModuleFileName(word ptr s_word) GetModuleFileName
50 pascal GetProcAddress(word segptr) GetProcAddress
50 pascal GetProcAddress(word segptr) GetProcAddress16
51 pascal MakeProcInstance(segptr word) MakeProcInstance16
52 pascal16 FreeProcInstance(segptr) FreeProcInstance16
53 stub CallProcInstance
@ -88,12 +88,12 @@ type win16
89 pascal lstrcat(segptr segptr) lstrcat16
90 pascal16 lstrlen(ptr) lstrlen16
91 register InitTask() InitTask
92 pascal16 GetTempDrive(byte) GetTempDrive
92 pascal GetTempDrive(byte) WIN16_GetTempDrive
93 pascal16 GetCodeHandle(segptr) GetCodeHandle
94 stub DefineHandleTable
95 pascal16 LoadLibrary(ptr) LoadLibrary
96 pascal16 FreeLibrary(word) FreeLibrary
97 pascal16 GetTempFileName(byte ptr word ptr) GetTempFileName
97 pascal16 GetTempFileName(byte ptr word ptr) GetTempFileName16
98 stub GetLastDiskChange
99 stub GetLPErrMode
100 stub ValidateCodeSegments

View File

@ -31,8 +31,8 @@ base 1
0026 stub CommConfigDialogA
0027 stub CommConfigDialogW
0028 stub CompareFileTime
0029 stdcall CompareStringA(long long ptr long ptr long) CompareStringA
0030 stub CompareStringW
0029 stdcall CompareStringA(long long ptr long ptr long) CompareString32A
0030 stdcall CompareStringW(long long ptr long ptr long) CompareString32W
0031 stub ConnectNamedPipe
0032 stub ConsoleMenuControl
0033 stub ConsoleSubst
@ -259,7 +259,7 @@ base 1
0254 stub GetPrivateProfileSectionW
0255 stdcall GetPrivateProfileStringA(ptr ptr ptr ptr long ptr) GetPrivateProfileString
0256 stub GetPrivateProfileStringW
0257 stdcall GetProcAddress(long long) WIN32_GetProcAddress
0257 stdcall GetProcAddress(long ptr) GetProcAddress32
0258 stdcall GetProcessAffinityMask(long ptr ptr) GetProcessAffinityMask
0259 stdcall GetProcessHeap() GetProcessHeap
0260 stub GetProcessHeaps
@ -273,9 +273,9 @@ base 1
0268 stdcall GetProfileStringA(ptr ptr ptr ptr long) GetProfileString
0269 stub GetProfileStringW
0270 stub GetQueuedCompletionStatus
0271 stub GetShortPathNameA
0272 stub GetShortPathNameW
0273 stdcall GetStartupInfoA(ptr) GetStartupInfoA
0271 stdcall GetShortPathNameA(ptr ptr long) GetShortPathName32A
0272 stdcall GetShortPathNameW(ptr ptr long) GetShortPathName32W
0273 stdcall GetStartupInfoA(ptr) GetStartupInfoA
0274 stub GetStartupInfoW
0275 stdcall GetStdHandle(long) GetStdHandle
0276 stub GetStringTypeA
@ -292,8 +292,8 @@ base 1
0287 stub GetTapeParameters
0288 stub GetTapePosition
0289 stub GetTapeStatus
0290 stub GetTempFileNameA
0291 stub GetTempFileNameW
0290 stdcall GetTempFileNameA(ptr ptr long ptr) GetTempFileName32A
0291 stdcall GetTempFileNameW(ptr ptr long ptr) GetTempFileName32W
0292 stdcall GetTempPathA(long ptr) GetTempPath32A
0293 stdcall GetTempPathW(long ptr) GetTempPath32W
0294 stdcall GetThreadContext(long ptr) GetThreadContext
@ -301,11 +301,11 @@ base 1
0296 stub GetThreadPriority
0297 stub GetThreadSelectorEntry
0298 stub GetThreadTimes
0299 stdcall GetTickCount() GetTickCount
0299 stdcall GetTickCount() GetTickCount
0300 stub GetTimeFormatA
0301 stub GetTimeFormatW
0302 stdcall GetTimeZoneInformation(ptr) GetTimeZoneInformation
0303 stub GetUserDefaultLCID
0303 stdcall GetUserDefaultLCID() GetUserDefaultLCID
0304 stub GetUserDefaultLangID
0305 stub GetVDMCurrentDirectories
0306 stdcall GetVersion() GetVersion32
@ -398,8 +398,8 @@ base 1
0393 stub OpenConsoleW
0394 stub OpenEventA
0395 stub OpenEventW
0396 stub OpenFile
0397 stdcall OpenFileMappingA(long long ptr) OpenFileMapping
0396 stdcall OpenFile(ptr ptr long) OpenFile
0397 stdcall OpenFileMappingA(long long ptr) OpenFileMapping
0398 stub OpenFileMappingW
0399 stub OpenMutexA
0400 stub OpenMutexW
@ -594,10 +594,10 @@ base 1
0589 stub WriteTapemark
0590 stub _hread
0591 stub _hwrite
0592 stub _lclose
0593 stub _lcreat
0592 stdcall _lclose(long) _lclose
0593 stdcall _lcreat(ptr long) _lcreat
0594 stub _llseek
0595 stub _lopen
0595 stdcall _lopen(ptr long) _lopen
0596 stub _lread
0597 stub _lwrite
0598 stdcall lstrcat(ptr ptr) lstrcat32A

View File

@ -8,7 +8,7 @@ type win16
5 pascal GetLocaleInfoA(long long ptr word) GetLocaleInfoA
6 stub LCMAPSTRINGA
7 stub GETSTRINGTYPEA
8 pascal16 CompareStringA(long long ptr word ptr word) CompareStringA
8 pascal16 CompareStringA(long long ptr word ptr word) CompareString16
#9 WEP
10 stub LIBMAIN
11 stub NOTIFYWINDOWPROC

View File

@ -64,24 +64,19 @@ BOOL RELAY_Init(void)
* RELAY_DebugCallFrom16
*/
void RELAY_DebugCallFrom16( int func_type, char *args,
void *entry_point, int args32 )
void *entry_point, SIGCONTEXT *context )
{
STACK16FRAME *frame;
NE_MODULE *pModule;
WORD ordinal;
char *args16, *name;
char *args16;
int i;
if (!debugging_relay) return;
frame = CURRENT_STACK16;
pModule = BUILTIN_GetEntryPoint( frame->entry_cs, frame->entry_ip,
&ordinal, &name );
printf( "Call %.*s.%d: %.*s(",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
ordinal, *name, name + 1 );
printf( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
&ordinal ));
args16 = (char *)frame->args;
for (i = 0; i < strlen(args); i++)
{
@ -122,13 +117,10 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
printf( ") ret=%04x:%04x ds=%04x\n", frame->cs, frame->ip, frame->ds );
if (func_type == 2) /* register function */
{
SIGCONTEXT *context = (SIGCONTEXT *)&args32;
printf( " AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x ES=%04x EFL=%08lx\n",
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
ES_reg(context), EFL_reg(context) );
}
}
@ -138,9 +130,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
{
STACK16FRAME *frame;
NE_MODULE *pModule;
WORD ordinal;
char *name;
if (*(DWORD *)PTR_SEG_TO_LIN(IF1632_Stack32_base) != 0xDEADBEEF)
{
@ -149,14 +139,10 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
}
if (!debugging_relay) return;
frame = CURRENT_STACK16;
pModule = BUILTIN_GetEntryPoint( frame->entry_cs, frame->entry_ip,
&ordinal, &name );
printf( "Ret %.*s.%d: %.*s() ",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
ordinal, *name, name + 1 );
frame = CURRENT_STACK16;
printf( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
&ordinal ));
switch(func_type)
{
case 0: /* long */
@ -191,15 +177,10 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
void RELAY_Unimplemented16(void)
{
WORD ordinal;
char *name;
STACK16FRAME *frame = CURRENT_STACK16;
NE_MODULE *pModule = BUILTIN_GetEntryPoint( frame->entry_cs,
frame->entry_ip,
&ordinal, &name );
fprintf( stderr, "No handler for Win16 routine %.*s.%d (%.*s) called from %04x:%04x\n",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
ordinal, *name, name + 1, frame->cs, frame->ip );
fprintf(stderr,"No handler for Win16 routine %s (called from %04x:%04x)\n",
BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal),
frame->cs, frame->ip );
TASK_KillCurrentTask(1);
}
@ -211,11 +192,11 @@ void RELAY_Unimplemented16(void)
* as 'stub' in the spec file).
* (The args are the same than for RELAY_DebugCallFrom32).
*/
void RELAY_Unimplemented32( int nb_args, void *entry_point,
const char *func_name, int ebp, int ret_addr )
void RELAY_Unimplemented32( int nb_args, void *relay_addr,
void *entry_point, int ebp, int ret_addr )
{
fprintf( stderr, "No handler for Win32 routine %s called from %08x\n",
func_name, ret_addr );
fprintf( stderr, "No handler for Win32 routine %s (called from %08x)\n",
BUILTIN_GetEntryPoint32( relay_addr ), ret_addr );
TASK_KillCurrentTask(1);
}
@ -246,13 +227,13 @@ void RELAY_DebugCallTo16( int* stack, int nbargs )
/***********************************************************************
* RELAY_DebugCallFrom32
*/
void RELAY_DebugCallFrom32( int nb_args, void *entry_point,
const char *func_name, int ebp, int ret_addr,
int arg1 )
void RELAY_DebugCallFrom32( int nb_args, void *relay_addr,
void *entry_point, int ebp, int ret_addr, int arg1)
{
int *parg;
int *parg;
if (!debugging_relay) return;
printf( "Call %s(", func_name );
printf( "Call %s(", BUILTIN_GetEntryPoint32( relay_addr ));
for (parg = &arg1; nb_args; parg++, nb_args--)
{
printf( "%08x", *parg );
@ -265,12 +246,12 @@ void RELAY_DebugCallFrom32( int nb_args, void *entry_point,
/***********************************************************************
* RELAY_DebugCallFrom32Ret
*/
void RELAY_DebugCallFrom32Ret( int ret_val, void *entry_point,
const char *func_name, int ebp, int ret_addr )
void RELAY_DebugCallFrom32Ret( int ret_val, void *relay_addr,
void *entry_point, int ebp, int ret_addr )
{
if (!debugging_relay) return;
printf( "Ret %s() retval=0x%08x ret=%08x\n",
func_name, ret_val, ret_addr );
BUILTIN_GetEntryPoint32( relay_addr ), ret_val, ret_addr );
}

View File

@ -9,9 +9,9 @@ heap 65520
5 pascal16 InitApp(word) USER_InitApp
6 pascal16 PostQuitMessage(word) PostQuitMessage
7 pascal16 ExitWindows(long word) ExitWindows
10 pascal16 SetTimer(word word word segptr) SetTimer
11 pascal16 SetSystemTimer(word word word segptr) SetSystemTimer
12 pascal16 KillTimer(word word) KillTimer
10 pascal16 SetTimer(word word word segptr) SetTimer16
11 pascal16 SetSystemTimer(word word word segptr) SetSystemTimer16
12 pascal16 KillTimer(word word) KillTimer16
13 pascal GetTickCount() GetTickCount
14 pascal GetTimerResolution() GetTimerResolution
15 pascal GetCurrentTime() GetCurrentTime
@ -168,7 +168,7 @@ heap 65520
166 pascal16 HideCaret(word) HideCaret
167 pascal16 ShowCaret(word) ShowCaret
168 pascal16 SetCaretBlinkTime(word) SetCaretBlinkTime
169 pascal16 GetCaretBlinkTime() GetCaretBlinkTime
169 pascal16 GetCaretBlinkTime() GetCaretBlinkTime16
170 pascal16 ArrangeIconicWindows(word) ArrangeIconicWindows
171 pascal16 WinHelp(word ptr word long) WinHelp
172 stub SwitchToThisWindow
@ -181,7 +181,7 @@ heap 65520
179 pascal16 GetSystemMetrics(word) GetSystemMetrics
180 pascal GetSysColor(word) GetSysColor
181 pascal16 SetSysColors(word ptr ptr) SetSysColors
182 pascal16 KillSystemTimer(word word) KillSystemTimer
182 pascal16 KillSystemTimer(word word) KillSystemTimer16
183 pascal16 GetCaretPos(ptr) GetCaretPos16
184 stub QuerySendMessage
185 pascal16 GrayString(word word segptr segptr s_word s_word s_word s_word s_word) GrayString
@ -224,7 +224,7 @@ heap 65520
221 pascal16 ScrollDC(word s_word s_word ptr ptr word ptr) ScrollDC
222 pascal16 GetKeyboardState(ptr) GetKeyboardState
223 pascal16 SetKeyboardState(ptr) SetKeyboardState
224 pascal16 GetWindowTask(word) GetWindowTask
224 pascal16 GetWindowTask(word) GetWindowTask16
225 pascal16 EnumTaskWindows(word segptr long) EnumTaskWindows16
226 stub LockInput
227 pascal16 GetNextDlgGroupItem(word word word) GetNextDlgGroupItem
@ -329,8 +329,8 @@ heap 65520
359 pascal16 GetDCEx(word word long) GetDCEx
362 pascal16 DCHook(word word long long) DCHook
364 stub LookupIconIDFromDirectoryEx
368 pascal16 CopyIcon(word word) CopyIcon
369 pascal16 CopyCursor(word word) CopyCursor
368 pascal16 CopyIcon(word word) CopyIcon16
369 pascal16 CopyCursor(word word) CopyCursor16
370 pascal16 GetWindowPlacement(word ptr) GetWindowPlacement16
371 pascal16 SetWindowPlacement(word ptr) SetWindowPlacement16
372 stub GetInternalIconHeader
@ -382,10 +382,10 @@ heap 65520
430 pascal16 lstrcmp(ptr ptr) lstrcmp16
431 pascal AnsiUpper(segptr) WIN16_AnsiUpper
432 pascal AnsiLower(segptr) WIN16_AnsiLower
433 pascal16 IsCharAlpha(byte) IsCharAlpha
434 pascal16 IsCharAlphanumeric(byte) IsCharAlphanumeric
435 pascal16 IsCharUpper(byte) IsCharUpper
436 pascal16 IsCharLower(byte) IsCharLower
433 pascal16 IsCharAlpha(byte) IsCharAlpha16
434 pascal16 IsCharAlphanumeric(byte) IsCharAlphanumeric16
435 pascal16 IsCharUpper(byte) IsCharUpper16
436 pascal16 IsCharLower(byte) IsCharLower16
437 pascal16 AnsiUpperBuff(ptr word) AnsiUpperBuff
438 pascal16 AnsiLowerBuff(ptr word) AnsiLowerBuff
441 stub InsertMenuItem
@ -484,10 +484,10 @@ heap 65520
652 stub GetKeyboardLayoutList
654 stub UnloadKeyboardLayout
655 stub PostPostedMessages
656 pascal16 DrawFrameControl(word ptr word word) DrawFrameControl
656 pascal16 DrawFrameControl(word ptr word word) DrawFrameControl16
657 stub DrawCaptionTemp
658 stub DispatchInput
659 pascal16 DrawEdge(word ptr word word) DrawEdge
659 pascal16 DrawEdge(word ptr word word) DrawEdge16
660 stub DrawCaption
661 stub SetSysColorsTemp
662 stub DrawMenubarTemp

View File

@ -26,30 +26,30 @@ base 1
0021 stub ChangeClipboardChain
0022 stdcall ChangeMenuA(long long ptr long long) ChangeMenu32A
0023 stdcall ChangeMenuW(long long ptr long long) ChangeMenu32W
0024 stub CharLowerA
0025 stub CharLowerBuffA
0026 stub CharLowerBuffW
0027 stub CharLowerW
0028 stub CharNextA
0029 stub CharNextExA
0030 stub CharNextExW
0031 stub CharNextW
0032 stub CharPrevA
0033 stub CharPrevExA
0034 stub CharPrevExW
0035 stub CharPrevW
0036 stub CharToOemA
0037 stub CharToOemBuffA
0038 stub CharToOemBuffW
0039 stub CharToOemW
0040 stub CharUpperA
0041 stub CharUpperBuffA
0042 stub CharUpperBuffW
0043 stub CharUpperW
0044 stub CheckDlgButton
0024 stdcall CharLowerA(ptr) CharLower32A
0025 stdcall CharLowerBuffA(ptr long) CharLowerBuff32A
0026 stdcall CharLowerBuffW(ptr long) CharLowerBuff32W
0027 stdcall CharLowerW(ptr) CharLower32W
0028 stdcall CharNextA(ptr) CharNext32A
0029 stdcall CharNextExA(long ptr long) CharNextEx32A
0030 stdcall CharNextExW(long ptr long) CharNextEx32W
0031 stdcall CharNextW(ptr) CharNext32W
0032 stdcall CharPrevA(ptr ptr) CharPrev32A
0033 stdcall CharPrevExA(long ptr ptr long) CharPrevEx32A
0034 stdcall CharPrevExW(long ptr ptr long) CharPrevEx32W
0035 stdcall CharPrevW(ptr ptr) CharPrev32W
0036 stdcall CharToOemA(ptr ptr) CharToOem32A
0037 stdcall CharToOemBuffA(ptr ptr long) CharToOemBuff32A
0038 stdcall CharToOemBuffW(ptr ptr long) CharToOemBuff32W
0039 stdcall CharToOemW(ptr ptr) CharToOem32W
0040 stdcall CharUpperA(ptr) CharUpper32A
0041 stdcall CharUpperBuffA(ptr long) CharUpperBuff32A
0042 stdcall CharUpperBuffW(ptr long) CharUpperBuff32W
0043 stdcall CharUpperW(ptr) CharUpper32W
0044 stdcall CheckDlgButton(long long long) CheckDlgButton
0045 stdcall CheckMenuItem(long long long) CheckMenuItem
0046 stub CheckMenuRadioItem
0047 stub CheckRadioButton
0047 stdcall CheckRadioButton(long long long long) CheckRadioButton
0048 stdcall ChildWindowFromPoint(long long long) ChildWindowFromPoint32
0049 stub ChildWindowFromPointEx
0050 stub ClientThreadConnect
@ -61,13 +61,13 @@ base 1
0056 stub CloseWindowStation
0057 stub CopyAcceleratorTableA
0058 stub CopyAcceleratorTableW
0059 stub CopyIcon
0059 stdcall CopyIcon(long) CopyIcon32
0060 stub CopyImage
0061 stdcall CopyRect(ptr ptr) CopyRect32
0062 stub CountClipboardFormats
0063 stub CreateAcceleratorTableA
0064 stub CreateAcceleratorTableW
0065 stub CreateCaret
0065 stdcall CreateCaret(long long long long) CreateCaret
0066 stub CreateCursor
0067 stub CreateDesktopA
0068 stub CreateDesktopW
@ -134,7 +134,7 @@ base 1
0127 stub DeferWindowPos
0128 stub DeleteMenu
0129 stub DestroyAcceleratorTable
0130 stub DestroyCaret
0130 stdcall DestroyCaret() DestroyCaret
0131 stub DestroyCursor
0132 stub DestroyIcon
0133 stub DestroyMenu
@ -158,10 +158,10 @@ base 1
0151 stub DragObject
0152 stub DrawAnimatedRects
0153 stub DrawCaption
0154 stub DrawEdge
0154 stdcall DrawEdge(long ptr long long) DrawEdge32
0155 stdcall DrawFocusRect(long ptr) DrawFocusRect32
0156 stub DrawFrame
0157 stub DrawFrameControl
0157 stdcall DrawFrameControl(long ptr long long) DrawFrameControl32
0158 stub DrawIcon
0159 stub DrawIconEx
0160 stdcall DrawMenuBar(long) DrawMenuBar
@ -212,7 +212,7 @@ base 1
0205 stdcall GetAppCompatFlags(long) GetAppCompatFlags
0206 stub GetAsyncKeyState
0207 stub GetCapture
0208 stub GetCaretBlinkTime
0208 stdcall GetCaretBlinkTime() GetCaretBlinkTime32
0209 stdcall GetCaretPos(ptr) GetCaretPos32
0210 stdcall GetClassInfoA(long ptr ptr) GetClassInfo32A
0211 stdcall GetClassInfoExA(long ptr ptr) GetClassInfoEx32A
@ -237,7 +237,7 @@ base 1
0230 stub GetDCEx
0231 stdcall GetDesktopWindow() GetDesktopWindow
0232 stub GetDialogBaseUnits
0233 stub GetDlgCtrlID
0233 stdcall GetDlgCtrlID(long) GetDlgCtrlID
0234 stdcall GetDlgItem(long long) GetDlgItem
0235 stdcall GetDlgItemInt(long long long long) GetDlgItemInt
0236 stdcall GetDlgItemTextA(long long ptr long) GetDlgItemText32A
@ -320,7 +320,7 @@ base 1
0313 stdcall GetWindowWord(long long) GetWindowWord
0314 stub GrayStringA
0315 stub GrayStringW
0316 stub HideCaret
0316 stdcall HideCaret(long) HideCaret
0317 stub HiliteMenuItem
0318 stub ImpersonateDdeClientWindow
0319 stub InSendMessage
@ -334,14 +334,14 @@ base 1
0327 stdcall InvalidateRect(long ptr long) InvalidateRect32
0328 stdcall InvalidateRgn(long long long) InvalidateRgn
0329 stdcall InvertRect(long ptr) InvertRect32
0330 stub IsCharAlphaA
0331 stub IsCharAlphaNumericA
0332 stub IsCharAlphaNumericW
0333 stub IsCharAlphaW
0334 stub IsCharLowerA
0335 stub IsCharLowerW
0336 stub IsCharUpperA
0337 stub IsCharUpperW
0330 stdcall IsCharAlphaA(long) IsCharAlpha32A
0331 stdcall IsCharAlphaNumericA(long) IsCharAlphaNumeric32A
0332 stdcall IsCharAlphaNumericW(long) IsCharAlphaNumeric32W
0333 stdcall IsCharAlphaW(long) IsCharAlpha32W
0334 stdcall IsCharLowerA(long) IsCharLower32A
0335 stdcall IsCharLowerW(long) IsCharLower32W
0336 stdcall IsCharUpperA(long) IsCharUpper32A
0337 stdcall IsCharUpperW(long) IsCharUpper32W
0338 stub IsChild
0339 stub IsClipboardFormatAvailable
0340 stub IsDialogMessage
@ -351,13 +351,13 @@ base 1
0344 stdcall IsIconic(long) IsIconic
0345 stub IsMenu
0346 stdcall IsRectEmpty(ptr) IsRectEmpty32
0347 stub IsWindow
0347 stdcall IsWindow(long) IsWindow
0348 stdcall IsWindowEnabled(long) IsWindowEnabled
0349 stdcall IsWindowUnicode(long) IsWindowUnicode
0350 stdcall IsWindowVisible(long) IsWindowVisible
0351 stub IsZoomed
0352 stub KillSystemTimer
0353 stdcall KillTimer(long long) KillTimer
0352 stdcall KillSystemTimer(long long) KillSystemTimer32
0353 stdcall KillTimer(long long) KillTimer32
0354 stdcall LoadAcceleratorsA(long ptr) WIN32_LoadAcceleratorsA
0355 stdcall LoadAcceleratorsW(long ptr) WIN32_LoadAcceleratorsW
0356 stdcall LoadBitmapA(long ptr) WIN32_LoadBitmapA
@ -405,10 +405,10 @@ base 1
0398 stdcall MoveWindow(long long long long long long) MoveWindow
0399 stub MsgWaitForMultipleObjects
0400 stub OemKeyScan
0401 stub OemToCharA
0402 stub OemToCharBuffA
0403 stub OemToCharBuffW
0404 stub OemToCharW
0401 stdcall OemToCharA(ptr ptr) OemToChar32A
0402 stdcall OemToCharBuffA(ptr ptr long) OemToCharBuff32A
0403 stdcall OemToCharBuffW(ptr ptr long) OemToCharBuff32W
0404 stdcall OemToCharW(ptr ptr) OemToChar32W
0405 stdcall OffsetRect(ptr long long) OffsetRect32
0406 stub OpenClipboard
0407 stub OpenDesktopA
@ -468,8 +468,8 @@ base 1
0461 stub ServerSetFunctionPointers
0462 stub SetActiveWindow
0463 stdcall SetCapture(long) SetCapture
0464 stub SetCaretBlinkTime
0465 stub SetCaretPos
0464 stdcall SetCaretBlinkTime(long) SetCaretBlinkTime
0465 stdcall SetCaretPos(long long) SetCaretPos
0466 stdcall SetClassLongA(long long long) SetClassLong32A
0467 stdcall SetClassLongW(long long long) SetClassLong32W
0468 stdcall SetClassWord(long long long) SetClassWord
@ -484,7 +484,7 @@ base 1
0477 stdcall SetDlgItemTextA(long long ptr) SetDlgItemText32A
0478 stdcall SetDlgItemTextW(long long ptr) SetDlgItemText32W
0479 stub SetDoubleClickTime
0480 stub SetFocus
0480 stdcall SetFocus(long) SetFocus
0481 stub SetForegroundWindow
0482 stdcall SetInternalWindowPos(long long ptr ptr) SetInternalWindowPos32
0483 stub SetKeyboardState
@ -512,9 +512,9 @@ base 1
0505 stub SetSysColorsTemp
0506 stub SetSystemCursor
0507 stub SetSystemMenu
0508 stub SetSystemTimer
0508 stdcall SetSystemTimer(long long long ptr) SetSystemTimer32
0509 stub SetThreadDesktop
0510 stdcall SetTimer(long long long long) USER32_SetTimer
0510 stdcall SetTimer(long long long ptr) SetTimer32
0511 stub SetUserObjectInformationA
0512 stub SetUserObjectInformationW
0513 stub SetUserObjectSecurity
@ -532,7 +532,7 @@ base 1
0525 stdcall SetWindowsHookExA(long long long long) SetWindowsHookEx32A
0526 stub SetWindowsHookExW
0527 stub SetWindowsHookW
0528 stub ShowCaret
0528 stdcall ShowCaret(long) ShowCaret
0529 stdcall ShowCursor(long) ShowCursor
0530 stub ShowOwnedPopups
0531 stub ShowScrollBar

View File

@ -20,9 +20,7 @@ type win16
20 pascal PrintDlgProc(word word word long) PrintDlgProc
21 pascal AboutDlgProc(word word word long) AboutDlgProc
22 pascal ComboLBoxWndProc(word word word long) ComboLBoxWndProc
23 pascal16 CARET_Callback(word word word long) CARET_Callback
24 pascal16 TASK_Reschedule() TASK_Reschedule
25 pascal MMSysTimeCallback(word word word long) MMSysTimeCallback
26 register Win32CallToStart() PE_Win32CallToStart
27 pascal EntryAddrProc(word word) MODULE_GetEntryPoint
28 pascal MyAlloc(word word word) MODULE_AllocateSegment

View File

@ -9,9 +9,7 @@
#include "gdi.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* GDI logical brush object */
typedef struct
@ -20,9 +18,7 @@ typedef struct
LOGBRUSH16 logbrush WINE_PACKED;
} BRUSHOBJ;
#ifndef WINELIB
#pragma pack(4)
#endif
extern BOOL BRUSH_Init(void);
extern int BRUSH_GetObject( BRUSHOBJ * brush, int count, LPSTR buffer );

View File

@ -1,5 +1,5 @@
/*
* 16-bit mode callback functions
* Callback functions
*
* Copyright 1995 Alexandre Julliard
*/
@ -77,16 +77,16 @@ extern WORD CallTo16_regs_( FARPROC16 func, WORD ds, WORD es, WORD bp, WORD ax,
#define CallWindowsExitProc( func, nExitType ) \
CallTo16_word_w( func, CURRENT_DS, nExitType )
#define CallWndProc16( func, ds, hwnd, msg, wParam, lParam ) \
CallTo16_long_wwwl( func, ds, hwnd, msg, wParam, lParam )
CallTo16_long_wwwl( (FARPROC16)(func), ds, hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
CallTo16_word_lwww( func, CURRENT_DS, lpch, ichCurrent, cch, code )
#define CallWndProcNCCREATE16( func, ds, exStyle, clsName, winName, style, \
x, y, cx, cy, hparent, hmenu, instance, \
params, hwnd, msg, wParam, lParam ) \
CallTo16_long_lllllllwlwwwl( func, ds, exStyle, clsName, winName, style, \
MAKELONG(y,x), MAKELONG(cy,cx), \
MAKELONG(hmenu,hparent), instance, params, \
hwnd, msg, wParam, lParam )
CallTo16_long_lllllllwlwwwl( (FARPROC16)(func), ds, exStyle, clsName, \
winName, style, MAKELONG(y,x), MAKELONG(cy,cx), \
MAKELONG(hmenu,hparent), instance, params, \
hwnd, msg, wParam, lParam )
/* List of the 32-bit callback functions. This list is used */
/* by the build program to generate the file if1632/callto32.S */

View File

@ -11,10 +11,6 @@ extern "C" {
#include "wintypes.h" /* needed for CHOOSEFONT structure */
#ifndef WINELIB
#pragma pack(1)
#endif
#define RT_CURSOR MAKEINTRESOURCE(1)
#define RT_BITMAP MAKEINTRESOURCE(2)
#define RT_ICON MAKEINTRESOURCE(3)
@ -29,10 +25,6 @@ extern "C" {
#define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
#define RT_GROUP_ICON MAKEINTRESOURCE(14)
#ifndef HGLOBAL
#define HGLOBAL HANDLE
#endif
#define OFN_READONLY 0x00000001
#define OFN_OVERWRITEPROMPT 0x00000002
#define OFN_HIDEREADONLY 0x00000004
@ -55,7 +47,6 @@ extern "C" {
#define OFN_SHARENOWARN 1
#define OFN_SHAREWARN 0
typedef struct {
DWORD lStructSize;
HWND hwndOwner;
@ -75,8 +66,7 @@ typedef struct {
UINT nFileExtension;
SEGPTR lpstrDefExt;
LPARAM lCustData;
/* UINT (CALLBACK *lpfnHook)(HWND, UINT, WPARAM, LPARAM);*/
FARPROC lpfnHook;
WNDPROC16 lpfnHook;
SEGPTR lpTemplateName;
} OPENFILENAME;
typedef OPENFILENAME * LPOPENFILENAME;
@ -90,7 +80,7 @@ typedef struct {
COLORREF *lpCustColors;
DWORD Flags;
LPARAM lCustData;
UINT (*lpfnHook)(HWND, UINT, WPARAM, LPARAM);
WNDPROC16 lpfnHook;
SEGPTR lpTemplateName;
} CHOOSECOLOR;
typedef CHOOSECOLOR *LPCHOOSECOLOR;
@ -114,8 +104,7 @@ typedef struct {
UINT wFindWhatLen; /* size of find buffer */
UINT wReplaceWithLen; /* size of replace buffer */
LPARAM lCustData; /* data passed to hook fn. */
/* UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM); */
FARPROC lpfnHook;
WNDPROC16 lpfnHook;
SEGPTR lpTemplateName; /* custom template name */
} FINDREPLACE;
typedef FINDREPLACE *LPFINDREPLACE;
@ -139,6 +128,8 @@ typedef FINDREPLACE *LPFINDREPLACE;
#define FR_HIDEWHOLEWORD 0x00010000
#pragma pack(1)
typedef struct {
DWORD lStructSize;
HWND hwndOwner; /* caller's window handle */
@ -148,8 +139,7 @@ typedef struct {
DWORD Flags WINE_PACKED; /* enum. type flags */
COLORREF rgbColors; /* returned text color */
LPARAM lCustData; /* data passed to hook fn. */
/* UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);*/
FARPROC lpfnHook;
WNDPROC16 lpfnHook;
SEGPTR lpTemplateName; /* custom template name */
HINSTANCE hInstance; /* instance handle of.EXE that */
/* contains cust. dlg. template */
@ -164,6 +154,7 @@ typedef struct {
} CHOOSEFONT;
typedef CHOOSEFONT *LPCHOOSEFONT;
#pragma pack(4)
#define CF_SCREENFONTS 0x00000001
#define CF_PRINTERFONTS 0x00000002
@ -226,10 +217,8 @@ typedef struct {
UINT nCopies;
HINSTANCE hInstance;
LPARAM lCustData;
/* UINT (CALLBACK* lpfnPrintHook)(HWND, UINT, WPARAM, LPARAM);
UINT (CALLBACK* lpfnSetupHook)(HWND, UINT, WPARAM, LPARAM);*/
FARPROC lpfnPrintHook;
FARPROC lpfnSetupHook;
WNDPROC16 lpfnPrintHook;
WNDPROC16 lpfnSetupHook;
SEGPTR lpPrintTemplateName;
SEGPTR lpSetupTemplateName;
HGLOBAL hPrintTemplate;
@ -237,7 +226,6 @@ typedef struct {
} PRINTDLG;
typedef PRINTDLG * LPPRINTDLG;
#define PD_ALLPAGES 0x00000000
#define PD_SELECTION 0x00000001
#define PD_PAGENUMS 0x00000002
@ -306,10 +294,6 @@ LRESULT PrintDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT PrintSetupDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
LRESULT FormatCharDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
#ifndef WINELIB
#pragma pack(4)
#endif
#ifdef __cplusplus
}
#endif

View File

@ -10,10 +10,6 @@
#include <X11/Xlib.h>
#include "windows.h"
#ifndef WINELIB
#pragma pack(1)
#endif
typedef struct
{
BYTE bWidth;
@ -42,6 +38,8 @@ typedef union
CURSORDIRENTRY cursor;
} CURSORICONDIRENTRY;
#pragma pack(1)
typedef struct
{
WORD idReserved;
@ -50,9 +48,7 @@ typedef struct
CURSORICONDIRENTRY idEntries[1] WINE_PACKED;
} CURSORICONDIR;
#ifndef WINELIB
#pragma pack(4)
#endif
extern Cursor CURSORICON_XCursor; /* Current X cursor */

View File

@ -36,7 +36,6 @@
#undef DEBUG_DOSFS
#undef DEBUG_DRIVER
#undef DEBUG_EDIT
#undef DEBUG_ENUM
#undef DEBUG_ENV
#undef DEBUG_EVENT
#undef DEBUG_EXEC
@ -114,7 +113,6 @@
#define DEBUG_DOSFS
#define DEBUG_DRIVER
#define DEBUG_EDIT
#define DEBUG_ENUM
#define DEBUG_ENV
#define DEBUG_EVENT
#define DEBUG_EXEC
@ -274,11 +272,6 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_ENUM
1,
#else
0,
#endif
#ifdef DEBUG_ENV
1,
#else
@ -817,21 +810,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_enum if(!debug_msg_enabled[20]) ; else fprintf
#define debugging_enum debug_msg_enabled[20]
#else
#ifdef DEBUG_ENUM
#define dprintf_enum fprintf
#define debugging_enum 1
#else
#define dprintf_enum while(0) fprintf
#define debugging_enum 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_env if(!debug_msg_enabled[21]) ; else fprintf
#define debugging_env debug_msg_enabled[21]
#define dprintf_env if(!debug_msg_enabled[20]) ; else fprintf
#define debugging_env debug_msg_enabled[20]
#else
#ifdef DEBUG_ENV
#define dprintf_env fprintf
@ -843,8 +823,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_event if(!debug_msg_enabled[22]) ; else fprintf
#define debugging_event debug_msg_enabled[22]
#define dprintf_event if(!debug_msg_enabled[21]) ; else fprintf
#define debugging_event debug_msg_enabled[21]
#else
#ifdef DEBUG_EVENT
#define dprintf_event fprintf
@ -856,8 +836,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_exec if(!debug_msg_enabled[23]) ; else fprintf
#define debugging_exec debug_msg_enabled[23]
#define dprintf_exec if(!debug_msg_enabled[22]) ; else fprintf
#define debugging_exec debug_msg_enabled[22]
#else
#ifdef DEBUG_EXEC
#define dprintf_exec fprintf
@ -869,8 +849,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_file if(!debug_msg_enabled[24]) ; else fprintf
#define debugging_file debug_msg_enabled[24]
#define dprintf_file if(!debug_msg_enabled[23]) ; else fprintf
#define debugging_file debug_msg_enabled[23]
#else
#ifdef DEBUG_FILE
#define dprintf_file fprintf
@ -882,8 +862,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_fixup if(!debug_msg_enabled[25]) ; else fprintf
#define debugging_fixup debug_msg_enabled[25]
#define dprintf_fixup if(!debug_msg_enabled[24]) ; else fprintf
#define debugging_fixup debug_msg_enabled[24]
#else
#ifdef DEBUG_FIXUP
#define dprintf_fixup fprintf
@ -895,8 +875,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_font if(!debug_msg_enabled[26]) ; else fprintf
#define debugging_font debug_msg_enabled[26]
#define dprintf_font if(!debug_msg_enabled[25]) ; else fprintf
#define debugging_font debug_msg_enabled[25]
#else
#ifdef DEBUG_FONT
#define dprintf_font fprintf
@ -908,8 +888,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_gdi if(!debug_msg_enabled[27]) ; else fprintf
#define debugging_gdi debug_msg_enabled[27]
#define dprintf_gdi if(!debug_msg_enabled[26]) ; else fprintf
#define debugging_gdi debug_msg_enabled[26]
#else
#ifdef DEBUG_GDI
#define dprintf_gdi fprintf
@ -921,8 +901,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_global if(!debug_msg_enabled[28]) ; else fprintf
#define debugging_global debug_msg_enabled[28]
#define dprintf_global if(!debug_msg_enabled[27]) ; else fprintf
#define debugging_global debug_msg_enabled[27]
#else
#ifdef DEBUG_GLOBAL
#define dprintf_global fprintf
@ -934,8 +914,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_graphics if(!debug_msg_enabled[29]) ; else fprintf
#define debugging_graphics debug_msg_enabled[29]
#define dprintf_graphics if(!debug_msg_enabled[28]) ; else fprintf
#define debugging_graphics debug_msg_enabled[28]
#else
#ifdef DEBUG_GRAPHICS
#define dprintf_graphics fprintf
@ -947,8 +927,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_heap if(!debug_msg_enabled[30]) ; else fprintf
#define debugging_heap debug_msg_enabled[30]
#define dprintf_heap if(!debug_msg_enabled[29]) ; else fprintf
#define debugging_heap debug_msg_enabled[29]
#else
#ifdef DEBUG_HEAP
#define dprintf_heap fprintf
@ -960,8 +940,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_hook if(!debug_msg_enabled[31]) ; else fprintf
#define debugging_hook debug_msg_enabled[31]
#define dprintf_hook if(!debug_msg_enabled[30]) ; else fprintf
#define debugging_hook debug_msg_enabled[30]
#else
#ifdef DEBUG_HOOK
#define dprintf_hook fprintf
@ -973,8 +953,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_icon if(!debug_msg_enabled[32]) ; else fprintf
#define debugging_icon debug_msg_enabled[32]
#define dprintf_icon if(!debug_msg_enabled[31]) ; else fprintf
#define debugging_icon debug_msg_enabled[31]
#else
#ifdef DEBUG_ICON
#define dprintf_icon fprintf
@ -986,8 +966,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_int if(!debug_msg_enabled[33]) ; else fprintf
#define debugging_int debug_msg_enabled[33]
#define dprintf_int if(!debug_msg_enabled[32]) ; else fprintf
#define debugging_int debug_msg_enabled[32]
#else
#ifdef DEBUG_INT
#define dprintf_int fprintf
@ -999,8 +979,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_key if(!debug_msg_enabled[34]) ; else fprintf
#define debugging_key debug_msg_enabled[34]
#define dprintf_key if(!debug_msg_enabled[33]) ; else fprintf
#define debugging_key debug_msg_enabled[33]
#else
#ifdef DEBUG_KEY
#define dprintf_key fprintf
@ -1012,8 +992,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_keyboard if(!debug_msg_enabled[35]) ; else fprintf
#define debugging_keyboard debug_msg_enabled[35]
#define dprintf_keyboard if(!debug_msg_enabled[34]) ; else fprintf
#define debugging_keyboard debug_msg_enabled[34]
#else
#ifdef DEBUG_KEYBOARD
#define dprintf_keyboard fprintf
@ -1025,8 +1005,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_ldt if(!debug_msg_enabled[36]) ; else fprintf
#define debugging_ldt debug_msg_enabled[36]
#define dprintf_ldt if(!debug_msg_enabled[35]) ; else fprintf
#define debugging_ldt debug_msg_enabled[35]
#else
#ifdef DEBUG_LDT
#define dprintf_ldt fprintf
@ -1038,8 +1018,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_listbox if(!debug_msg_enabled[37]) ; else fprintf
#define debugging_listbox debug_msg_enabled[37]
#define dprintf_listbox if(!debug_msg_enabled[36]) ; else fprintf
#define debugging_listbox debug_msg_enabled[36]
#else
#ifdef DEBUG_LISTBOX
#define dprintf_listbox fprintf
@ -1051,8 +1031,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_local if(!debug_msg_enabled[38]) ; else fprintf
#define debugging_local debug_msg_enabled[38]
#define dprintf_local if(!debug_msg_enabled[37]) ; else fprintf
#define debugging_local debug_msg_enabled[37]
#else
#ifdef DEBUG_LOCAL
#define dprintf_local fprintf
@ -1064,8 +1044,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mci if(!debug_msg_enabled[39]) ; else fprintf
#define debugging_mci debug_msg_enabled[39]
#define dprintf_mci if(!debug_msg_enabled[38]) ; else fprintf
#define debugging_mci debug_msg_enabled[38]
#else
#ifdef DEBUG_MCI
#define dprintf_mci fprintf
@ -1077,8 +1057,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mcianim if(!debug_msg_enabled[40]) ; else fprintf
#define debugging_mcianim debug_msg_enabled[40]
#define dprintf_mcianim if(!debug_msg_enabled[39]) ; else fprintf
#define debugging_mcianim debug_msg_enabled[39]
#else
#ifdef DEBUG_MCIANIM
#define dprintf_mcianim fprintf
@ -1090,8 +1070,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mciwave if(!debug_msg_enabled[41]) ; else fprintf
#define debugging_mciwave debug_msg_enabled[41]
#define dprintf_mciwave if(!debug_msg_enabled[40]) ; else fprintf
#define debugging_mciwave debug_msg_enabled[40]
#else
#ifdef DEBUG_MCIWAVE
#define dprintf_mciwave fprintf
@ -1103,8 +1083,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mdi if(!debug_msg_enabled[42]) ; else fprintf
#define debugging_mdi debug_msg_enabled[42]
#define dprintf_mdi if(!debug_msg_enabled[41]) ; else fprintf
#define debugging_mdi debug_msg_enabled[41]
#else
#ifdef DEBUG_MDI
#define dprintf_mdi fprintf
@ -1116,8 +1096,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_menu if(!debug_msg_enabled[43]) ; else fprintf
#define debugging_menu debug_msg_enabled[43]
#define dprintf_menu if(!debug_msg_enabled[42]) ; else fprintf
#define debugging_menu debug_msg_enabled[42]
#else
#ifdef DEBUG_MENU
#define dprintf_menu fprintf
@ -1129,8 +1109,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_message if(!debug_msg_enabled[44]) ; else fprintf
#define debugging_message debug_msg_enabled[44]
#define dprintf_message if(!debug_msg_enabled[43]) ; else fprintf
#define debugging_message debug_msg_enabled[43]
#else
#ifdef DEBUG_MESSAGE
#define dprintf_message fprintf
@ -1142,8 +1122,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_metafile if(!debug_msg_enabled[45]) ; else fprintf
#define debugging_metafile debug_msg_enabled[45]
#define dprintf_metafile if(!debug_msg_enabled[44]) ; else fprintf
#define debugging_metafile debug_msg_enabled[44]
#else
#ifdef DEBUG_METAFILE
#define dprintf_metafile fprintf
@ -1155,8 +1135,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_midi if(!debug_msg_enabled[46]) ; else fprintf
#define debugging_midi debug_msg_enabled[46]
#define dprintf_midi if(!debug_msg_enabled[45]) ; else fprintf
#define debugging_midi debug_msg_enabled[45]
#else
#ifdef DEBUG_MIDI
#define dprintf_midi fprintf
@ -1168,8 +1148,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mmio if(!debug_msg_enabled[47]) ; else fprintf
#define debugging_mmio debug_msg_enabled[47]
#define dprintf_mmio if(!debug_msg_enabled[46]) ; else fprintf
#define debugging_mmio debug_msg_enabled[46]
#else
#ifdef DEBUG_MMIO
#define dprintf_mmio fprintf
@ -1181,8 +1161,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mmsys if(!debug_msg_enabled[48]) ; else fprintf
#define debugging_mmsys debug_msg_enabled[48]
#define dprintf_mmsys if(!debug_msg_enabled[47]) ; else fprintf
#define debugging_mmsys debug_msg_enabled[47]
#else
#ifdef DEBUG_MMSYS
#define dprintf_mmsys fprintf
@ -1194,8 +1174,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_mmtime if(!debug_msg_enabled[49]) ; else fprintf
#define debugging_mmtime debug_msg_enabled[49]
#define dprintf_mmtime if(!debug_msg_enabled[48]) ; else fprintf
#define debugging_mmtime debug_msg_enabled[48]
#else
#ifdef DEBUG_MMTIME
#define dprintf_mmtime fprintf
@ -1207,8 +1187,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_module if(!debug_msg_enabled[50]) ; else fprintf
#define debugging_module debug_msg_enabled[50]
#define dprintf_module if(!debug_msg_enabled[49]) ; else fprintf
#define debugging_module debug_msg_enabled[49]
#else
#ifdef DEBUG_MODULE
#define dprintf_module fprintf
@ -1220,8 +1200,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_msg if(!debug_msg_enabled[51]) ; else fprintf
#define debugging_msg debug_msg_enabled[51]
#define dprintf_msg if(!debug_msg_enabled[50]) ; else fprintf
#define debugging_msg debug_msg_enabled[50]
#else
#ifdef DEBUG_MSG
#define dprintf_msg fprintf
@ -1233,8 +1213,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_nonclient if(!debug_msg_enabled[52]) ; else fprintf
#define debugging_nonclient debug_msg_enabled[52]
#define dprintf_nonclient if(!debug_msg_enabled[51]) ; else fprintf
#define debugging_nonclient debug_msg_enabled[51]
#else
#ifdef DEBUG_NONCLIENT
#define dprintf_nonclient fprintf
@ -1246,8 +1226,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_ole if(!debug_msg_enabled[53]) ; else fprintf
#define debugging_ole debug_msg_enabled[53]
#define dprintf_ole if(!debug_msg_enabled[52]) ; else fprintf
#define debugging_ole debug_msg_enabled[52]
#else
#ifdef DEBUG_OLE
#define dprintf_ole fprintf
@ -1259,8 +1239,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_palette if(!debug_msg_enabled[54]) ; else fprintf
#define debugging_palette debug_msg_enabled[54]
#define dprintf_palette if(!debug_msg_enabled[53]) ; else fprintf
#define debugging_palette debug_msg_enabled[53]
#else
#ifdef DEBUG_PALETTE
#define dprintf_palette fprintf
@ -1272,8 +1252,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_profile if(!debug_msg_enabled[55]) ; else fprintf
#define debugging_profile debug_msg_enabled[55]
#define dprintf_profile if(!debug_msg_enabled[54]) ; else fprintf
#define debugging_profile debug_msg_enabled[54]
#else
#ifdef DEBUG_PROFILE
#define dprintf_profile fprintf
@ -1285,8 +1265,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_prop if(!debug_msg_enabled[56]) ; else fprintf
#define debugging_prop debug_msg_enabled[56]
#define dprintf_prop if(!debug_msg_enabled[55]) ; else fprintf
#define debugging_prop debug_msg_enabled[55]
#else
#ifdef DEBUG_PROP
#define dprintf_prop fprintf
@ -1298,8 +1278,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_reg if(!debug_msg_enabled[57]) ; else fprintf
#define debugging_reg debug_msg_enabled[57]
#define dprintf_reg if(!debug_msg_enabled[56]) ; else fprintf
#define debugging_reg debug_msg_enabled[56]
#else
#ifdef DEBUG_REG
#define dprintf_reg fprintf
@ -1311,8 +1291,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_region if(!debug_msg_enabled[58]) ; else fprintf
#define debugging_region debug_msg_enabled[58]
#define dprintf_region if(!debug_msg_enabled[57]) ; else fprintf
#define debugging_region debug_msg_enabled[57]
#else
#ifdef DEBUG_REGION
#define dprintf_region fprintf
@ -1324,8 +1304,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_relay if(!debug_msg_enabled[59]) ; else fprintf
#define debugging_relay debug_msg_enabled[59]
#define dprintf_relay if(!debug_msg_enabled[58]) ; else fprintf
#define debugging_relay debug_msg_enabled[58]
#else
#ifdef DEBUG_RELAY
#define dprintf_relay fprintf
@ -1337,8 +1317,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_resource if(!debug_msg_enabled[60]) ; else fprintf
#define debugging_resource debug_msg_enabled[60]
#define dprintf_resource if(!debug_msg_enabled[59]) ; else fprintf
#define debugging_resource debug_msg_enabled[59]
#else
#ifdef DEBUG_RESOURCE
#define dprintf_resource fprintf
@ -1350,8 +1330,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_scroll if(!debug_msg_enabled[61]) ; else fprintf
#define debugging_scroll debug_msg_enabled[61]
#define dprintf_scroll if(!debug_msg_enabled[60]) ; else fprintf
#define debugging_scroll debug_msg_enabled[60]
#else
#ifdef DEBUG_SCROLL
#define dprintf_scroll fprintf
@ -1363,8 +1343,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_selector if(!debug_msg_enabled[62]) ; else fprintf
#define debugging_selector debug_msg_enabled[62]
#define dprintf_selector if(!debug_msg_enabled[61]) ; else fprintf
#define debugging_selector debug_msg_enabled[61]
#else
#ifdef DEBUG_SELECTOR
#define dprintf_selector fprintf
@ -1376,8 +1356,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_sem if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_sem debug_msg_enabled[63]
#define dprintf_sem if(!debug_msg_enabled[62]) ; else fprintf
#define debugging_sem debug_msg_enabled[62]
#else
#ifdef DEBUG_SEM
#define dprintf_sem fprintf
@ -1389,8 +1369,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_shm if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_shm debug_msg_enabled[64]
#define dprintf_shm if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_shm debug_msg_enabled[63]
#else
#ifdef DEBUG_SHM
#define dprintf_shm fprintf
@ -1402,8 +1382,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_stress if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_stress debug_msg_enabled[65]
#define dprintf_stress if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_stress debug_msg_enabled[64]
#else
#ifdef DEBUG_STRESS
#define dprintf_stress fprintf
@ -1415,8 +1395,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_syscolor if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_syscolor debug_msg_enabled[66]
#define dprintf_syscolor if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_syscolor debug_msg_enabled[65]
#else
#ifdef DEBUG_SYSCOLOR
#define dprintf_syscolor fprintf
@ -1428,8 +1408,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_task if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_task debug_msg_enabled[67]
#define dprintf_task if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_task debug_msg_enabled[66]
#else
#ifdef DEBUG_TASK
#define dprintf_task fprintf
@ -1441,8 +1421,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_text if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_text debug_msg_enabled[68]
#define dprintf_text if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_text debug_msg_enabled[67]
#else
#ifdef DEBUG_TEXT
#define dprintf_text fprintf
@ -1454,8 +1434,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_timer if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_timer debug_msg_enabled[69]
#define dprintf_timer if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_timer debug_msg_enabled[68]
#else
#ifdef DEBUG_TIMER
#define dprintf_timer fprintf
@ -1467,8 +1447,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_toolhelp if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[70]
#define dprintf_toolhelp if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[69]
#else
#ifdef DEBUG_TOOLHELP
#define dprintf_toolhelp fprintf
@ -1480,8 +1460,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_vxd if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_vxd debug_msg_enabled[71]
#define dprintf_vxd if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_vxd debug_msg_enabled[70]
#else
#ifdef DEBUG_VXD
#define dprintf_vxd fprintf
@ -1493,8 +1473,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_win debug_msg_enabled[72]
#define dprintf_win if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_win debug_msg_enabled[71]
#else
#ifdef DEBUG_WIN
#define dprintf_win fprintf
@ -1506,8 +1486,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win32 if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_win32 debug_msg_enabled[73]
#define dprintf_win32 if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_win32 debug_msg_enabled[72]
#else
#ifdef DEBUG_WIN32
#define dprintf_win32 fprintf
@ -1519,8 +1499,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_winsock if(!debug_msg_enabled[74]) ; else fprintf
#define debugging_winsock debug_msg_enabled[74]
#define dprintf_winsock if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_winsock debug_msg_enabled[73]
#else
#ifdef DEBUG_WINSOCK
#define dprintf_winsock fprintf
@ -1555,7 +1535,6 @@ static char *debug_msg_name[] = {
"dosfs",
"driver",
"edit",
"enum",
"env",
"event",
"exec",

View File

@ -4,12 +4,11 @@
* Copyright 1995 Alexandre Julliard
*/
#ifndef DEBUGGER_H
#define DEBUGGER_H
#ifndef __WINE_DEBUGGER_H
#define __WINE_DEBUGGER_H
#include "ldt.h"
#include "registers.h"
#include "wine.h"
#define STEP_FLAG 0x100 /* single step flag */
@ -50,7 +49,7 @@ enum debug_regs
REG_EDI, REG_EBP, REG_EFL, REG_EIP, REG_ESP,
REG_AX, REG_BX, REG_CX, REG_DX, REG_SI,
REG_DI, REG_BP, REG_FL, REG_IP, REG_SP,
REG_CS, REG_DS, REG_ES, REG_SS
REG_CS, REG_DS, REG_ES, REG_SS, REG_FS, REG_GS
};
@ -104,6 +103,7 @@ extern void DEBUG_ExamineMemory( const DBG_ADDR *addr, int count, char format);
extern void DEBUG_SetRegister( enum debug_regs reg, int val );
extern int DEBUG_GetRegister( enum debug_regs reg );
extern void DEBUG_InfoRegisters(void);
extern BOOL32 DEBUG_ValidateRegisters(void);
/* debugger/stack.c */
extern void DEBUG_InfoStack(void);
@ -113,4 +113,4 @@ extern void DEBUG_BackTrace(void);
extern void DEBUG_EnterDebugger(void);
extern void wine_debug( int signal, SIGCONTEXT *regs );
#endif /* DEBUGGER_H */
#endif /* __WINE_DEBUGGER_H */

View File

@ -9,9 +9,7 @@
#include "gdi.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* GDI logical font object */
typedef struct
@ -20,6 +18,8 @@ typedef struct
LOGFONT16 logfont WINE_PACKED;
} FONTOBJ;
#pragma pack(4)
/* may be switched... */
#define GGO_BITMAP 0x4F4D
#define GGO_NATIVE 0x4F50
@ -39,9 +39,6 @@ typedef struct
DWORD eM22;
} MAT2,*LPMAT2;
#ifndef WINELIB
#pragma pack(4)
#endif
extern BOOL FONT_Init( void );
extern int FONT_GetObject( FONTOBJ * font, int count, LPSTR buffer );

View File

@ -28,10 +28,6 @@
#define METAFILE_DC_MAGIC 0x4f51
#define MAGIC_DONTCARE 0xffff
#ifndef WINELIB
#pragma pack(1)
#endif
typedef struct tagGDIOBJHDR
{
HANDLE16 hNext;
@ -75,11 +71,6 @@ typedef struct
WORD colorRes; /* 108: color resolution */
} DeviceCaps;
#ifndef WINELIB
#pragma pack(4)
#endif
/* Device independent DC information */
typedef struct
{
@ -265,15 +256,9 @@ extern WORD GDI_HeapSel;
#define GDI_HEAP_FREE(handle) \
LOCAL_Free( GDI_HeapSel, (handle) )
#define GDI_HEAP_LIN_ADDR(handle) \
((handle) ? PTR_SEG_OFF_TO_LIN(GDI_HeapSel, (handle)) : NULL)
#ifdef WINELIB
#define GDI_HEAP_SEG_ADDR(handle) ((SEGPTR)GDI_HEAP_LIN_ADDR(handle))
#else
((handle) ? PTR_SEG_OFF_TO_LIN(GDI_HeapSel, (handle)) : NULL)
#define GDI_HEAP_SEG_ADDR(handle) \
((handle) ? MAKELONG((handle), GDI_HeapSel) : 0)
#endif /* WINELIB */
((handle) ? PTR_SEG_OFF_TO_SEGPTR(GDI_HeapSel, (handle)) : (SEGPTR)0)
extern BOOL32 GDI_Init(void);
extern HANDLE16 GDI_AllocObject( WORD, WORD );

View File

@ -11,9 +11,7 @@
#include "ldt.h"
#include "callback.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* Hook data (pointed to by a HHOOK) */
typedef struct
@ -26,9 +24,7 @@ typedef struct
WORD inHookProc; /* 0c TRUE if in this->proc */
} HOOKDATA;
#ifndef WINELIB
#pragma pack(4)
#endif
#define HOOK_MAGIC ((int)'H' | (int)'K' << 8) /* 'HK' */

View File

@ -1,4 +0,0 @@
extern int KERNEL_LockSegment(int segment);
extern int KERNEL_UnlockSegment(int segment);
extern KERNEL_InitTask(void);
extern int KERNEL_WaitEvent(int task);

View File

@ -3,26 +3,6 @@
* Copyright 1996 Marcus Meissner
*/
INT16 LZStart(void);
HFILE LZInit(HFILE);
void LZDone(void);
LONG LZSeek(HFILE,LONG,INT32);
LONG LZCopy(HFILE,HFILE);
void LZClose(HFILE);
LONG CopyLZFile(HFILE,HFILE);
INT16 GetExpandedName16(LPCSTR,LPSTR);
INT32 GetExpandedName32A(LPCSTR,LPSTR);
INT32 GetExpandedName32W(LPCWSTR,LPWSTR);
#define GetExpandedName WINELIB_NAME_AW(GetExpandedName)
HFILE LZOpenFile16(LPCSTR,LPOFSTRUCT,UINT16);
HFILE LZOpenFile32A(LPCSTR,LPOFSTRUCT,UINT32);
HFILE LZOpenFile32W(LPCWSTR,LPOFSTRUCT,UINT32);
#define LZOpenFile WINELIB_NAME_AW(LZOpenFile)
INT16 LZRead16(HFILE,SEGPTR,UINT16);
INT32 LZRead32(HFILE,LPVOID,UINT32);
#define LZRead WINELIB_NAME(LZRead)
#define LZERROR_BADINHANDLE 0xFFFF /* -1 */
#define LZERROR_BADOUTHANDLE 0xFFFE /* -2 */
#define LZERROR_READ 0xFFFD /* -3 */

View File

@ -17,13 +17,13 @@ extern BOOL MSG_InternalGetMessage( SEGPTR msg, HWND hwnd, HWND hwndOwner,
short code, WORD flags, BOOL sendIdle );
/* timer.c */
extern void TIMER_RemoveWindowTimers( HWND hwnd );
extern void TIMER_RemoveQueueTimers( HQUEUE hqueue );
extern void TIMER_SwitchQueue( HQUEUE hOldQueue, HQUEUE hNewQueue );
extern void TIMER_RemoveWindowTimers( HWND32 hwnd );
extern void TIMER_RemoveQueueTimers( HQUEUE16 hqueue );
extern void TIMER_SwitchQueue( HQUEUE16 hOldQueue, HQUEUE16 hNewQueue );
extern LONG TIMER_GetNextExpiration(void);
extern void TIMER_ExpireTimers(void);
extern BOOL TIMER_GetTimerMsg( MSG16 *msg, HWND hwnd,
HQUEUE hQueue, BOOL remove );
extern BOOL32 TIMER_GetTimerMsg( MSG16 *msg, HWND32 hwnd,
HQUEUE16 hQueue, BOOL32 remove );
/* event.c */
extern BOOL EVENT_WaitXEvent( BOOL sleep );

View File

@ -7,28 +7,29 @@
#ifndef __WINE_MISCEMU_H
#define __WINE_MISCEMU_H
#include <stdio.h>
#include "wintypes.h"
#include "registers.h"
/* miscemu/dosmem.c */
extern BOOL DOSMEM_Init(void);
extern BOOL32 DOSMEM_Init(void);
extern void DOSMEM_Tick(void);
extern void DOSMEM_FillBiosSegment(void);
extern HANDLE DOSMEM_BiosSeg;
extern HANDLE16 DOSMEM_BiosSeg;
/* miscemu/instr.c */
extern BOOL INSTR_EmulateInstruction( SIGCONTEXT *context );
extern BOOL32 INSTR_EmulateInstruction( SIGCONTEXT *context );
/* miscemu/interrupts.c */
extern BOOL INT_Init(void);
extern SEGPTR INT_GetHandler( BYTE intnum );
extern void INT_SetHandler( BYTE intnum, SEGPTR handler );
extern BOOL32 INT_Init(void);
extern FARPROC16 INT_GetHandler( BYTE intnum );
extern void INT_SetHandler( BYTE intnum, FARPROC16 handler );
/* miscemu/int1a.c */
extern DWORD INT1A_GetTicksSinceMidnight(void);
/* miscemu/int21.c */
extern BOOL INT21_Init(void);
extern BOOL32 INT21_Init(void);
/* miscemu/ioports.c */
extern DWORD inport( int port, int count );

View File

@ -10,10 +10,6 @@
#include "wintypes.h"
#include "pe_image.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* In-memory module structure. See 'Windows Internals' p. 219 */
typedef struct
{
@ -84,16 +80,19 @@ typedef struct
FARPROC16 SetOwner; /* Set Owner procedure, exported by wine */
} SELFLOADHEADER;
/* Parameters for LoadModule() */
#pragma pack(1)
/* Parameters for LoadModule() */
typedef struct
{
HANDLE16 hEnvironment; /* Environment segment */
SEGPTR cmdLine; /* Command-line */
SEGPTR showCmd; /* Code for ShowWindow() */
SEGPTR reserved;
HANDLE16 hEnvironment; /* Environment segment */
SEGPTR cmdLine WINE_PACKED; /* Command-line */
SEGPTR showCmd WINE_PACKED; /* Code for ShowWindow() */
SEGPTR reserved WINE_PACKED;
} LOADPARAMS;
#pragma pack(4)
/* Resource types */
typedef struct resource_typeinfo_s NE_TYPEINFO;
typedef struct resource_nameinfo_s NE_NAMEINFO;
@ -111,10 +110,6 @@ typedef struct resource_nameinfo_s NE_NAMEINFO;
((struct pe_data *)(((pModule)->flags & NE_FFLAGS_WIN32) ? \
((NE_WIN32_EXTRAINFO *)((pModule) + 1))->pe_module : 0))
#ifndef WINELIB
#pragma pack(4)
#endif
/* module.c */
extern NE_MODULE *MODULE_GetPtr( HMODULE16 hModule );
extern void MODULE_DumpModule( HMODULE16 hmodule );
@ -124,7 +119,7 @@ extern LPSTR MODULE_GetModuleName( HMODULE16 hModule );
extern void MODULE_RegisterModule( NE_MODULE *pModule );
extern HINSTANCE16 MODULE_GetInstance( HMODULE16 hModule );
extern WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name );
extern SEGPTR MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern BOOL16 MODULE_SetEntryPoint( HMODULE16 hModule, WORD ordinal,
WORD offset );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
@ -132,9 +127,9 @@ extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
/* builtin.c */
extern BOOL16 BUILTIN_Init(void);
extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL16 force );
extern NE_MODULE *BUILTIN_GetEntryPoint( WORD cs, WORD ip,
WORD *pOrd, char **ppName );
extern DWORD BUILTIN_GetProcAddress32( NE_MODULE *pModule, char *function );
extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
extern LPCSTR BUILTIN_GetEntryPoint32( void *relay );
extern FARPROC32 BUILTIN_GetProcAddress32(NE_MODULE *pModule, LPCSTR function);
extern BOOL16 BUILTIN_ParseDLLOptions( const char *str );
extern void BUILTIN_PrintDLLs(void);

View File

@ -9,9 +9,7 @@
#include "gdi.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* GDI logical palette object */
typedef struct
@ -20,10 +18,8 @@ typedef struct
LOGPALETTE logpalette WINE_PACKED;
} PALETTEOBJ;
#ifndef WINELIB
#pragma pack(4)
#endif
extern int PALETTE_GetObject( PALETTEOBJ * palette, int count, LPSTR buffer );
#endif /* __WINE_FONT_H */
#endif /* __WINE_PALETTE_H */

View File

@ -20,6 +20,7 @@ struct pe_data {
typedef struct pe_data PE_MODULE;
extern int PE_unloadImage(HMODULE32 hModule);
extern FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName);
extern void my_wcstombs(char * result, u_short * source, int len);
#endif /* __WINE_PE_IMAGE_H */

View File

@ -9,9 +9,7 @@
#include "gdi.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* GDI logical pen object */
typedef struct
@ -20,9 +18,7 @@ typedef struct
LOGPEN16 logpen WINE_PACKED;
} PENOBJ;
#ifndef WINELIB
#pragma pack(4)
#endif
extern int PEN_GetObject( PENOBJ * pen, int count, LPSTR buffer );
extern HPEN16 PEN_SelectObject( DC * dc, HPEN16 hpen, PENOBJ * pen );

View File

@ -9,10 +9,6 @@
#include "windows.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* Message as stored in the queue (contains the extraInfo field) */
typedef struct tagQMSG
{
@ -20,11 +16,12 @@ typedef struct tagQMSG
MSG16 msg;
} QMSG;
#pragma pack(1)
typedef struct tagMESSAGEQUEUE
{
HQUEUE next; /* 00 Next queue */
HTASK hTask; /* 02 hTask owning the queue */
HQUEUE16 next; /* 00 Next queue */
HTASK16 hTask; /* 02 hTask owning the queue */
WORD msgSize; /* 04 Size of messages in the queue */
WORD msgCount; /* 06 Number of waiting messages */
WORD nextMessage; /* 08 Next message to be retrieved */
@ -32,22 +29,22 @@ typedef struct tagMESSAGEQUEUE
WORD queueSize; /* 0c Size of the queue */
DWORD GetMessageTimeVal WINE_PACKED; /* 0e Value for GetMessageTime */
DWORD GetMessagePosVal WINE_PACKED; /* 12 Value for GetMessagePos */
HQUEUE self; /* 16 Handle to self (was: reserved) */
HQUEUE16 self; /* 16 Handle to self (was: reserved) */
DWORD GetMessageExtraInfoVal; /* 18 Value for GetMessageExtraInfo */
WORD reserved2; /* 1c Unknown */
LPARAM lParam WINE_PACKED; /* 1e Next 4 values set by SendMessage */
WPARAM wParam; /* 22 */
UINT msg; /* 24 */
HWND hWnd; /* 26 */
WPARAM16 wParam; /* 22 */
UINT16 msg; /* 24 */
HWND16 hWnd; /* 26 */
DWORD SendMessageReturn; /* 28 Return value for SendMessage */
WORD wPostQMsg; /* 2c PostQuitMessage flag */
WORD wExitCode; /* 2e PostQuitMessage exit code */
WORD flags; /* 30 Queue flags */
WORD reserved3[2]; /* 32 Unknown */
WORD wWinVersion; /* 36 Expected Windows version */
HQUEUE InSendMessageHandle; /* 38 Queue of task that sent a message */
HTASK hSendingTask; /* 3a Handle of task that sent a message */
HTASK hPrevSendingTask; /* 3c Handle of previous sender */
HQUEUE16 InSendMessageHandle; /* 38 Queue of task that sent a message */
HTASK16 hSendingTask; /* 3a Handle of task that sent a message */
HTASK16 hPrevSendingTask; /* 3c Handle of previous sender */
WORD wPaintCount; /* 3e Number of WM_PAINT needed */
WORD wTimerCount; /* 40 Number of timers for this task */
WORD changeBits; /* 42 Changed wake-up bits */
@ -60,9 +57,7 @@ typedef struct tagMESSAGEQUEUE
QMSG messages[1]; /* 6e Queue messages */
} MESSAGEQUEUE;
#ifndef WINELIB
#pragma pack(4)
#endif
/* Extra (undocumented) queue wake bits; not sure about the values */
#define QS_SMRESULT 0x0100 /* Queue has a SendMessage() result */
@ -71,22 +66,22 @@ typedef struct tagMESSAGEQUEUE
/* Queue flags */
#define QUEUE_FLAG_REPLIED 0x0001 /* Replied to a SendMessage() */
extern void QUEUE_DumpQueue( HQUEUE hQueue );
extern void QUEUE_DumpQueue( HQUEUE16 hQueue );
extern void QUEUE_WalkQueues(void);
extern MESSAGEQUEUE *QUEUE_GetSysQueue(void);
extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit );
extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
extern void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue );
extern void QUEUE_WaitBits( WORD bits );
extern void QUEUE_IncPaintCount( HQUEUE hQueue );
extern void QUEUE_DecPaintCount( HQUEUE hQueue );
extern void QUEUE_IncTimerCount( HQUEUE hQueue );
extern void QUEUE_DecTimerCount( HQUEUE hQueue );
extern BOOL QUEUE_CreateSysMsgQueue( int size );
extern BOOL QUEUE_DeleteMsgQueue( HQUEUE hQueue );
extern HTASK QUEUE_GetQueueTask( HQUEUE hQueue );
extern BOOL QUEUE_AddMsg( HQUEUE hQueue, MSG16 * msg, DWORD extraInfo );
extern int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND hwnd,
extern void QUEUE_IncPaintCount( HQUEUE16 hQueue );
extern void QUEUE_DecPaintCount( HQUEUE16 hQueue );
extern void QUEUE_IncTimerCount( HQUEUE16 hQueue );
extern void QUEUE_DecTimerCount( HQUEUE16 hQueue );
extern BOOL32 QUEUE_CreateSysMsgQueue( int size );
extern BOOL32 QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
extern BOOL32 QUEUE_AddMsg( HQUEUE16 hQueue, MSG16 * msg, DWORD extraInfo );
extern int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND32 hwnd,
int first, int last );
extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos );
extern void hardware_event( WORD message, WORD wParam, LONG lParam,

View File

@ -7,8 +7,70 @@
#ifndef __WINE_REGISTERS_H
#define __WINE_REGISTERS_H
#include <windows.h>
#include "wine.h"
#include "wintypes.h"
#ifndef WINELIB
#ifdef i386
extern int runtime_cpu (void);
#else
static inline int runtime_cpu(void) { return 3; }
#endif
#ifdef linux
typedef struct
{
unsigned short sc_gs, __gsh;
unsigned short sc_fs, __fsh;
unsigned short sc_es, __esh;
unsigned short sc_ds, __dsh;
unsigned long sc_edi;
unsigned long sc_esi;
unsigned long sc_ebp;
unsigned long sc_esp;
unsigned long sc_ebx;
unsigned long sc_edx;
unsigned long sc_ecx;
unsigned long sc_eax;
unsigned long sc_trapno;
unsigned long sc_err;
unsigned long sc_eip;
unsigned short sc_cs, __csh;
unsigned long sc_eflags;
unsigned long esp_at_signal;
unsigned short sc_ss, __ssh;
unsigned long i387;
unsigned long oldmask;
unsigned long cr2;
} SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x2b
#define WINE_CODE_SELECTOR 0x23
#endif /* linux */
#ifdef __NetBSD__
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x1f
#define WINE_CODE_SELECTOR 0x17
#endif /* NetBSD */
#if defined(__svr4__) || defined(_SCO_DS)
#include <signal.h>
#ifdef _SCO_DS
#include <sys/regset.h>
#endif
#include <sys/ucontext.h>
typedef struct ucontext SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x1f
#define WINE_CODE_SELECTOR 0x17
#endif /* svr4 || SCO_DS */
#ifdef __FreeBSD__
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x27
#define WINE_CODE_SELECTOR 0x1f
#endif /* FreeBSD */
#if !defined(__svr4__) && !defined(_SCO_DS)
@ -125,4 +187,12 @@
#define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
#define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
#else /* ifndef WINELIB */
typedef void SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x00
#define WINE_CODE_SELECTOR 0x00
#endif /* ifndef WINELIB */
#endif /* __WINE_REGISTERS_H */

View File

@ -4,15 +4,13 @@
* Copyright 1995 Alexandre Julliard
*/
#ifndef WINE_STACKFRAME_H
#define WINE_STACKFRAME_H
#ifndef __WINE_STACKFRAME_H
#define __WINE_STACKFRAME_H
#include <windows.h>
#include "ldt.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* 16-bit stack layout after CallFrom16() */
typedef struct
@ -45,9 +43,7 @@ typedef struct
DWORD args[1]; /* arguments to 16-bit function */
} STACK32FRAME;
#ifndef WINELIB
#pragma pack(4)
#endif
/* Saved 16-bit stack for current process (Win16 only) */
extern WORD IF1632_Saved16_ss;
@ -80,4 +76,4 @@ SEGPTR MAKE_SEGPTR(void *ptr);
#define MAKE_SEGPTR(ptr) ((SEGPTR)ptr)
#endif
#endif /* WINE_STACKFRAME_H */
#endif /* __WINE_STACKFRAME_H */

View File

@ -96,7 +96,6 @@
#undef DEBUG_DOSFS
#undef DEBUG_DRIVER
#undef DEBUG_EDIT
#undef DEBUG_ENUM
#undef DEBUG_ENV
#undef DEBUG_EVENT
#undef DEBUG_EXEC
@ -174,7 +173,6 @@
#define DEBUG_DOSFS
#define DEBUG_DRIVER
#define DEBUG_EDIT
#define DEBUG_ENUM
#define DEBUG_ENV
#define DEBUG_EVENT
#define DEBUG_EXEC

View File

@ -1,12 +1,8 @@
/* Structure definitions for Win32 -- used only internally */
#ifndef _STRUCT32_H
#define _STRUCT32_H
#ifndef __WINE__STRUCT32_H
#define __WINE__STRUCT32_H
#include "handle32.h"
#ifndef WINELIB
#pragma pack(1)
#endif
void STRUCT32_RECT32to16(const RECT32*,RECT16*);
void STRUCT32_RECT16to32(const RECT16*,RECT32*);
void STRUCT32_POINT32to16(const POINT32*,POINT16*);
@ -24,23 +20,14 @@ extern void STRUCT32_NCCALCSIZE16to32Flat( const NCCALCSIZE_PARAMS16* from,
NCCALCSIZE_PARAMS32* to,
int validRects );
typedef struct {
DWORD style;
DWORD dwExtendedStyle;
WORD noOfItems WINE_PACKED;
short x WINE_PACKED;
short y WINE_PACKED;
WORD cx WINE_PACKED;
WORD cy WINE_PACKED;
} DLGTEMPLATE32;
void STRUCT32_MSG16to32(const MSG16 *msg16,MSG32 *msg32);
void STRUCT32_MSG32to16(const MSG32 *msg32,MSG16 *msg16);
void STRUCT32_CREATESTRUCT32Ato16(const CREATESTRUCT32A*,CREATESTRUCT16*);
void STRUCT32_CREATESTRUCT16to32A(const CREATESTRUCT16*,CREATESTRUCT32A*);
#pragma pack(1)
typedef struct {
BYTE bWidth;
BYTE bHeight;
@ -77,9 +64,6 @@ typedef struct {
} CURSORICONDIR32;
#ifndef WINELIB
#pragma pack(4)
#endif
#endif
#endif /* __WINE_STRUCT32_H */

View File

@ -9,31 +9,29 @@
#include "wintypes.h"
#ifndef WINELIB
#pragma pack(1)
#endif
/* Process database (i.e. a normal DOS PSP) */
typedef struct
{
WORD int20; /* 00 int 20h instruction */
WORD nextParagraph; /* 02 Segment of next paragraph */
BYTE reserved1;
BYTE dispatcher[5]; /* 05 Long call to DOS */
SEGPTR savedint22 WINE_PACKED; /* 0a Saved int 22h handler */
SEGPTR savedint23 WINE_PACKED; /* 0e Saved int 23h handler */
SEGPTR savedint24 WINE_PACKED; /* 12 Saved int 24h handler */
WORD parentPSP; /* 16 Selector of parent PSP */
BYTE fileHandles[20]; /* 18 Open file handles */
HANDLE environment; /* 2c Selector of environment */
WORD reserved2[2];
WORD nbFiles; /* 32 Number of file handles */
SEGPTR fileHandlesPtr; /* 34 Pointer to file handle table */
WORD reserved3[18];
BYTE fcb1[16]; /* 5c First FCB */
BYTE fcb2[20]; /* 6c Second FCB */
BYTE cmdLine[128]; /* 80 Command-line (first byte is len) */
WORD int20; /* 00 int 20h instruction */
WORD nextParagraph; /* 02 Segment of next paragraph */
BYTE reserved1;
BYTE dispatcher[5]; /* 05 Long call to DOS */
FARPROC16 savedint22 WINE_PACKED; /* 0a Saved int 22h handler */
FARPROC16 savedint23 WINE_PACKED; /* 0e Saved int 23h handler */
FARPROC16 savedint24 WINE_PACKED; /* 12 Saved int 24h handler */
WORD parentPSP; /* 16 Selector of parent PSP */
BYTE fileHandles[20]; /* 18 Open file handles */
HANDLE16 environment; /* 2c Selector of environment */
WORD reserved2[2];
WORD nbFiles; /* 32 Number of file handles */
SEGPTR fileHandlesPtr; /* 34 Pointer to file handle table */
WORD reserved3[18];
BYTE fcb1[16]; /* 5c First FCB */
BYTE fcb2[20]; /* 6c Second FCB */
BYTE cmdLine[128]; /* 80 Command-line (first byte is len)*/
} PDB;
@ -107,9 +105,7 @@ typedef struct
#define TDBF_OS2APP 0x0008
#define TDBF_WIN32S 0x0010
#ifndef WINELIB
#pragma pack(4)
#endif
extern BOOL TASK_Init(void);
extern HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance,

View File

@ -19,13 +19,8 @@ extern WORD USER_HeapSel;
#define USER_HEAP_FREE(handle) \
LOCAL_Free( USER_HeapSel, (handle) )
#define USER_HEAP_LIN_ADDR(handle) \
((handle) ? PTR_SEG_OFF_TO_LIN(USER_HeapSel, (handle)) : NULL)
#ifdef WINELIB
#define USER_HEAP_SEG_ADDR(handle) ((SEGPTR)(USER_HEAP_LIN_ADDR(handle)))
#else
((handle) ? PTR_SEG_OFF_TO_LIN(USER_HeapSel, (handle)) : NULL)
#define USER_HEAP_SEG_ADDR(handle) \
((handle) ? MAKELONG((handle), USER_HeapSel) : 0)
#endif /* WINELIB */
((handle) ? PTR_SEG_OFF_TO_SEGPTR(USER_HeapSel, (handle)) : (SEGPTR)0)
#endif /* USER_H */

View File

@ -136,59 +136,6 @@ GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
DWORD off,DWORD reslen,LPVOID data
);
DWORD GetFileVersionInfoSize16(LPCSTR filename,LPDWORD handle);
DWORD GetFileVersionInfoSize32A(LPCSTR filename,LPDWORD handle);
DWORD GetFileVersionInfoSize32W(LPCWSTR filename,LPDWORD handle);
#define GetFileVersionInfoSize WINELIB_NAME_AW(GetFileVersionInfoSize)
DWORD GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
DWORD GetFileVersionInfo32A(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
DWORD GetFileVersionInfo32W(LPCWSTR filename,DWORD handle,DWORD datasize,LPVOID data);
#define GetFileVersionInfo WINELIB_NAME_AW(GetFileVersionInfo)
DWORD
VerFindFile16(
UINT16 flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT16 *curdirlen,LPSTR destdir,UINT16 *destdirlen
);
DWORD
VerFindFile32A(
UINT32 flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT32 *curdirlen,LPSTR destdir,UINT32 *destdirlen
);
DWORD
VerFindFile32W(
UINT32 flags,LPCWSTR filename,LPCWSTR windir,LPCWSTR appdir,
LPWSTR curdir,UINT32 *curdirlen,LPWSTR destdir,UINT32 *destdirlen
);
#define VerFindFile WINELIB_NAME_AW(VerFindFile)
DWORD
VerInstallFile16(
UINT16 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT16 *tmpfilelen
);
DWORD
VerInstallFile32A(
UINT32 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT32 *tmpfilelen
);
DWORD
VerInstallFile32W(
UINT32 flags,LPCWSTR srcfilename,LPCWSTR destfilename,LPCWSTR srcdir,
LPCWSTR destdir,LPWSTR tmpfile,UINT32 *tmpfilelen
);
#define VerInstallFile WINELIB_NAME_AW(VerInstallFile)
DWORD VerLanguageName16(UINT16 lang,LPSTR langname,UINT16 langnamelen);
DWORD VerLanguageName32A(UINT32 lang,LPSTR langname,UINT32 langnamelen);
DWORD VerLanguageName32W(UINT32 lang,LPWSTR langname,UINT32 langnamelen);
#define VerLanguageName WINELIB_NAME_AW(VerLanguageName)
DWORD VerQueryValue16(SEGPTR block,LPCSTR subblock,SEGPTR *buffer,UINT16 *buflen);
DWORD VerQueryValue32A(LPVOID block,LPCSTR subblock,LPVOID *buffer,UINT32 *buflen);
DWORD VerQueryValue32W(LPVOID block,LPCWSTR subblock,LPVOID *buffer,UINT32 *buflen);
#define VerQueryValue WINELIB_NAME_AW(VerQueryValue)
/* 20 GETFILEVERSIONINFORAW */

View File

@ -45,14 +45,14 @@ typedef struct tagWND
POINT16 ptIconPos; /* Icon position */
POINT16 ptMaxPos; /* Maximized window position */
LPSTR text; /* Window text */
void *pVScroll; /* Vertical scroll-bar info */
void *pHScroll; /* Horizontal scroll-bar info */
HGLOBAL hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HWND hwndLastActive;/* Last active popup hwnd */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HANDLE hVScroll; /* Vertical scroll-bar info */
HANDLE hHScroll; /* Horizontal scroll-bar info */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
WORD flags; /* Misc. flags (see below) */
Window window; /* X window (only for top-level windows) */

View File

@ -1449,15 +1449,15 @@ typedef KANJISTRUCT *LPKANJISTRUCT;
typedef KANJISTRUCT *NPKANJISTRUCT;
typedef KANJISTRUCT *PKANJISTRUCT;
#define OFS_MAXPATHNAME 128
typedef struct
{
BYTE cBytes;
BYTE fFixedDisk;
WORD nErrCode;
BYTE reserved[4];
BYTE szPathName[128];
} OFSTRUCT;
typedef OFSTRUCT *LPOFSTRUCT;
BYTE szPathName[OFS_MAXPATHNAME];
} OFSTRUCT, *LPOFSTRUCT;
#define OF_READ 0x0000
#define OF_WRITE 0x0001
@ -2247,6 +2247,43 @@ typedef struct
#define DT_NOPREFIX 2048
#define DT_INTERNAL 4096
/* DrawEdge() flags */
#define BDR_RAISEDOUTER 0x0001
#define BDR_SUNKENOUTER 0x0002
#define BDR_RAISEDINNER 0x0004
#define BDR_SUNKENINNER 0x0008
#define BDR_OUTER 0x0003
#define BDR_INNER 0x000c
#define BDR_RAISED 0x0005
#define BDR_SUNKEN 0x000a
#define EDGE_RAISED (BDR_RAISEDOUTER | BDR_RAISEDINNER)
#define EDGE_SUNKEN (BDR_SUNKENOUTER | BDR_SUNKENINNER)
#define EDGE_ETCHED (BDR_SUNKENOUTER | BDR_RAISEDINNER)
#define EDGE_BUMP (BDR_RAISEDOUTER | BDR_SUNKENINNER)
/* border flags */
#define BF_LEFT 0x0001
#define BF_TOP 0x0002
#define BF_RIGHT 0x0004
#define BF_BOTTOM 0x0008
#define BF_DIAGONAL 0x0010
#define BF_MIDDLE 0x0800 /* Fill in the middle */
#define BF_SOFT 0x1000 /* For softer buttons */
#define BF_ADJUST 0x2000 /* Calculate the space left over */
#define BF_FLAT 0x4000 /* For flat rather than 3D borders */
#define BF_MONO 0x8000 /* For monochrome borders */
#define BF_TOPLEFT (BF_TOP | BF_LEFT)
#define BF_TOPRIGHT (BF_TOP | BF_RIGHT)
#define BF_BOTTOMLEFT (BF_BOTTOM | BF_LEFT)
#define BF_BOTTOMRIGHT (BF_BOTTOM | BF_RIGHT)
#define BF_RECT (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM)
#define BF_DIAGONAL_ENDTOPRIGHT (BF_DIAGONAL | BF_TOP | BF_RIGHT)
#define BF_DIAGONAL_ENDTOPLEFT (BF_DIAGONAL | BF_TOP | BF_LEFT)
#define BF_DIAGONAL_ENDBOTTOMLEFT (BF_DIAGONAL | BF_BOTTOM | BF_LEFT)
#define BF_DIAGONAL_ENDBOTTOMRIGHT (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT)
/* Window Styles */
#define WS_OVERLAPPED 0x00000000L
#define WS_POPUP 0x80000000L
@ -3153,6 +3190,8 @@ VOID FillWindow(HWND16,HWND16,HDC16,HBRUSH16);
WORD FreeSelector(WORD);
DWORD GetBitmapDimension(HBITMAP16);
HTASK16 GetCurrentTask(void);
HINSTANCE16 GetTaskDS(void);
HQUEUE16 GetTaskQueue(HTASK16);
BOOL16 LocalInit(HANDLE16,WORD,WORD);
DWORD OffsetViewportOrg(HDC16,INT16,INT16);
DWORD OffsetWindowOrg(HDC16,INT16,INT16);
@ -3183,6 +3222,7 @@ LPVOID HeapReAlloc(HANDLE32,DWORD,LPVOID,DWORD);
DWORD HeapSize(HANDLE32,DWORD,LPVOID);
BOOL32 HeapUnlock(HANDLE32);
BOOL32 HeapValidate(HANDLE32,DWORD,LPVOID);
BOOL32 IsWindowUnicode(HWND32);
VOID RtlFillMemory(LPVOID,UINT32,UINT32);
VOID RtlMoveMemory(LPVOID,LPCVOID,UINT32);
VOID RtlZeroMemory(LPVOID,UINT32);
@ -3191,31 +3231,55 @@ BOOL32 VirtualFree(LPVOID,DWORD,DWORD);
/* Declarations for functions that are the same in Win16 and Win32 */
BOOL16 CheckDlgButton(HWND32,INT32,UINT32);
BOOL16 CheckRadioButton(HWND32,UINT32,UINT32,UINT32);
INT16 CombineRgn(HRGN32,HRGN32,HRGN32,INT32);
LONG CopyLZFile(HFILE,HFILE);
HBITMAP16 CreateBitmap(INT32,INT32,UINT32,UINT32,LPCVOID);
BOOL16 CreateCaret(HWND32,HBITMAP32,INT32,INT32);
HBITMAP16 CreateCompatibleBitmap(HDC32,INT32,INT32);
HBITMAP16 CreateDiscardableBitmap(HDC32,INT32,INT32);
HRGN16 CreateEllipticRgn(INT32,INT32,INT32,INT32);
HRGN16 CreateRectRgn(INT32,INT32,INT32,INT32);
HRGN16 CreateRoundRectRgn(INT32,INT32,INT32,INT32,INT32,INT32);
BOOL16 DestroyCaret(void);
BOOL16 EndDialog(HWND32,INT32);
BOOL16 EqualRgn(HRGN32,HRGN32);
INT16 ExcludeUpdateRgn(HDC32,HWND32);
BOOL16 ExtFloodFill(HDC32,INT32,INT32,COLORREF,UINT32);
BOOL16 FloodFill(HDC32,INT32,INT32,COLORREF);
DWORD GetAppCompatFlags(HTASK32);
LONG GetBitmapBits(HBITMAP32,LONG,LPVOID);
WORD GetClassWord(HWND32,INT32);
INT16 GetDlgCtrlID(HWND32);
DWORD GetTickCount(void);
INT16 GetUpdateRgn(HWND32,HRGN32,BOOL32);
WORD GetWindowWord(HWND32,INT32);
BOOL16 HideCaret(HWND32);
BOOL16 IsWindow(HWND32);
void LZClose(HFILE);
LONG LZCopy(HFILE,HFILE);
void LZDone(void);
HFILE LZInit(HFILE);
LONG LZSeek(HFILE,LONG,INT32);
INT16 LZStart(void);
INT16 OffsetRgn(HRGN32,INT32,INT32);
HFILE OpenFile(LPCSTR,OFSTRUCT*,UINT32);
BOOL16 PtInRegion(HRGN32,INT32,INT32);
DWORD RegCloseKey(HKEY);
DWORD RegFlushKey(HKEY);
LONG SetBitmapBits(HBITMAP32,LONG,LPCVOID);
BOOL16 SetCaretBlinkTime(UINT32);
BOOL16 SetCaretPos(INT32,INT32);
WORD SetClassWord(HWND32,INT32,WORD);
INT16 SetDIBits(HDC32,HBITMAP32,UINT32,UINT32,LPCVOID,const BITMAPINFO*,UINT32);
INT16 SetDIBitsToDevice(HDC32,INT32,INT32,DWORD,DWORD,INT32,INT32,UINT32,UINT32,LPCVOID,const BITMAPINFO*,UINT32);
VOID SetRectRgn(HRGN32,INT32,INT32,INT32,INT32);
WORD SetWindowWord(HWND32,INT32,WORD);
BOOL16 ShowCaret(HWND32);
HFILE _lclose(HFILE);
HFILE _lcreat(LPCSTR,INT32);
HFILE _lopen(LPCSTR,INT32);
/* Declarations for functions that change between Win16 and Win32 */
@ -3240,6 +3304,36 @@ BOOL16 ChangeMenu16(HMENU16,UINT16,SEGPTR,UINT16,UINT16);
BOOL32 ChangeMenu32A(HMENU32,UINT32,LPCSTR,UINT32,UINT32);
BOOL32 ChangeMenu32W(HMENU32,UINT32,LPCWSTR,UINT32,UINT32);
#define ChangeMenu WINELIB_NAME_AW(ChangeMenu)
LPSTR CharLower32A(LPSTR);
LPWSTR CharLower32W(LPWSTR);
#define CharLower WINELIB_NAME_AW(CharLower)
DWORD CharLowerBuff32A(LPSTR,DWORD);
DWORD CharLowerBuff32W(LPWSTR,DWORD);
#define CharLowerBuff WINELIB_NAME_AW(CharLowerBuff)
LPSTR CharNext32A(LPCSTR);
LPWSTR CharNext32W(LPCWSTR);
#define CharNext WINELIB_NAME_AW(CharNext)
LPSTR CharNextEx32A(WORD,LPCSTR,DWORD);
LPWSTR CharNextEx32W(WORD,LPCWSTR,DWORD);
#define CharNextEx WINELIB_NAME_AW(CharNextEx)
LPSTR CharPrev32A(LPCSTR,LPCSTR);
LPWSTR CharPrev32W(LPCWSTR,LPCWSTR);
#define CharPrev WINELIB_NAME_AW(CharPrev)
LPSTR CharPrevEx32A(WORD,LPCSTR,LPCSTR,DWORD);
LPWSTR CharPrevEx32W(WORD,LPCWSTR,LPCWSTR,DWORD);
#define CharPrevEx WINELIB_NAME_AW(CharPrevEx)
LPSTR CharUpper32A(LPSTR);
LPWSTR CharUpper32W(LPWSTR);
#define CharUpper WINELIB_NAME_AW(CharUpper)
DWORD CharUpperBuff32A(LPSTR,DWORD);
DWORD CharUpperBuff32W(LPWSTR,DWORD);
#define CharUpperBuff WINELIB_NAME_AW(CharUpperBuff)
BOOL32 CharToOem32A(LPSTR,LPSTR);
BOOL32 CharToOem32W(LPCWSTR,LPSTR);
#define CharToOem WINELIB_NAME_AW(CharToOem)
BOOL32 CharToOemBuff32A(LPSTR,LPSTR,DWORD);
BOOL32 CharToOemBuff32W(LPCWSTR,LPSTR,DWORD);
#define CharToOemBuff WINELIB_NAME_AW(CharToOemBuff)
HWND16 ChildWindowFromPoint16(HWND16,POINT16);
HWND32 ChildWindowFromPoint32(HWND32,POINT32);
#define ChildWindowFromPoint WINELIB_NAME(ChildWindowFromPoint)
@ -3249,6 +3343,16 @@ BOOL32 ClientToScreen32(HWND32,LPPOINT32);
BOOL16 ClipCursor16(const RECT16*);
BOOL32 ClipCursor32(const RECT32*);
#define ClipCursor WINELIB_NAME(ClipCursor)
UINT16 CompareString16(DWORD,DWORD,LPCSTR,DWORD,LPCSTR,DWORD);
UINT32 CompareString32A(DWORD,DWORD,LPCSTR,DWORD,LPCSTR,DWORD);
UINT32 CompareString32W(DWORD,DWORD,LPCWSTR,DWORD,LPCWSTR,DWORD);
#define CompareString WINELIB_NAME_AW(CompareString)
HCURSOR16 CopyCursor16(HINSTANCE16,HCURSOR16);
#define CopyCursor32(cur) ((HCURSOR32)CopyIcon32((HICON32)(cur)))
#define CopyCursor WINELIB_NAME(CopyCursor)
HICON16 CopyIcon16(HINSTANCE16,HICON16);
HICON32 CopyIcon32(HICON32);
#define CopyIcon WINELIB_NAME(CopyIcon)
BOOL16 CopyRect16(RECT16*,const RECT16*);
BOOL32 CopyRect32(RECT32*,const RECT32*);
#define CopyRect WINELIB_NAME(CopyRect)
@ -3282,6 +3386,10 @@ BOOL32 CreateDirectory32W(LPCWSTR,LPSECURITY_ATTRIBUTES);
HRGN16 CreateEllipticRgnIndirect16(const RECT16 *);
HRGN32 CreateEllipticRgnIndirect32(const RECT32 *);
#define CreateEllipticRgnIndirect WINELIB_NAME(CreateEllipticRgnIndirect)
HFONT16 CreateFontIndirect16(const LOGFONT16*);
HFONT32 CreateFontIndirect32A(const LOGFONT32A*);
HFONT32 CreateFontIndirect32W(const LOGFONT32W*);
#define CreateFontIndirect WINELIB_NAME_AW(CreateFontIndirect)
HRGN16 CreatePolyPolygonRgn16(const POINT16*,const INT16*,INT16,INT16);
HRGN32 CreatePolyPolygonRgn32(const POINT32*,const INT32*,INT32,INT32);
#define CreatePolyPolygonRgn WINELIB_NAME(CreatePolyPolygonRgn)
@ -3352,9 +3460,15 @@ INT32 DlgDirListComboBox32W(HWND32,LPCWSTR,INT32,INT32,UINT32);
BOOL16 DPtoLP16(HDC16,LPPOINT16,INT16);
BOOL32 DPtoLP32(HDC32,LPPOINT32,INT32);
#define DPtoLP WINELIB_NAME(DPtoLP)
BOOL16 DrawEdge16(HDC16,LPRECT16,UINT16,UINT16);
BOOL32 DrawEdge32(HDC32,LPRECT32,UINT32,UINT32);
#define DrawEdge WINELIB_NAME(DrawEdge)
void DrawFocusRect16(HDC16,const RECT16*);
void DrawFocusRect32(HDC32,const RECT32*);
#define DrawFocusRect WINELIB_NAME(DrawFocusRect)
BOOL16 DrawFrameControl16(HDC16,LPRECT16,UINT16,UINT16);
BOOL32 DrawFrameControl32(HDC32,LPRECT32,UINT32,UINT32);
#define DrawFrameControl WINELIB_NAME(DrawFrameControl)
INT16 DrawText16(HDC16,LPCSTR,INT16,LPRECT16,UINT16);
INT32 DrawText32A(HDC32,LPCSTR,INT32,LPRECT32,UINT32);
INT32 DrawText32W(HDC32,LPCWSTR,INT32,LPRECT32,UINT32);
@ -3397,7 +3511,7 @@ BOOL16 FreeModule16(HMODULE16);
#define FreeModule32(handle) FreeLibrary32(handle)
#define FreeModule WINELIB_NAME(FreeModule)
void FreeProcInstance16(FARPROC16);
#define FreeProcInstance32(proc) (proc)
#define FreeProcInstance32(proc) /*nothing*/
#define FreeProcInstance WINELIB_NAME(FreeProcInstance)
BOOL16 GetBitmapDimensionEx16(HBITMAP16,LPSIZE16);
BOOL32 GetBitmapDimensionEx32(HBITMAP32,LPSIZE32);
@ -3405,8 +3519,11 @@ BOOL32 GetBitmapDimensionEx32(HBITMAP32,LPSIZE32);
BOOL16 GetBrushOrgEx16(HDC16,LPPOINT16);
BOOL32 GetBrushOrgEx32(HDC32,LPPOINT32);
#define GetBrushOrgEx WINELIB_NAME(GetBrushOrgEx)
void GetCaretPos16(LPPOINT16);
void GetCaretPos32(LPPOINT32);
UINT16 GetCaretBlinkTime16(void);
UINT32 GetCaretBlinkTime32(void);
#define GetCaretBlinkTime WINELIB_NAME(GetCaretBlinkTime)
VOID GetCaretPos16(LPPOINT16);
BOOL32 GetCaretPos32(LPPOINT32);
#define GetCaretPos WINELIB_NAME(GetCaretPos)
BOOL16 GetClassInfo16(HINSTANCE16,SEGPTR,WNDCLASS16 *);
BOOL32 GetClassInfo32A(HINSTANCE32,LPCSTR,WNDCLASS32A *);
@ -3455,6 +3572,18 @@ UINT16 GetDriveType16(UINT16); /* yes, the arguments differ */
UINT32 GetDriveType32A(LPCSTR);
UINT32 GetDriveType32W(LPCWSTR);
#define GetDriveType WINELIB_NAME_AW(GetDriveType)
INT16 GetExpandedName16(LPCSTR,LPSTR);
INT32 GetExpandedName32A(LPCSTR,LPSTR);
INT32 GetExpandedName32W(LPCWSTR,LPWSTR);
#define GetExpandedName WINELIB_NAME_AW(GetExpandedName)
DWORD GetFileVersionInfoSize16(LPCSTR,LPDWORD);
DWORD GetFileVersionInfoSize32A(LPCSTR,LPDWORD);
DWORD GetFileVersionInfoSize32W(LPCWSTR,LPDWORD);
#define GetFileVersionInfoSize WINELIB_NAME_AW(GetFileVersionInfoSize)
DWORD GetFileVersionInfo16(LPCSTR,DWORD,DWORD,LPVOID);
DWORD GetFileVersionInfo32A(LPCSTR,DWORD,DWORD,LPVOID);
DWORD GetFileVersionInfo32W(LPCWSTR,DWORD,DWORD,LPVOID);
#define GetFileVersionInfo WINELIB_NAME_AW(GetFileVersionInfo)
UINT16 GetInternalWindowPos16(HWND16,LPRECT16,LPPOINT16);
UINT32 GetInternalWindowPos32(HWND32,LPRECT32,LPPOINT32);
#define GetInternalWindowPos WINELIB_NAME(GetInternalWindowPos)
@ -3465,13 +3594,23 @@ INT16 GetObject16(HANDLE16,INT16,LPVOID);
INT32 GetObject32A(HANDLE32,INT32,LPVOID);
INT32 GetObject32W(HANDLE32,INT32,LPVOID);
#define GetObject WINELIB_NAME_AW(GetObject)
FARPROC16 GetProcAddress16(HMODULE16,SEGPTR);
FARPROC32 GetProcAddress32(HMODULE32,LPCSTR);
#define GetProcAddress WINELIB_NAME(GetProcAddress)
INT16 GetRgnBox16(HRGN16,LPRECT16);
INT32 GetRgnBox32(HRGN32,LPRECT32);
#define GetRgnBox WINELIB_NAME(GetRgnBox)
DWORD GetShortPathName32A(LPCSTR,LPSTR,DWORD);
DWORD GetShortPathName32W(LPCWSTR,LPWSTR,DWORD);
#define GetShortPathName WINELIB_NAME_AW(GetShortPathName)
UINT16 GetSystemDirectory16(LPSTR,UINT16);
UINT32 GetSystemDirectory32A(LPSTR,UINT32);
UINT32 GetSystemDirectory32W(LPWSTR,UINT32);
#define GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
UINT16 GetTempFileName16(BYTE,LPCSTR,UINT16,LPSTR);
UINT32 GetTempFileName32A(LPCSTR,LPCSTR,UINT32,LPSTR);
UINT32 GetTempFileName32W(LPCWSTR,LPCWSTR,UINT32,LPWSTR);
#define GetTempFileName WINELIB_NAME_AW(GetTempFileName)
UINT32 GetTempPath32A(UINT32,LPSTR);
UINT32 GetTempPath32W(UINT32,LPWSTR);
#define GetTempPath WINELIB_NAME_AW(GetTempPath)
@ -3511,6 +3650,9 @@ BOOL32 GetWindowPlacement32(HWND32,LPWINDOWPLACEMENT32);
void GetWindowRect16(HWND16,LPRECT16);
void GetWindowRect32(HWND32,LPRECT32);
#define GetWindowRect WINELIB_NAME(GetWindowRect)
HTASK16 GetWindowTask16(HWND16);
#define GetWindowTask32(hwnd) ((HTASK32)GetWindowThreadProcessId(hwnd,NULL))
#define GetWindowTask WINELIB_NAME(GetWindowTask)
INT16 GetWindowText16(HWND16,SEGPTR,INT16);
INT32 GetWindowText32A(HWND32,LPSTR,INT32);
INT32 GetWindowText32W(HWND32,LPWSTR,INT32);
@ -3570,9 +3712,38 @@ void InvalidateRect32(HWND32,const RECT32*,BOOL32);
void InvertRect16(HDC16,const RECT16*);
void InvertRect32(HDC32,const RECT32*);
#define InvertRect WINELIB_NAME(InvertRect)
BOOL16 IsCharAlpha16(CHAR);
BOOL32 IsCharAlpha32A(CHAR);
BOOL32 IsCharAlpha32W(WCHAR);
#define IsCharAlpha WINELIB_NAME_AW(IsCharAlpha)
BOOL16 IsCharAlphaNumeric16(CHAR);
BOOL32 IsCharAlphaNumeric32A(CHAR);
BOOL32 IsCharAlphaNumeric32W(WCHAR);
#define IsCharAlphaNumeric WINELIB_NAME_AW(IsCharAlphaNumeric)
BOOL16 IsCharLower16(CHAR);
BOOL32 IsCharLower32A(CHAR);
BOOL32 IsCharLower32W(WCHAR);
#define IsCharLower WINELIB_NAME_AW(IsCharLower)
BOOL16 IsCharUpper16(CHAR);
BOOL32 IsCharUpper32A(CHAR);
BOOL32 IsCharUpper32W(WCHAR);
#define IsCharUpper WINELIB_NAME_AW(IsCharUpper)
BOOL16 IsRectEmpty16(const RECT16*);
BOOL32 IsRectEmpty32(const RECT32*);
#define IsRectEmpty WINELIB_NAME(IsRectEmpty)
BOOL16 KillSystemTimer16(HWND16,UINT16);
BOOL32 KillSystemTimer32(HWND32,UINT32);
#define KillSystemTimer WINELIB_NAME(KillSystemTimer)
BOOL16 KillTimer16(HWND16,UINT16);
BOOL32 KillTimer32(HWND32,UINT32);
#define KillTimer WINELIB_NAME(KillTimer)
HFILE LZOpenFile16(LPCSTR,LPOFSTRUCT,UINT16);
HFILE LZOpenFile32A(LPCSTR,LPOFSTRUCT,UINT32);
HFILE LZOpenFile32W(LPCWSTR,LPOFSTRUCT,UINT32);
#define LZOpenFile WINELIB_NAME_AW(LZOpenFile)
INT16 LZRead16(HFILE,SEGPTR,UINT16);
INT32 LZRead32(HFILE,LPVOID,UINT32);
#define LZRead WINELIB_NAME(LZRead)
HMENU16 LoadMenuIndirect16(LPCVOID);
HMENU32 LoadMenuIndirect32A(LPCVOID);
HMENU32 LoadMenuIndirect32W(LPCVOID);
@ -3632,6 +3803,12 @@ BOOL32 MoveToEx32(HDC32,INT32,INT32,LPPOINT32);
INT16 MulDiv16(INT16,INT16,INT16);
INT32 MulDiv32(INT32,INT32,INT32);
#define MulDiv WINELIB_NAME(MulDiv)
BOOL32 OemToChar32A(LPSTR,LPSTR);
BOOL32 OemToChar32W(LPCSTR,LPWSTR);
#define OemToChar WINELIB_NAME_AW(OemToChar)
BOOL32 OemToCharBuff32A(LPSTR,LPSTR,DWORD);
BOOL32 OemToCharBuff32W(LPCSTR,LPWSTR,DWORD);
#define OemToCharBuff WINELIB_NAME_AW(OemToCharBuff)
void OffsetRect16(LPRECT16,INT16,INT16);
void OffsetRect32(LPRECT32,INT32,INT32);
#define OffsetRect WINELIB_NAME(OffsetRect)
@ -3785,6 +3962,12 @@ void SetRect32(LPRECT32,INT32,INT32,INT32,INT32);
void SetRectEmpty16(LPRECT16);
void SetRectEmpty32(LPRECT32);
#define SetRectEmpty WINELIB_NAME(SetRectEmpty)
UINT16 SetSystemTimer16(HWND16,UINT16,UINT16,TIMERPROC16);
UINT32 SetSystemTimer32(HWND32,UINT32,UINT32,TIMERPROC32);
#define SetSystemTimer WINELIB_NAME(SetSystemTimer)
UINT16 SetTimer16(HWND16,UINT16,UINT16,TIMERPROC16);
UINT32 SetTimer32(HWND32,UINT32,UINT32,TIMERPROC32);
#define SetTimer WINELIB_NAME(SetTimer)
BOOL16 SetViewportExtEx16(HDC16,INT16,INT16,LPSIZE16);
BOOL32 SetViewportExtEx32(HDC32,INT32,INT32,LPSIZE32);
#define SetViewportExtEx WINELIB_NAME(SetViewportExtEx)
@ -3831,6 +4014,22 @@ BOOL32 UnregisterClass32W(LPCWSTR,HINSTANCE32);
void ValidateRect16(HWND16,const RECT16*);
void ValidateRect32(HWND32,const RECT32*);
#define ValidateRect WINELIB_NAME(ValidateRect)
DWORD VerFindFile16(UINT16,LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT16*,LPSTR,UINT16*);
DWORD VerFindFile32A(UINT32,LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT32*,LPSTR,UINT32*);
DWORD VerFindFile32W(UINT32,LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT32*,LPWSTR,UINT32*);
#define VerFindFile WINELIB_NAME_AW(VerFindFile)
DWORD VerInstallFile16(UINT16,LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT16*);
DWORD VerInstallFile32A(UINT32,LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT32*);
DWORD VerInstallFile32W(UINT32,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT32*);
#define VerInstallFile WINELIB_NAME_AW(VerInstallFile)
DWORD VerLanguageName16(UINT16,LPSTR,UINT16);
DWORD VerLanguageName32A(UINT32,LPSTR,UINT32);
DWORD VerLanguageName32W(UINT32,LPWSTR,UINT32);
#define VerLanguageName WINELIB_NAME_AW(VerLanguageName)
DWORD VerQueryValue16(SEGPTR,LPCSTR,SEGPTR*,UINT16*);
DWORD VerQueryValue32A(LPVOID,LPCSTR,LPVOID*,UINT32*);
DWORD VerQueryValue32W(LPVOID,LPCWSTR,LPVOID*,UINT32*);
#define VerQueryValue WINELIB_NAME_AW(VerQueryValue)
HWND16 WindowFromPoint16(POINT16);
HWND32 WindowFromPoint32(POINT32);
#define WindowFromPoint WINELIB_NAME(WindowFromPoint)
@ -3862,14 +4061,6 @@ INT16 lstrlen16(LPCSTR);
INT32 lstrlen32A(LPCSTR);
INT32 lstrlen32W(LPCWSTR);
#define lstrlen WINELIB_NAME_AW(lstrlen)
INT16 lstrncmp16(LPCSTR,LPCSTR,INT16);
INT32 lstrncmp32A(LPCSTR,LPCSTR,INT32);
INT32 lstrncmp32W(LPCWSTR,LPCWSTR,INT32);
#define lstrncmp WINELIB_NAME_AW(lstrncmp)
INT16 lstrncmpi16(LPCSTR,LPCSTR,INT16);
INT32 lstrncmpi32A(LPCSTR,LPCSTR,INT32);
INT32 lstrncmpi32W(LPCWSTR,LPCWSTR,INT32);
#define lstrncmpi WINELIB_NAME_AW(lstrncmpi)
INT16 wsnprintf16(LPSTR,UINT16,LPCSTR,...);
INT32 wsnprintf32A(LPSTR,UINT32,LPCSTR,...);
INT32 wsnprintf32W(LPWSTR,UINT32,LPCWSTR,...);
@ -3887,6 +4078,15 @@ INT32 wvsprintf32A(LPSTR,LPCSTR,LPCVOID);
INT32 wvsprintf32W(LPWSTR,LPCWSTR,LPCVOID);
#define wvsprintf WINELIB_NAME_AW(wvsprintf)
/* Extra functions that don't exist in the Windows API */
INT32 lstrncmp32A(LPCSTR,LPCSTR,INT32);
INT32 lstrncmp32W(LPCWSTR,LPCWSTR,INT32);
INT32 lstrncmpi32A(LPCSTR,LPCSTR,INT32);
INT32 lstrncmpi32W(LPCWSTR,LPCWSTR,INT32);
LPWSTR lstrcpynAtoW(LPWSTR,LPCSTR,INT32);
LPSTR lstrcpynWtoA(LPSTR,LPCWSTR,INT32);
/* Library data types defined as a transition aid for the emulator. */
/* These should _not_ be used in the emulator and will be removed someday. */
@ -3958,7 +4158,7 @@ LPSTR AnsiLower(LPSTR);
UINT AnsiLowerBuff(LPSTR,UINT);
SEGPTR AnsiNext(SEGPTR);
SEGPTR AnsiPrev(SEGPTR,SEGPTR);
INT AnsiToOem(LPSTR,LPSTR);
INT AnsiToOem(LPCSTR,LPSTR);
void AnsiToOemBuff(LPCSTR,LPSTR,UINT);
LPSTR AnsiUpper(LPSTR);
UINT AnsiUpperBuff(LPSTR,UINT);
@ -3975,9 +4175,7 @@ LRESULT CallNextHookEx(HHOOK,INT,WPARAM,LPARAM);
INT Catch(LPCATCHBUF);
BOOL ChangeClipboardChain(HWND,HWND);
WORD ChangeSelector(WORD,WORD);
BOOL CheckDlgButton(HWND,INT,UINT);
INT CheckMenuItem(HMENU,UINT,UINT);
BOOL CheckRadioButton(HWND,UINT,UINT,UINT);
BOOL Chord(HDC,INT,INT,INT,INT,INT,INT,INT,INT);
int ClearCommBreak(int);
BOOL CloseClipboard(void);
@ -3986,18 +4184,10 @@ HMETAFILE CloseMetaFile(HDC);
void CloseSound(void);
BOOL CloseWindow(HWND);
int ConvertRequest(HWND,LPKANJISTRUCT);
#ifdef WINELIB32
HCURSOR CopyCursor(HCURSOR); /* Win32 */
HICON CopyIcon(HICON); /* Win32 */
#else
HCURSOR CopyCursor(HINSTANCE,HCURSOR); /* Win16 */
HICON CopyIcon(HINSTANCE,HICON); /* Win16 */
#endif
HMETAFILE CopyMetaFile(HMETAFILE,LPCSTR);
INT CountClipboardFormats(void);
INT CountVoiceNotes(INT);
HBRUSH CreateBrushIndirect(const LOGBRUSH16*);
BOOL CreateCaret(HWND,HBITMAP,INT,INT);
HDC CreateCompatibleDC(HDC);
HCURSOR CreateCursor(HANDLE,INT,INT,INT,INT,const BYTE*,const BYTE*);
HANDLE CreateCursorIconIndirect(HANDLE,CURSORICONINFO*,const BYTE*,const BYTE*);
@ -4005,7 +4195,6 @@ HDC CreateDC(LPCSTR,LPCSTR,LPCSTR,const DEVMODE*);
HBRUSH CreateDIBPatternBrush(HGLOBAL,UINT);
HBITMAP CreateDIBitmap(HDC,BITMAPINFOHEADER*,DWORD,LPVOID,BITMAPINFO*,UINT);
HFONT CreateFont(INT,INT,INT,INT,INT,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,LPCSTR);
HFONT CreateFontIndirect(const LOGFONT16*);
HBRUSH CreateHatchBrush(INT,COLORREF);
HDC CreateIC(LPCSTR,LPCSTR,LPCSTR,const DEVMODE*);
HICON CreateIcon(HINSTANCE,INT,INT,BYTE,BYTE,const BYTE*,const BYTE*);
@ -4025,7 +4214,6 @@ BOOL DeleteDC(HDC);
BOOL DeleteMenu(HMENU,UINT,UINT);
BOOL DeleteMetaFile(HMETAFILE);
BOOL DeleteObject(HGDIOBJ16);
BOOL DestroyCaret(void);
BOOL DestroyCursor(HCURSOR);
BOOL DestroyIcon(HICON);
BOOL DestroyMenu(HMENU);
@ -4059,7 +4247,6 @@ LONG EscapeCommFunction(int,int);
int ExcludeClipRect(HDC,short,short,short,short);
int ExcludeVisRect(HDC,short,short,short,short);
BOOL ExitWindows(DWORD,WORD);
BOOL ExtFloodFill(HDC,INT,INT,COLORREF,WORD);
HICON ExtractIcon(HINSTANCE,LPCSTR,WORD);
HANDLE16 FarGetOwner(HANDLE16);
void FarSetOwner(HANDLE16,HANDLE16);
@ -4070,7 +4257,6 @@ ATOM FindAtom(SEGPTR);
HINSTANCE FindExecutable(LPCSTR,LPCSTR,LPSTR);
HRSRC FindResource(HINSTANCE,SEGPTR,SEGPTR);
BOOL FlashWindow(HWND,BOOL);
BOOL FloodFill(HDC,INT,INT,COLORREF);
int FlushComm(int,int);
BOOL FrameRgn(HDC,HRGN,HBRUSH,int,int);
void FreeLibrary(HANDLE);
@ -4086,7 +4272,6 @@ COLORREF GetBkColor(HDC);
WORD GetBkMode(HDC);
DWORD GetBrushOrg(HDC);
HWND GetCapture(void);
WORD GetCaretBlinkTime(void);
BOOL GetCharABCWidths(HDC,UINT,UINT,LPABC16);
BOOL GetCharWidth(HDC,WORD,WORD,LPINT16);
HRGN GetClipRgn(HDC);
@ -4115,7 +4300,6 @@ HWND GetDesktopHwnd(void);
HWND GetDesktopWindow(void);
int GetDeviceCaps(HDC,WORD);
DWORD GetDialogBaseUnits(void);
int GetDlgCtrlID(HWND);
HWND GetDlgItem(HWND,WORD);
WORD GetDlgItemInt(HWND,WORD,BOOL*,BOOL);
WORD GetDoubleClickTime(void);
@ -4165,7 +4349,6 @@ WORD GetPolyFillMode(HDC);
int GetPriorityClipboardFormat(WORD*,short);
UINT GetPrivateProfileInt(LPCSTR,LPCSTR,INT,LPCSTR);
INT GetPrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPSTR,INT,LPCSTR);
FARPROC GetProcAddress(HANDLE,SEGPTR);
UINT GetProfileInt(LPCSTR,LPCSTR,INT);
INT GetProfileString(LPCSTR,LPCSTR,LPCSTR,LPSTR,INT);
HANDLE GetProp(HWND,SEGPTR);
@ -4189,10 +4372,7 @@ WORD GetSystemPaletteUse(HDC);
BOOL GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
VOID GetSystemTime(LPSYSTEMTIME); /* Win32 */
DWORD GetTabbedTextExtent(HDC,LPSTR,int,int,LPINT16);
HINSTANCE GetTaskDS(void);
HQUEUE GetTaskQueue(HTASK);
BYTE GetTempDrive(BYTE);
INT GetTempFileName(BYTE,LPCSTR,UINT,LPSTR);
WORD GetTextAlign(HDC);
short GetTextCharacterExtra(HDC);
COLORREF GetTextColor(HDC);
@ -4200,7 +4380,6 @@ DWORD GetTextExtent(HDC,LPCSTR,short);
INT GetTextFace(HDC,INT,LPSTR);
LPINT16 GetThresholdEvent(void);
int GetThresholdStatus(void);
DWORD GetTickCount(void);
HWND GetTopWindow(HWND);
LONG GetVersion(void);
DWORD GetViewportExt(HDC);
@ -4211,7 +4390,6 @@ HWND GetWindow(HWND,WORD);
HDC GetWindowDC(HWND);
DWORD GetWindowExt(HDC);
DWORD GetWindowOrg(HDC);
HANDLE GetWindowTask(HWND);
int GetWindowTextLength(HWND);
UINT GetWindowsDirectory(LPSTR,UINT);
DWORD GlobalDOSAlloc(DWORD);
@ -4228,7 +4406,6 @@ BOOL16 GlobalUnWire(HGLOBAL16);
void GlobalUnfix(HGLOBAL16);
SEGPTR GlobalWire(HGLOBAL16);
BOOL GrayString(HDC,HBRUSH,FARPROC,LPARAM,INT,INT,INT,INT,INT);
void HideCaret(HWND);
BOOL HiliteMenuItem(HWND,HMENU,UINT,UINT);
BOOL InSendMessage(void);
WORD InitAtomTable(WORD);
@ -4243,10 +4420,6 @@ BOOL IsBadHugeWritePtr(SEGPTR,DWORD);
BOOL IsBadReadPtr(SEGPTR,WORD);
BOOL IsBadStringPtr(SEGPTR,WORD);
BOOL IsBadWritePtr(SEGPTR,WORD);
BOOL IsCharAlpha(char);
BOOL IsCharAlphaNumeric(char);
BOOL IsCharLower(char);
BOOL IsCharUpper(char);
BOOL IsChild(HWND,HWND);
BOOL IsClipboardFormatAvailable(WORD);
BOOL IsDialogMessage(HWND,LPMSG16);
@ -4256,13 +4429,9 @@ BOOL IsIconic(HWND);
BOOL IsMenu(HMENU);
BOOL IsTask(HTASK);
HTASK IsTaskLocked(void);
BOOL IsWindow(HWND);
BOOL IsWindowEnabled(HWND);
BOOL IsWindowUnicode(HWND);
BOOL IsWindowVisible(HWND);
BOOL IsZoomed(HWND);
BOOL KillSystemTimer(HWND,WORD);
BOOL KillTimer(HWND,WORD);
void LimitEmsPages(DWORD);
void LineDDA(short,short,short,short,FARPROC,long);
BOOL LineTo(HDC,short,short);
@ -4284,12 +4453,11 @@ int MessageBox(HWND,LPCSTR,LPCSTR,WORD);
DWORD MoveTo(HDC,short,short);
BOOL MoveWindow(HWND,short,short,short,short,BOOL);
DWORD OemKeyScan(WORD);
BOOL OemToAnsi(LPSTR,LPSTR);
void OemToAnsiBuff(LPSTR,LPSTR,INT);
BOOL OemToAnsi(LPCSTR,LPSTR);
void OemToAnsiBuff(LPCSTR,LPSTR,INT);
int OffsetClipRgn(HDC,short,short);
BOOL OpenClipboard(HWND);
int OpenComm(LPCSTR,UINT,UINT);
HFILE OpenFile(LPCSTR,OFSTRUCT*,UINT);
BOOL OpenIcon(HWND);
int OpenSound(void);
void OutputDebugString(LPCSTR);
@ -4344,8 +4512,6 @@ DWORD SetBkColor(HDC,COLORREF);
WORD SetBkMode(HDC,WORD);
DWORD SetBrushOrg(HDC,short,short);
HWND SetCapture(HWND);
void SetCaretBlinkTime(WORD);
void SetCaretPos(short,short);
HANDLE SetClipboardData(WORD,HANDLE);
HWND SetClipboardViewer(HWND);
int SetCommBreak(int);
@ -4393,13 +4559,11 @@ HWND SetSysModalWindow(HWND);
WORD SetSystemPaletteUse(HDC,WORD);
BOOL SetSystemPowerState(BOOL, BOOL);
BOOL SetSystemTime(const SYSTEMTIME*);
WORD SetSystemTimer(HWND,WORD,WORD,FARPROC);
HQUEUE SetTaskQueue(HTASK,HQUEUE);
WORD SetTextAlign(HDC,WORD);
short SetTextCharacterExtra(HDC,short);
DWORD SetTextColor(HDC,DWORD);
short SetTextJustification(HDC,short,short);
WORD SetTimer(HWND,WORD,WORD,FARPROC);
int SetVoiceAccent(int,int,int,int,int);
int SetVoiceEnvelope(int,int,int);
int SetVoiceNote(int,int,int,int);
@ -4411,7 +4575,6 @@ BOOL SetWindowPos(HWND,HWND,INT,INT,INT,INT,WORD);
FARPROC SetWindowsHook(short,FARPROC);
HHOOK SetWindowsHookEx(short,HOOKPROC,HINSTANCE,HTASK);
HINSTANCE ShellExecute(HWND,LPCSTR,LPCSTR,LPSTR,LPCSTR,INT);
void ShowCaret(HWND);
int ShowCursor(BOOL);
void ShowOwnedPopups(HWND,BOOL);
void ShowScrollBar(HWND,WORD,BOOL);
@ -4460,10 +4623,7 @@ BOOL WriteProfileString(LPCSTR,LPCSTR,LPCSTR);
void Yield(void);
LONG _hread(HFILE,SEGPTR,LONG);
LONG _hwrite(HFILE,LPCSTR,LONG);
HFILE _lclose(HFILE);
HFILE _lcreat(LPCSTR,INT);
LONG _llseek(HFILE,LONG,INT);
HFILE _lopen(LPCSTR,INT);
INT _lread(HFILE,SEGPTR,WORD);
INT _lwrite(HFILE,LPCSTR,WORD);

View File

@ -1,75 +0,0 @@
#ifndef __WINE_WINE_H
#define __WINE_WINE_H
#ifdef i386
extern int runtime_cpu (void);
#else
static inline int runtime_cpu(void) { return 3; }
#endif
#ifndef WINELIB
#ifdef linux
typedef struct
{
unsigned short sc_gs, __gsh;
unsigned short sc_fs, __fsh;
unsigned short sc_es, __esh;
unsigned short sc_ds, __dsh;
unsigned long sc_edi;
unsigned long sc_esi;
unsigned long sc_ebp;
unsigned long sc_esp;
unsigned long sc_ebx;
unsigned long sc_edx;
unsigned long sc_ecx;
unsigned long sc_eax;
unsigned long sc_trapno;
unsigned long sc_err;
unsigned long sc_eip;
unsigned short sc_cs, __csh;
unsigned long sc_eflags;
unsigned long esp_at_signal;
unsigned short sc_ss, __ssh;
unsigned long i387;
unsigned long oldmask;
unsigned long cr2;
} SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x2b
#define WINE_CODE_SELECTOR 0x23
#endif /* linux */
#ifdef __NetBSD__
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x1f
#define WINE_CODE_SELECTOR 0x17
#endif /* NetBSD */
#if defined(__svr4__) || defined(_SCO_DS)
#include <signal.h>
#ifdef _SCO_DS
#include <sys/regset.h>
#endif
#include <sys/ucontext.h>
typedef struct ucontext SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x1f
#define WINE_CODE_SELECTOR 0x17
#endif /* svr4 || SCO_DS */
#ifdef __FreeBSD__
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x27
#define WINE_CODE_SELECTOR 0x1f
#endif /* FreeBSD */
#else /* WINELIB */
typedef void SIGCONTEXT;
#define WINE_DATA_SELECTOR 0x00
#define WINE_CODE_SELECTOR 0x00
#endif /* WINELIB */
#endif /* __WINE_WINE_H */

View File

@ -26,4 +26,33 @@ extern BOOL32 WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC16 func,
extern void WINPROC_FreeProc( HWINDOWPROC proc );
extern WINDOWPROCTYPE WINPROC_GetProcType( HWINDOWPROC proc );
extern INT32 WINPROC_MapMsg32ATo32W( UINT32 msg, WPARAM32 wParam,
LPARAM *plparam );
extern INT32 WINPROC_MapMsg32WTo32A( UINT32 msg, WPARAM32 wParam,
LPARAM *plparam );
extern INT32 WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16,
UINT32 *pmsg32, WPARAM32 *pwparam32,
LPARAM *plparam );
extern INT32 WINPROC_MapMsg16To32W( UINT16 msg16, WPARAM16 wParam16,
UINT32 *pmsg32, WPARAM32 *pwparam32,
LPARAM *plparam );
extern INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32,
UINT16 *pmsg16, WPARAM16 *pwparam16,
LPARAM *plparam );
extern INT32 WINPROC_MapMsg32WTo16( UINT32 msg32, WPARAM32 wParam32,
UINT16 *pmsg16, WPARAM16 *pwparam16,
LPARAM *plparam );
extern void WINPROC_UnmapMsg32ATo32W( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg32WTo32A( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg16To32W( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg32ATo16( UINT16 msg, WPARAM16 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg32WTo16( UINT16 msg, WPARAM16 wParam,
LPARAM lParam );
#endif /* __WINE_WINPROC_H */

View File

@ -151,23 +151,17 @@ DECLARE_HANDLE(HWND);
/* Callback function pointers types for Win16. */
#ifdef WINELIB
typedef LRESULT (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef LRESULT (*FARPROC16)();
typedef VOID (*TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
typedef LRESULT (*WNDENUMPROC16)(HWND16,LPARAM);
typedef LRESULT (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
#else
/* Function pointers are SEGPTR in Win16 */
typedef SEGPTR DLGPROC16;
typedef SEGPTR FARPROC16;
typedef SEGPTR WNDENUMPROC16;
typedef SEGPTR WNDPROC16;
#endif
/* Callback function pointers types for Win32. */
typedef LRESULT (*DLGPROC32)(HWND32,UINT32,WPARAM32,LPARAM);
typedef LRESULT (*FARPROC32)();
typedef VOID (*TIMERPROC32)(HWND32,UINT32,UINT32,DWORD);
typedef LRESULT (*WNDENUMPROC32)(HWND32,LPARAM);
typedef LRESULT (*WNDPROC32)(HWND32,UINT32,WPARAM32,LPARAM);

View File

@ -44,7 +44,6 @@ int CallTo32_LargeStack( int (*func)(), int nbargs, ...)
WORD CallTo16_word_ ( FARPROC func, WORD arg ) { return func(arg); }
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT CARET_Callback(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ColorDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboBoxWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ComboLBoxWndProc(HWND,UINT,WPARAM,LPARAM);
@ -78,7 +77,6 @@ WNDPROC MODULE_GetWndProcEntry16( char *name )
{
#define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return proc
MAP_STR_TO_PROC("AboutDlgProc",AboutDlgProc);
MAP_STR_TO_PROC("CARET_Callback",CARET_Callback);
MAP_STR_TO_PROC("ColorDlgProc",ColorDlgProc);
MAP_STR_TO_PROC("ComboBoxWndProc",ComboBoxWndProc);
MAP_STR_TO_PROC("ComboLBoxWndProc",ComboLBoxWndProc);

View File

@ -2,7 +2,6 @@
#include <unistd.h>
#include "windows.h"
#include "callback.h"
#include "wine.h"
#include "arch.h"
#include "neexe.h"

View File

@ -1,7 +1,6 @@
/* Sample winestub.c file for compiling programs with libwine.so. */
#include "windows.h"
#include "wine.h"
#ifdef WIN_DEBUG
#include <stdio.h>
#endif

View File

@ -2,7 +2,6 @@
#include <string.h>
#include <malloc.h>
#include "windows.h"
#include "wine.h"
#include "xmalloc.h"
extern int MAIN_Init(void);
@ -31,9 +30,6 @@ int _WinMain (int argc, char *argv [])
hInstance = WinExec( *argv, SW_SHOWNORMAL );
TASK_Reschedule();
USER_InitApp( hInstance );
/* Perform global initialisations that need a task context */
if (!WIDGETS_Init()) return -1;
if (!WIN_CreateDesktopWindow()) return -1;
#ifdef WINELIBDLL
return (int)hInstance;

View File

@ -59,7 +59,6 @@ typedef struct
#define DLL_FLAG_ALWAYS_USED 0x02 /* Always use built-in DLL */
#define DLL_FLAG_WIN32 0x04 /* DLL is a Win32 DLL */
/* 16-bit DLLs */
extern const DLL_DESCRIPTOR KERNEL_Descriptor;
@ -146,7 +145,7 @@ static BUILTIN_DLL BuiltinDLLs[] =
{ &ADVAPI32_Descriptor, 0 },
{ &COMCTL32_Descriptor, 0 },
{ &COMDLG32_Descriptor, 0 },
{ &CRTDLL_Descriptor, 0 },
{ &CRTDLL_Descriptor, 0 },
{ &OLE32_Descriptor, 0 },
{ &GDI32_Descriptor, 0 },
{ &KERNEL32_Descriptor, DLL_FLAG_ALWAYS_USED },
@ -230,6 +229,7 @@ HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL16 force )
if (pModule->flags & NE_FFLAGS_WIN32)
{
pModule->pe_module = (PE_MODULE *)table;
table->flags |= DLL_FLAG_WIN32;
}
else /* Win16 module */
{
@ -265,13 +265,14 @@ HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL16 force )
/***********************************************************************
* BUILTIN_GetEntryPoint
* BUILTIN_GetEntryPoint16
*
* Return the built-in module, ordinal and name corresponding
* to a CS:IP address. This is used only by relay debugging.
* Return the ordinal and name corresponding to a CS:IP address.
* This is used only by relay debugging.
*/
NE_MODULE *BUILTIN_GetEntryPoint( WORD cs, WORD ip, WORD *pOrd, char **ppName )
LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
{
static char buffer[80];
WORD ordinal, i, max_offset;
register BYTE *p;
NE_MODULE *pModule;
@ -324,18 +325,62 @@ NE_MODULE *BUILTIN_GetEntryPoint( WORD cs, WORD ip, WORD *pOrd, char **ppName )
/* (built-in modules have no non-resident table) */
p = (BYTE *)pModule + pModule->name_table;
*ppName = "???";
while (*p)
{
p += *p + 1 + sizeof(WORD);
if (*(WORD *)(p + *p + 1) == *pOrd)
{
*ppName = (char *)p;
break;
}
if (*(WORD *)(p + *p + 1) == *pOrd) break;
}
return pModule;
sprintf( buffer, "%.*s.%d: %.*s",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
*pOrd, *p, (char *)(p + 1) );
return buffer;
}
/***********************************************************************
* BUILTIN_GetEntryPoint32
*
* Return the name of the DLL entry point corresponding
* to a relay entry point address. This is used only by relay debugging.
*/
LPCSTR BUILTIN_GetEntryPoint32( void *relay )
{
static char buffer[80];
BUILTIN_DLL *dll;
const void **funcs;
int first, i, size;
/* First find the module */
for (dll = BuiltinDLLs; dll->descr; dll++)
if ((dll->flags & DLL_FLAG_WIN32) &&
(dll->descr->u.win32.functions[0] <= relay) &&
(dll->descr->u.win32.functions[dll->descr->u.win32.size-1] >relay))
break;
if (!dll->descr)
{
sprintf( buffer, "???.???: %08x", (UINT32)relay );
return buffer;
}
/* Do a binary search for the function */
relay = (BYTE *)relay - 11; /* The relay entry point is 11 bytes long */
funcs = dll->descr->u.win32.functions;
first = i = 0;
size = dll->descr->u.win32.size;
while (first < size)
{
i = (first + size) / 2;
if (funcs[i] == relay) break;
if (funcs[i] > relay) size = i;
else first = i + 1;
}
sprintf( buffer, "%s.%d: %s",
dll->descr->name, i, dll->descr->u.win32.names[i] );
return buffer;
}
@ -345,12 +390,12 @@ NE_MODULE *BUILTIN_GetEntryPoint( WORD cs, WORD ip, WORD *pOrd, char **ppName )
* Implementation of GetProcAddress() for built-in Win32 modules.
* FIXME: this should be unified with the real GetProcAddress32().
*/
DWORD BUILTIN_GetProcAddress32( NE_MODULE *pModule, char *function )
FARPROC32 BUILTIN_GetProcAddress32( NE_MODULE *pModule, LPCSTR function )
{
BUILTIN_DLL *dll = (BUILTIN_DLL *)pModule->pe_module;
const WIN32_DESCRIPTOR *info = &dll->descr->u.win32;
if (!dll) return 0;
if (!dll) return NULL;
if (HIWORD(function)) /* Find function by name */
{
@ -360,7 +405,7 @@ DWORD BUILTIN_GetProcAddress32( NE_MODULE *pModule, char *function )
function, dll->descr->name );
for (i = 0; i < info->size; i++)
if (info->names[i] && !strcmp( function, info->names[i] ))
return (DWORD)info->functions[i];
return (FARPROC32)info->functions[i];
}
else /* Find function by ordinal */
{
@ -368,9 +413,9 @@ DWORD BUILTIN_GetProcAddress32( NE_MODULE *pModule, char *function )
dprintf_module( stddeb, "Looking for ordinal %d in %s\n",
ordinal, dll->descr->name );
if (ordinal && ordinal < info->size)
return (DWORD)info->functions[ordinal - info->base];
return (FARPROC32)info->functions[ordinal - info->base];
}
return 0;
return NULL;
}

View File

@ -40,7 +40,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "stddebug.h"
#include "debug.h"
void init_wine_signals(void);
HANDLE32 SystemHeap = 0;
HANDLE32 SegptrHeap = 0;
@ -50,7 +49,9 @@ HANDLE32 SegptrHeap = 0;
*/
int MAIN_Init(void)
{
extern BOOL RELAY_Init(void);
extern BOOL32 RELAY_Init(void);
extern BOOL32 SIGNAL_Init(void);
extern BOOL32 WIDGETS_Init(void);
int queueSize;
@ -61,9 +62,6 @@ int MAIN_Init(void)
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return 0;
/* Initialize message spying */
if (!SPY_Init()) return 0;
#ifdef WINELIB
/* Create USER and GDI heap */
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 0x10000 );
@ -71,12 +69,24 @@ int MAIN_Init(void)
GDI_HeapSel = GlobalAlloc16( GMEM_FIXED, GDI_HEAP_SIZE );
LocalInit( GDI_HeapSel, 0, GDI_HEAP_SIZE-1 );
#else
/* Initialize relay code */
/* Initialize relay code */
if (!RELAY_Init()) return 0;
/* Create built-in modules */
/* Create built-in modules */
if (!BUILTIN_Init()) return 0;
#endif
/* Initialize interrupt vectors */
if (!INT_Init()) return 0;
/* Initialize DOS memory */
if (!DOSMEM_Init()) return 0;
/* Initialize the DOS interrupt */
if (!INT21_Init()) return 0;
/* Initialize signal handling */
if (!SIGNAL_Init()) return 0;
#endif /* WINELIB */
/* Initialise DOS drives */
if (!DRIVE_Init()) return 0;
@ -90,19 +100,6 @@ int MAIN_Init(void)
/* Initialize communications */
COMM_Init();
#ifndef WINELIB
/* Initialize interrupt vectors */
if (!INT_Init()) return 0;
/* Initialize DOS memory */
if (!DOSMEM_Init()) return 0;
/* Initialize signal handling */
init_wine_signals();
/* Initialize the DOS memory */
if (!INT21_Init()) return 0;
#endif
/* registry initialisation */
SHELL_LoadRegistry();
@ -122,12 +119,21 @@ int MAIN_Init(void)
/* Initialize window procedures */
if (!WINPROC_Init()) return 0;
/* Initialize built-in window classes */
if (!WIDGETS_Init()) return 0;
/* Initialize dialog manager */
if (!DIALOG_Init()) return 0;
/* Initialize menus */
if (!MENU_Init()) return 0;
/* Create desktop window */
if (!WIN_CreateDesktopWindow()) return 0;
/* Initialize message spying */
if (!SPY_Init()) return 0;
/* Initialize Win32 data structures */
if (!KERN32_Init()) return 0;

View File

@ -19,14 +19,13 @@
#include "ldt.h"
#include "module.h"
#include "neexe.h"
#include "registers.h"
#include "stackframe.h"
#include "task.h"
#include "toolhelp.h"
#include "stddebug.h"
#include "debug.h"
#include "callback.h"
#include "wine.h"
extern HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params );
@ -663,7 +662,7 @@ WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name )
*
* Return the entry point for a given ordinal.
*/
SEGPTR MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
@ -704,7 +703,7 @@ SEGPTR MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
if (sel == 0xfe) sel = 0xffff; /* constant entry */
else sel = (WORD)(DWORD)NE_SEG_TABLE(pModule)[sel-1].selector;
return PTR_SEG_OFF_TO_SEGPTR( sel, offset );
return (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( sel, offset );
}
@ -1403,12 +1402,12 @@ HANDLE WinExec( LPSTR lpCmdLine, WORD nCmdShow )
/***********************************************************************
* GetProcAddress (KERNEL.50)
* GetProcAddress16 (KERNEL.50)
*/
FARPROC GetProcAddress( HANDLE hModule, SEGPTR name )
FARPROC16 GetProcAddress16( HMODULE16 hModule, SEGPTR name )
{
WORD ordinal;
SEGPTR ret;
FARPROC16 ret;
if (!hModule) hModule = GetCurrentTask();
hModule = GetExePtr( hModule );
@ -1425,12 +1424,34 @@ FARPROC GetProcAddress( HANDLE hModule, SEGPTR name )
dprintf_module( stddeb, "GetProcAddress: %04x %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC)0;
if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
dprintf_module( stddeb, "GetProcAddress: returning %08lx\n", (DWORD)ret );
return (FARPROC)ret;
dprintf_module( stddeb, "GetProcAddress: returning %08x\n", (UINT32)ret );
return ret;
}
/***********************************************************************
* GetProcAddress32 (KERNEL32.257)
*/
FARPROC32 GetProcAddress32( HMODULE32 hModule, LPCSTR function )
{
#ifndef WINELIB
NE_MODULE *pModule;
hModule = GetExePtr( hModule );
if (!(pModule = MODULE_GetPtr( hModule )))
return (FARPROC32)0;
if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module)
return (FARPROC32)0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return BUILTIN_GetProcAddress32( pModule, function );
return PE_FindExportedFunction( pModule->pe_module, function );
#else
return NULL;
#endif
}

View File

@ -37,7 +37,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
WORD *pModuleTable;
WORD count, i, offset;
HMODULE module;
DWORD address;
FARPROC16 address;
int fd;
struct relocation_entry_s *rep, *reloc_entries;
BYTE *func_name;
@ -242,7 +242,7 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
}
else
{
address = PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
}
dprintf_fixup(stddeb,"%d: %04x:%04x\n",
@ -288,9 +288,9 @@ BOOL NE_LoadSegment( HMODULE hModule, WORD segnum )
pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp;
if(additive)
*(unsigned char*)sp = (unsigned char)((address+offset) & 0xFF);
*(unsigned char*)sp = (unsigned char)(((int)address+offset) & 0xFF);
else
*(unsigned char*)sp = (unsigned char)(address & 0xFF);
*(unsigned char*)sp = (unsigned char)((int)address & 0xFF);
}
while (offset != 0xffff && !additive);
break;

View File

@ -101,7 +101,7 @@ void dump_exports(struct PE_Export_Directory * pe_exports, unsigned int load_add
}
}
static DWORD PE_FindExportedFunction(struct pe_data *pe, char* funcName)
FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
{
struct PE_Export_Directory * exports = pe->pe_export;
unsigned load_addr = pe->load_addr;
@ -109,7 +109,8 @@ static DWORD PE_FindExportedFunction(struct pe_data *pe, char* funcName)
u_long * function;
u_char ** name, *ename;
int i;
if(!exports)return 0;
if (!exports) return NULL;
ordinal = (u_short *) (((char *) load_addr) + (int) exports->Address_Of_Name_Ordinals);
function = (u_long *) (((char *) load_addr) + (int) exports->AddressOfFunctions);
name = (u_char **) (((char *) load_addr) + (int) exports->AddressOfNames);
@ -119,27 +120,16 @@ static DWORD PE_FindExportedFunction(struct pe_data *pe, char* funcName)
{
ename = (char *) (((char *) load_addr) + (int) *name);
if(strcmp(ename,funcName)==0)
return load_addr+*function;
return (FARPROC32)(load_addr + *function);
}else{
if(funcName == (int)*ordinal + exports->Base)
return load_addr+*function;
return (FARPROC32)(load_addr + *function);
}
function++;
ordinal++;
name++;
}
return 0;
}
DWORD PE_GetProcAddress(HMODULE hModule, char* function)
{
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module) return 0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return BUILTIN_GetProcAddress32( pModule, function );
return PE_FindExportedFunction( pModule->pe_module, function );
return NULL;
}
void fixup_imports(struct pe_data *pe, HMODULE hModule)
@ -211,24 +201,24 @@ void fixup_imports(struct pe_data *pe, HMODULE hModule)
{
int ordinal=*import_list & (0x80000000-1);
dprintf_win32(stddeb,"--- Ordinal %s,%d\n", Module, ordinal);
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
ordinal);
*thunk_list = GetProcAddress32(MODULE_FindModule(Module),
(LPCSTR)ordinal);
if(!*thunk_list)
{
fprintf(stderr,"No implementation for %s.%d\n",Module,
ordinal);
fixup_failed=1;
fprintf(stderr,"No implementation for %s.%d, setting to NULL\n",
Module, ordinal);
/* fixup_failed=1; */
}
}else{ /* import by name */
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
pe_name->Name);
*thunk_list = GetProcAddress32(MODULE_FindModule(Module),
pe_name->Name);
if(!*thunk_list)
{
fprintf(stderr,"No implementation for %s.%d(%s)\n",Module,
pe_name->Hint, pe_name->Name);
fixup_failed=1;
fprintf(stderr,"No implementation for %s.%d(%s), setting to NULL\n",
Module, pe_name->Hint, pe_name->Name);
/* fixup_failed=1; */
}
#else
@ -251,15 +241,15 @@ void fixup_imports(struct pe_data *pe, HMODULE hModule)
}
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
/* FIXME: Both calls should be unified into GetProcAddress */
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
pe_name->Name);
*thunk_list = GetProcAddress32(MODULE_FindModule(Module),
pe_name->Name);
#else
fprintf(stderr,"JBP: Call to RELAY32_GetEntryPoint being ignored.\n");
#endif
if(!*thunk_list) {
fprintf(stderr,"No implementation for %s.%d\n",Module, pe_name->Hint);
fixup_failed=1;
fprintf(stderr,"No implementation for %s.%d, setting to NULL\n",
Module, pe_name->Hint);
/* fixup_failed=1; */
}
thunk_list++;
}
@ -533,7 +523,7 @@ static struct pe_data *PE_LoadImage( int fd, HMODULE hModule, WORD offset )
}
HINSTANCE MODULE_CreateInstance(HMODULE hModule,LOADPARAMS *params);
void InitTask(SIGCONTEXT context);
void InitTask( SIGCONTEXT *context );
HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
{
@ -644,18 +634,18 @@ HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
int USER_InitApp(HINSTANCE hInstance);
void PE_InitTEB(int hTEB);
void PE_Win32CallToStart(SIGCONTEXT context)
void PE_Win32CallToStart( SIGCONTEXT *context )
{
int fs;
HMODULE hModule;
NE_MODULE *pModule;
dprintf_win32(stddeb,"Going to start Win32 program\n");
InitTask(context);
InitTask( &context );
hModule = GetExePtr( GetCurrentTask() );
pModule = MODULE_GetPtr( hModule );
USER_InitApp( hModule );
fs=(int)GlobalAlloc16(GHND,0x10000);
fs=(int)GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, 0x10000 );
PE_InitTEB(fs);
__asm__ __volatile__("movw %w0,%%fs"::"r" (fs));
CallTaskStart32( (FARPROC)(pModule->pe_module->load_addr +

View File

@ -168,9 +168,9 @@ extern void stop_wait(int a);
/**********************************************************************
* init_wine_signals
* SIGNAL_Init
*/
void init_wine_signals(void)
BOOL32 SIGNAL_Init(void)
{
#if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigaltstack ss;
@ -178,13 +178,13 @@ void init_wine_signals(void)
if ((ss.ss_sp = malloc(MINSIGSTKSZ)) == NULL) {
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
MINSIGSTKSZ);
exit(1);
return FALSE;
}
ss.ss_size = MINSIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
perror("sigstack");
exit(1);
return FALSE;
}
#endif /* __FreeBSD__ || __NetBSD__ */
@ -194,13 +194,13 @@ void init_wine_signals(void)
if ((ss.ss_sp = malloc(SIGSTKSZ) ) == NULL) {
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
SIGSTKSZ);
exit(1);
return FALSE;
}
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
perror("sigstack");
exit(1);
return FALSE;
}
#endif /* __svr4__ || _SCO_DS */
@ -216,6 +216,7 @@ void init_wine_signals(void)
#ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */
#endif
return TRUE;
}

View File

@ -468,7 +468,7 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance,
pTask->pdb.int20 = 0x20cd;
#ifndef WINELIB
pTask->pdb.dispatcher[0] = 0x9a; /* ljmp */
*(DWORD *)&pTask->pdb.dispatcher[1] = MODULE_GetEntryPoint( GetModuleHandle("KERNEL"), 102 ); /* KERNEL.102 is DOS3Call() */
*(FARPROC16 *)&pTask->pdb.dispatcher[1] = MODULE_GetEntryPoint( GetModuleHandle("KERNEL"), 102 ); /* KERNEL.102 is DOS3Call() */
pTask->pdb.savedint22 = INT_GetHandler( 0x22 );
pTask->pdb.savedint23 = INT_GetHandler( 0x23 );
pTask->pdb.savedint24 = INT_GetHandler( 0x24 );
@ -766,10 +766,9 @@ void TASK_Reschedule(void)
#ifdef WINELIB
void InitTask(void)
#else
void InitTask( SIGCONTEXT context )
void InitTask( SIGCONTEXT *context )
#endif
{
static int firstTask = 1;
TDB *pTask;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
@ -777,27 +776,11 @@ void InitTask( SIGCONTEXT context )
LONG stacklow, stackhi;
#ifndef WINELIB
EAX_reg(&context) = 0;
EAX_reg(context) = 0;
#endif
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pModule = MODULE_GetPtr( pTask->hModule ))) return;
if (firstTask)
{
extern BOOL WIDGETS_Init(void);
extern BOOL WIN_CreateDesktopWindow(void);
/* Perform global initialisations that need a task context */
/* Initialize built-in window classes */
if (!WIDGETS_Init()) return;
/* Create desktop window */
if (!WIN_CreateDesktopWindow()) return;
firstTask = 0;
}
#ifndef WINELIB
NE_InitializeDLLs( pTask->hModule );
@ -809,13 +792,13 @@ void InitTask( SIGCONTEXT context )
* di instance handle of the new task
* es:bx pointer to command-line inside PSP
*/
EAX_reg(&context) = 1;
EBX_reg(&context) = 0x81;
ECX_reg(&context) = pModule->stack_size;
EDX_reg(&context) = pTask->nCmdShow;
ESI_reg(&context) = (DWORD)pTask->hPrevInstance;
EDI_reg(&context) = (DWORD)pTask->hInstance;
ES_reg (&context) = (WORD)pTask->hPDB;
EAX_reg(context) = 1;
EBX_reg(context) = 0x81;
ECX_reg(context) = pModule->stack_size;
EDX_reg(context) = pTask->nCmdShow;
ESI_reg(context) = (DWORD)pTask->hPrevInstance;
EDI_reg(context) = (DWORD)pTask->hInstance;
ES_reg (context) = (WORD)pTask->hPDB;
/* Initialize the local heap */
if ( pModule->heap_size )
@ -824,7 +807,6 @@ void InitTask( SIGCONTEXT context )
}
#endif
/* Initialize the INSTANCEDATA structure */
pSegTable = NE_SEG_TABLE( pModule );
stacklow = pSegTable[pModule->ss - 1].minsize;
@ -1059,7 +1041,7 @@ HQUEUE SetTaskQueue( HANDLE hTask, HQUEUE hQueue )
/***********************************************************************
* GetTaskQueue (KERNEL.35)
*/
HQUEUE GetTaskQueue( HANDLE hTask )
HQUEUE16 GetTaskQueue( HTASK16 hTask )
{
TDB *pTask;
@ -1073,9 +1055,9 @@ HQUEUE GetTaskQueue( HANDLE hTask )
* GetTaskQueueDS (KERNEL.118)
*/
#ifndef WINELIB
void GetTaskQueueDS( SIGCONTEXT context )
void GetTaskQueueDS( SIGCONTEXT *context )
{
DS_reg(&context) = GlobalHandleToSel( GetTaskQueue(0) );
DS_reg(context) = GlobalHandleToSel( GetTaskQueue(0) );
}
#endif /* WINELIB */
@ -1084,9 +1066,9 @@ void GetTaskQueueDS( SIGCONTEXT context )
* GetTaskQueueES (KERNEL.119)
*/
#ifndef WINELIB
void GetTaskQueueES( SIGCONTEXT context )
void GetTaskQueueES( SIGCONTEXT *context )
{
ES_reg(&context) = GlobalHandleToSel( GetTaskQueue(0) );
ES_reg(context) = GlobalHandleToSel( GetTaskQueue(0) );
}
#endif /* WINELIB */
@ -1171,7 +1153,7 @@ WORD GetNumTasks(void)
/***********************************************************************
* GetTaskDS (KERNEL.155)
*/
HINSTANCE GetTaskDS(void)
HINSTANCE16 GetTaskDS(void)
{
TDB *pTask;

View File

@ -20,7 +20,6 @@
#include "instance.h"
#include "ldt.h"
#include "stackframe.h"
#include "string32.h"
#include "user.h"
#ifdef CONFIG_IPC
@ -360,7 +359,7 @@ ATOM GlobalAddAtom32W( LPCWSTR str )
{
char buffer[MAX_ATOM_LEN+1];
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
STRING32_UniToAnsi( buffer, str ); /* FIXME: 'str' length? */
lstrcpynWtoA( buffer, str, sizeof(buffer) );
return ATOM_AddAtom( USER_HeapSel, buffer );
}
@ -407,7 +406,7 @@ ATOM GlobalFindAtom32W( LPCWSTR str )
{
char buffer[MAX_ATOM_LEN+1];
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
STRING32_UniToAnsi( buffer, str ); /* FIXME: 'str' length? */
lstrcpynWtoA( buffer, str, sizeof(buffer) );
return ATOM_FindAtom( USER_HeapSel, buffer );
}
@ -437,10 +436,8 @@ UINT32 GlobalGetAtomName32A( ATOM atom, LPSTR buffer, INT32 count )
*/
UINT32 GlobalGetAtomName32W( ATOM atom, LPWSTR buffer, INT32 count )
{
UINT32 len;
char tmp[MAX_ATOM_LEN+1];
if (count > sizeof(tmp)) count = sizeof(tmp);
len = ATOM_GetAtomName( USER_HeapSel, atom, tmp, count );
STRING32_AnsiToUni( buffer, tmp ); /* FIXME: len? */
return len;
ATOM_GetAtomName( USER_HeapSel, atom, tmp, sizeof(tmp) );
lstrcpynAtoW( buffer, tmp, count );
return lstrlen32W( buffer );
}

View File

@ -405,7 +405,6 @@ HGLOBAL16 GlobalFree16( HGLOBAL16 handle )
*/
SEGPTR WIN16_GlobalLock16( HGLOBAL16 handle )
{
#ifndef WINELIB
dprintf_global( stddeb, "WIN16_GlobalLock16(%04x) -> %08lx\n",
handle, MAKELONG( 0, GlobalHandleToSel(handle)) );
if (!handle) return 0;
@ -417,9 +416,6 @@ SEGPTR WIN16_GlobalLock16( HGLOBAL16 handle )
if (!GET_ARENA_PTR(handle)->base) return (SEGPTR)0;
return PTR_SEG_OFF_TO_SEGPTR( GlobalHandleToSel(handle), 0 );
#else /* WINELIB */
return GlobalLock16( handle );
#endif /* WINELIB */
}

View File

@ -938,7 +938,7 @@ BOOL32 HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr )
flags &= HEAP_NO_SERIALIZE;
flags |= heapPtr->flags;
if (!(flags & HEAP_NO_SERIALIZE)) HeapLock( heap );
if (!HeapValidate( heap, HEAP_NO_SERIALIZE, ptr ))
if (!ptr || !HeapValidate( heap, HEAP_NO_SERIALIZE, ptr ))
{
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_INVALID_PARAMETER );

View File

@ -202,7 +202,6 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
*
* Print the content of the LDT on stdout.
*/
#ifndef WINELIB
void LDT_Print( int start, int length )
{
int i;
@ -232,4 +231,3 @@ void LDT_Print( int start, int length )
flags[0], flags[1], flags[2] );
}
}
#endif /* WINELIB */

View File

@ -1603,9 +1603,6 @@ BOOL16 LocalNext( LOCALENTRY *pLocalEntry )
return TRUE;
}
#ifndef WINELIB
#endif /* WINELIB */
/***********************************************************************
* LocalAlloc32 (KERNEL32.371)

View File

@ -176,6 +176,7 @@ SEGPTR lstrcpy16( SEGPTR dst, SEGPTR src )
*/
LPSTR lstrcpy32A( LPSTR dst, LPCSTR src )
{
if (!src || !dst) return NULL;
strcpy( dst, src );
return dst;
}
@ -261,15 +262,6 @@ INT32 lstrlen32W( LPCWSTR str )
}
/***********************************************************************
* lstrncmp16 (Not a Windows API)
*/
INT16 lstrncmp16( LPCSTR str1, LPCSTR str2, INT16 n )
{
return (INT16)lstrncmp32A( str1, str2, n );
}
/***********************************************************************
* lstrncmp32A (Not a Windows API)
*/
@ -290,15 +282,6 @@ INT32 lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
}
/***********************************************************************
* lstrncmpi16 (Not a Windows API)
*/
INT16 lstrncmpi16( LPCSTR str1, LPCSTR str2, INT16 n )
{
return (INT16)lstrncmpi32A( str1, str2, n );
}
/***********************************************************************
* lstrncmpi32A (Not a Windows API)
*/
@ -336,6 +319,30 @@ INT32 lstrncmpi32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
}
/***********************************************************************
* lstrcpynAtoW (Not a Windows API)
*/
LPWSTR lstrcpynAtoW( LPWSTR dst, LPCSTR src, INT32 n )
{
LPWSTR p = dst;
while ((n-- > 1) && *src) *p++ = (WCHAR)(unsigned char)*src++;
*p = 0;
return dst;
}
/***********************************************************************
* lstrcpynWtoA (Not a Windows API)
*/
LPSTR lstrcpynWtoA( LPSTR dst, LPCWSTR src, INT32 n )
{
LPSTR p = dst;
while ((n-- > 1) && *src) *p++ = (CHAR)*src++;
*p = 0;
return dst;
}
/***********************************************************************
* RtlFillMemory (KERNEL32.441)
*/
@ -359,7 +366,16 @@ VOID RtlMoveMemory( LPVOID dst, LPCVOID src, UINT32 len )
return;
}
/* do it the hard way (FIXME: could do better than this) */
while (len--) *((BYTE *)dst)++ = *((BYTE *)src)++;
if (dst < src)
{
while (len--) *((BYTE *)dst)++ = *((BYTE *)src)++;
}
else
{
dst = (BYTE *)dst + len - 1;
src = (BYTE *)src + len - 1;
while (len--) *((BYTE *)dst)-- = *((BYTE *)src)--;
}
}

View File

@ -85,8 +85,8 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpofn->hwndOwner,
MODULE_GetWndProcEntry16("FileOpenDlgProc"),
(DWORD)lpofn );
(DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"),
(DWORD)lpofn );
if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
{
@ -127,8 +127,8 @@ BOOL GetSaveFileName(LPOPENFILENAME lpofn)
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpofn->hwndOwner,
MODULE_GetWndProcEntry16("FileSaveDlgProc"),
(DWORD)lpofn);
(DLGPROC16)MODULE_GetWndProcEntry16("FileSaveDlgProc"),
(DWORD)lpofn);
if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
{
if (lpofn->Flags & OFN_ENABLETEMPLATE) FreeResource( hDlgTmpl );
@ -705,8 +705,8 @@ BOOL FindText(LPFINDREPLACE lpFind)
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
if (!(ptr = GlobalLock16( hDlgTmpl ))) return -1;
bRet = CreateDialogIndirectParam16( hInst, ptr, lpFind->hwndOwner,
MODULE_GetWndProcEntry16("FindTextDlgProc"),
(DWORD)lpFind );
(DLGPROC16)MODULE_GetWndProcEntry16("FindTextDlgProc"),
(DWORD)lpFind );
GlobalUnlock16( hDlgTmpl );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
@ -734,8 +734,8 @@ BOOL ReplaceText(LPFINDREPLACE lpFind)
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
if (!(ptr = GlobalLock16( hDlgTmpl ))) return -1;
bRet = CreateDialogIndirectParam16( hInst, ptr, lpFind->hwndOwner,
MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
(DWORD)lpFind );
(DLGPROC16)MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
(DWORD)lpFind );
GlobalUnlock16( hDlgTmpl );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
@ -980,10 +980,10 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
hInst = WIN_GetWindowInstance( lpPrint->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpPrint->hwndOwner,
(lpPrint->Flags & PD_PRINTSETUP) ?
MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
MODULE_GetWndProcEntry16("PrintDlgProc"),
(DWORD)lpPrint );
(DLGPROC16)((lpPrint->Flags & PD_PRINTSETUP) ?
MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
MODULE_GetWndProcEntry16("PrintDlgProc")),
(DWORD)lpPrint );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
}
@ -1117,8 +1117,8 @@ BOOL ChooseColor(LPCHOOSECOLOR lpChCol)
}
hInst = WIN_GetWindowInstance( lpChCol->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpChCol->hwndOwner,
MODULE_GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol );
(DLGPROC16)MODULE_GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol );
if (!(lpChCol->Flags & CC_ENABLETEMPLATEHANDLE))
{
if (lpChCol->Flags & CC_ENABLETEMPLATE) FreeResource( hDlgTmpl );
@ -1903,7 +1903,7 @@ static LONG CC_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam)
for (i=0x2bf;i<0x2c5;i++)
SendMessage16(GetDlgItem(hDlg,i),EM_LIMITTEXT,3,0); /* max 3 digits: xyz */
if (CC_HookCallChk(lpp->lpcc))
res=CallWindowProc16((FARPROC)lpp->lpcc->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
res=CallWindowProc16(lpp->lpcc->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
return res;
}
@ -2013,7 +2013,7 @@ static LRESULT CC_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam)
if (lpp->lpcc->hwndOwner)
SendMessage16(lpp->lpcc->hwndOwner,i,0,(LPARAM)lpp->lpcc);
if (CC_HookCallChk(lpp->lpcc))
CallWindowProc16((FARPROC)lpp->lpcc->lpfnHook,hDlg,
CallWindowProc16(lpp->lpcc->lpfnHook,hDlg,
WM_COMMAND,psh15,(LPARAM)lpp->lpcc);
break;
@ -2123,7 +2123,7 @@ LRESULT ColorDlgProc(HWND hDlg, UINT message,
return FALSE;
res=0;
if (CC_HookCallChk(lpp->lpcc))
res=CallWindowProc16((FARPROC)lpp->lpcc->lpfnHook,hDlg,message,wParam,lParam);
res=CallWindowProc16(lpp->lpcc->lpfnHook,hDlg,message,wParam,lParam);
if (res)
return res;
}
@ -2198,8 +2198,8 @@ BOOL ChooseFont(LPCHOOSEFONT lpChFont)
}
hInst = WIN_GetWindowInstance( lpChFont->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpChFont->hwndOwner,
MODULE_GetWndProcEntry16("FormatCharDlgProc"),
(DWORD)lpChFont );
(DLGPROC16)MODULE_GetWndProcEntry16("FormatCharDlgProc"),
(DWORD)lpChFont );
if (!(lpChFont->Flags & CF_ENABLETEMPLATEHANDLE))
{
if (lpChFont->Flags & CF_ENABLETEMPLATE) FreeResource( hDlgTmpl );
@ -2290,7 +2290,7 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, LPLOGFONT16 lplf ,LPTEXTMET
{
lplf->lfItalic=fontstyles[i].italic;
lplf->lfWeight=fontstyles[i].weight;
hf=CreateFontIndirect(lplf);
hf=CreateFontIndirect16(lplf);
hf=SelectObject(hdc,hf);
GetTextMetrics16(hdc,lptm);
hf=SelectObject(hdc,hf);
@ -2698,7 +2698,7 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam)
lpxx->lfQuality=DEFAULT_QUALITY;
lpcf->iPointSize= -10*lpxx->lfHeight;
hFont=CreateFontIndirect(lpxx);
hFont=CreateFontIndirect16(lpxx);
if (hFont)
SendDlgItemMessage16(hDlg,stc6,WM_SETFONT,hFont,TRUE);
/* FIXME: Delete old font ...? */

View File

@ -2,6 +2,7 @@
* String functions
*
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
* Copyright 1996 Marcus Meissner
*/
#include <stdio.h>
@ -17,6 +18,7 @@
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "string32.h"
#define ToUpper(c) toupper(c)
#define ToLower(c) tolower(c)
@ -61,25 +63,25 @@ static const BYTE Ansi2Oem[256] =
/* Funny to divide them between user and kernel. */
/* IsCharAlpha USER 433 */
BOOL IsCharAlpha(char ch)
BOOL16 IsCharAlpha16(CHAR ch)
{
return isalpha(ch); /* This is probably not right for NLS */
}
/* IsCharAlphanumeric USER 434 */
BOOL IsCharAlphanumeric(char ch)
BOOL16 IsCharAlphanumeric16(CHAR ch)
{
return (ch < '0') ? 0 : (ch <= '9');
return isalnum(ch);
}
/* IsCharUpper USER 435 */
BOOL IsCharUpper(char ch)
BOOL16 IsCharUpper16(CHAR ch)
{
return isupper(ch);
}
/* IsCharLower USER 436 */
BOOL IsCharLower(char ch)
BOOL16 IsCharLower16(CHAR ch)
{
return islower(ch);
}
@ -203,7 +205,7 @@ SEGPTR AnsiPrev( SEGPTR start, SEGPTR current)
/* AnsiToOem Keyboard.5 */
INT AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr)
INT AnsiToOem(LPCSTR lpAnsiStr, LPSTR lpOemStr)
{
dprintf_keyboard(stddeb, "AnsiToOem: %s\n", lpAnsiStr);
while(*lpAnsiStr){
@ -214,7 +216,7 @@ INT AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr)
}
/* OemToAnsi Keyboard.6 */
BOOL OemToAnsi(LPSTR lpOemStr, LPSTR lpAnsiStr)
BOOL OemToAnsi(LPCSTR lpOemStr, LPSTR lpAnsiStr)
{
dprintf_keyboard(stddeb, "OemToAnsi: %s\n", lpOemStr);
while(*lpOemStr){
@ -233,7 +235,7 @@ void AnsiToOemBuff(LPCSTR lpAnsiStr, LPSTR lpOemStr, UINT nLength)
}
/* OemToAnsi Keyboard.135 */
void OemToAnsiBuff(LPSTR lpOemStr, LPSTR lpAnsiStr, INT nLength)
void OemToAnsiBuff(LPCSTR lpOemStr, LPSTR lpAnsiStr, INT nLength)
{
int i;
for(i=0;i<nLength;i++)
@ -257,3 +259,375 @@ void OutputDebugString( LPCSTR str )
module ? module : "???", buffer );
free( buffer );
}
/***********************************************************************
* CharNextA (USER32.28)
*/
LPSTR CharNext32A(LPCSTR x)
{
if (*x) return (LPSTR)(x+1);
else return (LPSTR)x;
}
/***********************************************************************
* CharNextExA (USER32.29)
*/
LPSTR CharNextEx32A(WORD codepage,LPCSTR x,DWORD flags)
{
/* FIXME: add DBCS / codepage stuff */
if (*x) return (LPSTR)(x+1);
else return (LPSTR)x;
}
/***********************************************************************
* CharNextExW (USER32.30)
*/
LPWSTR CharNextEx32W(WORD codepage,LPCWSTR x,DWORD flags)
{
/* FIXME: add DBCS / codepage stuff */
if (*x) return (LPWSTR)(x+1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharNextW (USER32.31)
*/
LPWSTR CharNext32W(LPCWSTR x)
{
if (*x) return (LPWSTR)(x+1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharPrevA (USER32.32)
*/
LPSTR CharPrev32A(LPCSTR start,LPCSTR x)
{
if (x>start) return (LPSTR)(x-1);
else return (LPSTR)x;
}
/***********************************************************************
* CharPrevExA (USER32.33)
*/
LPSTR CharPrevEx32A(WORD codepage,LPCSTR start,LPCSTR x,DWORD flags)
{
/* FIXME: add DBCS / codepage stuff */
if (x>start) return (LPSTR)(x-1);
else return (LPSTR)x;
}
/***********************************************************************
* CharPrevExW (USER32.34)
*/
LPWSTR CharPrevEx32W(WORD codepage,LPCWSTR start,LPCWSTR x,DWORD flags)
{
/* FIXME: add DBCS / codepage stuff */
if (x>start) return (LPWSTR)(x-1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharPrevW (USER32.35)
*/
LPWSTR CharPrev32W(LPCWSTR start,LPCWSTR x)
{
if (x>start) return (LPWSTR)(x-1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharLowerA (USER32.24)
* FIXME: handle current locale
*/
LPSTR CharLower32A(LPSTR x)
{
LPSTR s;
if (HIWORD(x))
{
s=x;
while (*s)
{
*s=tolower(*s);
s++;
}
return x;
}
else return (LPSTR)tolower(LOWORD(x));
}
/***********************************************************************
* CharLowerBuffA (USER32.25)
* FIXME: handle current locale
*/
DWORD CharLowerBuff32A(LPSTR x,DWORD buflen)
{
DWORD done=0;
while (*x && (buflen--))
{
*x=tolower(*x);
x++;
done++;
}
return done;
}
/***********************************************************************
* CharLowerBuffW (USER32.26)
* FIXME: handle current locale
*/
DWORD CharLowerBuff32W(LPWSTR x,DWORD buflen)
{
DWORD done=0;
while (*x && (buflen--))
{
*x=tolower(*x);
x++;
done++;
}
return done;
}
/***********************************************************************
* CharLowerW (USER32.27)
* FIXME: handle current locale
*/
LPWSTR CharLower32W(LPWSTR x)
{
if (HIWORD(x))
{
LPWSTR s = x;
while (*s)
{
*s=tolower(*s);
s++;
}
return x;
}
else return (LPWSTR)tolower(LOWORD(x));
}
/***********************************************************************
* CharUpperA (USER32.40)
* FIXME: handle current locale
*/
LPSTR CharUpper32A(LPSTR x)
{
if (HIWORD(x))
{
LPSTR s = x;
while (*s)
{
*s=toupper(*s);
s++;
}
return x;
}
else return (LPSTR)toupper(LOWORD(x));
}
/***********************************************************************
* CharUpperBuffA (USER32.41)
* FIXME: handle current locale
*/
DWORD CharUpperBuff32A(LPSTR x,DWORD buflen)
{
DWORD done=0;
while (*x && (buflen--))
{
*x=toupper(*x);
x++;
done++;
}
return done;
}
/***********************************************************************
* CharUpperBuffW (USER32.42)
* FIXME: handle current locale
*/
DWORD CharUpperBuff32W(LPWSTR x,DWORD buflen)
{
DWORD done=0;
while (*x && (buflen--))
{
*x=toupper(*x);
x++;
done++;
}
return done;
}
/***********************************************************************
* CharUpperW (USER32.43)
* FIXME: handle current locale
*/
LPWSTR CharUpper32W(LPWSTR x)
{
if (HIWORD(x))
{
LPWSTR s = x;
while (*s)
{
*s=toupper(*s);
s++;
}
return x;
}
else return (LPWSTR)toupper(LOWORD(x));
}
/***********************************************************************
* IsCharAlphaA (USER32.330)
* FIXME: handle current locale
*/
BOOL32 IsCharAlpha32A(CHAR x)
{
return isalpha(x);
}
/***********************************************************************
* IsCharAlphaNumericA (USER32.331)
* FIXME: handle current locale
*/
BOOL32 IsCharAlphaNumeric32A(CHAR x)
{
return isalnum(x);
}
/***********************************************************************
* IsCharAlphaNumericW (USER32.332)
* FIXME: handle current locale
*/
BOOL32 IsCharAlphaNumeric32W(WCHAR x)
{
return isalnum(x);
}
/***********************************************************************
* IsCharAlphaW (USER32.333)
* FIXME: handle current locale
*/
BOOL32 IsCharAlpha32W(WCHAR x)
{
return isalpha(x);
}
/***********************************************************************
* IsCharAlphaW (USER32.334)
* FIXME: handle current locale
*/
BOOL32 IsCharLower32A(CHAR x)
{
return islower(x);
}
/***********************************************************************
* IsCharAlphaW (USER32.335)
* FIXME: handle current locale
*/
BOOL32 IsCharLower32W(WCHAR x)
{
return islower(x);
}
/***********************************************************************
* IsCharAlphaW (USER32.336)
* FIXME: handle current locale
*/
BOOL32 IsCharUpper32A(CHAR x)
{
return isupper(x);
}
/***********************************************************************
* IsCharAlphaW (USER32.337)
* FIXME: handle current locale
*/
BOOL32 IsCharUpper32W(WCHAR x)
{
return isupper(x);
}
/***********************************************************************
* CharToOemA (USER32.36)
*/
BOOL32 CharToOem32A(LPSTR s,LPSTR d)
{
AnsiToOem(s,d);
return TRUE;
}
/***********************************************************************
* CharToOemBuffA (USER32.37)
*/
BOOL32 CharToOemBuff32A(LPSTR s,LPSTR d,DWORD len)
{
AnsiToOemBuff(s,d,len);
return TRUE;
}
/***********************************************************************
* CharToOemBuffW (USER32.38)
*/
BOOL32 CharToOemBuff32W(LPCWSTR s,LPSTR d,DWORD len)
{
LPSTR x=STRING32_DupUniToAnsi(s);
AnsiToOemBuff(x,d,len);
return TRUE;
}
/***********************************************************************
* CharToOemW (USER32.39)
*/
BOOL32 CharToOem32W(LPCWSTR s,LPSTR d)
{
LPSTR x=STRING32_DupUniToAnsi(s);
AnsiToOem(x,d);
return TRUE;
}
/***********************************************************************
* OemToCharA (USER32.401)
*/
BOOL32 OemToChar32A(LPSTR s,LPSTR d)
{
OemToAnsi(s,d);
return TRUE;
}
/***********************************************************************
* OemToCharBuffA (USER32.402)
*/
BOOL32 OemToCharBuff32A(LPSTR s,LPSTR d,DWORD len)
{
OemToAnsiBuff(s,d,len);
return TRUE;
}
/***********************************************************************
* OemToCharBuffW (USER32.403)
*/
BOOL32 OemToCharBuff32W(LPCSTR s,LPWSTR d,DWORD len)
{
LPSTR x=(char*)xmalloc(strlen(s));
OemToAnsiBuff((LPSTR)s,x,len);
STRING32_AnsiToUni(d,x);
return TRUE;
}
/***********************************************************************
* OemToCharW (USER32.404)
*/
BOOL32 OemToChar32W(LPCSTR s,LPWSTR d)
{
LPSTR x=(char*)xmalloc(strlen(s));
OemToAnsi((LPSTR)s,x);
STRING32_AnsiToUni(d,x);
return TRUE;
}

View File

@ -25,7 +25,6 @@
#define strdupW2A(x) STRING32_DupUniToAnsi(x)
#define strdupA2W(x) STRING32_DupAnsiToUni(x)
#define strcpyWA(a,b) STRING32_UniToAnsi(a,b)
#define strcpyAW(a,b) STRING32_AnsiToUni(a,b)
/* The readahead length of the decompressor. Reading single bytes
@ -470,6 +469,23 @@ LZCopy(HFILE src,HFILE dest) {
#undef BUFLEN
}
/* reverses GetExpandedPathname */
static LPSTR LZEXPAND_MangleName( LPCSTR fn )
{
char *p;
char *mfn = (char *)xmalloc( strlen(fn) + 3 ); /* "._" and \0 */
strcpy( mfn, fn );
if (!(p = strrchr( mfn, '\\' ))) p = mfn;
if ((p = strchr( p, '.' )))
{
p++;
if (strlen(p) < 3) strcat( p, "_" ); /* append '_' */
else p[strlen(p)-1] = '_'; /* replace last character */
}
else strcat( mfn, "._" ); /* append "._" */
return mfn;
}
/*
* LZOpenFile [LZEXPAND.2]
* Opens a file. If not compressed, open it as a normal file.
@ -481,6 +497,12 @@ LZOpenFile16(LPCSTR fn,LPOFSTRUCT ofs,UINT16 mode) {
dprintf_file(stddeb,"LZOpenFile(%s,%p,%d)\n",fn,ofs,mode);
/* 0x70 represents all OF_SHARE_* flags, ignore them for the check */
fd=OpenFile(fn,ofs,mode);
if (fd==HFILE_ERROR)
{
LPSTR mfn = LZEXPAND_MangleName(fn);
fd = OpenFile(mfn,ofs,mode);
free( mfn );
}
if ((mode&~0x70)!=OF_READ)
return fd;
if (fd==HFILE_ERROR)

View File

@ -17,7 +17,6 @@
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include "wine.h"
#include "message.h"
#include "module.h"
#include "msdos.h"
@ -25,6 +24,7 @@
#include "winsock.h"
#include "options.h"
#include "desktop.h"
#include "registers.h"
#include "shell.h"
#include "winbase.h"
#include "string32.h"
@ -1021,9 +1021,6 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
XKeyboardControl keyboard_value;
fprintf(stderr, "SystemParametersInfo: action %d, param %x, flag %x\n",
uAction, uParam, fuWinIni);
switch (uAction) {
case SPI_GETBEEP:
XGetKeyboardControl(display, &keyboard_state);

View File

@ -6,8 +6,7 @@
#include "windows.h"
#include "ole2.h"
#include "global.h"
#include "local.h"
#include "heap.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
@ -17,39 +16,21 @@
as ISO-8859 */
typedef DWORD BSTR;
HGLOBAL BSTRheapsel=0;
#define BSTR_HEAP_SIZE 65536
static BSTR BSTR_AllocBytes(int n)
{
HLOCAL16 mem;
if(!BSTRheapsel)
{
BSTRheapsel=GlobalAlloc16(GMEM_FIXED,BSTR_HEAP_SIZE);
LocalInit(BSTRheapsel,0,BSTR_HEAP_SIZE-1);
}
if(!BSTRheapsel)
return 0;
mem=LOCAL_Alloc(BSTRheapsel,LMEM_FIXED,n);
#ifdef WINELIB32
return (BSTR)mem;
#else
return mem ? MAKELONG(mem,BSTRheapsel) : 0;
#endif
void *ptr = SEGPTR_ALLOC(n);
return SEGPTR_GET(ptr);
}
static void BSTR_Free(BSTR in)
{
#ifdef WINELIB32
LOCAL_Free(BSTRheapsel, (HANDLE)in);
#else
LOCAL_Free(BSTRheapsel, LOWORD(in));
#endif
SEGPTR_FREE( PTR_SEG_TO_LIN(in) );
}
static void* BSTR_GetAddr(BSTR in)
{
return in ? PTR_SEG_TO_LIN(in) : 0;
return in ? PTR_SEG_TO_LIN(in) : 0;
}
/***********************************************************************

View File

@ -24,16 +24,16 @@ DWORD GetUserDefaultLCID()
switch(Options.language)
{
case LANG_En: return 0x09;
case LANG_Es: return 0x07; /* Just a Guess :-) */
case LANG_Es: return 0x0a;
case LANG_De: return 0x07;
case LANG_No: return 0x14;
case LANG_Fr:
case LANG_Fi:
case LANG_Da:
case LANG_Cz:
case LANG_Eo:
case LANG_It:
case LANG_Ko:
case LANG_Fr: return 0x0c;
case LANG_Fi: return 0x0b;
case LANG_Da: return 0x06;
case LANG_Cz: return 0x05;
case LANG_Eo: return 0x25; /* not official */
case LANG_It: return 0x10;
case LANG_Ko: return 0x12;
default:
return 0; /* Neutral language */
}
@ -525,7 +525,130 @@ LOCVAL(LOCALE_SABBREVMONTHNAME13,"")
/* LOCVAL(LOCALE_INEGSYMPRECEDES) */
/* LOCVAL(LOCALE_INEGSEPBYSPACE) */
break; /* LANG(Eo) */
case LANG_Fi:
LOCVAL(LOCALE_ILANGUAGE,"11")
LOCVAL(LOCALE_SLANGUAGE,"Suomi")
LOCVAL(LOCALE_SENGLANGUAGE,"Finnish")
LOCVAL(LOCALE_SABBREVLANGNAME,"fin")
LOCVAL(LOCALE_SNATIVELANGNAME,"suomi")
LOCVAL(LOCALE_ICOUNTRY,"49")
LOCVAL(LOCALE_SCOUNTRY,"Suomi")
LOCVAL(LOCALE_SENGCOUNTRY,"Finland")
LOCVAL(LOCALE_SABBREVCTRYNAME,"Fin")
LOCVAL(LOCALE_SNATIVECTRYNAME,"Suomi")
LOCVAL(LOCALE_IDEFAULTLANGUAGE,"11")
LOCVAL(LOCALE_IDEFAULTCOUNTRY,"358")
/*
LOCVAL(LOCALE_IDEFAULTCODEPAGE)
LOCVAL(LOCALE_IDEFAULTANSICODEPAGE)
*/
LOCVAL(LOCALE_SLIST,";")
LOCVAL(LOCALE_IMEASURE,"0")
LOCVAL(LOCALE_SDECIMAL,",")
LOCVAL(LOCALE_STHOUSAND,".")
/*
LOCVAL(LOCALE_SGROUPING)
*/
LOCVAL(LOCALE_IDIGITS,"2")
LOCVAL(LOCALE_ILZERO,"1")
/*
LOCVAL(LOCALE_INEGNUMBER)
Is this "0123456789" ??
LOCVAL(LOCALE_SNATIVEDIGITS)
*/
LOCVAL(LOCALE_SCURRENCY,"mk")
/*
LOCVAL(LOCALE_SINTLSYMBOL)
LOCVAL(LOCALE_SMONDECIMALSEP)
LOCVAL(LOCALE_SMONTHOUSANDSEP)
LOCVAL(LOCALE_SMONGROUPING)
*/
LOCVAL(LOCALE_ICURRDIGITS,"2")
/*
LOCVAL(LOCALE_IINTLCURRDIGITS)
*/
LOCVAL(LOCALE_ICURRENCY,"3")
LOCVAL(LOCALE_INEGCURR,"8")
LOCVAL(LOCALE_SDATE,".")
LOCVAL(LOCALE_STIME,":")
LOCVAL(LOCALE_SSHORTDATE,"dd.MM.yyyy")
LOCVAL(LOCALE_SLONGDATE,"ddd, d. MMMM yyyy")
/*
LOCVAL(LOCALE_STIMEFORMAT)
*/
LOCVAL(LOCALE_IDATE,"1")
/*
LOCVAL(LOCALE_ILDATE)
*/
LOCVAL(LOCALE_ITIME,"1")
/*
LOCVAL(LOCALE_ITIMEMARKPOSN)
LOCVAL(LOCALE_ICENTURY)
*/
LOCVAL(LOCALE_ITLZERO,"1")
/*
LOCVAL(LOCALE_IDAYLZERO)
LOCVAL(LOCALE_IMONLZERO)
LOCVAL(LOCALE_S1159)
LOCVAL(LOCALE_S2359)
LOCVAL(LOCALE_ICALENDARTYPE)
LOCVAL(LOCALE_IOPTIONALCALENDAR)
LOCVAL(LOCALE_IFIRSTDAYOFWEEK)
LOCVAL(LOCALE_IFIRSTWEEKOFYEAR)
*/
LOCVAL(LOCALE_SDAYNAME1,"maanantai")
LOCVAL(LOCALE_SDAYNAME2,"tiistai")
LOCVAL(LOCALE_SDAYNAME3,"keskiviikko")
LOCVAL(LOCALE_SDAYNAME4,"torstai")
LOCVAL(LOCALE_SDAYNAME5,"perjantai")
LOCVAL(LOCALE_SDAYNAME6,"lauantai")
LOCVAL(LOCALE_SDAYNAME7,"sunnuntai")
LOCVAL(LOCALE_SABBREVDAYNAME1,"Ma")
LOCVAL(LOCALE_SABBREVDAYNAME2,"Ti")
LOCVAL(LOCALE_SABBREVDAYNAME3,"Ke")
LOCVAL(LOCALE_SABBREVDAYNAME4,"To")
LOCVAL(LOCALE_SABBREVDAYNAME5,"Pe")
LOCVAL(LOCALE_SABBREVDAYNAME6,"La")
LOCVAL(LOCALE_SABBREVDAYNAME7,"Su")
LOCVAL(LOCALE_SMONTHNAME1,"tammikuu")
LOCVAL(LOCALE_SMONTHNAME2,"helmikuu")
LOCVAL(LOCALE_SMONTHNAME3,"maaliskuu")
LOCVAL(LOCALE_SMONTHNAME4,"huhtikuu")
LOCVAL(LOCALE_SMONTHNAME5,"toukokuu")
LOCVAL(LOCALE_SMONTHNAME6,"kesäkuu")
LOCVAL(LOCALE_SMONTHNAME7,"heinäkuu")
LOCVAL(LOCALE_SMONTHNAME8,"elokuu")
LOCVAL(LOCALE_SMONTHNAME9,"syyskuu")
LOCVAL(LOCALE_SMONTHNAME10,"lokakuu")
LOCVAL(LOCALE_SMONTHNAME11,"marraskuu")
LOCVAL(LOCALE_SMONTHNAME12,"joulukuu")
LOCVAL(LOCALE_SMONTHNAME13,"")
LOCVAL(LOCALE_SABBREVMONTHNAME1,"tammi")
LOCVAL(LOCALE_SABBREVMONTHNAME2,"helmi")
LOCVAL(LOCALE_SABBREVMONTHNAME3,"maalis")
LOCVAL(LOCALE_SABBREVMONTHNAME4,"huhti")
LOCVAL(LOCALE_SABBREVMONTHNAME5,"touko")
LOCVAL(LOCALE_SABBREVMONTHNAME6,"kesä")
LOCVAL(LOCALE_SABBREVMONTHNAME7,"heinä")
LOCVAL(LOCALE_SABBREVMONTHNAME8,"elo")
LOCVAL(LOCALE_SABBREVMONTHNAME9,"syys")
LOCVAL(LOCALE_SABBREVMONTHNAME10,"loka")
LOCVAL(LOCALE_SABBREVMONTHNAME11,"marras")
LOCVAL(LOCALE_SABBREVMONTHNAME12,"joulu")
LOCVAL(LOCALE_SABBREVMONTHNAME13,"")
/*
LOCVAL(LOCALE_SPOSITIVESIGN)
LOCVAL(LOCALE_SNEGATIVESIGN)
LOCVAL(LOCALE_IPOSSIGNPOSN)
LOCVAL(LOCALE_INEGSIGNPOSN)
LOCVAL(LOCALE_IPOSSYMPRECEDES)
LOCVAL(LOCALE_IPOSSEPBYSPACE)
LOCVAL(LOCALE_INEGSYMPRECEDES)
LOCVAL(LOCALE_INEGSEPBYSPACE)
*/
break; /* LANG(Fi) */
case LANG_It:
LOCVAL(LOCALE_ILANGUAGE,"9")
LOCVAL(LOCALE_SLANGUAGE,"Italiano")
@ -671,11 +794,21 @@ LOCVAL(LOCALE_INEGSEPBYSPACE)
/***********************************************************************
* CompareStringA (OLE2NLS.8)
* This implementation ignores the locale, and trusts in libc
* CompareString16 (OLE2NLS.8)
*/
int CompareStringA(DWORD lcid, DWORD fdwStyle,
char *s1, int l1, char *s2,int l2)
UINT16 CompareString16(DWORD lcid,DWORD fdwStyle,
LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2)
{
return (UINT16)CompareString32A(lcid,fdwStyle,s1,l1,s2,l2);
}
/***********************************************************************
* CompareString32A (KERNEL32.29)
* This implementation ignores the locale
* FIXME
*/
UINT32 CompareString32A(DWORD lcid, DWORD fdwStyle,
LPCSTR s1, DWORD l1, LPCSTR s2,DWORD l2)
{
int len,ret;
if(fdwStyle & NORM_IGNORENONSPACE)
@ -699,6 +832,35 @@ int CompareStringA(DWORD lcid, DWORD fdwStyle,
return (l1<l2)? 1 : 3;
}
/***********************************************************************
* CompareString32W (KERNEL32.30)
* This implementation ignores the locale
* FIXME
*/
UINT32 CompareString32W(DWORD lcid, DWORD fdwStyle,
LPCWSTR s1, DWORD l1, LPCWSTR s2,DWORD l2)
{
int len,ret;
if(fdwStyle & NORM_IGNORENONSPACE)
fprintf(stdnimp,"CompareStringW:IGNORENONSPACE not supprted\n");
if(fdwStyle & NORM_IGNORESYMBOLS)
fprintf(stdnimp,"CompareStringW:IGNORESYMBOLS not supported\n");
/* Is strcmp defaulting to string sort or to word sort?? */
/* FIXME: Handle NORM_STRINGSORT */
l1 = (l1==-1)?lstrlen32W(s1):l1;
l2 = (l2==-1)?lstrlen32W(s2):l2;
len = l1<l2 ? l1:l2;
ret = (fdwStyle & NORM_IGNORECASE) ?
lstrncmpi32W(s1,s2,len) : lstrncmp32W(s1,s2,len);
/* not equal, return 1 or 3 */
if(ret!=0) return ret+2;
/* same len, return 2 */
if(l1==l2) return 2;
/* the longer one is lexically greater */
return (l1<l2)? 1 : 3;
}
/***********************************************************************
* SetLocalInfoA (KERNEL32.499)
*/

View File

@ -1,3 +1,4 @@
#include <sys/types.h>
#include <sys/time.h>
#ifndef HAVE_USLEEP
@ -9,7 +10,7 @@ unsigned int usleep (unsigned int useconds)
delay.tv_sec = 0;
delay.tv_usec = useconds;
(void) select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &delay);
select( 0, 0, 0, 0, &delay );
return 0;
}

View File

@ -140,7 +140,9 @@ static HINSTANCE SHELL_FindExecutable( LPCSTR lpFile,
}
/* First thing we need is the file's extension */
extension = strchr( lpFile, '.' ); /* Assumes first "." is the one... */
extension = strrchr( lpFile, '.' ); /* Assume last "." is the one; */
/* File->Run in progman uses */
/* .\FILE.EXE :( */
if ((extension == NULL) || (extension == &lpFile[strlen(lpFile)]))
{
return 31; /* no association */
@ -179,7 +181,10 @@ static HINSTANCE SHELL_FindExecutable( LPCSTR lpFile,
dprintf_exec(stddeb, "SHELL_FindExecutable: found %s\n",
lpResult);
return 33; /* Greater than 32 to indicate success FIXME */
/* what are the correct values here? */
/* According to the docs, I should be returning */
/* a handle for the executable. Does this mean */
/* I'm supposed to open the executable file or */
/* something? More RTFM, I guess... */
}
tok=strtok(NULL, " \t");
}
@ -320,11 +325,7 @@ LRESULT AboutDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch(msg) {
case WM_INITDIALOG:
#ifdef WINELIB32
SendDlgItemMessage32A(hWnd,stc1,STM_SETICON,lParam,0);
#else
SendDlgItemMessage16(hWnd,stc1,STM_SETICON,LOWORD(lParam),0);
#endif
GetWindowText32A(hWnd, Template, sizeof(Template));
sprintf(AppTitle, Template, AppName);
SetWindowText32A(hWnd, AppTitle);

View File

@ -461,7 +461,7 @@ void SPY_EnterMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg,
case SPY_SENDMESSAGE32:
{
char taskName[30];
HTASK hTask = GetWindowTask(hWnd);
HTASK hTask = GetWindowTask16(hWnd);
if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
else if (!hTask) strcpy( taskName, "Wine" );
else sprintf( taskName, "task %04x %s",

View File

@ -19,7 +19,6 @@
WORD USER_HeapSel = 0;
#ifndef WINELIB
extern HTASK TASK_GetNextTask(HTASK);
extern void QUEUE_SetDoomedQueue(HQUEUE);
@ -62,7 +61,7 @@ WORD GetFreeSystemResources( WORD resType )
/***********************************************************************
* SystemHeapInfo (TOOLHELP.71)
*/
BOOL SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
BOOL16 SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
{
pHeapInfo->wUserFreePercent = GetFreeSystemResources( GFSR_USERRESOURCES );
pHeapInfo->wGDIFreePercent = GetFreeSystemResources( GFSR_GDIRESOURCES );
@ -71,7 +70,6 @@ BOOL SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
return TRUE;
}
#endif /* WINELIB */
/***********************************************************************
* TimerCount (TOOLHELP.80)

View File

@ -16,7 +16,7 @@
#include "module.h"
HANDLE DOSMEM_BiosSeg; /* BIOS data segment at 0x40:0 */
HANDLE16 DOSMEM_BiosSeg; /* BIOS data segment at 0x40:0 */
#pragma pack(1)
@ -84,7 +84,7 @@ static BIOSDATA *pBiosData = NULL;
* Create the dos memory segments, and store them into the KERNEL
* exported values. BUILTIN_Init() must already have been called.
*/
BOOL DOSMEM_Init(void)
BOOL32 DOSMEM_Init(void)
{
HMODULE16 hModule = GetModuleHandle( "KERNEL" );
char *dosmem;

View File

@ -11,8 +11,6 @@
#include "windows.h"
#include "ldt.h"
#include "module.h"
#include "registers.h"
#include "wine.h"
#include "miscemu.h"
#include "stddebug.h"
/* #define DEBUG_INT */
@ -48,34 +46,34 @@ extern void do_mscdex( SIGCONTEXT *context );
*
* Handler for int 31h (DPMI).
*/
void INT_Int31Handler( SIGCONTEXT context )
void INT_Int31Handler( SIGCONTEXT *context )
{
DWORD dw;
BYTE *ptr;
RESET_CFLAG(&context);
switch(AX_reg(&context))
RESET_CFLAG(context);
switch(AX_reg(context))
{
case 0x0000: /* Allocate LDT descriptors */
if (!(AX_reg(&context) = AllocSelectorArray( CX_reg(&context) )))
if (!(AX_reg(context) = AllocSelectorArray( CX_reg(context) )))
{
AX_reg(&context) = 0x8011; /* descriptor unavailable */
SET_CFLAG(&context);
AX_reg(context) = 0x8011; /* descriptor unavailable */
SET_CFLAG(context);
}
break;
case 0x0001: /* Free LDT descriptor */
if (FreeSelector( BX_reg(&context) ))
if (FreeSelector( BX_reg(context) ))
{
AX_reg(&context) = 0x8022; /* invalid selector */
SET_CFLAG(&context);
AX_reg(context) = 0x8022; /* invalid selector */
SET_CFLAG(context);
}
break;
case 0x0002: /* Real mode segment to descriptor */
{
WORD entryPoint = 0; /* KERNEL entry point for descriptor */
switch(BX_reg(&context))
switch(BX_reg(context))
{
case 0x0000: entryPoint = 183; break; /* __0000H */
case 0x0040: entryPoint = 193; break; /* __0040H */
@ -88,97 +86,98 @@ void INT_Int31Handler( SIGCONTEXT context )
case 0xf000: entryPoint = 194; break; /* __F000H */
default:
fprintf( stderr, "DPMI: real-mode seg to descriptor %04x not possible\n",
BX_reg(&context) );
AX_reg(&context) = 0x8011;
SET_CFLAG(&context);
BX_reg(context) );
AX_reg(context) = 0x8011;
SET_CFLAG(context);
break;
}
if (entryPoint)
AX_reg(&context) = LOWORD(MODULE_GetEntryPoint(
AX_reg(context) = LOWORD(MODULE_GetEntryPoint(
GetModuleHandle( "KERNEL" ),
entryPoint ));
}
break;
case 0x0003: /* Get next selector increment */
AX_reg(&context) = __AHINCR;
AX_reg(context) = __AHINCR;
break;
case 0x0004: /* Lock selector (not supported) */
AX_reg(&context) = 0; /* FIXME: is this a correct return value? */
AX_reg(context) = 0; /* FIXME: is this a correct return value? */
break;
case 0x0005: /* Unlock selector (not supported) */
AX_reg(&context) = 0; /* FIXME: is this a correct return value? */
AX_reg(context) = 0; /* FIXME: is this a correct return value? */
break;
case 0x0006: /* Get selector base address */
if (!(dw = GetSelectorBase( BX_reg(&context) )))
if (!(dw = GetSelectorBase( BX_reg(context) )))
{
AX_reg(&context) = 0x8022; /* invalid selector */
SET_CFLAG(&context);
AX_reg(context) = 0x8022; /* invalid selector */
SET_CFLAG(context);
}
else
{
CX_reg(&context) = HIWORD(dw);
DX_reg(&context) = LOWORD(dw);
CX_reg(context) = HIWORD(dw);
DX_reg(context) = LOWORD(dw);
}
break;
case 0x0007: /* Set selector base address */
SetSelectorBase( BX_reg(&context),
MAKELONG( DX_reg(&context), CX_reg(&context) ) );
SetSelectorBase( BX_reg(context),
MAKELONG( DX_reg(context), CX_reg(context) ) );
break;
case 0x0008: /* Set selector limit */
SetSelectorLimit( BX_reg(&context),
MAKELONG( DX_reg(&context), CX_reg(&context) ) );
SetSelectorLimit( BX_reg(context),
MAKELONG( DX_reg(context), CX_reg(context) ) );
break;
case 0x0009: /* Set selector access rights */
SelectorAccessRights( BX_reg(&context), 1, CX_reg(&context) );
SelectorAccessRights( BX_reg(context), 1, CX_reg(context) );
case 0x000a: /* Allocate selector alias */
if (!(AX_reg(&context) = AllocCStoDSAlias( BX_reg(&context) )))
if (!(AX_reg(context) = AllocCStoDSAlias( BX_reg(context) )))
{
AX_reg(&context) = 0x8011; /* descriptor unavailable */
SET_CFLAG(&context);
AX_reg(context) = 0x8011; /* descriptor unavailable */
SET_CFLAG(context);
}
break;
case 0x000b: /* Get descriptor */
{
ldt_entry entry;
LDT_GetEntry( SELECTOR_TO_ENTRY( BX_reg(&context) ), &entry );
LDT_GetEntry( SELECTOR_TO_ENTRY( BX_reg(context) ), &entry );
/* FIXME: should use ES:EDI for 32-bit clients */
LDT_EntryToBytes( PTR_SEG_OFF_TO_LIN( ES_reg(&context),
DI_reg(&context) ), &entry );
LDT_EntryToBytes( PTR_SEG_OFF_TO_LIN( ES_reg(context),
DI_reg(context) ), &entry );
}
break;
case 0x000c: /* Set descriptor */
{
ldt_entry entry;
LDT_BytesToEntry( PTR_SEG_OFF_TO_LIN( ES_reg(&context),
DI_reg(&context) ), &entry );
LDT_GetEntry( SELECTOR_TO_ENTRY( BX_reg(&context) ), &entry );
LDT_BytesToEntry( PTR_SEG_OFF_TO_LIN( ES_reg(context),
DI_reg(context) ), &entry );
LDT_GetEntry( SELECTOR_TO_ENTRY( BX_reg(context) ), &entry );
}
break;
case 0x000d: /* Allocate specific LDT descriptor */
AX_reg(&context) = 0x8011; /* descriptor unavailable */
SET_CFLAG(&context);
AX_reg(context) = 0x8011; /* descriptor unavailable */
SET_CFLAG(context);
break;
case 0x0204: /* Get protected mode interrupt vector */
dw = (DWORD)INT_GetHandler( BL_reg(&context) );
CX_reg(&context) = HIWORD(dw);
DX_reg(&context) = LOWORD(dw);
dw = (DWORD)INT_GetHandler( BL_reg(context) );
CX_reg(context) = HIWORD(dw);
DX_reg(context) = LOWORD(dw);
break;
case 0x0205: /* Set protected mode interrupt vector */
INT_SetHandler( BL_reg(&context),
PTR_SEG_OFF_TO_SEGPTR(CX_reg(&context),DX_reg(&context)));
INT_SetHandler( BL_reg(context),
(FARPROC16)PTR_SEG_OFF_TO_SEGPTR( CX_reg(context),
DX_reg(context) ));
break;
case 0x0300: /* Simulate real mode interrupt
@ -187,100 +186,90 @@ void INT_Int31Handler( SIGCONTEXT context )
* Currently we just print it out and return error.
*/
{
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(&context), DI_reg(&context) );
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );
fprintf(stdnimp,
"RealModeInt %02x: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n"
" ESI=%08lx EDI=%08lx ES=%04x DS=%04x\n",
BL_reg(&context), p->eax, p->ebx, p->ecx, p->edx,
BL_reg(context), p->eax, p->ebx, p->ecx, p->edx,
p->esi, p->edi, p->es, p->ds );
/* Compton's 1995 encyclopedia does its MSCDEX calls through
* this interrupt. Why? Who knows...
*/
if ((BL_reg(&context) == 0x2f) && ((p->eax & 0xFF00) == 0x1500))
if ((BL_reg(context) == 0x2f) && ((p->eax & 0xFF00) == 0x1500))
{
SIGCONTEXT context2;
EAX_reg(&context2) = p->eax;
EBX_reg(&context2) = p->ebx;
ECX_reg(&context2) = p->ecx;
EDX_reg(&context2) = p->edx;
ES_reg(&context2) = p->es;
do_mscdex(&context2);
p->eax = EAX_reg(&context2);
p->ebx = EBX_reg(&context2);
p->ecx = ECX_reg(&context2);
p->edx = EDX_reg(&context2);
do_mscdex( context );
}
else SET_CFLAG(&context);
else SET_CFLAG(context);
}
break;
case 0x0301: /* Call real mode procedure with far return */
{
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(&context), DI_reg(&context) );
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );
fprintf(stdnimp,
"RealModeCall: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n"
" ESI=%08lx EDI=%08lx ES=%04x DS=%04x CS:IP=%04x:%04x\n",
p->eax, p->ebx, p->ecx, p->edx,
p->esi, p->edi, p->es, p->ds, p->cs, p->ip );
SET_CFLAG(&context);
SET_CFLAG(context);
}
break;
case 0x0302: /* Call real mode procedure with interrupt return */
{
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(&context), DI_reg(&context) );
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );
fprintf(stdnimp,
"RealModeCallIret: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n"
" ESI=%08lx EDI=%08lx ES=%04x DS=%04x CS:IP=%04x:%04x\n",
p->eax, p->ebx, p->ecx, p->edx,
p->esi, p->edi, p->es, p->ds, p->cs, p->ip );
SET_CFLAG(&context);
SET_CFLAG(context);
}
break;
case 0x0400: /* Get DPMI version */
AX_reg(&context) = 0x005a; /* DPMI version 0.90 */
BX_reg(&context) = 0x0005; /* Flags: 32-bit, virtual memory */
CL_reg(&context) = runtime_cpu ();
DX_reg(&context) = 0x0102; /* Master/slave interrupt controller base*/
AX_reg(context) = 0x005a; /* DPMI version 0.90 */
BX_reg(context) = 0x0005; /* Flags: 32-bit, virtual memory */
CL_reg(context) = runtime_cpu ();
DX_reg(context) = 0x0102; /* Master/slave interrupt controller base*/
break;
case 0x0500: /* Get free memory information */
ptr = (BYTE *)PTR_SEG_OFF_TO_LIN( ES_reg(&context), DI_reg(&context) );
ptr = (BYTE *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );
*(DWORD *)ptr = 0x00ff0000; /* Largest block available */
memset( ptr + 4, 0xff, 0x2c ); /* No other information supported */
break;
case 0x0501: /* Allocate memory block */
if (!(ptr = (BYTE *)malloc( MAKELONG( CX_reg(&context),
BX_reg(&context) ) )))
if (!(ptr = (BYTE *)malloc( MAKELONG( CX_reg(context),
BX_reg(context) ) )))
{
AX_reg(&context) = 0x8012; /* linear memory not available */
SET_CFLAG(&context);
AX_reg(context) = 0x8012; /* linear memory not available */
SET_CFLAG(context);
}
else
{
BX_reg(&context) = SI_reg(&context) = HIWORD(ptr);
CX_reg(&context) = DI_reg(&context) = LOWORD(ptr);
BX_reg(context) = SI_reg(context) = HIWORD(ptr);
CX_reg(context) = DI_reg(context) = LOWORD(ptr);
}
break;
case 0x0502: /* Free memory block */
free( (void *)MAKELONG( DI_reg(&context), SI_reg(&context) ) );
free( (void *)MAKELONG( DI_reg(context), SI_reg(context) ) );
break;
case 0x0503: /* Resize memory block */
if (!(ptr = (BYTE *)realloc( (void *)MAKELONG(DI_reg(&context),SI_reg(&context)),
MAKELONG(CX_reg(&context),BX_reg(&context)))))
if (!(ptr = (BYTE *)realloc( (void *)MAKELONG(DI_reg(context),SI_reg(context)),
MAKELONG(CX_reg(context),BX_reg(context)))))
{
AX_reg(&context) = 0x8012; /* linear memory not available */
SET_CFLAG(&context);
AX_reg(context) = 0x8012; /* linear memory not available */
SET_CFLAG(context);
}
else
{
BX_reg(&context) = SI_reg(&context) = HIWORD(ptr);
CX_reg(&context) = DI_reg(&context) = LOWORD(ptr);
BX_reg(context) = SI_reg(context) = HIWORD(ptr);
CX_reg(context) = DI_reg(context) = LOWORD(ptr);
}
break;
@ -297,8 +286,8 @@ void INT_Int31Handler( SIGCONTEXT context )
break; /* Just ignore it */
case 0x0604: /* Get page size */
BX_reg(&context) = 0;
CX_reg(&context) = 4096;
BX_reg(context) = 0;
CX_reg(context) = 4096;
break;
case 0x0702: /* Mark page as demand-paging candidate */
@ -308,9 +297,9 @@ void INT_Int31Handler( SIGCONTEXT context )
break; /* Just ignore it */
default:
INT_BARF( &context, 0x31 );
AX_reg(&context) = 0x8001; /* unsupported function */
SET_CFLAG(&context);
INT_BARF( context, 0x31 );
AX_reg(context) = 0x8001; /* unsupported function */
SET_CFLAG(context);
break;
}
}

View File

@ -1,8 +1,6 @@
#include <stdlib.h>
#include <stdio.h>
#include "wine.h"
#include "miscemu.h"
#include "registers.h"
#include "stddebug.h"
/* #define DEBUG_INT */
#include "debug.h"
@ -30,27 +28,27 @@ struct Win87EmInfoStruct
*/
/* FIXME: Only skeletal implementation for now */
void WIN87_fpmath( SIGCONTEXT context )
void WIN87_fpmath( SIGCONTEXT *context )
{
dprintf_int(stddeb, "_fpmath: (cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx==%04x)\n",
CS_reg(&context), EIP_reg(&context),
ES_reg(&context), BX_reg(&context),
AX_reg(&context), DX_reg(&context) );
CS_reg(context), EIP_reg(context),
ES_reg(context), BX_reg(context),
AX_reg(context), DX_reg(context) );
switch(BX_reg(&context))
switch(BX_reg(context))
{
case 0: /* install (increase instanceref) emulator, install NMI vector */
AX_reg(&context) = 0;
AX_reg(context) = 0;
break;
case 1: /* Init Emulator */
AX_reg(&context) = 0;
AX_reg(context) = 0;
break;
case 2: /* deinstall emulator (decrease instanceref), deinstall NMI vector
* if zero. Every '0' call should have a matching '2' call.
*/
AX_reg(&context) = 0;
AX_reg(context) = 0;
break;
case 3:
@ -79,8 +77,8 @@ void WIN87_fpmath( SIGCONTEXT context )
/* FIXME: could someone who really understands asm() fix this please? --AJ */
/* __asm__("fistp %0;wait" : "=m" (dw) : : "memory"); */
dprintf_int(stddeb,"emulate.c:On top of stack was %ld\n",dw);
AX_reg(&context) = LOWORD(dw);
DX_reg(&context) = HIWORD(dw);
AX_reg(context) = LOWORD(dw);
DX_reg(context) = HIWORD(dw);
}
break;
@ -91,19 +89,19 @@ void WIN87_fpmath( SIGCONTEXT context )
break;
case 10: /* dunno. but looks like returning nr. of things on stack in AX */
AX_reg(&context) = 0;
AX_reg(context) = 0;
break;
case 11: /* just returns the installed flag in DX:AX */
DX_reg(&context) = 0;
AX_reg(&context) = 1;
DX_reg(context) = 0;
AX_reg(context) = 1;
break;
case 12: /* save AX in some internal state var */
break;
default: /* error. Say that loud and clear */
AX_reg(&context) = DX_reg(&context) = 0xFFFF;
AX_reg(context) = DX_reg(context) = 0xFFFF;
break;
}
}

View File

@ -8,7 +8,6 @@
#include "windows.h"
#include "ldt.h"
#include "miscemu.h"
#include "registers.h"
#define STACK_reg(context) \
@ -279,7 +278,7 @@ static BOOL INSTR_EmulateLDS( SIGCONTEXT *context, BYTE *instr, int long_op,
*
* Emulate a priviledged instruction. Returns TRUE if emulation successful.
*/
BOOL INSTR_EmulateInstruction( SIGCONTEXT *context )
BOOL32 INSTR_EmulateInstruction( SIGCONTEXT *context )
{
int prefix, segprefix, prefixlen, len, repX, long_op, long_addr;
BYTE *instr;
@ -552,7 +551,7 @@ BOOL INSTR_EmulateInstruction( SIGCONTEXT *context )
}
else
{
SEGPTR addr = INT_GetHandler( instr[1] );
FARPROC16 addr = INT_GetHandler( instr[1] );
WORD *stack = (WORD *)STACK_PTR( context );
/* Push the flags and return address on the stack */
*(--stack) = FL_reg(context);

View File

@ -1,7 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "registers.h"
#include "wine.h"
#include "miscemu.h"
#include "stddebug.h"
/* #define DEBUG_INT */
@ -13,27 +11,27 @@
*
* Handler for int 10h (video).
*/
void INT_Int10Handler( SIGCONTEXT context )
void INT_Int10Handler( SIGCONTEXT *context )
{
switch(AH_reg(&context))
switch(AH_reg(context))
{
case 0x0f:
AL_reg(&context) = 0x5b;
AL_reg(context) = 0x5b;
break;
case 0x12:
if (BL_reg(&context) == 0x10)
if (BL_reg(context) == 0x10)
{
BX_reg(&context) = 0x0003;
CX_reg(&context) = 0x0009;
BX_reg(context) = 0x0003;
CX_reg(context) = 0x0009;
}
break;
case 0x1a:
BX_reg(&context) = 0x0008;
BX_reg(context) = 0x0008;
break;
default:
INT_BARF( &context, 0x10 );
INT_BARF( context, 0x10 );
}
}

View File

@ -1,7 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include "registers.h"
#include "wine.h"
#include "miscemu.h"
#include "stddebug.h"
/* #define DEBUG_INT */
@ -13,28 +11,28 @@
*
* Handler for int 13h (disk I/O).
*/
void INT_Int13Handler( SIGCONTEXT context )
void INT_Int13Handler( SIGCONTEXT *context )
{
switch(AH_reg(&context))
switch(AH_reg(context))
{
case 0x00: /* RESET DISK SYSTEM */
case 0x04: /* VERIFY DISK SECTOR(S) */
AH_reg(&context) = 0;
AH_reg(context) = 0;
break;
case 0x05: /* FORMAT TRACK */
AH_reg(&context) = 0x0c;
SET_CFLAG(&context);
AH_reg(context) = 0x0c;
SET_CFLAG(context);
break;
case 0x06: /* FORMAT TRACK AND SET BAD SECTOR FLAGS */
case 0x07: /* FORMAT DRIVE STARTING AT GIVEN TRACK */
AH_reg(&context) = 0x0c;
AH_reg(context) = 0x0c;
break;
case 0x08: /* GET DRIVE PARAMETERS */
AH_reg(&context) = (DL_reg(&context) & 0x80) ? 0x07 : 0x01;
SET_CFLAG(&context);
AH_reg(context) = (DL_reg(context) & 0x80) ? 0x07 : 0x01;
SET_CFLAG(context);
break;
case 0x09: /* INITIALIZE CONTROLLER WITH DRIVE PARAMETERS */
@ -43,18 +41,18 @@ void INT_Int13Handler( SIGCONTEXT context )
case 0x10: /* CHECK IF DRIVE READY */
case 0x11: /* RECALIBRATE DRIVE */
case 0x14: /* CONTROLLER INTERNAL DIAGNOSTIC */
AH_reg(&context) = 0;
AH_reg(context) = 0;
break;
case 0x0e: /* READ SECTOR BUFFER (XT only) */
case 0x0f: /* WRITE SECTOR BUFFER (XT only) */
case 0x12: /* CONTROLLER RAM DIAGNOSTIC (XT,PS) */
case 0x13: /* DRIVE DIAGNOSTIC (XT,PS) */
AH_reg(&context) = 0x01;
SET_CFLAG(&context);
AH_reg(context) = 0x01;
SET_CFLAG(context);
break;
default:
INT_BARF( &context, 0x13 );
INT_BARF( context, 0x13 );
}
}

View File

@ -2,8 +2,6 @@
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include "registers.h"
#include "wine.h"
#include "options.h"
#include "miscemu.h"
#include "stddebug.h"
@ -42,19 +40,19 @@ DWORD INT1A_GetTicksSinceMidnight(void)
*
* Handler for int 1ah (date and time).
*/
void INT_Int1aHandler( SIGCONTEXT context )
void INT_Int1aHandler( SIGCONTEXT *context )
{
time_t ltime;
DWORD ticks;
struct tm *bdtime;
switch(AH_reg(&context))
switch(AH_reg(context))
{
case 0:
ticks = INT1A_GetTicksSinceMidnight();
CX_reg(&context) = HIWORD(ticks);
DX_reg(&context) = LOWORD(ticks);
AX_reg(&context) = 0; /* No midnight rollover */
CX_reg(context) = HIWORD(ticks);
DX_reg(context) = LOWORD(ticks);
AX_reg(context) = 0; /* No midnight rollover */
dprintf_int(stddeb,"int1a_00 // ticks=%ld\n", ticks);
break;
@ -62,17 +60,17 @@ void INT_Int1aHandler( SIGCONTEXT context )
ltime = time(NULL);
bdtime = localtime(&ltime);
CX_reg(&context) = (BIN_TO_BCD(bdtime->tm_hour)<<8) |
BIN_TO_BCD(bdtime->tm_min);
DX_reg(&context) = (BIN_TO_BCD(bdtime->tm_sec)<<8);
CX_reg(context) = (BIN_TO_BCD(bdtime->tm_hour)<<8) |
BIN_TO_BCD(bdtime->tm_min);
DX_reg(context) = (BIN_TO_BCD(bdtime->tm_sec)<<8);
case 4:
ltime = time(NULL);
bdtime = localtime(&ltime);
CX_reg(&context) = (BIN_TO_BCD(bdtime->tm_year/100)<<8) |
BIN_TO_BCD((bdtime->tm_year-1900)%100);
DX_reg(&context) = (BIN_TO_BCD(bdtime->tm_mon)<<8) |
BIN_TO_BCD(bdtime->tm_mday);
CX_reg(context) = (BIN_TO_BCD(bdtime->tm_year/100)<<8) |
BIN_TO_BCD((bdtime->tm_year-1900)%100);
DX_reg(context) = (BIN_TO_BCD(bdtime->tm_mon)<<8) |
BIN_TO_BCD(bdtime->tm_mday);
break;
/* setting the time,date or RTC is not allow -EB */
@ -89,6 +87,6 @@ void INT_Int1aHandler( SIGCONTEXT context )
break;
default:
INT_BARF( &context, 0x1a );
INT_BARF( context, 0x1a );
}
}

View File

@ -20,7 +20,6 @@
#include "file.h"
#include "windows.h"
#include "msdos.h"
#include "registers.h"
#include "ldt.h"
#include "task.h"
#include "options.h"
@ -901,27 +900,27 @@ extern void LOCAL_PrintHeap (WORD ds);
/***********************************************************************
* DOS3Call (KERNEL.102)
*/
void DOS3Call( SIGCONTEXT context )
void DOS3Call( SIGCONTEXT *context )
{
dprintf_int( stddeb, "int21: AX=%04x BX=%04x CX=%04x DX=%04x "
"SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
AX_reg(&context), BX_reg(&context), CX_reg(&context),
DX_reg(&context), SI_reg(&context), DI_reg(&context),
DS_reg(&context), ES_reg(&context), EFL_reg(&context));
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
DS_reg(context), ES_reg(context), EFL_reg(context));
if (AH_reg(&context) == 0x59) /* Get extended error info */
if (AH_reg(context) == 0x59) /* Get extended error info */
{
AX_reg(&context) = DOS_ExtendedError;
BH_reg(&context) = DOS_ErrorClass;
BL_reg(&context) = DOS_ErrorAction;
CH_reg(&context) = DOS_ErrorLocus;
AX_reg(context) = DOS_ExtendedError;
BH_reg(context) = DOS_ErrorClass;
BL_reg(context) = DOS_ErrorAction;
CH_reg(context) = DOS_ErrorLocus;
return;
}
DOS_ERROR( 0, 0, 0, 0 );
RESET_CFLAG(&context); /* Not sure if this is a good idea */
RESET_CFLAG(context); /* Not sure if this is a good idea */
switch(AH_reg(&context))
switch(AH_reg(context))
{
case 0x00: /* TERMINATE PROGRAM */
TASK_KillCurrentTask( 0 );
@ -957,7 +956,7 @@ void DOS3Call( SIGCONTEXT context )
"SWITCHAR" - SET SWITCH CHARACTER
"AVAILDEV" - SPECIFY \DEV\ PREFIX USE */
case 0x54: /* GET VERIFY FLAG */
INT_BARF( &context, 0x21 );
INT_BARF( context, 0x21 );
break;
case 0x18: /* NULL FUNCTIONS FOR CP/M COMPATIBILITY */
@ -965,322 +964,323 @@ void DOS3Call( SIGCONTEXT context )
case 0x1e:
case 0x20:
case 0x6b: /* NULL FUNCTION */
AL_reg(&context) = 0;
AL_reg(context) = 0;
break;
case 0x5c: /* "FLOCK" - RECORD LOCKING */
fLock(&context);
fLock(context);
break;
case 0x0d: /* DISK BUFFER FLUSH */
RESET_CFLAG(&context); /* dos 6+ only */
RESET_CFLAG(context); /* dos 6+ only */
break;
case 0x0e: /* SELECT DEFAULT DRIVE */
DRIVE_SetCurrentDrive( DL_reg(&context) );
AL_reg(&context) = MAX_DOS_DRIVES;
DRIVE_SetCurrentDrive( DL_reg(context) );
AL_reg(context) = MAX_DOS_DRIVES;
break;
case 0x11: /* FIND FIRST MATCHING FILE USING FCB */
if (!INT21_FindFirstFCB(&context))
if (!INT21_FindFirstFCB(context))
{
AL_reg(&context) = 0xff;
AL_reg(context) = 0xff;
break;
}
/* else fall through */
case 0x12: /* FIND NEXT MATCHING FILE USING FCB */
AL_reg(&context) = INT21_FindNextFCB(&context) ? 0x00 : 0xff;
AL_reg(context) = INT21_FindNextFCB(context) ? 0x00 : 0xff;
break;
case 0x13: /* DELETE FILE USING FCB */
DeleteFileFCB(&context);
DeleteFileFCB(context);
break;
case 0x17: /* RENAME FILE USING FCB */
RenameFileFCB(&context);
RenameFileFCB(context);
break;
case 0x19: /* GET CURRENT DEFAULT DRIVE */
AL_reg(&context) = DRIVE_GetCurrentDrive();
AL_reg(context) = DRIVE_GetCurrentDrive();
break;
case 0x1a: /* SET DISK TRANSFER AREA ADDRESS */
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
pTask->dta = PTR_SEG_OFF_TO_SEGPTR(DS_reg(&context),DX_reg(&context));
pTask->dta = PTR_SEG_OFF_TO_SEGPTR(DS_reg(context),DX_reg(context));
dprintf_int(stddeb, "int21: Set DTA: %08lx\n", pTask->dta);
}
break;
case 0x1b: /* GET ALLOCATION INFORMATION FOR DEFAULT DRIVE */
DL_reg(&context) = 0;
if (!INT21_GetDriveAllocInfo(&context)) AX_reg(&context) = 0xffff;
DL_reg(context) = 0;
if (!INT21_GetDriveAllocInfo(context)) AX_reg(context) = 0xffff;
break;
case 0x1c: /* GET ALLOCATION INFORMATION FOR SPECIFIC DRIVE */
if (!INT21_GetDriveAllocInfo(&context)) AX_reg(&context) = 0xffff;
if (!INT21_GetDriveAllocInfo(context)) AX_reg(context) = 0xffff;
break;
case 0x1f: /* GET DRIVE PARAMETER BLOCK FOR DEFAULT DRIVE */
GetDrivePB(&context, DRIVE_GetCurrentDrive());
GetDrivePB(context, DRIVE_GetCurrentDrive());
break;
case 0x25: /* SET INTERRUPT VECTOR */
INT_SetHandler( AL_reg(&context),
PTR_SEG_OFF_TO_SEGPTR( DS_reg(&context), DX_reg(&context)));
INT_SetHandler( AL_reg(context),
(FARPROC16)PTR_SEG_OFF_TO_SEGPTR( DS_reg(context),
DX_reg(context)));
break;
case 0x2a: /* GET SYSTEM DATE */
GetSystemDate(&context);
GetSystemDate(context);
break;
case 0x2b: /* SET SYSTEM DATE */
fprintf( stdnimp, "SetSystemDate(%02d/%02d/%04d): not allowed\n",
DL_reg(&context), DH_reg(&context), CX_reg(&context) );
AL_reg(&context) = 0; /* Let's pretend we succeeded */
DL_reg(context), DH_reg(context), CX_reg(context) );
AL_reg(context) = 0; /* Let's pretend we succeeded */
break;
case 0x2c: /* GET SYSTEM TIME */
INT21_GetSystemTime(&context);
INT21_GetSystemTime(context);
break;
case 0x2d: /* SET SYSTEM TIME */
fprintf( stdnimp, "SetSystemTime(%02d:%02d:%02d.%02d): not allowed\n",
CH_reg(&context), CL_reg(&context),
DH_reg(&context), DL_reg(&context) );
AL_reg(&context) = 0; /* Let's pretend we succeeded */
CH_reg(context), CL_reg(context),
DH_reg(context), DL_reg(context) );
AL_reg(context) = 0; /* Let's pretend we succeeded */
break;
case 0x2f: /* GET DISK TRANSFER AREA ADDRESS */
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
ES_reg(&context) = SELECTOROF( pTask->dta );
BX_reg(&context) = OFFSETOF( pTask->dta );
ES_reg(context) = SELECTOROF( pTask->dta );
BX_reg(context) = OFFSETOF( pTask->dta );
}
break;
case 0x30: /* GET DOS VERSION */
AX_reg(&context) = DOSVERSION;
BX_reg(&context) = 0x0012; /* 0x123456 is Wine's serial # */
CX_reg(&context) = 0x3456;
AX_reg(context) = DOSVERSION;
BX_reg(context) = 0x0012; /* 0x123456 is Wine's serial # */
CX_reg(context) = 0x3456;
break;
case 0x31: /* TERMINATE AND STAY RESIDENT */
INT_BARF( &context, 0x21 );
INT_BARF( context, 0x21 );
break;
case 0x32: /* GET DOS DRIVE PARAMETER BLOCK FOR SPECIFIC DRIVE */
GetDrivePB(&context, DOS_GET_DRIVE( DL_reg(&context) ) );
GetDrivePB(context, DOS_GET_DRIVE( DL_reg(context) ) );
break;
case 0x33: /* MULTIPLEXED */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x00: /* GET CURRENT EXTENDED BREAK STATE */
DL_reg(&context) = 0;
DL_reg(context) = 0;
break;
case 0x01: /* SET EXTENDED BREAK STATE */
break;
case 0x02: /* GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE*/
DL_reg(&context) = 0;
DL_reg(context) = 0;
break;
case 0x05: /* GET BOOT DRIVE */
DL_reg(&context) = 2;
DL_reg(context) = 2;
/* c: is Wine's bootdrive */
break;
case 0x06: /* GET TRUE VERSION NUMBER */
BX_reg(&context) = DOSVERSION;
DX_reg(&context) = 0x00;
BX_reg(context) = DOSVERSION;
DX_reg(context) = 0x00;
break;
default:
INT_BARF( &context, 0x21 );
INT_BARF( context, 0x21 );
break;
}
break;
case 0x34: /* GET ADDRESS OF INDOS FLAG */
ES_reg(&context) = DosHeapHandle;
BX_reg(&context) = (int)&heap->InDosFlag - (int)heap;
ES_reg(context) = DosHeapHandle;
BX_reg(context) = (int)&heap->InDosFlag - (int)heap;
break;
case 0x35: /* GET INTERRUPT VECTOR */
{
SEGPTR addr = INT_GetHandler( AL_reg(&context) );
ES_reg(&context) = SELECTOROF(addr);
BX_reg(&context) = OFFSETOF(addr);
FARPROC16 addr = INT_GetHandler( AL_reg(context) );
ES_reg(context) = SELECTOROF(addr);
BX_reg(context) = OFFSETOF(addr);
}
break;
case 0x36: /* GET FREE DISK SPACE */
if (!INT21_GetFreeDiskSpace(&context)) AX_reg(&context) = 0xffff;
if (!INT21_GetFreeDiskSpace(context)) AX_reg(context) = 0xffff;
break;
case 0x38: /* GET COUNTRY-SPECIFIC INFORMATION */
AX_reg(&context) = 0x02; /* no country support available */
SET_CFLAG(&context);
AX_reg(context) = 0x02; /* no country support available */
SET_CFLAG(context);
break;
case 0x39: /* "MKDIR" - CREATE SUBDIRECTORY */
if (!CreateDirectory32A( PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) ), NULL))
if (!CreateDirectory32A( PTR_SEG_OFF_TO_LIN( DS_reg(context),
DX_reg(context) ), NULL))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x3a: /* "RMDIR" - REMOVE SUBDIRECTORY */
if (!RemoveDirectory32A( PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) )))
if (!RemoveDirectory32A( PTR_SEG_OFF_TO_LIN( DS_reg(context),
DX_reg(context) )))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x3b: /* "CHDIR" - SET CURRENT DIRECTORY */
INT21_ChangeDir(&context);
INT21_ChangeDir(context);
break;
case 0x3c: /* "CREAT" - CREATE OR TRUNCATE FILE */
AX_reg(&context) = _lcreat( PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) ), CX_reg(&context) );
if (AX_reg(&context) == (WORD)HFILE_ERROR)
AX_reg(context) = _lcreat( PTR_SEG_OFF_TO_LIN( DS_reg(context),
DX_reg(context) ), CX_reg(context) );
if (AX_reg(context) == (WORD)HFILE_ERROR)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x3d: /* "OPEN" - OPEN EXISTING FILE */
OpenExistingFile(&context);
OpenExistingFile(context);
break;
case 0x3e: /* "CLOSE" - CLOSE FILE */
if ((AX_reg(&context) = _lclose( BX_reg(&context) )) != 0)
if ((AX_reg(context) = _lclose( BX_reg(context) )) != 0)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x3f: /* "READ" - READ FROM FILE OR DEVICE */
{
LONG result = _hread( BX_reg(&context),
PTR_SEG_OFF_TO_SEGPTR( DS_reg(&context),
DX_reg(&context) ),
CX_reg(&context) );
LONG result = _hread( BX_reg(context),
PTR_SEG_OFF_TO_SEGPTR( DS_reg(context),
DX_reg(context) ),
CX_reg(context) );
if (result == -1)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else AX_reg(&context) = (WORD)result;
else AX_reg(context) = (WORD)result;
}
break;
case 0x40: /* "WRITE" - WRITE TO FILE OR DEVICE */
{
LONG result = _hwrite( BX_reg(&context),
PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) ),
CX_reg(&context) );
LONG result = _hwrite( BX_reg(context),
PTR_SEG_OFF_TO_LIN( DS_reg(context),
DX_reg(context) ),
CX_reg(context) );
if (result == -1)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else AX_reg(&context) = (WORD)result;
else AX_reg(context) = (WORD)result;
}
break;
case 0x41: /* "UNLINK" - DELETE FILE */
if (!DeleteFile32A( PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) )))
if (!DeleteFile32A( PTR_SEG_OFF_TO_LIN( DS_reg(context),
DX_reg(context) )))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x42: /* "LSEEK" - SET CURRENT FILE POSITION */
{
LONG status = _llseek( BX_reg(&context),
MAKELONG(DX_reg(&context),CX_reg(&context)),
AL_reg(&context) );
LONG status = _llseek( BX_reg(context),
MAKELONG(DX_reg(context),CX_reg(context)),
AL_reg(context) );
if (status == HFILE_ERROR)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
break;
}
AX_reg(&context) = LOWORD(status);
DX_reg(&context) = HIWORD(status);
AX_reg(context) = LOWORD(status);
DX_reg(context) = HIWORD(status);
}
break;
case 0x43: /* FILE ATTRIBUTES */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x00:
if (!INT21_GetFileAttribute(&context))
if (!INT21_GetFileAttribute(context))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x01:
RESET_CFLAG(&context);
RESET_CFLAG(context);
break;
}
break;
case 0x44: /* IOCTL */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x00:
ioctlGetDeviceInfo(&context);
ioctlGetDeviceInfo(context);
break;
case 0x01:
break;
case 0x08: /* Check if drive is removable. */
switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(&context) )))
switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(context) )))
{
case DRIVE_CANNOTDETERMINE:
DOS_ERROR( ER_InvalidDrive, EC_NotFound, SA_Abort, EL_Disk );
AX_reg(&context) = ER_InvalidDrive;
SET_CFLAG(&context);
AX_reg(context) = ER_InvalidDrive;
SET_CFLAG(context);
break;
case DRIVE_REMOVABLE:
AX_reg(&context) = 0; /* removable */
AX_reg(context) = 0; /* removable */
break;
default:
AX_reg(&context) = 1; /* not removable */
AX_reg(context) = 1; /* not removable */
break;
}
break;
case 0x09: /* CHECK IF BLOCK DEVICE REMOTE */
switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(&context) )))
switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(context) )))
{
case DRIVE_CANNOTDETERMINE:
DOS_ERROR( ER_InvalidDrive, EC_NotFound, SA_Abort, EL_Disk );
AX_reg(&context) = ER_InvalidDrive;
SET_CFLAG(&context);
AX_reg(context) = ER_InvalidDrive;
SET_CFLAG(context);
break;
case DRIVE_REMOTE:
DX_reg(&context) = (1<<9) | (1<<12); /* remote */
DX_reg(context) = (1<<9) | (1<<12); /* remote */
break;
default:
DX_reg(&context) = 0; /* FIXME: use driver attr here */
DX_reg(context) = 0; /* FIXME: use driver attr here */
break;
}
break;
@ -1289,97 +1289,97 @@ void DOS3Call( SIGCONTEXT context )
/* returns DX, bit 15 set if remote, bit 14 set if date/time
* not set on close
*/
DX_reg(&context) = 0;
DX_reg(context) = 0;
break;
case 0x0b: /* SET SHARING RETRY COUNT */
if (!CX_reg(&context))
if (!CX_reg(context))
{
AX_reg(&context) = 1;
SET_CFLAG(&context);
AX_reg(context) = 1;
SET_CFLAG(context);
break;
}
sharing_pause = CX_reg(&context);
if (!DX_reg(&context))
sharing_retries = DX_reg(&context);
RESET_CFLAG(&context);
sharing_pause = CX_reg(context);
if (!DX_reg(context))
sharing_retries = DX_reg(context);
RESET_CFLAG(context);
break;
case 0x0d:
ioctlGenericBlkDevReq(&context);
ioctlGenericBlkDevReq(context);
break;
case 0x0F: /* Set logical drive mapping */
/* FIXME: Not implemented at the moment, always returns error
*/
INT_BARF( &context, 0x21 );
AX_reg(&context) = 0x0001; /* invalid function */
SET_CFLAG(&context);
INT_BARF( context, 0x21 );
AX_reg(context) = 0x0001; /* invalid function */
SET_CFLAG(context);
break;
default:
INT_BARF( &context, 0x21 );
INT_BARF( context, 0x21 );
break;
}
break;
case 0x45: /* "DUP" - DUPLICATE FILE HANDLE */
if ((AX_reg(&context) = FILE_Dup(BX_reg(&context))) == (WORD)HFILE_ERROR)
if ((AX_reg(context) = FILE_Dup(BX_reg(context))) == (WORD)HFILE_ERROR)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x46: /* "DUP2", "FORCEDUP" - FORCE DUPLICATE FILE HANDLE */
if (FILE_Dup2( BX_reg(&context), CX_reg(&context) ) == HFILE_ERROR)
if (FILE_Dup2( BX_reg(context), CX_reg(context) ) == HFILE_ERROR)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x47: /* "CWD" - GET CURRENT DIRECTORY */
if (!INT21_GetCurrentDirectory(&context))
if (!INT21_GetCurrentDirectory(context))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else AX_reg(&context) = 0x0100;
else AX_reg(context) = 0x0100;
/* intlist: many Microsoft products for Windows rely on this */
break;
case 0x48: /* ALLOCATE MEMORY */
case 0x49: /* FREE MEMORY */
case 0x4a: /* RESIZE MEMORY BLOCK */
INT_BARF( &context, 0x21 );
INT_BARF( context, 0x21 );
break;
case 0x4b: /* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */
AX_reg(&context) = WinExec( PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) ),
AX_reg(context) = WinExec( PTR_SEG_OFF_TO_LIN( DS_reg(context),
DX_reg(context) ),
SW_NORMAL );
if (AX_reg(&context) < 32) SET_CFLAG(&context);
if (AX_reg(context) < 32) SET_CFLAG(context);
break;
case 0x4c: /* "EXIT" - TERMINATE WITH RETURN CODE */
TASK_KillCurrentTask( AL_reg(&context) );
TASK_KillCurrentTask( AL_reg(context) );
break;
case 0x4d: /* GET RETURN CODE */
AX_reg(&context) = 0; /* normal exit */
AX_reg(context) = 0; /* normal exit */
break;
case 0x4e: /* "FINDFIRST" - FIND FIRST MATCHING FILE */
if (!INT21_FindFirst(&context)) break;
if (!INT21_FindFirst(context)) break;
/* fall through */
case 0x4f: /* "FINDNEXT" - FIND NEXT MATCHING FILE */
if (!INT21_FindNext(&context))
if (!INT21_FindNext(context))
{
DOS_ERROR( ER_NoMoreFiles, EC_MediaError, SA_Abort, EL_Disk );
AX_reg(&context) = ER_NoMoreFiles;
SET_CFLAG(&context);
AX_reg(context) = ER_NoMoreFiles;
SET_CFLAG(context);
}
break;
@ -1387,75 +1387,75 @@ void DOS3Call( SIGCONTEXT context )
case 0x62: /* GET PSP ADDRESS */
/* FIXME: should we return the original DOS PSP upon */
/* Windows startup ? */
BX_reg(&context) = GetCurrentPDB();
BX_reg(context) = GetCurrentPDB();
break;
case 0x52: /* "SYSVARS" - GET LIST OF LISTS */
ES_reg(&context) = 0x0;
BX_reg(&context) = 0x0;
INT_BARF( &context, 0x21 );
ES_reg(context) = 0x0;
BX_reg(context) = 0x0;
INT_BARF( context, 0x21 );
break;
case 0x56: /* "RENAME" - RENAME FILE */
if (!INT21_RenameFile(&context))
if (!INT21_RenameFile(context))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x57: /* FILE DATE AND TIME */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x00: /* Get */
if (!FILE_GetDateTime( BX_reg(&context), &DX_reg(&context),
&CX_reg(&context), TRUE ))
if (!FILE_GetDateTime( BX_reg(context), &DX_reg(context),
&CX_reg(context), TRUE ))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x01: /* Set */
if (!FILE_SetDateTime( BX_reg(&context), DX_reg(&context),
CX_reg(&context) ))
if (!FILE_SetDateTime( BX_reg(context), DX_reg(context),
CX_reg(context) ))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
}
break;
case 0x58: /* GET OR SET MEMORY/UMB ALLOCATION STRATEGY */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x00:
AX_reg(&context) = 1;
AX_reg(context) = 1;
break;
case 0x02:
AX_reg(&context) = 0;
AX_reg(context) = 0;
break;
case 0x01:
case 0x03:
break;
}
RESET_CFLAG(&context);
RESET_CFLAG(context);
break;
case 0x5a: /* CREATE TEMPORARY FILE */
if (!INT21_CreateTempFile(&context))
if (!INT21_CreateTempFile(context))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x5b: /* CREATE NEW FILE */
if ((AX_reg(&context) = _lcreat_uniq( PTR_SEG_OFF_TO_LIN(DS_reg(&context),DX_reg(&context)), 0 )) == (WORD)HFILE_ERROR)
if ((AX_reg(context) = _lcreat_uniq( PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context)), 0 )) == (WORD)HFILE_ERROR)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
@ -1463,54 +1463,54 @@ void DOS3Call( SIGCONTEXT context )
case 0x5e:
/* network software not installed */
DOS_ERROR( ER_NoNetwork, EC_NotFound, SA_Abort, EL_Network );
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
break;
case 0x5f: /* NETWORK */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x07: /* ENABLE DRIVE */
if (!DRIVE_Enable( DL_reg(&context) ))
if (!DRIVE_Enable( DL_reg(context) ))
{
DOS_ERROR( ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk );
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x08: /* DISABLE DRIVE */
if (!DRIVE_Disable( DL_reg(&context) ))
if (!DRIVE_Disable( DL_reg(context) ))
{
DOS_ERROR( ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk );
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
default:
/* network software not installed */
DOS_ERROR( ER_NoNetwork, EC_NotFound, SA_Abort, EL_Network );
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
break;
}
break;
case 0x60: /* "TRUENAME" - CANONICALIZE FILENAME OR PATH */
{
const char *truename = DOSFS_GetDosTrueName( PTR_SEG_OFF_TO_LIN(DS_reg(&context),SI_reg(&context) ), FALSE );
const char *truename = DOSFS_GetDosTrueName( PTR_SEG_OFF_TO_LIN(DS_reg(context),SI_reg(context) ), FALSE );
if (!truename)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else
{
lstrcpyn32A( PTR_SEG_OFF_TO_LIN( ES_reg(&context),
DI_reg(&context) ),
lstrcpyn32A( PTR_SEG_OFF_TO_LIN( ES_reg(context),
DI_reg(context) ),
truename, 128 );
AX_reg(&context) = 0;
AX_reg(context) = 0;
}
}
break;
@ -1519,66 +1519,66 @@ void DOS3Call( SIGCONTEXT context )
case 0x63: /* UNUSED */
case 0x64: /* OS/2 DOS BOX */
case 0x65: /* GET EXTENDED COUNTRY INFORMATION */
INT_BARF( &context, 0x21 );
SET_CFLAG(&context);
INT_BARF( context, 0x21 );
SET_CFLAG(context);
break;
case 0x66: /* GLOBAL CODE PAGE TABLE */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x01:
DX_reg(&context) = BX_reg(&context) = CodePage;
RESET_CFLAG(&context);
DX_reg(context) = BX_reg(context) = CodePage;
RESET_CFLAG(context);
break;
case 0x02:
CodePage = BX_reg(&context);
RESET_CFLAG(&context);
CodePage = BX_reg(context);
RESET_CFLAG(context);
break;
}
break;
case 0x67: /* SET HANDLE COUNT */
SetHandleCount( BX_reg(&context) );
SetHandleCount( BX_reg(context) );
if (DOS_ExtendedError)
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x68: /* "FFLUSH" - COMMIT FILE */
case 0x6a: /* COMMIT FILE */
if (!FlushFileBuffers( BX_reg(&context) ))
if (!FlushFileBuffers( BX_reg(context) ))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
break;
case 0x69: /* DISK SERIAL NUMBER */
switch (AL_reg(&context))
switch (AL_reg(context))
{
case 0x00:
if (!INT21_GetDiskSerialNumber(&context))
if (!INT21_GetDiskSerialNumber(context))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else AX_reg(&context) = 0;
else AX_reg(context) = 0;
break;
case 0x01:
if (!INT21_SetDiskSerialNumber(&context))
if (!INT21_SetDiskSerialNumber(context))
{
AX_reg(&context) = DOS_ExtendedError;
SET_CFLAG(&context);
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else AX_reg(&context) = 1;
else AX_reg(context) = 1;
break;
}
break;
case 0x6C: /* Extended Open/Create*/
ExtendedOpenCreateFile(&context);
ExtendedOpenCreateFile(context);
break;
case 0x70: /* MS-DOS 7 (Windows95) - ??? (country-specific?)*/
@ -1586,10 +1586,10 @@ void DOS3Call( SIGCONTEXT context )
case 0x72: /* MS-DOS 7 (Windows95) - ??? */
case 0x73: /* MS-DOS 7 (Windows95) - DRIVE LOCKING ??? */
dprintf_int(stddeb,"int21: windows95 function AX %04x\n",
AX_reg(&context));
AX_reg(context));
dprintf_int(stddeb, " returning unimplemented\n");
SET_CFLAG(&context);
AL_reg(&context) = 0;
SET_CFLAG(context);
AL_reg(context) = 0;
break;
case 0xdc: /* CONNECTION SERVICES - GET CONNECTION NUMBER */
@ -1597,18 +1597,18 @@ void DOS3Call( SIGCONTEXT context )
break;
default:
INT_BARF( &context, 0x21 );
INT_BARF( context, 0x21 );
break;
}
dprintf_int( stddeb, "ret21: AX=%04x BX=%04x CX=%04x DX=%04x "
"SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
AX_reg(&context), BX_reg(&context), CX_reg(&context),
DX_reg(&context), SI_reg(&context), DI_reg(&context),
DS_reg(&context), ES_reg(&context), EFL_reg(&context));
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
DS_reg(context), ES_reg(context), EFL_reg(context));
}
BOOL INT21_Init(void)
BOOL32 INT21_Init(void)
{
if (!(DosHeapHandle = GlobalAlloc16(GMEM_FIXED,sizeof(struct DosHeap))))
{

View File

@ -1,10 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "registers.h"
#include "msdos.h"
#include "ldt.h"
#include "wine.h"
#include "miscemu.h"
#include "drive.h"
#include "stddebug.h"
@ -16,19 +14,19 @@
*
* Handler for int 25h (absolute disk read).
*/
void INT_Int25Handler( SIGCONTEXT context )
void INT_Int25Handler( SIGCONTEXT *context )
{
BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(&context), BX_reg(&context) );
BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(context), BX_reg(context) );
DWORD begin, length;
if (!DRIVE_IsValid(AL_reg(&context)))
if (!DRIVE_IsValid(AL_reg(context)))
{
SET_CFLAG(&context);
AX_reg(&context) = 0x0101; /* unknown unit */
SET_CFLAG(context);
AX_reg(context) = 0x0101; /* unknown unit */
return;
}
if (CX_reg(&context) == 0xffff)
if (CX_reg(context) == 0xffff)
{
begin = *(DWORD *)dataptr;
length = *(WORD *)(dataptr + 4);
@ -36,12 +34,12 @@ void INT_Int25Handler( SIGCONTEXT context )
}
else
{
begin = DX_reg(&context);
length = CX_reg(&context);
begin = DX_reg(context);
length = CX_reg(context);
}
dprintf_int( stdnimp, "int25: abs diskread, drive %d, sector %ld, "
"count %ld, buffer %d\n",
AL_reg(&context), begin, length, (int) dataptr);
AL_reg(context), begin, length, (int) dataptr);
memset(dataptr, 0, length * 512);
@ -49,5 +47,5 @@ void INT_Int25Handler( SIGCONTEXT context )
if (begin == 1) *dataptr = 0xf8;
RESET_CFLAG(&context);
RESET_CFLAG(context);
}

View File

@ -1,9 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "registers.h"
#include "msdos.h"
#include "ldt.h"
#include "wine.h"
#include "miscemu.h"
#include "drive.h"
#include "stddebug.h"
@ -15,19 +13,19 @@
*
* Handler for int 26h (absolute disk read).
*/
void INT_Int26Handler( SIGCONTEXT context )
void INT_Int26Handler( SIGCONTEXT *context )
{
BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(&context), BX_reg(&context) );
BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(context), BX_reg(context) );
DWORD begin, length;
if (!DRIVE_IsValid(AL_reg(&context)))
if (!DRIVE_IsValid(AL_reg(context)))
{
SET_CFLAG(&context);
AX_reg(&context) = 0x0101; /* unknown unit */
SET_CFLAG(context);
AX_reg(context) = 0x0101; /* unknown unit */
return;
}
if (CX_reg(&context) == 0xffff)
if (CX_reg(context) == 0xffff)
{
begin = *(DWORD *)dataptr;
length = *(WORD *)(dataptr + 4);
@ -35,13 +33,13 @@ void INT_Int26Handler( SIGCONTEXT context )
}
else
{
begin = DX_reg(&context);
length = CX_reg(&context);
begin = DX_reg(context);
length = CX_reg(context);
}
dprintf_int( stdnimp,"int26: abs diskwrite, drive %d, sector %ld, "
"count %ld, buffer %d\n",
AL_reg(&context), begin, length, (int) dataptr );
AL_reg(context), begin, length, (int) dataptr );
RESET_CFLAG(&context);
RESET_CFLAG(context);
}

View File

@ -1,8 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include "msdos.h"
#include "wine.h"
#include "registers.h"
#include "miscemu.h"
#include "stddebug.h"
/* #define DEBUG_INT */
@ -13,14 +11,14 @@
*
* Handler for int 2ah (network).
*/
void INT_Int2aHandler( SIGCONTEXT context )
void INT_Int2aHandler( SIGCONTEXT *context )
{
switch(AH_reg(&context))
switch(AH_reg(context))
{
case 0x00: /* NETWORK INSTALLATION CHECK */
break;
default:
INT_BARF( &context, 0x2a );
INT_BARF( context, 0x2a );
}
}

View File

@ -2,9 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "registers.h"
#include "ldt.h"
#include "wine.h"
#include "drive.h"
#include "msdos.h"
#include "miscemu.h"
@ -25,24 +23,24 @@ void do_mscdex( SIGCONTEXT *context );
*
* Handler for int 2fh (multiplex).
*/
void INT_Int2fHandler( SIGCONTEXT context )
void INT_Int2fHandler( SIGCONTEXT *context )
{
switch(AH_reg(&context))
switch(AH_reg(context))
{
case 0x10:
AL_reg(&context) = 0xff; /* share is installed */
AL_reg(context) = 0xff; /* share is installed */
break;
case 0x15: /* mscdex */
do_mscdex(&context);
do_mscdex(context);
break;
case 0x16:
do_int2f_16( &context );
do_int2f_16( context );
break;
case 0x4a:
switch(AL_reg(&context))
switch(AL_reg(context))
{
case 0x10: /* smartdrv */
break; /* not installed */
@ -51,14 +49,14 @@ void INT_Int2fHandler( SIGCONTEXT context )
case 0x12: /* realtime compression interface */
break; /* not installed */
default:
INT_BARF( &context, 0x2f );
INT_BARF( context, 0x2f );
}
break;
case 0xb7: /* append */
AL_reg(&context) = 0; /* not installed */
AL_reg(context) = 0; /* not installed */
break;
default:
INT_BARF( &context, 0x2f );
INT_BARF( context, 0x2f );
break;
}
}
@ -100,8 +98,8 @@ static void do_int2f_16( SIGCONTEXT *context )
break;
case 0x84: /* Get device API entry point */
addr = MODULE_GetEntryPoint( GetModuleHandle("WPROCS"),
VXD_BASE + BX_reg(context) );
addr = (DWORD)MODULE_GetEntryPoint( GetModuleHandle("WPROCS"),
VXD_BASE + BX_reg(context) );
if (!addr) /* not supported */
{
fprintf( stderr,"Application attempted to access VxD %04x\n",

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