Release 970914

Thu Sep 11 18:24:56 1997  Philippe De Muyter  <phdm@info.ucl.ac.be>

	* [objects/dc.c]
	In DC_SetupGCForPatBlt, replace R2_NOT by GXxor with (black xor white).

Tue Sep  9 23:04:02 1997  U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [memory/virtual.c] 
	Do not write debugging info unconditionally to stderr.

	* [files/profile.c]
	Call PROFILE_GetSection in PROFILE_GetString for key_name "" too.

	* [misc/crtdll.c]
	Many new functions.

	* [include/windows.h] [windows/winpos.c]
	ClientToScreen16 doesn't have a return value.

Sun Sep  7 10:06:39 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [misc/main.c] [AUTHORS]
	Update the list of contributors. Please let me know if I forgot
	someone.

	* [if1632/*.spec] [if1632/builtin.c] [tools/build.c]
	Ordinal base for Win32 DLLs is now computed automatically from the
	lowest ordinal found.

	* [include/wintypes.h]
	WINAPI is now defined as attribute((stdcall)). This will require
	gcc to compile.

	* [if1632/thunk.c]
	Removed Win32 thunks (no longer needed with stdcall).

	* [if1632/crtdll.spec] [misc/crtdll.c]
	Make sure we only reference cdecl functions in the spec file.

	* [objects/dc.c]
	Use CapNotLast drawing style for 1-pixel wide lines.

	* [tools/build.c]
	Added 'double' argument type.
	Added 'varargs' function type for Win32.
	Made CallTo16_xxx functions stdcall.

Fri Sep  5 14:50:49 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [tools/build.c] [windows/win.c] [windows/event.c] [windows/message.c]
	More fixes to get message exchange closer to the original.

	* [misc/spy.c]
	Message logs now contain window names.

	* [loader/resource.c] [loader/ne_resource.c] [loader/task.c]
	  [objects/cursoricon.c] [windows/user.c]
	Added some obscure features to fix memory leaks.

Fri Sep  5 00:46:28 1997  Jan Willamowius <jan@janhh.shnet.org>

	* [if1632/kernel32.spec] [win32/newfns.c]
	Added stub for UTRegister() and UTUnRegister().

Thu Sep  4 12:03:12 1997  Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
	* [controls/edit.c]
	Allow ASCII codes > 127 in WM_CHAR.

Mon Sep  1 17:23:24 1997  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [controls/widgets.c]
	In InitCommonControls, remember the name of the class
	because lpszClassName was made to point to a local array
	Added the ProgressBar to the list of implemented controls.
	Call InitCommonControls from WIDGETS_Init to register all
	implemented Common Controls.
	
	* [include/commctrl.h]
	Added misc decl for the Progress Bar.

	* [controls/progress.c] [include/progress.h]
	First attempt at implementiong the Progress Bar class.

	* [objects/brush.h]
	Implementation for GetSysColorBrush[16|32]

	* [controls/status.c]
	Use DrawEdge to draw the borders and fill the background

	* [controls/uitools.c]
	Added DrawDiagEdge32 and DrawRectEdge32

	* [graphics/painting.c]
	Implement DrawEdge[16|32]
	Started DrawFrameControl32

Mon Sep  1 10:07:09 1997  Lawson Whitney <lawson_whitney@juno.com>

	* [misc/comm.c] [include/windows.h]
	SetCommEventMask returns a SEGPTR.

Sun Aug 31 23:28:32 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [loader/pe_image.c][loader/module.c][include/pe_image.h]
	  [include/module.h]
	Cleaned up the whole Win32 library mess (a bit).

	* [debugger/stabs.c]
	If 'wine' has no absolute path and isn't found, check $PATH too.

	* [misc/ole2nls.c]
	Some fixes.

	* [misc/ver.c]
	Added support for PE style version resources.

	* [memory/string.c]
	Check for NULL pointers to _lstr* functions, just as Windows95 does.

	* [multimedia/time.c]
	Made list of timers a simple linked list.

	* [loader/resource.c]
	Netscape 3 seems to pass NEGATIVE resource Ids (in an
	unsigned int, yes). Don't know why, fixed it anyway.

	* [objects/bitmap.c]
	LoadImageW added.

	* [include/win.h][windows/win.c]
	Change wIDmenu from UINT16 to UINT32 and changed the
	SetWindow(Long|Word) accordingly.

Thu Aug 28 19:30:08 1997  Morten Welinder  <terra@diku.dk>

	* [include/windows.h]
	Add a few more colors defined for Win95.
	Add a few more brush styles.

	* [windows/syscolor.c]
 	Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
	GetSysColor16, GetSysColor32.  Add support for above colors.

Sun Aug 24 16:22:57 1997  Andrew Taylor <andrew@riscan.com>

	* [multimedia/mmsystem.c]
	Changed mmioDescend to use mmio functions for file I/O, neccessary
	for memory files.
This commit is contained in:
Alexandre Julliard 1997-09-14 17:17:23 +00:00
parent 670cdc45be
commit 77b9918e0e
149 changed files with 8838 additions and 6396 deletions

View File

@ -1,15 +1,15 @@
This is release 970824 of Wine, the MS Windows emulator. This is still a
This is release 970914 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-970824: (see ChangeLog for details)
- Better Win32 menu support.
- Improved Winsock.
- UpDown control.
- More undocumented Win95 hacks.
WHAT'S NEW with Wine-970914: (see ChangeLog for details)
- Better resource handling.
- New Progress control.
- Improved PE module support.
- Many relay code changes.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -18,10 +18,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970824.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970824.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970824.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-970824.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970914.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970914.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970914.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-970914.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

143
AUTHORS
View File

@ -4,28 +4,121 @@
@c This is a list of the Wine authors and copyright holders.
Wine is available thanks to the work of Bob Amstadt, Dag Asheim,
Martin Ayotte, Peter Bajusz, Ross Biro, Uwe Bonnes, Erik Bos, Fons
Botman, John Brezak, Andrew Bulhak, John Burton, Niels de Carpentier,
Jimen Ching, Huw D. M. Davies, Roman Dolejsi, Frans van Dorsselaer,
Paul Falstad, David Faure, Claus Fischer, Olaf Flebbe, Peter Galbavy,
Ramon Garcia, Matthew Ghio, Hans de Graaff, Charles M. Hannum, John
Harvey, Cameron Heide, Jochen Hoenicke, Onno Hovers, Jeffrey Hsu,
Miguel de Icaza, Jukka Iivonen, Lee Jaekil, Alexandre Julliard, Bang
Jun-Young, Pavel Kankovsky, Jochen Karrer, Andreas Kirschbaum,
Albrecht Kleine, Jon Konrath, Alex Korobka, Greg Kreider, Anand
Kumria, Scott A. Laird, Andrew Lewycky, Martin von Loewis, Kenneth
MacDonald, Peter MacDonald, William Magro, Juergen Marquardt, Ricardo
Massaro, Marcus Meissner, Graham Menhennitt, David Metcalfe, Bruce
Milner, Steffen Moeller, Andreas Mohr, Philippe De Muyter, Itai
Nahshon, Michael Patra, Jim Peterson, Robert Pouliot, Keith Reynolds,
Slaven Rezic, John Richardson, Johannes Ruscheinski, Thomas Sandford,
Constantine Sapuntzakis, Pablo Saratxaga, Daniel Schepler, Ulrich
Schmid, Bernd Schmidt, Yngvi Sigurjonsson, Stephen Simmons, Rick
Sladkey, William Smith, Dominik Strasser, Vadim Strizhevsky, Erik
Svendsen, Tristan Tarrant, Andrew Taylor, Duncan C Thomson, Goran
Thyni, Jimmy Tirtawangsa, Jon Tombs, Linus Torvalds, Gregory
Trubetskoy, Petri Tuomola, Michael Veksler, Sven Verdoolaege, Ronan
Waide, Eric Warnke, Manfred Weichel, Morten Welinder, Jan Willamowius,
Carl Williams, Karl Guenter Wuensch, Eric Youngdale, James Youngman,
Mikolaj Zalewski, and John Zero.
Wine is available thanks to the work of:
Bob Amstadt,
Dag Asheim,
Martin Ayotte,
Peter Bajusz,
Georg Beyerle,
Ross Biro,
Uwe Bonnes,
Erik Bos,
Fons Botman,
John Brezak,
Andrew Bulhak,
John Burton,
Niels de Carpentier,
Jimen Ching,
David A. Cuthbert,
Huw D. M. Davies,
Roman Dolejsi,
Frans van Dorsselaer,
Chris Faherty,
Paul Falstad,
David Faure,
Claus Fischer,
Olaf Flebbe,
Chad Fraleigh,
Peter Galbavy,
Ramon Garcia,
Matthew Ghio,
Jody Goldberg,
Hans de Graaff,
Charles M. Hannum,
Adrian Harvey,
John Harvey,
Cameron Heide,
Jochen Hoenicke,
Onno Hovers,
Jeffrey Hsu,
Miguel de Icaza,
Jukka Iivonen,
Lee Jaekil,
Alexandre Julliard,
Bang Jun-Young,
Pavel Kankovsky,
Jochen Karrer,
Andreas Kirschbaum,
Albrecht Kleine,
Jon Konrath,
Alex Korobka,
Greg Kreider,
Anand Kumria,
Scott A. Laird,
Andrew Lewycky,
Martin von Loewis,
Michiel van Loon,
Kenneth MacDonald,
Peter MacDonald,
William Magro,
Juergen Marquardt,
Ricardo Massaro,
Marcus Meissner,
Graham Menhennitt,
David Metcalfe,
Bruce Milner,
Steffen Moeller,
Andreas Mohr,
Philippe De Muyter,
Itai Nahshon,
Henrik Olsen,
Michael Patra,
Dimitrie O. Paun,
Jim Peterson,
Robert Pouliot,
Keith Reynolds,
Slaven Rezic,
John Richardson,
Rick Richardson,
Doug Ridgway,
Bernhard Rosenkraenzer,
Johannes Ruscheinski,
Thomas Sandford,
Constantine Sapuntzakis,
Pablo Saratxaga,
Daniel Schepler,
Peter Schlaile,
Ulrich Schmid,
Bernd Schmidt,
Ingo Schneider,
Victor Schneider,
Yngvi Sigurjonsson,
Stephen Simmons,
Rick Sladkey,
William Smith,
Dominik Strasser,
Vadim Strizhevsky,
Erik Svendsen,
Tristan Tarrant,
Andrew Taylor,
Duncan C Thomson,
Goran Thyni,
Jimmy Tirtawangsa,
Jon Tombs,
Linus Torvalds,
Gregory Trubetskoy,
Petri Tuomola,
Michael Veksler,
Sven Verdoolaege,
Ronan Waide,
Eric Warnke,
Manfred Weichel,
Morten Welinder,
Lawson Whitney,
Jan Willamowius,
Carl Williams,
Karl Guenter Wuensch,
Eric Youngdale,
James Youngman,
Mikolaj Zalewski,
and John Zero.

18
BUGS
View File

@ -5,10 +5,15 @@ done something for one of the problems. You are encouraged to
add new entries and, more importantly, remove those for the
bugs you fixed ;-)
------------------------------------------------------------
As of June 1997 -
As of Sept 1997 -
General:
* LoadAccelerators() must not create any objects apart
from loading the resource.
* Catch/Throw() do not save SI and DI registers (quite fatal).
* We need to do InsertMenuItem32[AW] and then code most of the other
inserting function in terms of this. Without this, we cannot support
all the new extended menus. Not hard, but slightly big.
@ -36,6 +41,17 @@ General:
Miscellaneous:
* nBytesWidth in CURSORICONINFO is bogus for some bpp
(doesn't reflect the fact that bits are packed and 16-bit aligned).
* Progman and AOL complain about being unable to convert bitmaps
(probably because of bytes width stuff).
* Netscape displays partially downloaded inline graphics with
wrong offsets. Bitmap is missing in the splash-window.
* BCW 4.5 crashes after SwitchStackBack().
* Text alignment problems in Word and Write (variable pitch fonts).
* Font mapper weights

150
ChangeLog
View File

@ -1,3 +1,153 @@
----------------------------------------------------------------------
Thu Sep 11 18:24:56 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
* [objects/dc.c]
In DC_SetupGCForPatBlt, replace R2_NOT by GXxor with (black xor white).
Tue Sep 9 23:04:02 1997 U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [memory/virtual.c]
Do not write debugging info unconditionally to stderr.
* [files/profile.c]
Call PROFILE_GetSection in PROFILE_GetString for key_name "" too.
* [misc/crtdll.c]
Many new functions.
* [include/windows.h] [windows/winpos.c]
ClientToScreen16 doesn't have a return value.
Sun Sep 7 10:06:39 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [misc/main.c] [AUTHORS]
Update the list of contributors. Please let me know if I forgot
someone.
* [if1632/*.spec] [if1632/builtin.c] [tools/build.c]
Ordinal base for Win32 DLLs is now computed automatically from the
lowest ordinal found.
* [include/wintypes.h]
WINAPI is now defined as attribute((stdcall)). This will require
gcc to compile.
* [if1632/thunk.c]
Removed Win32 thunks (no longer needed with stdcall).
* [if1632/crtdll.spec] [misc/crtdll.c]
Make sure we only reference cdecl functions in the spec file.
* [objects/dc.c]
Use CapNotLast drawing style for 1-pixel wide lines.
* [tools/build.c]
Added 'double' argument type.
Added 'varargs' function type for Win32.
Made CallTo16_xxx functions stdcall.
Fri Sep 5 14:50:49 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [tools/build.c] [windows/win.c] [windows/event.c] [windows/message.c]
More fixes to get message exchange closer to the original.
* [misc/spy.c]
Message logs now contain window names.
* [loader/resource.c] [loader/ne_resource.c] [loader/task.c]
[objects/cursoricon.c] [windows/user.c]
Added some obscure features to fix memory leaks.
Fri Sep 5 00:46:28 1997 Jan Willamowius <jan@janhh.shnet.org>
* [if1632/kernel32.spec] [win32/newfns.c]
Added stub for UTRegister() and UTUnRegister().
Thu Sep 4 12:03:12 1997 Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
* [controls/edit.c]
Allow ASCII codes > 127 in WM_CHAR.
Mon Sep 1 17:23:24 1997 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/widgets.c]
In InitCommonControls, remember the name of the class
because lpszClassName was made to point to a local array
Added the ProgressBar to the list of implemented controls.
Call InitCommonControls from WIDGETS_Init to register all
implemented Common Controls.
* [include/commctrl.h]
Added misc decl for the Progress Bar.
* [controls/progress.c] [include/progress.h]
First attempt at implementiong the Progress Bar class.
* [objects/brush.h]
Implementation for GetSysColorBrush[16|32]
* [controls/status.c]
Use DrawEdge to draw the borders and fill the background
* [controls/uitools.c]
Added DrawDiagEdge32 and DrawRectEdge32
* [graphics/painting.c]
Implement DrawEdge[16|32]
Started DrawFrameControl32
Mon Sep 1 10:07:09 1997 Lawson Whitney <lawson_whitney@juno.com>
* [misc/comm.c] [include/windows.h]
SetCommEventMask returns a SEGPTR.
Sun Aug 31 23:28:32 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_image.c][loader/module.c][include/pe_image.h]
[include/module.h]
Cleaned up the whole Win32 library mess (a bit).
* [debugger/stabs.c]
If 'wine' has no absolute path and isn't found, check $PATH too.
* [misc/ole2nls.c]
Some fixes.
* [misc/ver.c]
Added support for PE style version resources.
* [memory/string.c]
Check for NULL pointers to _lstr* functions, just as Windows95 does.
* [multimedia/time.c]
Made list of timers a simple linked list.
* [loader/resource.c]
Netscape 3 seems to pass NEGATIVE resource Ids (in an
unsigned int, yes). Don't know why, fixed it anyway.
* [objects/bitmap.c]
LoadImageW added.
* [include/win.h][windows/win.c]
Change wIDmenu from UINT16 to UINT32 and changed the
SetWindow(Long|Word) accordingly.
Thu Aug 28 19:30:08 1997 Morten Welinder <terra@diku.dk>
* [include/windows.h]
Add a few more colors defined for Win95.
Add a few more brush styles.
* [windows/syscolor.c]
Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
GetSysColor16, GetSysColor32. Add support for above colors.
Sun Aug 24 16:22:57 1997 Andrew Taylor <andrew@riscan.com>
* [multimedia/mmsystem.c]
Changed mmioDescend to use mmio functions for file I/O, neccessary
for memory files.
----------------------------------------------------------------------
Sat Aug 23 00:05:23 1997 Andreas Mohr <100.30936@germany.net>

View File

@ -13,9 +13,11 @@ C_SRCS = \
icontitle.c \
listbox.c \
menu.c \
progress.c \
scroll.c \
static.c \
status.c \
uitools.c \
updown.c \
widgets.c

View File

@ -982,11 +982,17 @@ static INT32 EDIT_CallWordBreakProc(WND *wnd, EDITSTATE *es, INT32 start, INT32
segptr + start, index, count, action);
LocalUnlock16(hloc16);
return ret;
} else if (es->word_break_proc32A)
return (INT32)CallWordBreakProc32A((FARPROC32)es->word_break_proc32A,
es->text + start, index, count, action);
}
else if (es->word_break_proc32A)
{
dprintf_relay( stddeb, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n",
es->word_break_proc32A, es->text + start, index,
count, action );
return (INT32)es->word_break_proc32A( es->text + start, index,
count, action );
}
else
return EDIT_WordBreakProc(es->text + start, index, count, action);
return EDIT_WordBreakProc(es->text + start, index, count, action);
}
@ -2819,7 +2825,7 @@ static void EDIT_WM_Char(WND *wnd, EDITSTATE *es, CHAR c, DWORD key_data)
EDIT_EM_ReplaceSel(wnd, es, TRUE, "\t");
break;
default:
if (!(es->style & ES_READONLY) && (c >= ' ') && (c != 127)) {
if (!(es->style & ES_READONLY) && ((BYTE)c >= ' ') && (c != 127)) {
char str[2];
str[0] = c;
str[1] = '\0';

View File

@ -2462,7 +2462,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
default:
if ((msg >= WM_USER) && (msg < 0xc000))
fprintf(stderr,"Listbox %04x: unknown msg %04x wp %08x lp %08lx\n",
dprintf_listbox(stddeb,"Listbox %04x: unknown msg %04x wp %08x lp %08lx\n",
hwnd, msg, wParam, lParam );
return DefWindowProc32A( hwnd, msg, wParam, lParam );
}

View File

@ -1141,48 +1141,44 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
/***********************************************************************
* MENU_PatchResidentPopup
*/
BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* wndOwner )
BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
{
/* checkQueue tells us whether we have to disconnect top
* popup from the wndOwner or (if the latter is NULL) from
* the checkQueue. If checkQueue is 0 then we need to set
* popup owner to the wndOwner.
*
* This is supposed to be called when top popup is hidden. */
if( pTopPopupWnd )
{
HTASK16 hTask = 0;
dprintf_menu(stddeb,"patching resident popup: %04x, %08x\n",
checkQueue, (unsigned) wndOwner);
if( wndOwner )
{
if( pTopPopupWnd->owner == wndOwner )
{
if( checkQueue ) pTopPopupWnd->owner = NULL;
return TRUE;
}
/* switch to the new owner */
dprintf_menu(stddeb,"patching resident popup: %04x %04x [%04x %04x]\n",
checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ,
pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0);
if( wndOwner->hmemTaskQ == pTopPopupWnd->hmemTaskQ )
return TRUE;
hTask = QUEUE_GetQueueTask( wndOwner->hmemTaskQ );
}
else if( pTopPopupWnd->hmemTaskQ == checkQueue )
switch( checkQueue )
{
/* switch to the different task */
case 0: /* checkWnd is the new popup owner */
if( checkWnd )
{
pTopPopupWnd->owner = checkWnd;
if( pTopPopupWnd->hmemTaskQ != checkWnd->hmemTaskQ )
hTask = QUEUE_GetQueueTask( checkWnd->hmemTaskQ );
}
break;
hTask = QUEUE_GetQueueTask( pTopPopupWnd->hmemTaskQ );
hTask = TASK_GetNextTask( hTask );
case 0xFFFF: /* checkWnd is destroyed */
if( pTopPopupWnd->owner == checkWnd )
pTopPopupWnd->owner = NULL;
return TRUE;
default: /* checkQueue is exiting */
if( pTopPopupWnd->hmemTaskQ == checkQueue )
{
hTask = QUEUE_GetQueueTask( pTopPopupWnd->hmemTaskQ );
hTask = TASK_GetNextTask( hTask );
}
break;
}
if( hTask )
{
TDB* task = (TDB*)GlobalLock16( hTask );
pTopPopupWnd->owner = wndOwner;
if( task )
{
pTopPopupWnd->hInstance = task->hInstance;
@ -3537,7 +3533,7 @@ HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name )
if (!name) return 0;
/* check for Win32 module */
instance = GetExePtr( instance );
instance = MODULE_HANDLEtoHMODULE16( instance );
if (MODULE_GetPtr(instance)->flags & NE_FFLAGS_WIN32)
return LoadMenu32A(instance,PTR_SEG_TO_LIN(name));
@ -3837,7 +3833,7 @@ BOOL16 WINAPI InsertMenuItem16( HMENU16 hmenu, UINT16 pos, BOOL16 byposition,
miia.cbSize = sizeof(miia);
miia.fMask = mii->fMask;
miia.dwTypeData = miia.dwTypeData;
miia.dwTypeData = mii->dwTypeData;
miia.fType = mii->fType;
miia.fState = mii->fState;
miia.wID = mii->wID;

208
controls/progress.c Normal file
View File

@ -0,0 +1,208 @@
/*
* Progress control
*
* Copyright 1997 Dimitrie O. Paun
*
* TODO:
* - I do not know what to to on WM_[SG]ET_FONT
* Problems:
* - I think I do not compute correctly the numer of leds to be drawn
*/
#include <stdlib.h>
#include <stdio.h>
#include "windows.h"
#include "syscolor.h"
#include "sysmetrics.h"
#include "progress.h"
#include "graphics.h"
#include "heap.h"
#include "win.h"
#include "stddebug.h"
#include "debug.h"
/* Control configuration constants */
#define LED_WIDTH 8
#define LED_GAP 2
/* Work constants */
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_progress(stddeb, \
"Progress Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
#define PROGRESS_GetInfoPtr(wndPtr) ((PROGRESS_INFO *)wndPtr->wExtra)
/***********************************************************************
* PROGRESS_Paint
* Draw the arrows. The background need not be erased.
* If dc!=0, it draws on it
*/
static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
{
PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(wndPtr);
HBRUSH32 ledBrush;
int rightBar, rightMost;
PAINTSTRUCT32 ps;
RECT32 rect;
HDC32 hdc;
dprintf_progress(stddeb, "Progress Bar: paint pos=%d min=%d, max=%d\n",
infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
/* get a dc */
hdc = dc==0 ? BeginPaint32(wndPtr->hwndSelf, &ps) : dc;
/* get the required brush */
ledBrush = GetSysColorBrush32(COLOR_HIGHLIGHT);
/* get rect for the bar, adjusted for the border */
GetClientRect32(wndPtr->hwndSelf, &rect);
/* draw the border */
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST|BF_MIDDLE);
rect.left++; rect.right--; rect.top++; rect.bottom--;
rightMost = rect.right;
/* compute extent of progress bar */
rightBar = rect.left +
MulDiv32(infoPtr->CurVal-infoPtr->MinVal,
rect.right - rect.left,
infoPtr->MaxVal-infoPtr->MinVal);
/* now draw the bar */
while(rect.left < rightBar) {
rect.right = rect.left+LED_WIDTH;
FillRect32(hdc, &rect, ledBrush);
rect.left = rect.right+LED_GAP;
}
/* clean-up */
if(!dc)
EndPaint32(wndPtr->hwndSelf, &ps);
}
/***********************************************************************
* PROGRESS_CoercePos
* Makes sure the current position (CUrVal) is within bounds.
*/
static void PROGRESS_CoercePos(WND *wndPtr)
{
PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(wndPtr);
if(infoPtr->CurVal < infoPtr->MinVal)
infoPtr->CurVal = infoPtr->MinVal;
if(infoPtr->CurVal > infoPtr->MaxVal)
infoPtr->CurVal = infoPtr->MaxVal;
}
/***********************************************************************
* ProgressWindowProc
*/
LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(wndPtr);
UINT32 temp;
switch(message)
{
case WM_CREATE:
/* initialize the info struct */
infoPtr->MinVal=0;
infoPtr->MaxVal=100;
infoPtr->CurVal=0;
infoPtr->Step=10;
dprintf_updown(stddeb, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
break;
case WM_DESTROY:
dprintf_updown(stddeb, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
break;
case WM_ERASEBKGND:
/* pretend to erase it here, but we will do it in the paint
function to avoid flicker */
return 1;
case WM_GETFONT:
/* FIXME: What do we need to do? */
break;
case WM_SETFONT:
/* FIXME: What do we need to do? */
break;
case WM_PAINT:
PROGRESS_Paint(wndPtr, wParam);
break;
case PBM_DELTAPOS:
if(lParam)
UNKNOWN_PARAM(PBM_DELTAPOS, wParam, lParam);
temp = infoPtr->CurVal;
if(wParam != 0){
infoPtr->CurVal += (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
PROGRESS_Paint(wndPtr, 0);
}
return temp;
case PBM_SETPOS:
if (lParam)
UNKNOWN_PARAM(PBM_SETPOS, wParam, lParam);
temp = infoPtr->CurVal;
if(temp != wParam){
infoPtr->CurVal = (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
PROGRESS_Paint(wndPtr, 0);
}
return temp;
case PBM_SETRANGE:
if (wParam)
UNKNOWN_PARAM(PBM_SETRANGE, wParam, lParam);
temp = MAKELONG(infoPtr->MinVal, infoPtr->MaxVal);
if(temp != lParam){
infoPtr->MinVal = LOWORD(lParam);
infoPtr->MaxVal = HIWORD(lParam);
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
PROGRESS_Paint(wndPtr, 0);
}
return temp;
case PBM_SETSTEP:
if (lParam)
UNKNOWN_PARAM(PBM_SETSTEP, wParam, lParam);
temp = infoPtr->Step;
infoPtr->Step = (UINT16)wParam;
return temp;
case PBM_STEPIT:
if (wParam || lParam)
UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
temp = infoPtr->CurVal;
infoPtr->CurVal += infoPtr->Step;
if(infoPtr->CurVal > infoPtr->MaxVal)
infoPtr->CurVal = infoPtr->MinVal;
if(temp != infoPtr->CurVal)
PROGRESS_Paint(wndPtr, 0);
return temp;
default:
if (message >= WM_USER)
fprintf( stderr, "Progress Ctrl: unknown msg %04x wp=%04x lp=%08lx\n",
message, wParam, lParam );
return DefWindowProc32A( hwnd, message, wParam, lParam );
}
return 0;
}

View File

@ -41,34 +41,29 @@ static STATUSWINDOWINFO *GetStatusInfo(HWND32 hwnd)
void WINAPI DrawStatusText32A( HDC32 hdc, LPRECT32 lprc, LPCSTR text,
UINT32 style )
{
RECT32 r, rt;
RECT32 r, rt;
int oldbkmode;
UINT32 border;
r = *lprc;
if (style == 0 ||
style == SBT_POPOUT) {
InflateRect32(&r, -1, -1);
SelectObject32(hdc, sysColorObjects.hbrushScrollbar);
Rectangle32(hdc, r.left, r.top, r.right, r.bottom);
if(style == SBT_OWNERDRAW){
/* FIXME for SBT_OWNERDRAW, SBT_RTLREADING */
}
else{
DrawEdge32(hdc, &r, BDR_RAISEDINNER, BF_RECT|BF_ADJUST|BF_FLAT);
/* draw border */
SelectObject32(hdc, sysColorObjects.hpenWindowFrame);
if (style == 0)
DrawEdge32(hdc, &r, EDGE_SUNKEN, BF_RECT);
else
DrawEdge32(hdc, &r, EDGE_RAISED, BF_RECT);
}
else if (style == SBT_NOBORDERS) {
SelectObject32(hdc, sysColorObjects.hbrushScrollbar);
Rectangle32(hdc, r.left, r.top, r.right, r.bottom);
}
else { /* fixme for SBT_OWNERDRAW, SBT_RTLREADING */
}
if(style==SBT_POPOUT)
border = BDR_RAISEDOUTER;
else if(style==SBT_NOBORDERS)
border = 0;
else
border = BDR_SUNKENOUTER;
/* now draw text */
if ((style != SBT_OWNERDRAW) && text) {
DrawEdge32(hdc, &r, border, BF_RECT | BF_ADJUST | BF_MIDDLE);
/* now draw text */
if (text) {
SelectObject32(hdc, sysColorObjects.hpenWindowText);
oldbkmode = SetBkMode32(hdc, TRANSPARENT);
rt = r;
@ -77,8 +72,10 @@ void WINAPI DrawStatusText32A( HDC32 hdc, LPRECT32 lprc, LPCSTR text,
&rt, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
if (oldbkmode != TRANSPARENT)
SetBkMode32(hdc, oldbkmode);
SetBkMode32(hdc, oldbkmode);
}
}
}
static BOOL32 SW_Refresh( HWND32 hwnd, HDC32 hdc, STATUSWINDOWINFO *self )

390
controls/uitools.c Normal file
View File

@ -0,0 +1,390 @@
/*
* User Interface Functions
*
* Copyright 1997 Dimitrie O. Paun
*/
#include <stdio.h>
#include "windows.h"
#include "debug.h"
/***********************************************************************
* UITOOLS_DrawDiagEdge
*
* Same as DrawEdge, but with BF_DIAGONAL
* I tested it extensively and as far as I can tell it is identical to the
* implementaion in Win95.
* I do not like that I create and
* use the 3 Pens to draw the diagonals. It would be better to draw them
* using the brushes returned by GetSysColorBrush func, but I did not have
* the patience to implement that yet.
*/
static BOOL32 UITOOLS_DrawDiagEdge(HDC32 hdc, RECT32 *rect, UINT32 edge,
UINT32 flags)
{
HPEN32 facePen, shadowPen, lightPen, blackPen, grayPen, nullPen;
HPEN32 iPen, oPen, oldPen;
HBRUSH32 oldBrush, faceBrush;
int cl, cr, ct, cb;
BOOL32 mainDiag;
POINT32 tp;
RECT32 r;
/* If both rasied and sunken is specified, they anihilate one another */
if( !((flags & BF_MONO) || (flags & BF_FLAT)) ){
if( (edge & BDR_RAISEDOUTER) && (edge & BDR_SUNKENOUTER) )
return FALSE;
if( (edge & BDR_RAISEDINNER) && (edge & BDR_SUNKENINNER) )
return FALSE;
}
/* Create/get the tools of the trade... */
facePen = CreatePen32(PS_SOLID, 0, GetSysColor32(COLOR_BTNFACE));
shadowPen = CreatePen32(PS_SOLID, 0, GetSysColor32(COLOR_BTNSHADOW));
lightPen = CreatePen32(PS_SOLID, 0, GetSysColor32(COLOR_BTNHILIGHT));
grayPen = CreatePen32(PS_SOLID, 0, RGB(168, 152, 144));
blackPen = GetStockObject32(BLACK_PEN);
nullPen = GetStockObject32(NULL_PEN);
faceBrush = GetSysColorBrush32(COLOR_BTNFACE);
oldPen = SelectObject32(hdc, nullPen);
oldBrush = SelectObject32(hdc, faceBrush);
/* this is my working rectangle */
r = *rect;
if(flags & BF_MONO){
oPen = blackPen;
iPen = nullPen;
}else if(flags & BF_FLAT){
oPen = shadowPen;
iPen = facePen;
}else {
if(flags & BF_SOFT){
if(flags & BF_BOTTOM){
oPen = (edge & BDR_RAISEDOUTER) ? blackPen : lightPen;
iPen = (edge & BDR_RAISEDINNER) ? shadowPen : grayPen;
}
else{
oPen = (edge & BDR_RAISEDOUTER) ? lightPen : blackPen;
iPen = (edge & BDR_RAISEDINNER) ? grayPen : shadowPen;
}
}
else{
if(flags & BF_BOTTOM){
oPen = (edge & BDR_RAISEDOUTER) ? blackPen : lightPen;
iPen = (edge & BDR_RAISEDINNER) ? shadowPen : grayPen;
}
else{
oPen = (edge & BDR_RAISEDOUTER) ? grayPen : shadowPen;
iPen = (edge & BDR_RAISEDINNER) ? lightPen : blackPen;
}
}
}
if(flags & BF_BOTTOM){
if(flags & BF_LEFT){
cr = -1; cl = 0;
ct = 0; cb = -1;
mainDiag = TRUE;
tp.x = r.left; tp.y = r.top;
}
else{ /* RIGHT */
cr = -1; cl = 0;
ct = 1; cb = 0;
tp.x = r.left; tp.y = r.bottom-1;
mainDiag = FALSE;
}
}
else{ /* TOP */
if(flags & BF_LEFT){
cr = 0; cl = 1;
ct = 0; cb = -1;
mainDiag = FALSE;
tp.x = r.right; tp.y = r.top;
}
else{ /* RIGHT */
cr = 0; cl = 1;
ct = 1; cb = 0;
tp.x = r.right; tp.y = r.bottom-1;
mainDiag = TRUE;
}
}
/* if it has external edge, draw it */
if(edge & BDR_OUTER){
SelectObject32(hdc, oPen);
MoveToEx32(hdc, r.left, mainDiag ? r.bottom-1 : r.top, 0);
LineTo32(hdc, r.right, mainDiag ? r.top-1 : r.bottom);
r.left += cl; r.right += cr; r.top += ct; r.bottom += cb;
}
/* if it has internal edge, draw it */
if(edge & BDR_INNER){
SelectObject32(hdc, iPen);
MoveToEx32(hdc, r.left, mainDiag ? r.bottom-1 : r.top, 0);
LineTo32(hdc, r.right, mainDiag ? r.top-1 : r.bottom);
r.left += cl; r.right += cr; r.top += ct; r.bottom += cb;
}
if((flags & BF_MIDDLE) && !(flags & BF_MONO)){
POINT32 p[3];
p[0].x = mainDiag ? r.right: r.left;
p[0].y = r.top;
p[1].x = mainDiag ? r.left : r.right;
p[1].y = r.bottom;
p[2].x = tp.x;
p[2].y = tp.y;
SelectObject32(hdc, nullPen);
SelectObject32(hdc, faceBrush);
Polygon32(hdc, p, 3);
}
if(flags & BF_ADJUST)
*rect = r;
/* Restore the DC */
SelectObject32(hdc, oldPen);
SelectObject32(hdc, oldBrush);
/* Clean-up */
DeleteObject32(facePen);
DeleteObject32(shadowPen);
DeleteObject32(lightPen);
DeleteObject32(grayPen);
return TRUE;
}
/***********************************************************************
* UITOOLS_DrawRectEdge
*
* Same as DrawEdge, but without BF_DIAGONAL
* I tested this function and it works very well. You should not change it
* unless you find a bug. If you don't like the colors, it it not its
* fault - the system colors are not OK.
* Again, I tested this function on Win95 and I compared the output with the
* one generated by the native DrawEdge and it is identical on all cases that
* I tried, and I tried quite a few.
*/
static BOOL32 UITOOLS_DrawRectEdge(HDC32 hdc, RECT32 *rect,
UINT32 edge, UINT32 flags)
{
HBRUSH32 faceBrush, shadowBrush, lightBrush, blackBrush, grayBrush, nullBrush;
HBRUSH32 iNBrush, iSBrush, iEBrush, iWBrush;
HBRUSH32 oNBrush, oSBrush, oEBrush, oWBrush;
HBRUSH32 oldBrush;
RECT32 r;
/* If both rasied and sunken is specified, they anihilate one another */
if( !((flags & BF_MONO) || (flags & BF_FLAT)) ){
if( (edge & BDR_RAISEDOUTER) && (edge & BDR_SUNKENOUTER) )
return FALSE;
if( (edge & BDR_RAISEDINNER) && (edge & BDR_SUNKENINNER) )
return FALSE;
}
faceBrush = GetSysColorBrush32(COLOR_BTNFACE);
shadowBrush = GetSysColorBrush32(COLOR_BTNSHADOW);
lightBrush = GetSysColorBrush32(COLOR_BTNHILIGHT);
blackBrush = GetStockObject32(BLACK_BRUSH);
grayBrush = GetStockObject32(LTGRAY_BRUSH);
nullBrush = GetStockObject32(NULL_BRUSH);
oldBrush = SelectObject32(hdc, nullBrush);
/* this is my working rectangle */
r = *rect;
if(flags & BF_MONO){
oNBrush = oSBrush = oEBrush = oWBrush = blackBrush;
iNBrush = iSBrush = iEBrush = iWBrush = nullBrush;
}else if(flags & BF_FLAT){
oNBrush = oSBrush = oEBrush = oWBrush = shadowBrush;
iNBrush = iSBrush = iEBrush = iWBrush = faceBrush;
}else {
if(flags & BF_SOFT){
oNBrush = oWBrush = (edge & BDR_RAISEDOUTER) ? lightBrush : blackBrush;
oSBrush = oEBrush = (edge & BDR_RAISEDOUTER) ? blackBrush : lightBrush;
iNBrush = iWBrush = (edge & BDR_RAISEDINNER) ? grayBrush : shadowBrush;
iSBrush = iEBrush = (edge & BDR_RAISEDINNER) ? shadowBrush : grayBrush;
}
else{
oNBrush = oWBrush = (edge & BDR_RAISEDOUTER) ? grayBrush : shadowBrush;
oSBrush = oEBrush = (edge & BDR_RAISEDOUTER) ? blackBrush : lightBrush;
iNBrush = iWBrush = (edge & BDR_RAISEDINNER) ? lightBrush : blackBrush;
iSBrush = iEBrush = (edge & BDR_RAISEDINNER) ? shadowBrush : grayBrush;
}
}
/* if it has external edge, draw it */
if(edge & BDR_OUTER){
if(flags & BF_RIGHT){
SelectObject32(hdc, oEBrush);
PatBlt32(hdc, r.right-1, r.top, 1, r.bottom - r.top, PATCOPY);
r.right--;
}
if(flags & BF_BOTTOM){
SelectObject32(hdc, oSBrush);
PatBlt32(hdc, r.left, r.bottom-1, r.right-r.left, 1, PATCOPY);
r.bottom--;
}
if(flags & BF_LEFT){
SelectObject32(hdc, oWBrush);
PatBlt32(hdc, r.left, r.top, 1, r.bottom - r.top, PATCOPY);
r.left++;
}
if(flags & BF_TOP){
SelectObject32(hdc, oNBrush);
PatBlt32(hdc, r.left, r.top, r.right-r.left, 1, PATCOPY);
r.top++;
}
}
/* if it has internal edge, draw it */
if(edge & BDR_INNER){
if(flags & BF_RIGHT){
SelectObject32(hdc, iEBrush);
PatBlt32(hdc, r.right-1, r.top, 1, r.bottom - r.top, PATCOPY);
r.right--;
}
if(flags & BF_BOTTOM){
SelectObject32(hdc, iSBrush);
PatBlt32(hdc, r.left, r.bottom-1, r.right-r.left, 1, PATCOPY);
r.bottom--;
}
if(flags & BF_LEFT){
SelectObject32(hdc, iWBrush);
PatBlt32(hdc, r.left, r.top, 1, r.bottom - r.top, PATCOPY);
r.left++;
}
if(flags & BF_TOP){
SelectObject32(hdc, iNBrush);
PatBlt32(hdc, r.left, r.top, r.right-r.left, 1, PATCOPY);
r.top++;
}
}
/* if we got to fill the middle, to it now */
if((flags & BF_MIDDLE) && !(flags & BF_MONO))
FillRect32(hdc, &r, faceBrush);
/* adjust the rectangle if required */
if(flags & BF_ADJUST)
*rect = r;
/* Restore the DC */
SelectObject32(hdc, oldBrush);
return TRUE;
}
/**********************************************************************
* DrawEdge16 (USER.659)
*/
BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
{
RECT32 rect32;
BOOL32 ret;
CONV_RECT16TO32( rc, &rect32 );
ret = DrawEdge32( hdc, &rect32, edge, flags );
CONV_RECT32TO16( &rect32, rc );
return ret;
}
/**********************************************************************
* DrawEdge32 (USER32.154)
*/
BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
hdc, rc->left, rc->top, rc->right, rc->bottom,
edge, flags );
if(flags & BF_DIAGONAL)
return UITOOLS_DrawDiagEdge(hdc, rc, edge, flags);
else
return UITOOLS_DrawRectEdge(hdc, rc, edge, flags);
}
/***********************************************************************
* UITOOLS_DrawFrameButton
*/
static BOOL32 UITOOLS_DrawFrameButton(HDC32 hdc, LPRECT32 rc, UINT32 uState)
{
fprintf( stdnimp,"DrawFrameButton(%x,%p,%x), empty stub!\n",
hdc,rc,uState );
return FALSE;
}
/***********************************************************************
* UITOOLS_DrawFrameCaption
*/
static BOOL32 UITOOLS_DrawFrameCaption(HDC32 hdc, LPRECT32 rc, UINT32 uState)
{
fprintf( stdnimp,"DrawFrameCaption(%x,%p,%x), empty stub!\n",
hdc,rc,uState );
return FALSE;
}
/***********************************************************************
* UITOOLS_DrawFrameMenu
*/
static BOOL32 UITOOLS_DrawFrameMenu(HDC32 hdc, LPRECT32 rc, UINT32 uState)
{
fprintf( stdnimp,"DrawFrameMenu32(%x,%p,%x), empty stub!\n",
hdc,rc,uState );
return FALSE;
}
/***********************************************************************
* UITOOLS_DrawFrameScroll
*/
static BOOL32 UITOOLS_DrawFrameScroll(HDC32 hdc, LPRECT32 rc, UINT32 uState)
{
fprintf( stdnimp,"DrawFrameScroll32(%x,%p,%x), empty stub!\n",
hdc,rc,uState );
return FALSE;
}
/**********************************************************************
* DrawFrameControl16 (USER.656)
*/
BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType,
UINT16 uState )
{
RECT32 rect32;
BOOL32 ret;
CONV_RECT16TO32( rc, &rect32 );
ret = DrawFrameControl32( hdc, &rect32, uType, uState );
CONV_RECT32TO16( &rect32, rc );
return ret;
}
/**********************************************************************
* DrawFrameControl32 (USER32.157)
*/
BOOL32 WINAPI DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 uType,
UINT32 uState )
{
switch(uType)
{
case DFC_BUTTON:
return UITOOLS_DrawFrameButton(hdc, rc, uState);
case DFC_CAPTION:
return UITOOLS_DrawFrameCaption(hdc, rc, uState);
case DFC_MENU:
return UITOOLS_DrawFrameMenu(hdc, rc, uState);
case DFC_SCROLL:
return UITOOLS_DrawFrameScroll(hdc, rc, uState);
default:
fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), bad type!\n",
hdc,rc,uType,uState );
}
return FALSE;
}

View File

@ -8,6 +8,7 @@
* arrow keys
* - I am not sure about the default values for the Min, Max, Pos
* (in the UPDOWN_INFO the fields: MinVal, MaxVal, CurVal)
* - I think I do not handle correctly the WS_BORDER style.
* Testing:
* Not much. The following have not been tested at all:
* - horizontal arrows
@ -20,10 +21,7 @@
* behave very well so I am confident it does work in most (all) of the
* untested cases.
* Problems:
* At the moment, the control will no draw itself very well because it
* uses some features in DrawEdge that are not yet implemented.
* In other words, there is no known problem, exempt for the things in
* the TODO list above.
* I do not like the arrows yet, I'll work more on them later on.
*/
#include <stdlib.h>
@ -47,10 +45,10 @@
#define INITIAL_DELAY 500 /* initial timer until auto-increment kicks in */
#define REPEAT_DELAY 50 /* delay between auto-increments */
#define DEFAULT_WIDTH 10 /* default width of the ctrl */
#define DEFAULT_XSEP 0 /* default separation between buddy and crtl */
#define DEFAULT_ADDTOP 1 /* amount to extend above the buddy window */
#define DEFAULT_ADDBOT 1 /* amount to extend below the buddy window */
#define DEFAULT_WIDTH 14 /* default width of the ctrl */
#define DEFAULT_XSEP 0 /* default separation between buddy and crtl */
#define DEFAULT_ADDTOP 0 /* amount to extend above the buddy window */
#define DEFAULT_ADDBOT 0 /* amount to extend below the buddy window */
/* Work constants */
@ -65,9 +63,6 @@
static int accelIndex = -1;
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_updown(stddeb, \
"UpDown Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
@ -129,7 +124,7 @@ static void UPDOWN_GetArrowRect(WND *wndPtr, RECT32 *rect, BOOL32 incr)
if (wndPtr->dwStyle & UDS_HORZ) {
len = rect->right - rect->left; /* compute the width */
if (incr)
rect->left = len/2;
rect->left = len/2+1;
else
rect->right = len/2;
}
@ -138,7 +133,7 @@ static void UPDOWN_GetArrowRect(WND *wndPtr, RECT32 *rect, BOOL32 incr)
if (incr)
rect->bottom = len/2;
else
rect->top = len/2;
rect->top = len/2+1;
}
}
@ -290,48 +285,57 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
static void UPDOWN_DrawArrow(HDC32 hdc, RECT32 *rect, BOOL32 incr,
BOOL32 pressed, BOOL32 horz)
{
const int w = rect->right - rect->left;
const int h = rect->bottom - rect->top;
int offset = pressed ? 1 : 0, tmp;
POINT32 pts[3];
const int rw = rect->right - rect->left;
const int rh = rect->bottom - rect->top;
int offset = pressed ? 1 : 0;
int th, x, y, len;
/* compute max extents of the triangle */
if(horz){ /* horizontal arrows */
pts[0].x = rect->right - max(2, w/3) + offset;
pts[0].y = rect->top + max(2, h/4) + offset;
pts[1].x = pts[0].x;
pts[1].y = rect->bottom - max(2, h/4) + offset;
pts[2].x = rect->left + w/3 + offset;
pts[2].y = (pts[0].y + pts[1].y)/2;
if(pts[2].x-2<rect->left)
pts[2].x = rect->left + 2;
if(pts[2].x <= pts[0].x)
pts[2].x = pts[0].x - 1;
th = (3*rh)/5-2*4;
if(th > rw/2)
th = rw/2;
if(th < 2)
th = 2;
if(incr){
tmp = pts[2].x;
pts[2].x = pts[0].x;
pts[0].x = pts[1].x = tmp;
}
/* compute the position of the tip */
y = (rect->top+rect->bottom+1)/2 + offset;
if(incr)
x = (rect->left+rect->right+1)/2 + (2*th)/3 + offset;
else
x = (rect->left+rect->right)/2 + th/3 + offset;
for(len=1; th>0; th--, len+=2){
MoveToEx32(hdc, x, y, 0);
LineTo32(hdc, x, y+len);
if(incr) x--;
else x++;
y++;
}
}
else{ /* vertical arrows */
pts[0].x = rect->left + max(2, w/4) + offset;
pts[0].y = rect->top + max(2, h/3) + offset;
pts[1].x = rect->right- max(2, w/4) + offset;
pts[1].y = pts[0].y;
pts[2].x = (pts[0].x + pts[1].x)/2;
pts[2].y = pts[0].y + h/3 + offset;
if(pts[2].y+2>rect->bottom)
pts[2].y = rect->bottom - 2;
if(pts[2].y <= pts[0].y)
pts[2].y = pts[0].y + 1;
th = (3*rw)/5-2*4;
if(th > rh/2)
th = rh/2;
if(th < 2)
th = 2;
if(incr){
tmp = pts[2].y;
pts[2].y = pts[0].y;
pts[0].y = pts[1].y = tmp;
/* compute the position of the tip */
x = (rect->left+rect->right+1)/2 + offset;
if(incr)
y = (rect->top+rect->bottom+1)/2 - th/3 + offset;
else
y = (rect->top+rect->bottom)/2 + (2*th)/3 + offset;
for(len=1; th>0; th--, len+=2){
MoveToEx32(hdc, x, y, 0);
LineTo32(hdc, x+len, y);
if(incr) y++;
else y--;
x--;
}
}
Polygon32(hdc, pts, 3);
}
@ -350,14 +354,6 @@ static void UPDOWN_Paint(WND *wndPtr)
hdc = BeginPaint32( wndPtr->hwndSelf, &ps );
/*FIXME - this is just for test */
/* - when DrawEdge works properly, this should dissapear
as DrawEdge will erase the background */
/*oldBrush = SelectObject32(hdc, GetStockObject32(GRAY_BRUSH));
GetClientRect32(wndPtr->hwndSelf, &rect);
Rectangle32(hdc, rect.left, rect.top, rect.right, rect.bottom);
SelectObject32(hdc, oldBrush);*/
/* First select the proper brush */
oldBrush = wndPtr->dwStyle & WS_DISABLED ? GRAY_BRUSH : BLACK_BRUSH;
oldBrush = SelectObject32(hdc, GetStockObject32(oldBrush));
@ -365,9 +361,12 @@ static void UPDOWN_Paint(WND *wndPtr)
/* Draw the incr button */
UPDOWN_GetArrowRect(wndPtr, &rect, TRUE);
prssed = (infoPtr->Flags & FLAG_INCR) && (infoPtr->Flags & FLAG_MOUSEIN);
DrawEdge32(hdc, &rect, prssed ? EDGE_SUNKEN : EDGE_RAISED,
BF_RECT | BF_SOFT | BF_MIDDLE);
DrawEdge32(hdc, &rect, prssed?EDGE_SUNKEN:EDGE_RAISED, BF_RECT|BF_MIDDLE);
UPDOWN_DrawArrow(hdc, &rect, TRUE, prssed, wndPtr->dwStyle & UDS_HORZ);
/* Draw the space between the buttons */
rect.top = rect.bottom; rect.bottom++;
DrawEdge32(hdc, &rect, 0, BF_MIDDLE);
/* Draw the decr button */
UPDOWN_GetArrowRect(wndPtr, &rect, FALSE);
@ -634,7 +633,7 @@ static void UPDOWN_HandleMouseEvent(WND *wndPtr, UINT32 msg, POINT32 pt)
* UpDownWndProc
*/
LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
LPARAM lParam)
LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(wndPtr);
@ -643,6 +642,9 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
switch(message)
{
case WM_CREATE:
/* get rid of border, if any */
wndPtr->dwStyle &= ~WS_BORDER;
/* initialize the info struct */
infoPtr->AccelCount=0; infoPtr->AccelVect=0;
infoPtr->CurVal=0; infoPtr->MinVal=0; infoPtr->MaxVal=100; /*FIXME*/
@ -745,7 +747,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
UNKNOWN_PARAM(UDM_GETACCEL, wParam, lParam);
return 0;
}
temp = min(infoPtr->AccelCount, wParam);
temp = MIN(infoPtr->AccelCount, wParam);
memcpy((void *)lParam, infoPtr->AccelVect, temp*sizeof(UDACCEL));
return temp;

View File

@ -9,8 +9,10 @@
#include "win.h"
#include "commctrl.h"
#include "button.h"
#include "progress.h"
#include "static.h"
#include "status.h"
#include "updown.h"
#include "scroll.h"
#include "updown.h"
#include "desktop.h"
@ -104,7 +106,9 @@ static WNDCLASS32A WIDGETS_CommonControls32[] =
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, StatusWindowProc, 0,
sizeof(STATUSWINDOWINFO), 0, 0, 0, 0, 0, STATUSCLASSNAME32A },
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, UpDownWindowProc, 0,
sizeof(UPDOWN_INFO), 0, 0, 0, 0, 0, UPDOWN_CLASS32A }
sizeof(UPDOWN_INFO), 0, 0, 0, 0, 0, UPDOWN_CLASS32A },
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, ProgressWindowProc, 0,
sizeof(PROGRESS_INFO), 0, 0, 0, 0, 0, PROGRESS_CLASS32A }
};
#define NB_COMMON_CONTROLS32 \
@ -155,6 +159,8 @@ BOOL32 WIDGETS_Init(void)
if (!(bicAtomTable[i] = RegisterClass32A( class32 ))) return FALSE;
}
/* FIXME: hack to enable using built-in controls with Windows COMCTL32 */
InitCommonControls();
SEGPTR_FREE(name);
return TRUE;
}
@ -167,15 +173,18 @@ void WINAPI InitCommonControls(void)
{
int i;
char name[30];
const char *old_name;
WNDCLASS32A *class32 = WIDGETS_CommonControls32;
for (i = 0; i < NB_COMMON_CONTROLS32; i++, class32++)
{
/* Just to make sure the string is > 0x10000 */
old_name = class32->lpszClassName;
strcpy( name, (char *)class32->lpszClassName );
class32->lpszClassName = name;
class32->hCursor = LoadCursor16( 0, IDC_ARROW );
RegisterClass32A( class32 );
class32->lpszClassName = old_name;
}
}

View File

@ -553,7 +553,7 @@ static void DEBUG_Main( int signal )
*/
void DebugBreak32( CONTEXT *regs )
{
const char *module = MODULE_GetModuleName( GetExePtr(GetCurrentTask()) );
const char *module = MODULE_GetModuleName( GetCurrentTask() );
fprintf( stderr, "%s called DebugBreak\n", module ? module : "???" );
DEBUG_context = *regs;
DEBUG_Main( SIGTRAP );
@ -564,7 +564,7 @@ void DebugBreak32( CONTEXT *regs )
*/
void DebugBreak16( CONTEXT *regs )
{
const char *module = MODULE_GetModuleName( GetExePtr(GetCurrentTask()) );
const char *module = MODULE_GetModuleName( GetCurrentTask() );
fprintf( stderr, "%s called DebugBreak\n", module ? module : "???" );
DEBUG_context = *regs;
DEBUG_Main( SIGTRAP );

View File

@ -886,8 +886,7 @@ DEBUG_InitCVDataTypes()
* We don't fully process it here for performance reasons.
*/
int
DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
int load_addr, u_long v_addr, u_long size)
DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr, u_long v_addr, u_long size)
{
int has_codeview = FALSE;
int rtn = FALSE;
@ -957,10 +956,7 @@ DEBUG_RegisterDebugInfo(int fd, struct pe_data * pe,
* to proceed if we know what we need to do next.
*/
deefer->dbg_size = dbgptr->SizeOfData;
deefer->dbg_info = (char *) xmalloc(dbgptr->SizeOfData);
lseek(fd, dbgptr->PointerToRawData, SEEK_SET);
read(fd, deefer->dbg_info, deefer->dbg_size);
deefer->dbg_info = pe->mappeddll+dbgptr->PointerToRawData;
deefer->load_addr = (char *) load_addr;
deefer->dbgdir = dbgptr;
deefer->next = dbglist;

View File

@ -128,7 +128,7 @@ int DEBUG_GetRegister( enum debug_regs reg )
*
* Set the register values from a sigcontext.
*/
extern void DEBUG_SetSigContext( const SIGCONTEXT *sigcontext )
void DEBUG_SetSigContext( const SIGCONTEXT *sigcontext )
{
EAX_reg(&DEBUG_context) = EAX_sig(sigcontext);
EBX_reg(&DEBUG_context) = EBX_sig(sigcontext);
@ -164,7 +164,7 @@ extern void DEBUG_SetSigContext( const SIGCONTEXT *sigcontext )
*
* Build a sigcontext from the register values.
*/
extern void DEBUG_GetSigContext( SIGCONTEXT *sigcontext )
void DEBUG_GetSigContext( SIGCONTEXT *sigcontext )
{
EAX_sig(sigcontext) = EAX_reg(&DEBUG_context);
EBX_sig(sigcontext) = EBX_reg(&DEBUG_context);

View File

@ -1085,6 +1085,25 @@ DEBUG_ProcessElfObject(char * filename, unsigned int load_offset)
status = stat(filename, &statbuf);
if( status == -1 )
{
char *s,*t,*fn,*paths;
if (strchr(filename,'/'))
goto leave;
paths = xstrdup(getenv("PATH"));
s = paths;
while (s && *s) {
t = strchr(s,':');
if (t) *t='\0';
fn = (char*)xmalloc(strlen(filename)+1+strlen(s)+1);
strcpy(fn,s);
strcat(fn,"/");
strcat(fn,filename);
if ((rtn = DEBUG_ProcessElfObject(fn,load_offset))) {
free(paths);
goto leave;
}
s = t+1;
}
free(paths);
goto leave;
}

View File

@ -501,7 +501,7 @@ static INT32 PROFILE_GetString( LPCSTR section, LPCSTR key_name,
PROFILEKEY *key = NULL;
if (!def_val) def_val = "";
if (key_name)
if (key_name && key_name[0])
{
key = PROFILE_Find( &CurProfile.section, section, key_name, FALSE );
PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val,
@ -839,6 +839,14 @@ INT32 WINAPI GetProfileString32W( LPCWSTR section, LPCWSTR entry,
buffer, len, wininiW );
}
/***********************************************************************
* GetProfileSection32A (KERNEL32.268)
*/
INT32 WINAPI GetProfileSection32A( LPCSTR section, LPSTR buffer, INT32 len )
{
return GetPrivateProfileSection32A( section, buffer, len, "win.ini" );
}
/***********************************************************************
* WriteProfileString16 (KERNEL.59)
@ -963,6 +971,16 @@ INT32 WINAPI GetPrivateProfileString32W( LPCWSTR section, LPCWSTR entry,
return ret;
}
/***********************************************************************
* GetPrivateProfileSection32A (KERNEL32.255)
*/
INT32 WINAPI GetPrivateProfileSection32A( LPCSTR section, LPSTR buffer,
INT32 len, LPCSTR filename )
{
if (PROFILE_Open( filename ))
return PROFILE_GetString( section, NULL, NULL, buffer, len );
return 0;
}
/***********************************************************************

View File

@ -10,7 +10,7 @@
/* GDI 300 */
WORD WINAPI EngineEnumerateFont(LPSTR fontname, FARPROC16 proc, DWORD data )
{
printf("In engineEnumerateFont for %s\n",(fontname)?fontname:"NULL");
fprintf(stderr,"EngineEnumerateFont(%s,%p,%d),stub\n",fontname,proc,data);
return 0;
}
#ifdef NOTDEF
@ -23,7 +23,7 @@ WORD WINAPI EngineDeleteFont(LPFONTINFO16 lpFontInfo)
/* GDI 302 */
WORD WINAPI EngineRealizeFont(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
{
printf("In EngineRealizeFont\n");
fprintf(stderr,"EngineRealizeFont(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
return 0;
}

View File

@ -25,6 +25,12 @@
#include "debug.h"
#include "xmalloc.h"
BOOL32 DrawDiagEdge32(HDC32 hdc, RECT32 *rect, UINT32 edge, UINT32 flags);
BOOL32 DrawRectEdge32(HDC32 hdc, RECT32 *rect, UINT32 edge, UINT32 flags);
BOOL32 DrawFrameButton32(HDC32 hdc, LPRECT32 rc, UINT32 uState);
BOOL32 DrawFrameCaption32(HDC32 hdc, LPRECT32 rc, UINT32 uState);
BOOL32 DrawFrameMenu32(HDC32 hdc, LPRECT32 rc, UINT32 uState);
BOOL32 DrawFrameScroll32(HDC32 hdc, LPRECT32 rc, UINT32 uState);
/***********************************************************************
* LineTo16 (GDI.19)
@ -658,127 +664,6 @@ BOOL32 WINAPI FloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
}
/**********************************************************************
* DrawEdge16 (USER.659)
*/
BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
{
RECT32 rect32;
BOOL32 ret;
CONV_RECT16TO32( rc, &rect32 );
ret = DrawEdge32( hdc, &rect32, edge, flags );
CONV_RECT32TO16( &rect32, rc );
return ret;
}
/**********************************************************************
* DrawEdge32 (USER32.154)
*/
BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
HBRUSH32 hbrushOld;
if (flags >= BF_DIAGONAL)
fprintf( stderr, "DrawEdge: unsupported flags %04x\n", flags );
dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
hdc, rc->left, rc->top, rc->right, rc->bottom,
edge, flags );
/* First do all the raised edges */
hbrushOld = SelectObject32( hdc, sysColorObjects.hbrushBtnHighlight );
if (edge & BDR_RAISEDOUTER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
1, rc->bottom - rc->top - 1, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
rc->right - rc->left - 1, 1, PATCOPY );
}
if (edge & BDR_SUNKENOUTER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
1, rc->bottom - rc->top, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
rc->right - rc->left, 1, PATCOPY );
}
if (edge & BDR_RAISEDINNER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
rc->right - rc->left - 2, 1, PATCOPY );
}
if (edge & BDR_SUNKENINNER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
rc->right - rc->left - 2, 1, PATCOPY );
}
/* Then do all the sunken edges */
SelectObject32( hdc, sysColorObjects.hbrushBtnShadow );
if (edge & BDR_SUNKENOUTER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
1, rc->bottom - rc->top - 1, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
rc->right - rc->left - 1, 1, PATCOPY );
}
if (edge & BDR_RAISEDOUTER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
1, rc->bottom - rc->top, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
rc->right - rc->left, 1, PATCOPY );
}
if (edge & BDR_SUNKENINNER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
rc->right - rc->left - 2, 1, PATCOPY );
}
if (edge & BDR_RAISEDINNER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
rc->right - rc->left - 2, 1, PATCOPY );
}
SelectObject32( hdc, hbrushOld );
return TRUE;
}
/**********************************************************************
* DrawFrameControl16 (USER.656)
*/
BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType,
UINT16 uState )
{
fprintf( stdnimp,"DrawFrameControl16(%x,%p,%d,%x), empty stub!\n",
hdc,rc,uType,uState );
return TRUE;
}
/**********************************************************************
* DrawFrameControl32 (USER32.157)
*/
BOOL32 WINAPI DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 uType,
UINT32 uState )
{
fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), empty stub!\n",
hdc,rc,uType,uState );
return TRUE;
}
/**********************************************************************
* DrawFrameControl32 (USER32.152)
*/
@ -795,7 +680,7 @@ BOOL32 WINAPI DrawState32A(
HDC32 hdc,HBRUSH32 hbrush,DRAWSTATEPROC drawstateproc,
LPARAM lparam,WPARAM32 wparam,INT32 x,INT32 y,INT32 z,INT32 a,UINT32 b
) {
fprintf(stderr,"DrawStateA(%x,%x,%p,0x%08lx,0x%08lx,%d,%d,%d,%d,%d),stub\n",
fprintf(stderr,"DrawStateA(%x,%x,%p,0x%08lx,0x%08x,%d,%d,%d,%d,%d),stub\n",
hdc,hbrush,drawstateproc,lparam,wparam,x,y,z,a,b
);
return TRUE;

View File

@ -82,7 +82,7 @@ static LOADED_PRINTER_DRIVER *FindPrinterDriverFromName(const char *pszDriver)
pLPD = ptmpLPD;
}
}
if (pLPD == NULL) printf("Couldn't find driver %s\n", pszDriver);
if (pLPD == NULL) fprintf(stderr,"Couldn't find driver %s\n", pszDriver);
return pLPD;
}
@ -132,7 +132,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
}
if (!bSlotFound)
{
printf("Too many printers drivers loaded\n");
fprintf(stderr,"Too many printers drivers loaded\n");
return NULL;
}
@ -381,7 +381,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
lP1, lP2, lP3, lP4);
}
else
printf("Failed to find device\n");
fprintf(stderr,"Failed to find device\n");
dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: return %x\n", wRet);
return wRet;
@ -423,7 +423,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
lP1, wP2, lP3, lP4);
}
else
printf("Failed to find device\n");
fprintf(stderr,"Failed to find device\n");
dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: return %x\n", wRet);
return wRet;
@ -465,7 +465,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
nSize = sizeof(LOGFONT16);
break;
default:
printf("PRTDRV_RealizeObject: Object type %d not supported\n", wStyle);
fprintf(stderr,"PRTDRV_RealizeObject: Object type %d not supported\n", wStyle);
nSize = 0;
}

View File

@ -2033,15 +2033,15 @@ LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont )
HFONT32 X11DRV_FONT_SelectObject( DC* dc, HFONT32 hfont, FONTOBJ* font )
{
HFONT32 hPrevFont = 0;
LOGFONT16 lf;
LOGFONT16 lf;
if( CHECK_PFONT(dc->u.x.font) )
XFONT_ReleaseCacheEntry( __PFONT(dc->u.x.font) );
/* FIXME: do we need to pass anything back from here? */
memcpy(&lf,&font->logfont,sizeof(lf));
lf.lfWidth = font->logfont.lfWidth * dc->vportExtX/dc->wndExtX;
lf.lfHeight = font->logfont.lfHeight* dc->vportExtY/dc->wndExtY;
lf.lfWidth = font->logfont.lfWidth * dc->vportExtX/dc->wndExtX;
lf.lfHeight = font->logfont.lfHeight* dc->vportExtY/dc->wndExtY;
dc->u.x.font = XFONT_RealizeFont( &lf );
hPrevFont = dc->w.hFont;

View File

@ -1,6 +1,5 @@
name advapi32
type win32
base 0
0000 stub AbortSystemShutdownA
0001 stub AbortSystemShutdownW

View File

@ -33,6 +33,7 @@ typedef struct
int size; /* Number of functions */
const void *code_start; /* Start of DLL code */
const void **functions; /* Pointer to functions table */
const void **nodbg_functions; /* Pointer to funcs without debug */
const char * const *names; /* Pointer to names table */
} WIN32_DESCRIPTOR;
@ -395,8 +396,8 @@ LPCSTR BUILTIN_GetEntryPoint32( void *relay )
relay = (BYTE *)relay - 11; /* The relay entry point is 11 bytes long */
funcs = dll->descr->u.win32.functions;
for (i = 0; i < dll->descr->u.win32.size;i++) if (*funcs++ == relay) break;
sprintf( buffer, "%s.%d: %s",
dll->descr->name, i, dll->descr->u.win32.names[i] );
sprintf( buffer, "%s.%d: %s", dll->descr->name,
dll->descr->u.win32.base + i, dll->descr->u.win32.names[i] );
return buffer;
}
@ -411,6 +412,7 @@ FARPROC32 BUILTIN_GetProcAddress32( NE_MODULE *pModule, LPCSTR function )
{
BUILTIN_DLL *dll = (BUILTIN_DLL *)pModule->pe_module;
const WIN32_DESCRIPTOR *info = &dll->descr->u.win32;
WORD ordinal = 0;
if (!dll) return NULL;
@ -422,17 +424,25 @@ FARPROC32 BUILTIN_GetProcAddress32( NE_MODULE *pModule, LPCSTR function )
function, dll->descr->name );
for (i = 0; i < info->size; i++)
if (info->names[i] && !strcmp( function, info->names[i] ))
return (FARPROC32)info->functions[i];
{
ordinal = info->base + i;
break;
}
if (i >= info->size) return NULL; /* not found */
}
else /* Find function by ordinal */
{
WORD ordinal = LOWORD(function);
ordinal = LOWORD(function);
dprintf_module( stddeb, "Looking for ordinal %d in %s\n",
ordinal, dll->descr->name );
if (ordinal && ordinal < info->size)
return (FARPROC32)info->functions[ordinal - info->base];
if ((ordinal < info->base) || (ordinal >= info->base + info->size))
return NULL; /* not found */
}
return NULL;
#if testing
if (!debugging_relay)
return (FARPROC32)info->nodbg_functions[ordinal - info->base];
#endif
return (FARPROC32)info->functions[ordinal - info->base];
}

View File

@ -1,72 +1,71 @@
name comctl32
type win32
base 2
# Functions exported by the Win95 comctl32.dll
# (these need to have these exact ordinals, because some win95 dlls
# import comctl32.dll by ordinal)
00 stub MenuHelp
01 stub ShowHideMenuCtl
02 stub GetEffectiveClientRect
03 stdcall DrawStatusTextA(long ptr ptr long) DrawStatusText32A
04 stdcall CreateStatusWindowA(long ptr long long) CreateStatusWindow32A
05 stub CreateToolbar
06 stub CreateMappedBitmap
07 stub Cctl1632_ThunkData32
08 stub CreatePropertySheetPage
09 stub CreatePropertySheetPageA
10 stub CreatePropertySheetPageW
11 stub MakeDragList
12 stub LBItemFromPt
13 stub DrawInsert
14 stdcall CreateUpDownControl(long long long long long long long long long long long long) CreateUpDownControl
15 stdcall InitCommonControls() InitCommonControls
16 stub CreateStatusWindow
17 stub CreateStatusWindowW
18 stub CreateToolbarEx
19 stub DestroyPropertySheetPage
20 stub DllGetVersion
21 stub DrawStatusText
22 stub DrawStatusTextW
23 stub ImageList_Add
24 stub ImageList_AddIcon
25 stub ImageList_AddMasked
26 stub ImageList_BeginDrag
27 stub ImageList_Copy
28 stub ImageList_Create
29 stub ImageList_Destroy
30 stub ImageList_DragEnter
31 stub ImageList_DragLeave
32 stub ImageList_DragMove
33 stub ImageList_DragShowNolock
34 stub ImageList_Draw
35 stub ImageList_DrawEx
36 stub ImageList_EndDrag
37 stub ImageList_GetBkColor
38 stub ImageList_GetDragImage
39 stub ImageList_GetIcon
40 stub ImageList_GetIconSize
41 stub ImageList_GetImageCount
42 stub ImageList_GetImageInfo
43 stub ImageList_GetImageRect
44 stub ImageList_LoadImage
45 stub ImageList_LoadImageA
46 stub ImageList_LoadImageW
47 stub ImageList_Merge
48 stub ImageList_Read
49 stub ImageList_Remove
50 stub ImageList_Replace
51 stub ImageList_ReplaceIcon
52 stub ImageList_SetBkColor
53 stub ImageList_SetDragCursorImage
54 stub ImageList_SetFilter
55 stub ImageList_SetIconSize
56 stub ImageList_SetImageCount
57 stub ImageList_SetOverlayImage
58 stub ImageList_Write
59 stub InitCommonControlsEx
60 stub PropertySheet
61 stub PropertySheetA
62 stub PropertySheetW
63 stub _TrackMouseEvent
2 stub MenuHelp
3 stub ShowHideMenuCtl
4 stub GetEffectiveClientRect
5 stdcall DrawStatusTextA(long ptr ptr long) DrawStatusText32A
6 stdcall CreateStatusWindowA(long ptr long long) CreateStatusWindow32A
7 stub CreateToolbar
8 stub CreateMappedBitmap
9 stub Cctl1632_ThunkData32
10 stub CreatePropertySheetPage
11 stub CreatePropertySheetPageA
12 stub CreatePropertySheetPageW
13 stub MakeDragList
14 stub LBItemFromPt
15 stub DrawInsert
16 stdcall CreateUpDownControl(long long long long long long long long long long long long) CreateUpDownControl
17 stdcall InitCommonControls() InitCommonControls
18 stub CreateStatusWindow
19 stub CreateStatusWindowW
20 stub CreateToolbarEx
21 stub DestroyPropertySheetPage
22 stub DllGetVersion
23 stub DrawStatusText
24 stub DrawStatusTextW
25 stub ImageList_Add
26 stub ImageList_AddIcon
27 stub ImageList_AddMasked
28 stub ImageList_BeginDrag
29 stub ImageList_Copy
30 stub ImageList_Create
31 stub ImageList_Destroy
32 stub ImageList_DragEnter
33 stub ImageList_DragLeave
34 stub ImageList_DragMove
35 stub ImageList_DragShowNolock
36 stub ImageList_Draw
37 stub ImageList_DrawEx
38 stub ImageList_EndDrag
39 stub ImageList_GetBkColor
40 stub ImageList_GetDragImage
41 stub ImageList_GetIcon
42 stub ImageList_GetIconSize
43 stub ImageList_GetImageCount
44 stub ImageList_GetImageInfo
45 stub ImageList_GetImageRect
46 stub ImageList_LoadImage
47 stub ImageList_LoadImageA
48 stub ImageList_LoadImageW
49 stub ImageList_Merge
50 stub ImageList_Read
51 stub ImageList_Remove
52 stub ImageList_Replace
53 stub ImageList_ReplaceIcon
54 stub ImageList_SetBkColor
55 stub ImageList_SetDragCursorImage
56 stub ImageList_SetFilter
57 stub ImageList_SetIconSize
58 stub ImageList_SetImageCount
59 stub ImageList_SetOverlayImage
60 stub ImageList_Write
61 stub InitCommonControlsEx
62 stub PropertySheet
63 stub PropertySheetA
64 stub PropertySheetW
65 stub _TrackMouseEvent

View File

@ -1,29 +1,28 @@
name comdlg32
type win32
base 1
0000 stub ArrowBtnWndProc
0001 stub ChooseColorA
0002 stub ChooseColorW
0003 stub ChooseFontA
0004 stub ChooseFontW
0005 stdcall CommDlgExtendedError() CommDlgExtendedError
0006 stub FindTextA
0007 stub FindTextW
0008 stdcall GetFileTitleA(ptr ptr long) GetFileTitle32A
0009 stdcall GetFileTitleW(ptr ptr long) GetFileTitle32W
0010 stdcall GetOpenFileNameA(ptr) GetOpenFileName32A
0011 stdcall GetOpenFileNameW(ptr) GetOpenFileName32W
0012 stdcall GetSaveFileNameA(ptr) GetSaveFileName32A
0013 stdcall GetSaveFileNameW(ptr) GetSaveFileName32A
0014 stub LoadAlterBitmap
0015 stub PageSetupDlgA
0016 stub PageSetupDlgW
0017 return PrintDlgA 4 0
0018 return PrintDlgW 4 0
0019 stub ReplaceTextA
0020 stub ReplaceTextW
0021 stub WantArrows
0022 stub dwLBSubclass
0023 stub dwOKSubclass
0 stub ArrowBtnWndProc
1 stub ChooseColorA
2 stub ChooseColorW
3 stub ChooseFontA
4 stub ChooseFontW
5 stdcall CommDlgExtendedError() CommDlgExtendedError
6 stub FindTextA
7 stub FindTextW
8 stdcall GetFileTitleA(ptr ptr long) GetFileTitle32A
9 stdcall GetFileTitleW(ptr ptr long) GetFileTitle32W
10 stdcall GetOpenFileNameA(ptr) GetOpenFileName32A
11 stdcall GetOpenFileNameW(ptr) GetOpenFileName32W
12 stdcall GetSaveFileNameA(ptr) GetSaveFileName32A
13 stdcall GetSaveFileNameW(ptr) GetSaveFileName32A
14 stub LoadAlterBitmap
15 stub PageSetupDlgA
16 stub PageSetupDlgW
17 return PrintDlgA 4 0
18 return PrintDlgW 4 0
19 stub ReplaceTextA
20 stub ReplaceTextW
21 stub WantArrows
22 stub dwLBSubclass
23 stub dwOKSubclass

View File

@ -18,9 +18,9 @@ type win16
15 pascal CoDisconnectObject(ptr long) CoDisconnectObject
16 stub CORELEASEMARSHALDATA
17 stub COFREEUNUSEDLIBRARIES
18 stub ISEQUALGUID
19 pascal STRINGFROMCLSID(ptr ptr) StringFromCLSID
20 pascal CLSIDFROMSTRING(str ptr) CLSIDFromString
18 pascal16 IsEqualGUID(ptr ptr) IsEqualGUID
19 pascal StringFromCLSID(ptr ptr) StringFromCLSID
20 pascal CLSIDFromString(str ptr) CLSIDFromString
21 stub ISVALIDPTRIN
22 stub ISVALIDPTROUT
23 stub ISVALIDINTERFACE

View File

@ -1,107 +1,106 @@
# C RunTime DLL. All functions use cdecl!
name crtdll
type win32
base 1
001 cdecl ??2@YAPAXI@Z(long) CRTDLL_new
002 cdecl ??3@YAXPAX@Z(long) CRTDLL_delete
003 cdecl ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) CRTDLL_set_new_handler
004 stub _CIacos
005 stub _CIasin
006 stub _CIatan
007 stub _CIatan2
008 stub _CIcos
009 stub _CIcosh
010 stub _CIexp
011 stub _CIfmod
012 stub _CIlog
013 stub _CIlog10
014 stub _CIpow
015 stub _CIsin
016 stub _CIsinh
017 stub _CIsqrt
018 stub _CItan
019 stub _CItanh
020 stub _HUGE_dll
021 stub _XcptFilter
022 cdecl __GetMainArgs(ptr ptr ptr long) CRTDLL__GetMainArgs
023 extern __argc_dll CRTDLL_argc_dll
024 extern __argv_dll CRTDLL_argv_dll
025 stub __dllonexit
026 stub __doserrno
027 stub __fpecode
028 stub __isascii
029 stub __iscsym
030 stub __iscsymf
031 stub __mb_cur_max_dll
032 stub __pxcptinfoptrs
033 stub __threadhandle
034 stub __threadid
035 stub __toascii
036 stub _abnormal_termination
037 stub _access
038 extern _acmdln_dll CRTDLL_acmdln_dll
039 stub _aexit_rtn_dll
040 stub _amsg_exit
041 stub _assert
042 extern _basemajor_dll CRTDLL_basemajor_dll
043 extern _baseminor_dll CRTDLL_baseminor_dll
044 extern _baseversion_dll CRTDLL_baseversion_dll
045 stub _beep
046 stub _beginthread
047 stub _c_exit
048 stub _cabs
049 stub _cexit
050 stub _cgets
051 cdecl _chdir(ptr) CRTDLL__chdir
052 cdecl _chdrive(long) CRTDLL__chdrive
053 stub _chgsign
054 stub _chmod
055 stub _chsize
056 stub _clearfp
057 stub _close
058 stub _commit
059 long _commode_dll(0)
060 stub _control87
061 stub _controlfp
062 stub _copysign
063 stub _cprintf
064 stub _cpumode_dll
065 stub _cputs
066 stub _creat
067 stub _cscanf
068 stub _ctype
069 stub _cwait
070 stub _daylight_dll
071 stub _dup
072 stub _dup2
073 stub _ecvt
074 stub _endthread
075 extern _environ_dll CRTDLL_environ_dll
076 stub _eof
077 cdecl _errno() CRTDLL__errno
078 stub _except_handler2
079 stub _execl
080 stub _execle
081 stub _execlp
082 stub _execlpe
083 stub _execv
084 stub _execve
085 stub _execvp
086 stub _execvpe
087 stub _exit
088 stub _expand
089 stub _fcloseall
090 stub _fcvt
091 stub _fdopen
092 stub _fgetchar
093 stub _fgetwchar
094 stub _filbuf
095 stub _fileinfo_dll
096 stub _filelength
097 stub _fileno
098 stub _findclose
099 stub _findfirst
1 cdecl ??2@YAPAXI@Z(long) CRTDLL_new
2 cdecl ??3@YAXPAX@Z(long) CRTDLL_delete
3 cdecl ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) CRTDLL_set_new_handler
4 stub _CIacos
5 stub _CIasin
6 stub _CIatan
7 stub _CIatan2
8 stub _CIcos
9 stub _CIcosh
10 stub _CIexp
11 stub _CIfmod
12 stub _CIlog
13 stub _CIlog10
14 stub _CIpow
15 stub _CIsin
16 stub _CIsinh
17 stub _CIsqrt
18 stub _CItan
19 stub _CItanh
20 stub _HUGE_dll
21 stub _XcptFilter
22 cdecl __GetMainArgs(ptr ptr ptr long) CRTDLL__GetMainArgs
23 extern __argc_dll CRTDLL_argc_dll
24 extern __argv_dll CRTDLL_argv_dll
25 stub __dllonexit
26 stub __doserrno
27 stub __fpecode
28 stub __isascii
29 stub __iscsym
30 stub __iscsymf
31 stub __mb_cur_max_dll
32 stub __pxcptinfoptrs
33 stub __threadhandle
34 stub __threadid
35 stub __toascii
36 stub _abnormal_termination
37 stub _access
38 extern _acmdln_dll CRTDLL_acmdln_dll
39 stub _aexit_rtn_dll
40 stub _amsg_exit
41 stub _assert
42 extern _basemajor_dll CRTDLL_basemajor_dll
43 extern _baseminor_dll CRTDLL_baseminor_dll
44 extern _baseversion_dll CRTDLL_baseversion_dll
45 stub _beep
46 stub _beginthread
47 stub _c_exit
48 stub _cabs
49 cdecl _cexit(long) CRTDLL__cexit
50 stub _cgets
51 cdecl _chdir(ptr) CRTDLL__chdir
52 cdecl _chdrive(long) CRTDLL__chdrive
53 stub _chgsign
54 stub _chmod
55 stub _chsize
56 stub _clearfp
57 cdecl _close(long) CRTDLL__close
58 stub _commit
59 long _commode_dll(0)
60 stub _control87
61 stub _controlfp
62 stub _copysign
63 stub _cprintf
64 stub _cpumode_dll
65 stub _cputs
66 stub _creat
67 stub _cscanf
68 stub _ctype
69 stub _cwait
70 stub _daylight_dll
71 stub _dup
72 stub _dup2
73 stub _ecvt
74 stub _endthread
75 extern _environ_dll CRTDLL_environ_dll
76 stub _eof
77 cdecl _errno() CRTDLL__errno
78 stub _except_handler2
79 stub _execl
80 stub _execle
81 stub _execlp
82 stub _execlpe
83 stub _execv
84 stub _execve
85 stub _execvp
86 stub _execvpe
87 stub _exit
88 stub _expand
89 stub _fcloseall
90 stub _fcvt
91 cdecl _fdopen(long ptr) CRTDLL__fdopen
92 stub _fgetchar
93 stub _fgetwchar
94 stub _filbuf
95 stub _fileinfo_dll
96 stub _filelength
97 stub _fileno
98 stub _findclose
99 stub _findfirst
100 stub _findnext
101 stub _finite
102 stub _flsbuf
@ -122,7 +121,7 @@ base 1
117 stub _get_osfhandle
118 stub _getch
119 stub _getche
120 stub _getcwd
120 cdecl _getcwd(ptr long) CRTDLL__getcwd
121 stub _getdcwd
122 stub _getdiskfree
123 stub _getdllprocaddr
@ -167,7 +166,7 @@ base 1
162 stub _ismbslead
163 stub _ismbstrail
164 stub _isnan
165 stub _itoa
165 cdecl _itoa(long ptr long) CRTDLL__itoa
166 stub _itow
167 stub _j0
168 stub _j1
@ -178,7 +177,7 @@ base 1
173 register _local_unwind2(ptr long) CRTDLL__local_unwind2
174 stub _locking
175 stub _logb
176 stub _lrotl
176 cdecl _lrotl (long long) CRTDLL__lrotl
177 stub _lrotr
178 stub _lsearch
179 stub _lseek
@ -241,8 +240,8 @@ base 1
236 stub _msize
237 stub _nextafter
238 stub _onexit
239 stub _open
240 stub _open_osfhandle
239 cdecl _open(ptr long) CRTDLL__open
240 cdecl _open_osfhandle(long long) CRTDLL__open_osfhandle
241 extern _osmajor_dll CRTDLL_osmajor_dll
242 extern _osminor_dll CRTDLL_osminor_dll
243 long _osmode_dll(0)
@ -269,7 +268,7 @@ base 1
264 stub _setjmp
265 cdecl _setmode(long long) CRTDLL__setmode
266 stub _setsystime
267 stub _sleep
267 cdecl _sleep(long) sleep
268 stub _snprintf
269 stub _snwprintf
270 stub _sopen
@ -284,18 +283,18 @@ base 1
279 stub _splitpath
280 stub _stat
281 stub _statusfp
282 cdecl _strcmpi(ptr ptr) lstrcmpi32A
282 cdecl _strcmpi(ptr ptr) CRTDLL__strcmpi
283 stub _strdate
284 stub _strdec
285 cdecl _strdup(ptr) CRTDLL__strdup
286 stub _strerror
287 cdecl _stricmp(ptr ptr) lstrcmpi32A
287 cdecl _stricmp(ptr ptr) CRTDLL__strcmpi
288 stub _stricoll
289 stub _strinc
290 stub _strlwr
290 cdecl _strlwr(ptr) CRTDLL__strlwr
291 stub _strncnt
292 stub _strnextc
293 cdecl _strnicmp(ptr ptr long) lstrncmpi32A
293 cdecl _strnicmp(ptr ptr long) CRTDLL__strnicmp
294 stub _strninc
295 stub _strnset
296 stub _strrev
@ -307,7 +306,7 @@ base 1
302 stub _sys_errlist
303 stub _sys_nerr_dll
304 stub _tell
305 stub _tempnam
305 cdecl _tempnam(ptr ptr) CRTDLL__tempnam
306 stub _timezone_dll
307 stub _tolower
308 stub _toupper
@ -317,16 +316,16 @@ base 1
312 stub _ultow
313 stub _umask
314 stub _ungetch
315 stub _unlink
315 cdecl _unlink(ptr) CRTDLL__unlink
316 stub _unloaddll
317 stub _utime
318 stub _vsnprintf
319 stub _vsnwprintf
320 stub _wcsdup
321 cdecl _wcsicmp(ptr ptr) lstrcmpi32W
321 cdecl _wcsicmp(ptr ptr) CRTDLL__wcsicmp
322 cdecl _wcsicoll(ptr ptr) CRTDLL__wcsicoll
323 cdecl _wcslwr(ptr) CRTDLL__wcslwr
324 stub _wcsnicmp
324 cdecl _wcsnicmp(ptr ptr long) CRTDLL__wcsnicmp
325 stub _wcsnset
326 cdecl _wcsrev(ptr) CRTDLL__wcsrev
327 stub _wcsset
@ -341,72 +340,72 @@ base 1
336 stub _y1
337 stub _yn
338 stub abort
339 cdecl abs(long) CRTDLL_abs
340 cdecl acos(long) CRTDLL_acos
339 cdecl abs(long) abs
340 cdecl acos(double) acos
341 cdecl asctime(ptr) asctime
342 cdecl asin(long) CRTDLL_asin
343 cdecl atan(long) CRTDLL_atan
344 cdecl atan2(long long) CRTDLL_atan2
342 cdecl asin(double) asin
343 cdecl atan(double) atan
344 cdecl atan2(double double) atan2
345 cdecl atexit(ptr) CRTDLL_atexit
346 cdecl atof(ptr) CRTDLL_atof
347 cdecl atoi(ptr) CRTDLL_atoi
348 cdecl atol(ptr) CRTDLL_atol
346 cdecl atof(ptr) atof
347 cdecl atoi(ptr) atoi
348 cdecl atol(ptr) atol
349 stub bsearch
350 cdecl calloc(long long) CRTDLL_calloc
351 stub ceil
352 stub clearerr
353 cdecl clock() clock
354 cdecl cos(long) CRTDLL_cos
355 cdecl cosh(long) CRTDLL_cosh
354 cdecl cos(double) cos
355 cdecl cosh(double) cosh
356 cdecl ctime(ptr) ctime
357 stub difftime
358 cdecl div(long long) div
359 cdecl exit(long) CRTDLL_exit
360 cdecl exp(long) CRTDLL_exp
361 cdecl fabs(long) CRTDLL_fabs
360 cdecl exp(double) exp
361 cdecl fabs(double) fabs
362 cdecl fclose(ptr) CRTDLL_fclose
363 stub feof
363 cdecl feof(ptr) CRTDLL_feof
364 stub ferror
365 cdecl fflush(ptr) CRTDLL_fflush
366 stub fgetc
366 cdecl fgetc(ptr) CRTDLL_fgetc
367 stub fgetpos
368 stub fgets
368 cdecl fgets(ptr long ptr) CRTDLL_fgets
369 stub fgetwc
370 stub floor
371 stub fmod
372 stub fopen
373 cdecl fprintf() CRTDLL_fprintf
374 stub fputc
375 stub fputs
371 cdecl fmod(double double) fmod
372 cdecl fopen(ptr ptr) CRTDLL_fopen
373 varargs fprintf() CRTDLL_fprintf
374 cdecl fputc(long ptr) CRTDLL_fputc
375 cdecl fputs(ptr ptr) CRTDLL_fputs
376 stub fputwc
377 stub fread
377 cdecl fread(ptr long long ptr) CRTDLL_fread
378 cdecl free(ptr) CRTDLL_free
379 stub freopen
380 stub frexp
381 stub fscanf
382 stub fseek
382 cdecl fseek(ptr long long) CRTDLL_fseek
383 stub fsetpos
384 stub ftell
384 cdecl ftell(ptr) CRTDLL_ftell
385 stub fwprintf
386 stub fwrite
386 cdecl fwrite(ptr long long ptr) CRTDLL_fwrite
387 stub fwscanf
388 stub getc
388 cdecl getc(ptr) CRTDLL_getc
389 stub getchar
390 stub getenv
391 cdecl gets(ptr) CRTDLL_gets
392 cdecl gmtime(ptr) gmtime
393 stub is_wctype
394 cdecl isalnum(long) CRTDLL_isalnum
395 cdecl isalpha(long) CRTDLL_isalpha
396 cdecl iscntrl(long) CRTDLL_iscntrl
397 cdecl isdigit(long) CRTDLL_isdigit
398 cdecl isgraph(long) CRTDLL_isgraph
394 cdecl isalnum(long) isalnum
395 cdecl isalpha(long) isalpha
396 cdecl iscntrl(long) iscntrl
397 cdecl isdigit(long) isdigit
398 cdecl isgraph(long) isgraph
399 stub isleadbyte
400 cdecl islower(long) CRTDLL_islower
401 cdecl isprint(long) CRTDLL_isprint
402 cdecl ispunct(long) CRTDLL_ispunct
403 cdecl isspace(long) CRTDLL_isspace
404 cdecl isupper(long) CRTDLL_isupper
400 cdecl islower(long) islower
401 cdecl isprint(long) isprint
402 cdecl ispunct(long) ispunct
403 cdecl isspace(long) isspace
404 cdecl isupper(long) isupper
405 stub iswalnum
406 stub iswalpha
407 stub iswascii
@ -420,19 +419,19 @@ base 1
415 stub iswspace
416 stub iswupper
417 stub iswxdigit
418 cdecl isxdigit(long) CRTDLL_isxdigit
419 cdecl labs(long) CRTDLL_labs
418 cdecl isxdigit(long) isxdigit
419 cdecl labs(long) labs
420 stub ldexp
421 cdecl ldiv(long long) ldiv
422 stub localeconv
423 cdecl localtime(ptr) localtime
424 cdecl log(long) CRTDLL_log
425 cdecl log10(long) CRTDLL_log10
424 cdecl log(double) log
425 cdecl log10(double) log10
426 stub longjmp
427 cdecl malloc(ptr) CRTDLL_malloc
428 stub mblen
428 cdecl mblen(ptr long) CRTDLL_mblen
429 cdecl mbstowcs(ptr ptr long) CRTDLL_mbstowcs
430 cdecl mbtowc(long) CRTDLL_mbtowc
430 cdecl mbtowc(ptr ptr long) CRTDLL_mbtowc
431 cdecl memchr(ptr long long) memchr
432 cdecl memcmp(ptr ptr long) memcmp
433 cdecl memcpy(ptr ptr long) memcpy
@ -441,11 +440,11 @@ base 1
436 cdecl mktime(ptr) mktime
437 stub modf
438 stub perror
439 cdecl pow(long long) CRTDLL_pow
440 cdecl printf() CRTDLL_printf
441 stub putc
439 cdecl pow(double double) pow
440 varargs printf() printf
441 cdecl putc(long ptr) CRTDLL_putc
442 cdecl putchar(long) CRTDLL_putchar
443 stub puts
443 cdecl puts(ptr) CRTDLL_puts
444 cdecl qsort(ptr long long ptr) qsort
445 stub raise
446 cdecl rand() CRTDLL_rand
@ -454,16 +453,16 @@ base 1
449 stub rename
450 stub rewind
451 stub scanf
452 stub setbuf
452 cdecl setbuf(ptr ptr) CRTDLL_setbuf
453 cdecl setlocale(long ptr) CRTDLL_setlocale
454 stub setvbuf
455 stub signal
456 cdecl sin(long) CRTDLL_sin
457 cdecl sinh(long) CRTDLL_sinh
458 cdecl sprintf() CRTDLL_sprintf
459 cdecl sqrt(long long) CRTDLL_sqrt
456 cdecl sin(double) sin
457 cdecl sinh(double) sinh
458 varargs sprintf() wsprintf32A
459 cdecl sqrt(double) sqrt
460 cdecl srand(long) CRTDLL_srand
461 cdecl sscanf() CRTDLL_sscanf
461 varargs sscanf() sscanf
462 cdecl strcat(ptr ptr) strcat
463 cdecl strchr(ptr long) strchr
464 cdecl strcmp(ptr ptr) strcmp
@ -480,42 +479,42 @@ base 1
475 cdecl strrchr(ptr long) strrchr
476 cdecl strspn(ptr ptr) strspn
477 cdecl strstr(ptr ptr) strstr
478 stub strtod
478 cdecl strtod(ptr ptr) strtod
479 cdecl strtok(ptr ptr) strtok
480 cdecl strtol(ptr ptr long) strtol
481 cdecl strtoul(ptr ptr long) strtoul
482 cdecl strxfrm(ptr ptr long) strxfrm
483 cdecl swprintf() CRTDLL_swprintf
483 varargs swprintf() wsprintf32W
484 stub swscanf
485 stub system
486 cdecl tan(long) CRTDLL_tan
487 cdecl tanh(long) CRTDLL_tanh
485 cdecl system(ptr) CRTDLL_system
486 cdecl tan(double) tan
487 cdecl tanh(double) tanh
488 cdecl time(ptr) CRTDLL_time
489 stub tmpfile
490 stub tmpnam
491 cdecl tolower(long) CRTDLL_tolower
492 cdecl toupper(long) CRTDLL_toupper
490 cdecl tmpnam(ptr) CRTDLL_tmpnam
491 cdecl tolower(long) tolower
492 cdecl toupper(long) toupper
493 stub towlower
494 cdecl towupper(long) CRTDLL_towupper
495 stub ungetc
496 stub ungetwc
497 stub vfprintf
497 cdecl vfprintf(ptr ptr ptr) CRTDLL_vfprintf
498 stub vfwprintf
499 stub vprintf
500 cdecl vsprintf() CRTDLL_vsprintf
501 stub vswprintf
500 cdecl vsprintf(ptr ptr ptr) CRTDLL_vsprintf
501 cdecl vswprintf(ptr ptr ptr) CRTDLL_vswprintf
502 stub vwprintf
503 cdecl wcscat(ptr ptr) lstrcat32W
503 cdecl wcscat(ptr ptr) CRTDLL_wcscat
504 cdecl wcschr(ptr long) CRTDLL_wcschr
505 stub wcscmp
505 cdecl wcscmp(ptr ptr) CRTDLL_wcscmp
506 cdecl wcscoll(ptr ptr) CRTDLL_wcscoll
507 cdecl wcscpy(ptr ptr) lstrcpy32W
507 cdecl wcscpy(ptr ptr) CRTDLL_wcscpy
508 cdecl wcscspn(ptr ptr) CRTDLL_wcscspn
509 stub wcsftime
510 cdecl wcslen(ptr) lstrlen32W
511 cdecl wcsncat(ptr ptr long) lstrcatn32W
512 cdecl wcsncmp(ptr ptr long) lstrncmp32W
513 cdecl wcsncpy(ptr ptr long) lstrcpyn32W
510 cdecl wcslen(ptr) CRTDLL_wcslen
511 cdecl wcsncat(ptr ptr long) CRTDLL_wcsncat
512 cdecl wcsncmp(ptr ptr long) CRTDLL_wcsncmp
513 cdecl wcsncpy(ptr ptr long) CRTDLL_wcsncpy
514 stub wcspbrk
515 cdecl wcsrchr(ptr long) CRTDLL_wcsrchr
516 cdecl wcsspn(ptr ptr) CRTDLL_wcsspn
@ -523,7 +522,7 @@ base 1
518 stub wcstod
519 stub wcstok
520 stub wcstol
521 stub wcstombs
521 cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs
522 stub wcstoul
523 stub wcsxfrm
524 stub wctomb

View File

@ -38,7 +38,7 @@ file gdi.exe
30 pascal16 SaveDC(word) SaveDC16
31 pascal SetPixel(word s_word s_word long) SetPixel16
32 pascal16 OffsetClipRgn(word s_word s_word) OffsetClipRgn16
33 pascal16 TextOut(word s_word s_word ptr word) TextOut16
33 pascal16 TextOut(word s_word s_word str word) TextOut16
34 pascal16 BitBlt( word s_word s_word s_word s_word word s_word s_word long)
BitBlt16
35 pascal16 StretchBlt(word s_word s_word s_word s_word word s_word s_word
@ -236,7 +236,7 @@ file gdi.exe
s_word s_word) Chord16
349 pascal SetMapperFlags(word long) SetMapperFlags16
350 pascal16 GetCharWidth(word word word ptr) GetCharWidth16
351 pascal16 ExtTextOut(word s_word s_word word ptr ptr word ptr) ExtTextOut16
351 pascal16 ExtTextOut(word s_word s_word word ptr str word ptr) ExtTextOut16
352 stub GetPhysicalFontHandle
353 stub GetAspectRatioFilter
354 stub ShrinkGDIHeap

View File

@ -1,398 +1,397 @@
name gdi32
type win32
base 1
0000 stub AbortDoc
0001 stub AbortPath
0002 stdcall AddFontResourceA(ptr) AddFontResource32A
0003 stub AddFontResourceTracking
0004 stdcall AddFontResourceW(ptr) AddFontResource32W
0005 stub AngleArc
0006 stdcall AnimatePalette(long long long ptr) AnimatePalette32
0007 stdcall Arc(long long long long long long long long long) Arc32
0008 stub ArcTo
0009 stub BeginPath
0010 stdcall BitBlt(long long long long long long long long long) BitBlt32
0011 stub CancelDC
0012 stub CheckColorsInGamut
0013 stub ChoosePixelFormat
0014 stdcall Chord(long long long long long long long long long) Chord32
0015 stub CloseEnhMetaFile
0016 stub CloseFigure
0017 stub CloseMetaFile
0018 stub ColorMatchToTarget
0019 stdcall CombineRgn(long long long long) CombineRgn32
0020 stub CombineTransform
0021 stub CopyEnhMetaFileA
0022 stub CopyEnhMetaFileW
0023 stdcall CopyMetaFileA(long ptr) CopyMetaFile32A
0024 stdcall CopyMetaFileW(long ptr) CopyMetaFile32W
0025 stdcall CreateBitmap(long long long long ptr) CreateBitmap32
0026 stdcall CreateBitmapIndirect(ptr) CreateBitmapIndirect32
0027 stdcall CreateBrushIndirect(ptr) CreateBrushIndirect32
0028 stub CreateColorSpaceA
0029 stub CreateColorSpaceW
0030 stdcall CreateCompatibleBitmap(long long long) CreateCompatibleBitmap32
0031 stdcall CreateCompatibleDC(long) CreateCompatibleDC32
0032 stdcall CreateDCA(ptr ptr ptr ptr) CreateDC32A
0033 stdcall CreateDCW(ptr ptr ptr ptr) CreateDC32W
0034 stdcall CreateDIBPatternBrush(long long) CreateDIBPatternBrush32
0035 stub CreateDIBPatternBrushPt
0036 stub CreateDIBSection
0037 stdcall CreateDIBitmap(long ptr long ptr ptr long) CreateDIBitmap32
0038 stdcall CreateDiscardableBitmap(long long long) CreateDiscardableBitmap32
0039 stdcall CreateEllipticRgn(long long long long) CreateEllipticRgn32
0040 stdcall CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect32
0041 stub CreateEnhMetaFileA
0042 stub CreateEnhMetaFileW
0043 stdcall CreateFontA(long long long long long long long long
0 stub AbortDoc
1 stub AbortPath
2 stdcall AddFontResourceA(ptr) AddFontResource32A
3 stub AddFontResourceTracking
4 stdcall AddFontResourceW(ptr) AddFontResource32W
5 stub AngleArc
6 stdcall AnimatePalette(long long long ptr) AnimatePalette32
7 stdcall Arc(long long long long long long long long long) Arc32
8 stub ArcTo
9 stub BeginPath
10 stdcall BitBlt(long long long long long long long long long) BitBlt32
11 stub CancelDC
12 stub CheckColorsInGamut
13 stub ChoosePixelFormat
14 stdcall Chord(long long long long long long long long long) Chord32
15 stub CloseEnhMetaFile
16 stub CloseFigure
17 stub CloseMetaFile
18 stub ColorMatchToTarget
19 stdcall CombineRgn(long long long long) CombineRgn32
20 stub CombineTransform
21 stub CopyEnhMetaFileA
22 stub CopyEnhMetaFileW
23 stdcall CopyMetaFileA(long ptr) CopyMetaFile32A
24 stdcall CopyMetaFileW(long ptr) CopyMetaFile32W
25 stdcall CreateBitmap(long long long long ptr) CreateBitmap32
26 stdcall CreateBitmapIndirect(ptr) CreateBitmapIndirect32
27 stdcall CreateBrushIndirect(ptr) CreateBrushIndirect32
28 stub CreateColorSpaceA
29 stub CreateColorSpaceW
30 stdcall CreateCompatibleBitmap(long long long) CreateCompatibleBitmap32
31 stdcall CreateCompatibleDC(long) CreateCompatibleDC32
32 stdcall CreateDCA(ptr ptr ptr ptr) CreateDC32A
33 stdcall CreateDCW(ptr ptr ptr ptr) CreateDC32W
34 stdcall CreateDIBPatternBrush(long long) CreateDIBPatternBrush32
35 stub CreateDIBPatternBrushPt
36 stdcall CreateDIBSection(long ptr long ptr long long) CreateDIBSection
37 stdcall CreateDIBitmap(long ptr long ptr ptr long) CreateDIBitmap32
38 stdcall CreateDiscardableBitmap(long long long) CreateDiscardableBitmap32
39 stdcall CreateEllipticRgn(long long long long) CreateEllipticRgn32
40 stdcall CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect32
41 stub CreateEnhMetaFileA
42 stub CreateEnhMetaFileW
43 stdcall CreateFontA(long long long long long long long long
long long long long long ptr) CreateFont32A
0044 stdcall CreateFontIndirectA(ptr) CreateFontIndirect32A
0045 stdcall CreateFontIndirectW(ptr) CreateFontIndirect32W
0046 stdcall CreateFontW(long long long long long long long long
44 stdcall CreateFontIndirectA(ptr) CreateFontIndirect32A
45 stdcall CreateFontIndirectW(ptr) CreateFontIndirect32W
46 stdcall CreateFontW(long long long long long long long long
long long long long long ptr) CreateFont32W
0047 stub CreateHalftonePalette
0048 stdcall CreateHatchBrush(long long) CreateHatchBrush32
0049 stdcall CreateICA(ptr ptr ptr ptr) CreateIC32A
0050 stdcall CreateICW(ptr ptr ptr ptr) CreateIC32W
0051 stub CreateMetaFileA
0052 stub CreateMetaFileW
0053 stdcall CreatePalette(ptr) CreatePalette32
0054 stdcall CreatePatternBrush(long) CreatePatternBrush32
0055 stdcall CreatePen(long long long) CreatePen32
0056 stdcall CreatePenIndirect(ptr) CreatePenIndirect32
0057 stdcall CreatePolyPolygonRgn(ptr ptr long long) CreatePolyPolygonRgn32
0058 stdcall CreatePolygonRgn(ptr long long) CreatePolygonRgn32
0059 stdcall CreateRectRgn(long long long long) CreateRectRgn32
0060 stdcall CreateRectRgnIndirect(ptr) CreateRectRgnIndirect32
0061 stdcall CreateRoundRectRgn(long long long long long long)
47 stub CreateHalftonePalette
48 stdcall CreateHatchBrush(long long) CreateHatchBrush32
49 stdcall CreateICA(ptr ptr ptr ptr) CreateIC32A
50 stdcall CreateICW(ptr ptr ptr ptr) CreateIC32W
51 stub CreateMetaFileA
52 stub CreateMetaFileW
53 stdcall CreatePalette(ptr) CreatePalette32
54 stdcall CreatePatternBrush(long) CreatePatternBrush32
55 stdcall CreatePen(long long long) CreatePen32
56 stdcall CreatePenIndirect(ptr) CreatePenIndirect32
57 stdcall CreatePolyPolygonRgn(ptr ptr long long) CreatePolyPolygonRgn32
58 stdcall CreatePolygonRgn(ptr long long) CreatePolygonRgn32
59 stdcall CreateRectRgn(long long long long) CreateRectRgn32
60 stdcall CreateRectRgnIndirect(ptr) CreateRectRgnIndirect32
61 stdcall CreateRoundRectRgn(long long long long long long)
CreateRoundRectRgn32
0062 stdcall CreateScalableFontResourceA(long ptr ptr ptr) CreateScalableFontResource32A
0063 stdcall CreateScalableFontResourceW(long ptr ptr ptr) CreateScalableFontResource32W
0064 stdcall CreateSolidBrush(long) CreateSolidBrush32
0065 stdcall DPtoLP(long ptr long) DPtoLP32
0066 stub DeleteColorSpace
0067 stdcall DeleteDC(long) DeleteDC32
0068 stub DeleteEnhMetaFile
0069 stub DeleteMetaFile
0070 stdcall DeleteObject(long) DeleteObject32
0071 stub DescribePixelFormat
0072 stub DeviceCapabilitiesExA
0073 stub DeviceCapabilitiesExW
0074 stub DrawEscape
0075 stdcall Ellipse(long long long long long) Ellipse32
0076 stub EndDoc
0077 stub EndPage
0078 stub EndPath
0079 stub EnumEnhMetaFile
0080 stdcall EnumFontFamiliesA(long ptr ptr long) THUNK_EnumFontFamilies32A
0081 stdcall EnumFontFamiliesExA(long ptr ptr long long) THUNK_EnumFontFamiliesEx32A
0082 stdcall EnumFontFamiliesExW(long ptr ptr long long) THUNK_EnumFontFamiliesEx32W
0083 stdcall EnumFontFamiliesW(long ptr ptr long) THUNK_EnumFontFamilies32W
0084 stdcall EnumFontsA(long ptr ptr long) THUNK_EnumFonts32A
0085 stdcall EnumFontsW(long ptr ptr long) THUNK_EnumFonts32W
0086 stub EnumICMProfilesA
0087 stub EnumICMProfilesW
0088 stub EnumMetaFile
0089 stdcall EnumObjects(long long ptr long) THUNK_EnumObjects32
0090 stdcall EqualRgn(long long) EqualRgn32
0091 stdcall Escape(long long long ptr ptr) Escape32
0092 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32
0093 stub ExtCreatePen
0094 stub ExtCreateRegion
0095 stub ExtEscape
0096 stdcall ExtFloodFill(long long long long long) ExtFloodFill32
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
0100 stub FillPath
0101 stdcall FillRgn(long long long) FillRgn32
0102 stub FixBrushOrgEx
0103 stub FlattenPath
0104 stdcall FloodFill(long long long long) FloodFill32
0105 stdcall FrameRgn(long long long long long) FrameRgn32
0106 stub FreeImageColorMatcher
0107 stub GdiAssociateObject
0108 stub GdiCleanCacheDC
0109 stub GdiComment
0110 stub GdiConvertAndCheckDC
0111 stub GdiConvertBitmap
0112 stub GdiConvertBrush
0113 stub GdiConvertDC
0114 stub GdiConvertEnhMetaFile
0115 stub GdiConvertFont
0116 stub GdiConvertMetaFilePict
0117 stub GdiConvertPalette
0118 stub GdiConvertRegion
0119 stub GdiCreateLocalBitmap
0120 stub GdiCreateLocalBrush
0121 stub GdiCreateLocalEnhMetaFile
0122 stub GdiCreateLocalFont
0123 stub GdiCreateLocalMetaFilePict
0124 stub GdiCreateLocalPalette
0125 stub GdiCreateLocalRegion
0126 stub GdiDeleteLocalDC
0127 stub GdiDeleteLocalObject
0128 stub GdiFlush
0129 return GdiGetBatchLimit 0 1
0130 stub GdiGetLocalBrush
0131 stub GdiGetLocalDC
0132 stub GdiGetLocalFont
0133 stub GdiIsMetaFileDC
0134 stub GdiPlayDCScript
0135 stub GdiPlayJournal
0136 stub GdiPlayScript
0137 stub GdiReleaseLocalDC
0138 stub GdiSetAttrs
0139 return GdiSetBatchLimit 4 1
0140 stub GdiSetServerAttr
0141 stub GetArcDirection
0142 stub GetAspectRatioFilterEx
0143 stdcall GetBitmapBits(long long ptr) GetBitmapBits32
0144 stdcall GetBitmapDimensionEx(long ptr) GetBitmapDimensionEx32
0145 stdcall GetBkColor(long) GetBkColor32
0146 stdcall GetBkMode(long) GetBkMode32
0147 stub GetBoundsRect
0148 stdcall GetBrushOrgEx(long ptr) GetBrushOrgEx32
0149 stdcall GetCharABCWidthsA(long long long ptr) GetCharABCWidths32A
0150 stub GetCharABCWidthsFloatA
0151 stub GetCharABCWidthsFloatW
0152 stdcall GetCharABCWidthsW(long long long ptr) GetCharABCWidths32W
0153 stdcall GetCharWidth32A(long long long long) GetCharWidth32A
0154 stdcall GetCharWidth32W(long long long long) GetCharWidth32W
0155 stdcall GetCharWidthA(long long long long) GetCharWidth32A
0156 stub GetCharWidthFloatA
0157 stub GetCharWidthFloatW
0158 stdcall GetCharWidthW(long long long long) GetCharWidth32W
0159 stub GetCharWidthWOW
0160 stub GetCharacterPlacementA
0161 stub GetCharacterPlacementW
0162 stdcall GetClipBox(long ptr) GetClipBox32
0163 stdcall GetClipRgn(long long) GetClipRgn32
0164 stub GetColorAdjustment
0165 stub GetColorSpace
0166 stub GetCurrentObject
0167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
0168 stdcall GetDCOrgEx(long ptr) GetDCOrgEx
0169 stub GetDIBColorTable
0170 stdcall GetDIBits(long long long long ptr ptr long) GetDIBits32
0171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
0172 stub GetDeviceGammaRamp
0173 stub GetETM
0174 stub GetEnhMetaFileA
0175 stub GetEnhMetaFileBits
0176 stub GetEnhMetaFileDescriptionA
0177 stub GetEnhMetaFileDescriptionW
0178 stub GetEnhMetaFileHeader
0179 stub GetEnhMetaFilePaletteEntries
0180 stub GetEnhMetaFileW
0181 stub GetFontData
0182 stub GetFontLanguageInfo
0183 stub GetFontResourceInfo
0184 stub GetFontResourceInfoW
0185 stub GetGlyphOutline
0186 stdcall GetGlyphOutlineA(long long long ptr long ptr ptr) GetGlyphOutline32A
0187 stdcall GetGlyphOutlineW(long long long ptr long ptr ptr) GetGlyphOutline32W
0188 return GetGraphicsMode 4 1 # just return 1
0189 stub GetICMProfileA
0190 stub GetICMProfileW
0191 stub GetKerningPairs
0192 stdcall GetKerningPairsA(long long ptr) GetKerningPairs32A
0193 stdcall GetKerningPairsW(long long ptr) GetKerningPairs32W
0194 stub GetLogColorSpaceA
0195 stub GetLogColorSpaceW
0196 stdcall GetMapMode(long) GetMapMode32
0197 stdcall GetMetaFileA(ptr) GetMetaFile32A
0198 stub GetMetaFileBitsEx
0199 stdcall GetMetaFileW(ptr) GetMetaFile32W
0200 stub GetMetaRgn
0201 stub GetMiterLimit
0202 stdcall GetNearestColor(long long) GetNearestColor32
0203 stdcall GetNearestPaletteIndex(long long) GetNearestPaletteIndex32
0204 stdcall GetObjectA(long long ptr) GetObject32A
0205 stub GetObjectType
0206 stdcall GetObjectW(long long ptr) GetObject32W
0207 stub GetOutlineTextMetricsA
0208 stub GetOutlineTextMetricsW
0209 stdcall GetPaletteEntries(long long long ptr) GetPaletteEntries32
0210 stub GetPath
0211 stdcall GetPixel(long long long) GetPixel32
0212 stub GetPixelFormat
0213 stdcall GetPolyFillMode(long) GetPolyFillMode32
0214 stdcall GetROP2(long) GetROP232
0215 stub GetRandomRgn
0216 stdcall GetRasterizerCaps(ptr long) GetRasterizerCaps32
0217 stub GetRegionData
0218 stdcall GetRelAbs(long) GetRelAbs32
0219 stdcall GetRgnBox(long ptr) GetRgnBox32
0220 stdcall GetStockObject(long) GetStockObject32
0221 stdcall GetStretchBltMode(long) GetStretchBltMode32
0222 stdcall GetSystemPaletteEntries(long long long ptr) GetSystemPaletteEntries32
0223 stdcall GetSystemPaletteUse() GetSystemPaletteUse32
0224 stdcall GetTextAlign(long) GetTextAlign32
0225 stdcall GetTextCharacterExtra(long) GetTextCharacterExtra32
0226 stdcall GetTextCharset(long) GetTextCharset32
0227 stdcall GetTextColor(long) GetTextColor32
0228 stdcall GetTextExtentExPointA(long ptr long long ptr ptr ptr) GetTextExtentExPoint32A
0229 stdcall GetTextExtentExPointW(long ptr long long ptr ptr ptr) GetTextExtentExPoint32W
0230 stdcall GetTextExtentPoint32A(long ptr long ptr) GetTextExtentPoint32A
0231 stdcall GetTextExtentPoint32W(long ptr long ptr) GetTextExtentPoint32W
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32ABuggy
0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32WBuggy
0234 stdcall GetTextFaceA(long long ptr) GetTextFace32A
0235 stdcall GetTextFaceW(long long ptr) GetTextFace32W
0236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A
0237 stdcall GetTextMetricsW(long ptr) GetTextMetrics32W
0238 stub GetTransform
0239 stdcall GetViewportExtEx(long ptr) GetViewportExtEx32
0240 stdcall GetViewportOrgEx(long ptr) GetViewportOrgEx32
0241 stub GetWinMetaFileBits
0242 stdcall GetWindowExtEx(long ptr) GetWindowExtEx32
0243 stdcall GetWindowOrgEx(long ptr) GetWindowOrgEx32
0244 return GetWorldTransform 8 0
0245 stdcall IntersectClipRect(long long long long long) IntersectClipRect32
0246 stdcall InvertRgn(long long) InvertRgn32
0247 stdcall LPtoDP(long ptr long) LPtoDP32
0248 stdcall LineDDA(long long long long ptr long) THUNK_LineDDA32
0249 stdcall LineTo(long long long) LineTo32
0250 stub LoadImageColorMatcherA
0251 stub LoadImageColorMatcherW
0252 stub MaskBlt
0253 stub ModifyWorldTransform
0254 stdcall MoveToEx(long long long ptr) MoveToEx32
0255 stdcall OffsetClipRgn(long long long) OffsetClipRgn32
0256 stdcall OffsetRgn(long long long) OffsetRgn32
0257 stdcall OffsetViewportOrgEx(long long long ptr) OffsetViewportOrgEx32
0258 stdcall OffsetWindowOrgEx(long long long ptr) OffsetWindowOrgEx32
0259 stdcall PaintRgn(long long) PaintRgn32
0260 stdcall PatBlt(long long long long long long) PatBlt32
0261 stub PathToRegion
0262 stdcall Pie(long long long long long long long long long) Pie32
0263 stub PlayEnhMetaFile
0264 stub PlayEnhMetaFileRecord
0265 stdcall PlayMetaFile(long long) PlayMetaFile32
0266 stub PlayMetaFileRecord
0267 stub PlgBlt
0268 stub PolyBezier
0269 stub PolyBezierTo
0270 stub PolyDraw
0271 stdcall PolyPolygon(long ptr ptr long) PolyPolygon32
0272 stub PolyPolyline
0273 stub PolyTextOutA
0274 stub PolyTextOutW
0275 stdcall Polygon(long ptr long) Polygon32
0276 stdcall Polyline(long ptr long) Polyline32
0277 stub PolylineTo
0278 stdcall PtInRegion(long long long) PtInRegion32
0279 stdcall PtVisible(long long long) PtVisible32
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) Rectangle32
0284 stdcall RemoveFontResourceA(ptr) RemoveFontResource32A
0285 stub RemoveFontResourceTracking
0286 stdcall RemoveFontResourceW(ptr) RemoveFontResource32W
0287 stdcall ResetDCA(long ptr) ResetDC32A
0288 stdcall ResetDCW(long ptr) ResetDC32W
0289 stdcall ResizePalette(long long) ResizePalette32
0290 stdcall RestoreDC(long long) RestoreDC32
0291 stdcall RoundRect(long long long long long long long) RoundRect32
0292 stdcall SaveDC(long) SaveDC32
0293 stdcall ScaleViewportExtEx(long long long long long ptr) ScaleViewportExtEx32
0294 stdcall ScaleWindowExtEx(long long long long long ptr) ScaleWindowExtEx32
0295 stub SelectBrushLocal
0296 stub SelectClipPath
0297 stdcall SelectClipRgn(long long) SelectClipRgn32
0298 stub SelectFontLocal
0299 stdcall SelectObject(long long) SelectObject32
0300 stdcall SelectPalette(long long long) SelectPalette32
0301 stub SetAbortProc
0302 stub SetArcDirection
0303 stdcall SetBitmapBits(long long ptr) SetBitmapBits32
0304 stdcall SetBitmapDimensionEx(long long long ptr) SetBitmapDimensionEx32
0305 stdcall SetBkColor(long long) SetBkColor32
0306 stdcall SetBkMode(long long) SetBkMode32
0307 stub SetBoundsRect
0308 stdcall SetBrushOrgEx(long long long ptr) SetBrushOrgEx
0309 stub SetColorAdjustment
0310 stub SetColorSpace
0311 stub SetDIBColorTable
0312 stdcall SetDIBits(long long long long ptr ptr long) SetDIBits32
0313 stdcall SetDIBitsToDevice(long long long long long long long long long
62 stdcall CreateScalableFontResourceA(long ptr ptr ptr) CreateScalableFontResource32A
63 stdcall CreateScalableFontResourceW(long ptr ptr ptr) CreateScalableFontResource32W
64 stdcall CreateSolidBrush(long) CreateSolidBrush32
65 stdcall DPtoLP(long ptr long) DPtoLP32
66 stub DeleteColorSpace
67 stdcall DeleteDC(long) DeleteDC32
68 stub DeleteEnhMetaFile
69 stub DeleteMetaFile
70 stdcall DeleteObject(long) DeleteObject32
71 stub DescribePixelFormat
72 stub DeviceCapabilitiesExA
73 stub DeviceCapabilitiesExW
74 stub DrawEscape
75 stdcall Ellipse(long long long long long) Ellipse32
76 stub EndDoc
77 stub EndPage
78 stub EndPath
79 stub EnumEnhMetaFile
80 stdcall EnumFontFamiliesA(long ptr ptr long) EnumFontFamilies32A
81 stdcall EnumFontFamiliesExA(long ptr ptr long long) EnumFontFamiliesEx32A
82 stdcall EnumFontFamiliesExW(long ptr ptr long long) EnumFontFamiliesEx32W
83 stdcall EnumFontFamiliesW(long ptr ptr long) EnumFontFamilies32W
84 stdcall EnumFontsA(long ptr ptr long) EnumFonts32A
85 stdcall EnumFontsW(long ptr ptr long) EnumFonts32W
86 stub EnumICMProfilesA
87 stub EnumICMProfilesW
88 stub EnumMetaFile
89 stdcall EnumObjects(long long ptr long) EnumObjects32
90 stdcall EqualRgn(long long) EqualRgn32
91 stdcall Escape(long long long ptr ptr) Escape32
92 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32
93 stub ExtCreatePen
94 stub ExtCreateRegion
95 stub ExtEscape
96 stdcall ExtFloodFill(long long long long long) ExtFloodFill32
97 stub ExtSelectClipRgn
98 stdcall ExtTextOutA(long long long long ptr ptr long ptr) ExtTextOut32A
99 stdcall ExtTextOutW(long long long long ptr ptr long ptr) ExtTextOut32W
100 stub FillPath
101 stdcall FillRgn(long long long) FillRgn32
102 stub FixBrushOrgEx
103 stub FlattenPath
104 stdcall FloodFill(long long long long) FloodFill32
105 stdcall FrameRgn(long long long long long) FrameRgn32
106 stub FreeImageColorMatcher
107 stub GdiAssociateObject
108 stub GdiCleanCacheDC
109 stub GdiComment
110 stub GdiConvertAndCheckDC
111 stub GdiConvertBitmap
112 stub GdiConvertBrush
113 stub GdiConvertDC
114 stub GdiConvertEnhMetaFile
115 stub GdiConvertFont
116 stub GdiConvertMetaFilePict
117 stub GdiConvertPalette
118 stub GdiConvertRegion
119 stub GdiCreateLocalBitmap
120 stub GdiCreateLocalBrush
121 stub GdiCreateLocalEnhMetaFile
122 stub GdiCreateLocalFont
123 stub GdiCreateLocalMetaFilePict
124 stub GdiCreateLocalPalette
125 stub GdiCreateLocalRegion
126 stub GdiDeleteLocalDC
127 stub GdiDeleteLocalObject
128 stub GdiFlush
129 return GdiGetBatchLimit 0 1
130 stub GdiGetLocalBrush
131 stub GdiGetLocalDC
132 stub GdiGetLocalFont
133 stub GdiIsMetaFileDC
134 stub GdiPlayDCScript
135 stub GdiPlayJournal
136 stub GdiPlayScript
137 stub GdiReleaseLocalDC
138 stub GdiSetAttrs
139 return GdiSetBatchLimit 4 1
140 stub GdiSetServerAttr
141 stub GetArcDirection
142 stub GetAspectRatioFilterEx
143 stdcall GetBitmapBits(long long ptr) GetBitmapBits32
144 stdcall GetBitmapDimensionEx(long ptr) GetBitmapDimensionEx32
145 stdcall GetBkColor(long) GetBkColor32
146 stdcall GetBkMode(long) GetBkMode32
147 stub GetBoundsRect
148 stdcall GetBrushOrgEx(long ptr) GetBrushOrgEx32
149 stdcall GetCharABCWidthsA(long long long ptr) GetCharABCWidths32A
150 stub GetCharABCWidthsFloatA
151 stub GetCharABCWidthsFloatW
152 stdcall GetCharABCWidthsW(long long long ptr) GetCharABCWidths32W
153 stdcall GetCharWidth32A(long long long long) GetCharWidth32A
154 stdcall GetCharWidth32W(long long long long) GetCharWidth32W
155 stdcall GetCharWidthA(long long long long) GetCharWidth32A
156 stub GetCharWidthFloatA
157 stub GetCharWidthFloatW
158 stdcall GetCharWidthW(long long long long) GetCharWidth32W
159 stub GetCharWidthWOW
160 stub GetCharacterPlacementA
161 stub GetCharacterPlacementW
162 stdcall GetClipBox(long ptr) GetClipBox32
163 stdcall GetClipRgn(long long) GetClipRgn32
164 stub GetColorAdjustment
165 stub GetColorSpace
166 stub GetCurrentObject
167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
168 stdcall GetDCOrgEx(long ptr) GetDCOrgEx
169 stub GetDIBColorTable
170 stdcall GetDIBits(long long long long ptr ptr long) GetDIBits32
171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
172 stub GetDeviceGammaRamp
173 stub GetETM
174 stub GetEnhMetaFileA
175 stub GetEnhMetaFileBits
176 stub GetEnhMetaFileDescriptionA
177 stub GetEnhMetaFileDescriptionW
178 stub GetEnhMetaFileHeader
179 stub GetEnhMetaFilePaletteEntries
180 stub GetEnhMetaFileW
181 stub GetFontData
182 stub GetFontLanguageInfo
183 stub GetFontResourceInfo
184 stub GetFontResourceInfoW
185 stub GetGlyphOutline
186 stdcall GetGlyphOutlineA(long long long ptr long ptr ptr) GetGlyphOutline32A
187 stdcall GetGlyphOutlineW(long long long ptr long ptr ptr) GetGlyphOutline32W
188 return GetGraphicsMode 4 1 # just return 1
189 stub GetICMProfileA
190 stub GetICMProfileW
191 stub GetKerningPairs
192 stdcall GetKerningPairsA(long long ptr) GetKerningPairs32A
193 stdcall GetKerningPairsW(long long ptr) GetKerningPairs32W
194 stub GetLogColorSpaceA
195 stub GetLogColorSpaceW
196 stdcall GetMapMode(long) GetMapMode32
197 stdcall GetMetaFileA(ptr) GetMetaFile32A
198 stub GetMetaFileBitsEx
199 stdcall GetMetaFileW(ptr) GetMetaFile32W
200 stub GetMetaRgn
201 stub GetMiterLimit
202 stdcall GetNearestColor(long long) GetNearestColor32
203 stdcall GetNearestPaletteIndex(long long) GetNearestPaletteIndex32
204 stdcall GetObjectA(long long ptr) GetObject32A
205 stub GetObjectType
206 stdcall GetObjectW(long long ptr) GetObject32W
207 stub GetOutlineTextMetricsA
208 stub GetOutlineTextMetricsW
209 stdcall GetPaletteEntries(long long long ptr) GetPaletteEntries32
210 stub GetPath
211 stdcall GetPixel(long long long) GetPixel32
212 stub GetPixelFormat
213 stdcall GetPolyFillMode(long) GetPolyFillMode32
214 stdcall GetROP2(long) GetROP232
215 stub GetRandomRgn
216 stdcall GetRasterizerCaps(ptr long) GetRasterizerCaps32
217 stub GetRegionData
218 stdcall GetRelAbs(long) GetRelAbs32
219 stdcall GetRgnBox(long ptr) GetRgnBox32
220 stdcall GetStockObject(long) GetStockObject32
221 stdcall GetStretchBltMode(long) GetStretchBltMode32
222 stdcall GetSystemPaletteEntries(long long long ptr) GetSystemPaletteEntries32
223 stdcall GetSystemPaletteUse() GetSystemPaletteUse32
224 stdcall GetTextAlign(long) GetTextAlign32
225 stdcall GetTextCharacterExtra(long) GetTextCharacterExtra32
226 stdcall GetTextCharset(long) GetTextCharset32
227 stdcall GetTextColor(long) GetTextColor32
228 stdcall GetTextExtentExPointA(long ptr long long ptr ptr ptr) GetTextExtentExPoint32A
229 stdcall GetTextExtentExPointW(long ptr long long ptr ptr ptr) GetTextExtentExPoint32W
230 stdcall GetTextExtentPoint32A(long ptr long ptr) GetTextExtentPoint32A
231 stdcall GetTextExtentPoint32W(long ptr long ptr) GetTextExtentPoint32W
232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32ABuggy
233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32WBuggy
234 stdcall GetTextFaceA(long long ptr) GetTextFace32A
235 stdcall GetTextFaceW(long long ptr) GetTextFace32W
236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A
237 stdcall GetTextMetricsW(long ptr) GetTextMetrics32W
238 stub GetTransform
239 stdcall GetViewportExtEx(long ptr) GetViewportExtEx32
240 stdcall GetViewportOrgEx(long ptr) GetViewportOrgEx32
241 stub GetWinMetaFileBits
242 stdcall GetWindowExtEx(long ptr) GetWindowExtEx32
243 stdcall GetWindowOrgEx(long ptr) GetWindowOrgEx32
244 return GetWorldTransform 8 0
245 stdcall IntersectClipRect(long long long long long) IntersectClipRect32
246 stdcall InvertRgn(long long) InvertRgn32
247 stdcall LPtoDP(long ptr long) LPtoDP32
248 stdcall LineDDA(long long long long ptr long) LineDDA32
249 stdcall LineTo(long long long) LineTo32
250 stub LoadImageColorMatcherA
251 stub LoadImageColorMatcherW
252 stub MaskBlt
253 stub ModifyWorldTransform
254 stdcall MoveToEx(long long long ptr) MoveToEx32
255 stdcall OffsetClipRgn(long long long) OffsetClipRgn32
256 stdcall OffsetRgn(long long long) OffsetRgn32
257 stdcall OffsetViewportOrgEx(long long long ptr) OffsetViewportOrgEx32
258 stdcall OffsetWindowOrgEx(long long long ptr) OffsetWindowOrgEx32
259 stdcall PaintRgn(long long) PaintRgn32
260 stdcall PatBlt(long long long long long long) PatBlt32
261 stub PathToRegion
262 stdcall Pie(long long long long long long long long long) Pie32
263 stub PlayEnhMetaFile
264 stub PlayEnhMetaFileRecord
265 stdcall PlayMetaFile(long long) PlayMetaFile32
266 stub PlayMetaFileRecord
267 stub PlgBlt
268 stub PolyBezier
269 stub PolyBezierTo
270 stub PolyDraw
271 stdcall PolyPolygon(long ptr ptr long) PolyPolygon32
272 stub PolyPolyline
273 stub PolyTextOutA
274 stub PolyTextOutW
275 stdcall Polygon(long ptr long) Polygon32
276 stdcall Polyline(long ptr long) Polyline32
277 stub PolylineTo
278 stdcall PtInRegion(long long long) PtInRegion32
279 stdcall PtVisible(long long long) PtVisible32
280 stdcall RealizePalette(long) RealizePalette32
281 stdcall RectInRegion(long ptr) RectInRegion32
282 stdcall RectVisible(long ptr) RectVisible32
283 stdcall Rectangle(long long long long long) Rectangle32
284 stdcall RemoveFontResourceA(ptr) RemoveFontResource32A
285 stub RemoveFontResourceTracking
286 stdcall RemoveFontResourceW(ptr) RemoveFontResource32W
287 stdcall ResetDCA(long ptr) ResetDC32A
288 stdcall ResetDCW(long ptr) ResetDC32W
289 stdcall ResizePalette(long long) ResizePalette32
290 stdcall RestoreDC(long long) RestoreDC32
291 stdcall RoundRect(long long long long long long long) RoundRect32
292 stdcall SaveDC(long) SaveDC32
293 stdcall ScaleViewportExtEx(long long long long long ptr) ScaleViewportExtEx32
294 stdcall ScaleWindowExtEx(long long long long long ptr) ScaleWindowExtEx32
295 stub SelectBrushLocal
296 stub SelectClipPath
297 stdcall SelectClipRgn(long long) SelectClipRgn32
298 stub SelectFontLocal
299 stdcall SelectObject(long long) SelectObject32
300 stdcall SelectPalette(long long long) SelectPalette32
301 stub SetAbortProc
302 stub SetArcDirection
303 stdcall SetBitmapBits(long long ptr) SetBitmapBits32
304 stdcall SetBitmapDimensionEx(long long long ptr) SetBitmapDimensionEx32
305 stdcall SetBkColor(long long) SetBkColor32
306 stdcall SetBkMode(long long) SetBkMode32
307 stub SetBoundsRect
308 stdcall SetBrushOrgEx(long long long ptr) SetBrushOrgEx
309 stub SetColorAdjustment
310 stub SetColorSpace
311 stub SetDIBColorTable
312 stdcall SetDIBits(long long long long ptr ptr long) SetDIBits32
313 stdcall SetDIBitsToDevice(long long long long long long long long long
ptr ptr long) SetDIBitsToDevice32
0314 stub SetDeviceGammaRamp
0315 stub SetEnhMetaFileBits
0316 stub SetFontEnumeration
0317 return SetGraphicsMode 8 1
0318 stub SetICMMode
0319 stub SetICMProfileA
0320 stub SetICMProfileW
0321 stdcall SetMapMode(long long) SetMapMode32
0322 stdcall SetMapperFlags(long long) SetMapperFlags32
0323 stub SetMetaFileBitsEx
0324 stub SetMetaRgn
0325 stub SetMiterLimit
0326 stdcall SetPaletteEntries(long long long ptr) SetPaletteEntries32
0327 stdcall SetPixel(long long long long) SetPixel32
0328 stub SetPixelFormat
0329 stub SetPixelV
0330 stdcall SetPolyFillMode(long long) SetPolyFillMode32
0331 stdcall SetROP2(long long) SetROP232
0332 stdcall SetRectRgn(long long long long long) SetRectRgn32
0333 stdcall SetRelAbs(long long) SetRelAbs32
0334 stdcall SetStretchBltMode(long long) SetStretchBltMode32
0335 stdcall SetSystemPaletteUse(long long) SetSystemPaletteUse32
0336 stdcall SetTextAlign(long long) SetTextAlign32
0337 stdcall SetTextCharacterExtra(long long) SetTextCharacterExtra32
0338 stdcall SetTextColor(long long) SetTextColor32
0339 stdcall SetTextJustification(long long long) SetTextJustification32
0340 stdcall SetViewportExtEx(long long long ptr) SetViewportExtEx32
0341 stdcall SetViewportOrgEx(long long long ptr) SetViewportOrgEx32
0342 stub SetVirtualResolution
0343 stub SetWinMetaFileBits
0344 stdcall SetWindowExtEx(long long long ptr) SetWindowExtEx32
0345 stdcall SetWindowOrgEx(long long long ptr) SetWindowOrgEx32
0346 stub SetWorldTransform
0347 stub StartDocA
0348 stub StartDocW
0349 stub StartPage
0350 stdcall StretchBlt(long long long long long long long long long long long)
StretchBlt32
0351 stdcall StretchDIBits(long long long long long long long long long
ptr ptr long long) StretchDIBits32
0352 stub StrokeAndFillPath
0353 stub StrokePath
0354 stub SwapBuffers
0355 stdcall TextOutA(long long long ptr long) TextOut32A
0356 stdcall TextOutW(long long long ptr long) TextOut32W
0357 stub UnloadNetworkFonts
0358 stdcall UnrealizeObject(long) UnrealizeObject32
0359 stdcall UpdateColors(long) UpdateColors32
0360 stub WidenPath
0361 stub pstackConnect
314 stub SetDeviceGammaRamp
315 stub SetEnhMetaFileBits
316 stub SetFontEnumeration
317 return SetGraphicsMode 8 1
318 stub SetICMMode
319 stub SetICMProfileA
320 stub SetICMProfileW
321 stdcall SetMapMode(long long) SetMapMode32
322 stdcall SetMapperFlags(long long) SetMapperFlags32
323 stub SetMetaFileBitsEx
324 stub SetMetaRgn
325 stub SetMiterLimit
326 stdcall SetPaletteEntries(long long long ptr) SetPaletteEntries32
327 stdcall SetPixel(long long long long) SetPixel32
328 stub SetPixelFormat
329 stub SetPixelV
330 stdcall SetPolyFillMode(long long) SetPolyFillMode32
331 stdcall SetROP2(long long) SetROP232
332 stdcall SetRectRgn(long long long long long) SetRectRgn32
333 stdcall SetRelAbs(long long) SetRelAbs32
334 stdcall SetStretchBltMode(long long) SetStretchBltMode32
335 stdcall SetSystemPaletteUse(long long) SetSystemPaletteUse32
336 stdcall SetTextAlign(long long) SetTextAlign32
337 stdcall SetTextCharacterExtra(long long) SetTextCharacterExtra32
338 stdcall SetTextColor(long long) SetTextColor32
339 stdcall SetTextJustification(long long long) SetTextJustification32
340 stdcall SetViewportExtEx(long long long ptr) SetViewportExtEx32
341 stdcall SetViewportOrgEx(long long long ptr) SetViewportOrgEx32
342 stub SetVirtualResolution
343 stub SetWinMetaFileBits
344 stdcall SetWindowExtEx(long long long ptr) SetWindowExtEx32
345 stdcall SetWindowOrgEx(long long long ptr) SetWindowOrgEx32
346 stub SetWorldTransform
347 stub StartDocA
348 stub StartDocW
349 stub StartPage
350 stdcall StretchBlt(long long long long long long long long long long long)
StretchBlt32
351 stdcall StretchDIBits(long long long long long long long long long
ptr ptr long long) StretchDIBits32
352 stub StrokeAndFillPath
353 stub StrokePath
354 stub SwapBuffers
355 stdcall TextOutA(long long long ptr long) TextOut32A
356 stdcall TextOutW(long long long ptr long) TextOut32W
357 stub UnloadNetworkFonts
358 stdcall UnrealizeObject(long) UnrealizeObject32
359 stdcall UpdateColors(long) UpdateColors32
360 stub WidenPath
361 stub pstackConnect
#late additions
0362 stub DeviceCapabilitiesEx
0363 stub GdiDciBeginAccess
0364 stub GdiDciCreateOffscreenSurface
0365 stub GdiDciCreateOverlaySurface
0366 stub GdiDciCreatePrimarySurface
0367 stub GdiDciDestroySurface
0368 stub GdiDciDrawSurface
0369 stub GdiDciEndAccess
0370 stub GdiDciEnumSurface
0371 stub GdiDciInitialize
0372 stub GdiDciSetClipList
0373 stub GdiDciSetDestination
0374 stub GdiDllInitialize
0375 stub GdiGetLocalBitmap
0376 stub GdiWinWatchClose
0377 stub GdiWinWatchDidStatusChange
0378 stub GdiWinWatchGetClipList
0379 stub GdiWinWatchOpen
0380 stub GetGlyphOutlineWow
0381 stub GetTextCharsetInfo
0382 stdcall TranslateCharsetInfo(ptr ptr long) TranslateCharSetInfo
0383 stub UpdateICMRegKeyA
0384 stub UpdateICMRegKeyW
0385 stub gdiPlaySpoolStream
0386 return SetObjectOwner 8 0
362 stub DeviceCapabilitiesEx
363 stub GdiDciBeginAccess
364 stub GdiDciCreateOffscreenSurface
365 stub GdiDciCreateOverlaySurface
366 stub GdiDciCreatePrimarySurface
367 stub GdiDciDestroySurface
368 stub GdiDciDrawSurface
369 stub GdiDciEndAccess
370 stub GdiDciEnumSurface
371 stub GdiDciInitialize
372 stub GdiDciSetClipList
373 stub GdiDciSetDestination
374 stub GdiDllInitialize
375 stub GdiGetLocalBitmap
376 stub GdiWinWatchClose
377 stub GdiWinWatchDidStatusChange
378 stub GdiWinWatchGetClipList
379 stub GdiWinWatchOpen
380 stub GetGlyphOutlineWow
381 stub GetTextCharsetInfo
382 stdcall TranslateCharsetInfo(ptr ptr long) TranslateCharSetInfo
383 stub UpdateICMRegKeyA
384 stub UpdateICMRegKeyW
385 stub gdiPlaySpoolStream
386 return SetObjectOwner 8 0

View File

@ -39,7 +39,7 @@ file krnl386.exe
35 pascal16 GetTaskQueue(word) GetTaskQueue
36 pascal GetCurrentTask() WIN16_GetCurrentTask
37 pascal GetCurrentPDB() GetCurrentPDB
38 pascal SetTaskSignalProc(word segptr) SetTaskSignalProc
38 pascal SetTaskSignalProc(word segptr) THUNK_SetTaskSignalProc
41 return EnableDos 0 0
42 return DisableDos 0 0
45 pascal16 LoadModule(str ptr) LoadModule16
@ -64,7 +64,7 @@ file krnl386.exe
64 pascal16 AccessResource(word word) AccessResource16
65 pascal SizeofResource(word word) SizeofResource16
66 pascal16 AllocResource(word word long) AllocResource16
67 pascal SetResourceHandler(word segstr ptr) SetResourceHandler
67 pascal SetResourceHandler(word segstr segptr) THUNK_SetResourceHandler
68 pascal16 InitAtomTable(word) InitAtomTable16
69 pascal16 FindAtom(segstr) FindAtom16
70 pascal16 AddAtom(segstr) AddAtom16
@ -89,12 +89,12 @@ file krnl386.exe
89 pascal lstrcat(segstr str) lstrcat16
90 pascal16 lstrlen(str) lstrlen16
91 register InitTask() InitTask
92 pascal GetTempDrive(byte) WIN16_GetTempDrive
92 pascal GetTempDrive(word) WIN16_GetTempDrive
93 pascal16 GetCodeHandle(segptr) GetCodeHandle
94 stub DefineHandleTable
95 pascal16 LoadLibrary(str) LoadLibrary16
96 pascal16 FreeLibrary(word) FreeLibrary16
97 pascal16 GetTempFileName(byte str word ptr) GetTempFileName16
97 pascal16 GetTempFileName(word str word ptr) GetTempFileName16
98 return GetLastDiskChange 0 0
99 stub GetLPErrMode
100 return ValidateCodeSegments 0 0
@ -135,7 +135,7 @@ file krnl386.exe
133 pascal16 GetExePtr(word) GetExePtr
134 pascal16 GetWindowsDirectory(ptr word) GetWindowsDirectory16
135 pascal16 GetSystemDirectory(ptr word) GetSystemDirectory16
136 pascal16 GetDriveType(byte) GetDriveType16
136 pascal16 GetDriveType(word) GetDriveType16
137 pascal16 FatalAppExit(word str) FatalAppExit16
138 pascal GetHeapSpaces(word) GetHeapSpaces
139 stub DoSignal

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@ type win16
#126 pascal GetTableSeg
#127 pascal NewTable
128 pascal OemKeyScan(word) OemKeyScan
129 pascal16 VkKeyScan(byte) VkKeyScan16
130 pascal16 GetKeyboardType(byte) GetKeyboardType16
129 pascal16 VkKeyScan(word) VkKeyScan16
130 pascal16 GetKeyboardType(word) GetKeyboardType16
131 pascal16 MapVirtualKey(word word) MapVirtualKey16
132 pascal16 GetKBCodePage() GetKBCodePage16
133 pascal16 GetKeyNameText(long ptr word) GetKeyNameText16

View File

@ -48,7 +48,7 @@ type win32
0067 stub WNetFormatNetworkNameA
0068 stub WNetFormatNetworkNameW
0069 stdcall WNetGetCachedPassword(ptr long ptr ptr long) WNetGetCachedPassword
0070 stub WNetGetConnectionA
0070 stdcall WNetGetConnectionA(ptr ptr ptr) WNetGetConnection32A
0071 stub WNetGetConnectionW
0072 stub WNetGetHomeDirectoryA
0073 stub WNetGetHomeDirectoryW

View File

@ -1,6 +1,5 @@
name ntdll
type win32
base 0
001 stub CsrAllocateCaptureBuffer
002 stub CsrAllocateCapturePointer
@ -873,82 +872,82 @@ base 0
869 stub _snprintf
870 stub _snwprintf
871 stub _splitpath
872 stub _strcmpi
873 stdcall _stricmp(ptr ptr) lstrcmpi32A
872 cdecl _strcmpi(ptr ptr) CRTDLL__strcmpi
873 cdecl _stricmp(ptr ptr) CRTDLL__strcmpi
874 stub _strlwr
875 stub _strnicmp
876 stdcall _strupr(ptr) CRTDLL__strupr
875 cdecl _strnicmp(ptr ptr long) CRTDLL__strnicmp
876 cdecl _strupr(ptr) CRTDLL__strupr
877 stub _ultoa
878 stub _vsnprintf
879 stdcall _wcsicmp(ptr ptr) lstrcmpi32W
880 stdcall _wcslwr(ptr) CRTDLL__wcslwr
881 stdcall _wcsnicmp(ptr ptr long) lstrncmpi32W
882 stdcall _wcsupr(ptr) CRTDLL__wcsupr
879 cdecl _wcsicmp(ptr ptr) CRTDLL__wcsicmp
880 cdecl _wcslwr(ptr) CRTDLL__wcslwr
881 cdecl _wcsnicmp(ptr ptr long) CRTDLL__wcsnicmp
882 cdecl _wcsupr(ptr) CRTDLL__wcsupr
883 stub abs
884 stub atan
885 stdcall atoi(ptr) CRTDLL_atoi
886 stdcall atol(ptr) CRTDLL_atol
885 cdecl atoi(ptr) atoi
886 cdecl atol(ptr) atol
887 stub ceil
888 stub cos
889 stub fabs
890 stub floor
891 stdcall isalpha(long) CRTDLL_isalpha
892 stdcall isdigit(long) CRTDLL_isdigit
893 stdcall islower(long) CRTDLL_islower
894 stdcall isprint(long) CRTDLL_isprint
895 stdcall isspace(long) CRTDLL_isspace
896 stdcall isupper(long) CRTDLL_isupper
891 cdecl isalpha(long) isalpha
892 cdecl isdigit(long) isdigit
893 cdecl islower(long) islower
894 cdecl isprint(long) isprint
895 cdecl isspace(long) isspace
896 cdecl isupper(long) isupper
897 stub iswalpha
898 stub iswctype
899 stdcall isxdigit(long) CRTDLL_isxdigit
899 cdecl isxdigit(long) isxdigit
900 stub labs
901 stub log
902 stub mbstowcs
903 stub memchr
904 stub memcmp
905 stub memcpy
906 stdcall memmove(ptr ptr long) memmove
907 stub memset
903 cdecl memchr(ptr long long) memchr
904 cdecl memcmp(ptr ptr long) memcmp
905 cdecl memcpy(ptr ptr long) memcpy
906 cdecl memmove(ptr ptr long) memmove
907 cdecl memset(ptr long long) memset
908 stub pow
909 stub qsort
910 stub sin
911 stdcall sprintf() CRTDLL_sprintf
911 varargs sprintf() wsprintf32A
912 stub sqrt
913 stdcall sscanf() CRTDLL_sscanf
914 stub strcat
915 stdcall strchr(ptr long) strchr
916 stdcall strcmp(ptr ptr) lstrcmp32A
917 stdcall strcpy(ptr ptr) lstrcpy32A
918 stub strcspn
919 stdcall strlen(ptr) lstrlen32A
920 stub strncat
921 stub strncmp
922 stub strncpy
923 stub strpbrk
924 stdcall strrchr(ptr long) strrchr
925 stub strspn
926 stub strstr
927 stdcall swprintf() CRTDLL_swprintf
913 varargs sscanf() sscanf
914 cdecl strcat(ptr ptr) strcat
915 cdecl strchr(ptr long) strchr
916 cdecl strcmp(ptr ptr) strcmp
917 cdecl strcpy(ptr ptr) strcpy
918 cdecl strcspn(ptr ptr) strcspn
919 cdecl strlen(ptr) strlen
920 cdecl strncat(ptr ptr long) strncat
921 cdecl strncmp(ptr ptr long) strncmp
922 cdecl strncpy(ptr ptr long) strncpy
923 cdecl strpbrk(ptr ptr long) strpbrk
924 cdecl strrchr(ptr long) strrchr
925 cdecl strspn(ptr ptr) strspn
926 cdecl strstr(ptr ptr) strstr
927 varargs swprintf() wsprintf32W
928 stub tan
929 stdcall tolower(long) CRTDLL_tolower
930 stdcall toupper(long) CRTDLL_toupper
929 cdecl tolower(long) tolower
930 cdecl toupper(long) toupper
931 stub towlower
932 stub towupper
933 stub vsprintf
934 stdcall wcscat(ptr ptr) lstrcat32W
935 stdcall wcschr(ptr long) CRTDLL_wcschr
933 cdecl vsprintf(ptr ptr ptr) CRTDLL_vsprintf
934 cdecl wcscat(ptr ptr) CRTDLL_wcscat
935 cdecl wcschr(ptr long) CRTDLL_wcschr
936 stub wcscmp
937 stdcall wcscpy(ptr ptr) lstrcpy32W
937 cdecl wcscpy(ptr ptr) CRTDLL_wcscpy
938 stub wcscspn
939 stdcall wcslen(ptr) lstrlen32W
939 cdecl wcslen(ptr) CRTDLL_wcslen
940 stub wcsncat
941 stub wcsncmp
942 stdcall wcsncpy(ptr ptr long) lstrcpyn32W
942 cdecl wcsncpy(ptr ptr long) CRTDLL_wcsncpy
943 stub wcspbrk
944 stdcall wcsrchr(ptr long) CRTDLL_wcsrchr
944 cdecl wcsrchr(ptr long) CRTDLL_wcsrchr
945 stub wcsspn
946 stdcall wcsstr(ptr ptr) CRTDLL_wcsstr
946 cdecl wcsstr(ptr ptr) CRTDLL_wcsstr
947 stub wcstok
948 stub wcstol
949 stdcall wcstombs(ptr ptr) lstrcpyWtoA
949 cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs
950 stub wcstoul

View File

@ -74,7 +74,7 @@ type win16
71 stub OLECONVERTOLESTREAMTOISTORAGE
74 stub READFMTUSERTYPESTG
75 stub WRITEFMTUSERTYPESTG
76 stub OLEFLUSHCLIPBOARD
76 pascal16 OleFlushClipboard() OleFlushClipboard
77 stub OLEISCURRENTCLIPBOARD
78 stub OLETRANSLATEACCELERATOR
79 stub OLEDOAUTOCONVERT

View File

@ -1,166 +1,165 @@
name ole32
type win32
base 1
0 stub BindMoniker
1 stub CLSIDFromProgID
2 stub CLSIDFromString
3 stub CoBuildVersion
4 stub CoCreateFreeThreadedMarshaler
5 stub CoCreateGuid
6 stub CoCreateInstance
7 stub CoDisconnectObject
8 stub CoDosDateTimeToFileTime
9 stub CoFileTimeNow
10 stub CoFileTimeToDosDateTime
11 stub CoFreeAllLibraries
12 stub CoFreeLibrary
13 stub CoFreeUnusedLibraries
14 stub CoGetCallerTID
15 stub CoGetClassObject
16 stub CoGetCurrentLogicalThreadId
17 stub CoGetCurrentProcess
18 stub CoGetInterfaceAndReleaseStream
19 stub CoGetMalloc
20 stub CoGetMarshalSizeMax
21 stub CoGetPSClsid
22 stub CoGetStandardMarshal
23 stub CoGetState
24 stub CoGetTreatAsClass
25 stub CoInitialize
26 stub CoInitializeWOW
27 stub CoIsHandlerConnected
28 stub CoIsOle1Class
29 stub CoLoadLibrary
30 stub CoLockObjectExternal
31 stub CoMarshalHresult
32 stub CoMarshalInterThreadInterfaceInStream
33 stub CoMarshalInterface
34 stub CoQueryReleaseObject
35 stub CoRegisterClassObject
36 stub CoRegisterMallocSpy
37 stub CoRegisterMessageFilter
38 stub CoReleaseMarshalData
39 stub CoRevokeClassObject
40 stub CoRevokeMallocSpy
41 stub CoSetState
42 stub CoTaskMemAlloc
43 stub CoTaskMemFree
44 stub CoTaskMemRealloc
45 stub CoTreatAsClass
46 stub CoUninitialize
47 stub CoUnloadingWOW
48 stub CoUnmarshalHresult
49 stub CoUnmarshalInterface
50 stub CreateAntiMoniker
51 stub CreateBindCtx
52 stub CreateDataAdviseHolder
53 stub CreateDataCache
54 stub CreateFileMoniker
55 stub CreateGenericComposite
56 stub CreateILockBytesOnHGlobal
57 stub CreateItemMoniker
58 stub CreateOleAdviseHolder
59 stub CreatePointerMoniker
60 stub CreateStreamOnHGlobal
61 stub DllDebugObjectRPCHook
62 stub DllGetClassObject
63 stub DllGetClassObjectWOW
64 stub DoDragDrop
65 stub EnableHookObject
66 stub GetClassFile
67 stub GetConvertStg
68 stub GetDocumentBitStg
69 stub GetHGlobalFromILockBytes
70 stub GetHGlobalFromStream
71 stub GetHookInterface
72 stub GetRunningObjectTable
73 stub IIDFromString
74 stub IsAccelerator
75 stub IsEqualGUID
76 stub IsValidIid
77 stub IsValidInterface
78 stub IsValidPtrIn
79 stub IsValidPtrOut
80 stub MkParseDisplayName
81 stub MonikerCommonPrefixWith
82 stub MonikerRelativePathTo
83 stub OleBuildVersion
84 stub OleConvertIStorageToOLESTREAM
85 stub OleConvertIStorageToOLESTREAMEx
86 stub OleConvertOLESTREAMToIStorage
87 stub OleConvertOLESTREAMToIStorageEx
88 stub OleCreate
89 stub OleCreateDefaultHandler
90 stub OleCreateEmbeddingHelper
91 stub OleCreateFromData
92 stub OleCreateFromFile
93 stub OleCreateLink
94 stub OleCreateLinkFromData
95 stub OleCreateLinkToFile
96 stub OleCreateMenuDescriptor
97 stub OleCreateStaticFromData
98 stub OleDestroyMenuDescriptor
99 stub OleDoAutoConvert
100 stub OleDraw
101 stub OleDuplicateData
102 stub OleFlushClipboard
103 stub OleGetAutoConvert
104 stub OleGetClipboard
105 stub OleGetIconOfClass
106 stub OleGetIconOfFile
107 return OleInitialize 4 0
108 stub OleInitializeWOW
109 stub OleIsCurrentClipboard
110 stub OleIsRunning
111 stub OleLoad
112 stub OleLoadFromStream
113 stub OleLockRunning
114 stub OleMetafilePictFromIconAndLabel
115 stub OleNoteObjectVisible
116 stub OleQueryCreateFromData
117 stub OleQueryLinkFromData
118 stub OleRegEnumFormatEtc
119 stub OleRegEnumVerbs
120 stub OleRegGetMiscStatus
121 stub OleRegGetUserType
122 stub OleRun
123 stub OleSave
124 stub OleSaveToStream
125 stub OleSetAutoConvert
126 stub OleSetClipboard
127 stub OleSetContainedObject
128 stub OleSetMenuDescriptor
129 stub OleTranslateAccelerator
130 return OleUninitialize 0 0
131 stub OpenOrCreateStream
132 stub ProgIDFromCLSID
133 stub ReadClassStg
134 stub ReadClassStm
135 stub ReadFmtUserTypeStg
136 stub ReadOleStg
137 stub ReadStringStream
138 stub RegisterDragDrop
139 stub ReleaseStgMedium
140 stub RevokeDragDrop
141 stub SetConvertStg
142 stub SetDocumentBitStg
143 stub StgCreateDocfile
144 stub StgCreateDocfileOnILockBytes
145 stub StgIsStorageFile
146 stub StgIsStorageILockBytes
147 stub StgOpenStorage
148 stub StgOpenStorageOnILockBytes
149 stub StgSetTimes
150 stub StringFromCLSID
151 stub StringFromGUID2
152 stub StringFromIID
153 stub UtConvertDvtd16toDvtd32
154 stub UtConvertDvtd32toDvtd16
155 stub UtGetDvtd16Info
156 stub UtGetDvtd32Info
157 stub WriteClassStg
158 stub WriteClassStm
159 stub WriteFmtUserTypeStg
160 stub WriteOleStg
161 stub WriteStringStream
1 stub BindMoniker
2 stub CLSIDFromProgID
3 stub CLSIDFromString
4 stub CoBuildVersion
5 stub CoCreateFreeThreadedMarshaler
6 stub CoCreateGuid
7 stub CoCreateInstance
8 stub CoDisconnectObject
9 stub CoDosDateTimeToFileTime
10 stub CoFileTimeNow
11 stub CoFileTimeToDosDateTime
12 stub CoFreeAllLibraries
13 stub CoFreeLibrary
14 stub CoFreeUnusedLibraries
15 stub CoGetCallerTID
16 stub CoGetClassObject
17 stub CoGetCurrentLogicalThreadId
18 stub CoGetCurrentProcess
19 stub CoGetInterfaceAndReleaseStream
20 stub CoGetMalloc
21 stub CoGetMarshalSizeMax
22 stub CoGetPSClsid
23 stub CoGetStandardMarshal
24 stub CoGetState
25 stub CoGetTreatAsClass
26 stub CoInitialize
27 stub CoInitializeWOW
28 stub CoIsHandlerConnected
29 stub CoIsOle1Class
30 stub CoLoadLibrary
31 stub CoLockObjectExternal
32 stub CoMarshalHresult
33 stub CoMarshalInterThreadInterfaceInStream
34 stub CoMarshalInterface
35 stub CoQueryReleaseObject
36 stub CoRegisterClassObject
37 stub CoRegisterMallocSpy
38 stub CoRegisterMessageFilter
39 stub CoReleaseMarshalData
40 stub CoRevokeClassObject
41 stub CoRevokeMallocSpy
42 stub CoSetState
43 stub CoTaskMemAlloc
44 stub CoTaskMemFree
45 stub CoTaskMemRealloc
46 stub CoTreatAsClass
47 stub CoUninitialize
48 stub CoUnloadingWOW
49 stub CoUnmarshalHresult
50 stub CoUnmarshalInterface
51 stub CreateAntiMoniker
52 stub CreateBindCtx
53 stub CreateDataAdviseHolder
54 stub CreateDataCache
55 stub CreateFileMoniker
56 stub CreateGenericComposite
57 stub CreateILockBytesOnHGlobal
58 stub CreateItemMoniker
59 stub CreateOleAdviseHolder
60 stub CreatePointerMoniker
61 stub CreateStreamOnHGlobal
62 stub DllDebugObjectRPCHook
63 stub DllGetClassObject
64 stub DllGetClassObjectWOW
65 stub DoDragDrop
66 stub EnableHookObject
67 stub GetClassFile
68 stub GetConvertStg
69 stub GetDocumentBitStg
70 stub GetHGlobalFromILockBytes
71 stub GetHGlobalFromStream
72 stub GetHookInterface
73 stub GetRunningObjectTable
74 stub IIDFromString
75 stub IsAccelerator
76 stub IsEqualGUID
77 stub IsValidIid
78 stub IsValidInterface
79 stub IsValidPtrIn
80 stub IsValidPtrOut
81 stub MkParseDisplayName
82 stub MonikerCommonPrefixWith
83 stub MonikerRelativePathTo
84 stub OleBuildVersion
85 stub OleConvertIStorageToOLESTREAM
86 stub OleConvertIStorageToOLESTREAMEx
87 stub OleConvertOLESTREAMToIStorage
88 stub OleConvertOLESTREAMToIStorageEx
89 stub OleCreate
90 stub OleCreateDefaultHandler
91 stub OleCreateEmbeddingHelper
92 stub OleCreateFromData
93 stub OleCreateFromFile
94 stub OleCreateLink
95 stub OleCreateLinkFromData
96 stub OleCreateLinkToFile
97 stub OleCreateMenuDescriptor
98 stub OleCreateStaticFromData
99 stub OleDestroyMenuDescriptor
100 stub OleDoAutoConvert
101 stub OleDraw
102 stub OleDuplicateData
103 stub OleFlushClipboard
104 stub OleGetAutoConvert
105 stub OleGetClipboard
106 stub OleGetIconOfClass
107 stub OleGetIconOfFile
108 return OleInitialize 4 0
109 stub OleInitializeWOW
110 stub OleIsCurrentClipboard
111 stub OleIsRunning
112 stub OleLoad
113 stub OleLoadFromStream
114 stub OleLockRunning
115 stub OleMetafilePictFromIconAndLabel
116 stub OleNoteObjectVisible
117 stub OleQueryCreateFromData
118 stub OleQueryLinkFromData
119 stub OleRegEnumFormatEtc
120 stub OleRegEnumVerbs
121 stub OleRegGetMiscStatus
122 stub OleRegGetUserType
123 stub OleRun
124 stub OleSave
125 stub OleSaveToStream
126 stub OleSetAutoConvert
127 stub OleSetClipboard
128 stub OleSetContainedObject
129 stub OleSetMenuDescriptor
130 stub OleTranslateAccelerator
131 return OleUninitialize 0 0
132 stub OpenOrCreateStream
133 stub ProgIDFromCLSID
134 stub ReadClassStg
135 stub ReadClassStm
136 stub ReadFmtUserTypeStg
137 stub ReadOleStg
138 stub ReadStringStream
139 stub RegisterDragDrop
140 stub ReleaseStgMedium
141 stub RevokeDragDrop
142 stub SetConvertStg
143 stub SetDocumentBitStg
144 stub StgCreateDocfile
145 stub StgCreateDocfileOnILockBytes
146 stub StgIsStorageFile
147 stub StgIsStorageILockBytes
148 stub StgOpenStorage
149 stub StgOpenStorageOnILockBytes
150 stub StgSetTimes
151 stub StringFromCLSID
152 stub StringFromGUID2
153 stub StringFromIID
154 stub UtConvertDvtd16toDvtd32
155 stub UtConvertDvtd32toDvtd16
156 stub UtGetDvtd16Info
157 stub UtGetDvtd32Info
158 stub WriteClassStg
159 stub WriteClassStm
160 stub WriteFmtUserTypeStg
161 stub WriteOleStg
162 stub WriteStringStream

View File

@ -352,15 +352,15 @@ INT16 WINAPI Catch( LPCATCHBUF lpbuf )
*/
/* FIXME: we need to save %si and %di */
lpbuf[0] = OFFSETOF(IF1632_Saved16_ss_sp);
lpbuf[1] = LOWORD(IF1632_Saved32_esp);
lpbuf[2] = HIWORD(IF1632_Saved32_esp);
lpbuf[3] = LOWORD(pFrame->saved_ss_sp);
lpbuf[4] = HIWORD(pFrame->saved_ss_sp);
lpbuf[5] = pFrame->ds;
lpbuf[6] = pFrame->bp;
lpbuf[7] = pFrame->ip;
lpbuf[8] = pFrame->cs;
lpbuf[0] = pFrame->ip;
lpbuf[1] = pFrame->cs;
lpbuf[2] = LOWORD(pFrame->saved_ss_sp);
lpbuf[3] = pFrame->bp;
lpbuf[4] = LOWORD(IF1632_Saved32_esp);
lpbuf[5] = HIWORD(IF1632_Saved32_esp);
lpbuf[6] = pFrame->ds;
lpbuf[7] = OFFSETOF(IF1632_Saved16_ss_sp);
lpbuf[8] = HIWORD(pFrame->saved_ss_sp);
return 0;
}
@ -373,15 +373,15 @@ INT16 WINAPI Throw( LPCATCHBUF lpbuf, INT16 retval )
STACK16FRAME *pFrame;
WORD es = CURRENT_STACK16->es;
IF1632_Saved16_ss_sp = MAKELONG( lpbuf[0] - sizeof(WORD),
IF1632_Saved16_ss_sp = MAKELONG( lpbuf[7] - sizeof(WORD),
HIWORD(IF1632_Saved16_ss_sp) );
IF1632_Saved32_esp = MAKELONG( lpbuf[1], lpbuf[2] );
IF1632_Saved32_esp = MAKELONG( lpbuf[4], lpbuf[5] );
pFrame = CURRENT_STACK16;
pFrame->saved_ss_sp = MAKELONG( lpbuf[3], lpbuf[4] );
pFrame->ds = lpbuf[5];
pFrame->bp = lpbuf[6];
pFrame->ip = lpbuf[7];
pFrame->cs = lpbuf[8];
pFrame->saved_ss_sp = MAKELONG( lpbuf[2], lpbuf[8] );
pFrame->ds = lpbuf[6];
pFrame->bp = lpbuf[3];
pFrame->ip = lpbuf[0];
pFrame->cs = lpbuf[1];
pFrame->es = es;
if (debugging_relay) /* Make sure we have a valid entry point address */
{

View File

@ -1,140 +1,153 @@
name shell32
type win32
base 1
# Functions exported by the Win95 shell32.dll
# (these need to have these exact ordinals, for some win95 dlls
# import shell32.dll by ordinal)
1 stub CheckEscapesA
4 stub CheckEscapesW
5 stdcall CommandLineToArgvW(ptr ptr) CommandLineToArgvW
6 stub Control_FillCache_RunDLL
10 stub Control_RunDLL
12 stub DllGetClassObject
20 stub DoEnvironmentSubstA
36 stub DoEnvironmentSubstW
39 stdcall DragAcceptFiles(long long) DragAcceptFiles
40 stub DragFinish
42 stub DragQueryFile
3 stub CheckEscapesA
6 stub CheckEscapesW
7 stdcall CommandLineToArgvW(ptr ptr) CommandLineToArgvW
8 stub Control_FillCache_RunDLL
12 stdcall Control_RunDLL(long long long long) Control_RunDLL
14 stub DllGetClassObject
22 stub DoEnvironmentSubstA
33 stub SHELL32_33
34 stub SHELL32_34
35 stub SHELL32_35
38 stub DoEnvironmentSubstW
41 stdcall DragAcceptFiles(long long) DragAcceptFiles
42 stub DragFinish
44 stub DragQueryFile
46 stub SHELL32_46
47 stub SHELL32_47
48 stub DragQueryFileA
51 stub DragQueryFileAorW
52 stub DragQueryFileW
74 stub DragQueryPoint
78 stub DuplicateIcon
80 stub ExtractAssociatedIconA
99 stub ExtractAssociatedIconExA
122 stub ExtractAssociatedIconExW
123 stub ExtractAssociatedIconW
131 stub ExtractIconA
133 stub ExtractIconEx
136 stub ExtractIconExA
146 stub ExtractIconResInfoA
148 stub ExtractIconResInfoW
154 stub SHELL32_154
155 stub SHELL32_155
48 stub SHELL32_48
49 stub SHELL32_49
50 stub DragQueryFileA
53 stub DragQueryFileAorW
54 stub DragQueryFileW
56 stub SHELL32_56
57 stub SHELL32_57
58 stub SHELL32_58
62 stub SHELL32_62
63 stub SHELL32_63
64 stub SHELL32_64
65 stub SHELL32_65
76 stub DragQueryPoint
80 stub DuplicateIcon
82 stub ExtractAssociatedIconA
101 stub ExtractAssociatedIconExA
124 stub ExtractAssociatedIconExW
125 stub ExtractAssociatedIconW
133 stub ExtractIconA
135 stub ExtractIconEx
138 stub ExtractIconExA
148 stub ExtractIconResInfoA
150 stub ExtractIconResInfoW
156 stub SHELL32_156
157 stub SHELL32_157
158 stub SHELL32_158
178 stub ExtractIconW
180 stub ExtractVersionResource16W
182 stub SHELL32_182
183 stub SHELL32_183
184 stdcall FindExecutableA(ptr ptr ptr) FindExecutable32A
185 stub FindExecutableW
186 return FreeIconList 4 0
187 stub InternalExtractIconListA
188 stub InternalExtractIconListW
189 stub OpenAs_RunDLL
190 stub PrintersGetCommand_RunDLL
191 stub RealShellExecuteA
192 stub RealShellExecuteExA
201 stub RealShellExecuteExW
202 stub RealShellExecuteW
203 stub RegenerateUserEnvironment
204 stub SHAddToRecentDocs
205 stub SHAppBarMessage
206 stub SHBrowseForFolder
207 stub SHBrowseForFolderA
208 stub SHChangeNotify
209 stub SHFileOperation
210 stub SHFileOperationA
211 stub SHFormatDrive
212 stub SHFreeNameMappings
213 stub SHGetDataFromIDListA
214 stub SHGetDesktopFolder
215 stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfo32A
216 stdcall SHGetFileInfoA(ptr long ptr long long) SHGetFileInfo32A
217 stub SHGetInstanceExplorer
218 stub SHGetMalloc
219 stub SHGetPathFromIDList
220 stub SHGetPathFromIDListA
221 stub SHGetSpecialFolderLocation
222 stub SHHelpShortcuts_RunDLL
223 stub SHLoadInProc
224 stub SheChangeDirA
225 stub SheChangeDirExA
226 stub SheChangeDirExW
227 stub SheChangeDirW
228 stub SheConvertPathW
229 stub SheFullPathA
230 stub SheFullPathW
231 stub SheGetCurDrive
232 stub SheGetDirA
233 stub SheGetDirExW
234 stub SheGetDirW
235 stub SheGetPathOffsetW
236 stub SheRemoveQuotesA
237 stub SheRemoveQuotesW
238 stub SheSetCurDrive
239 stub SheShortenPathA
240 stub SheShortenPathW
241 stdcall ShellAboutA(long ptr ptr long) ShellAbout32A
242 stdcall ShellAboutW(long ptr ptr long) ShellAbout32W
243 stdcall ShellExecuteA(long ptr ptr ptr ptr long) ShellExecute32A
244 stub ShellExecuteEx
245 stub ShellExecuteExA
246 stub ShellExecuteW
247 stub Shell_NotifyIcon
248 stub Shell_NotifyIconA
249 stub Shl1632_ThunkData32
250 stub Shl3216_ThunkData32
1023 stub ExtractIconExW # proper ordinal unknown
1028 stub FindExeDlgProc # proper ordinal unknown
1041 stub RegisterShellHook # proper ordinal unknown
1046 stub SHBrowseForFolderW # proper ordinal unknown
1050 stub SHFileOperationW # proper ordinal unknown
1056 stub SHGetFileInfoW # proper ordinal unknown
1061 stub SHGetPathFromIDListW # proper ordinal unknown
1087 stub ShellExecuteExW # proper ordinal unknown
1089 stub ShellHookProc # proper ordinal unknown
1092 stub Shell_NotifyIconW # proper ordinal unknown
1093 stub StrChrA # proper ordinal unknown
1094 stub StrChrIA # proper ordinal unknown
1095 stub StrChrIW # proper ordinal unknown
1096 stub StrChrW # proper ordinal unknown
1097 stub StrCmpNA # proper ordinal unknown
1098 stub StrCmpNIA # proper ordinal unknown
1099 stub StrCmpNIW # proper ordinal unknown
1100 stub StrCmpNW # proper ordinal unknown
1101 stub StrCpyNA # proper ordinal unknown
1102 stub StrCpyNW # proper ordinal unknown
1103 stub StrNCmpA # proper ordinal unknown
1104 stub StrNCmpIA # proper ordinal unknown
1105 stub StrNCmpIW # proper ordinal unknown
1106 stub StrNCmpW # proper ordinal unknown
1107 stub StrNCpyA # proper ordinal unknown
1108 stub StrNCpyW # proper ordinal unknown
1109 stub StrRChrA # proper ordinal unknown
1110 stub StrRChrIA # proper ordinal unknown
1111 stub StrRChrIW # proper ordinal unknown
1112 stub StrRChrW # proper ordinal unknown
1113 stub StrRStrA # proper ordinal unknown
1114 stub StrRStrIA # proper ordinal unknown
1115 stub StrRStrIW # proper ordinal unknown
1116 stub StrRStrW # proper ordinal unknown
1117 stub StrStrA # proper ordinal unknown
1118 stub StrStrIA # proper ordinal unknown
1119 stub StrStrIW # proper ordinal unknown
1120 stub StrStrW # proper ordinal unknown
1121 stub WOWShellExecute # proper ordinal unknown
159 stub SHELL32_159
160 stub SHELL32_160
180 stub ExtractIconW
182 stub ExtractVersionResource16W
184 stub SHELL32_184
185 stub SHELL32_185
186 stdcall FindExecutableA(ptr ptr ptr) FindExecutable32A
187 stub FindExecutableW
188 return FreeIconList 4 0
189 stub InternalExtractIconListA
190 stub InternalExtractIconListW
191 stub OpenAs_RunDLL
192 stub PrintersGetCommand_RunDLL
193 stub RealShellExecuteA
194 stub RealShellExecuteExA
203 stub RealShellExecuteExW
204 stub RealShellExecuteW
205 stub RegenerateUserEnvironment
206 stub SHAddToRecentDocs
207 stub SHAppBarMessage
208 stub SHBrowseForFolder
209 stub SHBrowseForFolderA
210 stub SHChangeNotify
211 stub SHFileOperation
212 stub SHFileOperationA
213 stub SHFormatDrive
214 stub SHFreeNameMappings
215 stub SHGetDataFromIDListA
216 stub SHGetDesktopFolder
217 stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfo32A
218 stdcall SHGetFileInfoA(ptr long ptr long long) SHGetFileInfo32A
219 stub SHGetInstanceExplorer
220 stub SHGetMalloc
221 stub SHGetPathFromIDList
222 stub SHGetPathFromIDListA
223 stub SHGetSpecialFolderLocation
224 stub SHHelpShortcuts_RunDLL
225 stub SHLoadInProc
226 stub SheChangeDirA
227 stub SheChangeDirExA
228 stub SheChangeDirExW
229 stub SheChangeDirW
230 stub SheConvertPathW
231 stub SheFullPathA
232 stub SheFullPathW
233 stub SheGetCurDrive
234 stub SheGetDirA
235 stub SheGetDirExW
236 stub SheGetDirW
237 stub SheGetPathOffsetW
238 stub SheRemoveQuotesA
239 stub SheRemoveQuotesW
240 stub SheSetCurDrive
241 stub SheShortenPathA
242 stub SheShortenPathW
243 stdcall ShellAboutA(long ptr ptr long) ShellAbout32A
244 stdcall ShellAboutW(long ptr ptr long) ShellAbout32W
245 stdcall ShellExecuteA(long ptr ptr ptr ptr long) ShellExecute32A
246 stub ShellExecuteEx
247 stub ShellExecuteExA
248 stub ShellExecuteW
249 stub Shell_NotifyIcon
250 stub Shell_NotifyIconA
251 stub Shl1632_ThunkData32
252 stub Shl3216_ThunkData32
1025 stub ExtractIconExW # proper ordinal unknown
1030 stub FindExeDlgProc # proper ordinal unknown
1043 stub RegisterShellHook # proper ordinal unknown
1048 stub SHBrowseForFolderW # proper ordinal unknown
1052 stub SHFileOperationW # proper ordinal unknown
1058 stub SHGetFileInfoW # proper ordinal unknown
1063 stub SHGetPathFromIDListW # proper ordinal unknown
1089 stub ShellExecuteExW # proper ordinal unknown
1091 stub ShellHookProc # proper ordinal unknown
1094 stub Shell_NotifyIconW # proper ordinal unknown
1095 stub StrChrA # proper ordinal unknown
1096 stub StrChrIA # proper ordinal unknown
1097 stub StrChrIW # proper ordinal unknown
1098 stub StrChrW # proper ordinal unknown
1099 stub StrCmpNA # proper ordinal unknown
1100 stub StrCmpNIA # proper ordinal unknown
1101 stub StrCmpNIW # proper ordinal unknown
1102 stub StrCmpNW # proper ordinal unknown
1103 stub StrCpyNA # proper ordinal unknown
1104 stub StrCpyNW # proper ordinal unknown
1105 stub StrNCmpA # proper ordinal unknown
1106 stub StrNCmpIA # proper ordinal unknown
1107 stub StrNCmpIW # proper ordinal unknown
1108 stub StrNCmpW # proper ordinal unknown
1109 stub StrNCpyA # proper ordinal unknown
1110 stub StrNCpyW # proper ordinal unknown
1111 stub StrRChrA # proper ordinal unknown
1112 stub StrRChrIA # proper ordinal unknown
1113 stub StrRChrIW # proper ordinal unknown
1114 stub StrRChrW # proper ordinal unknown
1115 stub StrRStrA # proper ordinal unknown
1116 stub StrRStrIA # proper ordinal unknown
1117 stub StrRStrIW # proper ordinal unknown
1118 stub StrRStrW # proper ordinal unknown
1119 stub StrStrA # proper ordinal unknown
1120 stub StrStrIA # proper ordinal unknown
1121 stub StrStrIW # proper ordinal unknown
1122 stub StrStrW # proper ordinal unknown
1123 stub WOWShellExecute # proper ordinal unknown

View File

@ -30,7 +30,7 @@
#include "options.h"
#include "sig_context.h"
#include "miscemu.h"
#include "thread.h"
/* Signal handler declaration */
@ -104,6 +104,115 @@ static HANDLER_DEF(SIGNAL_fault)
}
/***********************************************************************
* SIGNAL_SetContext
*
* Set the register values from a sigcontext.
*/
static void SIGNAL_SetSigContext( const SIGCONTEXT *sigcontext,
CONTEXT *context )
{
EAX_reg(context) = EAX_sig(sigcontext);
EBX_reg(context) = EBX_sig(sigcontext);
ECX_reg(context) = ECX_sig(sigcontext);
EDX_reg(context) = EDX_sig(sigcontext);
ESI_reg(context) = ESI_sig(sigcontext);
EDI_reg(context) = EDI_sig(sigcontext);
EBP_reg(context) = EBP_sig(sigcontext);
EFL_reg(context) = EFL_sig(sigcontext);
EIP_reg(context) = EIP_sig(sigcontext);
ESP_reg(context) = ESP_sig(sigcontext);
CS_reg(context) = LOWORD(CS_sig(sigcontext));
DS_reg(context) = LOWORD(DS_sig(sigcontext));
ES_reg(context) = LOWORD(ES_sig(sigcontext));
SS_reg(context) = LOWORD(SS_sig(sigcontext));
#ifdef FS_sig
FS_reg(context) = LOWORD(FS_sig(sigcontext));
#else
__asm__("movw %%fs,%w0":"=r" (FS_reg(&DEBUG_context)));
FS_reg(context) &= 0xffff;
#endif
#ifdef GS_sig
GS_reg(context) = LOWORD(GS_sig(sigcontext));
#else
__asm__("movw %%gs,%w0":"=r" (GS_reg(&DEBUG_context)));
GS_reg(context) &= 0xffff;
#endif
}
/***********************************************************************
* SIGNAL_GetSigContext
*
* Build a sigcontext from the register values.
*/
static void SIGNAL_GetSigContext( SIGCONTEXT *sigcontext,
const CONTEXT *context )
{
EAX_sig(sigcontext) = EAX_reg(context);
EBX_sig(sigcontext) = EBX_reg(context);
ECX_sig(sigcontext) = ECX_reg(context);
EDX_sig(sigcontext) = EDX_reg(context);
ESI_sig(sigcontext) = ESI_reg(context);
EDI_sig(sigcontext) = EDI_reg(context);
EBP_sig(sigcontext) = EBP_reg(context);
EFL_sig(sigcontext) = EFL_reg(context);
EIP_sig(sigcontext) = EIP_reg(context);
ESP_sig(sigcontext) = ESP_reg(context);
CS_sig(sigcontext) = CS_reg(context);
DS_sig(sigcontext) = DS_reg(context);
ES_sig(sigcontext) = ES_reg(context);
SS_sig(sigcontext) = SS_reg(context);
#ifdef FS_sig
FS_sig(sigcontext) = FS_reg(context);
#else
__asm__("movw %w0,%%fs"::"r" (FS_reg(context)));
#endif
#ifdef GS_sig
GS_sig(sigcontext) = GS_reg(context);
#else
__asm__("movw %w0,%%gs"::"r" (GS_reg(context)));
#endif
}
/***********************************************************************
* SIGNAL_InfoRegisters
*
* Display registers information.
*/
void SIGNAL_InfoRegisters( CONTEXT *context )
{
fprintf( stderr," CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x",
(WORD)CS_reg(context), (WORD)SS_reg(context),
(WORD)DS_reg(context), (WORD)ES_reg(context),
(WORD)FS_reg(context), (WORD)GS_reg(context) );
fprintf( stderr, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx\n",
EIP_reg(context), ESP_reg(context),
EBP_reg(context), EFL_reg(context) );
fprintf( stderr, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
EAX_reg(context), EBX_reg(context),
ECX_reg(context), EDX_reg(context) );
fprintf( stderr, " ESI:%08lx EDI:%08lx\n",
ESI_reg(context), EDI_reg(context) );
}
/**********************************************************************
* SIGNAL_tick
*
* Tick handler.
*/
static HANDLER_DEF(SIGNAL_tick)
{
HANDLER_PROLOG
CONTEXT nt_context;
SIGNAL_SetSigContext( context, &nt_context );
if (THREAD_SwitchThread( &nt_context ))
SIGNAL_GetSigContext( context, &nt_context );
HANDLER_EPILOG
}
/**********************************************************************
* SIGNAL_InitEmulator
*
@ -111,14 +220,25 @@ static HANDLER_DEF(SIGNAL_fault)
*/
BOOL32 SIGNAL_InitEmulator(void)
{
struct itimerval vt_timer;
SIGNAL_SetHandler( SIGINT, (void (*)())SIGNAL_break, 1);
SIGNAL_SetHandler( SIGSEGV, (void (*)())SIGNAL_fault, 1);
SIGNAL_SetHandler( SIGILL, (void (*)())SIGNAL_fault, 1);
SIGNAL_SetHandler( SIGFPE, (void (*)())SIGNAL_fault, 1);
SIGNAL_SetHandler( SIGVTALRM, (void (*)())SIGNAL_tick, 0);
SIGNAL_SetHandler( SIGTRAP, (void (*)())SIGNAL_trap, 1); /* debugger */
SIGNAL_SetHandler( SIGHUP, (void (*)())SIGNAL_trap, 1); /* forced break*/
#ifdef SIGBUS
SIGNAL_SetHandler( SIGBUS, (void (*)())SIGNAL_fault, 1);
#endif
/* Start the tick timer */
#if 0
vt_timer.it_interval.tv_sec = 0;
vt_timer.it_interval.tv_usec = 10000;
vt_timer.it_value = vt_timer.it_interval;
setitimer( ITIMER_VIRTUAL, &vt_timer, NULL );
#endif
return TRUE;
}

View File

@ -7,6 +7,9 @@
#include "windows.h"
#include "callback.h"
#include "resource.h"
#include "task.h"
#include "user.h"
#include "heap.h"
#include "hook.h"
#include "module.h"
@ -50,7 +53,6 @@ BOOL32 THUNK_Init(void)
{
/* Set the window proc calling functions */
WINPROC_SetCallWndProc16( THUNK_CallWndProc16 );
WINPROC_SetCallWndProc32( (WINPROC_CALLWNDPROC32)CallTo32_4 );
return TRUE;
}
@ -115,20 +117,20 @@ static void THUNK_Free( THUNK *thunk )
static LRESULT THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd, UINT16 msg,
WPARAM16 wParam, LPARAM lParam )
{
if ((msg == WM_CREATE) || (msg == WM_NCCREATE))
if (((msg == WM_CREATE) || (msg == WM_NCCREATE)) && lParam)
{
CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
/* Build the CREATESTRUCT on the 16-bit stack. */
/* This is really ugly, but some programs (notably the */
/* "Undocumented Windows" examples) want it that way. */
return CallTo16_long_lllllllwlwwwl( (FARPROC16)proc,
return CallTo16_wndp_lllllllwlwwwl( (FARPROC16)proc,
cs->dwExStyle, cs->lpszClass, cs->lpszName, cs->style,
MAKELONG( cs->y, cs->x ), MAKELONG( cs->cy, cs->cx ),
MAKELONG( cs->hMenu, cs->hwndParent ), cs->hInstance,
(LONG)cs->lpCreateParams, hwnd, msg, wParam,
IF1632_Saved16_ss_sp - sizeof(CREATESTRUCT16) );
}
return CallTo16_long_wwwl( (FARPROC16)proc, hwnd, msg, wParam, lParam );
return CallTo16_wndp_wwwl( (FARPROC16)proc, hwnd, msg, wParam, lParam );
}
@ -143,17 +145,6 @@ INT16 WINAPI THUNK_EnumObjects16( HDC16 hdc, INT16 nObjType,
}
/***********************************************************************
* THUNK_EnumObjects32 (GDI32.89)
*/
INT32 WINAPI THUNK_EnumObjects32( HDC32 hdc, INT32 nObjType,
GOBJENUMPROC32 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_2 );
return EnumObjects32( hdc, nObjType, (GOBJENUMPROC32)&thunk, lParam );
}
/*************************************************************************
* THUNK_EnumFonts16 (GDI.70)
*/
@ -164,26 +155,6 @@ INT16 WINAPI THUNK_EnumFonts16( HDC16 hdc, LPCSTR lpFaceName,
return EnumFonts16( hdc, lpFaceName, (FONTENUMPROC16)&thunk, lParam );
}
/*************************************************************************
* THUNK_EnumFonts32A (GDI32.84)
*/
INT32 WINAPI THUNK_EnumFonts32A( HDC32 hdc, LPCSTR lpFaceName,
FONTENUMPROC32A func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFonts32A( hdc, lpFaceName, (FONTENUMPROC32A)&thunk, lParam );
}
/*************************************************************************
* THUNK_EnumFonts32W (GDI32.85)
*/
INT32 WINAPI THUNK_EnumFonts32W( HDC32 hdc, LPCWSTR lpFaceName,
FONTENUMPROC32W func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFonts32W( hdc, lpFaceName, (FONTENUMPROC32W)&thunk, lParam );
}
/******************************************************************
* THUNK_EnumMetaFile16 (GDI.175)
*/
@ -206,27 +177,6 @@ INT16 WINAPI THUNK_EnumFontFamilies16( HDC16 hdc, LPCSTR lpszFamily,
}
/*************************************************************************
* THUNK_EnumFontFamilies32A (GDI32.80)
*/
INT32 WINAPI THUNK_EnumFontFamilies32A( HDC32 hdc, LPCSTR lpszFamily,
FONTENUMPROC32A func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFontFamilies32A(hdc,lpszFamily,(FONTENUMPROC32A)&thunk,lParam);
}
/*************************************************************************
* THUNK_EnumFontFamilies32W (GDI32.83)
*/
INT32 WINAPI THUNK_EnumFontFamilies32W( HDC32 hdc, LPCWSTR lpszFamily,
FONTENUMPROC32W func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFontFamilies32W(hdc,lpszFamily,(FONTENUMPROC32W)&thunk,lParam);
}
/*************************************************************************
* THUNK_EnumFontFamiliesEx16 (GDI.613)
*/
@ -240,32 +190,6 @@ INT16 WINAPI THUNK_EnumFontFamiliesEx16( HDC16 hdc, LPLOGFONT16 lpLF,
}
/*************************************************************************
* THUNK_EnumFontFamiliesEx32A (GDI32.81)
*/
INT32 WINAPI THUNK_EnumFontFamiliesEx32A( HDC32 hdc, LPLOGFONT32A lpLF,
FONTENUMPROCEX32A func, LPARAM lParam,
DWORD reserved)
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFontFamiliesEx32A( hdc, lpLF, (FONTENUMPROCEX32A)&thunk,
lParam, reserved );
}
/*************************************************************************
* THUNK_EnumFontFamiliesEx32W (GDI32.82)
*/
INT32 WINAPI THUNK_EnumFontFamiliesEx32W( HDC32 hdc, LPLOGFONT32W lpLF,
FONTENUMPROCEX32W func, LPARAM lParam,
DWORD reserved )
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumFontFamiliesEx32W( hdc, lpLF, (FONTENUMPROCEX32W)&thunk,
lParam, reserved );
}
/**********************************************************************
* THUNK_LineDDA16 (GDI.100)
*/
@ -277,18 +201,6 @@ void WINAPI THUNK_LineDDA16( INT16 nXStart, INT16 nYStart, INT16 nXEnd,
}
/**********************************************************************
* THUNK_LineDDA32 (GDI32.248)
*/
BOOL32 WINAPI THUNK_LineDDA32( INT32 nXStart, INT32 nYStart, INT32 nXEnd,
INT32 nYEnd, LINEDDAPROC32 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_3 );
return LineDDA32( nXStart, nYStart, nXEnd, nYEnd,
(LINEDDAPROC32)&thunk, lParam );
}
/*******************************************************************
* THUNK_EnumWindows16 (USER.54)
*/
@ -299,16 +211,6 @@ BOOL16 WINAPI THUNK_EnumWindows16( WNDENUMPROC16 func, LPARAM lParam )
}
/*******************************************************************
* THUNK_EnumWindows32 (USER32.192)
*/
BOOL32 WINAPI THUNK_EnumWindows32( WNDENUMPROC32 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_2 );
return EnumWindows32( (WNDENUMPROC32)&thunk, lParam );
}
/**********************************************************************
* THUNK_EnumChildWindows16 (USER.55)
*/
@ -320,17 +222,6 @@ BOOL16 WINAPI THUNK_EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func,
}
/**********************************************************************
* THUNK_EnumChildWindows32 (USER32.177)
*/
BOOL32 WINAPI THUNK_EnumChildWindows32( HWND32 parent, WNDENUMPROC32 func,
LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_2 );
return EnumChildWindows32( parent, (WNDENUMPROC32)&thunk, lParam );
}
/**********************************************************************
* THUNK_EnumTaskWindows16 (USER.225)
*/
@ -342,17 +233,6 @@ BOOL16 WINAPI THUNK_EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func,
}
/**********************************************************************
* THUNK_EnumThreadWindows (USER32.189)
*/
BOOL32 WINAPI THUNK_EnumThreadWindows( DWORD id, WNDENUMPROC32 func,
LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo32_2 );
return EnumThreadWindows( id, (WNDENUMPROC32)&thunk, lParam );
}
/***********************************************************************
* THUNK_EnumProps16 (USER.27)
*/
@ -363,154 +243,6 @@ INT16 WINAPI THUNK_EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
}
/***********************************************************************
* THUNK_EnumProps32A (USER32.185)
*/
INT32 WINAPI THUNK_EnumProps32A( HWND32 hwnd, PROPENUMPROC32A func )
{
DECL_THUNK( thunk, func, CallTo32_3 );
return EnumProps32A( hwnd, (PROPENUMPROC32A)&thunk );
}
/***********************************************************************
* THUNK_EnumProps32W (USER32.188)
*/
INT32 WINAPI THUNK_EnumProps32W( HWND32 hwnd, PROPENUMPROC32W func )
{
DECL_THUNK( thunk, func, CallTo32_3 );
return EnumProps32W( hwnd, (PROPENUMPROC32W)&thunk );
}
/***********************************************************************
* THUNK_EnumPropsEx32A (USER32.186)
*/
INT32 WINAPI THUNK_EnumPropsEx32A( HWND32 hwnd, PROPENUMPROCEX32A func,
LPARAM lParam)
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumPropsEx32A( hwnd, (PROPENUMPROCEX32A)&thunk, lParam );
}
/***********************************************************************
* THUNK_EnumPropsEx32W (USER32.187)
*/
INT32 WINAPI THUNK_EnumPropsEx32W( HWND32 hwnd, PROPENUMPROCEX32W func,
LPARAM lParam)
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumPropsEx32W( hwnd, (PROPENUMPROCEX32W)&thunk, lParam );
}
/***********************************************************************
* THUNK_EnumSystemCodePages32A (KERNEL32.92)
*/
BOOL32 WINAPI THUNK_EnumSystemCodePages32A( CODEPAGE_ENUMPROC32A func,
DWORD flags )
{
DECL_THUNK( thunk, func, CallTo32_1 );
return EnumSystemCodePages32A( (CODEPAGE_ENUMPROC32A)&thunk, flags );
}
/***********************************************************************
* THUNK_EnumSystemCodePages32W (KERNEL32.93)
*/
BOOL32 WINAPI THUNK_EnumSystemCodePages32W( CODEPAGE_ENUMPROC32W func,
DWORD flags )
{
DECL_THUNK( thunk, func, CallTo32_1 );
return EnumSystemCodePages32W( (CODEPAGE_ENUMPROC32W)&thunk, flags );
}
/***********************************************************************
* THUNK_EnumSystemLocales32A (KERNEL32.92)
*/
BOOL32 WINAPI THUNK_EnumSystemLocales32A( LOCALE_ENUMPROC32A func, DWORD flags)
{
DECL_THUNK( thunk, func, CallTo32_1 );
return EnumSystemLocales32A( (LOCALE_ENUMPROC32A)&thunk, flags );
}
/***********************************************************************
* THUNK_EnumSystemLocales32W (KERNEL32.93)
*/
BOOL32 WINAPI THUNK_EnumSystemLocales32W( LOCALE_ENUMPROC32W func, DWORD flags)
{
DECL_THUNK( thunk, func, CallTo32_1 );
return EnumSystemLocales32W( (LOCALE_ENUMPROC32W)&thunk, flags );
}
/***********************************************************************
* THUNK_EnumResourceLanguages32W (KERNEL32.87)
*/
BOOL32 WINAPI THUNK_EnumResourceLanguages32W( HMODULE32 hmod, LPCWSTR type,
LPCWSTR name,
ENUMRESLANGPROC32W func,
LONG lParam )
{
DECL_THUNK( thunk, func, CallTo32_5 );
return EnumResourceLanguages32W( hmod,type,name,(ENUMRESLANGPROC32W)&thunk, lParam );
}
/***********************************************************************
* THUNK_EnumResourceLanguages32A (KERNEL32.86)
*/
BOOL32 WINAPI THUNK_EnumResourceLanguages32A( HMODULE32 hmod, LPCSTR type,
LPCSTR name,
ENUMRESLANGPROC32A func,
LONG lParam )
{
DECL_THUNK( thunk, func, CallTo32_5 );
return EnumResourceLanguages32A( hmod,type,name,(ENUMRESLANGPROC32A)&thunk, lParam );
}
/***********************************************************************
* THUNK_EnumResourceNames32A (KERNEL32.88)
*/
BOOL32 WINAPI THUNK_EnumResourceNames32A( HMODULE32 hmod, LPCSTR type,
ENUMRESNAMEPROC32A func, LONG lParam)
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumResourceNames32A( hmod,type,(ENUMRESNAMEPROC32A)&thunk,lParam );
}
/***********************************************************************
* THUNK_EnumResourceNames32W (KERNEL32.89)
*/
BOOL32 WINAPI THUNK_EnumResourceNames32W( HMODULE32 hmod, LPCWSTR type,
ENUMRESNAMEPROC32W func, LONG lParam)
{
DECL_THUNK( thunk, func, CallTo32_4 );
return EnumResourceNames32W( hmod,type,(ENUMRESNAMEPROC32W)&thunk, lParam);
}
/***********************************************************************
* THUNK_EnumResourceTypes32A (KERNEL32.90)
*/
BOOL32 WINAPI THUNK_EnumResourceTypes32A( HMODULE32 hmod,
ENUMRESTYPEPROC32A func, LONG lParam)
{
DECL_THUNK( thunk, func, CallTo32_3 );
return EnumResourceTypes32A( hmod,(ENUMRESTYPEPROC32A)&thunk, lParam );
}
/***********************************************************************
* THUNK_EnumResourceTypes32W (KERNEL32.91)
*/
BOOL32 WINAPI THUNK_EnumResourceTypes32W( HMODULE32 hmod,
ENUMRESTYPEPROC32W func,
LONG lParam )
{
DECL_THUNK( thunk, func, CallTo32_3 );
return EnumResourceTypes32W( hmod,(ENUMRESTYPEPROC32W)&thunk, lParam );
}
/***********************************************************************
* THUNK_GrayString16 (USER.185)
*/
@ -528,40 +260,6 @@ BOOL16 WINAPI THUNK_GrayString16( HDC16 hdc, HBRUSH16 hbr,
}
/***********************************************************************
* THUNK_GrayString32A (USER32.314)
*/
BOOL32 WINAPI THUNK_GrayString32A( HDC32 hdc, HBRUSH32 hbr,
GRAYSTRINGPROC32 func, LPARAM lParam,
INT32 cch, INT32 x, INT32 y,
INT32 cx, INT32 cy )
{
DECL_THUNK( thunk, func, CallTo32_3 );
if (!func)
return GrayString32A( hdc, hbr, NULL, lParam, cch, x, y, cx, cy );
else
return GrayString32A( hdc, hbr, (GRAYSTRINGPROC32)&thunk, lParam, cch,
x, y, cx, cy );
}
/***********************************************************************
* THUNK_GrayString32W (USER32.315)
*/
BOOL32 WINAPI THUNK_GrayString32W( HDC32 hdc, HBRUSH32 hbr,
GRAYSTRINGPROC32 func,
LPARAM lParam, INT32 cch, INT32 x, INT32 y,
INT32 cx, INT32 cy )
{
DECL_THUNK( thunk, func, CallTo32_3 );
if (!func)
return GrayString32W( hdc, hbr, NULL, lParam, cch, x, y, cx, cy );
else
return GrayString32W( hdc, hbr, (GRAYSTRINGPROC32)&thunk, lParam, cch,
x, y, cx, cy );
}
/***********************************************************************
* THUNK_SetWindowsHook16 (USER.121)
*/
@ -639,24 +337,6 @@ WORD WINAPI THUNK_KillSystemTimer( WORD timer )
}
/***********************************************************************
* THUNK_SetUnhandledExceptionFilter (KERNEL32.516)
*/
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI THUNK_SetUnhandledExceptionFilter(
LPTOP_LEVEL_EXCEPTION_FILTER filter )
{
LPTOP_LEVEL_EXCEPTION_FILTER old;
THUNK *thunk = THUNK_Alloc( (FARPROC16)filter, (RELAY)CallTo32_1 );
if (!thunk) return NULL;
old = SetUnhandledExceptionFilter( (LPTOP_LEVEL_EXCEPTION_FILTER)thunk );
if (!old) return NULL;
thunk = (THUNK *)old;
old = (LPTOP_LEVEL_EXCEPTION_FILTER)thunk->proc;
THUNK_Free( thunk );
return old;
}
static FARPROC16 defDCHookProc = NULL;
/***********************************************************************
@ -705,6 +385,93 @@ DWORD WINAPI THUNK_GetDCHook( HDC16 hdc, FARPROC16 *phookProc )
return ret;
}
/***********************************************************************
* THUNK_SetTaskSignalProc (KERNEL.38)
*/
FARPROC16 WINAPI THUNK_SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
{
static FARPROC16 defSignalProc16 = NULL;
THUNK *thunk = NULL;
if( !defSignalProc16 )
defSignalProc16 = MODULE_GetEntryPoint(GetModuleHandle16("USER"), 314 );
if( proc == defSignalProc16 )
thunk = (THUNK*)SetTaskSignalProc( hTask, (FARPROC16)&USER_SignalProc );
else
{
thunk = THUNK_Alloc( proc, (RELAY)CallTo16_word_wwwww );
if( !thunk ) return FALSE;
thunk = (THUNK*)SetTaskSignalProc( hTask, (FARPROC16)thunk );
}
if( thunk != (THUNK*)USER_SignalProc )
{
if( !thunk ) return NULL;
proc = thunk->proc;
THUNK_Free( thunk );
return proc;
}
return defSignalProc16;
}
/***********************************************************************
* THUNK_SetResourceHandler (KERNEL.67)
*/
FARPROC16 WINAPI THUNK_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC16 proc )
{
/* loader/ne_resource.c */
extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16);
static FARPROC16 defDIBIconLoader16 = NULL;
static FARPROC16 defDIBCursorLoader16 = NULL;
static FARPROC16 defResourceLoader16 = NULL;
THUNK *thunk = NULL;
if( !defResourceLoader16 )
{
HMODULE16 hUser = GetModuleHandle16("USER");
defDIBIconLoader16 = MODULE_GetEntryPoint( hUser, 357 );
defDIBCursorLoader16 = MODULE_GetEntryPoint( hUser, 356 );
defResourceLoader16 = MODULE_GetWndProcEntry16( "DefResourceHandler" );
}
if( proc == defResourceLoader16 )
thunk = (THUNK*)&NE_DefResourceHandler;
else if( proc == defDIBIconLoader16 )
thunk = (THUNK*)&LoadDIBIconHandler;
else if( proc == defDIBCursorLoader16 )
thunk = (THUNK*)&LoadDIBCursorHandler;
else
{
thunk = THUNK_Alloc( proc, (RELAY)CallTo16_word_www );
if( !thunk ) return FALSE;
}
thunk = (THUNK*)SetResourceHandler( hModule, typeId, (FARPROC16)thunk );
if( thunk == (THUNK*)&NE_DefResourceHandler )
return defResourceLoader16;
if( thunk == (THUNK*)&LoadDIBIconHandler )
return defDIBIconLoader16;
if( thunk == (THUNK*)&LoadDIBCursorHandler )
return defDIBCursorLoader16;
if( thunk )
{
proc = thunk->proc;
THUNK_Free( thunk );
return proc;
}
return NULL;
}
/***********************************************************************
* *
* Win95 internal thunks *
@ -726,7 +493,7 @@ static void _write_ftprolog(LPBYTE start,DWORD thunkstart) {
*x++ = 0x0f;*x++=0xb6;*x++=0xd1; /* movzbl edx,cl */
*x++ = 0x8B;*x++=0x14;*x++=0x95;*(DWORD*)x= thunkstart;
x+=4; /* mov edx, [4*edx + thunkstart] */
*x++ = 0x68; *(DWORD*)x = (DWORD)GetProcAddress32(WIN32_GetModuleHandleA("KERNEL32"),"FT_Prolog");
*x++ = 0x68; *(DWORD*)x = (DWORD)GetProcAddress32(GetModuleHandle32A("KERNEL32"),"FT_Prolog");
x+=4; /* push FT_Prolog */
*x++ = 0xC3; /* lret */
/* fill rest with 0xCC / int 3 */
@ -749,7 +516,7 @@ static void _write_qtthunk(LPBYTE start,DWORD thunkstart) {
*x++ = 0x8A;*x++=0x4D;*x++=0xFC; /* movb cl,[ebp-04] */
*x++ = 0x8B;*x++=0x14;*x++=0x8D;*(DWORD*)x= thunkstart;
x+=4; /* mov edx, [4*ecx + (EAX+EDX) */
*x++ = 0xB8; *(DWORD*)x = (DWORD)GetProcAddress32(WIN32_GetModuleHandleA("KERNEL32"),"QT_Thunk");
*x++ = 0xB8; *(DWORD*)x = (DWORD)GetProcAddress32(GetModuleHandle32A("KERNEL32"),"QT_Thunk");
x+=4; /* mov eax , QT_Thunk */
*x++ = 0xFF; *x++ = 0xE0; /* jmp eax */
/* should fill the rest of the 32 bytes with 0xCC */
@ -1020,7 +787,7 @@ VOID WINAPI _KERNEL32_45(CONTEXT *context)
LPVOID WINAPI _KERNEL32_41(LPBYTE thunk,LPCSTR thkbuf,DWORD len,LPCSTR dll16,
LPCSTR dll32)
{
HMODULE32 hkrnl32 = WIN32_GetModuleHandleA("KERNEL32");
HMODULE32 hkrnl32 = GetModuleHandle32A("KERNEL32");
HMODULE16 hmod;
LPDWORD addr,addr2;
DWORD segaddr;
@ -1130,44 +897,41 @@ BOOL32 WINAPI _KERNEL32_87()
*
* And YES, I've seen nr=48 (somewhere in the Win95 32<->16 OLE coupling)
*/
DWORD WINAPI _KERNEL32_88(DWORD *args)
DWORD WINAPIV _KERNEL32_88( DWORD nr, DWORD flags, FARPROC32 fun, ... )
{
DWORD nr = args[0];
DWORD flags = args[1];
FARPROC32 fun = (FARPROC32)args[2];
DWORD i,ret;
DWORD i,ret;
DWORD *args = ((DWORD *)&fun) + 1;
fprintf(stderr,"KERNEL32_88(%ld,0x%08lx,%p,[ ",nr,flags,fun);
for (i=0;i<nr/4;i++)
fprintf(stderr,"0x%08lx,",args[3+i]);
for (i=0;i<nr/4;i++) fprintf(stderr,"0x%08lx,",args[i]);
fprintf(stderr,"])");
#ifndef WINELIB
switch (nr) {
case 0: ret = CallTo32_0(fun);
break;
case 4: ret = CallTo32_1(fun,args[3]);
case 4: ret = CallTo32_1(fun,args[0]);
break;
case 8: ret = CallTo32_2(fun,args[3],args[4]);
case 8: ret = CallTo32_2(fun,args[0],args[1]);
break;
case 12: ret = CallTo32_3(fun,args[3],args[4],args[5]);
case 12: ret = CallTo32_3(fun,args[0],args[1],args[2]);
break;
case 16: ret = CallTo32_4(fun,args[3],args[4],args[5],args[6]);
case 16: ret = CallTo32_4(fun,args[0],args[1],args[2],args[3]);
break;
case 20: ret = CallTo32_5(fun,args[3],args[4],args[5],args[6],args[7]);
case 20: ret = CallTo32_5(fun,args[0],args[1],args[2],args[3],args[4]);
break;
case 24: ret = CallTo32_6(fun,args[3],args[4],args[5],args[6],args[7],args[8]);
case 24: ret = CallTo32_6(fun,args[0],args[1],args[2],args[3],args[4],args[5]);
break;
case 28: ret = CallTo32_7(fun,args[3],args[4],args[5],args[6],args[7],args[8],args[9]);
case 28: ret = CallTo32_7(fun,args[0],args[1],args[2],args[3],args[4],args[5],args[6]);
break;
case 32: ret = CallTo32_8(fun,args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]);
case 32: ret = CallTo32_8(fun,args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
break;
case 36: ret = CallTo32_9(fun,args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11]);
case 36: ret = CallTo32_9(fun,args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]);
break;
case 40: ret = CallTo32_10(fun,args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12]);
case 40: ret = CallTo32_10(fun,args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9]);
break;
case 44: ret = CallTo32_11(fun,args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12],args[13]);
case 44: ret = CallTo32_11(fun,args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]);
break;
case 48: ret = CallTo32_12(fun,args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12],args[13],args[14]);
case 48: ret = CallTo32_12(fun,args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11]);
break;
default:
fprintf(stderr," unsupported nr of arguments, %ld\n",nr);

View File

@ -86,7 +86,7 @@ file user.exe
82 pascal16 InvertRect(word ptr) InvertRect16
83 pascal16 FrameRect(word ptr word) FrameRect16
84 pascal16 DrawIcon(word s_word s_word word) DrawIcon16
85 pascal16 DrawText(word ptr s_word ptr word) DrawText16
85 pascal16 DrawText(word str s_word ptr word) DrawText16
87 pascal16 DialogBox(word segstr word segptr) DialogBox16
88 pascal16 EndDialog(word s_word) EndDialog16
89 pascal16 CreateDialog(word segstr word segptr) CreateDialog16
@ -207,13 +207,13 @@ file user.exe
203 pascal16 GetCommError(word ptr) GetCommError
204 pascal16 ReadComm(word ptr word) ReadComm
205 pascal16 WriteComm(word ptr word) WriteComm
206 pascal16 TransmitCommChar(word byte) TransmitCommChar16
206 pascal16 TransmitCommChar(word word) TransmitCommChar16
207 pascal16 CloseComm(word) CloseComm
208 pascal SetCommEventMask(word word) SetCommEventMask
209 pascal16 GetCommEventMask(word word) GetCommEventMask
210 pascal16 SetCommBreak(word) SetCommBreak16
211 pascal16 ClearCommBreak(word) ClearCommBreak16
212 pascal16 UngetCommChar(word byte) UngetCommChar
212 pascal16 UngetCommChar(word word) UngetCommChar
213 pascal16 BuildCommDCB(ptr ptr) BuildCommDCB16
214 pascal EscapeCommFunction(word word) EscapeCommFunction16
215 pascal16 FlushComm(word word) FlushComm
@ -305,7 +305,7 @@ file user.exe
#306 BEAR306
308 pascal DefDlgProc(word word word long) DefDlgProc16
309 pascal16 GetClipCursor(ptr) GetClipCursor16
314 stub SignalProc
314 pascal16 SignalProc(word word word word word) USER_SignalProc
319 pascal16 ScrollWindowEx(word s_word s_word ptr ptr word ptr word) ScrollWindowEx16
320 stub SysErrorBox
321 stub SetEventHook
@ -316,19 +316,19 @@ file user.exe
326 pascal16 GetControlBrush(word word word) GetControlBrush
331 pascal16 EnableHardwareInput(word) EnableHardwareInput
332 pascal16 UserYield() UserYield
333 stub IsUserIdle
333 pascal16 IsUserIdle() IsUserIdle
334 pascal GetQueueStatus(word) GetQueueStatus16
335 pascal16 GetInputState() GetInputState16
336 stub LoadCursorIconHandler
336 pascal16 LoadCursorIconHandler(word word word) LoadCursorIconHandler
337 pascal GetMouseEventProc() GetMouseEventProc
#341 _FFFE_FARFRAME
343 stub GetFilePortName
356 stub LoadDIBCursorHandler
357 stub LoadDIBIconHandler
356 pascal16 LoadDIBCursorHandler(word word word) LoadDIBCursorHandler
357 pascal16 LoadDIBIconHandler(word word word) LoadDIBIconHandler
358 pascal16 IsMenu(word) IsMenu16
359 pascal16 GetDCEx(word word long) GetDCEx16
362 pascal16 DCHook(word word long long) DCHook
364 stub LookupIconIDFromDirectoryEx
364 pascal16 LookupIconIdFromDirectoryEx(ptr word word word word) LookupIconIdFromDirectoryEx16
368 pascal16 CopyIcon(word word) CopyIcon16
369 pascal16 CopyCursor(word word) CopyCursor16
370 pascal16 GetWindowPlacement(word ptr) GetWindowPlacement16
@ -381,10 +381,10 @@ file user.exe
430 pascal16 lstrcmp(str str) lstrcmp16
431 pascal AnsiUpper(segstr) AnsiUpper16
432 pascal AnsiLower(segstr) AnsiLower16
433 pascal16 IsCharAlpha(byte) IsCharAlpha16
434 pascal16 IsCharAlphaNumeric(byte) IsCharAlphaNumeric16
435 pascal16 IsCharUpper(byte) IsCharUpper16
436 pascal16 IsCharLower(byte) IsCharLower16
433 pascal16 IsCharAlpha(word) IsCharAlpha16
434 pascal16 IsCharAlphaNumeric(word) IsCharAlphaNumeric16
435 pascal16 IsCharUpper(word) IsCharUpper16
436 pascal16 IsCharLower(word) IsCharLower16
437 pascal16 AnsiUpperBuff(ptr word) AnsiUpperBuff16
438 pascal16 AnsiLowerBuff(ptr word) AnsiLowerBuff16
441 pascal16 InsertMenuItem(word word word ptr) InsertMenuItem16
@ -394,7 +394,7 @@ file user.exe
447 pascal DefMDIChildProc(word word word long) DefMDIChildProc16
448 stub DrawAnimatedRects
449 stub DrawState
450 stub CreateIconFromResourceEx
450 pascal16 CreateIconFromResourceEx(ptr long word long word word word) CreateIconFromResourceEx16
451 pascal16 TranslateMDISysAccel(word ptr) TranslateMDISysAccel16
452 pascal16 CreateWindowEx(long str str long s_word s_word s_word s_word
word word word segptr) CreateWindowEx16
@ -442,7 +442,7 @@ file user.exe
509 pascal16 WNetUnwatchQueue(word ptr ptr word) WNetUnwatchQueue
510 pascal16 WNetLockQueueData(ptr ptr ptr) WNetLockQueueData
511 pascal16 WNetUnlockQueueData(ptr) WNetUnlockQueueData
512 pascal16 WNetGetConnection(ptr ptr ptr) WNetGetConnection
512 pascal16 WNetGetConnection(ptr ptr ptr) WNetGetConnection16
513 pascal16 WNetGetCaps(word) WNetGetCaps
514 pascal16 WNetDeviceMode(word) WNetDeviceMode
515 pascal16 WNetBrowseDialog(word word ptr) WNetBrowseDialog

File diff suppressed because it is too large Load Diff

View File

@ -3,14 +3,14 @@ type win16
#1 DLLENTRYPOINT
2 pascal GetFileResourceSize(ptr segptr segptr ptr) GetFileResourceSize
3 pascal GetFileResource(ptr segptr segptr long long ptr) GetFileResource
6 pascal GetFileVersionInfoSize(ptr ptr) GetFileVersionInfoSize16
7 pascal GetFileVersionInfo(ptr long long ptr) GetFileVersionInfo16
8 pascal VerFindFile(word ptr ptr ptr ptr ptr ptr ptr) VerFindFile16
9 pascal VerInstallFile(word ptr ptr ptr ptr ptr ptr ptr) VerInstallFile16
2 pascal GetFileResourceSize(str segptr segptr ptr) GetFileResourceSize
3 pascal GetFileResource(str segptr segptr long long ptr) GetFileResource
6 pascal GetFileVersionInfoSize(str ptr) GetFileVersionInfoSize16
7 pascal GetFileVersionInfo(str long long ptr) GetFileVersionInfo16
8 pascal VerFindFile(word str str str ptr ptr ptr ptr) VerFindFile16
9 pascal VerInstallFile(word str str str str str ptr ptr) VerInstallFile16
10 pascal VerLanguageName(word ptr word) VerLanguageName16
11 pascal VerQueryValue(segptr ptr ptr ptr) VerQueryValue16
11 pascal VerQueryValue(segptr str ptr ptr) VerQueryValue16
20 stub GETFILEVERSIONINFORAW
#21 VERFTHK_THUNKDATA16
#22 VERTHKSL_THUNKDATA16

View File

@ -1,6 +1,7 @@
name winmm
type win32
0001 stub PlaySoundA
0004 stub CloseDriver
0005 stub DefDriverProc
0006 stub DriverCallback
@ -15,7 +16,6 @@ type win32
0015 stub OpenDriver
0016 stub OpenDriverA
0017 stub PlaySound
0001 stub PlaySoundA
0018 stub PlaySoundW
0019 stub SendDriverMessage
0020 stub auxGetDevCapsA

View File

@ -1,127 +1,126 @@
name winspool
type win32
base 100
001 stub ADVANCEDSETUPDIALOG
002 stub AbortPrinter
003 stub AddFormA
004 stub AddFormW
005 stub AddJobA
006 stub AddJobW
007 stub AddMonitorA
008 stub AddMonitorW
009 stub AddPortA
010 stub AddPortExA
011 stub AddPortExW
012 stub AddPortW
013 stub AddPrintProcessorA
014 stub AddPrintProcessorW
015 stub AddPrintProvidorA
016 stub AddPrintProvidorW
017 stub AddPrinterA
018 stub AddPrinterConnectionA
019 stub AddPrinterConnectionW
020 stub AddPrinterDriverA
021 stub AddPrinterDriverW
022 stub AddPrinterW
023 stub AdvancedDocumentPropertiesA
024 stub AdvancedDocumentPropertiesW
025 stub AdvancedSetupDialog
026 stub ClosePrinter
027 stub ConfigurePortA
028 stub ConfigurePortW
029 stub ConnectToPrinterDlg
030 stub CreatePrinterIC
031 stub DEVICECAPABILITIES
032 stub DEVICEMODE
033 stub DeleteFormA
034 stub DeleteFormW
035 stub DeleteMonitorA
036 stub DeleteMonitorW
037 stub DeletePortA
038 stub DeletePortW
039 stub DeletePrintProcessorA
040 stub DeletePrintProcessorW
041 stub DeletePrintProvidorA
042 stub DeletePrintProvidorW
043 stub DeletePrinter
044 stub DeletePrinterConnectionA
045 stub DeletePrinterConnectionW
046 stub DeletePrinterDriverA
047 stub DeletePrinterDriverW
048 stub DeletePrinterIC
049 stub DevQueryPrint
050 stub DeviceCapabilities
051 stdcall DeviceCapabilitiesA(ptr ptr long ptr ptr) DeviceCapabilities32A
052 stub DeviceCapabilitiesW
053 stub DeviceMode
054 stub DocumentEvent
055 stdcall DocumentPropertiesA(long long ptr ptr ptr long) DocumentProperties32A
056 stub DocumentPropertiesW
057 stub EXTDEVICEMODE
058 stub EndDocPrinter
059 stub EndPagePrinter
060 stub EnumFormsA
061 stub EnumFormsW
062 stub EnumJobsA
063 stub EnumJobsW
064 stub EnumMonitorsA
065 stub EnumMonitorsW
066 stub EnumPortsA
067 stub EnumPortsW
068 stub EnumPrintProcessorDatatypesA
069 stub EnumPrintProcessorDatatypesW
070 stub EnumPrintProcessorsA
071 stub EnumPrintProcessorsW
072 stub EnumPrinterDriversA
073 stub EnumPrinterDriversW
074 stub EnumPrintersA
075 stub EnumPrintersW
076 stub ExtDeviceMode
077 stub FindClosePrinterChangeNotification
078 stub FindFirstPrinterChangeNotification
079 stub FindNextPrinterChangeNotification
080 stub FreePrinterNotifyInfo
081 stub GetFormA
082 stub GetFormW
083 stub GetJobA
084 stub GetJobW
085 stub GetPrintProcessorDirectoryA
086 stub GetPrintProcessorDirectoryW
087 stub GetPrinterA
088 stub GetPrinterDataA
089 stub GetPrinterDataW
090 stub GetPrinterDriverA
091 stub GetPrinterDriverDirectoryA
092 stub GetPrinterDriverDirectoryW
093 stub GetPrinterDriverW
094 stub GetPrinterW
095 stub InitializeDll
096 stub OpenPrinterA
097 stub OpenPrinterW
098 stub PlayGdiScriptOnPrinterIC
099 stub PrinterMessageBoxA
100 stub PrinterMessageBoxW
101 stub PrinterProperties
102 stub ReadPrinter
103 stub ResetPrinterA
104 stub ResetPrinterW
105 stub ScheduleJob
106 stub SetAllocFailCount
107 stub SetFormA
108 stub SetFormW
109 stub SetJobA
110 stub SetJobW
111 stub SetPrinterA
112 stub SetPrinterDataA
113 stub SetPrinterDataW
114 stub SetPrinterW
115 stub SpoolerDevQueryPrintW
116 stub SpoolerInit
117 stub StartDocDlgA
118 stub StartDocDlgW
119 stub StartDocPrinterA
120 stub StartDocPrinterW
121 stub StartPagePrinter
122 stub WaitForPrinterChange
123 stub WritePrinter
101 stub ADVANCEDSETUPDIALOG
102 stub AbortPrinter
103 stub AddFormA
104 stub AddFormW
105 stub AddJobA
106 stub AddJobW
107 stub AddMonitorA
108 stub AddMonitorW
109 stub AddPortA
110 stub AddPortExA
111 stub AddPortExW
112 stub AddPortW
113 stub AddPrintProcessorA
114 stub AddPrintProcessorW
115 stub AddPrintProvidorA
116 stub AddPrintProvidorW
117 stub AddPrinterA
118 stub AddPrinterConnectionA
119 stub AddPrinterConnectionW
120 stub AddPrinterDriverA
121 stub AddPrinterDriverW
122 stub AddPrinterW
123 stub AdvancedDocumentPropertiesA
124 stub AdvancedDocumentPropertiesW
125 stub AdvancedSetupDialog
126 stub ClosePrinter
127 stub ConfigurePortA
128 stub ConfigurePortW
129 stub ConnectToPrinterDlg
130 stub CreatePrinterIC
131 stub DEVICECAPABILITIES
132 stub DEVICEMODE
133 stub DeleteFormA
134 stub DeleteFormW
135 stub DeleteMonitorA
136 stub DeleteMonitorW
137 stub DeletePortA
138 stub DeletePortW
139 stub DeletePrintProcessorA
140 stub DeletePrintProcessorW
141 stub DeletePrintProvidorA
142 stub DeletePrintProvidorW
143 stub DeletePrinter
144 stub DeletePrinterConnectionA
145 stub DeletePrinterConnectionW
146 stub DeletePrinterDriverA
147 stub DeletePrinterDriverW
148 stub DeletePrinterIC
149 stub DevQueryPrint
150 stub DeviceCapabilities
151 stdcall DeviceCapabilitiesA(ptr ptr long ptr ptr) DeviceCapabilities32A
152 stub DeviceCapabilitiesW
153 stub DeviceMode
154 stub DocumentEvent
155 stdcall DocumentPropertiesA(long long ptr ptr ptr long) DocumentProperties32A
156 stub DocumentPropertiesW
157 stub EXTDEVICEMODE
158 stub EndDocPrinter
159 stub EndPagePrinter
160 stub EnumFormsA
161 stub EnumFormsW
162 stub EnumJobsA
163 stub EnumJobsW
164 stub EnumMonitorsA
165 stub EnumMonitorsW
166 stub EnumPortsA
167 stub EnumPortsW
168 stub EnumPrintProcessorDatatypesA
169 stub EnumPrintProcessorDatatypesW
170 stub EnumPrintProcessorsA
171 stub EnumPrintProcessorsW
172 stub EnumPrinterDriversA
173 stub EnumPrinterDriversW
174 stub EnumPrintersA
175 stub EnumPrintersW
176 stub ExtDeviceMode
177 stub FindClosePrinterChangeNotification
178 stub FindFirstPrinterChangeNotification
179 stub FindNextPrinterChangeNotification
180 stub FreePrinterNotifyInfo
181 stub GetFormA
182 stub GetFormW
183 stub GetJobA
184 stub GetJobW
185 stub GetPrintProcessorDirectoryA
186 stub GetPrintProcessorDirectoryW
187 stub GetPrinterA
188 stub GetPrinterDataA
189 stub GetPrinterDataW
190 stub GetPrinterDriverA
191 stub GetPrinterDriverDirectoryA
192 stub GetPrinterDriverDirectoryW
193 stub GetPrinterDriverW
194 stub GetPrinterW
195 stub InitializeDll
196 stub OpenPrinterA
197 stub OpenPrinterW
198 stub PlayGdiScriptOnPrinterIC
199 stub PrinterMessageBoxA
200 stub PrinterMessageBoxW
201 stub PrinterProperties
202 stub ReadPrinter
203 stub ResetPrinterA
204 stub ResetPrinterW
205 stub ScheduleJob
206 stub SetAllocFailCount
207 stub SetFormA
208 stub SetFormW
209 stub SetJobA
210 stub SetJobW
211 stub SetPrinterA
212 stub SetPrinterDataA
213 stub SetPrinterDataW
214 stub SetPrinterW
215 stub SpoolerDevQueryPrintW
216 stub SpoolerInit
217 stub StartDocDlgA
218 stub StartDocDlgW
219 stub StartDocPrinterA
220 stub StartDocPrinterW
221 stub StartPagePrinter
222 stub WaitForPrinterChange
223 stub WritePrinter

View File

@ -12,6 +12,7 @@ type win16
24 pascal16 TASK_Reschedule() TASK_Reschedule
27 pascal EntryAddrProc(word word) EntryAddrProc
28 pascal MyAlloc(word word word) MODULE_AllocateSegment
29 pascal DefResourceHandler(word word word) NE_DefResourceHandler
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc
# Interrupt vectors 0-255 are ordinals 100-355

View File

@ -1,6 +1,5 @@
name wsock32
type win32
base 0
001 stdcall accept(long ptr ptr) WINSOCK_accept32
002 stdcall bind(long ptr long) WINSOCK_bind32

View File

@ -49,11 +49,13 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
}
/* objects/bitmap.c */
extern BOOL32 BITMAP_Init(void);
extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
extern BOOL32 BITMAP_Init(void);
extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
extern XImage *BITMAP_GetXImage( const BITMAPOBJ *bmp );
extern INT32 BITMAP_GetBitsPadding( int width, int depth );
extern INT32 BITMAP_GetBitsWidth( int width, int depth );
/* objects/dib.c */
extern int DIB_GetDIBWidthBytes( int width, int depth );

View File

@ -22,34 +22,36 @@ extern int (*IF1632_CallLargeStack)( int (*func)(), void *arg );
#ifndef WINELIB
extern LONG CallTo16_regs_ ( const CONTEXT *context );
extern WORD CallTo16_word_ ( FARPROC16 );
extern WORD CallTo16_word_w ( FARPROC16, WORD );
extern LONG CallTo16_long_l ( FARPROC16, LONG );
extern WORD CallTo16_word_ww ( FARPROC16, WORD, WORD );
extern WORD CallTo16_word_wl ( FARPROC16, WORD, LONG );
extern WORD CallTo16_word_ll ( FARPROC16, LONG, LONG );
extern WORD CallTo16_word_www ( FARPROC16, WORD, WORD, WORD );
extern WORD CallTo16_word_wwl ( FARPROC16, WORD, WORD, LONG );
extern WORD CallTo16_word_wlw ( FARPROC16, WORD, LONG, WORD );
extern LONG CallTo16_long_wwl ( FARPROC16, WORD, WORD, LONG );
extern WORD CallTo16_word_llwl ( FARPROC16, LONG, LONG, WORD, LONG );
extern LONG CallTo16_long_wwwl ( FARPROC16, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_lwww ( FARPROC16, LONG, WORD, WORD, WORD );
extern WORD CallTo16_word_wwll ( FARPROC16, WORD, WORD, LONG, LONG );
extern WORD CallTo16_word_wllwl( FARPROC16, WORD, LONG, LONG, WORD, LONG );
extern LONG CallTo16_long_lwwll( FARPROC16, LONG, WORD, WORD, LONG, LONG );
extern WORD CallTo16_word_wwlll( FARPROC16, WORD, WORD, LONG, LONG, LONG );
extern LONG CallTo16_long_lllllllwlwwwl( FARPROC16, LONG, LONG, LONG,
LONG, LONG, LONG, LONG, WORD, LONG,
WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_lwll ( FARPROC16, LONG, WORD, LONG, LONG);
extern WORD CallTo16_word_lwlll( FARPROC16, LONG, WORD, LONG, LONG, LONG );
extern WORD CallTo16_word_llll ( FARPROC16, LONG, LONG, LONG, LONG);
extern LONG CallTo16_long_lwlll( FARPROC16, LONG, WORD, LONG, LONG, LONG );
extern LONG CallTo16_long_lwwllwlllllw( FARPROC16, LONG, WORD, WORD, LONG,
LONG, WORD, LONG, LONG, LONG, LONG,
LONG, WORD);
extern LONG CALLBACK CallTo16_regs_ (const CONTEXT *context);
extern WORD CALLBACK CallTo16_word_ (FARPROC16);
extern WORD CALLBACK CallTo16_word_w (FARPROC16,WORD);
extern LONG CALLBACK CallTo16_long_l (FARPROC16,LONG);
extern WORD CALLBACK CallTo16_word_ww (FARPROC16,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wl (FARPROC16,WORD,LONG);
extern WORD CALLBACK CallTo16_word_ll (FARPROC16,LONG,LONG);
extern WORD CALLBACK CallTo16_word_www (FARPROC16,WORD,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wwl (FARPROC16,WORD,WORD,LONG);
extern WORD CALLBACK CallTo16_word_wlw (FARPROC16,WORD,LONG,WORD);
extern LONG CALLBACK CallTo16_long_wwl (FARPROC16,WORD,WORD,LONG);
extern WORD CALLBACK CallTo16_word_llwl (FARPROC16,LONG,LONG,WORD,LONG);
extern WORD CALLBACK CallTo16_word_lwll (FARPROC16,LONG,WORD,LONG,LONG);
extern LONG CALLBACK CallTo16_long_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
extern LONG CALLBACK CallTo16_wndp_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
extern WORD CALLBACK CallTo16_word_lwww (FARPROC16,LONG,WORD,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wwll (FARPROC16,WORD,WORD,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wllwl(FARPROC16,WORD,LONG,LONG,WORD,LONG);
extern LONG CALLBACK CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wwwww(FARPROC16,WORD,WORD,WORD,WORD,WORD);
extern LONG CALLBACK CallTo16_wndp_lllllllwlwwwl(FARPROC16,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,WORD,LONG,WORD,
WORD,WORD,LONG);
extern WORD CALLBACK CallTo16_word_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
extern WORD CALLBACK CallTo16_word_llll (FARPROC16,LONG,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_lwwllwlllllw(FARPROC16,LONG,WORD,WORD,LONG,
LONG,WORD,LONG,LONG,LONG,LONG,
LONG,WORD);
#define CallDriverProc( func, dwId, msg, hdrvr, lparam1, lparam2 ) \
CallTo16_long_lwwll( func, dwId, msg, hdrvr, lparam1, lparam2 )
@ -66,28 +68,20 @@ extern LONG CallTo16_long_lwwllwlllllw( FARPROC16, LONG, WORD, WORD, LONG,
/* List of the 32-bit callback functions. This list is used */
/* by the build program to generate the file if1632/callto32.S */
extern LONG CallTo32_0( FARPROC32 );
extern LONG CallTo32_1( FARPROC32, DWORD );
extern LONG CallTo32_2( FARPROC32, DWORD, DWORD );
extern LONG CallTo32_3( FARPROC32, DWORD, DWORD, DWORD );
extern LONG CallTo32_4( FARPROC32, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_5( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_6( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_7( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_8( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_9( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_10( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_11( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_12( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CallTo32_13( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
#define CallTaskStart32( func ) \
CallTo32_0( func )
#define CallDLLEntryProc32( func, hmodule, a, b ) \
CallTo32_3( func, hmodule, a, b )
#define CallWordBreakProc32A( func, lpch, ichCurrent, cch, code ) \
CallTo32_4( func, (DWORD)lpch, ichCurrent, cch, code )
extern LONG CALLBACK CallTo32_0( FARPROC32 );
extern LONG CALLBACK CallTo32_1( FARPROC32, DWORD );
extern LONG CALLBACK CallTo32_2( FARPROC32, DWORD, DWORD );
extern LONG CALLBACK CallTo32_3( FARPROC32, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_4( FARPROC32, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_5( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_6( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_7( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_8( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_9( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_10( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_11( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_12( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
extern LONG CALLBACK CallTo32_13( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
#else /* WINELIB */
@ -101,8 +95,6 @@ extern LONG CallTo32_13( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DW
(*func)( nExitType )
#define CallWordBreakProc16( func, lpch, ichCurrent, cch, code ) \
(*func)( lpch, ichCurrent, cch, code )
#define CallWordBreakProc32A( func, lpch, ichCurrent, cch, code ) \
(*func)( lpch, ichCurrent, cch, code )
#endif /* WINELIB */

View File

@ -38,6 +38,6 @@ typedef struct tagCLASS
extern void CLASS_DumpClass( CLASS *class );
extern void CLASS_WalkClasses(void);
extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
extern CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE16 hinstance );
extern CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE32 hinstance );
#endif /* __WINE_CLASS_H */

View File

@ -41,25 +41,18 @@ void WINAPI InitCommonControls(void);
#define CCS_BOTTOM 0x0003
#define SBARS_SIZEGRIP 0x0100
/* UpDown control */
/* UpDown */
#define UPDOWN_CLASS32A "msctls_updown32"
#define UPDOWN_CLASS32W "msctls_updown32"
#define UPDOWN_CLASS16 "msctls_updown"
#define UPDOWN_CLASS WINELIB_NAME_AW(UPDOWN_CLASS)
#define UPDOWN_CLASS32A "msctls_updown32"
#define UPDOWN_CLASS32W L"msctls_updown32"
#define UPDOWN_CLASS16 "msctls_updown"
#define UPDOWN_CLASS WINELIB_NAME_AW(UPDOWN_CLASS)
typedef struct tagUDACCEL
{
UINT32 nSec;
UINT32 nInc;
} UDACCEL;
typedef struct tagNM_UPDOWN
{
NMHDR hdr;
int iPos;
int iDelta;
} NM_UPDOWN;
#define UD_MAXVAL 0x7fff
#define UD_MINVAL 0x8001
@ -74,7 +67,7 @@ typedef struct tagNM_UPDOWN
#define UDS_NOTHOUSANDS 0x0080
#define UDN_FIRST (0U-721)
#define UDN_DELTAPOS (UDN_FIRST - 1)
#define UDN_DELTAPOS (UDN_FIRST-1)
#define UDM_SETRANGE (WM_USER+101)
#define UDM_GETRANGE (WM_USER+102)
@ -87,13 +80,28 @@ typedef struct tagNM_UPDOWN
#define UDM_SETBASE (WM_USER+109)
#define UDM_GETBASE (WM_USER+110)
/* Progress Bar */
#define PROGRESS_CLASS32A "msctls_progress32"
#define PROGRESS_CLASS32W L"msctls_progress32"
#define PROGRESS_CLASS16 "msctls_progress"
#define PROGRESS_CLASS WINELIB_NAME_AW(PROGRESS_CLASS)
#define PBM_SETRANGE (WM_USER+1)
#define PBM_SETPOS (WM_USER+2)
#define PBM_DELTAPOS (WM_USER+3)
#define PBM_SETSTEP (WM_USER+4)
#define PBM_STEPIT (WM_USER+5)
/* Functions prototypes */
HWND32 WINAPI CreateStatusWindow32A(INT32,LPCSTR,HWND32,UINT32);
HWND32 WINAPI CreateStatusWindow32W(INT32,LPCWSTR,HWND32,UINT32);
#define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow)
HWND32 WINAPI CreateUpDownControl(DWORD,INT32,INT32,INT32,INT32,HWND32,
INT32,HINSTANCE32,HWND32,INT32,INT32,INT32);
HWND32 WINAPI CreateUpDownControl(DWORD,INT32,INT32,INT32,INT32,
HWND32,INT32,HINSTANCE32,HWND32,
INT32,INT32,INT32);
VOID WINAPI DrawStatusText32A(HDC32,LPRECT32,LPCSTR,UINT32);
VOID WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32);
#define DrawStatusText WINELIB_NAME_AW(DrawStatusText)

View File

@ -1,14 +1,16 @@
#if !defined(COMPOBJ_H)
#define COMPOBJ_H
struct tagCLSID {
DWORD Data1;
WORD Data2;
WORD Data3;
BYTE Data4[8];
struct tagGUID
{
DWORD Data1;
WORD Data2;
WORD Data3;
BYTE Data4[8];
};
typedef struct tagCLSID CLSID;
typedef struct tagGUID GUID;
typedef struct tagGUID CLSID;
OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR);
OLESTATUS WINAPI CLSIDFromString(const LPCSTR, CLSID *);

View File

@ -63,6 +63,7 @@
#undef DEBUG_OLE
#undef DEBUG_PALETTE
#undef DEBUG_PROFILE
#undef DEBUG_PROGRESS
#undef DEBUG_PROP
#undef DEBUG_REG
#undef DEBUG_REGION
@ -148,6 +149,7 @@
#define DEBUG_OLE
#define DEBUG_PALETTE
#define DEBUG_PROFILE
#define DEBUG_PROGRESS
#define DEBUG_PROP
#define DEBUG_REG
#define DEBUG_REGION
@ -463,6 +465,11 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_PROGRESS
1,
#else
0,
#endif
#ifdef DEBUG_PROP
1,
#else
@ -1337,8 +1344,21 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_prop if(!debug_msg_enabled[57]) ; else fprintf
#define debugging_prop debug_msg_enabled[57]
#define dprintf_progress if(!debug_msg_enabled[57]) ; else fprintf
#define debugging_progress debug_msg_enabled[57]
#else
#ifdef DEBUG_PROGRESS
#define dprintf_progress fprintf
#define debugging_progress 1
#else
#define dprintf_progress while(0) fprintf
#define debugging_progress 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_prop if(!debug_msg_enabled[58]) ; else fprintf
#define debugging_prop debug_msg_enabled[58]
#else
#ifdef DEBUG_PROP
#define dprintf_prop fprintf
@ -1350,8 +1370,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_reg if(!debug_msg_enabled[58]) ; else fprintf
#define debugging_reg debug_msg_enabled[58]
#define dprintf_reg if(!debug_msg_enabled[59]) ; else fprintf
#define debugging_reg debug_msg_enabled[59]
#else
#ifdef DEBUG_REG
#define dprintf_reg fprintf
@ -1363,8 +1383,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_region if(!debug_msg_enabled[59]) ; else fprintf
#define debugging_region debug_msg_enabled[59]
#define dprintf_region if(!debug_msg_enabled[60]) ; else fprintf
#define debugging_region debug_msg_enabled[60]
#else
#ifdef DEBUG_REGION
#define dprintf_region fprintf
@ -1376,8 +1396,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_relay if(!debug_msg_enabled[60]) ; else fprintf
#define debugging_relay debug_msg_enabled[60]
#define dprintf_relay if(!debug_msg_enabled[61]) ; else fprintf
#define debugging_relay debug_msg_enabled[61]
#else
#ifdef DEBUG_RELAY
#define dprintf_relay fprintf
@ -1389,8 +1409,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_resource if(!debug_msg_enabled[61]) ; else fprintf
#define debugging_resource debug_msg_enabled[61]
#define dprintf_resource if(!debug_msg_enabled[62]) ; else fprintf
#define debugging_resource debug_msg_enabled[62]
#else
#ifdef DEBUG_RESOURCE
#define dprintf_resource fprintf
@ -1402,8 +1422,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_scroll if(!debug_msg_enabled[62]) ; else fprintf
#define debugging_scroll debug_msg_enabled[62]
#define dprintf_scroll if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_scroll debug_msg_enabled[63]
#else
#ifdef DEBUG_SCROLL
#define dprintf_scroll fprintf
@ -1415,8 +1435,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_selector if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_selector debug_msg_enabled[63]
#define dprintf_selector if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_selector debug_msg_enabled[64]
#else
#ifdef DEBUG_SELECTOR
#define dprintf_selector fprintf
@ -1428,8 +1448,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_sem if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_sem debug_msg_enabled[64]
#define dprintf_sem if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_sem debug_msg_enabled[65]
#else
#ifdef DEBUG_SEM
#define dprintf_sem fprintf
@ -1441,8 +1461,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_sendmsg if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_sendmsg debug_msg_enabled[65]
#define dprintf_sendmsg if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_sendmsg debug_msg_enabled[66]
#else
#ifdef DEBUG_SENDMSG
#define dprintf_sendmsg fprintf
@ -1454,8 +1474,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_shm if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_shm debug_msg_enabled[66]
#define dprintf_shm if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_shm debug_msg_enabled[67]
#else
#ifdef DEBUG_SHM
#define dprintf_shm fprintf
@ -1467,8 +1487,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_stress if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_stress debug_msg_enabled[67]
#define dprintf_stress if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_stress debug_msg_enabled[68]
#else
#ifdef DEBUG_STRESS
#define dprintf_stress fprintf
@ -1480,8 +1500,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_string if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_string debug_msg_enabled[68]
#define dprintf_string if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_string debug_msg_enabled[69]
#else
#ifdef DEBUG_STRING
#define dprintf_string fprintf
@ -1493,8 +1513,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_task if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_task debug_msg_enabled[69]
#define dprintf_task if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_task debug_msg_enabled[70]
#else
#ifdef DEBUG_TASK
#define dprintf_task fprintf
@ -1506,8 +1526,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_text if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_text debug_msg_enabled[70]
#define dprintf_text if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_text debug_msg_enabled[71]
#else
#ifdef DEBUG_TEXT
#define dprintf_text fprintf
@ -1519,8 +1539,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_timer if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_timer debug_msg_enabled[71]
#define dprintf_timer if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_timer debug_msg_enabled[72]
#else
#ifdef DEBUG_TIMER
#define dprintf_timer fprintf
@ -1532,8 +1552,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_toolhelp if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[72]
#define dprintf_toolhelp if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[73]
#else
#ifdef DEBUG_TOOLHELP
#define dprintf_toolhelp fprintf
@ -1545,8 +1565,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_tweak if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_tweak debug_msg_enabled[73]
#define dprintf_tweak if(!debug_msg_enabled[74]) ; else fprintf
#define debugging_tweak debug_msg_enabled[74]
#else
#ifdef DEBUG_TWEAK
#define dprintf_tweak fprintf
@ -1558,8 +1578,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_updown if(!debug_msg_enabled[74]) ; else fprintf
#define debugging_updown debug_msg_enabled[74]
#define dprintf_updown if(!debug_msg_enabled[75]) ; else fprintf
#define debugging_updown debug_msg_enabled[75]
#else
#ifdef DEBUG_UPDOWN
#define dprintf_updown fprintf
@ -1571,8 +1591,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_ver if(!debug_msg_enabled[75]) ; else fprintf
#define debugging_ver debug_msg_enabled[75]
#define dprintf_ver if(!debug_msg_enabled[76]) ; else fprintf
#define debugging_ver debug_msg_enabled[76]
#else
#ifdef DEBUG_VER
#define dprintf_ver fprintf
@ -1584,8 +1604,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_virtual if(!debug_msg_enabled[76]) ; else fprintf
#define debugging_virtual debug_msg_enabled[76]
#define dprintf_virtual if(!debug_msg_enabled[77]) ; else fprintf
#define debugging_virtual debug_msg_enabled[77]
#else
#ifdef DEBUG_VIRTUAL
#define dprintf_virtual fprintf
@ -1597,8 +1617,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_vxd if(!debug_msg_enabled[77]) ; else fprintf
#define debugging_vxd debug_msg_enabled[77]
#define dprintf_vxd if(!debug_msg_enabled[78]) ; else fprintf
#define debugging_vxd debug_msg_enabled[78]
#else
#ifdef DEBUG_VXD
#define dprintf_vxd fprintf
@ -1610,8 +1630,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win if(!debug_msg_enabled[78]) ; else fprintf
#define debugging_win debug_msg_enabled[78]
#define dprintf_win if(!debug_msg_enabled[79]) ; else fprintf
#define debugging_win debug_msg_enabled[79]
#else
#ifdef DEBUG_WIN
#define dprintf_win fprintf
@ -1623,8 +1643,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win16drv if(!debug_msg_enabled[79]) ; else fprintf
#define debugging_win16drv debug_msg_enabled[79]
#define dprintf_win16drv if(!debug_msg_enabled[80]) ; else fprintf
#define debugging_win16drv debug_msg_enabled[80]
#else
#ifdef DEBUG_WIN16DRV
#define dprintf_win16drv fprintf
@ -1636,8 +1656,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win32 if(!debug_msg_enabled[80]) ; else fprintf
#define debugging_win32 debug_msg_enabled[80]
#define dprintf_win32 if(!debug_msg_enabled[81]) ; else fprintf
#define debugging_win32 debug_msg_enabled[81]
#else
#ifdef DEBUG_WIN32
#define dprintf_win32 fprintf
@ -1649,8 +1669,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_winsock if(!debug_msg_enabled[81]) ; else fprintf
#define debugging_winsock debug_msg_enabled[81]
#define dprintf_winsock if(!debug_msg_enabled[82]) ; else fprintf
#define debugging_winsock debug_msg_enabled[82]
#else
#ifdef DEBUG_WINSOCK
#define dprintf_winsock fprintf
@ -1722,6 +1742,7 @@ static char *debug_msg_name[] = {
"ole",
"palette",
"profile",
"progress",
"prop",
"reg",
"region",

View File

@ -265,7 +265,7 @@ extern int DEBUG_GetCurrentFrame(struct name_hash ** name,
extern int DEBUG_ReadExecutableDbgInfo(void);
/* debugger/msc.c */
extern int DEBUG_RegisterDebugInfo(int, struct pe_data *pe,
extern int DEBUG_RegisterDebugInfo(struct pe_data *pe,
int, unsigned long, unsigned long);
extern int DEBUG_ProcessDeferredDebug(void);
extern int DEBUG_RegisterELFDebugInfo(int load_addr, u_long size, char * name);

View File

@ -40,8 +40,27 @@ typedef struct
DWORD refcount;
} K32OBJ;
/* Kernel object list entry */
typedef struct _K32OBJ_ENTRY
{
K32OBJ *obj;
struct _K32OBJ_ENTRY *next;
struct _K32OBJ_ENTRY *prev;
} K32OBJ_ENTRY;
/* Kernel object list */
typedef struct
{
K32OBJ_ENTRY *head;
K32OBJ_ENTRY *tail;
} K32OBJ_LIST;
extern void K32OBJ_IncCount( K32OBJ *ptr );
extern void K32OBJ_DecCount( K32OBJ *ptr );
extern void K32OBJ_AddHead( K32OBJ_LIST *list, K32OBJ *ptr );
extern void K32OBJ_AddTail( K32OBJ_LIST *list, K32OBJ *ptr );
extern void K32OBJ_Remove( K32OBJ_LIST *list, K32OBJ *ptr );
extern K32OBJ *K32OBJ_RemoveHead( K32OBJ_LIST *list );
extern BOOL32 K32OBJ_AddName( K32OBJ *obj, LPCSTR name );
extern K32OBJ *K32OBJ_FindName( LPCSTR name );
extern K32OBJ *K32OBJ_FindNameType( LPCSTR name, K32OBJ_TYPE type );

View File

@ -111,22 +111,25 @@ typedef struct resource_nameinfo_s NE_NAMEINFO;
((NE_WIN32_EXTRAINFO *)((pModule) + 1))->pe_module : 0))
/* module.c */
extern NE_MODULE *MODULE_GetPtr( HMODULE16 hModule );
extern void MODULE_DumpModule( HMODULE16 hmodule );
extern NE_MODULE *MODULE_GetPtr( HMODULE32 hModule );
extern HMODULE16 MODULE_HANDLEtoHMODULE16( HANDLE32 handle );
extern HMODULE32 MODULE_HANDLEtoHMODULE32( HANDLE32 handle );
extern void MODULE_DumpModule( HMODULE32 hmodule );
extern void MODULE_WalkModules(void);
extern int MODULE_OpenFile( HMODULE16 hModule );
extern LPSTR MODULE_GetModuleName( HMODULE16 hModule );
extern int MODULE_OpenFile( HMODULE32 hModule );
extern LPSTR MODULE_GetModuleName( HMODULE32 hModule );
extern void MODULE_RegisterModule( NE_MODULE *pModule );
extern HMODULE16 MODULE_FindModule( LPCSTR path );
extern HINSTANCE16 MODULE_GetInstance( HMODULE16 hModule );
extern HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first );
extern WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name );
extern FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern BOOL16 MODULE_SetEntryPoint( HMODULE16 hModule, WORD ordinal,
extern HMODULE32 MODULE_FindModule( LPCSTR path );
extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, LOADPARAMS* paramBlock );
extern HINSTANCE16 MODULE_GetInstance( HMODULE32 hModule );
extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 flags );
extern WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name );
extern FARPROC16 MODULE_GetEntryPoint( HMODULE32 hModule, WORD ordinal );
extern BOOL16 MODULE_SetEntryPoint( HMODULE32 hModule, WORD ordinal,
WORD offset );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WIN32_GetProcAddress16( HMODULE16 hmodule, LPSTR name );
extern FARPROC16 WIN32_GetProcAddress16( HMODULE32 hmodule, LPSTR name );
/* builtin.c */
extern BOOL16 BUILTIN_Init(void);

View File

@ -88,6 +88,10 @@ typedef struct
#define NE_FFLAGS_MULTIPLEDATA 0x0002
#define NE_FFLAGS_WIN32 0x0010
#define NE_FFLAGS_BUILTIN 0x0020 /* Wine built-in module */
#define NE_FFLAGS_IMPLICIT 0x0040
#define NE_FFLAGS_FRAMEBUF 0x0100 /* OS/2 fullscreen app */
#define NE_FFLAGS_CONSOLE 0x0200 /* OS/2 console app */
#define NE_FFLAGS_GUI 0x0300 /* right, (NE_FFLAGS_FRAMEBUF | NE_FFLAGS_CONSOLE) */
#define NE_FFLAGS_SELFLOAD 0x0800
#define NE_FFLAGS_LINKERROR 0x2000
#define NE_FFLAGS_CALLWEP 0x4000
@ -225,7 +229,7 @@ struct resource_typeinfo_s
{
unsigned short type_id; /* Type identifier */
unsigned short count; /* Number of resources of this type */
unsigned long reserved;
DWORD resloader; /* SetResourceHandler() */
/*
* Name info array.
*/
@ -244,7 +248,4 @@ struct resource_typeinfo_s
#define NE_RSCTYPE_RCDATA 0x800a
#define NE_RSCTYPE_STRING 0x8006
int load_typeinfo (int, struct resource_typeinfo_s *);
int load_nameinfo (int, struct resource_nameinfo_s *);
#endif /* __WINE_NEEXE_H */

View File

@ -6,20 +6,34 @@
#include "winnt.h"
#include "peexe.h"
/* This struct is used for loaded PE .dlls */
struct pe_data {
LPIMAGE_NT_HEADERS pe_header;
LPIMAGE_SECTION_HEADER pe_seg;
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
LPIMAGE_EXPORT_DIRECTORY pe_export;
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
LPIMAGE_BASE_RELOCATION pe_reloc;
int base_addr;
int load_addr;
int vma_size;
LPIMAGE_NT_HEADERS pe_header;
LPIMAGE_SECTION_HEADER pe_seg;
HMODULE32 mappeddll;
};
typedef struct pe_data PE_MODULE;
/* modreference used for attached processes
* all section are calculated here, relocations etc.
*/
struct pe_modref {
struct pe_modref *next;
PE_MODULE *pe_module;
unsigned long int load_addr;
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
LPIMAGE_EXPORT_DIRECTORY pe_export;
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
LPIMAGE_BASE_RELOCATION pe_reloc;
int flags;
#define PE_MODREF_PROCESS_ATTACHED 0x00000001
#define PE_MODREF_NO_DLL_CALLS 0x00000002
#define PE_MODREF_RELOCS_DONE 0x00000004
};
typedef struct pe_modref PE_MODREF;
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);
@ -31,7 +45,10 @@ extern BOOL32 PE_EnumResourceLanguages32A(HMODULE32,LPCSTR,LPCSTR,ENUMRESLANGPRO
extern BOOL32 PE_EnumResourceLanguages32W(HMODULE32,LPCWSTR,LPCWSTR,ENUMRESLANGPROC32W,LONG);
extern HRSRC32 PE_FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource32(HINSTANCE32,HRSRC32);
extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,HFILE32,DWORD);
extern HGLOBAL32 PE_LoadResource32(HINSTANCE32,HRSRC32);
extern void PE_InitializeDLLs(HMODULE16,DWORD,LPVOID);
struct _PDB32; /* forward definition */
extern void PE_InitializeDLLs(struct _PDB32*,DWORD,LPVOID);
#endif /* __WINE_PE_IMAGE_H */

View File

@ -323,7 +323,7 @@ typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
DWORD OffsetToData;
DWORD Size;
DWORD CodePage;
DWORD Reserved;
DWORD ResourceHandle;
} IMAGE_RESOURCE_DATA_ENTRY,*LPIMAGE_RESOURCE_DATA_ENTRY;
typedef struct _IMAGE_BASE_RELOCATION

View File

@ -11,6 +11,7 @@
#include "winbase.h"
#include "winnt.h"
#include "handle32.h"
#include "pe_image.h"
#include "task.h"
/* Process handle entry */
@ -71,7 +72,7 @@ typedef struct _PDB32
ENVDB *env_db; /* 40 Environment database */
HANDLE_TABLE *handle_table; /* 44 Handle table */
struct _PDB32 *parent; /* 48 Parent process */
void *modref_list; /* 4c MODREF list */
PE_MODREF *modref_list; /* 4c MODREF list */
void *thread_list; /* 50 List of threads */
void *debuggee_CB; /* 54 Debuggee context block */
void *local_heap_free; /* 58 Head of local heap free list */
@ -82,7 +83,7 @@ typedef struct _PDB32
DWORD tls_bits[2]; /* 88 TLS in-use bits */
DWORD process_dword; /* 90 Unknown */
struct _PDB32 *group; /* 94 Process group */
void *exe_modref; /* 98 MODREF for the process EXE */
PE_MODREF *exe_modref; /* 98 MODREF for the process EXE */
LPTOP_LEVEL_EXCEPTION_FILTER top_filter; /* 9c Top exception filter */
DWORD priority; /* a0 Priority level */
HANDLE32 heap_list; /* a4 Head of process heap list */
@ -101,7 +102,7 @@ extern HANDLE32 PROCESS_AllocHandle( K32OBJ *ptr, DWORD flags);
extern K32OBJ *PROCESS_GetObjPtr( HANDLE32 handle, K32OBJ_TYPE type );
extern BOOL32 PROCESS_SetObjPtr( HANDLE32 handle, K32OBJ *ptr, DWORD flags );
extern PDB32 *PROCESS_Create( TDB *pTask );
extern PDB32 *PROCESS_Create( TDB *pTask, LPCSTR cmd_line );
extern void PROCESS_Destroy( K32OBJ *ptr );
extern PDB32 *pCurrentProcess;

23
include/progress.h Normal file
View File

@ -0,0 +1,23 @@
/*
* Progress class extra info
*
* Copyright 1997 Dimitrie O. Paun
*/
#ifndef __WINE_PROGRESS_H
#define __WINE_PROGRESS_H
#include "windows.h"
#include "commctrl.h"
typedef struct
{
INT32 CurVal; /* Current progress value */
INT32 MinVal; /* Minimum progress value */
INT32 MaxVal; /* Maximum progress value */
INT32 Step; /* Step to use on PMB_STEPIT */
} PROGRESS_INFO;
LRESULT WINAPI ProgressWindowProc(HWND32, UINT32, WPARAM32, LPARAM);
#endif /* __WINE_PROGRESS_H */

View File

@ -44,14 +44,21 @@ extern void LIBRES_RegisterResources(const struct resource* const * Res);
#define WINE_CONSTRUCTOR
#endif
typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16, HMODULE16, HRSRC16 );
/* FIXME: convert all NE_ functions to accept NE_MODULE pointer instead
* of redundant hModule (which is always verified prior to calling these).
*/
extern int NE_AccessResource( HMODULE16 hModule, HRSRC16 hRsrc );
extern BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle );
extern HRSRC16 NE_FindResource(HMODULE16 hModule, SEGPTR typeId, SEGPTR resId);
extern DWORD NE_SizeofResource( HMODULE16 hModule, HRSRC16 hRsrc );
extern SEGPTR NE_LockResource( HMODULE16 hModule, HGLOBAL16 handle );
extern HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc,
DWORD size );
extern HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size );
extern HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc );
extern BOOL32 NE_InitResourceHandler( HMODULE16 hModule );
extern FARPROC32 NE_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC32 handler);
extern HGLOBAL16 SYSRES_LoadResource( SYSTEM_RESOURCE id );
extern void SYSRES_FreeResource( HGLOBAL16 handle );

View File

@ -18,6 +18,9 @@
#define SPY_RESULT_OK32 0x0001
#define SPY_RESULT_INVALIDHWND16 0x0002
#define SPY_RESULT_INVALIDHWND32 0x0003
#define SPY_RESULT_DEFWND16 0x0004
#define SPY_RESULT_DEFWND32 0x0005
extern const char *SPY_GetMsgName( UINT32 msg );
extern void SPY_EnterMessage( INT32 iFlag, HWND32 hwnd, UINT32 msg,

View File

@ -37,9 +37,10 @@ typedef struct
DWORD edx;
DWORD ecx;
DWORD ebx;
DWORD restore_addr; /* return address for restoring code selector */
DWORD codeselector; /* code selector to restore */
DWORD ebp; /* saved 32-bit frame pointer */
DWORD retaddr; /* return address */
DWORD codeselector; /* code selector for return address */
DWORD retaddr; /* actual return address */
DWORD args[1]; /* arguments to 16-bit function */
} STACK32FRAME;

View File

@ -133,6 +133,7 @@
#undef DEBUG_OLE
#undef DEBUG_PALETTE
#undef DEBUG_PROFILE
#undef DEBUG_PROGRESS
#undef DEBUG_PROP
#undef DEBUG_REG
#undef DEBUG_REGION
@ -218,6 +219,7 @@
#define DEBUG_OLE
#define DEBUG_PALETTE
#define DEBUG_PROFILE
#define DEBUG_PROGRESS
#define DEBUG_PROP
#define DEBUG_REG
#define DEBUG_REGION

View File

@ -23,45 +23,4 @@ void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCT32A*,
MDICREATESTRUCT16*);
void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16*,
MDICREATESTRUCT32A*);
#pragma pack(1)
typedef struct {
BYTE bWidth;
BYTE bHeight;
BYTE bColorCount;
BYTE bReserved;
WORD wPlanes;
WORD wBitCount;
DWORD dwBytesInRes;
WORD wResId WINE_PACKED;
/*WORD padding; Spec is wrong, no padding here*/
} ICONDIRENTRY32;
typedef struct {
WORD wWidth;
WORD wHeight;
WORD wPlanes;
WORD wBitCount;
DWORD dwBytesInRes;
WORD wResId WINE_PACKED;
/*WORD padding;*/
} CURSORDIRENTRY32;
typedef union{
ICONDIRENTRY32 icon;
CURSORDIRENTRY32 cursor;
} CURSORICONDIRENTRY32;
typedef struct {
WORD idReserved;
WORD idType;
WORD idCount;
/*WORD padding;*/
CURSORICONDIRENTRY32 idEntries[1];
} CURSORICONDIR32;
#pragma pack(4)
#endif /* __WINE_STRUCT32_H */

View File

@ -32,6 +32,10 @@ struct SysColorObjects
/* COLOR_BTNTEXT */
/* COLOR_INACTIVECAPTIONTEXT */
HBRUSH32 hbrushBtnHighlight; /* COLOR_BTNHIGHLIGHT */
/* COLOR_3DDKSHADOW */
/* COLOR_3DLIGHT */
/* COLOR_INFOTEXT */
/* COLOR_INFOBK */
};
extern void SYSCOLOR_Init(void);

View File

@ -51,11 +51,15 @@ typedef struct
struct _THDB;
struct _WSINFO;
/* signal proc typedef */
typedef void (CALLBACK *USERSIGNALPROC)(HANDLE16, UINT16, UINT16,
HINSTANCE16, HQUEUE16);
/* Task database. See 'Windows Internals' p. 226.
* Note that 16-bit OLE 2 libs like to read it directly
* so we have to keep entry offsets as they are.
*/
typedef struct
typedef struct _TDB
{
HTASK16 hNext; /* 00 Selector of next TDB */
DWORD ss_sp WINE_PACKED; /* 02 Stack pointer of task */
@ -75,7 +79,7 @@ typedef struct
HTASK16 hParent; /* 22 Selector of TDB of parent */
WORD signal_flags; /* 24 Flags for signal handler */
FARPROC16 sighandler WINE_PACKED; /* 26 Signal handler */
FARPROC16 userhandler WINE_PACKED; /* 2a USER signal handler */
USERSIGNALPROC userhandler WINE_PACKED; /* 2a USER signal handler */
FARPROC16 discardhandler WINE_PACKED; /* 2e Handler for GlobalNotify() */
DWORD int0 WINE_PACKED; /* 32 int 0 (divide by 0) handler */
DWORD int2 WINE_PACKED; /* 36 int 2 (NMI) handler */
@ -112,6 +116,12 @@ typedef struct
#define TDBF_OS2APP 0x0008
#define TDBF_WIN32 0x0010
/* USER signals */
#define USIG_TERMINATION 0x0020
#define USIG_DLL_LOAD 0x0040
#define USIG_DLL_UNLOAD 0x0080
#define USIG_GPF 0x0666
#pragma pack(4)
extern BOOL32 TASK_Init(void);

View File

@ -79,6 +79,8 @@ typedef struct _THDB
extern THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size,
LPTHREAD_START_ROUTINE start_addr );
extern void THREAD_Destroy( K32OBJ *ptr );
extern THDB *THREAD_Current(void);
extern THDB *THREAD_SwitchThread( CONTEXT *context );
extern THDB *pCurrentThread;

View File

@ -22,7 +22,14 @@ typedef struct
INT32 Flags; /* Internal Flags FLAG_* */
} UPDOWN_INFO;
LRESULT WINAPI UpDownWindowProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
LPARAM lParam);
typedef struct tagNM_UPDOWN
{
NMHDR hdr;
int iPos;
int iDelta;
} NM_UPDOWN;
LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
LPARAM lParam);
#endif /* __WINE_UPDOWN_H */

View File

@ -23,4 +23,6 @@ extern WORD USER_HeapSel;
#define USER_HEAP_SEG_ADDR(handle) \
((handle) ? PTR_SEG_OFF_TO_SEGPTR(USER_HeapSel, (handle)) : (SEGPTR)0)
void USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
#endif /* __WINE_USER_H */

View File

@ -61,7 +61,7 @@ typedef struct tagWND
HWINDOWPROC winproc; /* Window procedure */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND32 hwndSelf; /* Handle of this window */
HINSTANCE16 hInstance; /* Window hInstance (from CreateWindow) */
HINSTANCE32 hInstance; /* Window hInstance (from CreateWindow) */
RECT32 rectClient; /* Client area rel. to parent client area */
RECT32 rectWindow; /* Whole window rel. to parent client area */
LPSTR text; /* Window text */
@ -119,14 +119,12 @@ extern Window WIN_GetXWindow( HWND32 hwnd );
extern BOOL32 WIN_UnlinkWindow( HWND32 hwnd );
extern BOOL32 WIN_LinkWindow( HWND32 hwnd, HWND32 hwndInsertAfter );
extern HWND32 WIN_FindWinToRepaint( HWND32 hwnd, HQUEUE16 hQueue );
extern void WIN_SendParentNotify( HWND32 hwnd, WORD event,
WORD idChild, LPARAM lValue );
extern void WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew );
extern BOOL32 WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
extern BOOL32 WIN_CreateDesktopWindow(void);
extern HWND32 WIN_GetTopParent( HWND32 hwnd );
extern WND* WIN_GetTopParentPtr( WND* pWnd );
extern BOOL32 WIN_IsWindowDrawable(WND*, BOOL32 );
extern HINSTANCE16 WIN_GetWindowInstance( HWND32 hwnd );
extern HINSTANCE32 WIN_GetWindowInstance( HWND32 hwnd );
extern WND** WIN_BuildWinArray( WND *wndPtr, UINT32 bwa, UINT32* pnum );
extern void DEFWND_SetText( WND *wndPtr, LPCSTR text ); /* windows/defwnd.c */

View File

@ -5,6 +5,7 @@
extern "C" {
#endif
#include <stdarg.h>
#include "wintypes.h"
#pragma pack(1)
@ -904,6 +905,16 @@ typedef DWORD COLORREF;
#define COLOR_BTNTEXT 18
#define COLOR_INACTIVECAPTIONTEXT 19
#define COLOR_BTNHIGHLIGHT 20
#define COLOR_3DDKSHADOW 21
#define COLOR_3DLIGHT 22
#define COLOR_INFOTEXT 23
#define COLOR_INFOBK 24
#define COLOR_DESKTOP COLOR_BACKGROUND
#define COLOR_3DFACE COLOR_BTNFACE
#define COLOR_3DSHADOW COLOR_BTNSHADOW
#define COLOR_3DHIGHLIGHT COLOR_BTNHIGHLIGHT
#define COLOR_3DHILIGHT COLOR_BTNHIGHLIGHT
#define COLOR_BTNHILIGHT COLOR_BTNHIGHLIGHT
/* WM_CTLCOLOR values */
#define CTLCOLOR_MSGBOX 0
@ -968,6 +979,10 @@ DECL_WINELIB_TYPE(LPLOGBRUSH);
#define BS_PATTERN 3
#define BS_INDEXED 4
#define BS_DIBPATTERN 5
#define BS_DIBPATTERNPT 6
#define BS_PATTERN8X8 7
#define BS_DIBPATTERN8X8 8
#define BS_MONOPATTERN 9
/* Hatch styles */
#define HS_HORIZONTAL 0
@ -1875,6 +1890,15 @@ typedef struct
#define DIB_PAL_COLORS 1
#define CBM_INIT 4
typedef struct
{
BITMAP32 dsBm;
BITMAPINFOHEADER dsBmih;
DWORD dsBitfields[3];
HANDLE32 dshSection;
DWORD dsOffset;
} DIBSECTION,*LPDIBSECTION;
/* Cursors / Icons */
@ -4618,6 +4642,15 @@ typedef struct {
#define HELP_PARTIALKEY 0x0105
#define HELP_MULTIKEY 0x0201
#define HELP_SETWINPOS 0x0203
#define HELP_CONTEXTMENU 0x000a
#define HELP_FINDER 0x000b
#define HELP_WM_HELP 0x000c
#define HELP_SETPOPUP_POS 0x000d
#define HELP_TCARD 0x8000
#define HELP_TCARD_DATA 0x0010
#define HELP_TCARD_OTHER_CALLER 0x0011
/* ExitWindows() flags */
#define EW_RESTARTWINDOWS 0x0042
@ -5168,6 +5201,15 @@ typedef struct tagNMHDR
UINT32 code;
} NMHDR, *LPNMHDR;
typedef struct
{
UINT32 cbSize;
INT32 iTabLength;
INT32 iLeftMargin;
INT32 iRightMargin;
UINT32 uiLengthDrawn;
} DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
#pragma pack(4)
/* Declarations for functions that exist only in Win16 */
@ -5260,9 +5302,13 @@ BOOL16 WINAPI IsGDIObject(HGDIOBJ16);
BOOL16 WINAPI IsSharedSelector(HANDLE16);
BOOL16 WINAPI IsTask(HTASK16);
HTASK16 WINAPI IsTaskLocked(void);
BOOL16 WINAPI IsUserIdle(void);
BOOL16 WINAPI IsValidMetaFile(HMETAFILE16);
VOID WINAPI LogError(UINT16, LPVOID);
VOID WINAPI LogParamError(UINT16,FARPROC16,LPVOID);
HGLOBAL16 WINAPI LoadCursorIconHandler(HGLOBAL16,HMODULE16,HRSRC16);
HGLOBAL16 WINAPI LoadDIBCursorHandler(HGLOBAL16,HMODULE16,HRSRC16);
HGLOBAL16 WINAPI LoadDIBIconHandler(HGLOBAL16,HMODULE16,HRSRC16);
WORD WINAPI LocalCountFree(void);
WORD WINAPI LocalHandleDelta(WORD);
WORD WINAPI LocalHeapSize(void);
@ -5290,7 +5336,7 @@ WORD WINAPI SelectorAccessRights(WORD,WORD,WORD);
INT16 WINAPI SelectVisRgn(HDC16,HRGN16);
DWORD WINAPI SetBitmapDimension(HBITMAP16,INT16,INT16);
DWORD WINAPI SetBrushOrg(HDC16,INT16,INT16);
UINT16* WINAPI SetCommEventMask(INT16,UINT16);
SEGPTR WINAPI SetCommEventMask(INT16,UINT16);
BOOL16 WINAPI SetDCHook(HDC16,FARPROC16,DWORD);
DWORD WINAPI SetDCOrg(HDC16,INT16,INT16);
VOID WINAPI SetDCState(HDC16,HDC16);
@ -5582,7 +5628,11 @@ DWORD WINAPI GetMenuCheckMarkDimensions(void);
LONG WINAPI GetMessageExtraInfo(void);
DWORD WINAPI GetMessagePos(void);
LONG WINAPI GetMessageTime(void);
LANGID WINAPI GetSystemDefaultLangID(void);
LCID WINAPI GetSystemDefaultLCID(void);
DWORD WINAPI GetTickCount(void);
LANGID WINAPI GetUserDefaultLangID(void);
LCID WINAPI GetUserDefaultLCID(void);
ATOM WINAPI GlobalDeleteAtom(ATOM);
VOID WINAPI LZDone(void);
DWORD WINAPI OemKeyScan(WORD);
@ -5752,7 +5802,7 @@ BOOL32 WINAPI Chord32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32
INT16 WINAPI ClearCommBreak16(INT16);
BOOL32 WINAPI ClearCommBreak32(INT32);
#define ClearCommBreak WINELIB_NAME(ClearCommBreak)
BOOL16 WINAPI ClientToScreen16(HWND16,LPPOINT16);
VOID WINAPI ClientToScreen16(HWND16,LPPOINT16);
BOOL32 WINAPI ClientToScreen32(HWND32,LPPOINT32);
#define ClientToScreen WINELIB_NAME(ClientToScreen)
BOOL16 WINAPI ClipCursor16(const RECT16*);
@ -5889,6 +5939,9 @@ HDC32 WINAPI CreateIC32W(LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODE32W*);
HICON16 WINAPI CreateIcon16(HINSTANCE16,INT16,INT16,BYTE,BYTE,LPCVOID,LPCVOID);
HICON32 WINAPI CreateIcon32(HINSTANCE32,INT32,INT32,BYTE,BYTE,LPCVOID,LPCVOID);
#define CreateIcon WINELIB_NAME(CreateIcon)
HICON16 WINAPI CreateIconFromResourceEx16(LPBYTE,UINT16,BOOL16,DWORD,INT16,INT16,UINT16);
HICON32 WINAPI CreateIconFromResourceEx32(LPBYTE,UINT32,BOOL32,DWORD,INT32,INT32,UINT32);
#define CreateIconFromResourceEx WINELIB_NAME(CreateIconFromResourceEx)
HMENU16 WINAPI CreateMenu16(void);
HMENU32 WINAPI CreateMenu32(void);
#define CreateMenu WINELIB_NAME(CreateMenu)
@ -6477,7 +6530,7 @@ DWORD WINAPI GetModuleFileName32W(HMODULE32,LPWSTR,DWORD);
#define GetModuleFileName WINELIB_NAME_AW(GetModuleFileName)
HMODULE16 WINAPI GetModuleHandle16(LPCSTR);
HMODULE32 WINAPI GetModuleHandle32A(LPCSTR);
HMODULE32 WINAPI GetModuleHandle32W(LPCSTR);
HMODULE32 WINAPI GetModuleHandle32W(LPCWSTR);
#define GetModuleHandle WINELIB_NAME_AW(GetModuleHandle)
DWORD WINAPI GetNearestColor16(HDC16,DWORD);
DWORD WINAPI GetNearestColor32(HDC32,DWORD);
@ -6910,9 +6963,12 @@ HICON32 WINAPI LoadIcon32A(HINSTANCE32,LPCSTR);
HICON32 WINAPI LoadIcon32W(HINSTANCE32,LPCWSTR);
#define LoadIcon WINELIB_NAME_AW(LoadIcon)
HINSTANCE16 WINAPI LoadLibrary16(LPCSTR);
HINSTANCE32 WINAPI LoadLibrary32A(LPCSTR);
HINSTANCE32 WINAPI LoadLibrary32W(LPCWSTR);
HMODULE32 WINAPI LoadLibrary32A(LPCSTR);
HMODULE32 WINAPI LoadLibrary32W(LPCWSTR);
#define LoadLibrary WINELIB_NAME_AW(LoadLibrary)
HMODULE32 WINAPI LoadLibraryEx32A(LPCSTR,HFILE32,DWORD);
HMODULE32 WINAPI LoadLibraryEx32W(LPCWSTR,HFILE32,DWORD);
#define LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx)
HMENU16 WINAPI LoadMenu16(HINSTANCE16,SEGPTR);
HMENU32 WINAPI LoadMenu32A(HINSTANCE32,LPCSTR);
HMENU32 WINAPI LoadMenu32W(HINSTANCE32,LPCWSTR);
@ -7699,12 +7755,12 @@ INT32 WINAPIV wsprintf32A(LPSTR,LPCSTR,...);
INT32 WINAPIV wsprintf32W(LPWSTR,LPCWSTR,...);
#define wsprintf WINELIB_NAME_AW(wsprintf)
INT16 WINAPI wvsnprintf16(LPSTR,UINT16,LPCSTR,LPCVOID);
INT32 WINAPI wvsnprintf32A(LPSTR,UINT32,LPCSTR,LPCVOID);
INT32 WINAPI wvsnprintf32W(LPWSTR,UINT32,LPCWSTR,LPCVOID);
INT32 WINAPI wvsnprintf32A(LPSTR,UINT32,LPCSTR,va_list);
INT32 WINAPI wvsnprintf32W(LPWSTR,UINT32,LPCWSTR,va_list);
#define wvsnprintf WINELIB_NAME_AW(wvsnprintf)
INT16 WINAPI wvsprintf16(LPSTR,LPCSTR,LPCVOID);
INT32 WINAPI wvsprintf32A(LPSTR,LPCSTR,LPCVOID);
INT32 WINAPI wvsprintf32W(LPWSTR,LPCWSTR,LPCVOID);
INT32 WINAPI wvsprintf32A(LPSTR,LPCSTR,va_list);
INT32 WINAPI wvsprintf32W(LPWSTR,LPCWSTR,va_list);
#define wvsprintf WINELIB_NAME_AW(wvsprintf)
LONG WINAPI _hread16(HFILE16,LPVOID,LONG);
LONG WINAPI _hread32(HFILE32,LPVOID,LONG);

View File

@ -1,6 +1,10 @@
#ifndef __WINE_WINNLS_H
#define __WINE_WINNLS_H
/* flags to GetLocaleInfo */
#define LOCALE_NOUSEROVERRIDE 0x80000000
#define LOCALE_USE_CP_ACP 0x40000000
/* When adding new defines, don't forget to add an entry to the
* locale2id map in misc/ole2nls.c
*/
@ -103,6 +107,8 @@
#define LOCALE_IPOSSEPBYSPACE 0x00000055
#define LOCALE_INEGSYMPRECEDES 0x00000056
#define LOCALE_INEGSEPBYSPACE 0x00000057
#define LOCALE_FONTSIGNATURE 0x00000058
#define NORM_IGNORECASE 1
#define NORM_IGNORENONSPACE 2
@ -129,4 +135,15 @@
#define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
#define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
/* Locale Dependent Mapping Flags */
#define LCMAP_LOWERCASE 0x00000100 /* lower case letters */
#define LCMAP_UPPERCASE 0x00000200 /* upper case letters */
#define LCMAP_SORTKEY 0x00000400 /* WC sort key (normalize) */
#define LCMAP_BYTEREV 0x00000800 /* byte reversal */
#define LCMAP_HIRAGANA 0x00100000 /* map katakana to hiragana */
#define LCMAP_KATAKANA 0x00200000 /* map hiragana to katakana */
#define LCMAP_HALFWIDTH 0x00400000 /* map double byte to single byte */
#define LCMAP_FULLWIDTH 0x00800000 /* map single byte to double byte */
#endif /* __WINE_WINNLS_H */

View File

@ -278,7 +278,7 @@ typedef struct _EXCEPTION_POINTERS
* function pointer to a exception filter
*/
typedef LONG (*PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );

View File

@ -77,8 +77,6 @@ extern void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM32 wParam,
LPARAM lParam, MSGPARAM16* pm16 );
typedef LRESULT (*WINPROC_CALLWNDPROC16)(WNDPROC16,HWND16,UINT16,WPARAM16,LPARAM);
typedef LRESULT (*WINPROC_CALLWNDPROC32)(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM);
extern void WINPROC_SetCallWndProc16( WINPROC_CALLWNDPROC16 proc );
extern void WINPROC_SetCallWndProc32( WINPROC_CALLWNDPROC32 proc );
#endif /* __WINE_WINPROC_H */

View File

@ -66,27 +66,20 @@
/* Calling conventions definitions */
#ifdef not_used_yet
#ifdef __i386__
# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
# define __stdcall __attribute__((__stdcall__))
# define __cdecl __attribute__((__cdecl__))
# define __RESTORE_ES __asm__ __volatile__("pushw %ds\n\tpopw %es")
# else
# error You need gcc >= 2.7 to build Wine on a 386
# endif /* __GNUC__ */
#else /* __i386__ */
# define __stdcall /* nothing */
# define __cdecl /* nothing */
# define __stdcall
# define __cdecl
# define __RESTORE_ES
#endif /* __i386__ */
#else /* not_used_yet */
# define __stdcall /* nothing */
# define __cdecl /* nothing */
#endif /* not_used_yet */
#define CALLBACK __stdcall
#define WINAPI __stdcall
#define APIPRIVATE __stdcall
@ -131,6 +124,7 @@ typedef HANDLE32 HHOOK;
typedef HANDLE32 HKEY;
typedef HANDLE32 HMIXEROBJ;
typedef DWORD LCID;
typedef WORD LANGID;
typedef DWORD LCTYPE;
/* Pointers types. These are the same for emulator and library. */
@ -195,6 +189,7 @@ DECLARE_HANDLE(HWAVE);
DECLARE_HANDLE(HWAVEIN);
DECLARE_HANDLE(HWAVEOUT);
DECLARE_HANDLE(HWND);
DECLARE_HANDLE(HKL);
#undef DECLARE_HANDLE
/* Callback function pointers types */

View File

@ -9,8 +9,7 @@ LIBMODULE = library
LIB_SRCS = \
arch.c \
libres.c \
miscstubs.c \
sup.c
miscstubs.c
STUB_SRCS = winestub.c

View File

@ -15,7 +15,6 @@
/* for windows/winproc.c */
void CallFrom16_long_wwwll(void) {}
void CallFrom32_stdcall_5(void) {}
extern LRESULT ColorDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileOpenDlgProc(HWND16,UINT16,WPARAM16,LPARAM);

View File

@ -1,104 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include "windows.h"
#include "arch.h"
#include "neexe.h"
/*
* Header loading routines for WineLib.
*/
/* LOADSHORT Calls LOAD and swaps the high and the low bytes */
#define LOAD(x) read (fd, &TAB->x, sizeof (TAB->x))
#define LOADSHORT(x) LOAD(x); TAB->x = CONV_SHORT (TAB->x);
#define LOADLONG(x) LOAD(x); TAB->x = CONV_LONG (TAB->x);
void load_mz_header (int fd, LPIMAGE_DOS_HEADER mz_header)
{
#define TAB mz_header
LOAD(e_magic);
LOADSHORT(e_cblp);
LOADSHORT(e_cp);
LOADSHORT(e_crlc);
LOADSHORT(e_cparhdr);
LOADSHORT(e_minalloc);
LOADSHORT(e_maxalloc);
LOADSHORT(e_ss);
LOADSHORT(e_sp);
LOADSHORT(e_csum);
LOADSHORT(e_ip);
LOADSHORT(e_cs);
LOADSHORT(e_lfarlc);
LOADSHORT(e_ovno);
LOAD(e_res);
LOADSHORT(e_oemid);
LOADSHORT(e_oeminfo);
LOAD(e_res2);
LOADLONG(e_lfanew);
}
void load_ne_header (int fd, LPIMAGE_OS2_HEADER ne_header)
{
#undef TAB
#define TAB ne_header
LOAD (ne_magic);
LOADSHORT (linker_version);
LOADSHORT (linker_revision);
LOADSHORT (entry_tab_offset);
LOADSHORT (entry_tab_length);
LOAD (reserved1);
LOADSHORT (format_flags);
LOADSHORT (auto_data_seg);
LOADSHORT (local_heap_length);
LOADSHORT (stack_length);
LOADSHORT (ip);
LOADSHORT (cs);
LOADSHORT (sp);
LOADSHORT (ss);
LOADSHORT (n_segment_tab);
LOADSHORT (n_mod_ref_tab);
LOADSHORT (nrname_tab_length);
LOADSHORT (segment_tab_offset);
LOADSHORT (resource_tab_offset);
LOADSHORT (rname_tab_offset);
LOADSHORT (moduleref_tab_offset);
LOADSHORT (iname_tab_offset);
LOADLONG (nrname_tab_offset);
LOADSHORT (n_mov_entry_points);
LOADSHORT (align_shift_count);
LOADSHORT (n_resource_seg);
LOAD (operating_system);
LOAD (additional_flags);
LOADSHORT (fastload_offset);
LOADSHORT (fastload_length);
LOADSHORT (reserved2);
LOADSHORT (expect_version);
}
/*
* Typeinfo loading routines for non PC-architectures.
*/
int load_typeinfo (int fd, struct resource_typeinfo_s *typeinfo)
{
#undef TAB
#define TAB typeinfo
LOADSHORT (type_id);
LOADSHORT (count);
LOADLONG (reserved);
return 1;
}
int load_nameinfo (int fd, struct resource_nameinfo_s *nameinfo)
{
#undef TAB
#define TAB nameinfo
LOADSHORT (offset);
LOADSHORT (length);
LOADSHORT (flags);
LOADSHORT (id);
LOADSHORT (handle);
LOADSHORT (usage);
return 0;
}

View File

@ -18,6 +18,7 @@
#include "hook.h"
#include "module.h"
#include "neexe.h"
#include "resource.h"
#include "selectors.h"
#include "stackframe.h"
#include "task.h"
@ -26,7 +27,7 @@
#include "debug.h"
#include "callback.h"
extern HINSTANCE16 PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params );
extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params );
static HMODULE16 hFirstModule = 0;
static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */
@ -35,19 +36,70 @@ static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */
/***********************************************************************
* MODULE_GetPtr
*/
NE_MODULE *MODULE_GetPtr( HMODULE16 hModule )
NE_MODULE *MODULE_GetPtr( HMODULE32 hModule )
{
NE_MODULE *pModule = (NE_MODULE *)GlobalLock16( hModule );
if (!pModule || (pModule->magic != IMAGE_OS2_SIGNATURE) ||
(pModule->self != hModule)) return NULL;
return pModule;
HMODULE16 hnd =MODULE_HANDLEtoHMODULE16(hModule);
if (!hnd)
return NULL;
return (NE_MODULE*)GlobalLock16(hnd);
}
/***********************************************************************
* MODULE_HANDLEtoHMODULE16
*/
HMODULE16
MODULE_HANDLEtoHMODULE16(HANDLE32 handle) {
NE_MODULE *pModule;
if (HIWORD(handle)) {
/* this is a HMODULE32 aka pe->mappeddll */
/* walk the list looking for the correct startaddress */
pModule = (NE_MODULE *)GlobalLock16( hFirstModule );
while (pModule) {
if ( ((pModule->flags&(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32))==NE_FFLAGS_WIN32) &&
pModule->pe_module &&
((HMODULE32)pModule->pe_module->mappeddll == handle)
)
return pModule->self;
pModule=(NE_MODULE*)GlobalLock16(pModule->next);
}
return 0;
}
return GetExePtr(handle);
}
/***********************************************************************
* MODULE_HANDLEtoHMODULE32
* return HMODULE32, if possible, HMODULE16 otherwise
*/
HMODULE32
MODULE_HANDLEtoHMODULE32(HANDLE32 handle) {
NE_MODULE *pModule;
if (HIWORD(handle))
return (HMODULE32)handle;
else {
handle = GetExePtr(handle);
if (!handle)
return 0;
pModule = (NE_MODULE *)GlobalLock16( handle );
if (!pModule)
return 0;
if ( ((pModule->flags&(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32))==NE_FFLAGS_WIN32) &&
pModule->pe_module
)
return (HMODULE32)pModule->pe_module->mappeddll;
return handle;
}
}
/***********************************************************************
* MODULE_DumpModule
*/
void MODULE_DumpModule( HMODULE16 hModule )
void MODULE_DumpModule( HMODULE32 hModule )
{
int i, ordinal;
SEGTABLEENTRY *pSeg;
@ -210,7 +262,7 @@ void MODULE_WalkModules(void)
/***********************************************************************
* MODULE_OpenFile
*/
int MODULE_OpenFile( HMODULE16 hModule )
int MODULE_OpenFile( HMODULE32 hModule )
{
NE_MODULE *pModule;
DOS_FULL_NAME full_name;
@ -218,7 +270,7 @@ int MODULE_OpenFile( HMODULE16 hModule )
static int cachedfd = -1;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16(hModule);
dprintf_module( stddeb, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n",
hModule, hCachedModule, cachedfd );
if (!(pModule = MODULE_GetPtr( hModule ))) return -1;
@ -275,7 +327,7 @@ DWORD WINAPI MODULE_AllocateSegment(WORD wFlags, WORD wSize, WORD wElem)
/***********************************************************************
* MODULE_CreateSegments
*/
static BOOL32 MODULE_CreateSegments( HMODULE16 hModule )
static BOOL32 MODULE_CreateSegments( HMODULE32 hModule )
{
SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
@ -306,7 +358,7 @@ static BOOL32 MODULE_CreateSegments( HMODULE16 hModule )
/***********************************************************************
* MODULE_GetInstance
*/
HINSTANCE16 MODULE_GetInstance( HMODULE16 hModule )
HINSTANCE16 MODULE_GetInstance( HMODULE32 hModule )
{
SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
@ -359,12 +411,13 @@ HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, LOADPARAMS *params )
*
* Create a dummy NE module for Win32 or Winelib.
*/
HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
{
HMODULE16 hModule;
HMODULE32 hModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegment;
char *pStr,*basename,*s;
char *pStr,*s;
const char* basename;
INT32 of_size = sizeof(OFSTRUCT) - sizeof(ofs->szPathName)
+ strlen(ofs->szPathName) + 1;
@ -379,7 +432,7 @@ HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
8;
hModule = GlobalAlloc16( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
if (!hModule) return (HMODULE16)11; /* invalid exe */
if (!hModule) return (HMODULE32)11; /* invalid exe */
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
@ -432,7 +485,7 @@ HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
*pStr = strlen(basename);
if (*pStr>8) *pStr=8;
strncpy( pStr+1, basename, 8 );
free(basename);
free((void*)basename);
pStr += 9;
/* All tables zero terminated */
@ -447,12 +500,12 @@ HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
/***********************************************************************
* MODULE_LoadExeHeader
*/
static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
IMAGE_DOS_HEADER mz_header;
IMAGE_OS2_HEADER ne_header;
int size;
HMODULE16 hModule;
HMODULE32 hModule;
NE_MODULE *pModule;
BYTE *pData;
char *buffer, *fastload = NULL;
@ -469,18 +522,18 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
_llseek32( hFile, 0, SEEK_SET );
if ((_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
(mz_header.e_magic != IMAGE_DOS_SIGNATURE))
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET );
if (_lread32( hFile, &ne_header, sizeof(ne_header) ) != sizeof(ne_header))
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_NT_SIGNATURE) return (HMODULE16)21; /* win32 exe */
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return (HMODULE16)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_NT_SIGNATURE) return (HMODULE32)21; /* win32 exe */
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return (HMODULE32)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_OS2_SIGNATURE_LX) {
fprintf(stderr, "Sorry, this is an OS/2 linear executable (LX) file !\n");
return (HMODULE16)11;
return (HMODULE32)11;
}
/* We now have a valid NE header */
@ -501,7 +554,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
ne_header.entry_tab_length;
hModule = GlobalAlloc16( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
if (!hModule) return (HMODULE16)11; /* invalid exe */
if (!hModule) return (HMODULE32)11; /* invalid exe */
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
memcpy( pModule, &ne_header, sizeof(ne_header) );
@ -560,7 +613,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
HeapFree( SystemHeap, 0, buffer );
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
pSeg = (struct ne_segment_table_entry_s *)buffer;
for (i = ne_header.n_segment_tab; i > 0; i--, pSeg++)
@ -574,7 +627,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
/* Get the resource table */
@ -584,8 +637,9 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
pModule->res_table = (int)pData - (int)pModule;
if (!READ(mz_header.e_lfanew + ne_header.resource_tab_offset,
ne_header.rname_tab_offset - ne_header.resource_tab_offset,
pData )) return (HMODULE16)11; /* invalid exe */
pData )) return (HMODULE32)11; /* invalid exe */
pData += ne_header.rname_tab_offset - ne_header.resource_tab_offset;
NE_InitResourceHandler( hModule );
}
else pModule->res_table = 0; /* No resource table */
@ -598,7 +652,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
pData += ne_header.moduleref_tab_offset - ne_header.rname_tab_offset;
@ -613,7 +667,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
pData += ne_header.n_mod_ref_tab * sizeof(WORD);
}
@ -628,7 +682,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
pData += ne_header.entry_tab_offset - ne_header.iname_tab_offset;
@ -641,7 +695,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
if (fastload) HeapFree( SystemHeap, 0, fastload );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
pData += ne_header.entry_tab_length;
@ -659,7 +713,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
if (!pModule->nrname_handle)
{
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
buffer = GlobalLock16( pModule->nrname_handle );
_llseek32( hFile, ne_header.nrname_tab_offset, SEEK_SET );
@ -668,7 +722,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
GlobalFree16( pModule->nrname_handle );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
}
else pModule->nrname_handle = 0;
@ -678,13 +732,13 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
if (pModule->modref_count)
{
pModule->dlls_to_init = GLOBAL_Alloc(GMEM_ZEROINIT,
(pModule->modref_count+1)*sizeof(HMODULE16),
(pModule->modref_count+1)*sizeof(HMODULE32),
hModule, FALSE, FALSE, FALSE );
if (!pModule->dlls_to_init)
{
if (pModule->nrname_handle) GlobalFree16( pModule->nrname_handle );
GlobalFree16( hModule );
return (HMODULE16)11; /* invalid exe */
return (HMODULE32)11; /* invalid exe */
}
}
else pModule->dlls_to_init = 0;
@ -699,7 +753,7 @@ static HMODULE16 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
*
* Lookup the ordinal for a given name.
*/
WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name )
WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
{
unsigned char buffer[256], *cpnt;
BYTE len;
@ -763,7 +817,7 @@ WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name )
*
* Return the entry point for a given ordinal.
*/
FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
FARPROC16 MODULE_GetEntryPoint( HMODULE32 hModule, WORD ordinal )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
@ -823,7 +877,7 @@ FARPROC16 WINAPI EntryAddrProc( HMODULE16 hModule, WORD ordinal )
* Change the value of an entry point. Use with caution!
* It can only change the offset value, not the selector.
*/
BOOL16 MODULE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset )
BOOL16 MODULE_SetEntryPoint( HMODULE32 hModule, WORD ordinal, WORD offset )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
@ -872,7 +926,7 @@ FARPROC16 MODULE_GetWndProcEntry16( const char *name )
{
WORD ordinal;
FARPROC16 ret;
static HMODULE16 hModule = 0;
static HMODULE32 hModule = 0;
if (!hModule) hModule = GetModuleHandle16( "WPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
@ -886,7 +940,7 @@ FARPROC16 MODULE_GetWndProcEntry16( const char *name )
/***********************************************************************
* MODULE_GetModuleName
*/
LPSTR MODULE_GetModuleName( HMODULE16 hModule )
LPSTR MODULE_GetModuleName( HMODULE32 hModule )
{
NE_MODULE *pModule;
BYTE *p, len;
@ -916,9 +970,9 @@ void MODULE_RegisterModule( NE_MODULE *pModule )
*
* Find a module from a path name.
*/
HMODULE16 MODULE_FindModule( LPCSTR path )
HMODULE32 MODULE_FindModule( LPCSTR path )
{
HMODULE16 hModule = hFirstModule;
HMODULE32 hModule = hFirstModule;
LPCSTR filename, dotptr, modulepath, modulename;
BYTE len, *name_table;
@ -973,7 +1027,7 @@ static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
*
* Remove a module from memory.
*/
static void MODULE_FreeModule( HMODULE16 hModule )
BOOL16 MODULE_FreeModule( HMODULE32 hModule, TDB* pTaskContext )
{
HMODULE16 *hPrevModule;
NE_MODULE *pModule;
@ -981,17 +1035,28 @@ static void MODULE_FreeModule( HMODULE16 hModule )
HMODULE16 *pModRef;
int i;
if (!(pModule = MODULE_GetPtr( hModule ))) return;
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
hModule = pModule->self;
if (((INT16)(--pModule->count)) > 0 ) return TRUE;
else pModule->count = 0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return; /* Can't free built-in module */
return FALSE; /* Can't free built-in module */
if (pModule->flags & NE_FFLAGS_LIBMODULE) MODULE_CallWEP( hModule );
if (pModule->flags & NE_FFLAGS_LIBMODULE)
{
MODULE_CallWEP( hModule );
/* Free the objects owned by the module */
HOOK_FreeModuleHooks( hModule );
CLASS_FreeModuleClasses( hModule );
/* Free the objects owned by the DLL module */
if( pTaskContext && pTaskContext->userhandler )
{
pTaskContext->userhandler( hModule, USIG_DLL_UNLOAD, 0,
pTaskContext->hInstance,
pTaskContext->hQueue );
}
}
/* Clear magic number just in case */
pModule->magic = pModule->self = 0;
@ -1030,6 +1095,8 @@ static void MODULE_FreeModule( HMODULE16 hModule )
/* Remove module from cache */
if (hCachedModule == hModule) hCachedModule = 0;
return TRUE;
}
@ -1038,7 +1105,7 @@ static void MODULE_FreeModule( HMODULE16 hModule )
*
* Implementation of LoadModule()
*/
HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
{
HMODULE16 hModule;
HINSTANCE16 hInstance, hPrevInstance;
@ -1080,10 +1147,9 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
hModule = MODULE_LoadExeHeader( hFile, &ofs );
if (hModule < 32)
{
/* Note: PE_LoadModule closes the file */
if (hModule == 21)
hModule = PE_LoadModule( hFile, &ofs, paramBlock );
else _lclose32( hFile );
else _lclose32( hFile );
if (hModule < 32)
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
@ -1092,6 +1158,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
}
_lclose32( hFile );
pModule = MODULE_GetPtr( hModule );
pModule->flags |= uFlags; /* stamp implicitly loaded modules */
/* Allocate the segments for this module */
@ -1117,7 +1184,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
/* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, (LPVOID)-1, FALSE )) == 2)
if ((hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT )) == 2)
{
/* file not found */
char *p;
@ -1127,15 +1194,17 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, (LPVOID)-1, FALSE );
hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT );
}
if (hDLL < 32)
{
/* FIXME: cleanup what was done */
fprintf( stderr, "Could not load '%s' required by '%s', error = %d\n",
buffer, name, hDLL );
return 2; /* file not found */
}
*pModRef = GetExePtr( hDLL );
*pModRef = MODULE_HANDLEtoHMODULE16( hDLL );
*pDLLs++ = *pModRef;
}
else /* Increment the reference count of the DLL */
@ -1158,11 +1227,12 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
HMODULE16 hselfload = GetModuleHandle16("WPROCS");
DWORD oldstack;
WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
fprintf (stderr, "Warning: %*.*s is a self-loading module\n"
"Support for self-loading modules is very experimental\n",
*((BYTE*)pModule + pModule->name_table),
*((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1);
dprintf_module(stddeb, "MODULE_Load: %*.*s is a self-loading module!\n",
*((BYTE*)pModule + pModule->name_table),
*((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1);
NE_LoadSegment( hModule, 1 );
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(pSegTable->selector, 0);
@ -1210,7 +1280,8 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
frame32->ecx = 0;
frame32->ebx = 0;
frame32->ebp = 0;
frame32->retaddr = 0;
frame32->restore_addr = 0;
frame32->retaddr = 0;
frame32->codeselector = WINE_CODE_SELECTOR;
/* pTask->esp = (DWORD)frame32; */
}
@ -1242,10 +1313,14 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
pModule->count = 1;
if (first && (pModule->flags & NE_FFLAGS_LIBMODULE))
NE_InitializeDLLs( hModule );
/* Call initialization rountines for all loaded DLLs. Note that
* when we load implicitly linked DLLs this will be done by the InitTask().
*/
if ((pModule->flags & (NE_FFLAGS_LIBMODULE | NE_FFLAGS_IMPLICIT)) ==
NE_FFLAGS_LIBMODULE ) NE_InitializeDLLs( hModule );
}
else
else /* module is already loaded, just create a new data segment if it's a task */
{
pModule = MODULE_GetPtr( hModule );
hPrevInstance = MODULE_GetInstance( hModule );
@ -1254,6 +1329,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
NE_LoadSegment( hModule, pModule->dgroup );
pModule->count++;
}
#else
lstrcpyn32A( ofs.szPathName, name, sizeof(ofs.szPathName) );
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return hModule;
@ -1269,6 +1345,8 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
HTASK16 hTask;
WORD showcmd;
pModule->flags |= NE_FFLAGS_GUI;
/* PowerPoint passes NULL as showCmd */
if (params->showCmd)
showcmd = *((WORD *)PTR_SEG_TO_LIN(params->showCmd)+1);
@ -1292,7 +1370,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
*/
HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
{
return MODULE_Load( name, paramBlock, TRUE );
return MODULE_Load( name, paramBlock, 0 );
}
@ -1303,13 +1381,11 @@ BOOL16 WINAPI FreeModule16( HMODULE16 hModule )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
dprintf_module( stddeb, "FreeModule16: %s count %d\n",
MODULE_GetModuleName(hModule), pModule->count );
if (--pModule->count == 0) MODULE_FreeModule( hModule );
return TRUE;
return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) );
}
@ -1318,7 +1394,7 @@ BOOL16 WINAPI FreeModule16( HMODULE16 hModule )
*/
HMODULE16 WINAPI WIN16_GetModuleHandle( SEGPTR name )
{
if (HIWORD(name) == 0) return GetExePtr( (HINSTANCE16)name );
if (HIWORD(name) == 0) return MODULE_HANDLEtoHMODULE16( (HINSTANCE16)name );
return MODULE_FindModule( PTR_SEG_TO_LIN(name) );
}
@ -1327,6 +1403,33 @@ HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )
return MODULE_FindModule( name );
}
/***********************************************************************
* GetModuleHandle (KERNEL32.237)
*/
HMODULE32 WINAPI GetModuleHandle32A(LPCSTR module)
{
HMODULE32 hModule;
dprintf_win32(stddeb, "GetModuleHandleA: %s\n", module ? module : "NULL");
/* Freecell uses the result of GetModuleHandleA(0) as the hInstance in
all calls to e.g. CreateWindowEx. */
if (module == NULL) {
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
hModule = pTask->hInstance;
} else
hModule = MODULE_FindModule(module);
return MODULE_HANDLEtoHMODULE32(hModule);
}
HMODULE32 WINAPI GetModuleHandle32W(LPCWSTR module)
{
HMODULE32 hModule;
LPSTR modulea = HEAP_strdupWtoA( GetProcessHeap(), 0, module );
hModule = GetModuleHandle32A( modulea );
HeapFree( GetProcessHeap(), 0, modulea );
return hModule;
}
/**********************************************************************
* GetModuleUsage (KERNEL.48)
@ -1335,7 +1438,6 @@ INT16 WINAPI GetModuleUsage( HINSTANCE16 hModule )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
dprintf_module( stddeb, "GetModuleUsage(%04x): returning %d\n",
hModule, pModule->count );
@ -1352,7 +1454,6 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
NE_MODULE *pModule;
if (!hModule) hModule = GetCurrentTask();
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
dprintf_module( stddeb, "GetModuleFileName16: %s\n", lpFileName );
@ -1373,7 +1474,6 @@ DWORD WINAPI GetModuleFileName32A( HMODULE32 hModule, LPSTR lpFileName,
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
hModule = pTask->hInstance;
}
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size );
dprintf_module( stddeb, "GetModuleFileName32A: %s\n", lpFileName );
@ -1410,16 +1510,72 @@ BOOL16 WINAPI GetModuleName( HINSTANCE16 hinst, LPSTR buf, INT16 nSize )
/***********************************************************************
* LoadLibraryEx32W (KERNEL.513)
* FIXME
*/
HINSTANCE16 WINAPI LoadLibraryEx32W16( LPCSTR libname, HANDLE16 hf,
HMODULE32 WINAPI LoadLibraryEx32W16( LPCSTR libname, HANDLE16 hf,
DWORD flags )
{
fprintf(stderr,"LoadLibraryEx32W(%s,%d,%08lx)\n",libname,hf,flags);
if (!flags && !hf)
return LoadLibrary32A(libname);
return 0;
return LoadLibraryEx32A(libname,hf,flags);
}
/***********************************************************************
* LoadLibraryEx32A (KERNEL32)
*/
HMODULE32 WINAPI LoadLibraryEx32A(LPCSTR libname,HFILE32 hfile,DWORD flags)
{
HMODULE32 hmod;
hmod = PE_LoadLibraryEx32A(libname,hfile,flags);
if (hmod <= 32) {
char buffer[256];
strcpy( buffer, libname );
strcat( buffer, ".dll" );
hmod = PE_LoadLibraryEx32A(buffer,hfile,flags);
}
/* initialize all DLLs, which haven't been initialized yet. */
PE_InitializeDLLs( GetCurrentProcessId(), DLL_PROCESS_ATTACH, NULL);
return hmod;
}
/***********************************************************************
* LoadLibraryA (KERNEL32)
*/
HMODULE32 WINAPI LoadLibrary32A(LPCSTR libname) {
return LoadLibraryEx32A(libname,0,0);
}
/***********************************************************************
* LoadLibraryW (KERNEL32)
*/
HMODULE32 WINAPI LoadLibrary32W(LPCWSTR libnameW)
{
return LoadLibraryEx32W(libnameW,0,0);
}
/***********************************************************************
* LoadLibraryExW (KERNEL32)
*/
HMODULE32 WINAPI LoadLibraryEx32W(LPCWSTR libnameW,HFILE32 hfile,DWORD flags)
{
LPSTR libnameA = HEAP_strdupWtoA( GetProcessHeap(), 0, libnameW );
HMODULE32 ret = LoadLibraryEx32A( libnameA , hfile, flags );
HeapFree( GetProcessHeap(), 0, libnameA );
return ret;
}
/***********************************************************************
* FreeLibrary
*/
BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule)
{
fprintf(stderr,"FreeLibrary: empty stub\n");
return TRUE;
}
/***********************************************************************
* LoadLibrary (KERNEL.95)
*/
@ -1434,17 +1590,13 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
}
dprintf_module( stddeb, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
/* This does not increment the module reference count, and will
* therefore cause crashes on FreeLibrary calls.
if ((handle = MODULE_FindModule( libname )) != 0) return handle;
*/
handle = MODULE_Load( libname, (LPVOID)-1, TRUE );
handle = MODULE_Load( libname, (LPVOID)-1, 0 );
if (handle == (HINSTANCE16)2) /* file not found */
{
char buffer[256];
lstrcpyn32A( buffer, libname, 252 );
strcat( buffer, ".dll" );
handle = MODULE_Load( buffer, (LPVOID)-1, TRUE );
handle = MODULE_Load( buffer, (LPVOID)-1, 0 );
}
return handle;
}
@ -1486,7 +1638,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
return 2; /* File not found */
if (!(cmdShowHandle = GlobalAlloc16( 0, 2 * sizeof(WORD) )))
return 8; /* Out of memory */
if (!(cmdLineHandle = GlobalAlloc16( 0, 256 )))
if (!(cmdLineHandle = GlobalAlloc16( 0, 1024 )))
{
GlobalFree16( cmdShowHandle );
return 8; /* Out of memory */
@ -1531,7 +1683,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
}
if (*p)
lstrcpyn32A( cmdline + 1, p + 1, 127 );
lstrcpyn32A( cmdline + 1, p + 1, 1023 );
else
cmdline[1] = '\0';
@ -1645,7 +1797,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
* WIN32_GetProcAddress16 (KERNEL32.36)
* Get procaddress in 16bit module from win32... (kernel32 undoc. ordinal func)
*/
FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE16 hModule, LPSTR name )
FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPSTR name )
{
WORD ordinal;
FARPROC16 ret;
@ -1654,7 +1806,7 @@ FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE16 hModule, LPSTR name )
fprintf(stderr,"WIN32_GetProcAddress16: hModule may not be 0!\n");
return (FARPROC16)0;
}
hModule = GetExePtr(hModule);
hModule = MODULE_HANDLEtoHMODULE16(hModule);
if (HIWORD(name)) {
ordinal = MODULE_GetOrdinal( hModule, name );
dprintf_module( stddeb, "WIN32_GetProcAddress16: %04x '%s'\n",
@ -1679,7 +1831,7 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name )
FARPROC16 ret;
if (!hModule) hModule = GetCurrentTask();
hModule = GetExePtr( hModule );
hModule = MODULE_HANDLEtoHMODULE16( hModule );
if (HIWORD(name) != 0)
{
@ -1714,13 +1866,16 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
dprintf_win32(stddeb,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function);
else
dprintf_win32(stddeb,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
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 );
if (!pModule->pe_module) {
fprintf(stderr,"Oops, Module 0x%08lx has got no pe_module?\n",
(DWORD)MODULE_HANDLEtoHMODULE32(hModule)
);
return (FARPROC32)0;
}
return PE_FindExportedFunction( pModule->pe_module, function );
#else
return NULL;
@ -1732,14 +1887,20 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
*/
LPIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE32 hModule)
{
/* basically:
* return hModule+(((IMAGE_DOS_HEADER*)hModule)->e_lfanew);
* but we could get HMODULE16 or the like (think builtin modules)
*/
#ifndef WINELIB
NE_MODULE *pModule;
hModule = GetExePtr( hModule );
if (!(pModule = MODULE_GetPtr( hModule )))
return (LPIMAGE_NT_HEADERS)0;
if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module)
return (LPIMAGE_NT_HEADERS)0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return (LPIMAGE_NT_HEADERS)0;
return pModule->pe_module->pe_header;
#else
return NULL;
@ -1763,7 +1924,7 @@ WORD WINAPI GetExpWinVer( HMODULE16 hModule )
BOOL16 WINAPI IsSharedSelector( HANDLE16 selector )
{
/* Check whether the selector belongs to a DLL */
NE_MODULE *pModule = MODULE_GetPtr( GetExePtr( selector ));
NE_MODULE *pModule = MODULE_GetPtr( selector );
if (!pModule) return FALSE;
return (pModule->flags & NE_FFLAGS_LIBMODULE) != 0;
}
@ -1815,7 +1976,7 @@ BOOL16 WINAPI ModuleFindName( MODULEENTRY *lpme, LPCSTR name )
*/
BOOL16 WINAPI ModuleFindHandle( MODULEENTRY *lpme, HMODULE16 hModule )
{
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16( hModule );
lpme->wNext = hModule;
return ModuleNext( lpme );
}

View File

@ -17,6 +17,7 @@
#include <errno.h>
#include "neexe.h"
#include "windows.h"
#include "task.h"
#include "arch.h"
#include "selectors.h"
#include "callback.h"
@ -455,7 +456,7 @@ void NE_FixupPrologs( NE_MODULE *pModule )
*
* Call the DLL initialization code
*/
static BOOL32 NE_InitDLL( HMODULE16 hModule )
static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
{
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
@ -473,6 +474,17 @@ static BOOL32 NE_InitDLL( HMODULE16 hModule )
if (!(pModule->flags & NE_FFLAGS_LIBMODULE) ||
(pModule->flags & NE_FFLAGS_WIN32)) return TRUE; /*not a library*/
/* Call USER signal handler. This is necessary to install a
* proper loader for HICON and HCURSOR resources that this DLL
* may contain. InitApp() does this for task modules. */
if (pTask && pTask->userhandler)
{
pTask->userhandler( hModule, USIG_DLL_LOAD, 0, pTask->hInstance,
pTask->hQueue );
}
if (!pModule->cs) return TRUE; /* no initialization code */
memset( &context, 0, sizeof(context) );
@ -516,10 +528,12 @@ static BOOL32 NE_InitDLL( HMODULE16 hModule )
/***********************************************************************
* NE_InitializeDLLs
*
* Initialize the loaded DLLs.
* Recursively initialize all DLLs (according to the order in which
* they where loaded).
*/
void NE_InitializeDLLs( HMODULE16 hModule )
{
TDB* pTask = (TDB*)GlobalLock16(GetCurrentTask());
NE_MODULE *pModule;
HMODULE16 *pDLL;
@ -529,6 +543,7 @@ void NE_InitializeDLLs( HMODULE16 hModule )
/* PE_InitializeDLLs(hModule); */
return;
}
if (pModule->dlls_to_init)
{
HGLOBAL16 to_init = pModule->dlls_to_init;
@ -539,7 +554,7 @@ void NE_InitializeDLLs( HMODULE16 hModule )
}
GlobalFree16( to_init );
}
NE_InitDLL( hModule );
NE_InitDLL( pTask, hModule );
}

View File

@ -3,6 +3,7 @@
*
* Copyright 1993 Robert J. Amstadt
* Copyright 1995 Alexandre Julliard
* 1997 Alex Korobka
*/
#include <stdio.h>
@ -22,6 +23,8 @@
#include "stddebug.h"
#include "debug.h"
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
(pTypeInfo)->count * sizeof(NE_NAMEINFO)))
/***********************************************************************
* NE_FindNameTableId
@ -29,29 +32,26 @@
* Find the type and resource id from their names.
* Return value is MAKELONG( typeId, resId ), or 0 if not found.
*/
static DWORD NE_FindNameTableId( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId )
static DWORD NE_FindNameTableId( NE_MODULE *pModule, SEGPTR typeId, SEGPTR resId )
{
NE_MODULE *pModule;
NE_TYPEINFO *pTypeInfo;
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
NE_NAMEINFO *pNameInfo;
HGLOBAL16 handle;
WORD *p;
DWORD ret = 0;
int count;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
for (; pTypeInfo->type_id != 0;
pTypeInfo = (NE_TYPEINFO *)((char*)(pTypeInfo+1) +
pTypeInfo->count * sizeof(NE_NAMEINFO)))
pTypeInfo = (NE_TYPEINFO *)((char*)(pTypeInfo+1) +
pTypeInfo->count * sizeof(NE_NAMEINFO)))
{
if (pTypeInfo->type_id != 0x800f) continue;
pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1);
for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
{
if (pTypeInfo->type_id != 0x800f) continue;
pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1);
for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
{
dprintf_resource( stddeb, "NameTable entry: type=%04x id=%04x\n",
pTypeInfo->type_id, pNameInfo->id );
handle = LoadResource16( hModule,
handle = LoadResource16( pModule->self,
(HRSRC16)((int)pNameInfo - (int)pModule) );
for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p))
{
@ -89,11 +89,56 @@ static DWORD NE_FindNameTableId( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId
}
FreeResource16( handle );
if (ret) return ret;
}
}
}
return 0;
}
/***********************************************************************
* NE_FindTypeSection
*
* Find header struct for a particular resource type.
*/
static NE_TYPEINFO* NE_FindTypeSection( NE_MODULE *pModule,
NE_TYPEINFO *pTypeInfo, SEGPTR typeId )
{
/* start from pTypeInfo */
if (HIWORD(typeId) != 0) /* Named type */
{
char *str = (char *)PTR_SEG_TO_LIN( typeId );
BYTE len = strlen( str );
while (pTypeInfo->type_id)
{
if (!(pTypeInfo->type_id & 0x8000))
{
BYTE *p = (BYTE*)pModule + pModule->res_table + pTypeInfo->type_id;
if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
{
dprintf_resource( stddeb, " Found type '%s'\n", str );
return pTypeInfo;
}
}
dprintf_resource( stddeb, " Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
else /* Numeric type id */
{
WORD id = LOWORD(typeId) | 0x8000;
while (pTypeInfo->type_id)
{
if (pTypeInfo->type_id == id)
{
dprintf_resource( stddeb, " Found type %04x\n", id );
return pTypeInfo;
}
dprintf_resource( stddeb, " Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
return NULL;
}
/***********************************************************************
* NE_FindResourceFromType
@ -130,6 +175,83 @@ static HRSRC16 NE_FindResourceFromType( NE_MODULE *pModule,
}
/***********************************************************************
* NE_DefResourceHandler
*
* This is the default LoadProc() function.
*/
HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
HRSRC16 hRsrc )
{
int fd;
NE_MODULE* pModule = MODULE_GetPtr( hModule );
if ( pModule && (fd = MODULE_OpenFile( hModule )) >= 0)
{
HGLOBAL16 handle;
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
dprintf_resource( stddeb, "NEResourceHandler: loading, pos=%d, len=%d\n",
(int)pNameInfo->offset << sizeShift,
(int)pNameInfo->length << sizeShift );
if( hMemObj )
handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 );
else
handle = NE_AllocResource( hModule, hRsrc, 0 );
if( handle )
{
lseek( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET );
read( fd, GlobalLock16( handle ), (int)pNameInfo->length << sizeShift );
}
return handle;
}
return (HGLOBAL16)0;
}
/***********************************************************************
* NE_InitResourceHandler
*
* Fill in 'resloader' fields in the resource table.
*/
BOOL32 NE_InitResourceHandler( HMODULE16 hModule )
{
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
dprintf_resource(stddeb,"InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
pTypeInfo->resloader = (DWORD)&NE_DefResourceHandler;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
return TRUE;
}
/***********************************************************************
* NE_SetResourceHandler
*/
FARPROC32 NE_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId,
FARPROC32 resourceHandler )
{
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
FARPROC32 prevHandler = NULL;
do
{
pTypeInfo = NE_FindTypeSection( pModule, pTypeInfo, typeId );
if( pTypeInfo )
{
prevHandler = (FARPROC32)pTypeInfo->resloader;
pTypeInfo->resloader = (DWORD)resourceHandler;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
} while( pTypeInfo );
return prevHandler;
}
/***********************************************************************
* NE_FindResource
*/
@ -142,10 +264,12 @@ HRSRC16 NE_FindResource( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId )
if (!pModule || !pModule->res_table) return 0;
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
if (HIWORD(typeId) || HIWORD(resId))
if ((pModule->expected_version < 0x030a) && (HIWORD(typeId) || HIWORD(resId)))
{
/* Search the names in the nametable */
DWORD id = NE_FindNameTableId( hModule, typeId, resId );
/* Search the names in the nametable (which is not present
* since Windows 3.1). */
DWORD id = NE_FindNameTableId( pModule, typeId, resId );
if (id) /* found */
{
typeId = LOWORD(id);
@ -153,60 +277,27 @@ HRSRC16 NE_FindResource( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId )
}
}
if (HIWORD(typeId) != 0) /* Named type */
do
{
char *str = (char *)PTR_SEG_TO_LIN( typeId );
BYTE len = strlen( str );
while (pTypeInfo->type_id)
{
if (!(pTypeInfo->type_id & 0x8000))
{
BYTE *p = (BYTE*)pModule+pModule->res_table+pTypeInfo->type_id;
if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
{
dprintf_resource( stddeb, " Found type '%s'\n", str );
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
if (hRsrc)
{
dprintf_resource( stddeb, " Found id %08lx\n", resId );
return hRsrc;
}
dprintf_resource( stddeb, " Not found, going on\n" );
}
}
dprintf_resource( stddeb, " Skipping type %04x\n",
pTypeInfo->type_id );
pTypeInfo = (NE_TYPEINFO *)((char*)(pTypeInfo+1) +
pTypeInfo->count * sizeof(NE_NAMEINFO));
}
}
else /* Numeric type id */
{
WORD id = LOWORD(typeId) | 0x8000;
while (pTypeInfo->type_id)
{
if (pTypeInfo->type_id == id)
{
dprintf_resource( stddeb, " Found type %04x\n", id );
hRsrc = NE_FindResourceFromType( pModule, pTypeInfo, resId );
if (hRsrc)
{
dprintf_resource( stddeb, " Found id %08lx\n", resId );
return hRsrc;
}
dprintf_resource( stddeb, " Not found, going on\n" );
}
dprintf_resource( stddeb, " Skipping type %04x\n",
pTypeInfo->type_id );
pTypeInfo = (NE_TYPEINFO *)((char*)(pTypeInfo+1) +
pTypeInfo->count * sizeof(NE_NAMEINFO));
}
}
pTypeInfo = NE_FindTypeSection( pModule, pTypeInfo, typeId );
if( pTypeInfo )
{
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
if( hRsrc )
{
dprintf_resource( stddeb, " Found id %08lx\n", resId );
return hRsrc;
}
dprintf_resource( stddeb, " Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
} while( pTypeInfo );
dprintf_resource( stddeb, "failed!\n");
return 0;
}
/***********************************************************************
* NE_AllocResource
*/
@ -273,33 +364,67 @@ DWORD NE_SizeofResource( HMODULE16 hModule, HRSRC16 hRsrc )
*/
HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
int fd;
NE_TYPEINFO *pTypeInfo;
NE_NAMEINFO *pNameInfo = NULL;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
if (!pModule || !pModule->res_table) return 0;
int d;
if (!hRsrc || !pModule || !pModule->res_table) return 0;
/* First, verify hRsrc (just an offset from pModule to the needed pNameInfo) */
d = pModule->res_table + 2;
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + d);
#ifndef WINELIB
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
#endif
if (pNameInfo->handle)
while( hRsrc > d )
{
pNameInfo->usage++;
dprintf_resource( stddeb, " Already loaded, new count=%d\n",
pNameInfo->usage );
return pNameInfo->handle;
if (pTypeInfo->type_id == 0)
break; /* terminal entry */
d += sizeof(NE_TYPEINFO) + pTypeInfo->count * sizeof(NE_NAMEINFO);
if (hRsrc < d)
{
if( ((d - hRsrc)%sizeof(NE_NAMEINFO)) == 0 )
{
pNameInfo = (NE_NAMEINFO *)(((char *)pModule) + hRsrc);
break;
}
else
break; /* NE_NAMEINFO boundary mismatch */
}
pTypeInfo = (NE_TYPEINFO *)(((char *)pModule) + d);
}
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
dprintf_resource( stddeb, " Loading, pos=%d, len=%d\n",
(int)pNameInfo->offset << sizeShift,
(int)pNameInfo->length << sizeShift );
if ((fd = MODULE_OpenFile( hModule )) == -1) return 0;
pNameInfo->handle = NE_AllocResource( hModule, hRsrc, 0 );
pNameInfo->usage = 1;
lseek( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET );
read( fd, GlobalLock16( pNameInfo->handle ),
(int)pNameInfo->length << sizeShift );
return pNameInfo->handle;
#endif
if (pNameInfo)
{
RESOURCEHANDLER16 __r16loader;
if (pNameInfo->handle
&& !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
{
pNameInfo->usage++;
dprintf_resource( stddeb, " Already loaded, new count=%d\n",
pNameInfo->usage );
}
else
{
if (pTypeInfo->resloader)
__r16loader = (RESOURCEHANDLER16)pTypeInfo->resloader;
else /* this is really bad */
{
fprintf( stderr, "[%04x]: Missing resource handler!!!...\n", hModule);
__r16loader = NE_DefResourceHandler;
}
/* Finally call resource loader */
if ((pNameInfo->handle = __r16loader(pNameInfo->handle, hModule, hRsrc)))
{
pNameInfo->usage++;
pNameInfo->flags |= NE_SEGFLAGS_LOADED;
}
}
return pNameInfo->handle;
}
return 0;
}
@ -324,7 +449,7 @@ BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle )
WORD count;
NE_MODULE *pModule = MODULE_GetPtr( hModule );
if (!pModule || !pModule->res_table) return handle;
if (!handle || !pModule || !pModule->res_table) return handle;
pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
while (pTypeInfo->type_id)
{
@ -345,7 +470,10 @@ BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle )
}
pTypeInfo = (NE_TYPEINFO *)pNameInfo;
}
fprintf( stderr, "NE_FreeResource: %04x %04x not found!\n", hModule, handle );
dprintf_resource(stddeb, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n",
hModule, handle );
GlobalFree16( handle ); /* it could have been DirectResAlloc()'ed */
return handle;
}
#endif /* WINELIB */

View File

@ -17,11 +17,14 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include "windows.h"
#include "winbase.h"
#include "callback.h"
#include "neexe.h"
#include "peexe.h"
#include "process.h"
#include "pe_image.h"
#include "module.h"
#include "global.h"
@ -33,8 +36,7 @@
#include "debugger.h"
#include "xmalloc.h"
static void PE_InitDLL(HMODULE16 hModule, DWORD type, LPVOID lpReserved);
static void PE_InitDLL(PE_MODREF* modref, DWORD type, LPVOID lpReserved);
/* convert PE image VirtualAddress to Real Address */
#define RVA(x) ((unsigned int)load_addr+(unsigned int)(x))
@ -91,25 +93,40 @@ void dump_exports(IMAGE_EXPORT_DIRECTORY * pe_exports, unsigned int load_addr)
*/
FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
{
IMAGE_EXPORT_DIRECTORY * exports = pe->pe_export;
unsigned load_addr = pe->load_addr;
u_short * ordinal;
u_long * function;
u_char ** name, *ename;
int i;
IMAGE_EXPORT_DIRECTORY *exports;
unsigned load_addr;
u_short * ordinal;
u_long * function;
u_char ** name, *ename;
int i;
PDB32 *process=(PDB32*)GetCurrentProcessId();
PE_MODREF *pem;
pem = process->modref_list;
while (pem && (pem->pe_module != pe))
pem=pem->next;
if (!pem) {
fprintf(stderr,"No MODREF found for PE_MODULE %p in process %p\n",pe,process);
return NULL;
}
load_addr = pem->load_addr;
exports = pem->pe_export;
if (HIWORD(funcName))
dprintf_win32(stddeb,"PE_FindExportedFunction(%s)\n",funcName);
else
dprintf_win32(stddeb,"PE_FindExportedFunction(%d)\n",(int)funcName);
if (!exports)
if (!exports) {
fprintf(stderr,"Module %p/MODREF %p doesn't have a exports table.\n",pe,pem);
return NULL;
ordinal=(u_short*) RVA(exports->AddressOfNameOrdinals);
function=(u_long*) RVA(exports->AddressOfFunctions);
name=(u_char **) RVA(exports->AddressOfNames);
}
ordinal = (u_short*) RVA(exports->AddressOfNameOrdinals);
function= (u_long*) RVA(exports->AddressOfFunctions);
name = (u_char **) RVA(exports->AddressOfNames);
if (HIWORD(funcName)) {
for(i=0; i<exports->NumberOfNames; i++) {
ename=(char*) RVA(*name);
ename=(char*)RVA(*name);
if(!strcmp(ename,funcName))
return (FARPROC32) RVA(function[*ordinal]);
ordinal++;
@ -127,18 +144,17 @@ FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
}
void
fixup_imports (struct pe_data *pe, HMODULE16 hModule)
fixup_imports (PDB32 *process,PE_MODREF *pem)
{
IMAGE_IMPORT_DESCRIPTOR *pe_imp;
int fixup_failed = 0;
unsigned int load_addr = pe->load_addr;
int i;
NE_MODULE *ne_mod;
HMODULE16 *mod_ptr;
char *modname;
PE_MODULE *pe = pem->pe_module;
IMAGE_IMPORT_DESCRIPTOR *pe_imp;
int fixup_failed = 0;
unsigned int load_addr = pem->load_addr;
int i;
char *modname;
if (pe->pe_export)
modname = (char*) RVA(pe->pe_export->Name);
if (pem->pe_export)
modname = (char*) RVA(pem->pe_export->Name);
else
modname = "<unknown>";
@ -146,40 +162,77 @@ fixup_imports (struct pe_data *pe, HMODULE16 hModule)
dprintf_win32 (stddeb, "\nDumping imports list\n");
/* first, count the number of imported non-internal modules */
pe_imp = pe->pe_import;
pe_imp = pem->pe_import;
if (!pe_imp)
fprintf(stderr,"no import directory????\n");
/* FIXME: should terminate on 0 Characteristics */
for (i = 0; pe_imp->Name; pe_imp++)
i++;
/* Now, allocate memory for dlls_to_init */
ne_mod = GlobalLock16 (hModule);
ne_mod->dlls_to_init = GLOBAL_Alloc(GMEM_ZEROINIT, (i+1)*sizeof(HMODULE16),
hModule, FALSE, FALSE, FALSE);
mod_ptr = GlobalLock16 (ne_mod->dlls_to_init);
/* load the modules and put their handles into the list */
/* load the imported modules. They are automatically
* added to the modref list of the process.
*/
/* FIXME: should terminate on 0 Characteristics */
for (i = 0, pe_imp = pe->pe_import; pe_imp->Name; pe_imp++) {
/* FIXME: should terminate on 0 Characteristics */
for (i = 0, pe_imp = pem->pe_import; pe_imp->Name; pe_imp++) {
HMODULE32 res;
PE_MODREF *xpem,**ypem;
char *name = (char *) RVA(pe_imp->Name);
mod_ptr[i] = MODULE_Load( name, (LPVOID)-1, FALSE );
if (mod_ptr[i] <= (HMODULE16) 32) {
/* don't use MODULE_Load, Win32 creates new task differently */
res = PE_LoadLibraryEx32A( name, 0, 0 );
if (res <= (HMODULE32) 32) {
char *p, buffer[256];
/* Try with prepending the path of the current module */
GetModuleFileName16 (hModule, buffer, sizeof (buffer));
GetModuleFileName32A (pe->mappeddll, buffer, sizeof (buffer));
if (!(p = strrchr (buffer, '\\')))
p = buffer;
strcpy (p + 1, name);
mod_ptr[i] = MODULE_Load( buffer, (LPVOID)-1, FALSE );
res = PE_LoadLibraryEx32A( buffer, 0, 0 );
}
if (mod_ptr[i] <= (HMODULE16) 32) {
if (res <= (HMODULE32) 32) {
fprintf (stderr, "Module %s not found\n", name);
exit (0);
}
res = MODULE_HANDLEtoHMODULE32(res);
xpem = pem->next;
while (xpem) {
if (xpem->pe_module->mappeddll == res)
break;
xpem = xpem->next;
}
if (xpem) {
/* it has been loaded *BEFORE* us, so we have to init
* it before us. we just swap the two modules which should
* work.
*/
/* unlink xpem from chain */
ypem = &(process->modref_list);
while (*ypem) {
if ((*ypem)==xpem)
break;
ypem = &((*ypem)->next);
}
*ypem = xpem->next;
/* link it directly before pem */
ypem = &(process->modref_list);
while (*ypem) {
if ((*ypem)==pem)
break;
ypem = &((*ypem)->next);
}
*ypem = xpem;
xpem->next = pem;
}
i++;
}
pe_imp = pe->pe_import;
pe_imp = pem->pe_import;
while (pe_imp->Name) {
char *Module;
IMAGE_IMPORT_BY_NAME *pe_name;
@ -269,9 +322,9 @@ fixup_imports (struct pe_data *pe, HMODULE16 hModule)
if (fixup_failed) exit(1);
}
static void calc_vma_size(struct pe_data *pe)
static int calc_vma_size(struct pe_data *pe)
{
int i;
int i,vma_size = 0;
dprintf_win32(stddeb, "Dump of segment table\n");
dprintf_win32(stddeb, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
@ -288,19 +341,21 @@ static void calc_vma_size(struct pe_data *pe)
pe->pe_seg[i].NumberOfRelocations,
pe->pe_seg[i].NumberOfLinenumbers,
pe->pe_seg[i].Characteristics);
pe->vma_size = MAX(pe->vma_size,
vma_size = MAX(vma_size,
pe->pe_seg[i].VirtualAddress +
pe->pe_seg[i].SizeOfRawData);
}
return vma_size;
}
static void do_relocations(struct pe_data *pe)
static void do_relocations(PE_MODREF *pem)
{
int delta = pe->load_addr - pe->base_addr;
unsigned int load_addr = pe->load_addr;
IMAGE_BASE_RELOCATION *r = pe->pe_reloc;
int hdelta = (delta >> 16) & 0xFFFF;
int ldelta = delta & 0xFFFF;
int delta = pem->load_addr - pem->pe_module->pe_header->OptionalHeader.ImageBase;
unsigned int load_addr= pem->load_addr;
IMAGE_BASE_RELOCATION *r = pem->pe_reloc;
int hdelta = (delta >> 16) & 0xFFFF;
int ldelta = delta & 0xFFFF;
/* int reloc_size = */
@ -360,27 +415,47 @@ static void do_relocations(struct pe_data *pe)
/**********************************************************************
* PE_LoadImage
* Load one PE format executable into memory
* Load one PE format DLL/EXE into memory
*
* Unluckily we can't just mmap the sections where we want them, for
* (at least) Linux does only support offset with are multiples of the
* underlying filesystemblocksize, but PE DLLs usually have alignments of 512
* byte. This fails for instance when you try to map from CDROM (bsize 2048).
*
* BUT we have to map the whole image anyway, for Win32 programs sometimes
* want to access them. (HMODULE32 point to the start of it)
*/
static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WORD offset, OFSTRUCT *ofs )
static PE_MODULE *PE_LoadImage( int fd )
{
struct pe_data *pe;
int i, result;
int load_addr;
IMAGE_DATA_DIRECTORY dir;
char buffer[200];
DBG_ADDR daddr;
char *modname;
struct stat stbuf;
daddr.seg=0;
daddr.type = NULL;
if (-1==fstat(fd,&stbuf)) {
perror("PE_LoadImage:fstat");
return NULL;
}
pe = xmalloc(sizeof(struct pe_data));
memset(pe,0,sizeof(struct pe_data));
pe->pe_header = xmalloc(sizeof(IMAGE_NT_HEADERS));
/* read PE header */
lseek( fd, offset, SEEK_SET);
read( fd, pe->pe_header, sizeof(IMAGE_NT_HEADERS));
/* map the PE image somewhere */
pe->mappeddll = (HMODULE32)mmap(NULL,stbuf.st_size,PROT_READ,MAP_SHARED,fd,0);
if (!pe->mappeddll || pe->mappeddll==-1) {
perror("PE_LoadImage:mmap");
free(pe);
return NULL;
}
/* link PE header */
pe->pe_header = (IMAGE_NT_HEADERS*)(pe->mappeddll+(((IMAGE_DOS_HEADER*)pe->mappeddll)->e_lfanew));
if (pe->pe_header->Signature!=IMAGE_NT_SIGNATURE) {
fprintf(stderr,"image doesn't have PE signature, but 0x%08lx\n",
pe->pe_header->Signature
);
free(pe);
return NULL;
}
if (pe->pe_header->FileHeader.Machine != IMAGE_FILE_MACHINE_I386) {
fprintf(stderr,"trying to load PE image for unsupported architecture (");
@ -403,48 +478,66 @@ static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WO
fprintf(stderr,"Unknown-%04x",pe->pe_header->FileHeader.Machine);break;
}
fprintf(stderr,")\n");
return;
return NULL;
}
/* FIXME: this is a *horrible* hack to make COMDLG32.DLL load OK. The
* problem needs to be fixed properly at some stage
pe->pe_seg = (IMAGE_SECTION_HEADER*)(((LPBYTE)(pe->pe_header+1))-
(16 - pe->pe_header->OptionalHeader.NumberOfRvaAndSizes) * sizeof(IMAGE_DATA_DIRECTORY));
/* FIXME: the (16-...) is a *horrible* hack to make COMDLG32.DLL load OK. The
* problem needs to be fixed properly at some stage.
*/
if (pe->pe_header->OptionalHeader.NumberOfRvaAndSizes != 16) {
printf("Short PE Header!!!\n");
lseek( fd, -(16 - pe->pe_header->OptionalHeader.NumberOfRvaAndSizes) * sizeof(IMAGE_DATA_DIRECTORY), SEEK_CUR);
return pe;
}
/**********************************************************************
* This maps a loaded PE dll into the address space of the specified process.
*/
void
PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
PE_MODREF *pem;
int i, result;
int load_addr;
IMAGE_DATA_DIRECTORY dir;
char buffer[200];
DBG_ADDR daddr;
char *modname;
int vma_size;
pem = (PE_MODREF*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*pem));
/* NOTE: fixup_imports takes care of the correct order */
pem->next = process->modref_list;
process->modref_list = pem;
pem->pe_module = pe;
if (!(pe->pe_header->FileHeader.Characteristics & IMAGE_FILE_DLL)) {
if (process->exe_modref)
fprintf(stderr,"overwriting old exe_modref... arrgh\n");
process->exe_modref = pem;
}
/* read sections */
pe->pe_seg = xmalloc(sizeof(IMAGE_SECTION_HEADER) *
pe->pe_header->FileHeader.NumberOfSections);
read( fd, pe->pe_seg, sizeof(IMAGE_SECTION_HEADER) *
pe->pe_header->FileHeader.NumberOfSections);
load_addr = pe->pe_header->OptionalHeader.ImageBase;
pe->base_addr=load_addr;
pe->vma_size=0;
load_addr = pe->pe_header->OptionalHeader.ImageBase;
dprintf_win32(stddeb, "Load addr is %x\n",load_addr);
calc_vma_size(pe);
load_addr = (int) VirtualAlloc( (void*)pe->base_addr, pe->vma_size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE );
pe->load_addr = load_addr;
vma_size = calc_vma_size(pe);
load_addr = (int) VirtualAlloc( (void*)load_addr, vma_size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE );
pem->load_addr = load_addr;
dprintf_win32(stddeb, "Load addr is really %x, range %x\n",
pe->load_addr, pe->vma_size);
dprintf_win32(stddeb, "Load addr is really %lx, range %x\n",
pem->load_addr, vma_size);
for(i=0; i < pe->pe_header->FileHeader.NumberOfSections; i++)
{
/* load only non-BSS segments */
if(!(pe->pe_seg[i].Characteristics &
IMAGE_SCN_CNT_UNINITIALIZED_DATA))
{
if(lseek(fd,pe->pe_seg[i].PointerToRawData,SEEK_SET) == -1
|| read(fd,(char*)RVA(pe->pe_seg[i].VirtualAddress),
pe->pe_seg[i].SizeOfRawData) != pe->pe_seg[i].SizeOfRawData)
{
fprintf(stderr,"Failed to load section %x\n", i);
exit(0);
}
}
/* memcpy only non-BSS segments */
/* FIXME: this should be done by mmap(..MAP_PRIVATE|MAP_FIXED..)
* but it is not possible for (at least) Linux needs an offset
* aligned to a block on the filesystem.
*/
if(!(pe->pe_seg[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
memcpy((char*)RVA(pe->pe_seg[i].VirtualAddress),
(char*)(pe->mappeddll+pe->pe_seg[i].PointerToRawData),
pe->pe_seg[i].SizeOfRawData
);
result = RVA (pe->pe_seg[i].VirtualAddress);
#if 1
/* not needed, memory is zero */
@ -456,16 +549,16 @@ static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WO
#endif
if(strcmp(pe->pe_seg[i].Name, ".idata") == 0)
pe->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) result;
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) result;
if(strcmp(pe->pe_seg[i].Name, ".edata") == 0)
pe->pe_export = (LPIMAGE_EXPORT_DIRECTORY) result;
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) result;
if(strcmp(pe->pe_seg[i].Name, ".rsrc") == 0)
pe->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) result;
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) result;
if(strcmp(pe->pe_seg[i].Name, ".reloc") == 0)
pe->pe_reloc = (LPIMAGE_BASE_RELOCATION) result;
pem->pe_reloc = (LPIMAGE_BASE_RELOCATION) result;
}
/* There is word that the actual loader does not care about the
@ -473,26 +566,26 @@ static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WO
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
if(dir.Size)
{
if(pe->pe_export && (int)pe->pe_export!=RVA(dir.VirtualAddress))
if(pem->pe_export && (int)pem->pe_export!=RVA(dir.VirtualAddress))
fprintf(stderr,"wrong export directory??\n");
/* always trust the directory */
pe->pe_export = (LPIMAGE_EXPORT_DIRECTORY) RVA(dir.VirtualAddress);
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) RVA(dir.VirtualAddress);
}
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
if(dir.Size)
{
if(pe->pe_import && (int)pe->pe_import!=RVA(dir.VirtualAddress))
if(pem->pe_import && (int)pem->pe_import!=RVA(dir.VirtualAddress))
fprintf(stderr,"wrong import directory??\n");
pe->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) RVA(dir.VirtualAddress);
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) RVA(dir.VirtualAddress);
}
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
if(dir.Size)
{
if(pe->pe_resource && (int)pe->pe_resource!=RVA(dir.VirtualAddress))
if(pem->pe_resource && (int)pem->pe_resource!=RVA(dir.VirtualAddress))
fprintf(stderr,"wrong resource directory??\n");
pe->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) RVA(dir.VirtualAddress);
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) RVA(dir.VirtualAddress);
}
if(pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
@ -506,15 +599,15 @@ static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WO
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
if(dir.Size)
{
if(pe->pe_reloc && (int)pe->pe_reloc!= RVA(dir.VirtualAddress))
if(pem->pe_reloc && (int)pem->pe_reloc!= RVA(dir.VirtualAddress))
fprintf(stderr,"wrong relocation list??\n");
pe->pe_reloc = (void *) RVA(dir.VirtualAddress);
pem->pe_reloc = (void *) RVA(dir.VirtualAddress);
}
if(pe->pe_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_DEBUG].Size)
{
DEBUG_RegisterDebugInfo(fd, pe, load_addr,
DEBUG_RegisterDebugInfo(pe, load_addr,
pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress,
pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].Size);
}
@ -549,18 +642,12 @@ static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WO
if(pe->pe_header->OptionalHeader.DataDirectory[15].Size)
dprintf_win32(stdnimp,"Unknown directory 15 ignored\n");
if(pe->pe_reloc) do_relocations(pe);
/* Do exports before imports because fixup_imports
* may load a module that references this module.
*/
if(pe->pe_export) dump_exports(pe->pe_export,load_addr);
*ret_pe = pe; /* make export list available for GetProcAddress */
if(pe->pe_import) fixup_imports(pe, hModule);
if(pem->pe_reloc) do_relocations(pem);
if(pem->pe_export) dump_exports(pem->pe_export,load_addr);
if(pem->pe_import) fixup_imports(process,pem);
if (pe->pe_export)
modname = (char*)RVA(pe->pe_export->Name);
if (pem->pe_export)
modname = (char*)RVA(pem->pe_export->Name);
else {
char *s;
modname = s = ofs->szPathName;
@ -587,31 +674,70 @@ static void PE_LoadImage( struct pe_data **ret_pe, int fd, HMODULE16 hModule, WO
HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params);
/******************************************************************************
* The PE Library Loader frontend.
* FIXME: handle the flags.
*/
HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
OFSTRUCT ofs;
HMODULE32 hModule;
NE_MODULE *pModule;
if ((hModule = MODULE_FindModule( name )))
return hModule;
/* try to load builtin, enabled modules first */
if ((hModule = BUILTIN_LoadModule( name, FALSE )))
return hModule;
/* try to open the specified file */
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
/* Now try the built-in even if disabled */
if ((hModule = BUILTIN_LoadModule( name, TRUE ))) {
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return hModule;
}
return 1;
}
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) {
_lclose32(hFile);
return hModule;
}
pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32;
/* FIXME: check if pe image loaded already ... */
pModule->pe_module = PE_LoadImage( FILE_GetUnixHandle(hFile) );
_lclose32(hFile);
if (!pModule->pe_module)
return 21;
/* recurse */
PE_MapImage(pModule->pe_module,(PDB32*)GetCurrentProcessId(),&ofs,flags);
return pModule->pe_module->mappeddll;
}
/*****************************************************************************
* Load the PE main .EXE. All other loading is done by PE_LoadLibraryEx32A
* FIXME: this function should use PE_LoadLibraryEx32A, but currently can't
* due to the TASK_CreateTask stuff.
*/
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
{
HMODULE16 hModule;
HINSTANCE16 hInstance;
NE_MODULE *pModule;
IMAGE_DOS_HEADER mz_header;
int fd;
if ((hModule = MODULE_CreateDummyModule( ofs )) < 32) return hModule;
pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32;
/* FIXME: Hack because PE_LoadModule is recursive */
fd = dup( FILE_GetUnixHandle(hFile) );
_lclose32( hFile );
lseek( fd, 0, SEEK_SET );
read( fd, &mz_header, sizeof(mz_header) );
PE_LoadImage( &pModule->pe_module, fd, hModule, mz_header.e_lfanew, ofs );
pModule->pe_module = PE_LoadImage( FILE_GetUnixHandle(hFile) );
_lclose32(hFile);
if (!pModule->pe_module)
return 21;
close( fd );
hInstance = MODULE_CreateInstance( hModule, params );
if (!(pModule->pe_module->pe_header->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
TASK_CreateTask( hModule, hInstance, 0,
@ -619,10 +745,11 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
*((WORD*)PTR_SEG_TO_LIN(params->showCmd) + 1) );
}
PE_MapImage(pModule->pe_module,(PDB32*)GetCurrentProcessId(),ofs,0);
return hInstance;
}
int PE_UnloadImage( HMODULE16 hModule )
int PE_UnloadImage( HMODULE32 hModule )
{
printf("PEunloadImage() called!\n");
/* free resources, image, unmap */
@ -634,19 +761,13 @@ int PE_UnloadImage( HMODULE16 hModule )
* DLL_PROCESS_ATTACH. Only new created threads do DLL_THREAD_ATTACH
* (SDK)
*/
static void PE_InitDLL(HMODULE16 hModule, DWORD type,LPVOID lpReserved)
static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
{
NE_MODULE *pModule;
PE_MODULE *pe;
unsigned int load_addr;
hModule = GetExePtr(hModule);
if (!(pModule = MODULE_GetPtr(hModule))) return;
if (!(pModule->flags & NE_FFLAGS_WIN32) || !(pe = pModule->pe_module))
return;
load_addr = pe->load_addr;
PE_MODULE *pe = pem->pe_module;
unsigned int load_addr = pem->load_addr;
if (type==DLL_PROCESS_ATTACH)
pem->flags |= PE_MODREF_PROCESS_ATTACHED;
#ifndef WINELIB
if (Options.debug) {
DBG_ADDR addr = { NULL, 0, RVA(pe->pe_header->OptionalHeader.AddressOfEntryPoint) };
@ -666,58 +787,81 @@ static void PE_InitDLL(HMODULE16 hModule, DWORD type,LPVOID lpReserved)
if ( (pe->pe_header->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
(pe->pe_header->OptionalHeader.AddressOfEntryPoint)
) {
printf("InitPEDLL() called!\n");
CallDLLEntryProc32(
(FARPROC32)RVA(pe->pe_header->OptionalHeader.AddressOfEntryPoint),
hModule,
type,
(DWORD)lpReserved
);
FARPROC32 entry = (FARPROC32)RVA(pe->pe_header->OptionalHeader.AddressOfEntryPoint);
dprintf_relay( stddeb, "CallTo32(entryproc=%p,module=%d,type=%ld,res=%p)\n",
entry, pe->mappeddll, type, lpReserved );
entry( pe->mappeddll, type, lpReserved );
}
}
void PE_InitializeDLLs(HMODULE16 hModule,DWORD type,LPVOID lpReserved)
{
NE_MODULE *pModule;
HMODULE16 *pDLL;
pModule = MODULE_GetPtr( GetExePtr(hModule) );
if (pModule->dlls_to_init)
{
HGLOBAL16 to_init = pModule->dlls_to_init;
pModule->dlls_to_init = 0;
for (pDLL = (HMODULE16 *)GlobalLock16( to_init ); *pDLL; pDLL++)
{
PE_InitializeDLLs( *pDLL, type, lpReserved);
/* Call the DLLentry function of all dlls used by that process.
* (NOTE: this may recursively call this function (if a library calls
* LoadLibrary) ... but it won't matter)
*/
void PE_InitializeDLLs(PDB32 *process,DWORD type,LPVOID lpReserved) {
PE_MODREF *pem;
pem = process->modref_list;
while (pem) {
if (pem->flags & PE_MODREF_NO_DLL_CALLS) {
pem = pem->next;
continue;
}
GlobalFree16( to_init );
if (type==DLL_PROCESS_ATTACH) {
if (pem->flags & PE_MODREF_PROCESS_ATTACHED) {
pem = pem->next;
continue;
}
}
PE_InitDLL( pem, type, lpReserved );
pem = pem->next;
}
PE_InitDLL( hModule, type, lpReserved );
}
void PE_InitTls( PE_MODULE *module )
void PE_InitTls(PDB32 *pdb)
{
/* FIXME: tls callbacks ??? */
DWORD index;
DWORD datasize;
DWORD size;
LPVOID mem;
LPIMAGE_TLS_DIRECTORY pdir;
/* FIXME: tls callbacks ??? */
PE_MODREF *pem;
IMAGE_NT_HEADERS *peh;
DWORD size,datasize,index;
LPVOID mem;
LPIMAGE_TLS_DIRECTORY pdir;
if (!module->pe_header->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress)
return;
pem = pdb->modref_list;
while (pem) {
peh = pem->pe_module->pe_header;
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress) {
pem = pem->next;
continue;
}
pdir = (LPVOID)(pem->load_addr + peh->OptionalHeader.
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);
index = TlsAlloc();
datasize= pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
size = datasize + pdir->SizeOfZeroFill;
mem=VirtualAlloc(0,size,MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE);
memcpy(mem,(LPVOID) pdir->StartAddressOfRawData, datasize);
TlsSetValue(index,mem);
*(pdir->AddressOfIndex)=index;
pem=pem->next;
}
}
pdir = (LPVOID)(module->load_addr + module->pe_header->OptionalHeader.
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);
index = TlsAlloc();
datasize = pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
size = datasize + pdir->SizeOfZeroFill;
mem = VirtualAlloc(0,size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE );
memcpy(mem,(LPVOID) pdir->StartAddressOfRawData, datasize);
TlsSetValue(index,mem);
*(pdir->AddressOfIndex)=index;
/****************************************************************************
* DisableThreadLibraryCalls (KERNEL32.74)
* Don't call DllEntryPoint for DLL_THREAD_{ATTACH,DETACH} if set.
*/
BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32 hModule)
{
PDB32 *process = (PDB32*)GetCurrentProcessId();
PE_MODREF *pem = process->modref_list;
while (pem) {
if (pem->pe_module->mappeddll == hModule)
pem->flags|=PE_MODREF_NO_DLL_CALLS;
pem = pem->next;
}
return TRUE;
}
#endif /* WINELIB */

View File

@ -18,6 +18,8 @@
#include "pe_image.h"
#include "module.h"
#include "heap.h"
#include "task.h"
#include "process.h"
#include "libres.h"
#include "stackframe.h"
#include "neexe.h"
@ -25,20 +27,24 @@
#include "debug.h"
/**********************************************************************
* HMODULE32toPE_MODULE
* HMODULE32toPE_MODREF
*
* small helper function to get a PE_MODULE from a passed HMODULE32
* small helper function to get a PE_MODREF from a passed HMODULE32
*/
static PE_MODULE*
HMODULE32toPE_MODULE(HMODULE32 hmod) {
static PE_MODREF*
HMODULE32toPE_MODREF(HMODULE32 hmod) {
NE_MODULE *pModule;
PDB32 *pdb = (PDB32*)GetCurrentProcessId();
PE_MODREF *pem;
if (!hmod) hmod = GetTaskDS(); /* FIXME: correct? */
hmod = GetExePtr( hmod ); /* In case we were passed an hInstance */
hmod = MODULE_HANDLEtoHMODULE32( hmod );
if (!hmod) return NULL;
if (!(pModule = MODULE_GetPtr( hmod ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0;
return pModule->pe_module;
pem = pdb->modref_list;
while (pem && pem->pe_module->mappeddll != hmod)
pem=pem->next;
return pem;
}
/**********************************************************************
@ -106,12 +112,12 @@ HANDLE32 PE_FindResourceEx32W(
LPIMAGE_RESOURCE_DIRECTORY resdirptr;
DWORD root;
HANDLE32 result;
PE_MODULE *pe = HMODULE32toPE_MODULE(hModule);
PE_MODREF *pem = HMODULE32toPE_MODREF(hModule);
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return 0;
resdirptr = pe->pe_resource;
resdirptr = pem->pe_resource;
root = (DWORD) resdirptr;
if ((resdirptr = GetResDirEntryW(resdirptr, type, root)) == NULL)
return 0;
@ -130,13 +136,13 @@ HANDLE32 PE_FindResourceEx32W(
*/
HANDLE32 PE_LoadResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
{
PE_MODULE *pe = HMODULE32toPE_MODULE(hModule);
PE_MODREF *pem = HMODULE32toPE_MODREF(hModule);
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return 0;
if (!hRsrc)
return 0;
return (HANDLE32) (pe->load_addr+((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
return (HANDLE32) (pem->load_addr+((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
}
@ -169,21 +175,21 @@ walk_resdir(DWORD loadaddr,DWORD rootresdir,DWORD xres,DWORD data,DWORD lvl,LPDW
DWORD PE_SizeofResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
{
PE_MODULE *pe = HMODULE32toPE_MODULE(hModule);
PE_MODREF *pem = HMODULE32toPE_MODREF(hModule);
DWORD max,data;
IMAGE_DATA_DIRECTORY dir;
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return 0;
if (!hRsrc) return 0;
max=(DWORD)-1;
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
dir=pem->pe_module->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
if(dir.Size)
max=(DWORD)pe->pe_resource+dir.Size;
max=(DWORD)pem->pe_resource+dir.Size;
data=((DWORD)pe->load_addr+((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
walk_resdir(pe->load_addr,(DWORD)pe->pe_resource,0,data,0,&max);
data=((DWORD)pem->load_addr+((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
walk_resdir(pem->load_addr,(DWORD)pem->pe_resource,0,data,0,&max);
return max-data;
}
@ -192,24 +198,24 @@ DWORD PE_SizeofResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
*/
BOOL32
PE_EnumResourceTypes32A(HMODULE32 hmod,ENUMRESTYPEPROC32A lpfun,LONG lparam) {
PE_MODULE *pe = HMODULE32toPE_MODULE(hmod);
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
HANDLE32 heap = GetProcessHeap();
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pe->pe_resource;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPSTR name;
if (HIWORD(et[i].u1.Name))
name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pe->pe_resource+et[i].u1.Name));
name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name));
else
name = (LPSTR)et[i].u1.Name;
ret = lpfun(hmod,name,lparam);
@ -226,22 +232,22 @@ PE_EnumResourceTypes32A(HMODULE32 hmod,ENUMRESTYPEPROC32A lpfun,LONG lparam) {
*/
BOOL32
PE_EnumResourceTypes32W(HMODULE32 hmod,ENUMRESTYPEPROC32W lpfun,LONG lparam) {
PE_MODULE *pe = HMODULE32toPE_MODULE(hmod);
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pe->pe_resource;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPWSTR type;
if (HIWORD(et[i].u1.Name))
type = (LPWSTR)((LPBYTE)pe->pe_resource+et[i].u1.Name);
type = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name);
else
type = (LPWSTR)et[i].u1.Name;
@ -259,7 +265,7 @@ BOOL32
PE_EnumResourceNames32A(
HMODULE32 hmod,LPCSTR type,ENUMRESNAMEPROC32A lpfun,LONG lparam
) {
PE_MODULE *pe = HMODULE32toPE_MODULE(hmod);
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
@ -267,14 +273,14 @@ PE_EnumResourceNames32A(
HANDLE32 heap = GetProcessHeap();
LPWSTR typeW;
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pe->pe_resource;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
if (HIWORD(type))
typeW = HEAP_strdupAtoW(heap,0,type);
else
typeW = (LPWSTR)type;
resdir = GetResDirEntryW(resdir,typeW,(DWORD)pe->pe_resource);
resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource);
if (HIWORD(typeW))
HeapFree(heap,0,typeW);
if (!resdir)
@ -285,7 +291,7 @@ PE_EnumResourceNames32A(
LPSTR name;
if (HIWORD(et[i].u1.Name))
name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pe->pe_resource+et[i].u1.Name));
name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name));
else
name = (LPSTR)et[i].u1.Name;
ret = lpfun(hmod,type,name,lparam);
@ -303,17 +309,17 @@ BOOL32
PE_EnumResourceNames32W(
HMODULE32 hmod,LPCWSTR type,ENUMRESNAMEPROC32W lpfun,LONG lparam
) {
PE_MODULE *pe = HMODULE32toPE_MODULE(hmod);
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pe->pe_resource;
resdir = GetResDirEntryW(resdir,type,(DWORD)pe->pe_resource);
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource);
if (!resdir)
return FALSE;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
@ -321,7 +327,7 @@ PE_EnumResourceNames32W(
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
LPWSTR name;
if (HIWORD(et[i].u1.Name))
name = (LPWSTR)((LPBYTE)pe->pe_resource+et[i].u1.Name);
name = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.Name);
else
name = (LPWSTR)et[i].u1.Name;
ret = lpfun(hmod,type,name,lparam);
@ -339,7 +345,7 @@ PE_EnumResourceLanguages32A(
HMODULE32 hmod,LPCSTR name,LPCSTR type,ENUMRESLANGPROC32A lpfun,
LONG lparam
) {
PE_MODULE *pe = HMODULE32toPE_MODULE(hmod);
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
@ -347,15 +353,15 @@ PE_EnumResourceLanguages32A(
HANDLE32 heap = GetProcessHeap();
LPWSTR nameW,typeW;
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pe->pe_resource;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
if (HIWORD(name))
nameW = HEAP_strdupAtoW(heap,0,name);
else
nameW = (LPWSTR)name;
resdir = GetResDirEntryW(resdir,nameW,(DWORD)pe->pe_resource);
resdir = GetResDirEntryW(resdir,nameW,(DWORD)pem->pe_resource);
if (HIWORD(nameW))
HeapFree(heap,0,nameW);
if (!resdir)
@ -364,7 +370,7 @@ PE_EnumResourceLanguages32A(
typeW = HEAP_strdupAtoW(heap,0,type);
else
typeW = (LPWSTR)type;
resdir = GetResDirEntryW(resdir,typeW,(DWORD)pe->pe_resource);
resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource);
if (HIWORD(typeW))
HeapFree(heap,0,typeW);
if (!resdir)
@ -372,7 +378,7 @@ PE_EnumResourceLanguages32A(
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
ret = FALSE;
for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
/* languages are just ids... I hope */
/* languages are just ids... I hopem */
ret = lpfun(hmod,name,type,et[i].u1.Id,lparam);
if (!ret)
break;
@ -388,20 +394,20 @@ PE_EnumResourceLanguages32W(
HMODULE32 hmod,LPCWSTR name,LPCWSTR type,ENUMRESLANGPROC32W lpfun,
LONG lparam
) {
PE_MODULE *pe = HMODULE32toPE_MODULE(hmod);
PE_MODREF *pem = HMODULE32toPE_MODREF(hmod);
int i;
LPIMAGE_RESOURCE_DIRECTORY resdir;
LPIMAGE_RESOURCE_DIRECTORY_ENTRY et;
BOOL32 ret;
if (!pe || !pe->pe_resource)
if (!pem || !pem->pe_resource)
return FALSE;
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pe->pe_resource;
resdir = GetResDirEntryW(resdir,name,(DWORD)pe->pe_resource);
resdir = (LPIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
resdir = GetResDirEntryW(resdir,name,(DWORD)pem->pe_resource);
if (!resdir)
return FALSE;
resdir = GetResDirEntryW(resdir,type,(DWORD)pe->pe_resource);
resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource);
if (!resdir)
return FALSE;
et =(LPIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));

View File

@ -18,6 +18,7 @@
#include "global.h"
#include "heap.h"
#include "neexe.h"
#include "task.h"
#include "accel.h"
#include "module.h"
#include "resource.h"
@ -33,6 +34,11 @@
extern WORD WINE_LanguageId;
/* error message when 16-bit resource function is called for Win32 module */
static const char* NEWin32FailureString = "fails with Win32 module\n";
/* error message when 32-bit resource function is called for Win16 module */
static const char* PEWin16FailureString = "fails with Win16 module\n";
/**********************************************************************
* FindResource16 (KERNEL.60)
*/
@ -40,9 +46,10 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_resource(stddeb, "FindResource16: module=%04x type=", hModule );
PrintId( type );
if (HIWORD(name)) /* Check for '#xxx' name */
{
char *ptr = PTR_SEG_TO_LIN( name );
@ -50,20 +57,23 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
if (!(name = (SEGPTR)atoi( ptr + 1 ))) return 0;
}
}
dprintf_resource( stddeb, " name=" );
PrintId( name );
dprintf_resource( stddeb, "\n" );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
if ((pModule = MODULE_GetPtr( hModule )))
{
fprintf(stderr,"Don't know how to FindResource16() for Win32 module\n");
return 0;
}
return NE_FindResource( hModule, type, name );
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"FindResource16: %s", NEWin32FailureString);
else
return NE_FindResource( hModule, type, name );
#else
return LIBRES_FindResource16( hModule, name, type );
return LIBRES_FindResource16( hModule, name, type );
#endif
}
return 0;
}
@ -109,7 +119,7 @@ HRSRC32 WINAPI FindResourceEx32W( HINSTANCE32 hModule, LPCWSTR name,
NE_MODULE *pModule;
if (!hModule) hModule = GetTaskDS();
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "FindResource32W: module=%08x type=", hModule );
if (HIWORD(type))
dprintf_resource(stddeb,"%p",type);
@ -145,21 +155,22 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_resource(stddeb, "LoadResource16: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
if ((pModule = MODULE_GetPtr( hModule )))
{
fprintf(stderr,"Don't know how to LoadResource16() for Win32 module\n");
return 0;
}
return NE_LoadResource( hModule, hRsrc );
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"LoadResource16: %s", NEWin32FailureString);
else
return NE_LoadResource( hModule, hRsrc );
#else
return LIBRES_LoadResource( hModule, hRsrc );
return LIBRES_LoadResource( hModule, hRsrc );
#endif
}
return 0;
}
/**********************************************************************
@ -171,7 +182,7 @@ HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
NE_MODULE *pModule;
if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "LoadResource32: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
@ -179,7 +190,7 @@ HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32))
{
fprintf(stderr,"LoadResource32: tried to load a non win32 resource.\n");
fprintf(stderr,"LoadResource32: %s", PEWin16FailureString );
return 0; /* FIXME? */
}
return PE_LoadResource32(hModule,hRsrc);
@ -201,11 +212,11 @@ SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16 handle)
dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle );
if (!handle) return (SEGPTR)0;
hModule = GetExePtr( handle );
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"Don't know how to LockResource() for Win32 module\n");
fprintf(stderr,"LockResource16: %s", NEWin32FailureString);
return 0;
}
return NE_LockResource( hModule, handle );
@ -223,11 +234,11 @@ LPVOID WINAPI LockResource16( HGLOBAL16 handle )
dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle );
if (!handle) return NULL;
hModule = GetExePtr( handle );
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"Don't know how to LockResource16() for Win32 module\n");
fprintf(stderr,"LockResource16: %s", NEWin32FailureString);
return 0;
}
return (LPSTR)PTR_SEG_TO_LIN( NE_LockResource( hModule, handle ) );
@ -257,11 +268,11 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
dprintf_resource(stddeb, "FreeResource16: handle=%04x\n", handle );
if (!handle) return FALSE;
hModule = GetExePtr( handle );
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"Don't know how to FreeResource16() for Win32 module\n");
fprintf(stderr,"FreeResource16: %s", NEWin32FailureString);
return 0;
}
return NE_FreeResource( hModule, handle );
@ -287,7 +298,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_resource(stddeb, "AccessResource16: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
@ -295,7 +306,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"Don't know how to AccessResource16() for Win32 module\n");
fprintf(stderr,"AccessResource16: %s", NEWin32FailureString);
return 0;
}
return NE_AccessResource( hModule, hRsrc );
@ -310,7 +321,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
*/
INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "AccessResource: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
@ -326,14 +337,14 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_resource(stddeb, "SizeofResource16: module=%04x res=%04x\n",
hModule, hRsrc );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"Don't know how to SizeOfResource16() for Win32 module\n");
fprintf(stderr,"SizeOfResource16: %s", NEWin32FailureString);
return 0;
}
return NE_SizeofResource( hModule, hRsrc );
@ -348,7 +359,7 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
*/
DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "SizeofResource32: module=%04x res=%04x\n",
hModule, hRsrc );
#ifndef WINELIB
@ -367,7 +378,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
{
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_resource(stddeb, "AllocResource: module=%04x res=%04x size=%ld\n",
hModule, hRsrc, size );
if (!hRsrc) return 0;
@ -375,7 +386,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"Don't know how to AllocResource() for Win32 module\n");
fprintf(stderr,"AllocResource16: %s", NEWin32FailureString);
return 0;
}
return NE_AllocResource( hModule, hRsrc, size );
@ -394,7 +405,7 @@ HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
{
dprintf_resource(stddeb,"DirectResAlloc(%04x,%04x,%04x)\n",
hInstance, wType, wSize );
hInstance = GetExePtr(hInstance);
hInstance = MODULE_HANDLEtoHMODULE16(hInstance);
if(!hInstance)return 0;
if(wType != 0x10) /* 0x10 is the only observed value, passed from
CreateCursorIndirect. */
@ -405,6 +416,9 @@ HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
/**********************************************************************
* LoadAccelerators16 [USER.177]
*
* FIXME: this code leaks memory because HACCEL must be a result of LoadResource()
* (see TWIN for hints).
*/
HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, SEGPTR lpTableName)
{
@ -578,6 +592,8 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
int string_num;
int i;
if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */
resource_id = (UINT32)(-((INT32)resource_id));
dprintf_resource(stddeb, "LoadString: instance = %04x, id = %04x, buffer = %08x, "
"length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
@ -747,15 +763,24 @@ INT32 LoadMessage32W( HINSTANCE32 instance, UINT32 id, WORD lang,
/**********************************************************************
* SetResourceHandler (KERNEL.43)
*/
FARPROC16 WINAPI SetResourceHandler( HINSTANCE16 instance, SEGPTR s,
FARPROC16 farproc )
FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR s,
FARPROC16 resourceHandler )
{
if (HIWORD(s))
fprintf(stderr,"SetResourceHandler(%04x,%s,%p), empty STUB!\n",
instance,(char*)PTR_SEG_TO_LIN(s),farproc);
else
fprintf(stderr,"SetResourceHandler(%04x,0x%04x,%p), empty STUB!\n",
instance,LOWORD(s),farproc);
NE_MODULE *pModule;
hModule = GetExePtr( hModule );
dprintf_resource(stddeb, "SetResourceHandler: module=%04x type=", hModule );
PrintId( s );
dprintf_resource( stddeb, "\n" );
if ((pModule = MODULE_GetPtr( hModule )))
{
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"SetResourceHandler: %s", NEWin32FailureString);
else if (pModule->res_table)
return NE_SetResourceHandler( hModule, s, resourceHandler );
}
return NULL;
}

View File

@ -9,7 +9,7 @@
#include <string.h>
#include "windows.h"
#include "task.h"
#include "user.h"
#include "callback.h"
#include "file.h"
#include "global.h"
@ -40,9 +40,9 @@
/* Min. number of thunks allocated when creating a new segment */
#define MIN_THUNKS 32
extern INT32 WINSOCK_DeleteTaskWSI( TDB* pTask, struct _WSINFO* pwsi );
extern void USER_AppExit( HTASK16, HINSTANCE16, HQUEUE16 );
extern void PE_InitTls( PE_MODULE *module );
extern INT32 WINSOCK_DeleteTaskWSI( TDB* pTask, struct _WSINFO* );
extern BOOL32 MODULE_FreeModule( HMODULE16 hModule, TDB* ptaskContext );
extern void PE_InitTls( PDB32 *pdb32 );
/* Saved 16-bit stack for current process (Win16 only) */
DWORD IF1632_Saved16_ss_sp = 0;
@ -370,12 +370,16 @@ static void TASK_CallToStart(void)
extern void InitTask( CONTEXT *context );
FARPROC32 entry = (FARPROC32)(pCurrentProcess->exe_modref->load_addr +
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
InitTask( NULL );
InitApp( pTask->hModule );
__asm__ __volatile__("movw %w0,%%fs"::"r" (pCurrentThread->teb_sel));
PE_InitializeDLLs( pTask->hModule, DLL_PROCESS_ATTACH, (LPVOID)-1 );
exit_code = CallTaskStart32((FARPROC32)(pModule->pe_module->load_addr +
pModule->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint) );
PE_InitializeDLLs( pCurrentProcess, DLL_PROCESS_ATTACH, (LPVOID)-1 );
dprintf_relay( stddeb, "CallTo32(entryproc=%p)\n", entry );
exit_code = entry();
TASK_KillCurrentTask( exit_code );
}
else
@ -437,6 +441,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
STACK32FRAME *frame32;
#ifndef WINELIB32
extern DWORD CALLTO16_RetAddr_word;
extern void CALLTO16_Restore();
#endif
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@ -546,18 +551,21 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
/* Create the Win32 part of the task */
pdb32 = PROCESS_Create( pTask );
pCurrentProcess = pdb32 = PROCESS_Create( pTask, cmdLine );
pdb32->task = hTask;
if (pModule->flags & NE_FFLAGS_WIN32)
{
/*
LPTHREAD_START_ROUTINE start =
(LPTHREAD_START_ROUTINE)(pModule->pe_module->load_addr +
pModule->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
pTask->thdb = THREAD_Create( pdb32, 0, start );
(LPTHREAD_START_ROUTINE)(
pCurrentProcess->exe_modref->load_addr +
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
*/
pTask->thdb = THREAD_Create( pdb32, 0, 0 );
#ifndef WINELIB
/* FIXME: should not be done here */
pCurrentThread = pTask->thdb;
PE_InitTls( pModule->pe_module );
PE_InitTls( pdb32 );
#endif
}
else
@ -575,6 +583,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
frame32->ebx = 0;
frame32->ebp = 0;
#ifndef WINELIB
frame32->restore_addr = (DWORD)CALLTO16_Restore;
frame32->retaddr = (DWORD)TASK_CallToStart;
frame32->codeselector = WINE_CODE_SELECTOR;
#endif
@ -613,10 +622,12 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
{
if (pModule->flags & NE_FFLAGS_WIN32)
{
DBG_ADDR addr = { NULL, 0, pModule->pe_module->load_addr +
pModule->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint };
/*
DBG_ADDR addr = { NULL, 0, pCurrentProcess->exe_modref->load_addr +
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint };
fprintf( stderr, "Win32 task '%s': ", name );
DEBUG_AddBreakpoint( &addr );
*/
}
else
{
@ -656,7 +667,7 @@ static void TASK_DeleteTask( HTASK16 hTask )
/* Free the task module */
FreeModule16( pTask->hModule );
MODULE_FreeModule( pTask->hModule, pTask );
/* Free the selector aliases */
@ -691,17 +702,16 @@ void TASK_KillCurrentTask( INT16 exitCode )
dprintf_task(stddeb, "Killing task %04x\n", hCurrentTask );
/* Clean up sockets */
/* Delete active sockets */
if( pTask->pwsi )
{
dprintf_task(stddeb, "\tremoving socket table\n");
if( pTask->pwsi )
WINSOCK_DeleteTaskWSI( pTask, pTask->pwsi );
}
/* Perform USER cleanup */
USER_AppExit( hCurrentTask, pTask->hInstance, pTask->hQueue );
if (pTask->userhandler)
pTask->userhandler( hCurrentTask, USIG_TERMINATION, 0,
pTask->hInstance, pTask->hQueue );
if (hTaskToKill && (hTaskToKill != hCurrentTask))
{
@ -867,6 +877,8 @@ void TASK_YieldToSystem(TDB* pTask)
/***********************************************************************
* InitTask (KERNEL.91)
*
* Called by the application startup code.
*/
void WINAPI InitTask( CONTEXT *context )
{
@ -880,7 +892,13 @@ void WINAPI InitTask( CONTEXT *context )
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pModule = MODULE_GetPtr( pTask->hModule ))) return;
/* This is a hack to install task USER signal handler before
* implicitly loaded DLLs are initialized (see windows/user.c) */
pTask->userhandler = (USERSIGNALPROC)&USER_SignalProc;
#ifndef WINELIB
/* Initialize implicitly loaded DLLs */
NE_InitializeDLLs( pTask->hModule );
#endif
@ -1374,6 +1392,8 @@ BOOL16 WINAPI IsTask( HTASK16 hTask )
/***********************************************************************
* SetTaskSignalProc (KERNEL.38)
*
* Real 16-bit interface is provided by the THUNK_SetTaskSignalProc.
*/
FARPROC16 WINAPI SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
{
@ -1382,8 +1402,8 @@ FARPROC16 WINAPI SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
if (!hTask) hTask = hCurrentTask;
if (!(pTask = (TDB *)GlobalLock16( hTask ))) return NULL;
oldProc = pTask->userhandler;
pTask->userhandler = proc;
oldProc = (FARPROC16)pTask->userhandler;
pTask->userhandler = (USERSIGNALPROC)proc;
return oldProc;
}
@ -1464,7 +1484,6 @@ HMODULE16 WINAPI GetExePtr( HANDLE16 handle )
return 0;
}
/***********************************************************************
* TaskFirst (TOOLHELP.63)
*/

View File

@ -17,6 +17,7 @@
#include "miscemu.h"
#include "dde_mem.h"
#include "stackframe.h"
#include "module.h"
#include "options.h"
#include "stddebug.h"
#include "debug.h"
@ -206,6 +207,7 @@ HGLOBAL16 GLOBAL_Alloc( UINT16 flags, DWORD size, HGLOBAL16 hOwner,
{
ptr = HeapAlloc( SystemHeap, 0, size );
}
/* FIXME: free discardable blocks and try again? */
if (!ptr) return 0;
/* Allocate the selector(s) */
@ -274,7 +276,7 @@ HGLOBAL16 WINAPI GlobalAlloc16( UINT16 flags, DWORD size )
HANDLE16 owner = GetCurrentPDB();
if (flags & GMEM_DDESHARE)
owner = GetExePtr(owner); /* Make it a module handle */
owner = MODULE_HANDLEtoHMODULE16(owner); /* Make it a module handle */
return GLOBAL_Alloc( flags, size, owner, FALSE, FALSE, FALSE );
}
@ -313,8 +315,11 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags )
(pArena->lockCount > 0) || (pArena->pageLockCount > 0)) return 0;
HeapFree( SystemHeap, 0, (void *)pArena->base );
pArena->base = 0;
/* Note: we rely on the fact that SELECTOR_ReallocBlock won't */
/* change the selector if we are shrinking the block */
/* Note: we rely on the fact that SELECTOR_ReallocBlock won't
* change the selector if we are shrinking the block.
* FIXME: shouldn't we keep selectors until the block is deleted?
*/
SELECTOR_ReallocBlock( sel, 0, 1, SEGMENT_DATA, 0, 0 );
return handle;
}
@ -411,15 +416,20 @@ SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle )
{
dprintf_global( stddeb, "WIN16_GlobalLock16(%04x) -> %08lx\n",
handle, MAKELONG( 0, GlobalHandleToSel(handle)) );
if (!handle) return 0;
if (handle)
{
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
#ifdef CONFIG_IPC
if (is_dde_handle(handle))
return PTR_SEG_OFF_TO_SEGPTR( DDE_GlobalHandleToSel(handle), 0 );
if (is_dde_handle(handle))
return PTR_SEG_OFF_TO_SEGPTR( DDE_GlobalHandleToSel(handle), 0 );
#endif /* CONFIG_IPC */
if (!GET_ARENA_PTR(handle)->base) return (SEGPTR)0;
return PTR_SEG_OFF_TO_SEGPTR( GlobalHandleToSel(handle), 0 );
if (!GET_ARENA_PTR(handle)->base) return (SEGPTR)0;
return PTR_SEG_OFF_TO_SEGPTR( GlobalHandleToSel(handle), 0 );
/* FIXME: put segment value in CX as well */
}
return (SEGPTR)0;
}

View File

@ -16,6 +16,7 @@
#include <string.h>
#include "windows.h"
#include "ldt.h"
#include "task.h"
#include "global.h"
#include "heap.h"
#include "instance.h"
@ -333,7 +334,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
if (start == 0) {
/* Check if the segment is the DGROUP of a module */
if ((pModule = MODULE_GetPtr( GetExePtr( selector ) )))
if ((pModule = MODULE_GetPtr( selector )))
{
SEGTABLEENTRY *pSeg = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1;
if (pModule->dgroup && (pSeg->selector == selector)) {
@ -1582,7 +1583,6 @@ DWORD WINAPI GetHeapSpaces( HMODULE16 module )
NE_MODULE *pModule;
WORD ds;
module = GetExePtr( module );
if (!(pModule = MODULE_GetPtr( module ))) return 0;
ds = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
return MAKELONG( LOCAL_CountFree( ds ), LOCAL_HeapSize( ds ) );

View File

@ -8,6 +8,7 @@
#include <ctype.h>
#include <string.h>
#include "windows.h"
#include "winerror.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
@ -147,6 +148,12 @@ INT16 WINAPI lstrcmp16( LPCSTR str1, LPCSTR str2 )
*/
INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
{
/* Win95 KERNEL32.DLL does it that way. Hands off! */
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
dprintf_string(stddeb,"strcmp: '%s' and '%s'\n",
(str1)?str1:"NULL",(str2)?str2:"NULL");
return (INT32)strcmp( str1, str2 );
@ -158,6 +165,10 @@ INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
*/
INT32 WINAPI lstrcmp32W( LPCWSTR str1, LPCWSTR str2 )
{
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
return (INT32)(*str1 - *str2);
}
@ -179,6 +190,10 @@ INT32 WINAPI lstrcmpi32A( LPCSTR str1, LPCSTR str2 )
{
INT32 res;
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
dprintf_string(stddeb,"strcmpi '%s' and '%s'\n",
(str1)?str1:"NULL",(str2)?str2:"NULL");
while (*str1)
@ -198,6 +213,10 @@ INT32 WINAPI lstrcmpi32W( LPCWSTR str1, LPCWSTR str2 )
{
INT32 res;
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
while (*str1)
{
/* FIXME: Unicode */

View File

@ -118,19 +118,19 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
UINT32 addr = view->base;
BYTE prot = view->prot[0];
fprintf( stderr, "View: %08x - %08x%s",
dprintf_virtual( stddeb, "View: %08x - %08x%s",
view->base, view->base + view->size - 1,
(view->flags & VFLAG_SYSTEM) ? " (system)" : "" );
if (view->mapping && view->mapping->file)
fprintf( stderr, " %s @ %08x\n",
dprintf_virtual( stddeb, " %s @ %08x\n",
view->mapping->file->unix_name, view->offset );
else
fprintf( stderr, " (anonymous)\n");
dprintf_virtual( stddeb, " (anonymous)\n");
for (count = i = 1; i < view->size >> page_shift; i++, count++)
{
if (view->prot[i] == prot) continue;
fprintf( stderr, " %08x - %08x %s\n",
dprintf_virtual( stddeb, " %08x - %08x %s\n",
addr, addr + (count << page_shift) - 1,
VIRTUAL_GetProtStr(prot) );
addr += (count << page_shift);
@ -138,7 +138,7 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
count = 0;
}
if (count)
fprintf( stderr, " %08x - %08x %s\n",
dprintf_virtual( stddeb, " %08x - %08x %s\n",
addr, addr + (count << page_shift) - 1,
VIRTUAL_GetProtStr(prot) );
}
@ -150,7 +150,7 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
void VIRTUAL_Dump(void)
{
FILE_VIEW *view = VIRTUAL_FirstView;
fprintf( stderr, "\nDump of all virtual memory views:\n\n" );
dprintf_virtual( stddeb, "\nDump of all virtual memory views:\n\n" );
while (view)
{
VIRTUAL_DumpView( view );

View File

@ -1,4 +1,4 @@
/*
/*
* DEC 93 Erik Bos <erik@xs4all.nl>
*
* Copyright 1996 Marcus Meissner
@ -11,6 +11,9 @@
* IMHO, they are still wrong, but they at least implement the RXCHAR
* event and return I/O queue sizes, which makes the app I'm interested
* in (analog devices EZKIT DSP development system) work.
*
* August 12, 1997. Take a bash at SetCommEventMask - Lawson Whitney
* <lawson_whitney@juno.com>
*/
#include <stdio.h>
@ -38,7 +41,7 @@
#ifndef TIOCINQ
#define TIOCINQ FIONREAD
#endif
#define msr 35 /* offset in unknown structure commMask */
/*
* [RER] These are globals are wrong. They should be in DosDeviceStruct
* on a per port basis.
@ -47,6 +50,7 @@ int commerror = 0, eventmask = 0;
struct DosDeviceStruct COM[MAX_PORTS];
struct DosDeviceStruct LPT[MAX_PORTS];
LPCVOID *unknown[MAX_PORTS];
void COMM_Init(void)
{
@ -126,6 +130,18 @@ struct DosDeviceStruct *GetDeviceStruct(int fd)
return NULL;
}
int GetCommPort(int fd)
{
int x;
for (x=0; x<MAX_PORTS; x++) {
if (COM[x].fd == fd)
return x;
}
return -1;
}
int ValidCOMPort(int x)
{
return(x < MAX_PORTS ? (int) COM[x].devicename : 0);
@ -436,6 +452,8 @@ INT16 WINAPI OpenComm(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
commerror = WinError();
return -1;
} else {
unknown[port] = SEGPTR_ALLOC(40);
bzero(unknown[port],40);
COM[port].fd = fd;
return fd;
}
@ -470,16 +488,16 @@ INT16 WINAPI OpenComm(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
*/
INT16 WINAPI CloseComm(INT16 fd)
{
struct DosDeviceStruct *ptr;
int port;
dprintf_comm(stddeb,"CloseComm: fd %d\n", fd);
if ((ptr = GetDeviceStruct(fd)) == NULL) {
if ((port = GetCommPort(fd)) !=-1) { /* [LW] */
SEGPTR_FREE(unknown[port]);
COM[port].fd = 0; /* my adaptation of RER's fix */
} else {
commerror = IE_BADID;
return -1;
}
ptr->fd = 0; /* [RER] Really, -1 would be a better value */
if (close(fd) == -1) {
commerror = WinError();
return -1;
@ -738,7 +756,17 @@ INT16 WINAPI FlushComm(INT16 fd,INT16 fnQueue)
}
}
/*****************************************************************************
/********************************************************************
* PurgeComm (KERNEL32.557)
*/
BOOL32 WINAPI PurgeComm( HANDLE32 hFile, DWORD flags)
{
dprintf_comm(stdnimp, "PurgeComm(%08x %08lx) unimplemented stub\n",
hFile, flags);
return 0;
}
/********************************************************************
* GetCommError (USER.203)
*/
INT16 WINAPI GetCommError(INT16 fd,LPCOMSTAT lpStat)
@ -794,11 +822,26 @@ BOOL32 WINAPI ClearCommError(INT32 fd,LPDWORD errors,LPCOMSTAT lpStat)
/*****************************************************************************
* SetCommEventMask (USER.208)
*/
UINT16* WINAPI SetCommEventMask(INT16 fd,UINT16 fuEvtMask)
SEGPTR WINAPI SetCommEventMask(INT16 fd,UINT16 fuEvtMask)
{
unsigned char *stol;
int act;
int repid;
unsigned int mstat;
dprintf_comm(stddeb,"SetCommEventMask:fd %d,mask %d\n",fd,fuEvtMask);
eventmask |= fuEvtMask;
return (UINT16 *)&eventmask; /* FIXME, should be SEGPTR */
if ((act = GetCommPort(fd)) == -1) {
dprintf_comm(stddeb," fd %d not comm port\n",act);
return NULL;}
stol = unknown[act];
stol += msr;
repid = ioctl(fd,TIOCMGET,&mstat);
dprintf_comm(stddeb,
" ioctl %d, msr %x at %lx %lx\n",repid,mstat,stol,unknown[act]);
if ((mstat&TIOCM_CAR)) {*stol |= 0x80;}
else {*stol &=0x7f;}
dprintf_comm(stddeb," modem dcd construct %x\n",*stol);
return SEGPTR_GET(unknown[act]);
}
/*****************************************************************************
@ -845,6 +888,15 @@ UINT16 WINAPI GetCommEventMask(INT16 fd,UINT16 fnEvtClear)
#endif
}
/*****************************************************************************
* SetupComm (KERNEL32.676)
*/
BOOL32 WINAPI SetupComm( HANDLE32 hFile, DWORD insize, DWORD outsize)
{
dprintf_comm(stdnimp, "SetupComm: insize %ld outsize %ld unimplemented stub\n", insize, outsize);
return FALSE;
}
/*****************************************************************************
* GetCommMask (KERNEL32.156)
*/
@ -1599,7 +1651,7 @@ INT16 WINAPI UngetCommChar(INT16 fd,CHAR chUnget)
*/
INT16 WINAPI ReadComm(INT16 fd,LPSTR lpvBuf,INT16 cbRead)
{
int status, length;
int status, x, length;
struct DosDeviceStruct *ptr;
dprintf_comm(stddeb,
@ -1634,6 +1686,9 @@ INT16 WINAPI ReadComm(INT16 fd,LPSTR lpvBuf,INT16 cbRead)
return length;
}
} else {
for (x=0; x < length+status; x++)
dprintf_comm(stddeb,"%c",*(lpvBuf+x));
dprintf_comm(stddeb,"\nthus endeth\n");
commerror = 0;
return length + status;
}
@ -1661,7 +1716,7 @@ INT16 WINAPI WriteComm(INT16 fd, LPSTR lpvBuf, INT16 cbWrite)
for (x=0; x != cbWrite ; x++)
dprintf_comm(stddeb,"%c", *(lpvBuf + x) );
dprintf_comm(stddeb,"\n");
length = write(fd, (void *) lpvBuf, cbWrite);
if (length == -1) {

View File

@ -58,7 +58,7 @@ static BOOL32 FileDlg_Init()
*/
BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
{
HINSTANCE16 hInst;
HINSTANCE32 hInst;
HANDLE32 hDlgTmpl = 0, hResInfo;
BOOL32 bRet = FALSE, win32Format = FALSE;
HWND32 hwndDialog;
@ -148,7 +148,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
*/
BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
{
HINSTANCE16 hInst;
HINSTANCE32 hInst;
HANDLE32 hDlgTmpl = 0;
BOOL32 bRet = FALSE, win32Format = FALSE;
LPOPENFILENAME16 lpofn = (LPOPENFILENAME16)PTR_SEG_TO_LIN(ofn);
@ -3028,7 +3028,8 @@ BOOL32 WINAPI xxx##32A( LPOPENFILENAME32A ofn ) \
memset(ofn16,'\0',sizeof(*ofn16)); \
ofn16->lStructSize = sizeof(*ofn16); \
ofn16->hwndOwner = ofn->hwndOwner; \
ofn16->hInstance = ofn->hInstance; \
/* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */ \
ofn16->hInstance = MODULE_HANDLEtoHMODULE16(ofn->hInstance); \
if (ofn->lpstrFilter) { \
LPSTR s,x; \
\
@ -3107,7 +3108,8 @@ BOOL32 WINAPI xxx##32W( LPOPENFILENAME32W ofn ) \
memset(ofn16,'\0',sizeof(*ofn16)); \
ofn16->lStructSize = sizeof(*ofn16); \
ofn16->hwndOwner = ofn->hwndOwner; \
ofn16->hInstance = ofn->hInstance; \
/* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */ \
ofn16->hInstance = MODULE_HANDLEtoHMODULE16(ofn->hInstance); \
if (ofn->lpstrFilter) { \
LPWSTR s; \
LPSTR x,y; \
@ -3119,7 +3121,7 @@ BOOL32 WINAPI xxx##32W( LPOPENFILENAME32W ofn ) \
s = s+lstrlen32W(s)+1; \
s++; \
n = s - ofn->lpstrFilter; /* already divides by 2. ptr magic */\
x = y = (LPSTR)SEGPTR_ALLOC(n); \
x = y = (LPSTR)SEGPTR_ALLOC(n); \
s = (LPWSTR)ofn->lpstrFilter; \
while (*s) { \
lstrcpyWtoA(x,s); \

View File

@ -71,6 +71,14 @@ OLESTATUS WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
return OLE_OK;
}
/***********************************************************************
* IsEqualGUID [COMPOBJ.18]
*/
BOOL16 WINAPI IsEqualGUID(GUID* g1, GUID* g2)
{
return !memcmp( g1, g2, sizeof(GUID) );
}
/***********************************************************************
* CLSIDFromString [COMPOBJ.20]
*/

File diff suppressed because it is too large Load Diff

View File

@ -137,7 +137,7 @@ void WINAPI OutputDebugString16( LPCSTR str )
for (p = buffer; *str; str++) if (*str != '\r') *p++ = *str;
*p = '\0';
if ((p > buffer) && (p[-1] == '\n')) p[1] = '\0'; /* Remove trailing \n */
module = MODULE_GetModuleName( GetExePtr(GetCurrentTask()) );
module = MODULE_GetModuleName( GetCurrentTask() );
fprintf( stderr, "OutputDebugString: %s says '%s'\n",
module ? module : "???", buffer );
HeapFree( GetProcessHeap(), 0, buffer );
@ -475,7 +475,7 @@ BOOL32 WINAPI IsCharUpper32W(WCHAR x)
}
/***********************************************************************
* FormatMessageA (KERNEL32.138) Library Version
* FormatMessage32A (KERNEL32.138)
* FIXME: missing wrap,FROM_SYSTEM message-loading,
*/
DWORD WINAPI FormatMessage32A(
@ -577,10 +577,7 @@ DWORD WINAPI FormatMessage32A(
if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)
argliststart=args+insertnr-1;
else
/* FIXME: not sure that this is
* correct for unix-c-varargs.
*/
argliststart=((DWORD*)&args)+insertnr-1;
argliststart=(*(DWORD**)args)+insertnr-1;
if (fmtstr[strlen(fmtstr)]=='s')
sprintfbuf=HeapAlloc(GetProcessHeap(),0,strlen((LPSTR)argliststart[0])+1);
@ -643,44 +640,10 @@ DWORD WINAPI FormatMessage32A(
}
#undef ADD_TO_T
/***********************************************************************
* FormatMessageA (KERNEL32.138) Emulator Version
* FormatMessage32W (KERNEL32.138)
*/
DWORD WINAPI WIN32_FormatMessage32A(DWORD *args)
{
DWORD dwFlags = args[0];
LPCVOID lpSource = (LPCVOID)args[1];
DWORD dwMessageId = args[2];
DWORD dwLanguageId = args[3];
LPSTR lpBuffer = (LPSTR)args[4];
DWORD nSize = args[5];
DWORD *xargs;
/* convert possible varargs to an argument array look-a-like */
if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY) {
xargs=(DWORD*)args[6];
} else {
/* args[6] is a pointer to a pointer to the start of
* a list of arguments.
*/
if (args[6])
xargs=(DWORD*)(((DWORD*)args[6])[0]);
else
xargs=NULL;
dwFlags|=FORMAT_MESSAGE_ARGUMENT_ARRAY;
}
return FormatMessage32A(
dwFlags,
lpSource,
dwMessageId,
dwLanguageId,
lpBuffer,
nSize,
xargs
);
}
DWORD WINAPI FormatMessage32W(
DWORD dwFlags,
LPCVOID lpSource,
@ -781,10 +744,7 @@ DWORD WINAPI FormatMessage32W(
if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)
argliststart=args+insertnr-1;
else
/* FIXME: not sure that this is
* correct for unix-c-varargs.
*/
argliststart=((DWORD*)&args)+insertnr-1;
argliststart=(*(DWORD**)args)+insertnr-1;
if (fmtstr[strlen(fmtstr)]=='s') {
DWORD xarr[3];
@ -847,41 +807,3 @@ DWORD WINAPI FormatMessage32W(
lstrlen32W(lpBuffer);
}
#undef ADD_TO_T
/***********************************************************************
* FormatMessageW (KERNEL32.138) Emulator Version
*/
DWORD WINAPI WIN32_FormatMessage32W(DWORD *args)
{
DWORD dwFlags = args[0];
LPCVOID lpSource = (LPCVOID)args[1];
DWORD dwMessageId = args[2];
DWORD dwLanguageId = args[3];
LPWSTR lpBuffer = (LPWSTR)args[4];
DWORD nSize = args[5];
DWORD *xargs;
/* convert possible varargs to an argument array look-a-like */
if (dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY) {
xargs=(DWORD*)args[6];
} else {
/* args[6] is a pointer to a pointer to the start of
* a list of arguments.
*/
if (args[6])
xargs=(DWORD*)(((DWORD*)args[6])[0]);
else
xargs=NULL;
dwFlags|=FORMAT_MESSAGE_ARGUMENT_ARRAY;
}
return FormatMessage32W(
dwFlags,
lpSource,
dwMessageId,
dwLanguageId,
lpBuffer,
nSize,
xargs
);
}

View File

@ -35,31 +35,123 @@
#include "xmalloc.h"
const char people[] = "Wine is available thanks to the work of "
"Bob Amstadt, Dag Asheim, Martin Ayotte, Peter Bajusz, Ross Biro, "
"Uwe Bonnes, Erik Bos, Fons Botman, John Brezak, Andrew Bulhak, "
"John Burton, Niels de Carpentier, Jimen Ching, Huw D. M. Davies, "
"Roman Dolejsi, Frans van Dorsselaer, Paul Falstad, David Faure, "
"Olaf Flebbe, Peter Galbavy, Ramon Garcia, Matthew Ghio, "
"Hans de Graaff, Charles M. Hannum, John Harvey, Cameron Heide, "
"Jochen Hoenicke, Onno Hovers, Jeffrey Hsu, Miguel de Icaza, "
"Jukka Iivonen, Lee Jaekil, Alexandre Julliard, Bang Jun-Young, "
"Pavel Kankovsky, Jochen Karrer, Andreas Kirschbaum, Albrecht Kleine, "
"Jon Konrath, Alex Korobka, Greg Kreider, Anand Kumria, Scott A. Laird, "
"Andrew Lewycky, Martin von Loewis, Kenneth MacDonald, Peter MacDonald, "
"William Magro, Juergen Marquardt, Ricardo Massaro, Marcus Meissner, "
"Graham Menhennitt, David Metcalfe, Bruce Milner, Steffen Moeller, "
"Andreas Mohr, Philippe De Muyter, Itai Nahshon, Michael Patra, "
"Jim Peterson, Robert Pouliot, Keith Reynolds, Slaven Rezic, "
"John Richardson, Johannes Ruscheinski, Thomas Sandford, "
"Constantine Sapuntzakis, Pablo Saratxaga, Daniel Schepler, "
"Ulrich Schmid, Bernd Schmidt, Yngvi Sigurjonsson, Stephen Simmons, "
"Rick Sladkey, William Smith, Dominik Strasser, Vadim Strizhevsky, "
"Erik Svendsen, Tristan Tarrant, Andrew Taylor, Duncan C Thomson, "
"Goran Thyni, Jimmy Tirtawangsa, Jon Tombs, Linus Torvalds, "
"Gregory Trubetskoy, Petri Tuomola, Michael Veksler, Sven Verdoolaege, "
"Ronan Waide, Eric Warnke, Manfred Weichel, Morten Welinder, "
"Jan Willamowius, Carl Williams, Karl Guenter Wuensch, Eric Youngdale, "
"James Youngman, Mikolaj Zalewski, and John Zero.";
"Bob Amstadt, "
"Dag Asheim, "
"Martin Ayotte, "
"Peter Bajusz, "
"Georg Beyerle, "
"Ross Biro, "
"Uwe Bonnes, "
"Erik Bos, "
"Fons Botman, "
"John Brezak, "
"Andrew Bulhak, "
"John Burton, "
"Niels de Carpentier, "
"Jimen Ching, "
"David A. Cuthbert, "
"Huw D. M. Davies, "
"Roman Dolejsi, "
"Frans van Dorsselaer, "
"Chris Faherty, "
"Paul Falstad, "
"David Faure, "
"Claus Fischer, "
"Olaf Flebbe, "
"Chad Fraleigh, "
"Peter Galbavy, "
"Ramon Garcia, "
"Matthew Ghio, "
"Jody Goldberg, "
"Hans de Graaff, "
"Charles M. Hannum, "
"Adrian Harvey, "
"John Harvey, "
"Cameron Heide, "
"Jochen Hoenicke, "
"Onno Hovers, "
"Jeffrey Hsu, "
"Miguel de Icaza, "
"Jukka Iivonen, "
"Lee Jaekil, "
"Alexandre Julliard, "
"Bang Jun-Young, "
"Pavel Kankovsky, "
"Jochen Karrer, "
"Andreas Kirschbaum, "
"Albrecht Kleine, "
"Jon Konrath, "
"Alex Korobka, "
"Greg Kreider, "
"Anand Kumria, "
"Scott A. Laird, "
"Andrew Lewycky, "
"Martin von Loewis, "
"Michiel van Loon, "
"Kenneth MacDonald, "
"Peter MacDonald, "
"William Magro, "
"Juergen Marquardt, "
"Ricardo Massaro, "
"Marcus Meissner, "
"Graham Menhennitt, "
"David Metcalfe, "
"Bruce Milner, "
"Steffen Moeller, "
"Andreas Mohr, "
"Philippe De Muyter, "
"Itai Nahshon, "
"Henrik Olsen, "
"Michael Patra, "
"Dimitrie O. Paun, "
"Jim Peterson, "
"Robert Pouliot, "
"Keith Reynolds, "
"Slaven Rezic, "
"John Richardson, "
"Rick Richardson, "
"Doug Ridgway, "
"Bernhard Rosenkraenzer, "
"Johannes Ruscheinski, "
"Thomas Sandford, "
"Constantine Sapuntzakis, "
"Pablo Saratxaga, "
"Daniel Schepler, "
"Peter Schlaile, "
"Ulrich Schmid, "
"Bernd Schmidt, "
"Ingo Schneider, "
"Victor Schneider, "
"Yngvi Sigurjonsson, "
"Stephen Simmons, "
"Rick Sladkey, "
"William Smith, "
"Dominik Strasser, "
"Vadim Strizhevsky, "
"Erik Svendsen, "
"Tristan Tarrant, "
"Andrew Taylor, "
"Duncan C Thomson, "
"Goran Thyni, "
"Jimmy Tirtawangsa, "
"Jon Tombs, "
"Linus Torvalds, "
"Gregory Trubetskoy, "
"Petri Tuomola, "
"Michael Veksler, "
"Sven Verdoolaege, "
"Ronan Waide, "
"Eric Warnke, "
"Manfred Weichel, "
"Morten Welinder, "
"Lawson Whitney, "
"Jan Willamowius, "
"Carl Williams, "
"Karl Guenter Wuensch, "
"Eric Youngdale, "
"James Youngman, "
"Mikolaj Zalewski, "
"and John Zero.";
const WINE_LANGUAGE_DEF Languages[] =
{

View File

@ -153,8 +153,8 @@ int WINAPI WNetUnlockQueueData(LPSTR szQueue)
/**************************************************************************
* WNetGetConnection [USER.512]
*/
int WINAPI WNetGetConnection(LPSTR lpLocalName,
LPSTR lpRemoteName, UINT16 *cbRemoteName)
int WINAPI WNetGetConnection16(LPSTR lpLocalName,
LPSTR lpRemoteName, UINT16 *cbRemoteName)
{
const char *path;
@ -402,4 +402,11 @@ UINT16 WINAPI WNetOpenEnum(DWORD dwScope, DWORD dwType,
}
DWORD
WNetGetConnection32A(LPCSTR localname,LPSTR remotename,LPDWORD buflen)
{
UINT16 x;
DWORD ret = WNetGetConnection16(localname,remotename,&x);
*buflen = x;
return ret;
}

View File

@ -510,3 +510,27 @@ DWORD WINAPI NtOpenFile(DWORD x1,DWORD flags,DWORD x3,DWORD x4,DWORD alignment,D
/* returns file io completion status */
return 0;
}
/*
These functions were originally in CRTDLL. CRTFLL now call the C-Lib
function directly. So they were moved here
*/
/*********************************************************************
* atoi (NDLL.885)
*/
INT32 NTDLL_atoi(LPCSTR x)
{
if (!x) return 0;
return atoi(x);
}
/*********************************************************************
* atol (NTDLL.886)
*/
LONG NTDLL_atol(LPCSTR x)
{
if (!x) return 0;
return atol(x);
}

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