Release 971130
Sat Nov 29 12:35:26 1997 Alexandre Julliard <julliard@lrc.epfl.ch> * [if1632/builtin.c] Build a complete PE header for builtin Win32 modules. * [loader/pe_image.c] [loader/module.c] HMODULE32 now points to the loading address of the module. There is no longer a separate PE_MODULE structure. Fri Nov 28 11:21:47 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [ole/*][configure.in][Makefile.in][include/interfaces.h] [if1632/olesvr32.spec][if1632/olecli32.spec] New directory, moved OLE stuff there. new .spec files for olecli32,olesvr32, some stubs added. * [misc/shell.c] Added support for extracting icons from PE dlls. * [misc/shellord.c][if1632/shell32.spec] Added a huge heap of ordinal only exported shell functions (will work only in Win95). * [loader/task.c] Hack to make MakeProcInstance16 work in all cases (mplayer.exe). * [win32/string32.c][include/string32.h] Obsolete, removed. * [windows/keyboard.c] Added *RegisterHotkey. * [objects/font.c][objects/text.c] Added GetFontLanguageInfo, GetTextCharsetInfo. Wed Nov 26 18:10:40 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> * [misc/network.c] In WNetGetConnection16 return the Drive label and not the DOS-Cwd. Makes Wordview 6 start on a network connected machine. * [controls/status.c] Catch a Null pointer in SW_SetText. * [files/dos_fs.c] Add NT5 functions GetLongPathName32. * [files/file.c] Make GetTempFileName16 accept drive 0 (Current Drive) too. Handle more errors and be more verbose in FILE_SetDosError, fix an error in DeleteFile32W * [memory/virtual.c] Implement FlushViewOfFile. * [misc/crtdll] Implement _rotl and splitpath and add a stub for _abnormal_termination. * [misc/printdrv.c] Stub for EnumPrinters32A. * [win32/newfns] Add Stub for QueryPerformanceFrequency, change return value for QueryPerformanceCounter. Add stub for DeviceIoControl. Tue Nov 25 15:55:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de> * [controls/combo.c] [controls/edit.c] [windows/defwnd.c] [windows/winpos.c] [windows/win.c] Removed WIN_NO_REDRAW flag. Tue Nov 25 13:20:35 1997 Douglas Ridgway <ridgway@taiga.v-wave.com> * [graphics/x11drv/bitblt.c] Fixed memory leak in BITBLT_GetDstArea. Sun Nov 23 14:05:23 1997 Andreas Mohr <100.30936@germany.net> * [files/directory.c] Export windows system directory to environment. * [if1632/Makefile.in] [if1632/builtin.c] [if1632/w32skrnl.spec] [if1632/win32s16.spec] [misc/w32scomb.c] [misc/w32skrnl.c] Added Win32s DLLs W32SKRNL and WIN32S16. * [if1632/kernel32.spec] [loader/module.c] Added misc functions for Win32s. * [if1632/kernel.spec] [loader/task.c] Added DefineHandleTable(). * [scheduler/process.c] Fixed SetEnvironmentVariable32A() to avoid heap corruption. Sat Nov 22 14:11:42 1997 Kristian Nielsen <kristian.nielsen@risoe.dk> * [windows/painting.c] Fix leak in BeginPaint16() for CS_PARENTDC windows where the update region was not properly released. Thu Nov 20 03:55:29 1997 Gordon Chaffee <chaffee@CS.Berkeley.EDU> * [loader/pe_image.c] Implemented forwarded DLL functions. * [objects/dib.c] Added support for 16- and 32-bit mode DIBs. Support negative bitmap heights. * [win32/process.c] Added stub for CreateProcess32W. * [win32/security.c] [include/ntdll.h] Added stubs for LookupAccountSid32A/W. * [scheduler/process.c] Use the size specified in the PE header for the process heap. Mon Nov 17 00:53:35 1997 Len White <phreak@cgocable.net> * [msdos/int3d.c] New file. Stubs for int3d. Sun Nov 16 12:30:00 PST 1997 Jason Schonberg <schon@mti.sgi.com> * [include/aspi.h] Changed comment style from C++ to C.
This commit is contained in:
parent
a0b2b1d0f6
commit
e658d82093
18
ANNOUNCE
18
ANNOUNCE
|
@ -1,14 +1,14 @@
|
||||||
This is release 971116 of Wine, the MS Windows emulator. This is still a
|
This is release 971130 of Wine, the MS Windows emulator. This is still a
|
||||||
developer's only release. There are many bugs and many unimplemented API
|
developer's only release. There are many bugs and many unimplemented API
|
||||||
features. Most applications still do not work correctly.
|
features. Most applications still do not work correctly.
|
||||||
|
|
||||||
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
|
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
|
||||||
forget to include a ChangeLog entry.
|
forget to include a ChangeLog entry.
|
||||||
|
|
||||||
WHAT'S NEW with Wine-971116: (see ChangeLog for details)
|
WHAT'S NEW with Wine-971130: (see ChangeLog for details)
|
||||||
- Emulator and library unification.
|
- Better Win32s support.
|
||||||
- New About dialog.
|
- Lots of new Win32 functions.
|
||||||
- Menus improvements.
|
- DIB handling improvements.
|
||||||
- Lots of bug fixes.
|
- Lots of bug fixes.
|
||||||
|
|
||||||
See the README file in the distribution for installation instructions.
|
See the README file in the distribution for installation instructions.
|
||||||
|
@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before
|
||||||
the release is available at the ftp sites. The sources will be available
|
the release is available at the ftp sites. The sources will be available
|
||||||
from the following locations:
|
from the following locations:
|
||||||
|
|
||||||
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-971116.tar.gz
|
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-971130.tar.gz
|
||||||
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-971116.tar.gz
|
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-971130.tar.gz
|
||||||
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-971116.tar.gz
|
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-971130.tar.gz
|
||||||
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-971116.tar.gz
|
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-971130.tar.gz
|
||||||
|
|
||||||
It should also be available from any site that mirrors tsx-11 or sunsite.
|
It should also be available from any site that mirrors tsx-11 or sunsite.
|
||||||
|
|
||||||
|
|
6
AUTHORS
6
AUTHORS
|
@ -11,6 +11,7 @@ Martin Ayotte,
|
||||||
Peter Bajusz,
|
Peter Bajusz,
|
||||||
Georg Beyerle,
|
Georg Beyerle,
|
||||||
Ross Biro,
|
Ross Biro,
|
||||||
|
Martin Boehme,
|
||||||
Uwe Bonnes,
|
Uwe Bonnes,
|
||||||
Erik Bos,
|
Erik Bos,
|
||||||
Fons Botman,
|
Fons Botman,
|
||||||
|
@ -18,12 +19,14 @@ John Brezak,
|
||||||
Andrew Bulhak,
|
Andrew Bulhak,
|
||||||
John Burton,
|
John Burton,
|
||||||
Niels de Carpentier,
|
Niels de Carpentier,
|
||||||
|
Gordon Chaffee,
|
||||||
Jimen Ching,
|
Jimen Ching,
|
||||||
David A. Cuthbert,
|
David A. Cuthbert,
|
||||||
Huw D. M. Davies,
|
Huw D. M. Davies,
|
||||||
Roman Dolejsi,
|
Roman Dolejsi,
|
||||||
Frans van Dorsselaer,
|
Frans van Dorsselaer,
|
||||||
Chris Faherty,
|
Chris Faherty,
|
||||||
|
Carsten Fallesen,
|
||||||
Paul Falstad,
|
Paul Falstad,
|
||||||
David Faure,
|
David Faure,
|
||||||
Claus Fischer,
|
Claus Fischer,
|
||||||
|
@ -71,6 +74,7 @@ Steffen Moeller,
|
||||||
Andreas Mohr,
|
Andreas Mohr,
|
||||||
Philippe De Muyter,
|
Philippe De Muyter,
|
||||||
Itai Nahshon,
|
Itai Nahshon,
|
||||||
|
Kristian Nielsen,
|
||||||
Henrik Olsen,
|
Henrik Olsen,
|
||||||
Michael Patra,
|
Michael Patra,
|
||||||
Dimitrie O. Paun,
|
Dimitrie O. Paun,
|
||||||
|
@ -114,11 +118,13 @@ Ronan Waide,
|
||||||
Eric Warnke,
|
Eric Warnke,
|
||||||
Manfred Weichel,
|
Manfred Weichel,
|
||||||
Morten Welinder,
|
Morten Welinder,
|
||||||
|
Len White,
|
||||||
Lawson Whitney,
|
Lawson Whitney,
|
||||||
Jan Willamowius,
|
Jan Willamowius,
|
||||||
Carl Williams,
|
Carl Williams,
|
||||||
Karl Guenter Wuensch,
|
Karl Guenter Wuensch,
|
||||||
Eric Youngdale,
|
Eric Youngdale,
|
||||||
James Youngman,
|
James Youngman,
|
||||||
|
Nikita V. Youshchenko,
|
||||||
Mikolaj Zalewski,
|
Mikolaj Zalewski,
|
||||||
and John Zero.
|
and John Zero.
|
||||||
|
|
10
BUGS
10
BUGS
|
@ -9,10 +9,6 @@ As of Nov 1997 -
|
||||||
|
|
||||||
General:
|
General:
|
||||||
|
|
||||||
* 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.
|
|
||||||
|
|
||||||
* TrueType, .FON rasterizer.
|
* TrueType, .FON rasterizer.
|
||||||
|
|
||||||
* No thread/process scheduling support in Win32 code.
|
* No thread/process scheduling support in Win32 code.
|
||||||
|
@ -38,9 +34,11 @@ Miscellaneous:
|
||||||
|
|
||||||
* Invisible controls in BCW dialogs.
|
* Invisible controls in BCW dialogs.
|
||||||
|
|
||||||
* MIRC is unable to show 'Options' dialog.
|
* mIRC 'commands' menu stays on top and will not refresh.
|
||||||
|
|
||||||
* Tab switching in MIRC 'Setup' dialog leaks memory.
|
* mIRC is unable to show 'Options' dialog.
|
||||||
|
|
||||||
|
* Tab switching in mIRC 'Setup' dialog leaks memory.
|
||||||
|
|
||||||
* nBytesWidth in CURSORICONINFO is bogus for some bpp
|
* nBytesWidth in CURSORICONINFO is bogus for some bpp
|
||||||
(doesn't reflect the fact that bits are packed and 16-bit aligned).
|
(doesn't reflect the fact that bits are packed and 16-bit aligned).
|
||||||
|
|
133
ChangeLog
133
ChangeLog
|
@ -1,3 +1,134 @@
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Sat Nov 29 12:35:26 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
|
||||||
|
|
||||||
|
* [if1632/builtin.c]
|
||||||
|
Build a complete PE header for builtin Win32 modules.
|
||||||
|
|
||||||
|
* [loader/pe_image.c] [loader/module.c]
|
||||||
|
HMODULE32 now points to the loading address of the module. There
|
||||||
|
is no longer a separate PE_MODULE structure.
|
||||||
|
|
||||||
|
Fri Nov 28 11:21:47 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
|
||||||
|
|
||||||
|
* [ole/*][configure.in][Makefile.in][include/interfaces.h]
|
||||||
|
[if1632/olesvr32.spec][if1632/olecli32.spec]
|
||||||
|
New directory, moved OLE stuff there.
|
||||||
|
new .spec files for olecli32,olesvr32, some stubs added.
|
||||||
|
|
||||||
|
* [misc/shell.c]
|
||||||
|
Added support for extracting icons from PE dlls.
|
||||||
|
|
||||||
|
* [misc/shellord.c][if1632/shell32.spec]
|
||||||
|
Added a huge heap of ordinal only exported shell functions
|
||||||
|
(will work only in Win95).
|
||||||
|
|
||||||
|
* [loader/task.c]
|
||||||
|
Hack to make MakeProcInstance16 work in all cases (mplayer.exe).
|
||||||
|
|
||||||
|
* [win32/string32.c][include/string32.h]
|
||||||
|
Obsolete, removed.
|
||||||
|
|
||||||
|
* [windows/keyboard.c]
|
||||||
|
Added *RegisterHotkey.
|
||||||
|
|
||||||
|
* [objects/font.c][objects/text.c]
|
||||||
|
Added GetFontLanguageInfo, GetTextCharsetInfo.
|
||||||
|
|
||||||
|
Wed Nov 26 18:10:40 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
|
||||||
|
|
||||||
|
* [misc/network.c]
|
||||||
|
In WNetGetConnection16 return the Drive label and not the DOS-Cwd.
|
||||||
|
Makes Wordview 6 start on a network connected machine.
|
||||||
|
|
||||||
|
* [controls/status.c]
|
||||||
|
Catch a Null pointer in SW_SetText.
|
||||||
|
|
||||||
|
* [files/dos_fs.c]
|
||||||
|
Add NT5 functions GetLongPathName32.
|
||||||
|
|
||||||
|
* [files/file.c]
|
||||||
|
Make GetTempFileName16 accept drive 0 (Current Drive) too.
|
||||||
|
Handle more errors and be more verbose in FILE_SetDosError, fix
|
||||||
|
an error in DeleteFile32W
|
||||||
|
|
||||||
|
* [memory/virtual.c]
|
||||||
|
Implement FlushViewOfFile.
|
||||||
|
|
||||||
|
* [misc/crtdll]
|
||||||
|
Implement _rotl and splitpath and add a stub for
|
||||||
|
_abnormal_termination.
|
||||||
|
|
||||||
|
* [misc/printdrv.c]
|
||||||
|
Stub for EnumPrinters32A.
|
||||||
|
|
||||||
|
* [win32/newfns]
|
||||||
|
Add Stub for QueryPerformanceFrequency, change return value
|
||||||
|
for QueryPerformanceCounter.
|
||||||
|
Add stub for DeviceIoControl.
|
||||||
|
|
||||||
|
Tue Nov 25 15:55:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
|
||||||
|
|
||||||
|
* [controls/combo.c] [controls/edit.c] [windows/defwnd.c]
|
||||||
|
[windows/winpos.c] [windows/win.c]
|
||||||
|
Removed WIN_NO_REDRAW flag.
|
||||||
|
|
||||||
|
Tue Nov 25 13:20:35 1997 Douglas Ridgway <ridgway@taiga.v-wave.com>
|
||||||
|
|
||||||
|
* [graphics/x11drv/bitblt.c]
|
||||||
|
Fixed memory leak in BITBLT_GetDstArea.
|
||||||
|
|
||||||
|
Sun Nov 23 14:05:23 1997 Andreas Mohr <100.30936@germany.net>
|
||||||
|
|
||||||
|
* [files/directory.c]
|
||||||
|
Export windows system directory to environment.
|
||||||
|
|
||||||
|
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/w32skrnl.spec]
|
||||||
|
[if1632/win32s16.spec] [misc/w32scomb.c] [misc/w32skrnl.c]
|
||||||
|
Added Win32s DLLs W32SKRNL and WIN32S16.
|
||||||
|
|
||||||
|
* [if1632/kernel32.spec] [loader/module.c]
|
||||||
|
Added misc functions for Win32s.
|
||||||
|
|
||||||
|
* [if1632/kernel.spec] [loader/task.c]
|
||||||
|
Added DefineHandleTable().
|
||||||
|
|
||||||
|
* [scheduler/process.c]
|
||||||
|
Fixed SetEnvironmentVariable32A() to avoid heap corruption.
|
||||||
|
|
||||||
|
Sat Nov 22 14:11:42 1997 Kristian Nielsen <kristian.nielsen@risoe.dk>
|
||||||
|
|
||||||
|
* [windows/painting.c]
|
||||||
|
Fix leak in BeginPaint16() for CS_PARENTDC windows where the
|
||||||
|
update region was not properly released.
|
||||||
|
|
||||||
|
Thu Nov 20 03:55:29 1997 Gordon Chaffee <chaffee@CS.Berkeley.EDU>
|
||||||
|
|
||||||
|
* [loader/pe_image.c]
|
||||||
|
Implemented forwarded DLL functions.
|
||||||
|
|
||||||
|
* [objects/dib.c]
|
||||||
|
Added support for 16- and 32-bit mode DIBs.
|
||||||
|
Support negative bitmap heights.
|
||||||
|
|
||||||
|
* [win32/process.c]
|
||||||
|
Added stub for CreateProcess32W.
|
||||||
|
|
||||||
|
* [win32/security.c] [include/ntdll.h]
|
||||||
|
Added stubs for LookupAccountSid32A/W.
|
||||||
|
|
||||||
|
* [scheduler/process.c]
|
||||||
|
Use the size specified in the PE header for the process heap.
|
||||||
|
|
||||||
|
Mon Nov 17 00:53:35 1997 Len White <phreak@cgocable.net>
|
||||||
|
|
||||||
|
* [msdos/int3d.c]
|
||||||
|
New file. Stubs for int3d.
|
||||||
|
|
||||||
|
Sun Nov 16 12:30:00 PST 1997 Jason Schonberg <schon@mti.sgi.com>
|
||||||
|
|
||||||
|
* [include/aspi.h]
|
||||||
|
Changed comment style from C++ to C.
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
Sun Nov 16 07:42:44 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
|
Sun Nov 16 07:42:44 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
|
||||||
|
|
||||||
|
@ -78,7 +209,7 @@ Fri Nov 7 19:44:26 1997 Olaf Flebbe <o.flebbe@science-computing.de>
|
||||||
* [loader/resource.c] [user32.spec]
|
* [loader/resource.c] [user32.spec]
|
||||||
Stubs for CopyAcceleratorTable, Destroy AcceleratorTable.
|
Stubs for CopyAcceleratorTable, Destroy AcceleratorTable.
|
||||||
|
|
||||||
Thu Nov 6 22:37:04 1997 Morten Welinder <welinder@rentec.com>
|
Thu Nov 6 22:37:04 1997 Morten Welinder <terra@diku.dk>
|
||||||
|
|
||||||
* [files/drive.c]
|
* [files/drive.c]
|
||||||
(GetDiskFreeSpace32A): Cap at 2GB.
|
(GetDiskFreeSpace32A): Cap at 2GB.
|
||||||
|
|
10
Makefile.in
10
Makefile.in
|
@ -37,6 +37,7 @@ LIBSUBDIRS = \
|
||||||
msdos \
|
msdos \
|
||||||
multimedia \
|
multimedia \
|
||||||
objects \
|
objects \
|
||||||
|
ole \
|
||||||
resources \
|
resources \
|
||||||
scheduler \
|
scheduler \
|
||||||
win32 \
|
win32 \
|
||||||
|
@ -79,6 +80,7 @@ LIBOBJS = \
|
||||||
msdos/msdos.o \
|
msdos/msdos.o \
|
||||||
multimedia/multimedia.o \
|
multimedia/multimedia.o \
|
||||||
objects/objects.o \
|
objects/objects.o \
|
||||||
|
ole/ole.o \
|
||||||
resources/resources.o \
|
resources/resources.o \
|
||||||
scheduler/scheduler.o \
|
scheduler/scheduler.o \
|
||||||
win32/win32.o \
|
win32/win32.o \
|
||||||
|
@ -98,18 +100,18 @@ install:: install_$(MAIN_TARGET)
|
||||||
|
|
||||||
emu: wine
|
emu: wine
|
||||||
|
|
||||||
lib: $(LIB_TARGET)
|
lib: $(LIBSUBDIRS) $(LIB_TARGET)
|
||||||
|
|
||||||
wine wine.sym: $(LIB_TARGET) $(EMUSUBDIRS) dummy
|
wine wine.sym: $(LIBSUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
|
||||||
$(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
|
$(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
|
||||||
nm -n wine | grep -v _compiled >wine.sym
|
nm -n wine | grep -v _compiled >wine.sym
|
||||||
|
|
||||||
libwine.a: $(LIBSUBDIRS) dummy
|
libwine.a: $(LIBOBJS)
|
||||||
$(RM) $@
|
$(RM) $@
|
||||||
$(AR) $@ $(LIBOBJS)
|
$(AR) $@ $(LIBOBJS)
|
||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
libwine.so.1.0: $(LIBSUBDIRS) dummy
|
libwine.so.1.0: $(LIBOBJS)
|
||||||
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
|
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
|
||||||
|
|
||||||
install_emu: dummy
|
install_emu: dummy
|
||||||
|
|
|
@ -2521,9 +2521,11 @@ miscemu/Makefile
|
||||||
msdos/Makefile
|
msdos/Makefile
|
||||||
multimedia/Makefile
|
multimedia/Makefile
|
||||||
objects/Makefile
|
objects/Makefile
|
||||||
|
ole/Makefile
|
||||||
programs/Makefile
|
programs/Makefile
|
||||||
programs/progman/Makefile
|
programs/progman/Makefile
|
||||||
programs/winhelp/Makefile
|
programs/winhelp/Makefile
|
||||||
|
programs/winver/Makefile
|
||||||
rc/Makefile
|
rc/Makefile
|
||||||
resources/Makefile
|
resources/Makefile
|
||||||
scheduler/Makefile
|
scheduler/Makefile
|
||||||
|
@ -2643,9 +2645,11 @@ miscemu/Makefile
|
||||||
msdos/Makefile
|
msdos/Makefile
|
||||||
multimedia/Makefile
|
multimedia/Makefile
|
||||||
objects/Makefile
|
objects/Makefile
|
||||||
|
ole/Makefile
|
||||||
programs/Makefile
|
programs/Makefile
|
||||||
programs/progman/Makefile
|
programs/progman/Makefile
|
||||||
programs/winhelp/Makefile
|
programs/winhelp/Makefile
|
||||||
|
programs/winver/Makefile
|
||||||
rc/Makefile
|
rc/Makefile
|
||||||
resources/Makefile
|
resources/Makefile
|
||||||
scheduler/Makefile
|
scheduler/Makefile
|
||||||
|
|
|
@ -146,9 +146,11 @@ miscemu/Makefile
|
||||||
msdos/Makefile
|
msdos/Makefile
|
||||||
multimedia/Makefile
|
multimedia/Makefile
|
||||||
objects/Makefile
|
objects/Makefile
|
||||||
|
ole/Makefile
|
||||||
programs/Makefile
|
programs/Makefile
|
||||||
programs/progman/Makefile
|
programs/progman/Makefile
|
||||||
programs/winhelp/Makefile
|
programs/winhelp/Makefile
|
||||||
|
programs/winver/Makefile
|
||||||
rc/Makefile
|
rc/Makefile
|
||||||
resources/Makefile
|
resources/Makefile
|
||||||
scheduler/Makefile
|
scheduler/Makefile
|
||||||
|
|
|
@ -363,6 +363,9 @@ static void CBPaintButton(LPHEADCOMBO lphc, HDC16 hdc)
|
||||||
UINT32 x, y;
|
UINT32 x, y;
|
||||||
BOOL32 bBool;
|
BOOL32 bBool;
|
||||||
|
|
||||||
|
if( lphc->wState & CBF_NOREDRAW )
|
||||||
|
return;
|
||||||
|
|
||||||
hPrevBrush = (HBRUSH32)SelectObject32(hdc, sysColorObjects.hbrushBtnFace);
|
hPrevBrush = (HBRUSH32)SelectObject32(hdc, sysColorObjects.hbrushBtnFace);
|
||||||
CONV_RECT16TO32( &lphc->RectButton, &r );
|
CONV_RECT16TO32( &lphc->RectButton, &r );
|
||||||
|
|
||||||
|
@ -401,6 +404,9 @@ static void CBPaintText(LPHEADCOMBO lphc, HDC16 hdc)
|
||||||
INT32 id, size = 0;
|
INT32 id, size = 0;
|
||||||
LPSTR pText = NULL;
|
LPSTR pText = NULL;
|
||||||
|
|
||||||
|
if( lphc->wState & CBF_NOREDRAW )
|
||||||
|
return;
|
||||||
|
|
||||||
/* follow Windows combobox that sends a bunch of text
|
/* follow Windows combobox that sends a bunch of text
|
||||||
* inquiries to its listbox while processing WM_PAINT. */
|
* inquiries to its listbox while processing WM_PAINT. */
|
||||||
|
|
||||||
|
@ -508,7 +514,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC16 hParamDC)
|
||||||
|
|
||||||
hDC = (hParamDC) ? hParamDC
|
hDC = (hParamDC) ? hParamDC
|
||||||
: BeginPaint16( lphc->self->hwndSelf, &ps);
|
: BeginPaint16( lphc->self->hwndSelf, &ps);
|
||||||
if( hDC && !(lphc->self->flags & WIN_NO_REDRAW) )
|
if( hDC && !(lphc->wState & CBF_NOREDRAW) )
|
||||||
{
|
{
|
||||||
HBRUSH32 hPrevBrush, hBkgBrush;
|
HBRUSH32 hPrevBrush, hBkgBrush;
|
||||||
|
|
||||||
|
@ -673,11 +679,14 @@ static void CBDropDown( LPHEADCOMBO lphc )
|
||||||
|
|
||||||
SetWindowPos32( lphc->hWndLBox, HWND_TOP, rect.left, rect.top,
|
SetWindowPos32( lphc->hWndLBox, HWND_TOP, rect.left, rect.top,
|
||||||
rect.right - rect.left, rect.bottom - rect.top,
|
rect.right - rect.left, rect.bottom - rect.top,
|
||||||
SWP_NOACTIVATE | SWP_NOSIZE );
|
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOREDRAW);
|
||||||
if( pRect )
|
if( !(lphc->wState & CBF_NOREDRAW) )
|
||||||
RedrawWindow16( lphc->self->hwndSelf, pRect, 0, RDW_INVALIDATE |
|
{
|
||||||
|
if( pRect )
|
||||||
|
RedrawWindow16( lphc->self->hwndSelf, pRect, 0, RDW_INVALIDATE |
|
||||||
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
|
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
|
||||||
ShowWindow32( lphc->hWndLBox, SW_SHOWNA );
|
ShowWindow32( lphc->hWndLBox, SW_SHOWNA );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -722,7 +731,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL32 ok, BOOL32 bButton )
|
||||||
bButton = TRUE;
|
bButton = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( bButton )
|
if( bButton && !(lphc->wState & CBF_NOREDRAW) )
|
||||||
RedrawWindow16( hWnd, &rect, 0, RDW_INVALIDATE |
|
RedrawWindow16( hWnd, &rect, 0, RDW_INVALIDATE |
|
||||||
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
|
RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN );
|
||||||
CB_NOTIFY( lphc, CBN_CLOSEUP );
|
CB_NOTIFY( lphc, CBN_CLOSEUP );
|
||||||
|
@ -1036,7 +1045,7 @@ static void CBResetPos( LPHEADCOMBO lphc, LPRECT16 lbRect, BOOL32 bRedraw )
|
||||||
lphc->RectEdit.bottom - lphc->RectEdit.top,
|
lphc->RectEdit.bottom - lphc->RectEdit.top,
|
||||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
|
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
|
||||||
lphc->wState &= ~CBF_NORESIZE;
|
lphc->wState &= ~CBF_NORESIZE;
|
||||||
if( bRedraw )
|
if( bRedraw && !(lphc->wState & CBF_NOREDRAW) )
|
||||||
RedrawWindow32( lphc->self->hwndSelf, NULL, 0,
|
RedrawWindow32( lphc->self->hwndSelf, NULL, 0,
|
||||||
RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW );
|
RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW );
|
||||||
}
|
}
|
||||||
|
@ -1336,6 +1345,11 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_SETREDRAW:
|
case WM_SETREDRAW:
|
||||||
|
if( wParam )
|
||||||
|
lphc->wState &= ~CBF_NOREDRAW;
|
||||||
|
else
|
||||||
|
lphc->wState |= CBF_NOREDRAW;
|
||||||
|
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
SendMessage32A( lphc->hWndEdit, message, wParam, lParam );
|
SendMessage32A( lphc->hWndEdit, message, wParam, lParam );
|
||||||
SendMessage32A( lphc->hWndLBox, message, wParam, lParam );
|
SendMessage32A( lphc->hWndLBox, message, wParam, lParam );
|
||||||
|
|
108
controls/edit.c
108
controls/edit.c
|
@ -84,6 +84,8 @@ typedef struct
|
||||||
INT32 left_margin; /* in pixels */
|
INT32 left_margin; /* in pixels */
|
||||||
INT32 right_margin; /* in pixels */
|
INT32 right_margin; /* in pixels */
|
||||||
RECT32 format_rect;
|
RECT32 format_rect;
|
||||||
|
INT32 region_posx; /* Position of cursor relative to region: */
|
||||||
|
INT32 region_posy; /* -1: to left, 0: within, 1: to right */
|
||||||
EDITWORDBREAKPROC16 word_break_proc16;
|
EDITWORDBREAKPROC16 word_break_proc16;
|
||||||
EDITWORDBREAKPROC32A word_break_proc32A;
|
EDITWORDBREAKPROC32A word_break_proc32A;
|
||||||
INT32 line_count; /* number of lines */
|
INT32 line_count; /* number of lines */
|
||||||
|
@ -1016,6 +1018,7 @@ static INT32 EDIT_CharFromPos(WND *wnd, EDITSTATE *es, INT32 x, INT32 y, LPBOOL3
|
||||||
INT32 line = (y - es->format_rect.top) / es->line_height + es->y_offset;
|
INT32 line = (y - es->format_rect.top) / es->line_height + es->y_offset;
|
||||||
INT32 line_index = 0;
|
INT32 line_index = 0;
|
||||||
LINEDEF *line_def = es->first_line_def;
|
LINEDEF *line_def = es->first_line_def;
|
||||||
|
INT32 low, high;
|
||||||
while ((line > 0) && line_def->next) {
|
while ((line > 0) && line_def->next) {
|
||||||
line_index += line_def->length;
|
line_index += line_def->length;
|
||||||
line_def = line_def->next;
|
line_def = line_def->next;
|
||||||
|
@ -1035,11 +1038,16 @@ static INT32 EDIT_CharFromPos(WND *wnd, EDITSTATE *es, INT32 x, INT32 y, LPBOOL3
|
||||||
dc = GetDC32(wnd->hwndSelf);
|
dc = GetDC32(wnd->hwndSelf);
|
||||||
if (es->font)
|
if (es->font)
|
||||||
old_font = SelectObject32(dc, es->font);
|
old_font = SelectObject32(dc, es->font);
|
||||||
/* FIXME: inefficient algorithm */
|
low = line_index + 1;
|
||||||
for (index = line_index + 1 ; index < line_index + line_def->net_length ; index++)
|
high = line_index + line_def->net_length + 1;
|
||||||
if (LOWORD(GetTabbedTextExtent32A(dc, es->text + line_index,
|
while (low < high - 1)
|
||||||
index - line_index, es->tabs_count, es->tabs)) >= x)
|
{
|
||||||
break;
|
INT32 mid = (low + high) / 2;
|
||||||
|
if (LOWORD(GetTabbedTextExtent32A(dc, es->text + line_index,mid - line_index, es->tabs_count, es->tabs)) > x) high = mid;
|
||||||
|
else low = mid;
|
||||||
|
}
|
||||||
|
index = low;
|
||||||
|
|
||||||
if (after_wrap)
|
if (after_wrap)
|
||||||
*after_wrap = ((index == line_index + line_def->net_length) &&
|
*after_wrap = ((index == line_index + line_def->net_length) &&
|
||||||
(line_def->ending == END_WRAP));
|
(line_def->ending == END_WRAP));
|
||||||
|
@ -2257,14 +2265,12 @@ static BOOL32 EDIT_EM_LineScroll(WND *wnd, EDITSTATE *es, INT32 dx, INT32 dy)
|
||||||
nyoff = es->line_count - 1;
|
nyoff = es->line_count - 1;
|
||||||
dy = (es->y_offset - nyoff) * es->line_height;
|
dy = (es->y_offset - nyoff) * es->line_height;
|
||||||
if (dx || dy) {
|
if (dx || dy) {
|
||||||
if (!(wnd->flags & WIN_NO_REDRAW)) {
|
RECT32 rc1;
|
||||||
RECT32 rc1;
|
RECT32 rc;
|
||||||
RECT32 rc;
|
GetClientRect32(wnd->hwndSelf, &rc1);
|
||||||
GetClientRect32(wnd->hwndSelf, &rc1);
|
IntersectRect32(&rc, &rc1, &es->format_rect);
|
||||||
IntersectRect32(&rc, &rc1, &es->format_rect);
|
ScrollWindowEx32(wnd->hwndSelf, -dx, dy,
|
||||||
ScrollWindowEx32(wnd->hwndSelf, -dx, dy,
|
NULL, &rc, (HRGN32)NULL, NULL, SW_INVALIDATE);
|
||||||
NULL, &rc, (HRGN32)NULL, NULL, SW_INVALIDATE);
|
|
||||||
}
|
|
||||||
es->y_offset = nyoff;
|
es->y_offset = nyoff;
|
||||||
es->x_offset += dx;
|
es->x_offset += dx;
|
||||||
}
|
}
|
||||||
|
@ -2440,8 +2446,7 @@ static void EDIT_EM_ReplaceSel(WND *wnd, EDITSTATE *es, BOOL32 can_undo, LPCSTR
|
||||||
EDIT_EM_ScrollCaret(wnd, es);
|
EDIT_EM_ScrollCaret(wnd, es);
|
||||||
|
|
||||||
/* FIXME: really inefficient */
|
/* FIXME: really inefficient */
|
||||||
if (!(wnd->flags & WIN_NO_REDRAW))
|
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
||||||
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2525,8 +2530,7 @@ static void EDIT_EM_SetHandle(WND *wnd, EDITSTATE *es, HLOCAL32 hloc)
|
||||||
es->flags &= ~EF_MODIFIED;
|
es->flags &= ~EF_MODIFIED;
|
||||||
es->flags &= ~EF_UPDATE;
|
es->flags &= ~EF_UPDATE;
|
||||||
EDIT_BuildLineDefs_ML(wnd, es);
|
EDIT_BuildLineDefs_ML(wnd, es);
|
||||||
if (!(wnd->flags & WIN_NO_REDRAW))
|
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
||||||
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
|
||||||
EDIT_EM_ScrollCaret(wnd, es);
|
EDIT_EM_ScrollCaret(wnd, es);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2569,8 +2573,7 @@ static void EDIT_EM_SetHandle16(WND *wnd, EDITSTATE *es, HLOCAL16 hloc)
|
||||||
es->flags &= ~EF_MODIFIED;
|
es->flags &= ~EF_MODIFIED;
|
||||||
es->flags &= ~EF_UPDATE;
|
es->flags &= ~EF_UPDATE;
|
||||||
EDIT_BuildLineDefs_ML(wnd, es);
|
EDIT_BuildLineDefs_ML(wnd, es);
|
||||||
if (!(wnd->flags & WIN_NO_REDRAW))
|
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
||||||
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
|
||||||
EDIT_EM_ScrollCaret(wnd, es);
|
EDIT_EM_ScrollCaret(wnd, es);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2612,16 +2615,16 @@ static void EDIT_EM_SetMargins(WND *wnd, EDITSTATE *es, INT32 action, INT32 left
|
||||||
* FIXME: do some GetABCCharWidth, or so
|
* FIXME: do some GetABCCharWidth, or so
|
||||||
* This is just preliminary
|
* This is just preliminary
|
||||||
*/
|
*/
|
||||||
es->left_margin = es->right_margin = es->char_width;
|
es->left_margin = es->right_margin = es->char_width/4;
|
||||||
} else
|
} else
|
||||||
es->left_margin = es->right_margin = es->char_width;
|
es->left_margin = es->right_margin = es->char_width/4;
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
if (action & EC_LEFTMARGIN)
|
if (action & EC_LEFTMARGIN)
|
||||||
es->left_margin = left;
|
es->left_margin = left;
|
||||||
if (action & EC_RIGHTMARGIN)
|
if (action & EC_RIGHTMARGIN)
|
||||||
es->right_margin = right;
|
es->right_margin = right;
|
||||||
}
|
}
|
||||||
|
dprintf_edit(stddeb, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2678,24 +2681,36 @@ static void EDIT_EM_SetSel(WND *wnd, EDITSTATE *es, UINT32 start, UINT32 end, BO
|
||||||
es->flags |= EF_AFTER_WRAP;
|
es->flags |= EF_AFTER_WRAP;
|
||||||
else
|
else
|
||||||
es->flags &= ~EF_AFTER_WRAP;
|
es->flags &= ~EF_AFTER_WRAP;
|
||||||
if (!(wnd->flags & WIN_NO_REDRAW)) {
|
if (es->flags & EF_FOCUSED) {
|
||||||
if (es->flags & EF_FOCUSED) {
|
LRESULT pos = EDIT_EM_PosFromChar(wnd, es, end, after_wrap);
|
||||||
LRESULT pos = EDIT_EM_PosFromChar(wnd, es, end, after_wrap);
|
SetCaretPos32(SLOWORD(pos), SHIWORD(pos));
|
||||||
SetCaretPos32(SLOWORD(pos), SHIWORD(pos));
|
|
||||||
}
|
|
||||||
/* FIXME: little efficiency, could be better */
|
|
||||||
ORDER_UINT32(start, end);
|
|
||||||
ORDER_UINT32(start, old_start);
|
|
||||||
ORDER_UINT32(start, old_end);
|
|
||||||
ORDER_UINT32(end, old_start);
|
|
||||||
ORDER_UINT32(end, old_end);
|
|
||||||
ORDER_UINT32(old_start, old_end);
|
|
||||||
if (end != old_start) {
|
|
||||||
EDIT_InvalidateText(wnd, es, start, end);
|
|
||||||
EDIT_InvalidateText(wnd, es, old_start, old_end);
|
|
||||||
} else
|
|
||||||
EDIT_InvalidateText(wnd, es, start, old_end);
|
|
||||||
}
|
}
|
||||||
|
/* This is little bit more efficient than before, not sure if it can be improved. FIXME? */
|
||||||
|
ORDER_UINT32(start, end);
|
||||||
|
ORDER_UINT32(end, old_end);
|
||||||
|
ORDER_UINT32(start, old_start);
|
||||||
|
ORDER_UINT32(old_start, old_end);
|
||||||
|
if (end != old_start)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* One can also do
|
||||||
|
* ORDER_UINT32(end, old_start);
|
||||||
|
* EDIT_InvalidateText(wnd, es, start, end);
|
||||||
|
* EDIT_InvalidateText(wnd, es, old_start, old_end);
|
||||||
|
* in place of the following if statement.
|
||||||
|
*/
|
||||||
|
if (old_start > end )
|
||||||
|
{
|
||||||
|
EDIT_InvalidateText(wnd, es, start, end);
|
||||||
|
EDIT_InvalidateText(wnd, es, old_start, old_end);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EDIT_InvalidateText(wnd, es, start, old_start);
|
||||||
|
EDIT_InvalidateText(wnd, es, end, old_end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else EDIT_InvalidateText(wnd, es, start, old_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3479,6 +3494,7 @@ static LRESULT EDIT_WM_LButtonDown(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x,
|
||||||
e = EDIT_CharFromPos(wnd, es, x, y, &after_wrap);
|
e = EDIT_CharFromPos(wnd, es, x, y, &after_wrap);
|
||||||
EDIT_EM_SetSel(wnd, es, (keys & MK_SHIFT) ? es->selection_start : e, e, after_wrap);
|
EDIT_EM_SetSel(wnd, es, (keys & MK_SHIFT) ? es->selection_start : e, e, after_wrap);
|
||||||
EDIT_EM_ScrollCaret(wnd, es);
|
EDIT_EM_ScrollCaret(wnd, es);
|
||||||
|
es->region_posx = es->region_posx = 0;
|
||||||
SetTimer32(wnd->hwndSelf, 0, 100, NULL);
|
SetTimer32(wnd->hwndSelf, 0, 100, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3508,6 +3524,7 @@ static LRESULT EDIT_WM_MouseMove(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x, I
|
||||||
{
|
{
|
||||||
INT32 e;
|
INT32 e;
|
||||||
BOOL32 after_wrap;
|
BOOL32 after_wrap;
|
||||||
|
INT32 prex, prey;
|
||||||
|
|
||||||
if (GetCapture32() != wnd->hwndSelf)
|
if (GetCapture32() != wnd->hwndSelf)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3516,7 +3533,10 @@ static LRESULT EDIT_WM_MouseMove(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x, I
|
||||||
* FIXME: gotta do some scrolling if outside client
|
* FIXME: gotta do some scrolling if outside client
|
||||||
* area. Maybe reset the timer ?
|
* area. Maybe reset the timer ?
|
||||||
*/
|
*/
|
||||||
|
prex = x; prey = y;
|
||||||
EDIT_ConfinePoint(wnd, es, &x, &y);
|
EDIT_ConfinePoint(wnd, es, &x, &y);
|
||||||
|
es->region_posx = (prex < x) ? -1 : ((prex > x) ? 1 : 0);
|
||||||
|
es->region_posy = (prey < y) ? -1 : ((prey > y) ? 1 : 0);
|
||||||
e = EDIT_CharFromPos(wnd, es, x, y, &after_wrap);
|
e = EDIT_CharFromPos(wnd, es, x, y, &after_wrap);
|
||||||
EDIT_EM_SetSel(wnd, es, es->selection_start, e, after_wrap);
|
EDIT_EM_SetSel(wnd, es, es->selection_start, e, after_wrap);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3677,7 +3697,7 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT32 font, BOOL32 redraw
|
||||||
EDIT_EM_SetMargins(wnd, es, EC_USEFONTINFO, 0, 0);
|
EDIT_EM_SetMargins(wnd, es, EC_USEFONTINFO, 0, 0);
|
||||||
if (es->style & ES_MULTILINE)
|
if (es->style & ES_MULTILINE)
|
||||||
EDIT_BuildLineDefs_ML(wnd, es);
|
EDIT_BuildLineDefs_ML(wnd, es);
|
||||||
if (redraw && !(wnd->flags & WIN_NO_REDRAW))
|
if (redraw)
|
||||||
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
|
||||||
if (es->flags & EF_FOCUSED) {
|
if (es->flags & EF_FOCUSED) {
|
||||||
LRESULT pos;
|
LRESULT pos;
|
||||||
|
@ -3701,6 +3721,7 @@ static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPCSTR text)
|
||||||
if (text) {
|
if (text) {
|
||||||
dprintf_edit(stddeb, "\t'%s'\n", text);
|
dprintf_edit(stddeb, "\t'%s'\n", text);
|
||||||
EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
|
EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
|
||||||
|
es->x_offset = 0;
|
||||||
}
|
}
|
||||||
es->flags |= EF_MODIFIED;
|
es->flags |= EF_MODIFIED;
|
||||||
es->flags |= EF_UPDATE;
|
es->flags |= EF_UPDATE;
|
||||||
|
@ -3749,8 +3770,13 @@ static LRESULT EDIT_WM_SysKeyDown(WND *wnd, EDITSTATE *es, INT32 key, DWORD key_
|
||||||
*/
|
*/
|
||||||
static void EDIT_WM_Timer(WND *wnd, EDITSTATE *es, INT32 id, TIMERPROC32 timer_proc)
|
static void EDIT_WM_Timer(WND *wnd, EDITSTATE *es, INT32 id, TIMERPROC32 timer_proc)
|
||||||
{
|
{
|
||||||
|
if (es->region_posx < 0) {
|
||||||
|
EDIT_MoveBackward(wnd, es, TRUE);
|
||||||
|
} else if (es->region_posx > 0) {
|
||||||
|
EDIT_MoveForward(wnd, es, TRUE);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* FIXME: gotta do some scrolling here, like
|
* FIXME: gotta do some vertical scrolling here, like
|
||||||
* EDIT_EM_LineScroll(wnd, 0, 1);
|
* EDIT_EM_LineScroll(wnd, 0, 1);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,13 +118,11 @@ SW_SetText(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
|
||||||
part_num = ((INT32) wParam) & 0x00ff;
|
part_num = ((INT32) wParam) & 0x00ff;
|
||||||
style = ((INT32) wParam) & 0xff00;
|
style = ((INT32) wParam) & 0xff00;
|
||||||
|
|
||||||
if (part_num >= 255)
|
if ((self->simple) || (self->parts==NULL) || (part_num==255))
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if ((self->simple) || (part_num==255))
|
|
||||||
part = &self->part0;
|
part = &self->part0;
|
||||||
else
|
else
|
||||||
part = &self->parts[part_num];
|
part = &self->parts[part_num];
|
||||||
|
if (!part) return FALSE;
|
||||||
part->style = style;
|
part->style = style;
|
||||||
if (style == SBT_OWNERDRAW) {
|
if (style == SBT_OWNERDRAW) {
|
||||||
part->text = text;
|
part->text = text;
|
||||||
|
|
|
@ -347,19 +347,18 @@ void DEBUG_AddModuleBreakpoints(void)
|
||||||
|
|
||||||
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
|
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
|
||||||
{
|
{
|
||||||
PE_MODULE *pe = pModule->pe_module;
|
|
||||||
PE_MODREF *pem;
|
PE_MODREF *pem;
|
||||||
if (!pCurrentProcess) continue;
|
if (!pCurrentProcess) continue;
|
||||||
pem = pCurrentProcess->modref_list;
|
pem = pCurrentProcess->modref_list;
|
||||||
while (pem)
|
while (pem)
|
||||||
{
|
{
|
||||||
if (pem->pe_module == pe) break;
|
if (pem->module == pModule->module32) break;
|
||||||
pem = pem->next;
|
pem = pem->next;
|
||||||
}
|
}
|
||||||
if (!pem) continue;
|
if (!pem) continue;
|
||||||
addr.seg = 0;
|
addr.seg = 0;
|
||||||
addr.off = pem->load_addr +
|
addr.off = (DWORD)RVA_PTR( pem->module,
|
||||||
(DWORD)pe->pe_header->OptionalHeader.AddressOfEntryPoint;
|
OptionalHeader.AddressOfEntryPoint );
|
||||||
fprintf( stderr, "Win32 task '%s': ", entry.szModule );
|
fprintf( stderr, "Win32 task '%s': ", entry.szModule );
|
||||||
DEBUG_AddBreakpoint( &addr );
|
DEBUG_AddBreakpoint( &addr );
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,13 +418,10 @@ DEBUG_EvalExpr(struct expr * exp)
|
||||||
exp->un.rgister.result = DEBUG_GetRegister(exp->un.rgister.reg);
|
exp->un.rgister.result = DEBUG_GetRegister(exp->un.rgister.reg);
|
||||||
rtn.off = (unsigned int) &exp->un.rgister.result;
|
rtn.off = (unsigned int) &exp->un.rgister.result;
|
||||||
if( exp->un.rgister.reg == REG_EIP )
|
if( exp->un.rgister.reg == REG_EIP )
|
||||||
{
|
|
||||||
rtn.seg = CS_reg(&DEBUG_context);
|
rtn.seg = CS_reg(&DEBUG_context);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
rtn.seg = DS_reg(&DEBUG_context);
|
rtn.seg = DS_reg(&DEBUG_context);
|
||||||
}
|
DBG_FIX_ADDR_SEG( &rtn, 0 );
|
||||||
break;
|
break;
|
||||||
case EXPR_TYPE_BINOP:
|
case EXPR_TYPE_BINOP:
|
||||||
exp1 = DEBUG_EvalExpr(exp->un.binop.exp1);
|
exp1 = DEBUG_EvalExpr(exp->un.binop.exp1);
|
||||||
|
|
|
@ -789,24 +789,23 @@ static void DEBUG_LoadEntryPoints16( HMODULE16 hModule, NE_MODULE *pModule,
|
||||||
*
|
*
|
||||||
* Load the entry points of a Win32 module into the hash table.
|
* Load the entry points of a Win32 module into the hash table.
|
||||||
*/
|
*/
|
||||||
static void DEBUG_LoadEntryPoints32( PE_MODULE *pe, const char *name )
|
static void DEBUG_LoadEntryPoints32( HMODULE32 hModule, const char *name )
|
||||||
{
|
{
|
||||||
#define RVA(x) (load_addr+(DWORD)(x))
|
#define RVA(x) (hModule+(DWORD)(x))
|
||||||
|
|
||||||
DBG_ADDR addr;
|
DBG_ADDR addr;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
int i, j;
|
int i, j;
|
||||||
|
IMAGE_SECTION_HEADER *pe_seg;
|
||||||
IMAGE_EXPORT_DIRECTORY *exports;
|
IMAGE_EXPORT_DIRECTORY *exports;
|
||||||
IMAGE_DATA_DIRECTORY *debug_dir;
|
IMAGE_DATA_DIRECTORY *debug_dir;
|
||||||
DWORD load_addr;
|
|
||||||
WORD *ordinals;
|
WORD *ordinals;
|
||||||
void **functions;
|
void **functions;
|
||||||
const char **names;
|
const char **names;
|
||||||
|
|
||||||
PE_MODREF *pem = pCurrentProcess->modref_list;
|
PE_MODREF *pem = pCurrentProcess->modref_list;
|
||||||
while (pem && (pem->pe_module != pe)) pem = pem->next;
|
while (pem && (pem->module != hModule)) pem = pem->next;
|
||||||
if (!pem) return;
|
if (!pem) return;
|
||||||
load_addr = pem->load_addr;
|
|
||||||
exports = pem->pe_export;
|
exports = pem->pe_export;
|
||||||
|
|
||||||
addr.seg = 0;
|
addr.seg = 0;
|
||||||
|
@ -814,22 +813,24 @@ static void DEBUG_LoadEntryPoints32( PE_MODULE *pe, const char *name )
|
||||||
|
|
||||||
/* Add start of DLL */
|
/* Add start of DLL */
|
||||||
|
|
||||||
addr.off = load_addr;
|
addr.off = hModule;
|
||||||
DEBUG_AddSymbol( name, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
DEBUG_AddSymbol( name, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
||||||
|
|
||||||
/* Add entry point */
|
/* Add entry point */
|
||||||
|
|
||||||
sprintf( buffer, "%s.EntryPoint", name );
|
sprintf( buffer, "%s.EntryPoint", name );
|
||||||
addr.off = RVA( pe->pe_header->OptionalHeader.AddressOfEntryPoint );
|
addr.off = (DWORD)RVA_PTR( hModule, OptionalHeader.AddressOfEntryPoint );
|
||||||
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
||||||
|
|
||||||
/* Add start of sections */
|
/* Add start of sections */
|
||||||
|
|
||||||
for (i = 0; i < pe->pe_header->FileHeader.NumberOfSections; i++)
|
pe_seg = PE_SECTIONS(hModule);
|
||||||
|
for (i = 0; i < PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
|
||||||
{
|
{
|
||||||
sprintf( buffer, "%s.%s", name, pe->pe_seg[i].Name );
|
sprintf( buffer, "%s.%s", name, pe_seg->Name );
|
||||||
addr.off = RVA( pe->pe_seg[i].VirtualAddress );
|
addr.off = RVA(pe_seg->VirtualAddress );
|
||||||
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
||||||
|
pe_seg++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add exported functions */
|
/* Add exported functions */
|
||||||
|
@ -859,9 +860,9 @@ static void DEBUG_LoadEntryPoints32( PE_MODULE *pe, const char *name )
|
||||||
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_dir = &pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG];
|
debug_dir = &PE_HEADER(hModule)->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG];
|
||||||
if (debug_dir->Size)
|
if (debug_dir->Size)
|
||||||
DEBUG_RegisterDebugInfo( pe, load_addr, name,
|
DEBUG_RegisterDebugInfo( hModule, name,
|
||||||
debug_dir->VirtualAddress, debug_dir->Size );
|
debug_dir->VirtualAddress, debug_dir->Size );
|
||||||
#undef RVA
|
#undef RVA
|
||||||
}
|
}
|
||||||
|
@ -884,10 +885,7 @@ void DEBUG_LoadEntryPoints(void)
|
||||||
fprintf( stderr, " %s", entry.szModule );
|
fprintf( stderr, " %s", entry.szModule );
|
||||||
|
|
||||||
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
|
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
|
||||||
{
|
DEBUG_LoadEntryPoints32( pModule->module32, entry.szModule );
|
||||||
if (pModule->flags & NE_FFLAGS_BUILTIN) continue;
|
|
||||||
DEBUG_LoadEntryPoints32( pModule->pe_module, entry.szModule );
|
|
||||||
}
|
|
||||||
else /* NE module */
|
else /* NE module */
|
||||||
DEBUG_LoadEntryPoints16( entry.hModule, pModule, entry.szModule );
|
DEBUG_LoadEntryPoints16( entry.hModule, pModule, entry.szModule );
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,8 +509,8 @@ struct deferred_debug_info
|
||||||
char * module_name;
|
char * module_name;
|
||||||
char * dbg_info;
|
char * dbg_info;
|
||||||
int dbg_size;
|
int dbg_size;
|
||||||
|
HMODULE32 module;
|
||||||
LPIMAGE_DEBUG_DIRECTORY dbgdir;
|
LPIMAGE_DEBUG_DIRECTORY dbgdir;
|
||||||
struct pe_data * pe;
|
|
||||||
LPIMAGE_SECTION_HEADER sectp;
|
LPIMAGE_SECTION_HEADER sectp;
|
||||||
int nsect;
|
int nsect;
|
||||||
short int dbg_index;
|
short int dbg_index;
|
||||||
|
@ -881,8 +881,8 @@ DEBUG_InitCVDataTypes()
|
||||||
* We don't fully process it here for performance reasons.
|
* We don't fully process it here for performance reasons.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr,
|
DEBUG_RegisterDebugInfo( HMODULE32 hModule, const char *module_name,
|
||||||
const char *module_name, u_long v_addr, u_long size)
|
u_long v_addr, u_long size)
|
||||||
{
|
{
|
||||||
int has_codeview = FALSE;
|
int has_codeview = FALSE;
|
||||||
int rtn = FALSE;
|
int rtn = FALSE;
|
||||||
|
@ -891,7 +891,7 @@ DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr,
|
||||||
struct deferred_debug_info * deefer;
|
struct deferred_debug_info * deefer;
|
||||||
|
|
||||||
orig_size = size;
|
orig_size = size;
|
||||||
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (load_addr + v_addr);
|
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (hModule + v_addr);
|
||||||
for(; size >= sizeof(*dbgptr); size -= sizeof(*dbgptr), dbgptr++ )
|
for(; size >= sizeof(*dbgptr); size -= sizeof(*dbgptr), dbgptr++ )
|
||||||
{
|
{
|
||||||
switch(dbgptr->Type)
|
switch(dbgptr->Type)
|
||||||
|
@ -904,7 +904,7 @@ DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr,
|
||||||
}
|
}
|
||||||
|
|
||||||
size = orig_size;
|
size = orig_size;
|
||||||
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (load_addr + v_addr);
|
dbgptr = (LPIMAGE_DEBUG_DIRECTORY) (hModule + v_addr);
|
||||||
for(; size >= sizeof(*dbgptr); size -= sizeof(*dbgptr), dbgptr++ )
|
for(; size >= sizeof(*dbgptr); size -= sizeof(*dbgptr), dbgptr++ )
|
||||||
{
|
{
|
||||||
switch(dbgptr->Type)
|
switch(dbgptr->Type)
|
||||||
|
@ -935,16 +935,16 @@ DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr,
|
||||||
* it just points to itself, and we can ignore this.
|
* it just points to itself, and we can ignore this.
|
||||||
*/
|
*/
|
||||||
if( (dbgptr->Type == IMAGE_DEBUG_TYPE_MISC)
|
if( (dbgptr->Type == IMAGE_DEBUG_TYPE_MISC)
|
||||||
&& (pe->pe_header->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED) == 0 )
|
&& (PE_HEADER(hModule)->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED) == 0 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
deefer = (struct deferred_debug_info *) xmalloc(sizeof(*deefer));
|
deefer = (struct deferred_debug_info *) xmalloc(sizeof(*deefer));
|
||||||
deefer->pe = pe;
|
deefer->module = hModule;
|
||||||
|
deefer->load_addr = (char *)hModule;
|
||||||
deefer->dbg_info = NULL;
|
deefer->dbg_info = NULL;
|
||||||
deefer->dbg_size = 0;
|
deefer->dbg_size = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the important bits. What we do after this depends
|
* Read the important bits. What we do after this depends
|
||||||
|
@ -952,16 +952,15 @@ DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr,
|
||||||
* to proceed if we know what we need to do next.
|
* to proceed if we know what we need to do next.
|
||||||
*/
|
*/
|
||||||
deefer->dbg_size = dbgptr->SizeOfData;
|
deefer->dbg_size = dbgptr->SizeOfData;
|
||||||
deefer->dbg_info = (char *)(pe->mappeddll+dbgptr->PointerToRawData);
|
deefer->dbg_info = (char *)(hModule + dbgptr->PointerToRawData);
|
||||||
deefer->load_addr = (char *) load_addr;
|
|
||||||
deefer->dbgdir = dbgptr;
|
deefer->dbgdir = dbgptr;
|
||||||
deefer->next = dbglist;
|
deefer->next = dbglist;
|
||||||
deefer->loaded = FALSE;
|
deefer->loaded = FALSE;
|
||||||
deefer->dbg_index = DEBUG_next_index;
|
deefer->dbg_index = DEBUG_next_index;
|
||||||
deefer->module_name = xstrdup(module_name);
|
deefer->module_name = xstrdup(module_name);
|
||||||
|
|
||||||
deefer->sectp = pe->pe_seg;
|
deefer->sectp = PE_SECTIONS(hModule);
|
||||||
deefer->nsect = pe->pe_header->FileHeader.NumberOfSections;
|
deefer->nsect = PE_HEADER(hModule)->FileHeader.NumberOfSections;
|
||||||
|
|
||||||
dbglist = deefer;
|
dbglist = deefer;
|
||||||
break;
|
break;
|
||||||
|
@ -985,7 +984,7 @@ DEBUG_RegisterELFDebugInfo(int load_addr, u_long size, char * name)
|
||||||
struct deferred_debug_info * deefer;
|
struct deferred_debug_info * deefer;
|
||||||
|
|
||||||
deefer = (struct deferred_debug_info *) xmalloc(sizeof(*deefer));
|
deefer = (struct deferred_debug_info *) xmalloc(sizeof(*deefer));
|
||||||
deefer->pe = NULL;
|
deefer->module = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the important bits. What we do after this depends
|
* Read the important bits. What we do after this depends
|
||||||
|
@ -2401,19 +2400,9 @@ void DEBUG_InfoShare(void)
|
||||||
fprintf(stderr,"Address\t\tModule\tName\n");
|
fprintf(stderr,"Address\t\tModule\tName\n");
|
||||||
|
|
||||||
for(deefer = dbglist; deefer; deefer = deefer->next)
|
for(deefer = dbglist; deefer; deefer = deefer->next)
|
||||||
{
|
{
|
||||||
if( deefer->pe == NULL )
|
fprintf(stderr,"0x%8.8x\t(%s)\t%s\n", (unsigned int) deefer->load_addr,
|
||||||
{
|
deefer->module ? "Win32" : "ELF", deefer->module_name);
|
||||||
fprintf(stderr,"0x%8.8x\t(ELF)\t%s\n",
|
}
|
||||||
(unsigned int) deefer->load_addr,
|
|
||||||
deefer->module_name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fprintf(stderr,"0x%8.8x\t(Win32)\t%s\n",
|
|
||||||
(unsigned int) deefer->load_addr,
|
|
||||||
deefer->module_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ int DIR_Init(void)
|
||||||
dprintf_dosfs( stddeb, "TempDir = %s\nCwd = %c:\\%s\n",
|
dprintf_dosfs( stddeb, "TempDir = %s\nCwd = %c:\\%s\n",
|
||||||
DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) );
|
DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) );
|
||||||
|
|
||||||
/* Put the temp and Windows directories into the environment */
|
/* Put the temp and Windows and system directories into the environment */
|
||||||
|
|
||||||
env_p = HEAP_xalloc( SystemHeap, 0, strlen(DIR_TempDosDir) + 6 );
|
env_p = HEAP_xalloc( SystemHeap, 0, strlen(DIR_TempDosDir) + 6 );
|
||||||
strcpy( env_p, "TEMP=" );
|
strcpy( env_p, "TEMP=" );
|
||||||
|
@ -171,6 +171,10 @@ int DIR_Init(void)
|
||||||
strcpy( env_p, "windir=" );
|
strcpy( env_p, "windir=" );
|
||||||
strcpy( env_p + 7, DIR_WindowsDosDir );
|
strcpy( env_p + 7, DIR_WindowsDosDir );
|
||||||
putenv( env_p );
|
putenv( env_p );
|
||||||
|
env_p = HEAP_xalloc( SystemHeap, 0, strlen(DIR_SystemDosDir) + 11 );
|
||||||
|
strcpy( env_p, "winsysdir=" );
|
||||||
|
strcpy( env_p + 10, DIR_SystemDosDir );
|
||||||
|
putenv( env_p );
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -797,6 +797,42 @@ DWORD WINAPI GetShortPathName32W( LPCWSTR longpath, LPWSTR shortpath,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* GetLongPathName32A (KERNEL32.xxx)
|
||||||
|
*/
|
||||||
|
DWORD WINAPI GetLongPathName32A( LPCSTR shortpath, LPSTR longpath,
|
||||||
|
DWORD longlen )
|
||||||
|
{
|
||||||
|
DOS_FULL_NAME full_name;
|
||||||
|
|
||||||
|
/* FIXME: is it correct to always return a fully qualified short path? */
|
||||||
|
if (!DOSFS_GetFullName( shortpath, TRUE, &full_name )) return 0;
|
||||||
|
lstrcpyn32A( longpath, full_name.long_name, longlen );
|
||||||
|
return strlen( full_name.long_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* GetLongPathName32W (KERNEL32.269)
|
||||||
|
*/
|
||||||
|
DWORD WINAPI GetLongPathName32W( LPCWSTR shortpath, LPWSTR longpath,
|
||||||
|
DWORD longlen )
|
||||||
|
{
|
||||||
|
DOS_FULL_NAME full_name;
|
||||||
|
DWORD ret = 0;
|
||||||
|
LPSTR shortpathA = HEAP_strdupWtoA( GetProcessHeap(), 0, shortpath );
|
||||||
|
|
||||||
|
/* FIXME: is it correct to always return a fully qualified short path? */
|
||||||
|
if (DOSFS_GetFullName( shortpathA, TRUE, &full_name ))
|
||||||
|
{
|
||||||
|
ret = strlen( full_name.short_name );
|
||||||
|
lstrcpynAtoW( longpath, full_name.long_name, longlen );
|
||||||
|
}
|
||||||
|
HeapFree( GetProcessHeap(), 0, shortpathA );
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DOSFS_DoGetFullPathName
|
* DOSFS_DoGetFullPathName
|
||||||
*
|
*
|
||||||
|
|
14
files/file.c
14
files/file.c
|
@ -146,7 +146,8 @@ void FILE_SetDosError(void)
|
||||||
{
|
{
|
||||||
int save_errno = errno; /* errno gets overwritten by printf */
|
int save_errno = errno; /* errno gets overwritten by printf */
|
||||||
|
|
||||||
dprintf_file(stddeb, "FILE_SetDosError: errno = %d\n", errno );
|
dprintf_file(stddeb, "FILE_SetDosError: errno = %d %s\n", errno,
|
||||||
|
sys_errlist[errno] );
|
||||||
switch (save_errno)
|
switch (save_errno)
|
||||||
{
|
{
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
|
@ -179,6 +180,12 @@ void FILE_SetDosError(void)
|
||||||
case EEXIST:
|
case EEXIST:
|
||||||
DOS_ERROR( ER_FileExists, EC_Exists, SA_Abort, EL_Disk );
|
DOS_ERROR( ER_FileExists, EC_Exists, SA_Abort, EL_Disk );
|
||||||
break;
|
break;
|
||||||
|
case EINVAL:
|
||||||
|
DOS_ERROR( ER_SeekError, EC_NotFound, SA_Ignore, EL_Disk );
|
||||||
|
break;
|
||||||
|
case ENOTEMPTY:
|
||||||
|
DOS_ERROR( ERROR_DIR_NOT_EMPTY, EC_Exists, SA_Ignore, EL_Disk );
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
perror( "int21: unknown errno" );
|
perror( "int21: unknown errno" );
|
||||||
DOS_ERROR( ER_GeneralFailure, EC_SystemFailure, SA_Abort, EL_Unknown );
|
DOS_ERROR( ER_GeneralFailure, EC_SystemFailure, SA_Abort, EL_Unknown );
|
||||||
|
@ -523,6 +530,9 @@ UINT16 WINAPI GetTempFileName16( BYTE drive, LPCSTR prefix, UINT16 unique,
|
||||||
{
|
{
|
||||||
char temppath[144];
|
char temppath[144];
|
||||||
|
|
||||||
|
if (!(drive & ~TF_FORCEDRIVE)) /* drive 0 means current default drive */
|
||||||
|
drive |= DRIVE_GetCurrentDrive();
|
||||||
|
|
||||||
if ((drive & TF_FORCEDRIVE) &&
|
if ((drive & TF_FORCEDRIVE) &&
|
||||||
!DRIVE_IsValid( toupper(drive & ~TF_FORCEDRIVE) - 'A' ))
|
!DRIVE_IsValid( toupper(drive & ~TF_FORCEDRIVE) - 'A' ))
|
||||||
{
|
{
|
||||||
|
@ -1185,7 +1195,7 @@ BOOL32 WINAPI DeleteFile32A( LPCSTR path )
|
||||||
BOOL32 WINAPI DeleteFile32W( LPCWSTR path )
|
BOOL32 WINAPI DeleteFile32W( LPCWSTR path )
|
||||||
{
|
{
|
||||||
LPSTR xpath = HEAP_strdupWtoA( GetProcessHeap(), 0, path );
|
LPSTR xpath = HEAP_strdupWtoA( GetProcessHeap(), 0, path );
|
||||||
BOOL32 ret = RemoveDirectory32A( xpath );
|
BOOL32 ret = DeleteFile32A( xpath );
|
||||||
HeapFree( GetProcessHeap(), 0, xpath );
|
HeapFree( GetProcessHeap(), 0, xpath );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,7 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
|
||||||
LPSTR x=PTR_SEG_TO_LIN(segout);
|
LPSTR x=PTR_SEG_TO_LIN(segout);
|
||||||
lstrcpy32A(lpvOutData,x);
|
lstrcpy32A(lpvOutData,x);
|
||||||
SEGPTR_FREE(x);
|
SEGPTR_FREE(x);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case ENABLEPAIRKERNING: {
|
case ENABLEPAIRKERNING: {
|
||||||
LPINT16 enab = (LPINT16)PTR_SEG_TO_LIN(segout);
|
LPINT16 enab = (LPINT16)PTR_SEG_TO_LIN(segout);
|
||||||
|
@ -99,6 +100,7 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
|
||||||
*(LPINT32)lpvOutData = *enab;
|
*(LPINT32)lpvOutData = *enab;
|
||||||
SEGPTR_FREE(enab);
|
SEGPTR_FREE(enab);
|
||||||
SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
|
SEGPTR_FREE(PTR_SEG_TO_LIN(segin));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case GETFACENAME: {
|
case GETFACENAME: {
|
||||||
LPSTR x = (LPSTR)PTR_SEG_TO_LIN(segout);
|
LPSTR x = (LPSTR)PTR_SEG_TO_LIN(segout);
|
||||||
|
|
|
@ -975,6 +975,7 @@ static void BITBLT_GetDstArea(DC *dc, Pixmap pixmap, GC gc, RECT32 *visRectDst)
|
||||||
XPutPixel( image, x, y,
|
XPutPixel( image, x, y,
|
||||||
COLOR_PixelToPalette[XGetPixel( image, x, y )]);
|
COLOR_PixelToPalette[XGetPixel( image, x, y )]);
|
||||||
XPutImage( display, pixmap, gc, image, 0, 0, 0, 0, width, height );
|
XPutImage( display, pixmap, gc, image, 0, 0, 0, 0, width, height );
|
||||||
|
XDestroyImage( image );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,9 @@ DLLS = \
|
||||||
ole2prox.spec \
|
ole2prox.spec \
|
||||||
ole32.spec \
|
ole32.spec \
|
||||||
olecli.spec \
|
olecli.spec \
|
||||||
|
olecli32.spec \
|
||||||
olesvr.spec \
|
olesvr.spec \
|
||||||
|
olesvr32.spec \
|
||||||
shell.spec \
|
shell.spec \
|
||||||
shell32.spec \
|
shell32.spec \
|
||||||
sound.spec \
|
sound.spec \
|
||||||
|
@ -43,7 +45,9 @@ DLLS = \
|
||||||
user32.spec \
|
user32.spec \
|
||||||
ver.spec \
|
ver.spec \
|
||||||
version.spec \
|
version.spec \
|
||||||
|
w32skrnl.spec \
|
||||||
w32sys.spec \
|
w32sys.spec \
|
||||||
|
win32s16.spec \
|
||||||
win87em.spec \
|
win87em.spec \
|
||||||
winaspi.spec \
|
winaspi.spec \
|
||||||
wing.spec \
|
wing.spec \
|
||||||
|
|
|
@ -87,8 +87,8 @@ type win32
|
||||||
0083 stub LogonUserW
|
0083 stub LogonUserW
|
||||||
0084 stub LookupAccountNameA
|
0084 stub LookupAccountNameA
|
||||||
0085 stub LookupAccountNameW
|
0085 stub LookupAccountNameW
|
||||||
0086 stub LookupAccountSidA
|
0086 stdcall LookupAccountSidA(ptr ptr ptr ptr ptr ptr ptr) LookupAccountSid32A
|
||||||
0087 stub LookupAccountSidW
|
0087 stdcall LookupAccountSidW(ptr ptr ptr ptr ptr ptr ptr) LookupAccountSid32W
|
||||||
0088 stub LookupPrivilegeDisplayNameA
|
0088 stub LookupPrivilegeDisplayNameA
|
||||||
0089 stub LookupPrivilegeDisplayNameW
|
0089 stub LookupPrivilegeDisplayNameW
|
||||||
0090 stub LookupPrivilegeNameA
|
0090 stub LookupPrivilegeNameA
|
||||||
|
|
280
if1632/builtin.c
280
if1632/builtin.c
|
@ -16,6 +16,7 @@
|
||||||
#include "neexe.h"
|
#include "neexe.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
|
#include "process.h"
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
@ -101,6 +102,7 @@ extern const DLL_DESCRIPTOR DDEML_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR LZEXPAND_Descriptor;
|
extern const DLL_DESCRIPTOR LZEXPAND_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR VER_Descriptor;
|
extern const DLL_DESCRIPTOR VER_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR W32SYS_Descriptor;
|
extern const DLL_DESCRIPTOR W32SYS_Descriptor;
|
||||||
|
extern const DLL_DESCRIPTOR WIN32S16_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR WING_Descriptor;
|
extern const DLL_DESCRIPTOR WING_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR WINASPI_Descriptor;
|
extern const DLL_DESCRIPTOR WINASPI_Descriptor;
|
||||||
|
|
||||||
|
@ -110,15 +112,18 @@ extern const DLL_DESCRIPTOR ADVAPI32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR COMCTL32_Descriptor;
|
extern const DLL_DESCRIPTOR COMCTL32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR COMDLG32_Descriptor;
|
extern const DLL_DESCRIPTOR COMDLG32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR CRTDLL_Descriptor;
|
extern const DLL_DESCRIPTOR CRTDLL_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR OLE32_Descriptor;
|
|
||||||
extern const DLL_DESCRIPTOR GDI32_Descriptor;
|
extern const DLL_DESCRIPTOR GDI32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR KERNEL32_Descriptor;
|
extern const DLL_DESCRIPTOR KERNEL32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR LZ32_Descriptor;
|
extern const DLL_DESCRIPTOR LZ32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR MPR_Descriptor;
|
extern const DLL_DESCRIPTOR MPR_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR NTDLL_Descriptor;
|
extern const DLL_DESCRIPTOR NTDLL_Descriptor;
|
||||||
|
extern const DLL_DESCRIPTOR OLE32_Descriptor;
|
||||||
|
extern const DLL_DESCRIPTOR OLECLI32_Descriptor;
|
||||||
|
extern const DLL_DESCRIPTOR OLESVR32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR SHELL32_Descriptor;
|
extern const DLL_DESCRIPTOR SHELL32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR USER32_Descriptor;
|
extern const DLL_DESCRIPTOR USER32_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR VERSION_Descriptor;
|
extern const DLL_DESCRIPTOR VERSION_Descriptor;
|
||||||
|
extern const DLL_DESCRIPTOR W32SKRNL_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR WINMM_Descriptor;
|
extern const DLL_DESCRIPTOR WINMM_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR WINSPOOL_Descriptor;
|
extern const DLL_DESCRIPTOR WINSPOOL_Descriptor;
|
||||||
extern const DLL_DESCRIPTOR WSOCK32_Descriptor;
|
extern const DLL_DESCRIPTOR WSOCK32_Descriptor;
|
||||||
|
@ -156,6 +161,7 @@ static BUILTIN_DLL BuiltinDLLs[] =
|
||||||
{ &LZEXPAND_Descriptor, NULL, 0 },
|
{ &LZEXPAND_Descriptor, NULL, 0 },
|
||||||
{ &VER_Descriptor, NULL, 0 },
|
{ &VER_Descriptor, NULL, 0 },
|
||||||
{ &W32SYS_Descriptor, NULL, 0 },
|
{ &W32SYS_Descriptor, NULL, 0 },
|
||||||
|
{ &WIN32S16_Descriptor, NULL, 0 },
|
||||||
{ &WING_Descriptor, NULL, 0 },
|
{ &WING_Descriptor, NULL, 0 },
|
||||||
{ &WINASPI_Descriptor, NULL, 0 },
|
{ &WINASPI_Descriptor, NULL, 0 },
|
||||||
/* Win32 DLLs */
|
/* Win32 DLLs */
|
||||||
|
@ -163,15 +169,18 @@ static BUILTIN_DLL BuiltinDLLs[] =
|
||||||
{ &COMCTL32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
{ &COMCTL32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
||||||
{ &COMDLG32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &COMDLG32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &CRTDLL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &CRTDLL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &OLE32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
|
||||||
{ &GDI32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &GDI32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &KERNEL32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_ALWAYS_USED },
|
{ &KERNEL32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &LZ32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &LZ32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &MPR_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
{ &MPR_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &NTDLL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &NTDLL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
|
{ &OLE32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
||||||
|
{ &OLECLI32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
||||||
|
{ &OLESVR32_Descriptor, NULL, DLL_FLAG_WIN32 | DLL_FLAG_NOT_USED },
|
||||||
{ &SHELL32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &SHELL32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &USER32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &USER32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &VERSION_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &VERSION_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
|
{ &W32SKRNL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &WINMM_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &WINMM_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &WINSPOOL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &WINSPOOL_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
{ &WSOCK32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
{ &WSOCK32_Descriptor, NULL, DLL_FLAG_WIN32 },
|
||||||
|
@ -182,46 +191,6 @@ static BUILTIN_DLL BuiltinDLLs[] =
|
||||||
/* Ordinal number for interrupt 0 handler in WPROCS.DLL */
|
/* Ordinal number for interrupt 0 handler in WPROCS.DLL */
|
||||||
#define FIRST_INTERRUPT_ORDINAL 100
|
#define FIRST_INTERRUPT_ORDINAL 100
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* BUILTIN_BuildDebugEntryPoints
|
|
||||||
*
|
|
||||||
* Build the table of relay-debugging entry points for a Win32 DLL.
|
|
||||||
*/
|
|
||||||
static void BUILTIN_BuildDebugEntryPoints( BUILTIN_DLL *dll )
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
DEBUG_ENTRY_POINT *entry;
|
|
||||||
extern void RELAY_CallFrom32();
|
|
||||||
|
|
||||||
assert( !dll->dbg_funcs );
|
|
||||||
assert( dll->flags & DLL_FLAG_WIN32 );
|
|
||||||
dll->dbg_funcs = HeapAlloc( SystemHeap, 0,
|
|
||||||
dll->descr->win32.nb_funcs * sizeof(DEBUG_ENTRY_POINT) );
|
|
||||||
entry = dll->dbg_funcs;
|
|
||||||
for (i = 0; i < dll->descr->win32.nb_funcs; i++, entry++)
|
|
||||||
{
|
|
||||||
BYTE args = dll->descr->win32.args[i];
|
|
||||||
entry->call = 0xe8; /* call */
|
|
||||||
switch(args)
|
|
||||||
{
|
|
||||||
case 0xfe: /* register func */
|
|
||||||
entry->callfrom32 = (DWORD)dll->descr->win32.functions[i] -
|
|
||||||
(DWORD)&entry->ret;
|
|
||||||
entry->ret = 0x90; /* nop */
|
|
||||||
entry->args = 0;
|
|
||||||
break;
|
|
||||||
case 0xff: /* stub */
|
|
||||||
entry->args = 0xffff;
|
|
||||||
break;
|
|
||||||
default: /* normal function (stdcall or cdecl) */
|
|
||||||
entry->callfrom32 = (DWORD)RELAY_CallFrom32 - (DWORD)&entry->ret;
|
|
||||||
entry->ret = (args & 0x80) ? 0xc3 : 0xc2; /* ret / ret $n */
|
|
||||||
entry->args = (args & 0x7f) * sizeof(int);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* BUILTIN_DoLoadModule16
|
* BUILTIN_DoLoadModule16
|
||||||
|
@ -279,20 +248,179 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
|
||||||
* Load a built-in Win32 module. Helper function for BUILTIN_LoadModule
|
* Load a built-in Win32 module. Helper function for BUILTIN_LoadModule
|
||||||
* and BUILTIN_Init.
|
* and BUILTIN_Init.
|
||||||
*/
|
*/
|
||||||
static HMODULE16 BUILTIN_DoLoadModule32( BUILTIN_DLL *table )
|
static HMODULE32 BUILTIN_DoLoadModule32( BUILTIN_DLL *dll )
|
||||||
{
|
{
|
||||||
|
extern void RELAY_CallFrom32();
|
||||||
|
|
||||||
HMODULE16 hModule;
|
HMODULE16 hModule;
|
||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
OFSTRUCT ofs;
|
OFSTRUCT ofs;
|
||||||
|
IMAGE_DATA_DIRECTORY *dir;
|
||||||
|
IMAGE_DOS_HEADER *dos;
|
||||||
|
IMAGE_NT_HEADERS *nt;
|
||||||
|
IMAGE_SECTION_HEADER *sec;
|
||||||
|
IMAGE_EXPORT_DIRECTORY *exp;
|
||||||
|
LPVOID *funcs;
|
||||||
|
LPSTR *names;
|
||||||
|
DEBUG_ENTRY_POINT *entry;
|
||||||
|
PE_MODREF *pem;
|
||||||
|
INT32 i, size;
|
||||||
|
BYTE *addr;
|
||||||
|
|
||||||
sprintf( ofs.szPathName, "%s.DLL", table->descr->name );
|
/* Allocate the module */
|
||||||
|
|
||||||
|
size = (sizeof(IMAGE_DOS_HEADER)
|
||||||
|
+ sizeof(IMAGE_NT_HEADERS)
|
||||||
|
+ 2 * sizeof(IMAGE_SECTION_HEADER)
|
||||||
|
+ sizeof(IMAGE_EXPORT_DIRECTORY)
|
||||||
|
+ dll->descr->win32.nb_funcs * sizeof(LPVOID)
|
||||||
|
+ dll->descr->win32.nb_names * sizeof(LPSTR));
|
||||||
|
if (debugging_relay)
|
||||||
|
size += dll->descr->win32.nb_funcs * sizeof(DEBUG_ENTRY_POINT);
|
||||||
|
addr = VirtualAlloc( NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
|
||||||
|
if (!addr) return 0;
|
||||||
|
dos = (IMAGE_DOS_HEADER *)addr;
|
||||||
|
nt = (IMAGE_NT_HEADERS *)(dos + 1);
|
||||||
|
sec = (IMAGE_SECTION_HEADER *)(nt + 1);
|
||||||
|
exp = (IMAGE_EXPORT_DIRECTORY *)(sec + 2);
|
||||||
|
funcs = (LPVOID *)(exp + 1);
|
||||||
|
names = (LPSTR *)(funcs + dll->descr->win32.nb_funcs);
|
||||||
|
entry = (DEBUG_ENTRY_POINT *)(names + dll->descr->win32.nb_names);
|
||||||
|
|
||||||
|
/* Build the DOS and NT headers */
|
||||||
|
|
||||||
|
dos->e_magic = IMAGE_DOS_SIGNATURE;
|
||||||
|
dos->e_lfanew = sizeof(*dos);
|
||||||
|
|
||||||
|
nt->Signature = IMAGE_NT_SIGNATURE;
|
||||||
|
nt->FileHeader.Machine = IMAGE_FILE_MACHINE_I386;
|
||||||
|
nt->FileHeader.NumberOfSections = 2; /* exports + code */
|
||||||
|
nt->FileHeader.SizeOfOptionalHeader = sizeof(nt->OptionalHeader);
|
||||||
|
nt->FileHeader.Characteristics = IMAGE_FILE_DLL;
|
||||||
|
|
||||||
|
nt->OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
|
||||||
|
nt->OptionalHeader.SizeOfCode = 0x1000;
|
||||||
|
nt->OptionalHeader.SizeOfInitializedData = 0;
|
||||||
|
nt->OptionalHeader.SizeOfUninitializedData = 0;
|
||||||
|
nt->OptionalHeader.ImageBase = (DWORD)addr;
|
||||||
|
nt->OptionalHeader.SectionAlignment = 0x1000;
|
||||||
|
nt->OptionalHeader.FileAlignment = 0x1000;
|
||||||
|
nt->OptionalHeader.MajorOperatingSystemVersion = 1;
|
||||||
|
nt->OptionalHeader.MinorOperatingSystemVersion = 0;
|
||||||
|
nt->OptionalHeader.MajorSubsystemVersion = 4;
|
||||||
|
nt->OptionalHeader.MinorSubsystemVersion = 0;
|
||||||
|
nt->OptionalHeader.SizeOfImage = size;
|
||||||
|
nt->OptionalHeader.SizeOfHeaders = (BYTE *)exp - addr;
|
||||||
|
nt->OptionalHeader.NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
|
||||||
|
|
||||||
|
/* Build the export directory */
|
||||||
|
|
||||||
|
dir = &nt->OptionalHeader.DataDirectory[IMAGE_FILE_EXPORT_DIRECTORY];
|
||||||
|
dir->VirtualAddress = (BYTE *)exp - addr;
|
||||||
|
dir->Size = sizeof(*exp)
|
||||||
|
+ dll->descr->win32.nb_funcs * sizeof(LPVOID)
|
||||||
|
+ dll->descr->win32.nb_names * sizeof(LPSTR);
|
||||||
|
|
||||||
|
/* Build the exports section */
|
||||||
|
|
||||||
|
strcpy( sec->Name, ".edata" );
|
||||||
|
sec->Misc.VirtualSize = dir->Size;
|
||||||
|
sec->VirtualAddress = (BYTE *)exp - addr;
|
||||||
|
sec->SizeOfRawData = dir->Size;
|
||||||
|
sec->PointerToRawData = (BYTE *)exp - addr;
|
||||||
|
sec->Characteristics = (IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||||
|
IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ |
|
||||||
|
IMAGE_SCN_MEM_WRITE);
|
||||||
|
|
||||||
|
/* Build the code section */
|
||||||
|
|
||||||
|
sec++;
|
||||||
|
strcpy( sec->Name, ".code" );
|
||||||
|
if (debugging_relay)
|
||||||
|
sec->SizeOfRawData = dll->descr->win32.nb_funcs * sizeof(DEBUG_ENTRY_POINT);
|
||||||
|
else
|
||||||
|
sec->SizeOfRawData = 1;
|
||||||
|
sec->Misc.VirtualSize = sec->SizeOfRawData;
|
||||||
|
sec->VirtualAddress = (BYTE *)entry - addr;
|
||||||
|
sec->PointerToRawData = (BYTE *)entry - addr;
|
||||||
|
sec->Characteristics = (IMAGE_SCN_CNT_INITIALIZED_DATA |
|
||||||
|
IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ);
|
||||||
|
|
||||||
|
/* Build the exports section data */
|
||||||
|
|
||||||
|
exp->Name = (BYTE *)dll->descr->name - addr; /*??*/
|
||||||
|
exp->Base = dll->descr->win32.base;
|
||||||
|
exp->NumberOfFunctions = dll->descr->win32.nb_funcs;
|
||||||
|
exp->NumberOfNames = dll->descr->win32.nb_names;
|
||||||
|
exp->AddressOfFunctions = (LPDWORD *)((BYTE *)funcs - addr);
|
||||||
|
exp->AddressOfNames = (LPDWORD *)((BYTE *)names - addr);
|
||||||
|
exp->AddressOfNameOrdinals = (LPWORD *)((BYTE *)dll->descr->win32.ordinals - addr);
|
||||||
|
|
||||||
|
/* Build the funcs table */
|
||||||
|
|
||||||
|
if (debugging_relay)
|
||||||
|
{
|
||||||
|
dll->dbg_funcs = entry;
|
||||||
|
for (i = 0; i < dll->descr->win32.nb_funcs; i++, funcs++, entry++)
|
||||||
|
{
|
||||||
|
BYTE args = dll->descr->win32.args[i];
|
||||||
|
entry->call = 0xe8; /* call */
|
||||||
|
switch(args)
|
||||||
|
{
|
||||||
|
case 0xfe: /* register func */
|
||||||
|
entry->callfrom32 = (DWORD)dll->descr->win32.functions[i] -
|
||||||
|
(DWORD)&entry->ret;
|
||||||
|
entry->ret = 0x90; /* nop */
|
||||||
|
entry->args = 0;
|
||||||
|
*funcs = (LPVOID)((BYTE *)entry - addr);
|
||||||
|
break;
|
||||||
|
case 0xff: /* stub or extern */
|
||||||
|
if (dll->descr->win32.functions[i])
|
||||||
|
*funcs = (LPVOID)((BYTE *)dll->descr->win32.functions[i]
|
||||||
|
- addr);
|
||||||
|
break;
|
||||||
|
default: /* normal function (stdcall or cdecl) */
|
||||||
|
entry->callfrom32 = (DWORD)RELAY_CallFrom32 -
|
||||||
|
(DWORD)&entry->ret;
|
||||||
|
entry->ret = (args & 0x80) ? 0xc3 : 0xc2; /*ret/ret $n*/
|
||||||
|
entry->args = (args & 0x7f) * sizeof(int);
|
||||||
|
*funcs = (LPVOID)((BYTE *)entry - addr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < dll->descr->win32.nb_funcs; i++, funcs++)
|
||||||
|
if (dll->descr->win32.functions[i])
|
||||||
|
*funcs = (LPVOID)((BYTE *)dll->descr->win32.functions[i]
|
||||||
|
- addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build the names table */
|
||||||
|
|
||||||
|
for (i = 0; i < exp->NumberOfNames; i++, names++)
|
||||||
|
if (dll->descr->win32.names[i])
|
||||||
|
*names = (LPSTR)((BYTE *)dll->descr->win32.names[i] - addr);
|
||||||
|
|
||||||
|
/* Create a modref */
|
||||||
|
|
||||||
|
pem = (PE_MODREF *)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(*pem) );
|
||||||
|
pem->module = (HMODULE32)addr;
|
||||||
|
pem->pe_export = exp;
|
||||||
|
pem->next = pCurrentProcess->modref_list;
|
||||||
|
pCurrentProcess->modref_list = pem;
|
||||||
|
|
||||||
|
/* Create a Win16 dummy module */
|
||||||
|
|
||||||
|
sprintf( ofs.szPathName, "%s.DLL", dll->descr->name );
|
||||||
hModule = MODULE_CreateDummyModule( &ofs );
|
hModule = MODULE_CreateDummyModule( &ofs );
|
||||||
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
||||||
pModule->pe_module = (PE_MODULE *)table;
|
|
||||||
pModule->flags = NE_FFLAGS_SINGLEDATA | NE_FFLAGS_BUILTIN |
|
pModule->flags = NE_FFLAGS_SINGLEDATA | NE_FFLAGS_BUILTIN |
|
||||||
NE_FFLAGS_LIBMODULE | NE_FFLAGS_WIN32;
|
NE_FFLAGS_LIBMODULE | NE_FFLAGS_WIN32;
|
||||||
if (debugging_relay) BUILTIN_BuildDebugEntryPoints( table );
|
pModule->module32 = (HMODULE32)addr;
|
||||||
return hModule;
|
return pModule->module32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -358,7 +486,7 @@ BOOL32 BUILTIN_Init(void)
|
||||||
* Load a built-in module. If the 'force' parameter is FALSE, we only
|
* Load a built-in module. If the 'force' parameter is FALSE, we only
|
||||||
* load the module if it has not been disabled via the -dll option.
|
* load the module if it has not been disabled via the -dll option.
|
||||||
*/
|
*/
|
||||||
HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL32 force )
|
HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force )
|
||||||
{
|
{
|
||||||
BUILTIN_DLL *table;
|
BUILTIN_DLL *table;
|
||||||
char dllname[16], *p;
|
char dllname[16], *p;
|
||||||
|
@ -484,56 +612,14 @@ FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay, DWORD *typemask )
|
||||||
/* Now find the function */
|
/* Now find the function */
|
||||||
|
|
||||||
ordinal = ((DWORD)relay-(DWORD)dll->dbg_funcs) / sizeof(DEBUG_ENTRY_POINT);
|
ordinal = ((DWORD)relay-(DWORD)dll->dbg_funcs) / sizeof(DEBUG_ENTRY_POINT);
|
||||||
ordinal += descr->base;
|
|
||||||
for (i = 0; i < descr->nb_names; i++)
|
for (i = 0; i < descr->nb_names; i++)
|
||||||
if (descr->ordinals[i] == ordinal) break;
|
if (descr->ordinals[i] == ordinal) break;
|
||||||
assert( i < descr->nb_names );
|
assert( i < descr->nb_names );
|
||||||
|
|
||||||
sprintf( buffer, "%s.%d: %s", descr->name, ordinal, descr->names[i] );
|
sprintf( buffer, "%s.%d: %s", descr->name, ordinal + descr->base,
|
||||||
*typemask = descr->argtypes[ordinal - descr->base];
|
descr->names[i] );
|
||||||
return (FARPROC32)descr->functions[ordinal - descr->base];
|
*typemask = descr->argtypes[ordinal];
|
||||||
}
|
return (FARPROC32)descr->functions[ordinal];
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* BUILTIN_GetProcAddress32
|
|
||||||
*
|
|
||||||
* Implementation of GetProcAddress() for built-in Win32 modules.
|
|
||||||
* FIXME: this should be unified with the real GetProcAddress32().
|
|
||||||
*/
|
|
||||||
FARPROC32 BUILTIN_GetProcAddress32( NE_MODULE *pModule, LPCSTR function )
|
|
||||||
{
|
|
||||||
BUILTIN_DLL *dll = (BUILTIN_DLL *)pModule->pe_module;
|
|
||||||
const WIN32_DESCRIPTOR *info = &dll->descr->win32;
|
|
||||||
WORD ordinal = 0;
|
|
||||||
|
|
||||||
if (!dll) return NULL;
|
|
||||||
|
|
||||||
if (HIWORD(function)) /* Find function by name */
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
dprintf_module( stddeb, "Looking for function %s in %s\n",
|
|
||||||
function, dll->descr->name );
|
|
||||||
for (i = 0; i < info->nb_names; i++)
|
|
||||||
if (!strcmp( function, info->names[i] ))
|
|
||||||
{
|
|
||||||
ordinal = info->ordinals[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i >= info->nb_names) return NULL; /* not found */
|
|
||||||
}
|
|
||||||
else /* Find function by ordinal */
|
|
||||||
{
|
|
||||||
ordinal = LOWORD(function);
|
|
||||||
dprintf_module( stddeb, "Looking for ordinal %d in %s\n",
|
|
||||||
ordinal, dll->descr->name );
|
|
||||||
if ((ordinal < info->base) || (ordinal >= info->base + info->nb_funcs))
|
|
||||||
return NULL; /* not found */
|
|
||||||
}
|
|
||||||
if (dll->dbg_funcs && (dll->dbg_funcs[ordinal-info->base].args != 0xffff))
|
|
||||||
return (FARPROC32)&dll->dbg_funcs[ordinal - info->base];
|
|
||||||
return (FARPROC32)info->functions[ordinal - info->base];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ type win32
|
||||||
33 stub __threadhandle
|
33 stub __threadhandle
|
||||||
34 stub __threadid
|
34 stub __threadid
|
||||||
35 stub __toascii
|
35 stub __toascii
|
||||||
36 stub _abnormal_termination
|
36 cdecl _abnormal_termination() CRTDLL__abnormal_termination
|
||||||
37 stub _access
|
37 stub _access
|
||||||
38 extern _acmdln_dll CRTDLL_acmdln_dll
|
38 extern _acmdln_dll CRTDLL_acmdln_dll
|
||||||
39 stub _aexit_rtn_dll
|
39 stub _aexit_rtn_dll
|
||||||
|
@ -260,7 +260,7 @@ type win32
|
||||||
256 stub _read
|
256 stub _read
|
||||||
257 stub _rmdir
|
257 stub _rmdir
|
||||||
258 stub _rmtmp
|
258 stub _rmtmp
|
||||||
259 stub _rotl
|
259 cdecl _rotl (long long) CRTDLL__rotl
|
||||||
260 stub _rotr
|
260 stub _rotr
|
||||||
261 stub _scalb
|
261 stub _scalb
|
||||||
262 stub _searchenv
|
262 stub _searchenv
|
||||||
|
@ -280,7 +280,7 @@ type win32
|
||||||
276 stub _spawnve
|
276 stub _spawnve
|
||||||
277 stub _spawnvp
|
277 stub _spawnvp
|
||||||
278 stub _spawnvpe
|
278 stub _spawnvpe
|
||||||
279 stub _splitpath
|
279 cdecl _splitpath (ptr ptr ptr ptr ptr) CRTDLL__splitpath
|
||||||
280 cdecl _stat (ptr ptr) CRTDLL__stat
|
280 cdecl _stat (ptr ptr) CRTDLL__stat
|
||||||
281 stub _statusfp
|
281 stub _statusfp
|
||||||
282 cdecl _strcmpi(ptr ptr) CRTDLL__strcmpi
|
282 cdecl _strcmpi(ptr ptr) CRTDLL__strcmpi
|
||||||
|
|
|
@ -385,7 +385,7 @@ file gdi.exe
|
||||||
613 pascal16 EnumFontFamiliesEx(word ptr segptr long long) THUNK_EnumFontFamiliesEx16
|
613 pascal16 EnumFontFamiliesEx(word ptr segptr long long) THUNK_EnumFontFamiliesEx16
|
||||||
614 stub AddLpkToGDI
|
614 stub AddLpkToGDI
|
||||||
615 stub GetCharacterPlacement
|
615 stub GetCharacterPlacement
|
||||||
616 stub GetFontLanguageInfo
|
616 pascal GetFontLanguageInfo(word) GetFontLanguageInfo16
|
||||||
650 stub BuildInverseTableDIB
|
650 stub BuildInverseTableDIB
|
||||||
701 stub GDITHKCONNECTIONDATALS
|
701 stub GDITHKCONNECTIONDATALS
|
||||||
702 stub FT_GDIFTHKTHKCONNECTIONDATA
|
702 stub FT_GDIFTHKTHKCONNECTIONDATA
|
||||||
|
|
|
@ -173,7 +173,7 @@ type win32
|
||||||
166 stub GetCurrentObject
|
166 stub GetCurrentObject
|
||||||
167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
|
167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
|
||||||
168 stdcall GetDCOrgEx(long ptr) GetDCOrgEx
|
168 stdcall GetDCOrgEx(long ptr) GetDCOrgEx
|
||||||
169 stub GetDIBColorTable
|
169 stdcall GetDIBColorTable(long long long ptr) GetDIBColorTable32
|
||||||
170 stdcall GetDIBits(long long long long ptr ptr long) GetDIBits32
|
170 stdcall GetDIBits(long long long long ptr ptr long) GetDIBits32
|
||||||
171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
|
171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
|
||||||
172 stub GetDeviceGammaRamp
|
172 stub GetDeviceGammaRamp
|
||||||
|
@ -186,7 +186,7 @@ type win32
|
||||||
179 stub GetEnhMetaFilePaletteEntries
|
179 stub GetEnhMetaFilePaletteEntries
|
||||||
180 stub GetEnhMetaFileW
|
180 stub GetEnhMetaFileW
|
||||||
181 stub GetFontData
|
181 stub GetFontData
|
||||||
182 stub GetFontLanguageInfo
|
182 stdcall GetFontLanguageInfo(long) GetFontLanguageInfo32
|
||||||
183 stub GetFontResourceInfo
|
183 stub GetFontResourceInfo
|
||||||
184 stub GetFontResourceInfoW
|
184 stub GetFontResourceInfoW
|
||||||
185 stub GetGlyphOutline
|
185 stub GetGlyphOutline
|
||||||
|
@ -315,7 +315,7 @@ type win32
|
||||||
308 stdcall SetBrushOrgEx(long long long ptr) SetBrushOrgEx
|
308 stdcall SetBrushOrgEx(long long long ptr) SetBrushOrgEx
|
||||||
309 stub SetColorAdjustment
|
309 stub SetColorAdjustment
|
||||||
310 stub SetColorSpace
|
310 stub SetColorSpace
|
||||||
311 stub SetDIBColorTable
|
311 stdcall SetDIBColorTable(long long long ptr) SetDIBColorTable32
|
||||||
312 stdcall SetDIBits(long long long long ptr ptr long) SetDIBits32
|
312 stdcall SetDIBits(long long long long ptr ptr long) SetDIBits32
|
||||||
313 stdcall SetDIBitsToDevice(long long long long long long long long long
|
313 stdcall SetDIBitsToDevice(long long long long long long long long long
|
||||||
ptr ptr long) SetDIBitsToDevice32
|
ptr ptr long) SetDIBitsToDevice32
|
||||||
|
@ -389,7 +389,7 @@ type win32
|
||||||
378 stub GdiWinWatchGetClipList
|
378 stub GdiWinWatchGetClipList
|
||||||
379 stub GdiWinWatchOpen
|
379 stub GdiWinWatchOpen
|
||||||
380 stub GetGlyphOutlineWow
|
380 stub GetGlyphOutlineWow
|
||||||
381 stub GetTextCharsetInfo
|
381 stdcall GetTextCharsetInfo(long ptr long) GetTextCharsetInfo
|
||||||
382 stdcall TranslateCharsetInfo(ptr ptr long) TranslateCharSetInfo
|
382 stdcall TranslateCharsetInfo(ptr ptr long) TranslateCharSetInfo
|
||||||
383 stub UpdateICMRegKeyA
|
383 stub UpdateICMRegKeyA
|
||||||
384 stub UpdateICMRegKeyW
|
384 stub UpdateICMRegKeyW
|
||||||
|
|
|
@ -30,7 +30,7 @@ file krnl386.exe
|
||||||
26 pascal16 GlobalFreeAll(word) GlobalFreeAll
|
26 pascal16 GlobalFreeAll(word) GlobalFreeAll
|
||||||
27 pascal16 GetModuleName(word ptr word) GetModuleName
|
27 pascal16 GetModuleName(word ptr word) GetModuleName
|
||||||
28 stub GlobalMasterHandle
|
28 stub GlobalMasterHandle
|
||||||
29 pascal16 Yield() Yield
|
29 pascal16 Yield() Yield16
|
||||||
30 pascal16 WaitEvent(word) WaitEvent
|
30 pascal16 WaitEvent(word) WaitEvent
|
||||||
31 pascal16 PostEvent(word) PostEvent
|
31 pascal16 PostEvent(word) PostEvent
|
||||||
32 pascal16 SetPriority(word s_word) SetPriority
|
32 pascal16 SetPriority(word s_word) SetPriority
|
||||||
|
@ -91,7 +91,7 @@ file krnl386.exe
|
||||||
91 register InitTask() InitTask
|
91 register InitTask() InitTask
|
||||||
92 pascal GetTempDrive(word) WIN16_GetTempDrive
|
92 pascal GetTempDrive(word) WIN16_GetTempDrive
|
||||||
93 pascal16 GetCodeHandle(segptr) GetCodeHandle
|
93 pascal16 GetCodeHandle(segptr) GetCodeHandle
|
||||||
94 stub DefineHandleTable
|
94 pascal16 DefineHandleTable(word) DefineHandleTable16
|
||||||
95 pascal16 LoadLibrary(str) LoadLibrary16
|
95 pascal16 LoadLibrary(str) LoadLibrary16
|
||||||
96 pascal16 FreeLibrary(word) FreeLibrary16
|
96 pascal16 FreeLibrary(word) FreeLibrary16
|
||||||
97 pascal16 GetTempFileName(word str word ptr) GetTempFileName16
|
97 pascal16 GetTempFileName(word str word ptr) GetTempFileName16
|
||||||
|
@ -103,7 +103,7 @@ file krnl386.exe
|
||||||
103 register NetBIOSCall() NetBIOSCall
|
103 register NetBIOSCall() NetBIOSCall
|
||||||
104 stub GetCodeInfo
|
104 stub GetCodeInfo
|
||||||
105 pascal16 GetExeVersion() GetExeVersion
|
105 pascal16 GetExeVersion() GetExeVersion
|
||||||
106 pascal SetSwapAreaSize(word) SetSwapAreaSize
|
106 pascal SetSwapAreaSize(word) SetSwapAreaSize16
|
||||||
107 pascal16 SetErrorMode(word) SetErrorMode16
|
107 pascal16 SetErrorMode(word) SetErrorMode16
|
||||||
108 pascal16 SwitchStackTo(word word word) SwitchStackTo
|
108 pascal16 SwitchStackTo(word word word) SwitchStackTo
|
||||||
109 register SwitchStackBack(word word word) SwitchStackBack
|
109 register SwitchStackBack(word word word) SwitchStackBack
|
||||||
|
@ -232,6 +232,7 @@ file krnl386.exe
|
||||||
233 stub RegUnloadKey
|
233 stub RegUnloadKey
|
||||||
234 stub RegSaveKey
|
234 stub RegSaveKey
|
||||||
235 stub InvalidateNlsCache
|
235 stub InvalidateNlsCache
|
||||||
|
236 stub GetProductName
|
||||||
237 stub KERNEL_237
|
237 stub KERNEL_237
|
||||||
262 stub KERNEL_262
|
262 stub KERNEL_262
|
||||||
263 stub KERNEL_263
|
263 stub KERNEL_263
|
||||||
|
@ -280,6 +281,7 @@ file krnl386.exe
|
||||||
359 pascal KERNEL_359(long) _KERNEL_359
|
359 pascal KERNEL_359(long) _KERNEL_359
|
||||||
360 stub OpenFileEx
|
360 stub OpenFileEx
|
||||||
#361 PIGLET_361
|
#361 PIGLET_361
|
||||||
|
365 stub KERNEL_365
|
||||||
403 pascal16 FarSetOwner(word word) FarSetOwner
|
403 pascal16 FarSetOwner(word word) FarSetOwner
|
||||||
404 pascal16 FarGetOwner(word) FarGetOwner
|
404 pascal16 FarGetOwner(word) FarGetOwner
|
||||||
406 stub WritePrivateProfileStruct
|
406 stub WritePrivateProfileStruct
|
||||||
|
@ -312,6 +314,7 @@ file krnl386.exe
|
||||||
471 stub KERNEL_471
|
471 stub KERNEL_471
|
||||||
472 register KERNEL_472() _KERNEL_472
|
472 register KERNEL_472() _KERNEL_472
|
||||||
473 stub KERNEL_473
|
473 stub KERNEL_473
|
||||||
|
475 stub KERNEL_475
|
||||||
482 stub KERNEL_482
|
482 stub KERNEL_482
|
||||||
485 stub KERNEL_485
|
485 stub KERNEL_485
|
||||||
491 stub RegisterServiceProcess
|
491 stub RegisterServiceProcess
|
||||||
|
@ -327,11 +330,21 @@ file krnl386.exe
|
||||||
518 stub CallProcEx32W
|
518 stub CallProcEx32W
|
||||||
519 stub KERNEL_519
|
519 stub KERNEL_519
|
||||||
522 stub KERNEL_522
|
522 stub KERNEL_522
|
||||||
|
523 stub KERNEL_523
|
||||||
525 stub KERNEL_525
|
525 stub KERNEL_525
|
||||||
|
531 stub KERNEL_531
|
||||||
|
532 stub KERNEL_532
|
||||||
|
540 stub KERNEL_540
|
||||||
|
541 stub KERNEL_541
|
||||||
|
544 stub KERNEL_544
|
||||||
600 stub KERNEL_600
|
600 stub KERNEL_600
|
||||||
601 stub KERNEL_601
|
601 stub KERNEL_601
|
||||||
604 stub KERNEL_604
|
604 stub KERNEL_604
|
||||||
605 stub KERNEL_605
|
605 stub KERNEL_605
|
||||||
|
606 stub KERNEL_606
|
||||||
|
607 stub KERNEL_607
|
||||||
|
608 stub KERNEL_608
|
||||||
|
611 stub KERNEL_611
|
||||||
612 stub KERNEL_612
|
612 stub KERNEL_612
|
||||||
613 stub KERNEL_613
|
613 stub KERNEL_613
|
||||||
614 stub KERNEL_614
|
614 stub KERNEL_614
|
||||||
|
@ -339,6 +352,6 @@ file krnl386.exe
|
||||||
621 stub KERNEL_621
|
621 stub KERNEL_621
|
||||||
627 stub IsBadFlatReadWritePtr
|
627 stub IsBadFlatReadWritePtr
|
||||||
630 stub KERNEL_630
|
630 stub KERNEL_630
|
||||||
631 pascal FUNC004(word word long) FUNC004 # shell hook
|
631 pascal FUNC004(word word long) FUNC004 #C16ThkSl01?
|
||||||
651 stub KERNEL_651
|
651 stub KERNEL_651 #ThunkConnect16?
|
||||||
700 pascal KERNEL_700() stub_KERNEL_700
|
700 pascal KERNEL_700() stub_KERNEL_700
|
||||||
|
|
|
@ -160,7 +160,7 @@ type win32
|
||||||
169 stub CreateNamedPipeW
|
169 stub CreateNamedPipeW
|
||||||
170 stub CreatePipe
|
170 stub CreatePipe
|
||||||
171 stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) CreateProcess32A
|
171 stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) CreateProcess32A
|
||||||
172 stub CreateProcessW
|
172 stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) CreateProcess32W
|
||||||
173 stub CreateRemoteThread
|
173 stub CreateRemoteThread
|
||||||
174 stdcall CreateSemaphoreA(ptr long long str) CreateSemaphore32A
|
174 stdcall CreateSemaphoreA(ptr long long str) CreateSemaphore32A
|
||||||
175 stdcall CreateSemaphoreW(ptr long long wstr) CreateSemaphore32W
|
175 stdcall CreateSemaphoreW(ptr long long wstr) CreateSemaphore32W
|
||||||
|
@ -176,7 +176,7 @@ type win32
|
||||||
185 stdcall DeleteCriticalSection(ptr) DeleteCriticalSection
|
185 stdcall DeleteCriticalSection(ptr) DeleteCriticalSection
|
||||||
186 stdcall DeleteFileA(str) DeleteFile32A
|
186 stdcall DeleteFileA(str) DeleteFile32A
|
||||||
187 stdcall DeleteFileW(wstr) DeleteFile32W
|
187 stdcall DeleteFileW(wstr) DeleteFile32W
|
||||||
188 stub DeviceIoControl
|
188 stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) DeviceIoControl
|
||||||
189 stdcall DisableThreadLibraryCalls(long) DisableThreadLibraryCalls
|
189 stdcall DisableThreadLibraryCalls(long) DisableThreadLibraryCalls
|
||||||
190 stub DisconnectNamedPipe
|
190 stub DisconnectNamedPipe
|
||||||
191 stdcall DosDateTimeToFileTime(long long ptr) DosDateTimeToFileTime
|
191 stdcall DosDateTimeToFileTime(long long ptr) DosDateTimeToFileTime
|
||||||
|
@ -250,7 +250,7 @@ type win32
|
||||||
259 stdcall FlushConsoleInputBuffer(long) FlushConsoleInputBuffer
|
259 stdcall FlushConsoleInputBuffer(long) FlushConsoleInputBuffer
|
||||||
260 stdcall FlushFileBuffers(long) FlushFileBuffers
|
260 stdcall FlushFileBuffers(long) FlushFileBuffers
|
||||||
261 stub FlushInstructionCache
|
261 stub FlushInstructionCache
|
||||||
262 stub FlushViewOfFile
|
262 stdcall FlushViewOfFile(ptr long) FlushViewOfFile
|
||||||
263 stub FoldStringA
|
263 stub FoldStringA
|
||||||
264 stub FoldStringW
|
264 stub FoldStringW
|
||||||
265 stdcall FormatMessageA(long ptr long long ptr long ptr) FormatMessage32A
|
265 stdcall FormatMessageA(long ptr long long ptr long ptr) FormatMessage32A
|
||||||
|
@ -362,7 +362,7 @@ type win32
|
||||||
371 stub GetPrivateProfileStructW
|
371 stub GetPrivateProfileStructW
|
||||||
372 stdcall GetProcAddress(long str) GetProcAddress32
|
372 stdcall GetProcAddress(long str) GetProcAddress32
|
||||||
373 stdcall GetProcessAffinityMask(long ptr ptr) GetProcessAffinityMask
|
373 stdcall GetProcessAffinityMask(long ptr ptr) GetProcessAffinityMask
|
||||||
374 stub GetProcessFlags
|
374 stdcall GetProcessFlags(long) GetProcessFlags
|
||||||
375 stdcall GetProcessHeap() GetProcessHeap
|
375 stdcall GetProcessHeap() GetProcessHeap
|
||||||
376 stub GetProcessHeaps
|
376 stub GetProcessHeaps
|
||||||
377 stub GetProcessShutdownParameters
|
377 stub GetProcessShutdownParameters
|
||||||
|
@ -531,7 +531,7 @@ type win32
|
||||||
540 stdcall OpenFileMappingW(long long wstr) OpenFileMapping32W
|
540 stdcall OpenFileMappingW(long long wstr) OpenFileMapping32W
|
||||||
541 stdcall OpenMutexA(long long str) OpenMutex32A
|
541 stdcall OpenMutexA(long long str) OpenMutex32A
|
||||||
542 stdcall OpenMutexW(long long wstr) OpenMutex32W
|
542 stdcall OpenMutexW(long long wstr) OpenMutex32W
|
||||||
543 stub OpenProcess
|
543 stdcall OpenProcess(long long long) OpenProcess32
|
||||||
544 stub OpenProfileUserMapping
|
544 stub OpenProfileUserMapping
|
||||||
545 stdcall OpenSemaphoreA(long long str) OpenSemaphore32A
|
545 stdcall OpenSemaphoreA(long long str) OpenSemaphore32A
|
||||||
546 stdcall OpenSemaphoreW(long long wstr) OpenSemaphore32W
|
546 stdcall OpenSemaphoreW(long long wstr) OpenSemaphore32W
|
||||||
|
@ -553,7 +553,7 @@ type win32
|
||||||
562 stub QueryNumberOfEventLogRecords
|
562 stub QueryNumberOfEventLogRecords
|
||||||
563 stub QueryOldestEventLogRecord
|
563 stub QueryOldestEventLogRecord
|
||||||
564 stdcall QueryPerformanceCounter(ptr) QueryPerformanceCounter
|
564 stdcall QueryPerformanceCounter(ptr) QueryPerformanceCounter
|
||||||
565 stub QueryPerformanceFrequency
|
565 stdcall QueryPerformanceFrequency(ptr) QueryPerformanceFrequency
|
||||||
566 stub QueueUserAPC
|
566 stub QueueUserAPC
|
||||||
567 register RaiseException() EXC_RaiseException
|
567 register RaiseException() EXC_RaiseException
|
||||||
568 stdcall ReadConsoleA(long ptr long ptr ptr) ReadConsole32A
|
568 stdcall ReadConsoleA(long ptr long ptr ptr) ReadConsole32A
|
||||||
|
@ -843,3 +843,56 @@ type win32
|
||||||
853 stub VirtualBufferExceptionHandler
|
853 stub VirtualBufferExceptionHandler
|
||||||
854 stub WriteConsoleInputVDMA
|
854 stub WriteConsoleInputVDMA
|
||||||
855 stub WriteConsoleInputVDMW
|
855 stub WriteConsoleInputVDMW
|
||||||
|
|
||||||
|
# NT 4.0 additions
|
||||||
|
856 stub CancelIo
|
||||||
|
857 stub CancelWaitableTimer
|
||||||
|
858 stub CopyFileExA
|
||||||
|
859 stub CopyFileExW
|
||||||
|
860 stub CreateFiber
|
||||||
|
861 stub CreateWaitableTimerA
|
||||||
|
862 stub CreateWaitableTimerW
|
||||||
|
863 stub DeleteFiber
|
||||||
|
864 stub DuplicateConsoleHandle
|
||||||
|
865 stub FindFirstFileExA
|
||||||
|
866 stub FindFirstFileExW
|
||||||
|
867 stub GetConsoleInputExeNameA
|
||||||
|
868 stub GetConsoleInputExeNameW
|
||||||
|
869 stub GetConsoleKeyboardLayoutNameA
|
||||||
|
870 stub GetConsoleKeyboardLayoutNameW
|
||||||
|
871 stub GetDiskFreeSpaceExA
|
||||||
|
873 stub GetDiskFreeSpaceExW
|
||||||
|
874 stub GetFileAttributesExA
|
||||||
|
875 stub GetFileAttributesExW
|
||||||
|
876 stub GetProcessPriorityBoost
|
||||||
|
877 stub GetThreadPriorityBoost
|
||||||
|
878 stub InterlockedCompareExchange
|
||||||
|
879 stub InterlockedExchangeAdd
|
||||||
|
880 stub IsProcessorFeaturePresent
|
||||||
|
881 stub OpenWaitableTimerA
|
||||||
|
882 stub OpenWaitableTimerW
|
||||||
|
883 stub ReadConsoleInputExA
|
||||||
|
884 stub ReadConsoleInputExW
|
||||||
|
885 stub ReadDirectoryChangesW
|
||||||
|
886 stub ReadFileScatter
|
||||||
|
887 stub SetConsoleIcon
|
||||||
|
888 stub SetConsoleInputExeNameA
|
||||||
|
889 stub SetConsoleInputExeNameW
|
||||||
|
890 stub SetProcessAffinityMask
|
||||||
|
891 stub SetProcessPriorityBoost
|
||||||
|
892 stub SetThreadIdealProcessor
|
||||||
|
893 stub SetThreadPriorityBoost
|
||||||
|
894 stub SetWaitableTimer
|
||||||
|
895 stub SignalObjectAndWait
|
||||||
|
896 stub SwitchToFiber
|
||||||
|
897 stub SwitchToThread
|
||||||
|
898 stub TryEnterCriticalSection
|
||||||
|
899 stub VirtualAllocEx
|
||||||
|
900 stub VirtualFreeEx
|
||||||
|
901 stub WriteFileGather
|
||||||
|
|
||||||
|
1346 stdcall PrivateLoadLibrary(str) PrivateLoadLibrary
|
||||||
|
1545 stdcall PrivateFreeLibrary(long) PrivateFreeLibrary
|
||||||
|
|
||||||
|
#1599 wrong ordinal (249 in Win32s's W32SCOMB.DLL) !
|
||||||
|
1599 stdcall Get16DLLAddress(long str) Get16DLLAddress
|
||||||
|
|
|
@ -58,7 +58,7 @@ type win32
|
||||||
0077 stub WNetGetNetworkInformationW
|
0077 stub WNetGetNetworkInformationW
|
||||||
0078 stub WNetGetProviderNameA
|
0078 stub WNetGetProviderNameA
|
||||||
0079 stub WNetGetProviderNameW
|
0079 stub WNetGetProviderNameW
|
||||||
0080 stub WNetGetResourceInformationA
|
0080 stdcall WNetGetResourceInformationA(ptr ptr ptr ptr) WNetGetResourceInformation32A
|
||||||
0081 stub WNetGetResourceInformationW
|
0081 stub WNetGetResourceInformationW
|
||||||
0082 stub WNetGetResourceParentA
|
0082 stub WNetGetResourceParentA
|
||||||
0083 stub WNetGetResourceParentW
|
0083 stub WNetGetResourceParentW
|
||||||
|
@ -70,7 +70,7 @@ type win32
|
||||||
0089 stub WNetLogoffW
|
0089 stub WNetLogoffW
|
||||||
0090 stub WNetLogonA
|
0090 stub WNetLogonA
|
||||||
0091 stub WNetLogonW
|
0091 stub WNetLogonW
|
||||||
0092 stub WNetOpenEnumA
|
0092 stdcall WNetOpenEnumA(long long ptr ptr) WNetOpenEnum32A
|
||||||
0093 stub WNetOpenEnumW
|
0093 stub WNetOpenEnumW
|
||||||
0094 stub WNetRemoveCachedPassword
|
0094 stub WNetRemoveCachedPassword
|
||||||
0095 stub WNetRestoreConnectionA
|
0095 stub WNetRestoreConnectionA
|
||||||
|
|
|
@ -951,3 +951,23 @@ type win32
|
||||||
948 stub wcstol
|
948 stub wcstol
|
||||||
949 cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs
|
949 cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs
|
||||||
950 stub wcstoul
|
950 stub wcstoul
|
||||||
|
|
||||||
|
# NT 4 additions
|
||||||
|
951 stub NtAddAtom
|
||||||
|
952 stub NtDeleteAtom
|
||||||
|
953 stub NtFindAtom
|
||||||
|
954 stub NtQueryFullAttributesFile
|
||||||
|
955 stub NtQueueApcThread
|
||||||
|
956 stub NtReadFileScatter
|
||||||
|
957 stub NtSignalAndWaitForSingleObject
|
||||||
|
958 stub NtWriteFileGather
|
||||||
|
959 stub NtYieldExecution
|
||||||
|
960 stub RtlAddAtomToAtomTable
|
||||||
|
961 stub RtlAllocateHandle
|
||||||
|
962 stub RtlCreateAtomTable
|
||||||
|
963 stub RtlDeleteAtomFromAtomTable
|
||||||
|
964 stub RtlFreeHandle
|
||||||
|
965 stub RtlInitializeHandleTable
|
||||||
|
966 stub RtlIsValidHandle
|
||||||
|
967 stub RtlLookupAtomInAtomTable
|
||||||
|
968 stub RtlQueryAtomInAtomTable
|
||||||
|
|
|
@ -38,7 +38,7 @@ type win32
|
||||||
35 stub CoQueryReleaseObject
|
35 stub CoQueryReleaseObject
|
||||||
36 stub CoRegisterClassObject
|
36 stub CoRegisterClassObject
|
||||||
37 stub CoRegisterMallocSpy
|
37 stub CoRegisterMallocSpy
|
||||||
38 stub CoRegisterMessageFilter
|
38 stdcall CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter
|
||||||
39 stub CoReleaseMarshalData
|
39 stub CoReleaseMarshalData
|
||||||
40 stub CoRevokeClassObject
|
40 stub CoRevokeClassObject
|
||||||
41 stub CoRevokeMallocSpy
|
41 stub CoRevokeMallocSpy
|
||||||
|
|
|
@ -40,9 +40,9 @@ type win16
|
||||||
38 stub OLECREATEFROMFILE
|
38 stub OLECREATEFROMFILE
|
||||||
39 stub OLECREATELINKFROMFILE
|
39 stub OLECREATELINKFROMFILE
|
||||||
40 stub OLERELEASE
|
40 stub OLERELEASE
|
||||||
41 pascal OleRegisterClientDoc(ptr ptr long ptr) OleRegisterClientDoc
|
41 pascal OleRegisterClientDoc(ptr ptr long ptr) OleRegisterClientDoc16
|
||||||
42 pascal OleRevokeClientDoc(long) OleRevokeClientDoc
|
42 pascal OleRevokeClientDoc(long) OleRevokeClientDoc16
|
||||||
43 pascal OleRenameClientDoc(long ptr) OleRenameClientDoc
|
43 pascal OleRenameClientDoc(long ptr) OleRenameClientDoc16
|
||||||
44 stub OLEREVERTCLIENTDOC
|
44 stub OLEREVERTCLIENTDOC
|
||||||
45 stub OLESAVEDCLIENTDOC
|
45 stub OLESAVEDCLIENTDOC
|
||||||
46 stub OLERENAME
|
46 stub OLERENAME
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
name olecli32
|
||||||
|
type win32
|
||||||
|
|
||||||
|
1 stub WEP
|
||||||
|
2 stub OleDelete
|
||||||
|
3 stub OleSaveToStream
|
||||||
|
4 stub OleLoadFromStream
|
||||||
|
6 stub OleClone
|
||||||
|
7 stub OleCopyFromLink
|
||||||
|
8 stub OleEqual
|
||||||
|
9 stdcall OleQueryLinkFromClip(str long long) OleQueryLinkFromClip32
|
||||||
|
10 stdcall OleQueryCreateFromClip(str long long) OleQueryCreateFromClip32
|
||||||
|
11 stdcall OleCreateLinkFromClip(str long ptr str long long) OleCreateLinkFromClip32
|
||||||
|
12 stdcall OleCreateFromClip(str ptr long str ptr long long) OleCreateFromClip32
|
||||||
|
13 stub OleCopyToClipboard
|
||||||
|
14 stdcall OleQueryType(ptr ptr) OleQueryType32
|
||||||
|
15 stdcall OleSetHostNames(ptr str str) OleSetHostNames32
|
||||||
|
16 stub OleSetTargetDevice
|
||||||
|
17 stub OleSetBounds
|
||||||
|
18 stub OleQueryBounds
|
||||||
|
19 stub OleDraw
|
||||||
|
20 stub OleQueryOpen
|
||||||
|
21 stub OleActivate
|
||||||
|
22 stub OleUpdate
|
||||||
|
23 stub OleReconnect
|
||||||
|
24 stub OleGetLinkUpdateOptions
|
||||||
|
25 stub OleSetLinkUpdateOptions
|
||||||
|
26 stub OleEnumFormats
|
||||||
|
27 stub OleClose
|
||||||
|
28 stub OleGetData
|
||||||
|
29 stub OleSetData
|
||||||
|
30 stub OleQueryProtocol
|
||||||
|
31 stub OleQueryOutOfDate
|
||||||
|
32 stub OleObjectConvert
|
||||||
|
33 stub OleCreateFromTemplate
|
||||||
|
34 stub OleCreate
|
||||||
|
35 stub OleQueryReleaseStatus
|
||||||
|
36 stub OleQueryReleaseError
|
||||||
|
37 stub OleQueryReleaseMethod
|
||||||
|
38 stub OleCreateFromFile
|
||||||
|
39 stub OleCreateLinkFromFile
|
||||||
|
40 stub OleRelease
|
||||||
|
41 stdcall OleRegisterClientDoc(str str long ptr) OleRegisterClientDoc32
|
||||||
|
42 stdcall OleRevokeClientDoc(long) OleRevokeClientDoc32
|
||||||
|
43 stdcall OleRenameClientDoc(long str) OleRenameClientDoc32
|
||||||
|
44 stub OleRevertClientDoc
|
||||||
|
45 stub OleSavedClientDoc
|
||||||
|
46 stub OleRename
|
||||||
|
47 stub OleEnumObjects
|
||||||
|
48 stub OleQueryName
|
||||||
|
49 stub OleSetColorScheme
|
||||||
|
50 stub OleRequestData
|
||||||
|
54 stub OleLockServer
|
||||||
|
55 stub OleUnlockServer
|
||||||
|
56 stub OleQuerySize
|
||||||
|
57 stub OleExecute
|
||||||
|
58 stub OleCreateInvisible
|
||||||
|
59 stub OleQueryClientVersion
|
||||||
|
60 stub OleIsDcMeta
|
|
@ -2,12 +2,12 @@ name olesvr
|
||||||
type win16
|
type win16
|
||||||
|
|
||||||
#1 WEP
|
#1 WEP
|
||||||
2 pascal OleRegisterServer(str ptr ptr word word) OleRegisterServer
|
2 pascal OleRegisterServer(str ptr ptr word word) OleRegisterServer16
|
||||||
3 pascal OleRevokeServer(long) OleRevokeServer
|
3 pascal OleRevokeServer(long) OleRevokeServer
|
||||||
4 pascal OleBlockServer(long) OleBlockServer
|
4 pascal OleBlockServer(long) OleBlockServer16
|
||||||
5 pascal OleUnblockServer(long ptr) OleUnblockServer
|
5 pascal OleUnblockServer(long ptr) OleUnblockServer16
|
||||||
6 pascal OleRegisterServerDoc(long str ptr ptr) OleRegisterServerDoc
|
6 pascal OleRegisterServerDoc(long str ptr ptr) OleRegisterServerDoc16
|
||||||
7 pascal OleRevokeServerDoc(long) OleRevokeServerDoc
|
7 pascal OleRevokeServerDoc(long) OleRevokeServerDoc16
|
||||||
8 stub OLERENAMESERVERDOC
|
8 stub OLERENAMESERVERDOC
|
||||||
9 stub OLEREVERTSERVERDOC
|
9 stub OLEREVERTSERVERDOC
|
||||||
10 stub OLESAVEDSERVERDOC
|
10 stub OLESAVEDSERVERDOC
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
name olesvr32
|
||||||
|
type win32
|
||||||
|
|
||||||
|
1 stub WEP
|
||||||
|
2 stdcall OleRegisterServer(str ptr ptr long long) OleRegisterServer32
|
||||||
|
3 stub OleRevokeServer
|
||||||
|
4 stdcall OleBlockServer(long) OleBlockServer32
|
||||||
|
5 stdcall OleUnblockServer(long ptr) OleUnblockServer32
|
||||||
|
6 stdcall OleRegisterServerDoc(ptr str ptr ptr) OleRegisterServerDoc32
|
||||||
|
7 stdcall OleRevokeServerDoc(long) OleRevokeServerDoc32
|
||||||
|
8 stdcall OleRenameServerDoc(long str) OleRenameServerDoc32
|
||||||
|
9 stub OleRevertServerDoc
|
||||||
|
10 stub OleSavedServerDoc
|
||||||
|
11 stub OleRevokeObject
|
||||||
|
12 stub OleQueryServerVersion
|
|
@ -17,7 +17,7 @@ type win16
|
||||||
22 pascal16 ShellAbout(word ptr ptr word) ShellAbout16
|
22 pascal16 ShellAbout(word ptr ptr word) ShellAbout16
|
||||||
33 pascal16 AboutDlgProc(word word word long) AboutDlgProc16
|
33 pascal16 AboutDlgProc(word word word long) AboutDlgProc16
|
||||||
34 pascal16 ExtractIcon(word str s_word) ExtractIcon16
|
34 pascal16 ExtractIcon(word str s_word) ExtractIcon16
|
||||||
36 pascal16 ExtractAssociatedIcon(word ptr ptr) ExtractAssociatedIcon
|
36 pascal16 ExtractAssociatedIcon(word ptr ptr) ExtractAssociatedIcon16
|
||||||
37 pascal DoEnvironmentSubst(ptr word) DoEnvironmentSubst
|
37 pascal DoEnvironmentSubst(ptr word) DoEnvironmentSubst
|
||||||
38 pascal FindEnvironmentString(ptr) FindEnvironmentString
|
38 pascal FindEnvironmentString(ptr) FindEnvironmentString
|
||||||
39 pascal16 InternalExtractIcon(word ptr s_word word) InternalExtractIcon
|
39 pascal16 InternalExtractIcon(word ptr s_word word) InternalExtractIcon
|
||||||
|
|
|
@ -7,51 +7,182 @@ type win32
|
||||||
|
|
||||||
2 stub SHELL32_2
|
2 stub SHELL32_2
|
||||||
3 stub CheckEscapesA
|
3 stub CheckEscapesA
|
||||||
|
4 stub SHELL32_4
|
||||||
|
5 stub SHELL32_5
|
||||||
6 stub CheckEscapesW
|
6 stub CheckEscapesW
|
||||||
7 stdcall CommandLineToArgvW(ptr ptr) CommandLineToArgvW
|
7 stdcall CommandLineToArgvW(ptr ptr) CommandLineToArgvW
|
||||||
8 stub Control_FillCache_RunDLL
|
8 stub Control_FillCache_RunDLL
|
||||||
12 stdcall Control_RunDLL(long long long long) Control_RunDLL
|
12 stdcall Control_RunDLL(long long long long) Control_RunDLL
|
||||||
14 stdcall DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
|
14 stdcall DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
|
||||||
|
15 stub SHELL32_15
|
||||||
|
16 stdcall SHELL32_16(ptr) SHELL32_16
|
||||||
|
17 stub SHELL32_17
|
||||||
|
18 stdcall SHELL32_18(ptr) SHELL32_18
|
||||||
|
19 stub SHELL32_19
|
||||||
|
20 stub SHELL32_20
|
||||||
|
21 stub SHELL32_21
|
||||||
22 stub DoEnvironmentSubstA
|
22 stub DoEnvironmentSubstA
|
||||||
|
23 stub SHELL32_23
|
||||||
|
24 stub SHELL32_24
|
||||||
|
25 stdcall SHELL32_25(ptr ptr) SHELL32_25
|
||||||
|
26 stub SHELL32_26
|
||||||
|
27 stub SHELL32_27
|
||||||
|
28 stub SHELL32_28
|
||||||
|
29 stdcall SHELL32_29(str) SHELL32_29
|
||||||
|
30 stub SHELL32_30
|
||||||
|
31 stub SHELL32_31
|
||||||
|
32 stdcall SHELL32_32(str) SHELL32_32
|
||||||
33 stub SHELL32_33
|
33 stub SHELL32_33
|
||||||
34 stub SHELL32_34
|
34 stdcall SHELL32_34(str) SHELL32_34
|
||||||
35 stub SHELL32_35
|
35 stdcall SHELL32_35(str) SHELL32_35
|
||||||
|
36 stdcall SHELL32_36(str str) SHELL32_36
|
||||||
|
37 stdcall SHELL32_37(ptr str str) SHELL32_37
|
||||||
38 stub DoEnvironmentSubstW
|
38 stub DoEnvironmentSubstW
|
||||||
|
39 stub SHELL32_39
|
||||||
|
40 stub SHELL32_40
|
||||||
41 stdcall DragAcceptFiles(long long) DragAcceptFiles
|
41 stdcall DragAcceptFiles(long long) DragAcceptFiles
|
||||||
42 stub DragFinish
|
42 stub DragFinish
|
||||||
|
43 stub SHELL32_43
|
||||||
44 stub DragQueryFile
|
44 stub DragQueryFile
|
||||||
|
45 stdcall SHELL32_45(str) SHELL32_45
|
||||||
46 stub SHELL32_46
|
46 stub SHELL32_46
|
||||||
47 stub SHELL32_47
|
47 stub SHELL32_47
|
||||||
48 stub SHELL32_48
|
48 stub SHELL32_48
|
||||||
49 stub SHELL32_49
|
49 stub SHELL32_49
|
||||||
50 stub DragQueryFileA
|
50 stub DragQueryFileA
|
||||||
|
51 stub SHELL32_51
|
||||||
|
52 stdcall SHELL32_52(str) SHELL32_52
|
||||||
53 stub DragQueryFileAorW
|
53 stub DragQueryFileAorW
|
||||||
54 stub DragQueryFileW
|
54 stub DragQueryFileW
|
||||||
|
55 stub SHELL32_55
|
||||||
56 stub SHELL32_56
|
56 stub SHELL32_56
|
||||||
57 stub SHELL32_57
|
57 stub SHELL32_57
|
||||||
58 stub SHELL32_58
|
58 stub SHELL32_58
|
||||||
62 stub SHELL32_62
|
59 stub SHELL32_59
|
||||||
|
60 stub SHELL32_60
|
||||||
|
61 stub SHELL32_61
|
||||||
|
62 stdcall SHELL32_62(long long long long) SHELL32_62
|
||||||
63 stub SHELL32_63
|
63 stub SHELL32_63
|
||||||
64 stub SHELL32_64
|
64 stub SHELL32_64
|
||||||
65 stub SHELL32_65
|
65 stub SHELL32_65
|
||||||
|
66 stub SHELL32_66
|
||||||
|
67 stub SHELL32_67
|
||||||
|
68 stub SHELL32_68
|
||||||
|
69 stub SHELL32_69
|
||||||
|
70 stub SHELL32_70
|
||||||
|
71 stdcall SHELL32_71(ptr ptr) SHELL32_71
|
||||||
|
72 stdcall SHELL32_72(ptr ptr long) SHELL32_72
|
||||||
|
73 stub SHELL32_73
|
||||||
|
74 stub SHELL32_74
|
||||||
|
75 stub SHELL32_75
|
||||||
76 stub DragQueryPoint
|
76 stub DragQueryPoint
|
||||||
|
77 stdcall SHELL32_77(long long long) SHELL32_77
|
||||||
|
78 stub SHELL32_78
|
||||||
|
79 stdcall SHELL32_79(str ptr) SHELL32_79
|
||||||
80 stub DuplicateIcon
|
80 stub DuplicateIcon
|
||||||
|
81 stub SHELL32_81
|
||||||
82 stub ExtractAssociatedIconA
|
82 stub ExtractAssociatedIconA
|
||||||
|
83 stub SHELL32_83
|
||||||
|
84 stub SHELL32_84
|
||||||
|
85 stub SHELL32_85
|
||||||
|
86 stub SHELL32_86
|
||||||
|
87 stub SHELL32_87
|
||||||
|
88 stub SHELL32_88
|
||||||
|
89 stub SHELL32_89
|
||||||
|
90 stub SHELL32_90
|
||||||
|
91 stub SHELL32_91
|
||||||
|
92 stub SHELL32_92
|
||||||
|
93 stub SHELL32_93
|
||||||
|
94 stub SHELL32_94
|
||||||
|
95 stub SHELL32_95
|
||||||
|
96 stub SHELL32_96
|
||||||
|
97 stub SHELL32_97
|
||||||
|
98 stub SHELL32_98
|
||||||
|
99 stub SHELL32_99
|
||||||
|
100 stdcall SHELL32_100(long) SHELL32_100
|
||||||
101 stub ExtractAssociatedIconExA
|
101 stub ExtractAssociatedIconExA
|
||||||
|
102 stdcall SHELL32_102(ptr ptr long ptr ptr) SHELL32_102
|
||||||
|
103 stub SHELL32_103
|
||||||
|
104 stub SHELL32_104
|
||||||
|
105 stub SHELL32_105
|
||||||
|
106 stub SHELL32_106
|
||||||
|
107 stub SHELL32_107
|
||||||
|
108 stub SHELL32_108
|
||||||
|
109 stub SHELL32_109
|
||||||
|
110 stub SHELL32_110
|
||||||
|
111 stub SHELL32_111
|
||||||
|
112 stub SHELL32_112
|
||||||
|
113 stub SHELL32_113
|
||||||
|
114 stub SHELL32_114
|
||||||
|
115 stub SHELL32_115
|
||||||
|
116 stub SHELL32_116
|
||||||
|
117 stub SHELL32_117
|
||||||
|
118 stub SHELL32_118
|
||||||
|
119 stdcall SHELL32_119(ptr) SHELL32_119
|
||||||
|
120 stub SHELL32_120
|
||||||
|
121 stub SHELL32_121
|
||||||
|
122 stub SHELL32_122
|
||||||
|
123 stub SHELL32_123
|
||||||
124 stub ExtractAssociatedIconExW
|
124 stub ExtractAssociatedIconExW
|
||||||
125 stub ExtractAssociatedIconW
|
125 stub ExtractAssociatedIconW
|
||||||
133 stdcall ExtractIconA(long ptr long) ExtractIcon32A
|
126 stub SHELL32_126
|
||||||
|
127 stub SHELL32_127
|
||||||
|
128 stdcall DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
|
||||||
|
129 stub SHELL32_129
|
||||||
|
130 stub SHELL32_130
|
||||||
|
131 stub SHELL32_131
|
||||||
|
132 stub SHELL32_132
|
||||||
|
133 stdcall ExtractIconA(long str long) ExtractIcon32A
|
||||||
|
134 stub SHELL32_134
|
||||||
135 stub ExtractIconEx
|
135 stub ExtractIconEx
|
||||||
|
136 stub SHELL32_136
|
||||||
|
137 stub SHELL32_137
|
||||||
138 stub ExtractIconExA
|
138 stub ExtractIconExA
|
||||||
|
139 stub SHELL32_139
|
||||||
|
140 stub SHELL32_140
|
||||||
|
141 stub SHELL32_141
|
||||||
|
142 stub SHELL32_142
|
||||||
|
143 stub SHELL32_143
|
||||||
|
144 stub SHELL32_144
|
||||||
|
145 stub SHELL32_145
|
||||||
|
146 stub SHELL32_146
|
||||||
|
147 stub SHELL32_147
|
||||||
148 stub ExtractIconResInfoA
|
148 stub ExtractIconResInfoA
|
||||||
|
149 stub SHELL32_149
|
||||||
150 stub ExtractIconResInfoW
|
150 stub ExtractIconResInfoW
|
||||||
|
151 stub SHELL32_151
|
||||||
|
152 stdcall SHELL32_152(ptr) SHELL32_152
|
||||||
|
153 stub SHELL32_153
|
||||||
|
154 stub SHELL32_154
|
||||||
|
155 stdcall SHELL32_155(ptr) SHELL32_155
|
||||||
156 stub SHELL32_156
|
156 stub SHELL32_156
|
||||||
157 stub SHELL32_157
|
157 stub SHELL32_157
|
||||||
158 stub SHELL32_158
|
158 stub SHELL32_158
|
||||||
159 stub SHELL32_159
|
159 stub SHELL32_159
|
||||||
160 stub SHELL32_160
|
160 stub SHELL32_160
|
||||||
180 stub ExtractIconW
|
161 stub SHELL32_161
|
||||||
|
162 stub SHELL32_162
|
||||||
|
163 stub SHELL32_163
|
||||||
|
164 stub SHELL32_164
|
||||||
|
165 stdcall SHELL32_165(long long) SHELL32_165
|
||||||
|
166 stub SHELL32_166
|
||||||
|
167 stub SHELL32_167
|
||||||
|
168 stub SHELL32_168
|
||||||
|
169 stub SHELL32_169
|
||||||
|
170 stub SHELL32_170
|
||||||
|
171 stub SHELL32_171
|
||||||
|
172 stub SHELL32_172
|
||||||
|
173 stub SHELL32_173
|
||||||
|
174 stub SHELL32_174
|
||||||
|
175 stdcall SHELL32_175(long long long long) SHELL32_175
|
||||||
|
176 stub SHELL32_176
|
||||||
|
177 stub SHELL32_177
|
||||||
|
178 stub SHELL32_178
|
||||||
|
179 stub SHELL32_179
|
||||||
|
180 stdcall ExtractIconW(long wstr long) ExtractIcon32W
|
||||||
|
181 stdcall SHELL32_181(long long) SHELL32_181
|
||||||
182 stub ExtractVersionResource16W
|
182 stub ExtractVersionResource16W
|
||||||
|
183 cdecl SHELL32_183(long long long long long long) SHELL32_183
|
||||||
184 stub SHELL32_184
|
184 stub SHELL32_184
|
||||||
185 stub SHELL32_185
|
185 stub SHELL32_185
|
||||||
186 stdcall FindExecutableA(ptr ptr ptr) FindExecutable32A
|
186 stdcall FindExecutableA(ptr ptr ptr) FindExecutable32A
|
||||||
|
@ -63,11 +194,19 @@ type win32
|
||||||
192 stub PrintersGetCommand_RunDLL
|
192 stub PrintersGetCommand_RunDLL
|
||||||
193 stub RealShellExecuteA
|
193 stub RealShellExecuteA
|
||||||
194 stub RealShellExecuteExA
|
194 stub RealShellExecuteExA
|
||||||
|
195 stdcall SHELL32_195(ptr) SHELL32_195
|
||||||
|
196 stdcall SHELL32_196(long) SHELL32_196
|
||||||
|
197 stub SHELL32_197
|
||||||
|
198 stub SHELL32_198
|
||||||
|
199 stub SHELL32_199
|
||||||
|
200 stub SHELL32_200
|
||||||
|
201 stub SHELL32_201
|
||||||
|
202 stub SHELL32_202
|
||||||
203 stub RealShellExecuteExW
|
203 stub RealShellExecuteExW
|
||||||
204 stub RealShellExecuteW
|
204 stub RealShellExecuteW
|
||||||
205 stub RegenerateUserEnvironment
|
205 stub RegenerateUserEnvironment
|
||||||
206 stub SHAddToRecentDocs
|
206 stub SHAddToRecentDocs
|
||||||
207 stub SHAppBarMessage
|
207 stdcall SHAppBarMessage(long ptr) SHAppBarMessage32
|
||||||
208 stub SHBrowseForFolder
|
208 stub SHBrowseForFolder
|
||||||
209 stub SHBrowseForFolderA
|
209 stub SHBrowseForFolderA
|
||||||
210 stub SHChangeNotify
|
210 stub SHChangeNotify
|
||||||
|
@ -76,7 +215,7 @@ type win32
|
||||||
213 stub SHFormatDrive
|
213 stub SHFormatDrive
|
||||||
214 stub SHFreeNameMappings
|
214 stub SHFreeNameMappings
|
||||||
215 stub SHGetDataFromIDListA
|
215 stub SHGetDataFromIDListA
|
||||||
216 stub SHGetDesktopFolder
|
216 stdcall SHGetDesktopFolder(ptr) SHGetDesktopFolder
|
||||||
217 stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfo32A
|
217 stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfo32A
|
||||||
218 stdcall SHGetFileInfoA(ptr long ptr long long) SHGetFileInfo32A
|
218 stdcall SHGetFileInfoA(ptr long ptr long long) SHGetFileInfo32A
|
||||||
219 stub SHGetInstanceExplorer
|
219 stub SHGetInstanceExplorer
|
||||||
|
@ -113,6 +252,10 @@ type win32
|
||||||
250 stub Shell_NotifyIconA
|
250 stub Shell_NotifyIconA
|
||||||
251 stub Shl1632_ThunkData32
|
251 stub Shl1632_ThunkData32
|
||||||
252 stub Shl3216_ThunkData32
|
252 stub Shl3216_ThunkData32
|
||||||
|
505 stub SHELL32_505
|
||||||
|
507 stub SHELL32_507
|
||||||
|
510 stub SHELL32_510
|
||||||
|
511 stub SHELL32_511
|
||||||
1025 stub ExtractIconExW # proper ordinal unknown
|
1025 stub ExtractIconExW # proper ordinal unknown
|
||||||
1030 stub FindExeDlgProc # proper ordinal unknown
|
1030 stub FindExeDlgProc # proper ordinal unknown
|
||||||
1043 stub RegisterShellHook # proper ordinal unknown
|
1043 stub RegisterShellHook # proper ordinal unknown
|
||||||
|
|
|
@ -52,7 +52,7 @@ file user.exe
|
||||||
48 pascal16 IsChild(word word) IsChild16
|
48 pascal16 IsChild(word word) IsChild16
|
||||||
49 pascal16 IsWindowVisible(word) IsWindowVisible16
|
49 pascal16 IsWindowVisible(word) IsWindowVisible16
|
||||||
50 pascal16 FindWindow(segstr str) FindWindow16
|
50 pascal16 FindWindow(segstr str) FindWindow16
|
||||||
#51 BEAR51
|
51 stub BEAR51 # IsTwoByteCharPrefix
|
||||||
52 pascal16 AnyPopup() AnyPopup16
|
52 pascal16 AnyPopup() AnyPopup16
|
||||||
53 pascal16 DestroyWindow(word) DestroyWindow16
|
53 pascal16 DestroyWindow(word) DestroyWindow16
|
||||||
54 pascal16 EnumWindows(segptr long) THUNK_EnumWindows16
|
54 pascal16 EnumWindows(segptr long) THUNK_EnumWindows16
|
||||||
|
@ -87,6 +87,7 @@ file user.exe
|
||||||
83 pascal16 FrameRect(word ptr word) FrameRect16
|
83 pascal16 FrameRect(word ptr word) FrameRect16
|
||||||
84 pascal16 DrawIcon(word s_word s_word word) DrawIcon16
|
84 pascal16 DrawIcon(word s_word s_word word) DrawIcon16
|
||||||
85 pascal16 DrawText(word str s_word ptr word) DrawText16
|
85 pascal16 DrawText(word str s_word ptr word) DrawText16
|
||||||
|
86 stub BEAR86 # IconSize
|
||||||
87 pascal16 DialogBox(word segstr word segptr) DialogBox16
|
87 pascal16 DialogBox(word segstr word segptr) DialogBox16
|
||||||
88 pascal16 EndDialog(word s_word) EndDialog16
|
88 pascal16 EndDialog(word s_word) EndDialog16
|
||||||
89 pascal16 CreateDialog(word segstr word segptr) CreateDialog16
|
89 pascal16 CreateDialog(word segstr word segptr) CreateDialog16
|
||||||
|
@ -217,7 +218,7 @@ file user.exe
|
||||||
213 pascal16 BuildCommDCB(ptr ptr) BuildCommDCB16
|
213 pascal16 BuildCommDCB(ptr ptr) BuildCommDCB16
|
||||||
214 pascal EscapeCommFunction(word word) EscapeCommFunction16
|
214 pascal EscapeCommFunction(word word) EscapeCommFunction16
|
||||||
215 pascal16 FlushComm(word word) FlushComm
|
215 pascal16 FlushComm(word word) FlushComm
|
||||||
#216 USERSEEUSERDO
|
216 stub USERSEEUSERDO
|
||||||
217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle
|
217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle
|
||||||
218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect16
|
218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect16
|
||||||
219 pascal16 CreateDialogIndirect(word ptr word segptr) CreateDialogIndirect16
|
219 pascal16 CreateDialogIndirect(word ptr word segptr) CreateDialogIndirect16
|
||||||
|
@ -431,6 +432,7 @@ file user.exe
|
||||||
492 pascal16 USER_492() stub_USER_492
|
492 pascal16 USER_492() stub_USER_492
|
||||||
496 pascal16 USER_496() stub_USER_496
|
496 pascal16 USER_496() stub_USER_496
|
||||||
499 pascal16 WNetErrorText(word ptr word) WNetErrorText
|
499 pascal16 WNetErrorText(word ptr word) WNetErrorText
|
||||||
|
500 stub FARCALLNETDRIVER # Undocumented Windows
|
||||||
501 pascal16 WNetOpenJob(ptr ptr word ptr) WNetOpenJob
|
501 pascal16 WNetOpenJob(ptr ptr word ptr) WNetOpenJob
|
||||||
502 pascal16 WNetCloseJob(word ptr ptr) WNetCloseJob
|
502 pascal16 WNetCloseJob(word ptr ptr) WNetCloseJob
|
||||||
503 pascal16 WNetAbortJob(ptr word) WNetAbortJob
|
503 pascal16 WNetAbortJob(ptr word) WNetAbortJob
|
||||||
|
@ -534,3 +536,4 @@ file user.exe
|
||||||
920 pascal16 USER_920() stub_USER_920
|
920 pascal16 USER_920() stub_USER_920
|
||||||
922 pascal16 USER_922() stub_USER_922
|
922 pascal16 USER_922() stub_USER_922
|
||||||
923 pascal16 USER_923() stub_USER_923
|
923 pascal16 USER_923() stub_USER_923
|
||||||
|
924 stub UsrMpr_ThunkData16
|
||||||
|
|
|
@ -12,7 +12,7 @@ type win32
|
||||||
9 stdcall BeginDeferWindowPos(long) BeginDeferWindowPos32
|
9 stdcall BeginDeferWindowPos(long) BeginDeferWindowPos32
|
||||||
10 stdcall BeginPaint(long ptr) BeginPaint32
|
10 stdcall BeginPaint(long ptr) BeginPaint32
|
||||||
11 stdcall BringWindowToTop(long) BringWindowToTop32
|
11 stdcall BringWindowToTop(long) BringWindowToTop32
|
||||||
12 stub BroadcastSystemMessage
|
12 stdcall BroadcastSystemMessage(long ptr long long long) BroadcastSystemMessage
|
||||||
13 stub CalcChildScroll
|
13 stub CalcChildScroll
|
||||||
14 stub CallMsgFilter
|
14 stub CallMsgFilter
|
||||||
15 stdcall CallMsgFilterA(ptr long) CallMsgFilter32A
|
15 stdcall CallMsgFilterA(ptr long) CallMsgFilter32A
|
||||||
|
@ -285,7 +285,7 @@ type win32
|
||||||
280 stub GetProcessWindowStation
|
280 stub GetProcessWindowStation
|
||||||
281 stdcall GetPropA(long ptr) GetProp32A
|
281 stdcall GetPropA(long ptr) GetProp32A
|
||||||
282 stdcall GetPropW(long ptr) GetProp32W
|
282 stdcall GetPropW(long ptr) GetProp32W
|
||||||
283 stub GetQueueStatus
|
283 stdcall GetQueueStatus(long) GetQueueStatus32
|
||||||
284 stdcall GetScrollInfo(long long ptr) GetScrollInfo32
|
284 stdcall GetScrollInfo(long long ptr) GetScrollInfo32
|
||||||
285 stdcall GetScrollPos(long long) GetScrollPos32
|
285 stdcall GetScrollPos(long long) GetScrollPos32
|
||||||
286 stdcall GetScrollRange(long long ptr ptr) GetScrollRange32
|
286 stdcall GetScrollRange(long long ptr ptr) GetScrollRange32
|
||||||
|
@ -381,7 +381,7 @@ type win32
|
||||||
376 stdcall LoadStringW(long long ptr long) LoadString32W
|
376 stdcall LoadStringW(long long ptr long) LoadString32W
|
||||||
377 stub LockWindowStation
|
377 stub LockWindowStation
|
||||||
378 stdcall LockWindowUpdate(long) LockWindowUpdate32
|
378 stdcall LockWindowUpdate(long) LockWindowUpdate32
|
||||||
379 stdcall LookupIconIdFromDirectory(ptr long) LookupIconIdFromDirectory
|
379 stdcall LookupIconIdFromDirectory(ptr long) LookupIconIdFromDirectory32
|
||||||
380 stdcall LookupIconIdFromDirectoryEx(ptr long long long long) LookupIconIdFromDirectoryEx32
|
380 stdcall LookupIconIdFromDirectoryEx(ptr long long long long) LookupIconIdFromDirectoryEx32
|
||||||
381 stub MBToWCSEx
|
381 stub MBToWCSEx
|
||||||
382 stdcall MapDialogRect(long ptr) MapDialogRect32
|
382 stdcall MapDialogRect(long ptr) MapDialogRect32
|
||||||
|
@ -435,7 +435,7 @@ type win32
|
||||||
430 stdcall RegisterClassW(ptr) RegisterClass32W
|
430 stdcall RegisterClassW(ptr) RegisterClass32W
|
||||||
431 stdcall RegisterClipboardFormatA(str) RegisterClipboardFormat32A
|
431 stdcall RegisterClipboardFormatA(str) RegisterClipboardFormat32A
|
||||||
432 stdcall RegisterClipboardFormatW(wstr) RegisterClipboardFormat32W
|
432 stdcall RegisterClipboardFormatW(wstr) RegisterClipboardFormat32W
|
||||||
433 stub RegisterHotKey
|
433 stdcall RegisterHotKey(long long long long) RegisterHotKey
|
||||||
434 stub RegisterLogonProcess
|
434 stub RegisterLogonProcess
|
||||||
435 stub RegisterSystemThread
|
435 stub RegisterSystemThread
|
||||||
436 stub RegisterTasklist
|
436 stub RegisterTasklist
|
||||||
|
@ -506,7 +506,7 @@ type win32
|
||||||
501 stdcall SetScrollInfo(long long ptr long) SetScrollInfo32
|
501 stdcall SetScrollInfo(long long ptr long) SetScrollInfo32
|
||||||
502 stdcall SetScrollPos(long long long long) SetScrollPos32
|
502 stdcall SetScrollPos(long long long long) SetScrollPos32
|
||||||
503 stdcall SetScrollRange(long long long long long) SetScrollRange32
|
503 stdcall SetScrollRange(long long long long long) SetScrollRange32
|
||||||
504 stub SetShellWindow
|
504 stdcall SetShellWindow(long) SetShellWindow32
|
||||||
505 stdcall SetSysColors(long ptr ptr) SetSysColors32
|
505 stdcall SetSysColors(long ptr ptr) SetSysColors32
|
||||||
506 stub SetSysColorsTemp
|
506 stub SetSysColorsTemp
|
||||||
507 stub SetSystemCursor
|
507 stub SetSystemCursor
|
||||||
|
@ -567,7 +567,7 @@ type win32
|
||||||
562 stub UnpackDDElParam
|
562 stub UnpackDDElParam
|
||||||
563 stdcall UnregisterClassA(str long) UnregisterClass32A
|
563 stdcall UnregisterClassA(str long) UnregisterClass32A
|
||||||
564 stdcall UnregisterClassW(wstr long) UnregisterClass32W
|
564 stdcall UnregisterClassW(wstr long) UnregisterClass32W
|
||||||
565 stub UnregisterHotKey
|
565 stdcall UnregisterHotKey(long long) UnregisterHotKey
|
||||||
566 stub UpdatePerUserSystemParameters
|
566 stub UpdatePerUserSystemParameters
|
||||||
567 stdcall UpdateWindow(long) UpdateWindow32
|
567 stdcall UpdateWindow(long) UpdateWindow32
|
||||||
568 stub UserClientDllInitialize
|
568 stub UserClientDllInitialize
|
||||||
|
@ -602,6 +602,10 @@ type win32
|
||||||
596 stub RegisterServicesProcess
|
596 stub RegisterServicesProcess
|
||||||
597 stub SetWindowRgn
|
597 stub SetWindowRgn
|
||||||
598 stub ToUnicodeEx
|
598 stub ToUnicodeEx
|
||||||
599 stub DrawCaptionTempA
|
599 stdcall DrawCaptionTempA(long long ptr long long str long) DrawCaptionTemp32A
|
||||||
600 stub RegisterNetworkCapabilities
|
600 stub RegisterNetworkCapabilities
|
||||||
601 stub WNDPROC_CALLBACK
|
601 stub WNDPROC_CALLBACK
|
||||||
|
602 stub DrawCaptionTempW
|
||||||
|
603 stub IsHungAppWindow
|
||||||
|
604 stub ChangeDisplaySettingsA
|
||||||
|
605 stub ChangeDisplaySettingsW
|
||||||
|
|
|
@ -0,0 +1,139 @@
|
||||||
|
name w32skrnl
|
||||||
|
type win32
|
||||||
|
|
||||||
|
1 stub _kSetEnvironmentVariable@8
|
||||||
|
2 stub _SzFromImte@4
|
||||||
|
3 stdcall GetCurrentTask32() GetCurrentTask
|
||||||
|
4 stub _DebugPrintf
|
||||||
|
5 stub _NtCloseSection@8
|
||||||
|
6 stub _AllocKernelHeap@8
|
||||||
|
7 stub _SelToFlat
|
||||||
|
8 stub _kGetExeVersion@4
|
||||||
|
9 stub _ResizeKernelHeap@12
|
||||||
|
10 stub _DbgBackTo32
|
||||||
|
11 stub _kGethInstance@0
|
||||||
|
12 stub SelOffsetToLinear
|
||||||
|
13 stub DebugPrintf
|
||||||
|
14 stdcall _kGetWin32sDirectory@0() GetWin32sDirectory
|
||||||
|
15 stub _sprintf
|
||||||
|
16 stub _KIsDBCSLeadByte@4
|
||||||
|
17 stub W32S_BackTo32
|
||||||
|
18 stub _KGetDbgFlags32
|
||||||
|
19 stub SelToFlat
|
||||||
|
20 stub _FreeKernelHeap@4
|
||||||
|
21 stub WIN32SYSDLL
|
||||||
|
#22
|
||||||
|
23 stub _KSilentException@4
|
||||||
|
24 stub _NtCreateSection@28
|
||||||
|
#25 stub _W32sError32@12
|
||||||
|
26 stub _NtOpenSection@12
|
||||||
|
27 stub _NtDupSection@4
|
||||||
|
28 stub _GetSelModName@20
|
||||||
|
29 stub _FGetDscr@8
|
||||||
|
30 stdcall _RtlNtStatusToDosError@4(long) RtlNtStatusToDosError #FIXME: not sure
|
||||||
|
31 stub _NtFlushVirtualMemory@16
|
||||||
|
32 stub _snprintf
|
||||||
|
33 stub _NtUnmapViewOfSection@8
|
||||||
|
|
||||||
|
#34-149
|
||||||
|
|
||||||
|
153 stub _PvAllocVirtMem@16
|
||||||
|
154 stub SetVirtMemProcess
|
||||||
|
155 stub _FFreeVirtMem@12
|
||||||
|
156 stub _FSetVirtProtect@16
|
||||||
|
157 stub _QueryVirtMem@8
|
||||||
|
158 stub _FLockVirtMem@8
|
||||||
|
159 stub _FUnlockVirtMem@8
|
||||||
|
|
||||||
|
#160-170
|
||||||
|
|
||||||
|
171 stub _HHeapCreateHeap@12
|
||||||
|
#172
|
||||||
|
173 stub _FHeapDestroy@4
|
||||||
|
174 stub _PvAllocHeapMem@12
|
||||||
|
175 stub _PvResizeHeapMem@16
|
||||||
|
176 stub _FFreeHeapMem@8
|
||||||
|
|
||||||
|
#177-196
|
||||||
|
|
||||||
|
197 stub _PpdbGetProcess@0
|
||||||
|
198 stub _ErcGetError@0
|
||||||
|
199 stub _SetError@4
|
||||||
|
|
||||||
|
#200-223
|
||||||
|
|
||||||
|
224 stub _CbSearchPath@24
|
||||||
|
225 stub _CbSearchBinPath@16
|
||||||
|
|
||||||
|
#226-230
|
||||||
|
|
||||||
|
231 stub _FFindEnvVar@8
|
||||||
|
|
||||||
|
#232-251
|
||||||
|
|
||||||
|
252 stub _SzFileFromImte@4
|
||||||
|
253 stub _ImteFromFileSz@4
|
||||||
|
254 stub _ImteFromSz@4
|
||||||
|
255 stub _FGetProcAddr@12
|
||||||
|
256 stub _KLoadLibrary@8
|
||||||
|
257 stub _KFreeLibrary@4
|
||||||
|
|
||||||
|
#258-271
|
||||||
|
|
||||||
|
272 stub _lmaUserBase
|
||||||
|
|
||||||
|
#273-325
|
||||||
|
|
||||||
|
326 stub _KrnOutputDebugString@4
|
||||||
|
|
||||||
|
#327-359
|
||||||
|
|
||||||
|
360 stub _RtlRaiseException
|
||||||
|
361 stub _RtlUnwind
|
||||||
|
362 stub _RtlUnwind4
|
||||||
|
|
||||||
|
#363-401
|
||||||
|
|
||||||
|
402 stub _DfhCreateFile@12
|
||||||
|
403 stub _FCloseFile@4
|
||||||
|
404 stub _CbWriteFile@12
|
||||||
|
405 stub _LfoSetFilePos@12
|
||||||
|
406 stub _CbReadFile@12
|
||||||
|
|
||||||
|
#407-499
|
||||||
|
|
||||||
|
500 stub _SelOffsetToLinear@4
|
||||||
|
501 stub _ImteFromHModule@4
|
||||||
|
502 stub _HModuleFromImte@4
|
||||||
|
503 stub _ExitPEApp
|
||||||
|
#504 stdcall _GetThunkBuff@0() _GetThunkBuff
|
||||||
|
505 stub _Dos3Call@0
|
||||||
|
506 stub _GetPEInstanceData@0
|
||||||
|
507 stub _GetThreadTask@4
|
||||||
|
508 stub _BaseAddrFromImte@4
|
||||||
|
509 stub _GetTaskId@12
|
||||||
|
510 stub _KGetProcessDebugPort@4
|
||||||
|
511 stub _W32S_BackTo32
|
||||||
|
512 stub _KReadProcessMemory32@20
|
||||||
|
513 stub _KWriteProcessMemory32@20
|
||||||
|
514 stub _KGetThreadContext32@8
|
||||||
|
515 stub _KSetThreadContext32@8
|
||||||
|
516 stub _KQueryPerformanceCounter@8
|
||||||
|
#517
|
||||||
|
518 stub _KGetExitCodeThread32@8
|
||||||
|
519 stub _KGetExitCodeProcess32@8
|
||||||
|
520 stub _KGetTaskPpdb32@4
|
||||||
|
521 stub _KGetThreadPtdb32@4
|
||||||
|
|
||||||
|
#522-599
|
||||||
|
|
||||||
|
600 stub _GetCurProcFIOData@0
|
||||||
|
601 stub _KUseObject32@4
|
||||||
|
602 stub _KUnuseObject32@4
|
||||||
|
603 stub _KErcGetError32@0
|
||||||
|
604 stub _KCreateProcessHeap@4
|
||||||
|
605 stub _KGetSystemInfo@8
|
||||||
|
606 stub _KGlobalMemStat@4
|
||||||
|
607 stub _GetHandleFromAddr@4
|
||||||
|
608 stub _TlsNullSlot@4
|
||||||
|
609 stub _FWorkingSetSize@8
|
|
@ -0,0 +1,58 @@
|
||||||
|
name win32s16
|
||||||
|
type win16
|
||||||
|
|
||||||
|
1 stub WEP
|
||||||
|
2 stub BOOTTASK
|
||||||
|
3 stub CREATEPROCESS
|
||||||
|
4 stub WAITFORDEBUGEVENT
|
||||||
|
5 pascal CONTINUEDEBUGEVENT(long long long) ContinueDebugEvent
|
||||||
|
6 pascal READPROCESSMEMORY(long ptr ptr long ptr) ReadProcessMemory
|
||||||
|
7 stub WRITEPROCESSMEMORY
|
||||||
|
8 stub GETTHREADCONTEXT
|
||||||
|
9 stub SETTHREADCONTEXT
|
||||||
|
10 pascal GETLASTERROR() GetLastError
|
||||||
|
11 pascal CLOSEHANDLE(long) CloseHandle
|
||||||
|
12 stub ALLOCCLBKTO32BDLL
|
||||||
|
13 pascal GETEXITCODETHREAD(long ptr) GetExitCodeThread
|
||||||
|
14 stub GETEXITCODEPROCESS
|
||||||
|
15 stub OPENPROCESS
|
||||||
|
16 stub OPENTHREAD
|
||||||
|
17 stub GETTHREADSELECTORENTRY
|
||||||
|
18 pascal VIRTUALQUERYEX(long ptr ptr long) VirtualQueryEx
|
||||||
|
19 pascal VIRTUALPROTECTEX(long ptr long long ptr) VirtualProtectEx
|
||||||
|
20 stub KGETTASKPPDB
|
||||||
|
21 stub KGETTHREADPTDB
|
||||||
|
22 stub FREECALLBACK
|
||||||
|
23 stub RELEASECSALIAS
|
||||||
|
24 stub EXCHANGEPFN32INSTUB
|
||||||
|
25 stub SELCBCS
|
||||||
|
26 stub DESTROYPEHEADER
|
||||||
|
27 stub SELCBDS
|
||||||
|
28 stub GETCSALIAS
|
||||||
|
29 stub SELFLATCODE
|
||||||
|
30 stub HUNITOANSIDBCS
|
||||||
|
31 stub ALLOCUTPROC32
|
||||||
|
32 stub FLATDATA
|
||||||
|
33 stub CODEDATA
|
||||||
|
34 stub MYGLOBALFREE
|
||||||
|
35 stub FREE32BDLLCBENTRIES
|
||||||
|
36 stub SETFS
|
||||||
|
37 stub PELOADRESOURCEHANDLER
|
||||||
|
38 stub CHECKDEBUG
|
||||||
|
39 stub REMOVEH32FROMWIN32S
|
||||||
|
40 stub RMEMCPY
|
||||||
|
41 stub INITRESLOADER
|
||||||
|
42 stub FREESELECTOROFFSET
|
||||||
|
43 stub STACKLINEARTOSEGMENTED
|
||||||
|
44 stub GETMODULEFILENAME32S
|
||||||
|
45 stub FAPILOG16
|
||||||
|
46 stub ALLOCCALLBACK
|
||||||
|
47 stub LINEARTOHUGESELECTOROFFSET
|
||||||
|
48 stub UTSELECTOROFFSETTOLINEAR
|
||||||
|
49 stub UTLINEARTOSELECTOROFFSET
|
||||||
|
50 stub SELFOREIGNTIB
|
||||||
|
51 stub MYGLOBALREALLOC
|
||||||
|
52 stub CREATEPEHEADER
|
||||||
|
53 stub FINDGLOBALHANDLE
|
||||||
|
|
||||||
|
#54-289 exist, but function names blanked out
|
|
@ -74,7 +74,7 @@ type win32
|
||||||
171 stub EnumPrintProcessorsW
|
171 stub EnumPrintProcessorsW
|
||||||
172 stub EnumPrinterDriversA
|
172 stub EnumPrinterDriversA
|
||||||
173 stub EnumPrinterDriversW
|
173 stub EnumPrinterDriversW
|
||||||
174 stub EnumPrintersA
|
174 stdcall EnumPrintersA(long ptr long ptr long ptr ptr) EnumPrinters32A
|
||||||
175 stub EnumPrintersW
|
175 stub EnumPrintersW
|
||||||
176 stub ExtDeviceMode
|
176 stub ExtDeviceMode
|
||||||
177 stub FindClosePrinterChangeNotification
|
177 stub FindClosePrinterChangeNotification
|
||||||
|
|
|
@ -78,7 +78,7 @@ type win16
|
||||||
158 register INT_Int3aHandler(word) BUILTIN_DefaultIntHandler
|
158 register INT_Int3aHandler(word) BUILTIN_DefaultIntHandler
|
||||||
159 register INT_Int3bHandler(word) BUILTIN_DefaultIntHandler
|
159 register INT_Int3bHandler(word) BUILTIN_DefaultIntHandler
|
||||||
160 register INT_Int3cHandler(word) BUILTIN_DefaultIntHandler
|
160 register INT_Int3cHandler(word) BUILTIN_DefaultIntHandler
|
||||||
161 register INT_Int3dHandler(word) BUILTIN_DefaultIntHandler
|
161 register INT_Int3dHandler(word) INT_Int3dHandler
|
||||||
162 register INT_Int3eHandler(word) BUILTIN_DefaultIntHandler
|
162 register INT_Int3eHandler(word) BUILTIN_DefaultIntHandler
|
||||||
163 register INT_Int3fHandler(word) BUILTIN_DefaultIntHandler
|
163 register INT_Int3fHandler(word) BUILTIN_DefaultIntHandler
|
||||||
164 register INT_Int40Handler(word) BUILTIN_DefaultIntHandler
|
164 register INT_Int40Handler(word) BUILTIN_DefaultIntHandler
|
||||||
|
|
128
include/aspi.h
128
include/aspi.h
|
@ -56,92 +56,92 @@ struct SRB_HaInquiry16 {
|
||||||
typedef struct SRB_HaInquiry16 SRB_HaInquiry16;
|
typedef struct SRB_HaInquiry16 SRB_HaInquiry16;
|
||||||
|
|
||||||
struct SRB_ExecSCSICmd16 {
|
struct SRB_ExecSCSICmd16 {
|
||||||
BYTE SRB_Cmd; // ASPI command code (W)
|
BYTE SRB_Cmd; /* ASPI command code (W) */
|
||||||
BYTE SRB_Status; // ASPI command status byte (R)
|
BYTE SRB_Status; /* ASPI command status byte (R) */
|
||||||
BYTE SRB_HaId; // ASPI host adapter number (W)
|
BYTE SRB_HaId; /* ASPI host adapter number (W) */
|
||||||
BYTE SRB_Flags; // ASPI request flags (W)
|
BYTE SRB_Flags; /* ASPI request flags (W) */
|
||||||
DWORD SRB_Hdr_Rsvd; // Reserved, MUST = 0 (-)
|
DWORD SRB_Hdr_Rsvd; /* Reserved, MUST = 0 (-) */
|
||||||
BYTE SRB_Target; // Target's SCSI ID (W)
|
BYTE SRB_Target; /* Target's SCSI ID (W) */
|
||||||
BYTE SRB_Lun; // Target's LUN number (W)
|
BYTE SRB_Lun; /* Target's LUN number (W) */
|
||||||
DWORD SRB_BufLen; // Data Allocation LengthPG (W/R)
|
DWORD SRB_BufLen; /* Data Allocation LengthPG (W/R)*/
|
||||||
BYTE SRB_SenseLen; // Sense Allocation Length (W)
|
BYTE SRB_SenseLen; /* Sense Allocation Length (W) */
|
||||||
SEGPTR SRB_BufPointer; // Data Buffer Pointer (W)
|
SEGPTR SRB_BufPointer; /* Data Buffer Pointer (W) */
|
||||||
DWORD SRB_Rsvd1; // Reserved, MUST = 0 (-/W)
|
DWORD SRB_Rsvd1; /* Reserved, MUST = 0 (-/W)*/
|
||||||
BYTE SRB_CDBLen; // CDB Length = 6 (W)
|
BYTE SRB_CDBLen; /* CDB Length = 6 (W) */
|
||||||
BYTE SRB_HaStat; // Host Adapter Status (R)
|
BYTE SRB_HaStat; /* Host Adapter Status (R) */
|
||||||
BYTE SRB_TargStat; // Target Status (R)
|
BYTE SRB_TargStat; /* Target Status (R) */
|
||||||
FARPROC16 SRB_PostProc; // Post routine (W)
|
FARPROC16 SRB_PostProc; /* Post routine (W) */
|
||||||
BYTE SRB_Rsvd2[34]; // Reserved, MUST = 0
|
BYTE SRB_Rsvd2[34]; /* Reserved, MUST = 0 */
|
||||||
BYTE CDBByte[0]; // SCSI CBD - variable length (W)
|
BYTE CDBByte[0]; /* SCSI CBD - variable length (W) */
|
||||||
/* variable example for 6 byte cbd
|
/* variable example for 6 byte cbd
|
||||||
* BYTE CDBByte[6]; // SCSI CDB (W)
|
* BYTE CDBByte[6]; * SCSI CDB (W) *
|
||||||
* BYTE SenseArea6[SENSE_LEN]; // Request Sense buffer (R)
|
* BYTE SenseArea6[SENSE_LEN]; * Request Sense buffer (R) *
|
||||||
*/
|
*/
|
||||||
} WINE_PACKED ;
|
} WINE_PACKED ;
|
||||||
|
|
||||||
typedef struct SRB_ExecSCSICmd16 SRB_ExecSCSICmd16;
|
typedef struct SRB_ExecSCSICmd16 SRB_ExecSCSICmd16;
|
||||||
|
|
||||||
struct SRB_ExecSCSICmd32 {
|
struct SRB_ExecSCSICmd32 {
|
||||||
BYTE SRB_Cmd; // ASPI command code = SC_EXEC_SCSI_CMD
|
BYTE SRB_Cmd; /* ASPI command code = SC_EXEC_SCSI_CMD */
|
||||||
BYTE SRB_Status; // ASPI command status byte
|
BYTE SRB_Status; /* ASPI command status byte */
|
||||||
BYTE SRB_HaId; // ASPI host adapter number
|
BYTE SRB_HaId; /* ASPI host adapter number */
|
||||||
BYTE SRB_Flags; // ASPI request flags
|
BYTE SRB_Flags; /* ASPI request flags */
|
||||||
DWORD SRB_Hdr_Rsvd; // Reserved
|
DWORD SRB_Hdr_Rsvd; /* Reserved */
|
||||||
BYTE SRB_Target; // Target's SCSI ID
|
BYTE SRB_Target; /* Target's SCSI ID */
|
||||||
BYTE SRB_Lun; // Target's LUN number
|
BYTE SRB_Lun; /* Target's LUN number */
|
||||||
WORD SRB_Rsvd1; // Reserved for Alignment
|
WORD SRB_Rsvd1; /* Reserved for Alignment */
|
||||||
DWORD SRB_BufLen; // Data Allocation Length
|
DWORD SRB_BufLen; /* Data Allocation Length */
|
||||||
BYTE *SRB_BufPointer; // Data Buffer Point
|
BYTE *SRB_BufPointer; /* Data Buffer Point */
|
||||||
BYTE SRB_SenseLen; // Sense Allocation Length
|
BYTE SRB_SenseLen; /* Sense Allocation Length */
|
||||||
BYTE SRB_CDBLen; // CDB Length
|
BYTE SRB_CDBLen; /* CDB Length */
|
||||||
BYTE SRB_HaStat; // Host Adapter Status
|
BYTE SRB_HaStat; /* Host Adapter Status */
|
||||||
BYTE SRB_TargStat; // Target Status
|
BYTE SRB_TargStat; /* Target Status */
|
||||||
void (*SRB_PostProc)(); // Post routine
|
void (*SRB_PostProc)(); /* Post routine */
|
||||||
void *SRB_Rsvd2; // Reserved
|
void *SRB_Rsvd2; /* Reserved */
|
||||||
BYTE SRB_Rsvd3[16]; // Reserved for expansion
|
BYTE SRB_Rsvd3[16]; /* Reserved for expansion */
|
||||||
BYTE CDBByte[16]; // SCSI CDB
|
BYTE CDBByte[16]; /* SCSI CDB */
|
||||||
BYTE SenseArea[0]; // Request sense buffer - var length
|
BYTE SenseArea[0]; /* Request sense buffer - var length */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct SRB_ExecSCSICmd32 SRB_ExecSCSICmd32;
|
typedef struct SRB_ExecSCSICmd32 SRB_ExecSCSICmd32;
|
||||||
|
|
||||||
struct SRB_Abort16 {
|
struct SRB_Abort16 {
|
||||||
BYTE SRB_Cmd; // ASPI command code = SC_ABORT_SRB
|
BYTE SRB_Cmd; /* ASPI command code = SC_ABORT_SRB */
|
||||||
BYTE SRB_Status; // ASPI command status byte
|
BYTE SRB_Status; /* ASPI command status byte */
|
||||||
BYTE SRB_HaId; // ASPI host adapter number
|
BYTE SRB_HaId; /* ASPI host adapter number */
|
||||||
BYTE SRB_Flags; // ASPI request flags
|
BYTE SRB_Flags; /* ASPI request flags */
|
||||||
DWORD SRB_Hdr_Rsvd; // Reserved, MUST = 0
|
DWORD SRB_Hdr_Rsvd; /* Reserved, MUST = 0 */
|
||||||
LPSRB16 SRB_ToAbort; // Pointer to SRB to abort
|
LPSRB16 SRB_ToAbort; /* Pointer to SRB to abort */
|
||||||
} WINE_PACKED;
|
} WINE_PACKED;
|
||||||
|
|
||||||
typedef struct SRB_Abort16 SRB_Abort16;
|
typedef struct SRB_Abort16 SRB_Abort16;
|
||||||
|
|
||||||
struct SRB_BusDeviceReset16 {
|
struct SRB_BusDeviceReset16 {
|
||||||
BYTE SRB_Cmd; // ASPI command code = SC_RESET_DEV
|
BYTE SRB_Cmd; /* ASPI command code = SC_RESET_DEV */
|
||||||
BYTE SRB_Status; // ASPI command status byte
|
BYTE SRB_Status; /* ASPI command status byte */
|
||||||
BYTE SRB_HaId; // ASPI host adapter number
|
BYTE SRB_HaId; /* ASPI host adapter number */
|
||||||
BYTE SRB_Flags; // ASPI request flags
|
BYTE SRB_Flags; /* ASPI request flags */
|
||||||
DWORD SRB_Hdr_Rsvd; // Reserved, MUST = 0
|
DWORD SRB_Hdr_Rsvd; /* Reserved, MUST = 0 */
|
||||||
BYTE SRB_Target; // Target's SCSI ID
|
BYTE SRB_Target; /* Target's SCSI ID */
|
||||||
BYTE SRB_Lun; // Target's LUN number
|
BYTE SRB_Lun; /* Target's LUN number */
|
||||||
BYTE SRB_ResetRsvd1[14]; // Reserved, MUST = 0
|
BYTE SRB_ResetRsvd1[14]; /* Reserved, MUST = 0 */
|
||||||
BYTE SRB_HaStat; // Host Adapter Status
|
BYTE SRB_HaStat; /* Host Adapter Status */
|
||||||
BYTE SRB_TargStat; // Target Status
|
BYTE SRB_TargStat; /* Target Status */
|
||||||
SEGPTR SRB_PostProc; // Post routine
|
SEGPTR SRB_PostProc; /* Post routine */
|
||||||
BYTE SRB_ResetRsvd2[34]; // Reserved, MUST = 0
|
BYTE SRB_ResetRsvd2[34]; /* Reserved, MUST = 0 */
|
||||||
} WINE_PACKED;
|
} WINE_PACKED;
|
||||||
|
|
||||||
typedef struct SRB_BusDeviceReset16 SRB_BusDeviceReset16;
|
typedef struct SRB_BusDeviceReset16 SRB_BusDeviceReset16;
|
||||||
|
|
||||||
struct SRB_GDEVBlock16 {
|
struct SRB_GDEVBlock16 {
|
||||||
BYTE SRB_Cmd; // ASPI command code = SC_GET_DEV_TYPE
|
BYTE SRB_Cmd; /* ASPI command code = SC_GET_DEV_TYPE */
|
||||||
BYTE SRB_Status; // ASPI command status byte
|
BYTE SRB_Status; /* ASPI command status byte */
|
||||||
BYTE SRB_HaId; // ASPI host adapter number
|
BYTE SRB_HaId; /* ASPI host adapter number */
|
||||||
BYTE SRB_Flags; // ASPI request flags
|
BYTE SRB_Flags; /* ASPI request flags */
|
||||||
DWORD SRB_Hdr_Rsvd; // Reserved, MUST = 0
|
DWORD SRB_Hdr_Rsvd; /* Reserved, MUST = 0 */
|
||||||
BYTE SRB_Target; // Target's SCSI ID
|
BYTE SRB_Target; /* Target's SCSI ID */
|
||||||
BYTE SRB_Lun; // Target's LUN number
|
BYTE SRB_Lun; /* Target's LUN number */
|
||||||
BYTE SRB_DeviceType; // Target's peripheral device type
|
BYTE SRB_DeviceType; /* Target's peripheral device type */
|
||||||
} WINE_PACKED;
|
} WINE_PACKED;
|
||||||
|
|
||||||
typedef struct SRB_GDEVBlock16 SRB_GDEVBlock16;
|
typedef struct SRB_GDEVBlock16 SRB_GDEVBlock16;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#define CBF_EDIT 0x0040
|
#define CBF_EDIT 0x0040
|
||||||
#define CBF_NORESIZE 0x0080
|
#define CBF_NORESIZE 0x0080
|
||||||
#define CBF_NOTIFY 0x0100
|
#define CBF_NOTIFY 0x0100
|
||||||
|
#define CBF_NOREDRAW 0x0200
|
||||||
#define CBF_EUI 0x8000
|
#define CBF_EUI 0x8000
|
||||||
|
|
||||||
/* Combo state struct */
|
/* Combo state struct */
|
||||||
|
|
|
@ -11,20 +11,6 @@ extern "C" {
|
||||||
|
|
||||||
#include "wintypes.h" /* needed for CHOOSEFONT structure */
|
#include "wintypes.h" /* needed for CHOOSEFONT structure */
|
||||||
|
|
||||||
#define RT_CURSOR MAKEINTRESOURCE(1)
|
|
||||||
#define RT_BITMAP MAKEINTRESOURCE(2)
|
|
||||||
#define RT_ICON MAKEINTRESOURCE(3)
|
|
||||||
#define RT_MENU MAKEINTRESOURCE(4)
|
|
||||||
#define RT_DIALOG MAKEINTRESOURCE(5)
|
|
||||||
#define RT_STRING MAKEINTRESOURCE(6)
|
|
||||||
#define RT_FONTDIR MAKEINTRESOURCE(7)
|
|
||||||
#define RT_FONT MAKEINTRESOURCE(8)
|
|
||||||
#define RT_ACCELERATOR MAKEINTRESOURCE(9)
|
|
||||||
#define RT_RCDATA MAKEINTRESOURCE(10)
|
|
||||||
|
|
||||||
#define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
|
|
||||||
#define RT_GROUP_ICON MAKEINTRESOURCE(14)
|
|
||||||
|
|
||||||
#define OFN_READONLY 0x00000001
|
#define OFN_READONLY 0x00000001
|
||||||
#define OFN_OVERWRITEPROMPT 0x00000002
|
#define OFN_OVERWRITEPROMPT 0x00000002
|
||||||
#define OFN_HIDEREADONLY 0x00000004
|
#define OFN_HIDEREADONLY 0x00000004
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#if !defined(COMPOBJ_H)
|
#if !defined(COMPOBJ_H)
|
||||||
#define COMPOBJ_H
|
#define COMPOBJ_H
|
||||||
|
|
||||||
|
#include "ole.h"
|
||||||
|
|
||||||
struct tagGUID
|
struct tagGUID
|
||||||
{
|
{
|
||||||
DWORD Data1;
|
DWORD Data1;
|
||||||
|
@ -10,9 +12,24 @@ struct tagGUID
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct tagGUID GUID;
|
typedef struct tagGUID GUID;
|
||||||
typedef struct tagGUID CLSID;
|
typedef struct tagGUID CLSID,*LPCLSID,*REFCLSID;
|
||||||
|
typedef struct tagGUID IID,*REFIID,*LPIID;
|
||||||
|
|
||||||
OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR);
|
OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR);
|
||||||
OLESTATUS WINAPI CLSIDFromString(const LPCSTR, CLSID *);
|
OLESTATUS WINAPI CLSIDFromString(const LPCSTR, CLSID *);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef INITGUID
|
||||||
|
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||||
|
const GUID name =\
|
||||||
|
{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
|
||||||
|
#else
|
||||||
|
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||||
|
extern const GUID name
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DEFINE_OLEGUID(name, l, w1, w2) \
|
||||||
|
DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
|
||||||
|
|
||||||
|
#define DEFINE_SHLGUID(name, l, w1, w2) DEFINE_OLEGUID(name,l,w1,w2)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -266,8 +266,8 @@ extern int DEBUG_GetCurrentFrame(struct name_hash ** name,
|
||||||
extern int DEBUG_ReadExecutableDbgInfo(void);
|
extern int DEBUG_ReadExecutableDbgInfo(void);
|
||||||
|
|
||||||
/* debugger/msc.c */
|
/* debugger/msc.c */
|
||||||
extern int DEBUG_RegisterDebugInfo(struct pe_data *pe, int, const char *,
|
extern int DEBUG_RegisterDebugInfo( HMODULE32, const char *,
|
||||||
unsigned long, unsigned long);
|
unsigned long, unsigned long);
|
||||||
extern int DEBUG_ProcessDeferredDebug(void);
|
extern int DEBUG_ProcessDeferredDebug(void);
|
||||||
extern int DEBUG_RegisterELFDebugInfo(int load_addr, u_long size, char * name);
|
extern int DEBUG_RegisterELFDebugInfo(int load_addr, u_long size, char * name);
|
||||||
extern void DEBUG_InfoShare(void);
|
extern void DEBUG_InfoShare(void);
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
#ifndef _WINE_INTERFACES_H
|
||||||
|
#define _WINE_INTERFACES_H
|
||||||
|
|
||||||
|
#include "ole.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "compobj.h"
|
||||||
|
|
||||||
|
DEFINE_OLEGUID(IID_IUnknown,0,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IClassFactory,1,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IMalloc,2,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IMarshal,3,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IStorage,0xb,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IStream,0xc,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IBindCtx,0xe,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IMoniker,0xf,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IRunningObject,0x10,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IRootStorage,0x12,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IMessageFilter,0x16,0,0);
|
||||||
|
DEFINE_OLEGUID(IID_IStdMarshalInfo,0x18,0,0);
|
||||||
|
|
||||||
|
typedef struct tagUNKNOWN *LPUNKNOWN,IUnknown;
|
||||||
|
typedef struct {
|
||||||
|
HRESULT (CALLBACK *fnQueryInterface)(LPUNKNOWN this,REFIID refiid,LPVOID *obj);
|
||||||
|
HRESULT (CALLBACK *fnAddRef)(LPUNKNOWN this);
|
||||||
|
HRESULT (CALLBACK *fnRelease)(LPUNKNOWN this);
|
||||||
|
} *LPUNKNOWN_VTABLE;
|
||||||
|
|
||||||
|
struct tagUNKNOWN {
|
||||||
|
LPUNKNOWN_VTABLE lpvtbl;
|
||||||
|
/* internal stuff. Not needed until we actually implement IUnknown */
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct tagCLASSFACTORY *LPCLASSFACTORY,IClassFactory;
|
||||||
|
typedef struct {
|
||||||
|
HRESULT (CALLBACK *fnQueryInterface)(LPCLASSFACTORY this,REFIID refiid,LPVOID *obj);
|
||||||
|
HRESULT (CALLBACK *fnAddRef)(LPCLASSFACTORY this);
|
||||||
|
HRESULT (CALLBACK *fnRelease)(LPCLASSFACTORY this);
|
||||||
|
HRESULT (CALLBACK *fnCreateInstance)(LPCLASSFACTORY this,LPUNKNOWN pUnkOuter,REFIID riid,LPVOID * ppvObject);
|
||||||
|
} *LPCLASSFACTORY_VTABLE;
|
||||||
|
|
||||||
|
struct tagCLASSFACTORY {
|
||||||
|
LPCLASSFACTORY_VTABLE lpvtbl;
|
||||||
|
/*internal stuff. Not needed until we actually implement IClassFactory*/
|
||||||
|
};
|
||||||
|
#endif /*_WINE_INTERFACES_H*/
|
|
@ -46,7 +46,7 @@ typedef struct
|
||||||
WORD min_swap_area; /* 3c Min. swap area size */
|
WORD min_swap_area; /* 3c Min. swap area size */
|
||||||
WORD expected_version; /* 3e Expected Windows version */
|
WORD expected_version; /* 3e Expected Windows version */
|
||||||
/* From here, these are extra fields not present in normal Windows */
|
/* From here, these are extra fields not present in normal Windows */
|
||||||
PE_MODULE *pe_module; /* 40 PE module handle for Win32 modules */
|
HMODULE32 module32; /* 40 PE module handle for Win32 modules */
|
||||||
HMODULE16 self; /* 44 Handle for this module */
|
HMODULE16 self; /* 44 Handle for this module */
|
||||||
WORD self_loading_sel; /* 46 Selector used for self-loading apps. */
|
WORD self_loading_sel; /* 46 Selector used for self-loading apps. */
|
||||||
} NE_MODULE;
|
} NE_MODULE;
|
||||||
|
@ -107,8 +107,8 @@ typedef struct resource_nameinfo_s NE_NAMEINFO;
|
||||||
(((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
|
(((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
|
||||||
|
|
||||||
#define NE_WIN32_MODULE(pModule) \
|
#define NE_WIN32_MODULE(pModule) \
|
||||||
((struct pe_data *)(((pModule)->flags & NE_FFLAGS_WIN32) ? \
|
((((pModule)->flags & NE_FFLAGS_WIN32) ? \
|
||||||
((NE_WIN32_EXTRAINFO *)((pModule) + 1))->pe_module : 0))
|
((NE_WIN32_EXTRAINFO *)((pModule) + 1))->module32 : 0))
|
||||||
|
|
||||||
/* module.c */
|
/* module.c */
|
||||||
extern NE_MODULE *MODULE_GetPtr( HMODULE32 hModule );
|
extern NE_MODULE *MODULE_GetPtr( HMODULE32 hModule );
|
||||||
|
@ -133,11 +133,10 @@ extern FARPROC16 WIN32_GetProcAddress16( HMODULE32 hmodule, LPSTR name );
|
||||||
|
|
||||||
/* builtin.c */
|
/* builtin.c */
|
||||||
extern BOOL32 BUILTIN_Init(void);
|
extern BOOL32 BUILTIN_Init(void);
|
||||||
extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL32 force );
|
extern HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force );
|
||||||
extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
|
extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
|
||||||
extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay,
|
extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay,
|
||||||
DWORD *typemask );
|
DWORD *typemask );
|
||||||
extern FARPROC32 BUILTIN_GetProcAddress32(NE_MODULE *pModule, LPCSTR function);
|
|
||||||
extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
|
extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
|
||||||
extern void BUILTIN_PrintDLLs(void);
|
extern void BUILTIN_PrintDLLs(void);
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,14 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BYTE Value[6];
|
BYTE Value[6];
|
||||||
} SID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
|
} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
|
||||||
|
|
||||||
typedef struct _SID {
|
typedef struct _SID {
|
||||||
BYTE Revision;
|
BYTE Revision;
|
||||||
BYTE SubAuthorityCount;
|
BYTE SubAuthorityCount;
|
||||||
SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
|
SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
|
||||||
DWORD SubAuthority[1]; /* more than one */
|
DWORD SubAuthority[1]; /* more than one */
|
||||||
} SID,*LPSID;
|
} SID,*PSID,*LPSID;
|
||||||
|
|
||||||
#define SID_REVISION (1) /* Current revision */
|
#define SID_REVISION (1) /* Current revision */
|
||||||
#define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
|
#define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
|
||||||
|
@ -121,7 +121,18 @@ typedef struct {
|
||||||
LPSID Group;
|
LPSID Group;
|
||||||
LPACL Sacl;
|
LPACL Sacl;
|
||||||
LPACL Dacl;
|
LPACL Dacl;
|
||||||
} SECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR;
|
} SECURITY_DESCRIPTOR,*PSECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR;
|
||||||
|
|
||||||
|
typedef enum tagSID_NAME_USE {
|
||||||
|
SidTypeUser = 1,
|
||||||
|
SidTypeGroup,
|
||||||
|
SidTypeDomain,
|
||||||
|
SidTypeAlias,
|
||||||
|
SidTypeWellKnownGroup,
|
||||||
|
SidTypeDeletedAccount,
|
||||||
|
SidTypeInvalid,
|
||||||
|
SidTypeUnknown
|
||||||
|
} SID_NAME_USE,*PSID_NAME_USE,*LPSID_NAME_USE;
|
||||||
|
|
||||||
/* NT lowlevel Strings (handled by Rtl* functions in NTDLL)
|
/* NT lowlevel Strings (handled by Rtl* functions in NTDLL)
|
||||||
* If they are zero terminated, Length does not include the terminating 0.
|
* If they are zero terminated, Length does not include the terminating 0.
|
||||||
|
|
|
@ -7,8 +7,9 @@
|
||||||
|
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
|
||||||
typedef LPVOID LPUNKNOWN;
|
|
||||||
typedef LPCSTR OLE_LPCSTR;
|
typedef LPCSTR OLE_LPCSTR;
|
||||||
|
typedef LPSTR LPOLESTR;
|
||||||
|
typedef LPCSTR LPCOLESTR;
|
||||||
|
|
||||||
/* object types */
|
/* object types */
|
||||||
#define OT_LINK 1
|
#define OT_LINK 1
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
typedef LONG HRESULT;
|
typedef LONG HRESULT;
|
||||||
|
|
||||||
|
typedef LPVOID LPMESSAGEFILTER;
|
||||||
|
|
||||||
#define S_OK 0
|
#define S_OK 0
|
||||||
#define S_FALSE 1
|
#define S_FALSE 1
|
||||||
|
|
||||||
|
|
|
@ -6,22 +6,12 @@
|
||||||
#include "winnt.h"
|
#include "winnt.h"
|
||||||
#include "peexe.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;
|
|
||||||
HMODULE32 mappeddll;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct pe_data PE_MODULE;
|
|
||||||
|
|
||||||
/* modreference used for attached processes
|
/* modreference used for attached processes
|
||||||
* all section are calculated here, relocations etc.
|
* all section are calculated here, relocations etc.
|
||||||
*/
|
*/
|
||||||
struct pe_modref {
|
struct pe_modref {
|
||||||
struct pe_modref *next;
|
struct pe_modref *next;
|
||||||
PE_MODULE *pe_module;
|
HMODULE32 module;
|
||||||
unsigned long int load_addr;
|
|
||||||
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
|
LPIMAGE_IMPORT_DESCRIPTOR pe_import;
|
||||||
LPIMAGE_EXPORT_DIRECTORY pe_export;
|
LPIMAGE_EXPORT_DIRECTORY pe_export;
|
||||||
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
|
LPIMAGE_RESOURCE_DIRECTORY pe_resource;
|
||||||
|
@ -35,7 +25,7 @@ struct pe_modref {
|
||||||
typedef struct pe_modref PE_MODREF;
|
typedef struct pe_modref PE_MODREF;
|
||||||
|
|
||||||
extern int PE_unloadImage(HMODULE32 hModule);
|
extern int PE_unloadImage(HMODULE32 hModule);
|
||||||
extern FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName);
|
extern FARPROC32 PE_FindExportedFunction(HMODULE32 hModule, LPCSTR funcName);
|
||||||
extern void my_wcstombs(char * result, u_short * source, int len);
|
extern void my_wcstombs(char * result, u_short * source, int len);
|
||||||
extern BOOL32 PE_EnumResourceTypes32A(HMODULE32,ENUMRESTYPEPROC32A,LONG);
|
extern BOOL32 PE_EnumResourceTypes32A(HMODULE32,ENUMRESTYPEPROC32A,LONG);
|
||||||
extern BOOL32 PE_EnumResourceTypes32W(HMODULE32,ENUMRESTYPEPROC32W,LONG);
|
extern BOOL32 PE_EnumResourceTypes32W(HMODULE32,ENUMRESTYPEPROC32W,LONG);
|
||||||
|
@ -51,4 +41,6 @@ extern HGLOBAL32 PE_LoadResource32(HINSTANCE32,HRSRC32);
|
||||||
struct _PDB32; /* forward definition */
|
struct _PDB32; /* forward definition */
|
||||||
extern void PE_InitializeDLLs(struct _PDB32*,DWORD,LPVOID);
|
extern void PE_InitializeDLLs(struct _PDB32*,DWORD,LPVOID);
|
||||||
|
|
||||||
|
extern LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(LPIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD);
|
||||||
|
|
||||||
#endif /* __WINE_PE_IMAGE_H */
|
#endif /* __WINE_PE_IMAGE_H */
|
||||||
|
|
|
@ -145,6 +145,17 @@ typedef struct _IMAGE_NT_HEADERS {
|
||||||
IMAGE_OPTIONAL_HEADER OptionalHeader;
|
IMAGE_OPTIONAL_HEADER OptionalHeader;
|
||||||
} IMAGE_NT_HEADERS,*LPIMAGE_NT_HEADERS;
|
} IMAGE_NT_HEADERS,*LPIMAGE_NT_HEADERS;
|
||||||
|
|
||||||
|
|
||||||
|
#define PE_HEADER(module) \
|
||||||
|
((IMAGE_NT_HEADERS*)((LPBYTE)(module) + \
|
||||||
|
(((IMAGE_DOS_HEADER*)(module))->e_lfanew)))
|
||||||
|
|
||||||
|
#define PE_SECTIONS(module) \
|
||||||
|
((IMAGE_SECTION_HEADER*)((LPBYTE)&PE_HEADER(module)->OptionalHeader + \
|
||||||
|
PE_HEADER(module)->FileHeader.SizeOfOptionalHeader))
|
||||||
|
|
||||||
|
#define RVA_PTR(module,field) ((LPBYTE)(module) + PE_HEADER(module)->field)
|
||||||
|
|
||||||
/* Section header format */
|
/* Section header format */
|
||||||
|
|
||||||
#define IMAGE_SIZEOF_SHORT_NAME 8
|
#define IMAGE_SIZEOF_SHORT_NAME 8
|
||||||
|
|
|
@ -50,6 +50,17 @@ typedef struct tagSHFILEINFO32W {
|
||||||
|
|
||||||
DECL_WINELIB_TYPE_AW(SHFILEINFO);
|
DECL_WINELIB_TYPE_AW(SHFILEINFO);
|
||||||
|
|
||||||
|
typedef struct _AppBarData {
|
||||||
|
DWORD cbSize;
|
||||||
|
HWND32 hWnd;
|
||||||
|
UINT32 uCallbackMessage;
|
||||||
|
UINT32 uEdge;
|
||||||
|
RECT32 rc;
|
||||||
|
LPARAM lParam;
|
||||||
|
} APPBARDATA, *PAPPBARDATA;
|
||||||
|
|
||||||
|
DECL_WINELIB_TYPE(APPBARDATA);
|
||||||
|
|
||||||
#define SHGFI_ICON 0x000000100 /* get icon */
|
#define SHGFI_ICON 0x000000100 /* get icon */
|
||||||
#define SHGFI_DISPLAYNAME 0x000000200 /* get display name */
|
#define SHGFI_DISPLAYNAME 0x000000200 /* get display name */
|
||||||
#define SHGFI_TYPENAME 0x000000400 /* get type name */
|
#define SHGFI_TYPENAME 0x000000400 /* get type name */
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
#ifndef _WINE_SHLOBJ_H
|
||||||
|
#define _WINE_SHLOBJ_H
|
||||||
|
|
||||||
|
#include "ole.h"
|
||||||
|
#include "ole2.h"
|
||||||
|
#include "compobj.h"
|
||||||
|
|
||||||
|
typedef LPVOID LPBC; /* *IBindCtx really */
|
||||||
|
typedef LPVOID LPSTRRET,LPENUMIDLIST;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* shell32 classids
|
||||||
|
*/
|
||||||
|
DEFINE_SHLGUID(CLSID_ShellDesktop, 0x00021400L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(CLSID_ShellLink, 0x00021401L, 0, 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* shell32 Interface ids
|
||||||
|
*/
|
||||||
|
DEFINE_SHLGUID(IID_IContextMenu, 0x000214E4L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IShellFolder, 0x000214E6L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IShellExtInit, 0x000214E8L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IShellPropSheetExt, 0x000214E9L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IExtractIcon, 0x000214EBL, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IShellLink, 0x000214EEL, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IShellCopyHook, 0x000214EFL, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IFileViewer, 0x000214F0L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IEnumIDList, 0x000214F2L, 0, 0);
|
||||||
|
DEFINE_SHLGUID(IID_IFileViewerSite, 0x000214F3L, 0, 0);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
WORD cb; /* nr of bytes in this item */
|
||||||
|
BYTE abID[1];/* first byte in this item */
|
||||||
|
} SHITEMID,*LPSHITEMID;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
SHITEMID mkid; /* first itemid in list */
|
||||||
|
} ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST;
|
||||||
|
|
||||||
|
/* The IShellFolder interface ... the basic interface for a lot of stuff */
|
||||||
|
|
||||||
|
typedef struct tagSHELLFOLDER *LPSHELLFOLDER,IShellFolder;
|
||||||
|
typedef struct {
|
||||||
|
HRESULT (CALLBACK *fnQueryInterface)(LPSHELLFOLDER this,REFIID refiid,LPVOID *obj);
|
||||||
|
HRESULT (CALLBACK *fnAddRef)(LPSHELLFOLDER this);
|
||||||
|
HRESULT (CALLBACK *fnRelease)(LPSHELLFOLDER this);
|
||||||
|
/* IShellFolder methods */
|
||||||
|
|
||||||
|
HRESULT (CALLBACK *fnParseDisplayName) (LPSHELLFOLDER this,HWND32 hwndOwner,LPBC pbcReserved,LPOLESTR lpszDisplayName,DWORD * pchEaten,LPITEMIDLIST * ppidl, DWORD *pdwAttributes) ;
|
||||||
|
|
||||||
|
HRESULT (CALLBACK *fnEnumObjects)( LPSHELLFOLDER this,HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST* ppenumIDList);
|
||||||
|
HRESULT (CALLBACK *fnBindToObject)(LPSHELLFOLDER this, LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut);
|
||||||
|
HRESULT (CALLBACK *fnBindToStorage)(LPSHELLFOLDER this, LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvObj);
|
||||||
|
HRESULT (CALLBACK *fnCompareIDs) (LPSHELLFOLDER this, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
||||||
|
HRESULT (CALLBACK *fnCreateViewObject) (LPSHELLFOLDER this, HWND32 hwndOwner, REFIID riid, LPVOID * ppvOut);
|
||||||
|
HRESULT (CALLBACK *fnGetAttributesOf) (LPSHELLFOLDER this, UINT32 cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut);
|
||||||
|
HRESULT (CALLBACK *fnGetUIObjectOf) (LPSHELLFOLDER this, HWND32 hwndOwner, UINT32 cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut);
|
||||||
|
HRESULT (CALLBACK *fnGetDisplayNameOf) (LPSHELLFOLDER this, LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName);
|
||||||
|
HRESULT (CALLBACK *fnSetNameOf) (LPSHELLFOLDER this, HWND32 hwndOwner, LPCITEMIDLIST pidl, LPCOLESTR lpszName, DWORD uFlags, LPITEMIDLIST * ppidlOut);
|
||||||
|
} *LPSHELLFOLDER_VTABLE;
|
||||||
|
|
||||||
|
struct tagSHELLFOLDER {
|
||||||
|
LPSHELLFOLDER_VTABLE *lpvtbl;
|
||||||
|
};
|
||||||
|
#endif /*_WINE_SHLOBJ_H*/
|
|
@ -1,16 +0,0 @@
|
||||||
/*
|
|
||||||
* Unicode string management
|
|
||||||
*
|
|
||||||
* Copyright 1995 Martin von Loewis
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __WINE_STRING32_H
|
|
||||||
#define __WINE_STRING32_H
|
|
||||||
|
|
||||||
#include "wintypes.h"
|
|
||||||
|
|
||||||
LPWSTR STRING32_DupAnsiToUni(LPCSTR src);
|
|
||||||
LPWSTR STRING32_strdupW(LPCWSTR);
|
|
||||||
|
|
||||||
#endif /* __WINE_STRING32_H */
|
|
|
@ -1 +1 @@
|
||||||
#define WINE_RELEASE_INFO "Wine release 971116"
|
#define WINE_RELEASE_INFO "Wine release 971130"
|
||||||
|
|
|
@ -97,7 +97,7 @@ typedef struct
|
||||||
#define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
|
#define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
|
||||||
#define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
|
#define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
|
||||||
#define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
|
#define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
|
||||||
#define WIN_NO_REDRAW 0x0020 /* WM_SETREDRAW called for this window */
|
/* Used to have WIN_NO_REDRAW 0x0020 here */
|
||||||
#define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
|
#define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
|
||||||
#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
|
#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
|
||||||
#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
|
#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
|
||||||
|
|
|
@ -1973,6 +1973,15 @@ typedef struct
|
||||||
DECL_WINELIB_TYPE(ACCEL);
|
DECL_WINELIB_TYPE(ACCEL);
|
||||||
DECL_WINELIB_TYPE(LPACCEL);
|
DECL_WINELIB_TYPE(LPACCEL);
|
||||||
|
|
||||||
|
/* modifiers for RegisterHotKey */
|
||||||
|
#define MOD_ALT 0x0001
|
||||||
|
#define MOD_CONTROL 0x0002
|
||||||
|
#define MOD_SHIFT 0x0004
|
||||||
|
#define MOD_WIN 0x0008
|
||||||
|
|
||||||
|
/* ids for RegisterHotKey */
|
||||||
|
#define IDHOT_SNAPWINDOW (-1) /* SHIFT-PRINTSCRN */
|
||||||
|
#define IDHOT_SNAPDESKTOP (-2) /* PRINTSCRN */
|
||||||
|
|
||||||
/* Flags for DrawIconEx. */
|
/* Flags for DrawIconEx. */
|
||||||
#define DI_MASK 1
|
#define DI_MASK 1
|
||||||
|
@ -5461,7 +5470,6 @@ VOID WINAPI SetPriority(HTASK16,INT16);
|
||||||
FARPROC16 WINAPI SetResourceHandler(HINSTANCE16,SEGPTR,FARPROC16);
|
FARPROC16 WINAPI SetResourceHandler(HINSTANCE16,SEGPTR,FARPROC16);
|
||||||
WORD WINAPI SetSelectorBase(WORD,DWORD);
|
WORD WINAPI SetSelectorBase(WORD,DWORD);
|
||||||
WORD WINAPI SetSelectorLimit(WORD,DWORD);
|
WORD WINAPI SetSelectorLimit(WORD,DWORD);
|
||||||
LONG WINAPI SetSwapAreaSize(WORD);
|
|
||||||
HQUEUE16 WINAPI SetTaskQueue(HTASK16,HQUEUE16);
|
HQUEUE16 WINAPI SetTaskQueue(HTASK16,HQUEUE16);
|
||||||
FARPROC16 WINAPI SetTaskSignalProc(HTASK16,FARPROC16);
|
FARPROC16 WINAPI SetTaskSignalProc(HTASK16,FARPROC16);
|
||||||
DWORD WINAPI SetViewportExt(HDC16,INT16,INT16);
|
DWORD WINAPI SetViewportExt(HDC16,INT16,INT16);
|
||||||
|
@ -5478,7 +5486,6 @@ BOOL16 WINAPI WaitEvent(HTASK16);
|
||||||
INT16 WINAPI WriteComm(INT16,LPSTR,INT16);
|
INT16 WINAPI WriteComm(INT16,LPSTR,INT16);
|
||||||
VOID WINAPI WriteOutProfiles(VOID);
|
VOID WINAPI WriteOutProfiles(VOID);
|
||||||
VOID WINAPI hmemcpy(LPVOID,LPCVOID,LONG);
|
VOID WINAPI hmemcpy(LPVOID,LPCVOID,LONG);
|
||||||
VOID WINAPI Yield(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* Declarations for functions that exist only in Win32 */
|
/* Declarations for functions that exist only in Win32 */
|
||||||
|
@ -6160,6 +6167,9 @@ LRESULT WINAPI DefWindowProc16(HWND16,UINT16,WPARAM16,LPARAM);
|
||||||
LRESULT WINAPI DefWindowProc32A(HWND32,UINT32,WPARAM32,LPARAM);
|
LRESULT WINAPI DefWindowProc32A(HWND32,UINT32,WPARAM32,LPARAM);
|
||||||
LRESULT WINAPI DefWindowProc32W(HWND32,UINT32,WPARAM32,LPARAM);
|
LRESULT WINAPI DefWindowProc32W(HWND32,UINT32,WPARAM32,LPARAM);
|
||||||
#define DefWindowProc WINELIB_NAME_AW(DefWindowProc)
|
#define DefWindowProc WINELIB_NAME_AW(DefWindowProc)
|
||||||
|
BOOL16 WINAPI DefineHandleTable16(WORD);
|
||||||
|
#define DefineHandleTable32(w) ((w),TRUE)
|
||||||
|
#define DefineHandleTable WINELIB_NAME(DefineHandleTable)
|
||||||
ATOM WINAPI DeleteAtom16(ATOM);
|
ATOM WINAPI DeleteAtom16(ATOM);
|
||||||
ATOM WINAPI DeleteAtom32(ATOM);
|
ATOM WINAPI DeleteAtom32(ATOM);
|
||||||
#define DeleteAtom WINELIB_NAME(DeleteAtom)
|
#define DeleteAtom WINELIB_NAME(DeleteAtom)
|
||||||
|
@ -6357,6 +6367,10 @@ HICON16 WINAPI ExtractIcon16(HINSTANCE16,LPCSTR,UINT16);
|
||||||
HICON32 WINAPI ExtractIcon32A(HINSTANCE32,LPCSTR,UINT32);
|
HICON32 WINAPI ExtractIcon32A(HINSTANCE32,LPCSTR,UINT32);
|
||||||
HICON32 WINAPI ExtractIcon32W(HINSTANCE32,LPCWSTR,UINT32);
|
HICON32 WINAPI ExtractIcon32W(HINSTANCE32,LPCWSTR,UINT32);
|
||||||
#define ExtractIcon WINELIB_NAME_AW(ExtractIcon)
|
#define ExtractIcon WINELIB_NAME_AW(ExtractIcon)
|
||||||
|
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16,LPSTR,LPWORD);
|
||||||
|
HICON32 WINAPI ExtractAssociatedIcon32A(HINSTANCE32,LPSTR,LPWORD);
|
||||||
|
HICON32 WINAPI ExtractAssociatedIcon32W(HINSTANCE32,LPWSTR,LPWORD);
|
||||||
|
#define ExtractAssociatedIcon WINELIB_NAME_AW(ExtractAssociatedIcon)
|
||||||
BOOL16 WINAPI ExtTextOut16(HDC16,INT16,INT16,UINT16,const RECT16*,
|
BOOL16 WINAPI ExtTextOut16(HDC16,INT16,INT16,UINT16,const RECT16*,
|
||||||
LPCSTR,UINT16,const INT16*);
|
LPCSTR,UINT16,const INT16*);
|
||||||
BOOL32 WINAPI ExtTextOut32A(HDC32,INT32,INT32,UINT32,const RECT32*,
|
BOOL32 WINAPI ExtTextOut32A(HDC32,INT32,INT32,UINT32,const RECT32*,
|
||||||
|
@ -7173,6 +7187,12 @@ HGLOBAL16 WINAPI LockSegment16(HGLOBAL16);
|
||||||
BOOL16 WINAPI LockWindowUpdate16(HWND16);
|
BOOL16 WINAPI LockWindowUpdate16(HWND16);
|
||||||
BOOL32 WINAPI LockWindowUpdate32(HWND32);
|
BOOL32 WINAPI LockWindowUpdate32(HWND32);
|
||||||
#define LockWindowUpdate WINELIB_NAME(LockWindowUpdate)
|
#define LockWindowUpdate WINELIB_NAME(LockWindowUpdate)
|
||||||
|
INT16 WINAPI LookupIconIdFromDirectory16(LPBYTE,BOOL16);
|
||||||
|
INT32 WINAPI LookupIconIdFromDirectory32(LPBYTE,BOOL32);
|
||||||
|
#define LookupIconIdFromDirectory WINELIB_NAME(LookupIconIdFromDirectory)
|
||||||
|
INT16 WINAPI LookupIconIdFromDirectoryEx16(LPBYTE,BOOL16,INT16,INT16,UINT16);
|
||||||
|
INT32 WINAPI LookupIconIdFromDirectoryEx32(LPBYTE,BOOL32,INT32,INT32,UINT32);
|
||||||
|
#define LookupIconIdFromDirectoryEx WINELIB_NAME(LookupIconIdFromDirectoryEx)
|
||||||
BOOL16 WINAPI LPtoDP16(HDC16,LPPOINT16,INT16);
|
BOOL16 WINAPI LPtoDP16(HDC16,LPPOINT16,INT16);
|
||||||
BOOL32 WINAPI LPtoDP32(HDC32,LPPOINT32,INT32);
|
BOOL32 WINAPI LPtoDP32(HDC32,LPPOINT32,INT32);
|
||||||
#define LPtoDP WINELIB_NAME(LPtoDP)
|
#define LPtoDP WINELIB_NAME(LPtoDP)
|
||||||
|
@ -7620,6 +7640,9 @@ DWORD WINAPI SetSoundNoise32(DWORD,DWORD);
|
||||||
INT16 WINAPI SetStretchBltMode16(HDC16,INT16);
|
INT16 WINAPI SetStretchBltMode16(HDC16,INT16);
|
||||||
INT32 WINAPI SetStretchBltMode32(HDC32,INT32);
|
INT32 WINAPI SetStretchBltMode32(HDC32,INT32);
|
||||||
#define SetStretchBltMode WINELIB_NAME(SetStretchBltMode)
|
#define SetStretchBltMode WINELIB_NAME(SetStretchBltMode)
|
||||||
|
LONG WINAPI SetSwapAreaSize16(WORD);
|
||||||
|
#define SetSwapAreaSize32(w) (w)
|
||||||
|
#define SetSwapAreaSize WINELIB_NAME(SetSwapAreaSize)
|
||||||
VOID WINAPI SetSysColors16(INT16,const INT16*,const COLORREF*);
|
VOID WINAPI SetSysColors16(INT16,const INT16*,const COLORREF*);
|
||||||
BOOL32 WINAPI SetSysColors32(INT32,const INT32*,const COLORREF*);
|
BOOL32 WINAPI SetSysColors32(INT32,const INT32*,const COLORREF*);
|
||||||
#define SetSysColors WINELIB_NAME(SetSysColors)
|
#define SetSysColors WINELIB_NAME(SetSysColors)
|
||||||
|
@ -7861,6 +7884,9 @@ BOOL16 WINAPI WriteProfileString16(LPCSTR,LPCSTR,LPCSTR);
|
||||||
BOOL32 WINAPI WriteProfileString32A(LPCSTR,LPCSTR,LPCSTR);
|
BOOL32 WINAPI WriteProfileString32A(LPCSTR,LPCSTR,LPCSTR);
|
||||||
BOOL32 WINAPI WriteProfileString32W(LPCWSTR,LPCWSTR,LPCWSTR);
|
BOOL32 WINAPI WriteProfileString32W(LPCWSTR,LPCWSTR,LPCWSTR);
|
||||||
#define WriteProfileString WINELIB_NAME_AW(WriteProfileString)
|
#define WriteProfileString WINELIB_NAME_AW(WriteProfileString)
|
||||||
|
VOID WINAPI Yield16(void);
|
||||||
|
#define Yield32()
|
||||||
|
#define Yield WINELIB_NAME(Yield)
|
||||||
SEGPTR WINAPI lstrcat16(SEGPTR,LPCSTR);
|
SEGPTR WINAPI lstrcat16(SEGPTR,LPCSTR);
|
||||||
LPSTR WINAPI lstrcat32A(LPSTR,LPCSTR);
|
LPSTR WINAPI lstrcat32A(LPSTR,LPCSTR);
|
||||||
LPWSTR WINAPI lstrcat32W(LPWSTR,LPCWSTR);
|
LPWSTR WINAPI lstrcat32W(LPWSTR,LPCWSTR);
|
||||||
|
|
|
@ -38,5 +38,6 @@ extern int WIN32_LastError;
|
||||||
#define ERROR_IO_DEVICE 1117
|
#define ERROR_IO_DEVICE 1117
|
||||||
#define ERROR_POSSIBLE_DEADLOCK 1131
|
#define ERROR_POSSIBLE_DEADLOCK 1131
|
||||||
#define ERROR_BAD_DEVICE 1200
|
#define ERROR_BAD_DEVICE 1200
|
||||||
|
#define ERROR_NO_NETWORK 1222
|
||||||
|
|
||||||
#endif /* __WINE_WINERROR_H */
|
#endif /* __WINE_WINERROR_H */
|
||||||
|
|
|
@ -145,7 +145,7 @@ typedef void* SEGPTR;
|
||||||
|
|
||||||
/* Handle types that exist both in Win16 and Win32. */
|
/* Handle types that exist both in Win16 and Win32. */
|
||||||
|
|
||||||
#define DECLARE_HANDLE(a) typedef HANDLE16 a##16; typedef HANDLE32 a##32;
|
#define DECLARE_HANDLE(a) typedef HANDLE16 a##16; typedef HANDLE32 a##32
|
||||||
DECLARE_HANDLE(HACCEL);
|
DECLARE_HANDLE(HACCEL);
|
||||||
DECLARE_HANDLE(HBITMAP);
|
DECLARE_HANDLE(HBITMAP);
|
||||||
DECLARE_HANDLE(HBRUSH);
|
DECLARE_HANDLE(HBRUSH);
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
|
||||||
/* Stubs needed for linking with Winelib */
|
/* Stub needed for linking with Winelib */
|
||||||
/* FIXME: this should not be necessary */
|
/* FIXME: this should not be necessary */
|
||||||
FARPROC32 BUILTIN_GetProcAddress32( void *mod, LPCSTR func ) { return 0; }
|
|
||||||
HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ) { return 0; }
|
HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ) { return 0; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,18 +53,16 @@ HMODULE16
|
||||||
MODULE_HANDLEtoHMODULE16(HANDLE32 handle) {
|
MODULE_HANDLEtoHMODULE16(HANDLE32 handle) {
|
||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
|
|
||||||
if (HIWORD(handle)) {
|
if (HIWORD(handle))
|
||||||
/* this is a HMODULE32 aka pe->mappeddll */
|
{
|
||||||
|
/* this is a HMODULE32 */
|
||||||
|
|
||||||
/* walk the list looking for the correct startaddress */
|
/* walk the list looking for the correct startaddress */
|
||||||
pModule = (NE_MODULE *)GlobalLock16( hFirstModule );
|
pModule = (NE_MODULE *)GlobalLock16( hFirstModule );
|
||||||
while (pModule) {
|
while (pModule)
|
||||||
if ( ((pModule->flags&(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32))==NE_FFLAGS_WIN32) &&
|
{
|
||||||
pModule->pe_module &&
|
if (pModule->module32 == handle) return pModule->self;
|
||||||
((HMODULE32)pModule->pe_module->mappeddll == handle)
|
pModule = (NE_MODULE*)GlobalLock16(pModule->next);
|
||||||
)
|
|
||||||
return pModule->self;
|
|
||||||
pModule=(NE_MODULE*)GlobalLock16(pModule->next);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -89,10 +87,7 @@ MODULE_HANDLEtoHMODULE32(HANDLE32 handle) {
|
||||||
if (!pModule)
|
if (!pModule)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( ((pModule->flags&(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32))==NE_FFLAGS_WIN32) &&
|
if (pModule->module32) return pModule->module32;
|
||||||
pModule->pe_module
|
|
||||||
)
|
|
||||||
return (HMODULE32)pModule->pe_module->mappeddll;
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +122,7 @@ void MODULE_DumpModule( HMODULE32 hModule )
|
||||||
pModule->os_flags, pModule->min_swap_area,
|
pModule->os_flags, pModule->min_swap_area,
|
||||||
pModule->expected_version );
|
pModule->expected_version );
|
||||||
if (pModule->flags & NE_FFLAGS_WIN32)
|
if (pModule->flags & NE_FFLAGS_WIN32)
|
||||||
printf( "PE module=%08x\n", (unsigned int)pModule->pe_module );
|
printf( "PE module=%08x\n", pModule->module32 );
|
||||||
|
|
||||||
/* Dump the file info */
|
/* Dump the file info */
|
||||||
|
|
||||||
|
@ -557,7 +552,7 @@ static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
|
||||||
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
||||||
memcpy( pModule, &ne_header, sizeof(ne_header) );
|
memcpy( pModule, &ne_header, sizeof(ne_header) );
|
||||||
pModule->count = 0;
|
pModule->count = 0;
|
||||||
pModule->pe_module = NULL;
|
pModule->module32 = 0;
|
||||||
pModule->self = hModule;
|
pModule->self = hModule;
|
||||||
pModule->self_loading_sel = 0;
|
pModule->self_loading_sel = 0;
|
||||||
pData = (BYTE *)(pModule + 1);
|
pData = (BYTE *)(pModule + 1);
|
||||||
|
@ -1139,7 +1134,7 @@ BOOL16 MODULE_FreeModule( HMODULE32 hModule, TDB* pTaskContext )
|
||||||
*/
|
*/
|
||||||
HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
|
HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
|
||||||
{
|
{
|
||||||
HMODULE16 hModule;
|
HMODULE32 hModule;
|
||||||
HINSTANCE16 hInstance, hPrevInstance;
|
HINSTANCE16 hInstance, hPrevInstance;
|
||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
|
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
|
||||||
|
@ -1161,7 +1156,8 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
|
||||||
if (!hModule) /* We have to load the module */
|
if (!hModule) /* We have to load the module */
|
||||||
{
|
{
|
||||||
/* Try to load the built-in first if not disabled */
|
/* Try to load the built-in first if not disabled */
|
||||||
if ((hModule = BUILTIN_LoadModule( name, FALSE ))) return hModule;
|
if ((hModule = BUILTIN_LoadModule( name, FALSE )))
|
||||||
|
return MODULE_HANDLEtoHMODULE16( hModule );
|
||||||
|
|
||||||
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
|
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
|
||||||
{
|
{
|
||||||
|
@ -1169,7 +1165,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
|
||||||
if ((hModule = BUILTIN_LoadModule( name, TRUE )))
|
if ((hModule = BUILTIN_LoadModule( name, TRUE )))
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
|
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
|
||||||
return hModule;
|
return MODULE_HANDLEtoHMODULE16( hModule );
|
||||||
}
|
}
|
||||||
return 2; /* File not found */
|
return 2; /* File not found */
|
||||||
}
|
}
|
||||||
|
@ -1254,7 +1250,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
|
||||||
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
|
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
|
||||||
showcmd );
|
showcmd );
|
||||||
|
|
||||||
if( hTask && TASK_GetNextTask(hTask)) Yield();
|
if( hTask && TASK_GetNextTask(hTask)) Yield16();
|
||||||
}
|
}
|
||||||
|
|
||||||
return hInstance;
|
return hInstance;
|
||||||
|
@ -1507,6 +1503,17 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* PrivateLoadLibrary (KERNEL32)
|
||||||
|
*
|
||||||
|
* FIXME: rough guesswork, don't know what "Private" means
|
||||||
|
*/
|
||||||
|
HMODULE32 WINAPI PrivateLoadLibrary(LPCSTR libname)
|
||||||
|
{
|
||||||
|
return LoadLibrary16(libname);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FreeLibrary16 (KERNEL.96)
|
* FreeLibrary16 (KERNEL.96)
|
||||||
*/
|
*/
|
||||||
|
@ -1517,6 +1524,17 @@ void WINAPI FreeLibrary16( HINSTANCE16 handle )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* PrivateFreeLibrary (KERNEL32)
|
||||||
|
*
|
||||||
|
* FIXME: rough guesswork, don't know what "Private" means
|
||||||
|
*/
|
||||||
|
void WINAPI PrivateFreeLibrary(HMODULE32 handle)
|
||||||
|
{
|
||||||
|
FreeLibrary16(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* WinExec16 (KERNEL.166)
|
* WinExec16 (KERNEL.166)
|
||||||
*/
|
*/
|
||||||
|
@ -1773,15 +1791,14 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
|
||||||
dprintf_win32(stddeb,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
|
dprintf_win32(stddeb,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
|
||||||
if (!(pModule = MODULE_GetPtr( hModule )))
|
if (!(pModule = MODULE_GetPtr( hModule )))
|
||||||
return (FARPROC32)0;
|
return (FARPROC32)0;
|
||||||
if (pModule->flags & NE_FFLAGS_BUILTIN)
|
if (!pModule->module32)
|
||||||
return BUILTIN_GetProcAddress32( pModule, function );
|
{
|
||||||
if (!pModule->pe_module) {
|
fprintf(stderr,"Oops, Module 0x%08lx has got no module32?\n",
|
||||||
fprintf(stderr,"Oops, Module 0x%08lx has got no pe_module?\n",
|
|
||||||
(DWORD)MODULE_HANDLEtoHMODULE32(hModule)
|
(DWORD)MODULE_HANDLEtoHMODULE32(hModule)
|
||||||
);
|
);
|
||||||
return (FARPROC32)0;
|
return (FARPROC32)0;
|
||||||
}
|
}
|
||||||
return PE_FindExportedFunction( pModule->pe_module, function );
|
return PE_FindExportedFunction( pModule->module32, function );
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1798,11 +1815,9 @@ LPIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE32 hModule)
|
||||||
|
|
||||||
if (!(pModule = MODULE_GetPtr( hModule )))
|
if (!(pModule = MODULE_GetPtr( hModule )))
|
||||||
return (LPIMAGE_NT_HEADERS)0;
|
return (LPIMAGE_NT_HEADERS)0;
|
||||||
if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module)
|
if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->module32)
|
||||||
return (LPIMAGE_NT_HEADERS)0;
|
return (LPIMAGE_NT_HEADERS)0;
|
||||||
if (pModule->flags & NE_FFLAGS_BUILTIN)
|
return PE_HEADER(pModule->module32);
|
||||||
return (LPIMAGE_NT_HEADERS)0;
|
|
||||||
return pModule->pe_module->pe_header;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,13 +40,20 @@ static void PE_InitDLL(PE_MODREF* modref, DWORD type, LPVOID lpReserved);
|
||||||
/* convert PE image VirtualAddress to Real Address */
|
/* convert PE image VirtualAddress to Real Address */
|
||||||
#define RVA(x) ((unsigned int)load_addr+(unsigned int)(x))
|
#define RVA(x) ((unsigned int)load_addr+(unsigned int)(x))
|
||||||
|
|
||||||
void dump_exports(IMAGE_EXPORT_DIRECTORY * pe_exports, unsigned int load_addr)
|
void dump_exports( HMODULE32 hModule )
|
||||||
{
|
{
|
||||||
char *Module;
|
char *Module;
|
||||||
int i, j;
|
int i, j;
|
||||||
u_short *ordinal;
|
u_short *ordinal;
|
||||||
u_long *function,*functions;
|
u_long *function,*functions;
|
||||||
u_char **name;
|
u_char **name;
|
||||||
|
unsigned int load_addr = hModule;
|
||||||
|
|
||||||
|
DWORD rva_start = PE_HEADER(hModule)->OptionalHeader
|
||||||
|
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
|
||||||
|
DWORD rva_end = rva_start + PE_HEADER(hModule)->OptionalHeader
|
||||||
|
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
|
||||||
|
IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
|
||||||
|
|
||||||
Module = (char*)RVA(pe_exports->Name);
|
Module = (char*)RVA(pe_exports->Name);
|
||||||
dprintf_win32(stddeb,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n",
|
dprintf_win32(stddeb,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n",
|
||||||
|
@ -58,15 +65,18 @@ void dump_exports(IMAGE_EXPORT_DIRECTORY * pe_exports, unsigned int load_addr)
|
||||||
functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
|
functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
|
||||||
name=(u_char**) RVA(pe_exports->AddressOfNames);
|
name=(u_char**) RVA(pe_exports->AddressOfNames);
|
||||||
|
|
||||||
dprintf_win32(stddeb," Ord Virt Addr Name\n" );
|
dprintf_win32(stddeb," Ord RVA Addr Name\n" );
|
||||||
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
|
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
|
||||||
{
|
{
|
||||||
if (!*function) continue; /* No such function */
|
if (!*function) continue; /* No such function */
|
||||||
dprintf_win32( stddeb,"%4ld %08lx", i + pe_exports->Base, *function );
|
dprintf_win32( stddeb,"%4ld %08lx %08x",
|
||||||
|
i + pe_exports->Base, *function, RVA(*function) );
|
||||||
/* Check if we have a name for it */
|
/* Check if we have a name for it */
|
||||||
for (j = 0; j < pe_exports->NumberOfNames; j++)
|
for (j = 0; j < pe_exports->NumberOfNames; j++)
|
||||||
if (ordinal[j] == i)
|
if (ordinal[j] == i)
|
||||||
dprintf_win32( stddeb, " %s", (char*)RVA(name[j]) );
|
dprintf_win32( stddeb, " %s", (char*)RVA(name[j]) );
|
||||||
|
if ((*function >= rva_start) && (*function <= rva_end))
|
||||||
|
dprintf_win32(stddeb, " (forwarded -> %s)", (char *)RVA(*function));
|
||||||
dprintf_win32( stddeb,"\n" );
|
dprintf_win32( stddeb,"\n" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +89,7 @@ void dump_exports(IMAGE_EXPORT_DIRECTORY * pe_exports, unsigned int load_addr)
|
||||||
* If it is a ordinal:
|
* If it is a ordinal:
|
||||||
* - use ordinal-pe_export->Base as offset into the functionlist
|
* - use ordinal-pe_export->Base as offset into the functionlist
|
||||||
*/
|
*/
|
||||||
FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
|
FARPROC32 PE_FindExportedFunction( HMODULE32 hModule, LPCSTR funcName)
|
||||||
{
|
{
|
||||||
IMAGE_EXPORT_DIRECTORY *exports;
|
IMAGE_EXPORT_DIRECTORY *exports;
|
||||||
unsigned load_addr;
|
unsigned load_addr;
|
||||||
|
@ -89,34 +99,47 @@ FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
|
||||||
int i;
|
int i;
|
||||||
PDB32 *process=(PDB32*)GetCurrentProcessId();
|
PDB32 *process=(PDB32*)GetCurrentProcessId();
|
||||||
PE_MODREF *pem;
|
PE_MODREF *pem;
|
||||||
|
u_long rva_start, rva_end, addr;
|
||||||
|
char * forward;
|
||||||
|
|
||||||
pem = process->modref_list;
|
pem = process->modref_list;
|
||||||
while (pem && (pem->pe_module != pe))
|
while (pem && (pem->module != hModule))
|
||||||
pem=pem->next;
|
pem=pem->next;
|
||||||
if (!pem) {
|
if (!pem) {
|
||||||
fprintf(stderr,"No MODREF found for PE_MODULE %p in process %p\n",pe,process);
|
fprintf(stderr,"No MODREF found for PE_MODULE %08x in process %p\n",hModule,process);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
load_addr = pem->load_addr;
|
load_addr = hModule;
|
||||||
exports = pem->pe_export;
|
exports = pem->pe_export;
|
||||||
|
|
||||||
if (HIWORD(funcName))
|
if (HIWORD(funcName))
|
||||||
dprintf_win32(stddeb,"PE_FindExportedFunction(%s)\n",funcName);
|
dprintf_win32(stddeb,"PE_FindExportedFunction(%s)\n",funcName);
|
||||||
else
|
else
|
||||||
dprintf_win32(stddeb,"PE_FindExportedFunction(%d)\n",(int)funcName);
|
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);
|
fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ordinal = (u_short*) RVA(exports->AddressOfNameOrdinals);
|
ordinal = (u_short*) RVA(exports->AddressOfNameOrdinals);
|
||||||
function= (u_long*) RVA(exports->AddressOfFunctions);
|
function= (u_long*) RVA(exports->AddressOfFunctions);
|
||||||
name = (u_char **) RVA(exports->AddressOfNames);
|
name = (u_char **) RVA(exports->AddressOfNames);
|
||||||
|
forward = NULL;
|
||||||
|
rva_start = PE_HEADER(hModule)->OptionalHeader
|
||||||
|
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
|
||||||
|
rva_end = rva_start + PE_HEADER(hModule)->OptionalHeader
|
||||||
|
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
|
||||||
|
|
||||||
if (HIWORD(funcName)) {
|
if (HIWORD(funcName)) {
|
||||||
for(i=0; i<exports->NumberOfNames; i++) {
|
for(i=0; i<exports->NumberOfNames; i++) {
|
||||||
ename=(char*)RVA(*name);
|
ename=(char*)RVA(*name);
|
||||||
if(!strcmp(ename,funcName))
|
if(!strcmp(ename,funcName))
|
||||||
return (FARPROC32) RVA(function[*ordinal]);
|
{
|
||||||
|
addr = function[*ordinal];
|
||||||
|
if ((addr < rva_start) || (addr >= rva_end))
|
||||||
|
return (FARPROC32)RVA(addr);
|
||||||
|
forward = (char *)RVA(addr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
ordinal++;
|
ordinal++;
|
||||||
name++;
|
name++;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +149,19 @@ FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
|
||||||
LOWORD(funcName));
|
LOWORD(funcName));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (FARPROC32) RVA(function[(int)funcName-exports->Base]);
|
addr = function[(int)funcName-exports->Base];
|
||||||
|
if ((addr < rva_start) || (addr >= rva_end))
|
||||||
|
return (FARPROC32)RVA(addr);
|
||||||
|
forward = (char *)RVA(addr);
|
||||||
|
}
|
||||||
|
if (forward)
|
||||||
|
{
|
||||||
|
char module[256];
|
||||||
|
char *end = strchr(forward, '.');
|
||||||
|
if (!end) return NULL;
|
||||||
|
strncpy(module, forward, (end - forward));
|
||||||
|
module[end-forward] = 0;
|
||||||
|
return GetProcAddress32(MODULE_FindModule(module), end + 1);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -134,10 +169,9 @@ FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
|
||||||
void
|
void
|
||||||
fixup_imports (PDB32 *process,PE_MODREF *pem)
|
fixup_imports (PDB32 *process,PE_MODREF *pem)
|
||||||
{
|
{
|
||||||
PE_MODULE *pe = pem->pe_module;
|
|
||||||
IMAGE_IMPORT_DESCRIPTOR *pe_imp;
|
IMAGE_IMPORT_DESCRIPTOR *pe_imp;
|
||||||
int fixup_failed = 0;
|
int fixup_failed = 0;
|
||||||
unsigned int load_addr = pem->load_addr;
|
unsigned int load_addr = pem->module;
|
||||||
int i;
|
int i;
|
||||||
char *modname;
|
char *modname;
|
||||||
|
|
||||||
|
@ -176,7 +210,7 @@ fixup_imports (PDB32 *process,PE_MODREF *pem)
|
||||||
char *p, buffer[256];
|
char *p, buffer[256];
|
||||||
|
|
||||||
/* Try with prepending the path of the current module */
|
/* Try with prepending the path of the current module */
|
||||||
GetModuleFileName32A (pe->mappeddll, buffer, sizeof (buffer));
|
GetModuleFileName32A( pem->module, buffer, sizeof (buffer));
|
||||||
if (!(p = strrchr (buffer, '\\')))
|
if (!(p = strrchr (buffer, '\\')))
|
||||||
p = buffer;
|
p = buffer;
|
||||||
strcpy (p + 1, name);
|
strcpy (p + 1, name);
|
||||||
|
@ -189,7 +223,7 @@ fixup_imports (PDB32 *process,PE_MODREF *pem)
|
||||||
res = MODULE_HANDLEtoHMODULE32(res);
|
res = MODULE_HANDLEtoHMODULE32(res);
|
||||||
xpem = pem->next;
|
xpem = pem->next;
|
||||||
while (xpem) {
|
while (xpem) {
|
||||||
if (xpem->pe_module->mappeddll == res)
|
if (xpem->module == res)
|
||||||
break;
|
break;
|
||||||
xpem = xpem->next;
|
xpem = xpem->next;
|
||||||
}
|
}
|
||||||
|
@ -297,37 +331,36 @@ fixup_imports (PDB32 *process,PE_MODREF *pem)
|
||||||
if (fixup_failed) exit(1);
|
if (fixup_failed) exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int calc_vma_size(struct pe_data *pe)
|
static int calc_vma_size( HMODULE32 hModule )
|
||||||
{
|
{
|
||||||
int i,vma_size = 0;
|
int i,vma_size = 0;
|
||||||
|
IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule);
|
||||||
|
|
||||||
dprintf_win32(stddeb, "Dump of segment table\n");
|
dprintf_win32(stddeb, "Dump of segment table\n");
|
||||||
dprintf_win32(stddeb, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
|
dprintf_win32(stddeb, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
|
||||||
for(i=0; i< pe->pe_header->FileHeader.NumberOfSections; i++)
|
for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
|
||||||
{
|
{
|
||||||
dprintf_win32(stddeb, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n",
|
dprintf_win32(stddeb, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n",
|
||||||
pe->pe_seg[i].Name,
|
pe_seg->Name,
|
||||||
pe->pe_seg[i].Misc.VirtualSize,
|
pe_seg->Misc.VirtualSize,
|
||||||
pe->pe_seg[i].VirtualAddress,
|
pe_seg->VirtualAddress,
|
||||||
pe->pe_seg[i].SizeOfRawData,
|
pe_seg->SizeOfRawData,
|
||||||
pe->pe_seg[i].PointerToRawData,
|
pe_seg->PointerToRawData,
|
||||||
pe->pe_seg[i].PointerToRelocations,
|
pe_seg->PointerToRelocations,
|
||||||
pe->pe_seg[i].PointerToLinenumbers,
|
pe_seg->PointerToLinenumbers,
|
||||||
pe->pe_seg[i].NumberOfRelocations,
|
pe_seg->NumberOfRelocations,
|
||||||
pe->pe_seg[i].NumberOfLinenumbers,
|
pe_seg->NumberOfLinenumbers,
|
||||||
pe->pe_seg[i].Characteristics);
|
pe_seg->Characteristics);
|
||||||
vma_size = MAX(vma_size,
|
vma_size = MAX(vma_size, pe_seg->VirtualAddress+pe_seg->SizeOfRawData);
|
||||||
pe->pe_seg[i].VirtualAddress +
|
pe_seg++;
|
||||||
pe->pe_seg[i].SizeOfRawData);
|
|
||||||
}
|
}
|
||||||
return vma_size;
|
return vma_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_relocations(PE_MODREF *pem)
|
static void do_relocations(PE_MODREF *pem)
|
||||||
{
|
{
|
||||||
int delta = pem->load_addr - pem->pe_module->pe_header->OptionalHeader.ImageBase;
|
int delta = pem->module - PE_HEADER(pem->module)->OptionalHeader.ImageBase;
|
||||||
|
unsigned int load_addr= pem->module;
|
||||||
unsigned int load_addr= pem->load_addr;
|
|
||||||
IMAGE_BASE_RELOCATION *r = pem->pe_reloc;
|
IMAGE_BASE_RELOCATION *r = pem->pe_reloc;
|
||||||
int hdelta = (delta >> 16) & 0xFFFF;
|
int hdelta = (delta >> 16) & 0xFFFF;
|
||||||
int ldelta = delta & 0xFFFF;
|
int ldelta = delta & 0xFFFF;
|
||||||
|
@ -398,9 +431,8 @@ static void do_relocations(PE_MODREF *pem)
|
||||||
* BUT we have to map the whole image anyway, for Win32 programs sometimes
|
* BUT we have to map the whole image anyway, for Win32 programs sometimes
|
||||||
* want to access them. (HMODULE32 point to the start of it)
|
* want to access them. (HMODULE32 point to the start of it)
|
||||||
*/
|
*/
|
||||||
static PE_MODULE *PE_LoadImage( HFILE32 hFile )
|
static HMODULE32 PE_LoadImage( HFILE32 hFile )
|
||||||
{
|
{
|
||||||
struct pe_data *pe;
|
|
||||||
HMODULE32 hModule;
|
HMODULE32 hModule;
|
||||||
HANDLE32 mapping;
|
HANDLE32 mapping;
|
||||||
|
|
||||||
|
@ -411,7 +443,7 @@ static PE_MODULE *PE_LoadImage( HFILE32 hFile )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "PE_LoadImage: CreateFileMapping error %ld\n",
|
fprintf( stderr, "PE_LoadImage: CreateFileMapping error %ld\n",
|
||||||
GetLastError() );
|
GetLastError() );
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
hModule = (HMODULE32)MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 );
|
hModule = (HMODULE32)MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 );
|
||||||
CloseHandle( mapping );
|
CloseHandle( mapping );
|
||||||
|
@ -419,126 +451,128 @@ static PE_MODULE *PE_LoadImage( HFILE32 hFile )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "PE_LoadImage: MapViewOfFile error %ld\n",
|
fprintf( stderr, "PE_LoadImage: MapViewOfFile error %ld\n",
|
||||||
GetLastError() );
|
GetLastError() );
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* build PE header */
|
if (PE_HEADER(hModule)->Signature != IMAGE_NT_SIGNATURE)
|
||||||
pe = xmalloc(sizeof(struct pe_data));
|
|
||||||
pe->mappeddll = hModule;
|
|
||||||
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",
|
fprintf(stderr,"image doesn't have PE signature, but 0x%08lx\n",
|
||||||
pe->pe_header->Signature );
|
PE_HEADER(hModule)->Signature );
|
||||||
free(pe);
|
goto error;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pe->pe_header->FileHeader.Machine != IMAGE_FILE_MACHINE_I386) {
|
if (PE_HEADER(hModule)->FileHeader.Machine != IMAGE_FILE_MACHINE_I386)
|
||||||
fprintf(stderr,"trying to load PE image for unsupported architecture (");
|
{
|
||||||
switch (pe->pe_header->FileHeader.Machine) {
|
fprintf(stderr,"trying to load PE image for unsupported architecture (");
|
||||||
case IMAGE_FILE_MACHINE_UNKNOWN:
|
switch (PE_HEADER(hModule)->FileHeader.Machine)
|
||||||
fprintf(stderr,"Unknown");break;
|
{
|
||||||
case IMAGE_FILE_MACHINE_I860:
|
case IMAGE_FILE_MACHINE_UNKNOWN: fprintf(stderr,"Unknown"); break;
|
||||||
fprintf(stderr,"I860");break;
|
case IMAGE_FILE_MACHINE_I860: fprintf(stderr,"I860"); break;
|
||||||
case IMAGE_FILE_MACHINE_R3000:
|
case IMAGE_FILE_MACHINE_R3000: fprintf(stderr,"R3000"); break;
|
||||||
fprintf(stderr,"R3000");break;
|
case IMAGE_FILE_MACHINE_R4000: fprintf(stderr,"R4000"); break;
|
||||||
case IMAGE_FILE_MACHINE_R4000:
|
case IMAGE_FILE_MACHINE_R10000: fprintf(stderr,"R10000"); break;
|
||||||
fprintf(stderr,"R4000");break;
|
case IMAGE_FILE_MACHINE_ALPHA: fprintf(stderr,"Alpha"); break;
|
||||||
case IMAGE_FILE_MACHINE_R10000:
|
case IMAGE_FILE_MACHINE_POWERPC: fprintf(stderr,"PowerPC"); break;
|
||||||
fprintf(stderr,"R10000");break;
|
default: fprintf(stderr,"Unknown-%04x",
|
||||||
case IMAGE_FILE_MACHINE_ALPHA:
|
PE_HEADER(hModule)->FileHeader.Machine); break;
|
||||||
fprintf(stderr,"Alpha");break;
|
}
|
||||||
case IMAGE_FILE_MACHINE_POWERPC:
|
fprintf(stderr,")\n");
|
||||||
fprintf(stderr,"PowerPC");break;
|
goto error;
|
||||||
default:
|
}
|
||||||
fprintf(stderr,"Unknown-%04x",pe->pe_header->FileHeader.Machine);break;
|
return hModule;
|
||||||
}
|
|
||||||
fprintf(stderr,")\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
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
|
error:
|
||||||
* problem needs to be fixed properly at some stage.
|
UnmapViewOfFile( (LPVOID)hModule );
|
||||||
*/
|
return 0;
|
||||||
return pe;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* This maps a loaded PE dll into the address space of the specified process.
|
* This maps a loaded PE dll into the address space of the specified process.
|
||||||
*/
|
*/
|
||||||
void
|
static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
|
||||||
PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
|
OFSTRUCT *ofs, DWORD flags )
|
||||||
|
{
|
||||||
PE_MODREF *pem;
|
PE_MODREF *pem;
|
||||||
int i, result;
|
int i, result;
|
||||||
int load_addr;
|
DWORD load_addr;
|
||||||
IMAGE_DATA_DIRECTORY dir;
|
IMAGE_DATA_DIRECTORY dir;
|
||||||
char *modname;
|
char *modname;
|
||||||
int vma_size;
|
int vma_size;
|
||||||
|
|
||||||
|
IMAGE_SECTION_HEADER *pe_seg;
|
||||||
|
IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hModule;
|
||||||
|
IMAGE_NT_HEADERS *nt_header = PE_HEADER(hModule);
|
||||||
|
|
||||||
pem = (PE_MODREF*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(*pem));
|
pem = (PE_MODREF*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(*pem));
|
||||||
/* NOTE: fixup_imports takes care of the correct order */
|
/* NOTE: fixup_imports takes care of the correct order */
|
||||||
pem->next = process->modref_list;
|
pem->next = process->modref_list;
|
||||||
process->modref_list = pem;
|
process->modref_list = pem;
|
||||||
|
|
||||||
pem->pe_module = pe;
|
if (!(nt_header->FileHeader.Characteristics & IMAGE_FILE_DLL))
|
||||||
if (!(pe->pe_header->FileHeader.Characteristics & IMAGE_FILE_DLL)) {
|
{
|
||||||
if (process->exe_modref)
|
if (process->exe_modref)
|
||||||
fprintf(stderr,"overwriting old exe_modref... arrgh\n");
|
fprintf(stderr,"overwriting old exe_modref... arrgh\n");
|
||||||
process->exe_modref = pem;
|
process->exe_modref = pem;
|
||||||
}
|
}
|
||||||
|
|
||||||
load_addr = pe->pe_header->OptionalHeader.ImageBase;
|
load_addr = nt_header->OptionalHeader.ImageBase;
|
||||||
dprintf_win32(stddeb, "Load addr is %x\n",load_addr);
|
vma_size = calc_vma_size( hModule );
|
||||||
vma_size = calc_vma_size(pe);
|
dprintf_win32(stddeb, "Load addr is %lx\n",load_addr);
|
||||||
load_addr = (int) VirtualAlloc( (void*)load_addr, vma_size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE );
|
load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size,
|
||||||
pem->load_addr = load_addr;
|
MEM_RESERVE | MEM_COMMIT,
|
||||||
|
PAGE_EXECUTE_READWRITE );
|
||||||
|
pem->module = (HMODULE32)load_addr;
|
||||||
|
|
||||||
dprintf_win32(stddeb, "Load addr is really %lx, range %x\n",
|
dprintf_win32(stddeb, "Load addr is really %lx, range %x\n",
|
||||||
pem->load_addr, vma_size);
|
load_addr, vma_size);
|
||||||
|
|
||||||
|
/* Store the NT header at the load addr
|
||||||
|
* (FIXME: should really use mmap)
|
||||||
|
*/
|
||||||
|
*(IMAGE_DOS_HEADER *)load_addr = *dos_header;
|
||||||
|
*(IMAGE_NT_HEADERS *)(load_addr + dos_header->e_lfanew) = *nt_header;
|
||||||
|
|
||||||
for(i=0; i < pe->pe_header->FileHeader.NumberOfSections; i++)
|
pe_seg = PE_SECTIONS(hModule);
|
||||||
|
for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++, pe_seg++)
|
||||||
{
|
{
|
||||||
/* memcpy only non-BSS segments */
|
/* memcpy only non-BSS segments */
|
||||||
/* FIXME: this should be done by mmap(..MAP_PRIVATE|MAP_FIXED..)
|
/* FIXME: this should be done by mmap(..MAP_PRIVATE|MAP_FIXED..)
|
||||||
* but it is not possible for (at least) Linux needs
|
* but it is not possible for (at least) Linux needs
|
||||||
* a page-aligned offset.
|
* a page-aligned offset.
|
||||||
*/
|
*/
|
||||||
if(!(pe->pe_seg[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
|
if(!(pe_seg->Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA))
|
||||||
memcpy((char*)RVA(pe->pe_seg[i].VirtualAddress),
|
memcpy((char*)RVA(pe_seg->VirtualAddress),
|
||||||
(char*)(pe->mappeddll+pe->pe_seg[i].PointerToRawData),
|
(char*)(hModule + pe_seg->PointerToRawData),
|
||||||
pe->pe_seg[i].SizeOfRawData
|
pe_seg->SizeOfRawData
|
||||||
);
|
);
|
||||||
|
|
||||||
result = RVA (pe->pe_seg[i].VirtualAddress);
|
result = RVA (pe_seg->VirtualAddress);
|
||||||
#if 1
|
#if 1
|
||||||
/* not needed, memory is zero */
|
/* not needed, memory is zero */
|
||||||
if(strcmp(pe->pe_seg[i].Name, ".bss") == 0)
|
if(strcmp(pe_seg->Name, ".bss") == 0)
|
||||||
memset((void *)result, 0,
|
memset((void *)result, 0,
|
||||||
pe->pe_seg[i].Misc.VirtualSize ?
|
pe_seg->Misc.VirtualSize ?
|
||||||
pe->pe_seg[i].Misc.VirtualSize :
|
pe_seg->Misc.VirtualSize :
|
||||||
pe->pe_seg[i].SizeOfRawData);
|
pe_seg->SizeOfRawData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(strcmp(pe->pe_seg[i].Name, ".idata") == 0)
|
if(strcmp(pe_seg->Name, ".idata") == 0)
|
||||||
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) result;
|
pem->pe_import = (LPIMAGE_IMPORT_DESCRIPTOR) result;
|
||||||
|
|
||||||
if(strcmp(pe->pe_seg[i].Name, ".edata") == 0)
|
if(strcmp(pe_seg->Name, ".edata") == 0)
|
||||||
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) result;
|
pem->pe_export = (LPIMAGE_EXPORT_DIRECTORY) result;
|
||||||
|
|
||||||
if(strcmp(pe->pe_seg[i].Name, ".rsrc") == 0)
|
if(strcmp(pe_seg->Name, ".rsrc") == 0)
|
||||||
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) result;
|
pem->pe_resource = (LPIMAGE_RESOURCE_DIRECTORY) result;
|
||||||
|
|
||||||
if(strcmp(pe->pe_seg[i].Name, ".reloc") == 0)
|
if(strcmp(pe_seg->Name, ".reloc") == 0)
|
||||||
pem->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
|
/* There is word that the actual loader does not care about the
|
||||||
section names, and only goes for the DataDirectory */
|
section names, and only goes for the DataDirectory */
|
||||||
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
|
dir=nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
|
||||||
if(dir.Size)
|
if(dir.Size)
|
||||||
{
|
{
|
||||||
if(pem->pe_export && (int)pem->pe_export!=RVA(dir.VirtualAddress))
|
if(pem->pe_export && (int)pem->pe_export!=RVA(dir.VirtualAddress))
|
||||||
|
@ -547,7 +581,7 @@ PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
|
||||||
pem->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];
|
dir=nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
|
||||||
if(dir.Size)
|
if(dir.Size)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -557,7 +591,7 @@ PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
|
||||||
pem->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];
|
dir=nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];
|
||||||
if(dir.Size)
|
if(dir.Size)
|
||||||
{
|
{
|
||||||
if(pem->pe_resource && (int)pem->pe_resource!=RVA(dir.VirtualAddress))
|
if(pem->pe_resource && (int)pem->pe_resource!=RVA(dir.VirtualAddress))
|
||||||
|
@ -565,15 +599,15 @@ PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
|
||||||
pem->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)
|
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
|
||||||
dprintf_win32(stdnimp,"Exception directory ignored\n");
|
dprintf_win32(stdnimp,"Exception directory ignored\n");
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size)
|
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size)
|
||||||
dprintf_win32(stdnimp,"Security directory ignored\n");
|
dprintf_win32(stdnimp,"Security directory ignored\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dir=pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
|
dir=nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
|
||||||
if(dir.Size)
|
if(dir.Size)
|
||||||
{
|
{
|
||||||
if(pem->pe_reloc && (int)pem->pe_reloc!= RVA(dir.VirtualAddress))
|
if(pem->pe_reloc && (int)pem->pe_reloc!= RVA(dir.VirtualAddress))
|
||||||
|
@ -581,38 +615,38 @@ PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
|
||||||
pem->pe_reloc = (void *) RVA(dir.VirtualAddress);
|
pem->pe_reloc = (void *) RVA(dir.VirtualAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory
|
if(nt_header->OptionalHeader.DataDirectory
|
||||||
[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
|
[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
|
||||||
dprintf_win32(stdnimp,"Copyright string ignored\n");
|
dprintf_win32(stdnimp,"Copyright string ignored\n");
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory
|
if(nt_header->OptionalHeader.DataDirectory
|
||||||
[IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size)
|
[IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size)
|
||||||
dprintf_win32(stdnimp,"Global Pointer (MIPS) ignored\n");
|
dprintf_win32(stdnimp,"Global Pointer (MIPS) ignored\n");
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory
|
if(nt_header->OptionalHeader.DataDirectory
|
||||||
[IMAGE_DIRECTORY_ENTRY_TLS].Size)
|
[IMAGE_DIRECTORY_ENTRY_TLS].Size)
|
||||||
fprintf(stdnimp,"Thread local storage ignored\n");
|
fprintf(stdnimp,"Thread local storage ignored\n");
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory
|
if(nt_header->OptionalHeader.DataDirectory
|
||||||
[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size)
|
[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size)
|
||||||
dprintf_win32(stdnimp,"Load Configuration directory ignored\n");
|
dprintf_win32(stdnimp,"Load Configuration directory ignored\n");
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory
|
if(nt_header->OptionalHeader.DataDirectory
|
||||||
[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size)
|
[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size)
|
||||||
dprintf_win32(stdnimp,"Bound Import directory ignored\n");
|
dprintf_win32(stdnimp,"Bound Import directory ignored\n");
|
||||||
|
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory
|
if(nt_header->OptionalHeader.DataDirectory
|
||||||
[IMAGE_DIRECTORY_ENTRY_IAT].Size)
|
[IMAGE_DIRECTORY_ENTRY_IAT].Size)
|
||||||
dprintf_win32(stdnimp,"Import Address Table directory ignored\n");
|
dprintf_win32(stdnimp,"Import Address Table directory ignored\n");
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory[13].Size)
|
if(nt_header->OptionalHeader.DataDirectory[13].Size)
|
||||||
dprintf_win32(stdnimp,"Unknown directory 13 ignored\n");
|
dprintf_win32(stdnimp,"Unknown directory 13 ignored\n");
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory[14].Size)
|
if(nt_header->OptionalHeader.DataDirectory[14].Size)
|
||||||
dprintf_win32(stdnimp,"Unknown directory 14 ignored\n");
|
dprintf_win32(stdnimp,"Unknown directory 14 ignored\n");
|
||||||
if(pe->pe_header->OptionalHeader.DataDirectory[15].Size)
|
if(nt_header->OptionalHeader.DataDirectory[15].Size)
|
||||||
dprintf_win32(stdnimp,"Unknown directory 15 ignored\n");
|
dprintf_win32(stdnimp,"Unknown directory 15 ignored\n");
|
||||||
|
|
||||||
if(pem->pe_reloc) do_relocations(pem);
|
if(pem->pe_reloc) do_relocations(pem);
|
||||||
if(pem->pe_export) dump_exports(pem->pe_export,load_addr);
|
if(pem->pe_export) dump_exports(pem->module);
|
||||||
if(pem->pe_import) fixup_imports(process,pem);
|
if(pem->pe_import) fixup_imports(process,pem);
|
||||||
|
|
||||||
if (pem->pe_export)
|
if (pem->pe_export)
|
||||||
|
@ -625,6 +659,11 @@ PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
|
||||||
if ((s=strchr(modname,'.')))
|
if ((s=strchr(modname,'.')))
|
||||||
*s='\0';
|
*s='\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Now that we got everything at the right address,
|
||||||
|
* we can unmap the previous module */
|
||||||
|
UnmapViewOfFile( (LPVOID)hModule );
|
||||||
|
return (HMODULE32)load_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params);
|
HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params);
|
||||||
|
@ -647,8 +686,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
|
||||||
/* check if this module is already mapped */
|
/* check if this module is already mapped */
|
||||||
pem = ((PDB32*)GetCurrentProcessId())->modref_list;
|
pem = ((PDB32*)GetCurrentProcessId())->modref_list;
|
||||||
while (pem) {
|
while (pem) {
|
||||||
if (pem->pe_module->mappeddll == hModule)
|
if (pem->module == hModule) return hModule;
|
||||||
return hModule;
|
|
||||||
pem = pem->next;
|
pem = pem->next;
|
||||||
}
|
}
|
||||||
pModule = MODULE_GetPtr(hModule);
|
pModule = MODULE_GetPtr(hModule);
|
||||||
|
@ -656,14 +694,14 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
|
||||||
|
|
||||||
/* try to load builtin, enabled modules first */
|
/* try to load builtin, enabled modules first */
|
||||||
if ((hModule = BUILTIN_LoadModule( name, FALSE )))
|
if ((hModule = BUILTIN_LoadModule( name, FALSE )))
|
||||||
return hModule;
|
return MODULE_HANDLEtoHMODULE32( hModule );
|
||||||
|
|
||||||
/* try to open the specified file */
|
/* try to open the specified file */
|
||||||
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
|
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
|
||||||
/* Now try the built-in even if disabled */
|
/* Now try the built-in even if disabled */
|
||||||
if ((hModule = BUILTIN_LoadModule( name, TRUE ))) {
|
if ((hModule = BUILTIN_LoadModule( name, TRUE ))) {
|
||||||
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
|
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
|
||||||
return hModule;
|
return MODULE_HANDLEtoHMODULE32( hModule );
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -673,14 +711,15 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
|
||||||
}
|
}
|
||||||
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
||||||
pModule->flags = NE_FFLAGS_WIN32;
|
pModule->flags = NE_FFLAGS_WIN32;
|
||||||
pModule->pe_module = PE_LoadImage( hFile );
|
pModule->module32 = PE_LoadImage( hFile );
|
||||||
CloseHandle( hFile );
|
CloseHandle( hFile );
|
||||||
if (!pModule->pe_module)
|
if (pModule->module32 < 32) return 21;
|
||||||
return 21;
|
|
||||||
}
|
}
|
||||||
/* recurse */
|
/* recurse */
|
||||||
PE_MapImage(pModule->pe_module,(PDB32*)GetCurrentProcessId(),&ofs,flags);
|
pModule->module32 = PE_MapImage( pModule->module32,
|
||||||
return pModule->pe_module->mappeddll;
|
(PDB32*)GetCurrentProcessId(),
|
||||||
|
&ofs,flags);
|
||||||
|
return pModule->module32;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
@ -690,28 +729,29 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
|
||||||
*/
|
*/
|
||||||
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
|
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
|
||||||
{
|
{
|
||||||
HMODULE16 hModule;
|
HMODULE16 hModule16;
|
||||||
|
HMODULE32 hModule32;
|
||||||
HINSTANCE16 hInstance;
|
HINSTANCE16 hInstance;
|
||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
|
|
||||||
if ((hModule = MODULE_CreateDummyModule( ofs )) < 32) return hModule;
|
if ((hModule16 = MODULE_CreateDummyModule( ofs )) < 32) return hModule16;
|
||||||
pModule = (NE_MODULE *)GlobalLock16( hModule );
|
pModule = (NE_MODULE *)GlobalLock16( hModule16 );
|
||||||
pModule->flags = NE_FFLAGS_WIN32;
|
pModule->flags = NE_FFLAGS_WIN32;
|
||||||
|
|
||||||
pModule->pe_module = PE_LoadImage( hFile );
|
pModule->module32 = hModule32 = PE_LoadImage( hFile );
|
||||||
CloseHandle( hFile );
|
CloseHandle( hFile );
|
||||||
if (!pModule->pe_module)
|
if (hModule32 < 32) return 21;
|
||||||
return 21;
|
|
||||||
|
|
||||||
hInstance = MODULE_CreateInstance( hModule, params );
|
hInstance = MODULE_CreateInstance( hModule16, params );
|
||||||
if (!(pModule->pe_module->pe_header->FileHeader.Characteristics & IMAGE_FILE_DLL))
|
if (!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
|
||||||
{
|
{
|
||||||
TASK_CreateTask( hModule, hInstance, 0,
|
TASK_CreateTask( hModule16, hInstance, 0,
|
||||||
params->hEnvironment,
|
params->hEnvironment,
|
||||||
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
|
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
|
||||||
*((WORD*)PTR_SEG_TO_LIN(params->showCmd) + 1) );
|
*((WORD*)PTR_SEG_TO_LIN(params->showCmd) + 1) );
|
||||||
}
|
}
|
||||||
PE_MapImage(pModule->pe_module,(PDB32*)GetCurrentProcessId(),ofs,0);
|
pModule->module32 = PE_MapImage( hModule32, (PDB32*)GetCurrentProcessId(),
|
||||||
|
ofs, 0 );
|
||||||
return hInstance;
|
return hInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,9 +769,6 @@ int PE_UnloadImage( HMODULE32 hModule )
|
||||||
*/
|
*/
|
||||||
static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
|
static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
PE_MODULE *pe = pem->pe_module;
|
|
||||||
unsigned int load_addr = pem->load_addr;
|
|
||||||
|
|
||||||
if (type==DLL_PROCESS_ATTACH)
|
if (type==DLL_PROCESS_ATTACH)
|
||||||
pem->flags |= PE_MODREF_PROCESS_ATTACHED;
|
pem->flags |= PE_MODREF_PROCESS_ATTACHED;
|
||||||
|
|
||||||
|
@ -743,13 +780,14 @@ static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Is this a library? And has it got an entrypoint? */
|
/* Is this a library? And has it got an entrypoint? */
|
||||||
if ( (pe->pe_header->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
|
if ((PE_HEADER(pem->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
|
||||||
(pe->pe_header->OptionalHeader.AddressOfEntryPoint)
|
(PE_HEADER(pem->module)->OptionalHeader.AddressOfEntryPoint)
|
||||||
) {
|
) {
|
||||||
FARPROC32 entry = (FARPROC32)RVA(pe->pe_header->OptionalHeader.AddressOfEntryPoint);
|
FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module,
|
||||||
|
OptionalHeader.AddressOfEntryPoint );
|
||||||
dprintf_relay( stddeb, "CallTo32(entryproc=%p,module=%d,type=%ld,res=%p)\n",
|
dprintf_relay( stddeb, "CallTo32(entryproc=%p,module=%d,type=%ld,res=%p)\n",
|
||||||
entry, pe->mappeddll, type, lpReserved );
|
entry, pem->module, type, lpReserved );
|
||||||
entry( pe->mappeddll, type, lpReserved );
|
entry( pem->module, type, lpReserved );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,12 +826,12 @@ void PE_InitTls(PDB32 *pdb)
|
||||||
|
|
||||||
pem = pdb->modref_list;
|
pem = pdb->modref_list;
|
||||||
while (pem) {
|
while (pem) {
|
||||||
peh = pem->pe_module->pe_header;
|
peh = PE_HEADER(pem->module);
|
||||||
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress) {
|
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress) {
|
||||||
pem = pem->next;
|
pem = pem->next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pdir = (LPVOID)(pem->load_addr + peh->OptionalHeader.
|
pdir = (LPVOID)(pem->module + peh->OptionalHeader.
|
||||||
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);
|
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);
|
||||||
index = TlsAlloc();
|
index = TlsAlloc();
|
||||||
datasize= pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
|
datasize= pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
|
||||||
|
@ -816,7 +854,7 @@ BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32 hModule)
|
||||||
PE_MODREF *pem = process->modref_list;
|
PE_MODREF *pem = process->modref_list;
|
||||||
|
|
||||||
while (pem) {
|
while (pem) {
|
||||||
if (pem->pe_module->mappeddll == hModule)
|
if (pem->module == hModule)
|
||||||
pem->flags|=PE_MODREF_NO_DLL_CALLS;
|
pem->flags|=PE_MODREF_NO_DLL_CALLS;
|
||||||
pem = pem->next;
|
pem = pem->next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ HMODULE32toPE_MODREF(HMODULE32 hmod) {
|
||||||
if (!hmod) return NULL;
|
if (!hmod) return NULL;
|
||||||
if (!(pModule = MODULE_GetPtr( hmod ))) return 0;
|
if (!(pModule = MODULE_GetPtr( hmod ))) return 0;
|
||||||
pem = pdb->modref_list;
|
pem = pdb->modref_list;
|
||||||
while (pem && pem->pe_module->mappeddll != hmod)
|
while (pem && pem->module != hmod)
|
||||||
pem=pem->next;
|
pem=pem->next;
|
||||||
return pem;
|
return pem;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ HANDLE32 PE_LoadResource32( HINSTANCE32 hModule, HANDLE32 hRsrc )
|
||||||
return 0;
|
return 0;
|
||||||
if (!hRsrc)
|
if (!hRsrc)
|
||||||
return 0;
|
return 0;
|
||||||
return (HANDLE32) (pem->load_addr+((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
|
return (HANDLE32) (pem->module + ((LPIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,19 +45,27 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
|
||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
|
|
||||||
hModule = MODULE_HANDLEtoHMODULE16( hModule );
|
hModule = MODULE_HANDLEtoHMODULE16( hModule );
|
||||||
dprintf_resource(stddeb, "FindResource16: module=%04x type=", hModule );
|
dprintf_resource(stddeb, "FindResource16: module=%04x", hModule );
|
||||||
PrintId( type );
|
|
||||||
|
|
||||||
if (HIWORD(name)) /* Check for '#xxx' name */
|
if (HIWORD(name)) /* Check for '#xxx' name */
|
||||||
{
|
{
|
||||||
char *ptr = PTR_SEG_TO_LIN( name );
|
char *ptr = PTR_SEG_TO_LIN( name );
|
||||||
if (ptr[0] == '#') {
|
if (ptr[0] == '#')
|
||||||
if (!(name = (SEGPTR)atoi( ptr + 1 ))) return 0;
|
if (!(name = (SEGPTR)atoi( ptr + 1 ))) return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintf_resource( stddeb, " name=" );
|
dprintf_resource( stddeb, " name=" );
|
||||||
PrintId( name );
|
PrintId( name );
|
||||||
|
|
||||||
|
if (HIWORD(type)) /* Check for '#xxx' type */
|
||||||
|
{
|
||||||
|
char *ptr = PTR_SEG_TO_LIN( type );
|
||||||
|
if (ptr[0] == '#')
|
||||||
|
if (!(type = (SEGPTR)atoi( ptr + 1 ))) return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dprintf_resource( stddeb, " type=" );
|
||||||
|
PrintId( type );
|
||||||
dprintf_resource( stddeb, "\n" );
|
dprintf_resource( stddeb, "\n" );
|
||||||
|
|
||||||
if ((pModule = MODULE_GetPtr( hModule )))
|
if ((pModule = MODULE_GetPtr( hModule )))
|
||||||
|
@ -547,7 +555,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
|
||||||
* LoadString32W (USER32.375)
|
* LoadString32W (USER32.375)
|
||||||
*/
|
*/
|
||||||
INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
|
INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
|
||||||
LPWSTR buffer, int buflen )
|
LPWSTR buffer, INT32 buflen )
|
||||||
{
|
{
|
||||||
HGLOBAL32 hmem;
|
HGLOBAL32 hmem;
|
||||||
HRSRC32 hrsrc;
|
HRSRC32 hrsrc;
|
||||||
|
@ -599,16 +607,20 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
|
||||||
* LoadString32A (USER32.374)
|
* LoadString32A (USER32.374)
|
||||||
*/
|
*/
|
||||||
INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
|
INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
|
||||||
LPSTR buffer,int buflen )
|
LPSTR buffer, INT32 buflen )
|
||||||
{
|
{
|
||||||
INT32 retval;
|
INT32 retval;
|
||||||
LPWSTR buffer2 = NULL;
|
LPWSTR buffer2 = NULL;
|
||||||
if (buffer) buffer2 = HeapAlloc( GetProcessHeap(), 0, buflen * 2 );
|
if (buffer && buflen)
|
||||||
|
buffer2 = HeapAlloc( GetProcessHeap(), 0, buflen * 2 );
|
||||||
retval = LoadString32W(instance,resource_id,buffer2,buflen);
|
retval = LoadString32W(instance,resource_id,buffer2,buflen);
|
||||||
|
|
||||||
if (buffer2)
|
if (buffer2)
|
||||||
{
|
{
|
||||||
lstrcpynWtoA( buffer, buffer2, buflen );
|
if (retval) {
|
||||||
|
lstrcpynWtoA( buffer, buffer2, buflen );
|
||||||
|
retval = lstrlen32A( buffer );
|
||||||
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, buffer2 );
|
HeapFree( GetProcessHeap(), 0, buffer2 );
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -640,7 +652,7 @@ INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
|
||||||
* LoadMessage32A (internal)
|
* LoadMessage32A (internal)
|
||||||
*/
|
*/
|
||||||
INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
|
INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
|
||||||
LPSTR buffer, int buflen )
|
LPSTR buffer, INT32 buflen )
|
||||||
{
|
{
|
||||||
HGLOBAL32 hmem;
|
HGLOBAL32 hmem;
|
||||||
HRSRC32 hrsrc;
|
HRSRC32 hrsrc;
|
||||||
|
@ -708,15 +720,19 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
|
||||||
* LoadMessage32W (internal)
|
* LoadMessage32W (internal)
|
||||||
*/
|
*/
|
||||||
INT32 LoadMessage32W( HINSTANCE32 instance, UINT32 id, WORD lang,
|
INT32 LoadMessage32W( HINSTANCE32 instance, UINT32 id, WORD lang,
|
||||||
LPWSTR buffer, int buflen )
|
LPWSTR buffer, INT32 buflen )
|
||||||
{
|
{
|
||||||
INT32 retval;
|
INT32 retval;
|
||||||
LPSTR buffer2 = NULL;
|
LPSTR buffer2 = NULL;
|
||||||
if (buffer) buffer2 = HeapAlloc( GetProcessHeap(), 0, buflen );
|
if (buffer && buflen)
|
||||||
|
buffer2 = HeapAlloc( GetProcessHeap(), 0, buflen );
|
||||||
retval = LoadMessage32A(instance,id,lang,buffer2,buflen);
|
retval = LoadMessage32A(instance,id,lang,buffer2,buflen);
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
lstrcpynAtoW( buffer, buffer2, buflen );
|
if (retval) {
|
||||||
|
lstrcpynAtoW( buffer, buffer2, buflen );
|
||||||
|
retval = lstrlen32W( buffer );
|
||||||
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, buffer2 );
|
HeapFree( GetProcessHeap(), 0, buffer2 );
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -340,18 +340,17 @@ static void TASK_CallToStart(void)
|
||||||
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
|
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
|
||||||
|
|
||||||
IF1632_Saved16_ss_sp = pTask->ss_sp;
|
IF1632_Saved16_ss_sp = pTask->ss_sp;
|
||||||
|
SET_FS( pCurrentThread->teb_sel );
|
||||||
if (pModule->flags & NE_FFLAGS_WIN32)
|
if (pModule->flags & NE_FFLAGS_WIN32)
|
||||||
{
|
{
|
||||||
/* FIXME: all this is an ugly hack */
|
/* FIXME: all this is an ugly hack */
|
||||||
|
|
||||||
extern void InitTask( CONTEXT *context );
|
extern void InitTask( CONTEXT *context );
|
||||||
|
|
||||||
FARPROC32 entry = (FARPROC32)(pCurrentProcess->exe_modref->load_addr +
|
FARPROC32 entry = (FARPROC32)RVA_PTR( pCurrentProcess->exe_modref->module, OptionalHeader.AddressOfEntryPoint );
|
||||||
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
|
|
||||||
|
|
||||||
InitTask( NULL );
|
InitTask( NULL );
|
||||||
InitApp( pTask->hModule );
|
InitApp( pTask->hModule );
|
||||||
SET_FS( pCurrentThread->teb_sel );
|
|
||||||
PE_InitializeDLLs( pCurrentProcess, DLL_PROCESS_ATTACH, (LPVOID)-1 );
|
PE_InitializeDLLs( pCurrentProcess, DLL_PROCESS_ATTACH, (LPVOID)-1 );
|
||||||
dprintf_relay( stddeb, "CallTo32(entryproc=%p)\n", entry );
|
dprintf_relay( stddeb, "CallTo32(entryproc=%p)\n", entry );
|
||||||
exit_code = entry();
|
exit_code = entry();
|
||||||
|
@ -526,7 +525,8 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
|
||||||
pCurrentProcess->exe_modref->load_addr +
|
pCurrentProcess->exe_modref->load_addr +
|
||||||
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
|
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
|
||||||
*/
|
*/
|
||||||
pTask->thdb = THREAD_Create( pdb32, 0, 0 );
|
pTask->thdb = THREAD_Create( pdb32,
|
||||||
|
PE_HEADER(pModule->module32)->OptionalHeader.SizeOfStackReserve, 0 );
|
||||||
/* FIXME: should not be done here */
|
/* FIXME: should not be done here */
|
||||||
pCurrentThread = pTask->thdb;
|
pCurrentThread = pTask->thdb;
|
||||||
PE_InitTls( pdb32 );
|
PE_InitTls( pdb32 );
|
||||||
|
@ -1005,9 +1005,9 @@ void WINAPI UserYield(void)
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Yield (KERNEL.29)
|
* Yield16 (KERNEL.29)
|
||||||
*/
|
*/
|
||||||
void WINAPI Yield(void)
|
void WINAPI Yield16(void)
|
||||||
{
|
{
|
||||||
TDB *pCurTask = (TDB *)GlobalLock16( hCurrentTask );
|
TDB *pCurTask = (TDB *)GlobalLock16( hCurrentTask );
|
||||||
if (pCurTask) pCurTask->hYieldTo = 0;
|
if (pCurTask) pCurTask->hYieldTo = 0;
|
||||||
|
@ -1021,16 +1021,24 @@ void WINAPI Yield(void)
|
||||||
*/
|
*/
|
||||||
FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
|
FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
|
||||||
{
|
{
|
||||||
BYTE *thunk;
|
BYTE *thunk,*lfunc;
|
||||||
SEGPTR thunkaddr;
|
SEGPTR thunkaddr;
|
||||||
|
|
||||||
if (__winelib) return func; /* func can be called directly in Winelib */
|
if (__winelib) return func; /* func can be called directly in Winelib */
|
||||||
thunkaddr = TASK_AllocThunk( hCurrentTask );
|
thunkaddr = TASK_AllocThunk( hCurrentTask );
|
||||||
if (!thunkaddr) return (FARPROC16)0;
|
if (!thunkaddr) return (FARPROC16)0;
|
||||||
thunk = PTR_SEG_TO_LIN( thunkaddr );
|
thunk = PTR_SEG_TO_LIN( thunkaddr );
|
||||||
|
lfunc = PTR_SEG_TO_LIN( func );
|
||||||
|
|
||||||
dprintf_task( stddeb, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n",
|
dprintf_task( stddeb, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n",
|
||||||
(DWORD)func, hInstance, (DWORD)thunkaddr );
|
(DWORD)func, hInstance, (DWORD)thunkaddr );
|
||||||
|
if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) ||
|
||||||
|
((lfunc[0]==0x1e) && (lfunc[1]==0x58))
|
||||||
|
) {
|
||||||
|
fprintf(stderr,"FIXME: MakeProcInstance16 thunk would be useless for %p, overwriting with nop;nop;\n", func );
|
||||||
|
lfunc[0]=0x90; /* nop */
|
||||||
|
lfunc[1]=0x90; /* nop */
|
||||||
|
}
|
||||||
|
|
||||||
*thunk++ = 0xb8; /* movw instance, %ax */
|
*thunk++ = 0xb8; /* movw instance, %ax */
|
||||||
*thunk++ = (BYTE)(hInstance & 0xff);
|
*thunk++ = (BYTE)(hInstance & 0xff);
|
||||||
|
@ -1074,6 +1082,15 @@ HANDLE16 WINAPI GetCodeHandle( FARPROC16 proc )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* DefineHandleTable16 (KERNEL.94)
|
||||||
|
*/
|
||||||
|
BOOL16 WINAPI DefineHandleTable16( WORD wOffset )
|
||||||
|
{
|
||||||
|
return TRUE; /* FIXME */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetTaskQueue (KERNEL.34)
|
* SetTaskQueue (KERNEL.34)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -567,9 +567,9 @@ BOOL16 WINAPI GlobalUnWire16( HGLOBAL16 handle )
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetSwapAreaSize (KERNEL.106)
|
* SetSwapAreaSize16 (KERNEL.106)
|
||||||
*/
|
*/
|
||||||
LONG WINAPI SetSwapAreaSize( WORD size )
|
LONG WINAPI SetSwapAreaSize16( WORD size )
|
||||||
{
|
{
|
||||||
dprintf_global(stdnimp, "STUB: SetSwapAreaSize(%d)\n", size );
|
dprintf_global(stdnimp, "STUB: SetSwapAreaSize(%d)\n", size );
|
||||||
return MAKELONG( size, 0xffff );
|
return MAKELONG( size, 0xffff );
|
||||||
|
|
|
@ -1080,6 +1080,28 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FlushViewOfFile (KERNEL32.262)
|
||||||
|
*/
|
||||||
|
BOOL32 WINAPI FlushViewOfFile( LPCVOID base, DWORD cbFlush )
|
||||||
|
{
|
||||||
|
FILE_VIEW *view;
|
||||||
|
UINT32 addr = ROUND_ADDR( base );
|
||||||
|
|
||||||
|
dprintf_virtual( stddeb, "FlushViewOfFile at %p for %ld bytes\n",
|
||||||
|
base, cbFlush );
|
||||||
|
|
||||||
|
if (!(view = VIRTUAL_FindView( addr )))
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (!cbFlush) cbFlush = view->size;
|
||||||
|
if (!msync( addr, cbFlush, MS_SYNC )) return TRUE;
|
||||||
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
}
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* UnmapViewOfFile (KERNEL32.540)
|
* UnmapViewOfFile (KERNEL32.540)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,6 @@ C_SRCS = \
|
||||||
callback.c \
|
callback.c \
|
||||||
comm.c \
|
comm.c \
|
||||||
commdlg.c \
|
commdlg.c \
|
||||||
compobj.c \
|
|
||||||
crtdll.c \
|
crtdll.c \
|
||||||
cpu.c \
|
cpu.c \
|
||||||
ddeml.c \
|
ddeml.c \
|
||||||
|
@ -22,15 +21,11 @@ C_SRCS = \
|
||||||
mpr.c \
|
mpr.c \
|
||||||
network.c \
|
network.c \
|
||||||
ntdll.c \
|
ntdll.c \
|
||||||
ole2.c \
|
|
||||||
ole2disp.c \
|
|
||||||
ole2nls.c \
|
|
||||||
olecli.c \
|
|
||||||
olesvr.c \
|
|
||||||
port.c \
|
port.c \
|
||||||
printdrv.c \
|
printdrv.c \
|
||||||
registry.c \
|
registry.c \
|
||||||
shell.c \
|
shell.c \
|
||||||
|
shellord.c \
|
||||||
sound.c \
|
sound.c \
|
||||||
spy.c \
|
spy.c \
|
||||||
stress.c \
|
stress.c \
|
||||||
|
@ -39,6 +34,8 @@ C_SRCS = \
|
||||||
tweak.c \
|
tweak.c \
|
||||||
ver.c \
|
ver.c \
|
||||||
version.c \
|
version.c \
|
||||||
|
w32scomb.c \
|
||||||
|
w32skrnl.c \
|
||||||
w32sys.c \
|
w32sys.c \
|
||||||
winsock.c \
|
winsock.c \
|
||||||
winsock_dns.c \
|
winsock_dns.c \
|
||||||
|
|
|
@ -124,6 +124,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
|
||||||
}
|
}
|
||||||
|
|
||||||
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
|
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
|
||||||
|
/* FIXME: doesn't handle win32 format correctly yet */
|
||||||
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
|
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
|
||||||
lpofn->hwndOwner,
|
lpofn->hwndOwner,
|
||||||
(DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"),
|
(DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"),
|
||||||
|
|
|
@ -474,6 +474,16 @@ void __cdecl CRTDLL_exit(DWORD ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _abnormal_termination (CRTDLL.36 )
|
||||||
|
*/
|
||||||
|
INT32 __cdecl CRTDLL__abnormal_termination(void)
|
||||||
|
{
|
||||||
|
dprintf_crtdll(stddeb,"CRTDLL__abnormal_termination\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* fflush (CRTDLL.365)
|
* fflush (CRTDLL.365)
|
||||||
*/
|
*/
|
||||||
|
@ -582,6 +592,19 @@ INT32 __cdecl CRTDLL_getc( FILE *stream )
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _rotl (CRTDLL.259)
|
||||||
|
*/
|
||||||
|
UINT32 __cdecl CRTDLL__rotl(UINT32 x,INT32 shift)
|
||||||
|
{
|
||||||
|
unsigned int ret = (x >> shift)|( x >>((sizeof(x))-shift));
|
||||||
|
|
||||||
|
dprintf_crtdll(stddeb,
|
||||||
|
"CRTDLL_rotl got 0x%08x rot %d ret 0x%08x\n",
|
||||||
|
x,shift,ret);
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
}
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _lrotl (CRTDLL.176)
|
* _lrotl (CRTDLL.176)
|
||||||
*/
|
*/
|
||||||
|
@ -1429,6 +1452,66 @@ LPSTR __cdecl CRTDLL__fullpath(LPSTR buf, LPCSTR name, INT32 size)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _splitpath (CRTDLL.279)
|
||||||
|
*/
|
||||||
|
VOID __cdecl CRTDLL__splitpath(LPCSTR path, LPSTR drive, LPSTR directory, LPSTR filename, LPSTR extension )
|
||||||
|
{
|
||||||
|
/* drive includes :
|
||||||
|
directory includes leading and trailing (forward and backward slashes)
|
||||||
|
filename without dot and slashes
|
||||||
|
extension with leading dot
|
||||||
|
*/
|
||||||
|
char * drivechar,*dirchar,*namechar;
|
||||||
|
|
||||||
|
dprintf_crtdll(stddeb,"CRTDLL__splitpath got %s\n",path);
|
||||||
|
|
||||||
|
drivechar = strchr(path,':');
|
||||||
|
dirchar = strrchr(path,'/');
|
||||||
|
namechar = strrchr(path,'\\');
|
||||||
|
dirchar = MAX(dirchar,namechar);
|
||||||
|
if (dirchar)
|
||||||
|
namechar = strrchr(dirchar,'.');
|
||||||
|
else
|
||||||
|
namechar = strrchr(path,'.');
|
||||||
|
|
||||||
|
|
||||||
|
if (drive)
|
||||||
|
{
|
||||||
|
*drive = NULL;
|
||||||
|
if (drivechar)
|
||||||
|
{
|
||||||
|
strncat(drive,path,drivechar-path+1);
|
||||||
|
path = drivechar+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (directory)
|
||||||
|
{
|
||||||
|
*directory = NULL;
|
||||||
|
if (dirchar)
|
||||||
|
{
|
||||||
|
strncat(directory,path,dirchar-path+1);
|
||||||
|
path = dirchar+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (filename)
|
||||||
|
{
|
||||||
|
*filename = NULL;
|
||||||
|
if (namechar)
|
||||||
|
{
|
||||||
|
strncat(filename,path,namechar-path);
|
||||||
|
if (extension)
|
||||||
|
{
|
||||||
|
*extension = NULL;
|
||||||
|
strcat(extension,namechar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dprintf_crtdll(stddeb,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _getcwd (CRTDLL.120)
|
* _getcwd (CRTDLL.120)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -168,7 +168,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
|
||||||
_llseek32(hfSrc,0,SEEK_SET);
|
_llseek32(hfSrc,0,SEEK_SET);
|
||||||
return ret?ret:hfSrc;
|
return ret?ret:hfSrc;
|
||||||
}
|
}
|
||||||
lzstates = HeapReAlloc( GetProcessHeap(), 0, lzstates,
|
lzstates = HeapReAlloc( SystemHeap, 0, lzstates,
|
||||||
(++nroflzstates)*sizeof(struct lzstate) );
|
(++nroflzstates)*sizeof(struct lzstate) );
|
||||||
lzs = lzstates+(nroflzstates-1);
|
lzs = lzstates+(nroflzstates-1);
|
||||||
|
|
||||||
|
@ -618,7 +618,7 @@ void WINAPI LZClose32( HFILE32 fd )
|
||||||
memmove(lzstates+i,lzstates+i+1,
|
memmove(lzstates+i,lzstates+i+1,
|
||||||
sizeof(struct lzstate)*(nroflzstates-i-1));
|
sizeof(struct lzstate)*(nroflzstates-i-1));
|
||||||
nroflzstates--;
|
nroflzstates--;
|
||||||
lzstates = HeapReAlloc( GetProcessHeap(), 0, lzstates,
|
lzstates = HeapReAlloc( SystemHeap, 0, lzstates,
|
||||||
sizeof(struct lzstate)*nroflzstates );
|
sizeof(struct lzstate)*nroflzstates );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ static XrmOptionDescRec optionsTable[] =
|
||||||
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
|
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
|
||||||
|
|
||||||
#define USAGE \
|
#define USAGE \
|
||||||
"Usage: %s [options] program_name [arguments]\n" \
|
"Usage: %s [options] \"program_name [arguments]\"\n" \
|
||||||
"\n" \
|
"\n" \
|
||||||
"Options:\n" \
|
"Options:\n" \
|
||||||
" -backingstore Turn on backing store\n" \
|
" -backingstore Turn on backing store\n" \
|
||||||
|
@ -613,7 +613,7 @@ void WINAPI MessageBeep16( UINT16 i )
|
||||||
*/
|
*/
|
||||||
BOOL32 WINAPI MessageBeep32( UINT32 i )
|
BOOL32 WINAPI MessageBeep32( UINT32 i )
|
||||||
{
|
{
|
||||||
XBell( display, 100 );
|
XBell( display, 0 );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ BOOL32 WINAPI MessageBeep32( UINT32 i )
|
||||||
BOOL32 WINAPI Beep( DWORD dwFreq, DWORD dwDur )
|
BOOL32 WINAPI Beep( DWORD dwFreq, DWORD dwDur )
|
||||||
{
|
{
|
||||||
/* dwFreq and dwDur are ignored by Win95 */
|
/* dwFreq and dwDur are ignored by Win95 */
|
||||||
XBell(display, 100);
|
XBell(display, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
#include "winerror.h"
|
||||||
#include "drive.h"
|
#include "drive.h"
|
||||||
|
|
||||||
#define WN_SUCCESS 0x0000
|
#define WN_SUCCESS 0x0000
|
||||||
|
@ -29,8 +30,10 @@
|
||||||
#define WN_ALREADY_CONNECTED 0x0034
|
#define WN_ALREADY_CONNECTED 0x0034
|
||||||
#define WN_DEVICE_ERROR 0x0035
|
#define WN_DEVICE_ERROR 0x0035
|
||||||
#define WN_CONNECTION_CLOSED 0x0036
|
#define WN_CONNECTION_CLOSED 0x0036
|
||||||
|
#define WN_NO_NETWORK ERROR_NO_NETWORK
|
||||||
|
|
||||||
typedef LPSTR LPNETRESOURCE;
|
|
||||||
|
typedef LPVOID LPNETRESOURCE16;
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* WNetErrorText [USER.499]
|
* WNetErrorText [USER.499]
|
||||||
|
@ -170,8 +173,12 @@ int WINAPI WNetGetConnection16(LPSTR lpLocalName,
|
||||||
case DRIVE_FIXED:
|
case DRIVE_FIXED:
|
||||||
return WN_NOT_CONNECTED;
|
return WN_NOT_CONNECTED;
|
||||||
case DRIVE_REMOTE:
|
case DRIVE_REMOTE:
|
||||||
path = DRIVE_GetDosCwd(drive);
|
path = DRIVE_GetLabel(drive);
|
||||||
if (strlen(path) + 1 > *cbRemoteName) return WN_MORE_DATA;
|
if (strlen(path) + 1 > *cbRemoteName)
|
||||||
|
{
|
||||||
|
*cbRemoteName = strlen(path) + 1;
|
||||||
|
return WN_MORE_DATA;
|
||||||
|
}
|
||||||
strcpy( lpRemoteName, path );
|
strcpy( lpRemoteName, path );
|
||||||
*cbRemoteName = strlen(lpRemoteName) + 1;
|
*cbRemoteName = strlen(lpRemoteName) + 1;
|
||||||
return WN_SUCCESS;
|
return WN_SUCCESS;
|
||||||
|
@ -194,7 +201,7 @@ int WINAPI WNetGetCaps(WORD capability)
|
||||||
int WINAPI WNetDeviceMode(HWND16 hWndOwner)
|
int WINAPI WNetDeviceMode(HWND16 hWndOwner)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetDeviceMode(%04x)\n",hWndOwner);
|
printf("EMPTY STUB !!! WNetDeviceMode(%04x)\n",hWndOwner);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -204,7 +211,7 @@ int WINAPI WNetBrowseDialog(HWND16 hParent,WORD nType,LPSTR szPath)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetBrowseDialog(%04x,%x,'%s')\n",
|
printf("EMPTY STUB !!! WNetBrowseDialog(%04x,%x,'%s')\n",
|
||||||
hParent,nType,szPath);
|
hParent,nType,szPath);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -214,7 +221,7 @@ UINT16 WINAPI WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetGetUser(%p, %p, %p);\n",
|
printf("EMPTY STUB !!! WNetGetUser(%p, %p, %p);\n",
|
||||||
lpLocalName, lpUserName, lpSize);
|
lpLocalName, lpUserName, lpSize);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -225,7 +232,7 @@ UINT16 WINAPI WNetAddConnection(LPSTR lpNetPath, LPSTR lpPassWord,
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetAddConnection('%s', %p, '%s');\n",
|
printf("EMPTY STUB !!! WNetAddConnection('%s', %p, '%s');\n",
|
||||||
lpNetPath, lpPassWord, lpLocalName);
|
lpNetPath, lpPassWord, lpLocalName);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,7 +243,7 @@ UINT16 WINAPI WNetCancelConnection(LPSTR lpName, BOOL16 bForce)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetCancelConnection('%s', %04X);\n",
|
printf("EMPTY STUB !!! WNetCancelConnection('%s', %04X);\n",
|
||||||
lpName, bForce);
|
lpName, bForce);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -245,7 +252,7 @@ UINT16 WINAPI WNetCancelConnection(LPSTR lpName, BOOL16 bForce)
|
||||||
int WINAPI WNetGetError(LPWORD nError)
|
int WINAPI WNetGetError(LPWORD nError)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetGetError(%p)\n",nError);
|
printf("EMPTY STUB !!! WNetGetError(%p)\n",nError);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -265,7 +272,7 @@ int WINAPI WNetRestoreConnection(HWND16 hwndOwner,LPSTR lpszDevice)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetRestoreConnection(%04x,'%s')\n",
|
printf("EMPTY STUB !!! WNetRestoreConnection(%04x,'%s')\n",
|
||||||
hwndOwner,lpszDevice);
|
hwndOwner,lpszDevice);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -275,7 +282,7 @@ int WINAPI WNetWriteJob(HANDLE16 hJob,void *lpData,LPWORD lpcbData)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetWriteJob(%04x,%p,%p)\n",
|
printf("EMPTY STUB !!! WNetWriteJob(%04x,%p,%p)\n",
|
||||||
hJob,lpData,lpcbData);
|
hJob,lpData,lpcbData);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -294,7 +301,7 @@ int WINAPI WNetDisconnectDialog(HWND16 hwndOwner, WORD iType)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetDisconnectDialog(%04x,%x)\n",
|
printf("EMPTY STUB !!! WNetDisconnectDialog(%04x,%x)\n",
|
||||||
hwndOwner,iType);
|
hwndOwner,iType);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -314,7 +321,7 @@ int WINAPI WNetViewQueueDialog(HWND16 hwndOwner,LPSTR lpszQueue)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetViewQueueDialog(%04x,'%s')\n",
|
printf("EMPTY STUB !!! WNetViewQueueDialog(%04x,'%s')\n",
|
||||||
hwndOwner,lpszQueue);
|
hwndOwner,lpszQueue);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -325,7 +332,7 @@ int WINAPI WNetPropertyDialog(HWND16 hwndParent,WORD iButton,
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetPropertyDialog(%04x,%x,%x,'%s',%x)\n",
|
printf("EMPTY STUB !!! WNetPropertyDialog(%04x,%x,%x,'%s',%x)\n",
|
||||||
hwndParent,iButton,nPropSel,lpszName,nType);
|
hwndParent,iButton,nPropSel,lpszName,nType);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -335,7 +342,7 @@ int WINAPI WNetGetDirectoryType(LPSTR lpName,void *lpType)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetGetDirectoryType('%s',%p)\n",
|
printf("EMPTY STUB !!! WNetGetDirectoryType('%s',%p)\n",
|
||||||
lpName,lpType);
|
lpName,lpType);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -345,7 +352,7 @@ int WINAPI WNetDirectoryNotify(HWND16 hwndOwner,void *lpDir,WORD wOper)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetDirectoryNotify(%04x,%p,%x)\n",
|
printf("EMPTY STUB !!! WNetDirectoryNotify(%04x,%p,%x)\n",
|
||||||
hwndOwner,lpDir,wOper);
|
hwndOwner,lpDir,wOper);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -356,7 +363,7 @@ int WINAPI WNetGetPropertyText(HWND16 hwndParent,WORD iButton,WORD nPropSel,
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetGetPropertyText(%04x,%x,%x,'%s',%x)\n",
|
printf("EMPTY STUB !!! WNetGetPropertyText(%04x,%x,%x,'%s',%x)\n",
|
||||||
hwndParent,iButton,nPropSel,lpszName,nType);
|
hwndParent,iButton,nPropSel,lpszName,nType);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -367,7 +374,7 @@ UINT16 WINAPI WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetAddConnection2('%s', %p, '%s', '%s');\n",
|
printf("EMPTY STUB !!! WNetAddConnection2('%s', %p, '%s', '%s');\n",
|
||||||
lpNetPath, lpPassWord, lpLocalName, lpUserName);
|
lpNetPath, lpPassWord, lpLocalName, lpUserName);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -376,7 +383,7 @@ UINT16 WINAPI WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
|
||||||
UINT16 WINAPI WNetCloseEnum(HANDLE16 hEnum)
|
UINT16 WINAPI WNetCloseEnum(HANDLE16 hEnum)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetCloseEnum(%04x);\n", hEnum);
|
printf("EMPTY STUB !!! WNetCloseEnum(%04x);\n", hEnum);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -387,22 +394,35 @@ UINT16 WINAPI WNetEnumResource(HANDLE16 hEnum, DWORD cRequ,
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetEnumResource(%04x, %08lX, %p, %p);\n",
|
printf("EMPTY STUB !!! WNetEnumResource(%04x, %08lX, %p, %p);\n",
|
||||||
hEnum, cRequ, lpCount, lpBuf);
|
hEnum, cRequ, lpCount, lpBuf);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* WNetOpenEnum [USER.???]
|
* WNetOpenEnum [USER.???]
|
||||||
*/
|
*/
|
||||||
UINT16 WINAPI WNetOpenEnum(DWORD dwScope, DWORD dwType,
|
UINT16 WINAPI WNetOpenEnum16(DWORD dwScope, DWORD dwType,
|
||||||
LPNETRESOURCE lpNet, HANDLE16 *lphEnum)
|
LPNETRESOURCE16 lpNet, HANDLE16 *lphEnum)
|
||||||
{
|
{
|
||||||
printf("EMPTY STUB !!! WNetOpenEnum(%08lX, %08lX, %p, %p);\n",
|
printf("EMPTY STUB !!! WNetOpenEnum(%08lX, %08lX, %p, %p);\n",
|
||||||
dwScope, dwType, lpNet, lphEnum);
|
dwScope, dwType, lpNet, lphEnum);
|
||||||
return WN_NET_ERROR;
|
return WN_NO_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* WNetOpenEnumA [MPR.92]
|
||||||
|
*/
|
||||||
|
UINT32 WINAPI WNetOpenEnum32A(DWORD dwScope, DWORD dwType,
|
||||||
|
LPNETRESOURCE32A lpNet, HANDLE32 *lphEnum)
|
||||||
|
{
|
||||||
|
printf("EMPTY STUB !!! WNetOpenEnumA(%08lX, %08lX, %p, %p);\n",
|
||||||
|
dwScope, dwType, lpNet, lphEnum);
|
||||||
|
return WN_NO_NETWORK;
|
||||||
|
}
|
||||||
|
|
||||||
DWORD
|
/**************************************************************************
|
||||||
|
* WNetGetConnectionA [MPR.92]
|
||||||
|
*/
|
||||||
|
DWORD WINAPI
|
||||||
WNetGetConnection32A(LPCSTR localname,LPSTR remotename,LPDWORD buflen)
|
WNetGetConnection32A(LPCSTR localname,LPSTR remotename,LPDWORD buflen)
|
||||||
{
|
{
|
||||||
UINT16 x;
|
UINT16 x;
|
||||||
|
@ -410,3 +430,13 @@ WNetGetConnection32A(LPCSTR localname,LPSTR remotename,LPDWORD buflen)
|
||||||
*buflen = x;
|
*buflen = x;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DWORD WINAPI
|
||||||
|
WNetGetResourceInformation32A(
|
||||||
|
LPNETRESOURCE32A netres,LPVOID buf,LPDWORD buflen,LPSTR systemstr
|
||||||
|
) {
|
||||||
|
fprintf(stderr,"WNetGetResourceInformationA(%p,%p,%p,%p),stub!\n",
|
||||||
|
netres,buf,buflen,systemstr
|
||||||
|
);
|
||||||
|
return WN_NO_NETWORK;
|
||||||
|
}
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
/*
|
|
||||||
* OLECLI library
|
|
||||||
*
|
|
||||||
* Copyright 1995 Martin von Loewis
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* At the moment, these are only empty stubs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "windows.h"
|
|
||||||
#include "ole.h"
|
|
||||||
#include "gdi.h"
|
|
||||||
#include "stddebug.h"
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
extern LONG OLE_current_handle;
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRegisterClientDoc
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRegisterClientDoc( LPCSTR classname, LPCSTR docname,
|
|
||||||
LONG reserved, LHCLIENTDOC *hRet )
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRegisterClientDoc:%s %s\n",classname,docname);
|
|
||||||
*hRet=++OLE_current_handle;
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRenameClientDoc
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRenameClientDoc(LHCLIENTDOC hDoc, LPCSTR newName)
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRenameClientDoc: %ld %s\n",hDoc, newName);
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRevokeClientDoc
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRevokeClientDoc(LHCLIENTDOC hServerDoc)
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRevokeClientDoc:%ld\n",hServerDoc);
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleIsDcMeta
|
|
||||||
*/
|
|
||||||
BOOL16 WINAPI OleIsDcMeta(HDC16 hdc)
|
|
||||||
{
|
|
||||||
dprintf_ole(stddeb,"OleIsDCMeta(%04x)\n",hdc);
|
|
||||||
return GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0;
|
|
||||||
}
|
|
|
@ -1,78 +0,0 @@
|
||||||
/*
|
|
||||||
* OLESVR library
|
|
||||||
*
|
|
||||||
* Copyright 1995 Martin von Loewis
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* At the moment, these are only empty stubs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "windows.h"
|
|
||||||
#include "ole.h"
|
|
||||||
#include "stddebug.h"
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
LONG OLE_current_handle;
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRegisterServer
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRegisterServer( LPCSTR name, LPOLESERVER serverStruct,
|
|
||||||
LHSERVER *hRet, HINSTANCE16 hServer,
|
|
||||||
OLE_SERVER_USE use )
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRegisterServer:%s\n",name);
|
|
||||||
*hRet=++OLE_current_handle;
|
|
||||||
/* return OLE_ERROR_MEMORY, OLE_ERROR_PROTECT_ONLY if you want it fail*/
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleBlockServer
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleBlockServer(LHSERVER hServer)
|
|
||||||
{
|
|
||||||
fprintf(stdnimp,"OleBlockServer:%ld\n",hServer);
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleUnblockServer
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleUnblockServer(LHSERVER hServer, BOOL16 *block)
|
|
||||||
{
|
|
||||||
fprintf(stdnimp,"OleUnblockServer:%ld\n",hServer);
|
|
||||||
/* no more blocked messages :) */
|
|
||||||
*block=FALSE;
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRegisterServerDoc
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRegisterServerDoc( LHSERVER hServer, LPCSTR docname,
|
|
||||||
LPOLESERVERDOC document,
|
|
||||||
LHSERVERDOC *hRet)
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRegisterServerDoc:%ld,%s\n", hServer, docname);
|
|
||||||
*hRet=++OLE_current_handle;
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRevokeServerDoc
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC hServerDoc)
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRevokeServerDoc:%ld\n",hServerDoc);
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* OleRevokeServer
|
|
||||||
*/
|
|
||||||
OLESTATUS WINAPI OleRevokeServer(LHSERVER hServer)
|
|
||||||
{
|
|
||||||
dprintf_ole(stdnimp,"OleRevokeServer:%ld\n",hServer);
|
|
||||||
return OLE_OK;
|
|
||||||
}
|
|
|
@ -89,3 +89,12 @@ LONG WINAPI DocumentProperties32A(HWND32 hWnd,HANDLE32 hPrinter,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL32 WINAPI EnumPrinters32A(DWORD dwType, LPSTR lpszName,
|
||||||
|
DWORD dwLevel, LPBYTE lpbPrinters,
|
||||||
|
DWORD cbBuf, LPDWORD lpdwNeeded,
|
||||||
|
LPDWORD lpdwReturned)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"EnumPrinters32A nearly empty stub\n");
|
||||||
|
*lpdwReturned=0;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "string32.h"
|
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
@ -78,9 +77,25 @@ static KEYSTRUCT *key_dyn_data=NULL;
|
||||||
/* what valuetypes do we need to convert? */
|
/* what valuetypes do we need to convert? */
|
||||||
#define UNICONVMASK ((1<<REG_SZ)|(1<<REG_MULTI_SZ)|(1<<REG_EXPAND_SZ))
|
#define UNICONVMASK ((1<<REG_SZ)|(1<<REG_MULTI_SZ)|(1<<REG_EXPAND_SZ))
|
||||||
|
|
||||||
#define strdupA2W(x) STRING32_DupAnsiToUni(x)
|
extern LPWSTR __cdecl CRTDLL_wcschr(LPWSTR a,WCHAR c);
|
||||||
#define strdupW(x) STRING32_strdupW(x)
|
|
||||||
#define strchrW(a,c) STRING32_lstrchrW(a,c)
|
static LPWSTR strdupA2W(LPCSTR src)
|
||||||
|
{
|
||||||
|
LPWSTR dest=xmalloc(2*strlen(src)+2);
|
||||||
|
lstrcpyAtoW(dest,src);
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LPWSTR strdupW(LPCWSTR a) {
|
||||||
|
LPWSTR b;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len=sizeof(WCHAR)*(lstrlen32W(a)+1);
|
||||||
|
b=(LPWSTR)xmalloc(len);
|
||||||
|
memcpy(b,a,len);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct openhandle {
|
static struct openhandle {
|
||||||
LPKEYSTRUCT lpkey;
|
LPKEYSTRUCT lpkey;
|
||||||
|
@ -1454,7 +1469,7 @@ __w31_dumptree( unsigned short idx,
|
||||||
idx=dir->sibling_idx;
|
idx=dir->sibling_idx;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
name=STRING32_DupAnsiToUni(tail);
|
name=strdupA2W(tail);
|
||||||
|
|
||||||
xlpkey=_find_or_add_key(lpkey,name);
|
xlpkey=_find_or_add_key(lpkey,name);
|
||||||
|
|
||||||
|
@ -1464,7 +1479,7 @@ __w31_dumptree( unsigned short idx,
|
||||||
val=(struct _w31_valent*)&tab[dir->value_idx];
|
val=(struct _w31_valent*)&tab[dir->value_idx];
|
||||||
memcpy(tail,&txt[val->string_off],val->length);
|
memcpy(tail,&txt[val->string_off],val->length);
|
||||||
tail[val->length]='\0';
|
tail[val->length]='\0';
|
||||||
value=STRING32_DupAnsiToUni(tail);
|
value=strdupA2W(tail);
|
||||||
_find_or_add_value(xlpkey,NULL,REG_SZ,(LPBYTE)value,lstrlen32W(value)*2+2,lastmodified);
|
_find_or_add_value(xlpkey,NULL,REG_SZ,(LPBYTE)value,lstrlen32W(value)*2+2,lastmodified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
400
misc/shell.c
400
misc/shell.c
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Shell Library Functions
|
* Shell Library Functions
|
||||||
*/
|
*/
|
||||||
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -17,8 +18,12 @@
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
#include "cursoricon.h"
|
#include "cursoricon.h"
|
||||||
|
#include "interfaces.h"
|
||||||
|
#include "sysmetrics.h"
|
||||||
|
#include "shlobj.h"
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "debugstr.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
|
|
||||||
static const char * const SHELL_People[] =
|
static const char * const SHELL_People[] =
|
||||||
|
@ -29,6 +34,7 @@ static const char * const SHELL_People[] =
|
||||||
"Peter Bajusz",
|
"Peter Bajusz",
|
||||||
"Georg Beyerle",
|
"Georg Beyerle",
|
||||||
"Ross Biro",
|
"Ross Biro",
|
||||||
|
"Martin Boehme",
|
||||||
"Uwe Bonnes",
|
"Uwe Bonnes",
|
||||||
"Erik Bos",
|
"Erik Bos",
|
||||||
"Fons Botman",
|
"Fons Botman",
|
||||||
|
@ -36,12 +42,14 @@ static const char * const SHELL_People[] =
|
||||||
"Andrew Bulhak",
|
"Andrew Bulhak",
|
||||||
"John Burton",
|
"John Burton",
|
||||||
"Niels de Carpentier",
|
"Niels de Carpentier",
|
||||||
|
"Gordon Chaffee",
|
||||||
"Jimen Ching",
|
"Jimen Ching",
|
||||||
"David A. Cuthbert",
|
"David A. Cuthbert",
|
||||||
"Huw D. M. Davies",
|
"Huw D. M. Davies",
|
||||||
"Roman Dolejsi",
|
"Roman Dolejsi",
|
||||||
"Frans van Dorsselaer",
|
"Frans van Dorsselaer",
|
||||||
"Chris Faherty",
|
"Chris Faherty",
|
||||||
|
"Carsten Fallesen",
|
||||||
"Paul Falstad",
|
"Paul Falstad",
|
||||||
"David Faure",
|
"David Faure",
|
||||||
"Claus Fischer",
|
"Claus Fischer",
|
||||||
|
@ -89,6 +97,7 @@ static const char * const SHELL_People[] =
|
||||||
"Andreas Mohr",
|
"Andreas Mohr",
|
||||||
"Philippe De Muyter",
|
"Philippe De Muyter",
|
||||||
"Itai Nahshon",
|
"Itai Nahshon",
|
||||||
|
"Kristian Nielsen",
|
||||||
"Henrik Olsen",
|
"Henrik Olsen",
|
||||||
"Michael Patra",
|
"Michael Patra",
|
||||||
"Dimitrie O. Paun",
|
"Dimitrie O. Paun",
|
||||||
|
@ -132,12 +141,14 @@ static const char * const SHELL_People[] =
|
||||||
"Eric Warnke",
|
"Eric Warnke",
|
||||||
"Manfred Weichel",
|
"Manfred Weichel",
|
||||||
"Morten Welinder",
|
"Morten Welinder",
|
||||||
|
"Len White",
|
||||||
"Lawson Whitney",
|
"Lawson Whitney",
|
||||||
"Jan Willamowius",
|
"Jan Willamowius",
|
||||||
"Carl Williams",
|
"Carl Williams",
|
||||||
"Karl Guenter Wuensch",
|
"Karl Guenter Wuensch",
|
||||||
"Eric Youngdale",
|
"Eric Youngdale",
|
||||||
"James Youngman",
|
"James Youngman",
|
||||||
|
"Nikita V. Youshchenko",
|
||||||
"Mikolaj Zalewski",
|
"Mikolaj Zalewski",
|
||||||
"John Zero",
|
"John Zero",
|
||||||
NULL
|
NULL
|
||||||
|
@ -746,48 +757,52 @@ BOOL32 WINAPI ShellAbout32W( HWND32 hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* SHELL_GetResourceTable
|
* SHELL_GetResourceTable
|
||||||
*
|
|
||||||
* FIXME: Implement GetPEResourceTable in w32sys.c and call it here.
|
|
||||||
*/
|
*/
|
||||||
static BYTE* SHELL_GetResourceTable(HFILE32 hFile)
|
static DWORD SHELL_GetResourceTable(HFILE32 hFile,LPBYTE *retptr)
|
||||||
{
|
{
|
||||||
BYTE* pTypeInfo = NULL;
|
|
||||||
IMAGE_DOS_HEADER mz_header;
|
IMAGE_DOS_HEADER mz_header;
|
||||||
IMAGE_OS2_HEADER ne_header;
|
char magic[4];
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
|
*retptr = NULL;
|
||||||
_llseek32( hFile, 0, SEEK_SET );
|
_llseek32( hFile, 0, SEEK_SET );
|
||||||
if ((_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
|
if ( (_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
|
||||||
(mz_header.e_magic != IMAGE_DOS_SIGNATURE)) return (BYTE*)-1;
|
(mz_header.e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
|
)
|
||||||
|
return 0;
|
||||||
|
|
||||||
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET );
|
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET );
|
||||||
if (_lread32( hFile, &ne_header, sizeof(ne_header) ) != sizeof(ne_header))
|
if (_lread32( hFile, magic, sizeof(magic) ) != sizeof(magic))
|
||||||
return NULL;
|
return 0;
|
||||||
|
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET);
|
||||||
|
|
||||||
if (ne_header.ne_magic == IMAGE_NT_SIGNATURE)
|
if (*(DWORD*)magic == IMAGE_NT_SIGNATURE)
|
||||||
{ fprintf(stdnimp,"Win32s FIXME: file %s line %i\n", __FILE__, __LINE__ );
|
return IMAGE_NT_SIGNATURE;
|
||||||
return NULL; }
|
if (*(WORD*)magic == IMAGE_OS2_SIGNATURE) {
|
||||||
|
IMAGE_OS2_HEADER ne_header;
|
||||||
|
LPBYTE pTypeInfo = NULL;
|
||||||
|
|
||||||
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return NULL;
|
if (_lread32(hFile,&ne_header,sizeof(ne_header))!=sizeof(ne_header))
|
||||||
|
return 0;
|
||||||
|
|
||||||
size = ne_header.rname_tab_offset - ne_header.resource_tab_offset;
|
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return 0;
|
||||||
|
size = ne_header.rname_tab_offset - ne_header.resource_tab_offset;
|
||||||
|
if( size > sizeof(NE_TYPEINFO) )
|
||||||
|
{
|
||||||
|
pTypeInfo = (BYTE*)HeapAlloc( GetProcessHeap(), 0, size);
|
||||||
|
if( pTypeInfo ) {
|
||||||
|
_llseek32(hFile, mz_header.e_lfanew+ne_header.resource_tab_offset, SEEK_SET);
|
||||||
|
if( _lread32( hFile, (char*)pTypeInfo, size) != size ) {
|
||||||
|
HeapFree( GetProcessHeap(), 0, pTypeInfo);
|
||||||
|
pTypeInfo = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*retptr = pTypeInfo;
|
||||||
|
} else
|
||||||
|
*retptr = (LPBYTE)-1;
|
||||||
|
return IMAGE_OS2_SIGNATURE; /* handles .ICO too */
|
||||||
|
|
||||||
if( size > sizeof(NE_TYPEINFO) )
|
|
||||||
{
|
|
||||||
pTypeInfo = (BYTE*)HeapAlloc( GetProcessHeap(), 0, size);
|
|
||||||
if( pTypeInfo )
|
|
||||||
{
|
|
||||||
_llseek32(hFile, mz_header.e_lfanew+ne_header.resource_tab_offset, SEEK_SET);
|
|
||||||
if( _lread32( hFile, (char*)pTypeInfo, size) != size )
|
|
||||||
{
|
|
||||||
HeapFree( GetProcessHeap(), 0, pTypeInfo);
|
|
||||||
pTypeInfo = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* no resources */
|
|
||||||
|
|
||||||
return pTypeInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -886,11 +901,13 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
|
||||||
{
|
{
|
||||||
HGLOBAL16 hRet = 0;
|
HGLOBAL16 hRet = 0;
|
||||||
HGLOBAL16* RetPtr = NULL;
|
HGLOBAL16* RetPtr = NULL;
|
||||||
BYTE* pData;
|
LPBYTE pData;
|
||||||
OFSTRUCT ofs;
|
OFSTRUCT ofs;
|
||||||
|
DWORD sig;
|
||||||
HFILE32 hFile = OpenFile32( lpszExeFileName, &ofs, OF_READ );
|
HFILE32 hFile = OpenFile32( lpszExeFileName, &ofs, OF_READ );
|
||||||
|
UINT16 iconDirCount = 0,iconCount = 0;
|
||||||
|
|
||||||
dprintf_reg(stddeb, "InternalExtractIcon(%04x, file '%s', start from %d, extract %d\n",
|
dprintf_reg(stddeb,"InternalExtractIcon(%04x,file %s,start %d,extract %d\n",
|
||||||
hInstance, lpszExeFileName, nIconIndex, n);
|
hInstance, lpszExeFileName, nIconIndex, n);
|
||||||
|
|
||||||
if( hFile == HFILE_ERROR32 || !n ) return 0;
|
if( hFile == HFILE_ERROR32 || !n ) return 0;
|
||||||
|
@ -898,13 +915,13 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
|
||||||
hRet = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, sizeof(HICON16)*n);
|
hRet = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, sizeof(HICON16)*n);
|
||||||
RetPtr = (HICON16*)GlobalLock16(hRet);
|
RetPtr = (HICON16*)GlobalLock16(hRet);
|
||||||
|
|
||||||
*RetPtr = (n == 0xFFFF)? 0: 1; /* error return values */
|
*RetPtr = (n == 0xFFFF)? 0: 1; /* error return values */
|
||||||
|
|
||||||
if( (pData = SHELL_GetResourceTable(hFile)) )
|
sig = SHELL_GetResourceTable(hFile,&pData);
|
||||||
|
|
||||||
|
if(sig == IMAGE_OS2_SIGNATURE)
|
||||||
{
|
{
|
||||||
HICON16 hIcon = 0;
|
HICON16 hIcon = 0;
|
||||||
UINT16 iconDirCount = 0;
|
|
||||||
UINT16 iconCount = 0;
|
|
||||||
NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(pData + 2);
|
NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(pData + 2);
|
||||||
NE_NAMEINFO* pIconStorage = NULL;
|
NE_NAMEINFO* pIconStorage = NULL;
|
||||||
NE_NAMEINFO* pIconDir = NULL;
|
NE_NAMEINFO* pIconDir = NULL;
|
||||||
|
@ -980,30 +997,181 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
|
||||||
if( lpiID ) HeapFree( GetProcessHeap(), 0, lpiID);
|
if( lpiID ) HeapFree( GetProcessHeap(), 0, lpiID);
|
||||||
else HeapFree( GetProcessHeap(), 0, pData);
|
else HeapFree( GetProcessHeap(), 0, pData);
|
||||||
}
|
}
|
||||||
_lclose32( hFile );
|
if( sig == IMAGE_NT_SIGNATURE)
|
||||||
|
{
|
||||||
/* return array with icon handles */
|
LPBYTE peimage,idata,igdata;
|
||||||
|
LPIMAGE_DOS_HEADER dheader;
|
||||||
|
LPIMAGE_NT_HEADERS pe_header;
|
||||||
|
LPIMAGE_SECTION_HEADER pe_sections;
|
||||||
|
LPIMAGE_RESOURCE_DIRECTORY rootresdir,iconresdir,icongroupresdir;
|
||||||
|
LPIMAGE_RESOURCE_DATA_ENTRY idataent,igdataent;
|
||||||
|
HANDLE32 fmapping;
|
||||||
|
int i,j;
|
||||||
|
LPIMAGE_RESOURCE_DIRECTORY_ENTRY xresent;
|
||||||
|
CURSORICONDIR **cids;
|
||||||
|
|
||||||
|
fmapping = CreateFileMapping32A(hFile,NULL,PAGE_READONLY|SEC_COMMIT,0,0,NULL);
|
||||||
|
if (fmapping == 0) { /* FIXME, INVALID_HANDLE_VALUE? */
|
||||||
|
fprintf(stderr,"InternalExtractIcon:failed to create filemap.\n");
|
||||||
|
_lclose32( hFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
peimage = MapViewOfFile(fmapping,FILE_MAP_READ,0,0,0);
|
||||||
|
if (!peimage) {
|
||||||
|
fprintf(stderr,"InternalExtractIcon:failed to mmap filemap.\n");
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
dheader = (LPIMAGE_DOS_HEADER)peimage;
|
||||||
|
/* it is a pe header, SHELL_GetResourceTable checked that */
|
||||||
|
pe_header = (LPIMAGE_NT_HEADERS)(peimage+dheader->e_lfanew);
|
||||||
|
/* probably makes problems with short PE headers... but I haven't seen
|
||||||
|
* one yet...
|
||||||
|
*/
|
||||||
|
pe_sections = (LPIMAGE_SECTION_HEADER)(((char*)pe_header)+sizeof(*pe_header));
|
||||||
|
rootresdir = NULL;
|
||||||
|
for (i=0;i<pe_header->FileHeader.NumberOfSections;i++) {
|
||||||
|
if (pe_sections[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
|
||||||
|
continue;
|
||||||
|
/* FIXME: doesn't work when the resources are not in a seperate section */
|
||||||
|
if (pe_sections[i].VirtualAddress == pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress) {
|
||||||
|
rootresdir = (LPIMAGE_RESOURCE_DIRECTORY)((char*)peimage+pe_sections[i].PointerToRawData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rootresdir) {
|
||||||
|
fprintf(stderr,"InternalExtractIcon: haven't found section for resource directory.\n");
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
icongroupresdir = GetResDirEntryW(rootresdir,(LPWSTR)RT_GROUP_ICON,(DWORD)rootresdir);
|
||||||
|
if (!icongroupresdir) {
|
||||||
|
fprintf(stderr,"InternalExtractIcon: No Icongroupresourcedirectory!\n");
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
iconDirCount = icongroupresdir->NumberOfNamedEntries+icongroupresdir->NumberOfIdEntries;
|
||||||
|
if( nIconIndex == (UINT16)-1 ) {
|
||||||
|
RetPtr[0] = iconDirCount;
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return hRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nIconIndex >= iconDirCount) {
|
||||||
|
fprintf(stderr,"nIconIndex %d is larger than iconDirCount %d\n",
|
||||||
|
nIconIndex,iconDirCount
|
||||||
|
);
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
GlobalFree16(hRet);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
cids = (CURSORICONDIR**)HeapAlloc(GetProcessHeap(),0,n*sizeof(CURSORICONDIR*));
|
||||||
|
|
||||||
|
/* caller just wanted the number of entries */
|
||||||
|
|
||||||
|
xresent = (LPIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1);
|
||||||
|
/* assure we don't get too much ... */
|
||||||
|
if( n > iconDirCount - nIconIndex ) n = iconDirCount - nIconIndex;
|
||||||
|
|
||||||
|
/* starting from specified index ... */
|
||||||
|
xresent = xresent+nIconIndex;
|
||||||
|
|
||||||
|
for (i=0;i<n;i++,xresent++) {
|
||||||
|
CURSORICONDIR *cid;
|
||||||
|
LPIMAGE_RESOURCE_DIRECTORY resdir;
|
||||||
|
|
||||||
|
/* go down this resource entry, name */
|
||||||
|
resdir = (LPIMAGE_RESOURCE_DIRECTORY)((DWORD)rootresdir+(xresent->u2.s.OffsetToDirectory));
|
||||||
|
/* default language (0) */
|
||||||
|
resdir = GetResDirEntryW(resdir,(LPWSTR)0,(DWORD)rootresdir);
|
||||||
|
igdataent = (LPIMAGE_RESOURCE_DATA_ENTRY)resdir;
|
||||||
|
|
||||||
|
/* lookup address in mapped image for virtual address */
|
||||||
|
igdata = NULL;
|
||||||
|
for (j=0;j<pe_header->FileHeader.NumberOfSections;j++) {
|
||||||
|
if (igdataent->OffsetToData < pe_sections[j].VirtualAddress)
|
||||||
|
continue;
|
||||||
|
if (igdataent->OffsetToData+igdataent->Size > pe_sections[j].VirtualAddress+pe_sections[j].SizeOfRawData)
|
||||||
|
continue;
|
||||||
|
igdata = peimage+(igdataent->OffsetToData-pe_sections[j].VirtualAddress+pe_sections[j].PointerToRawData);
|
||||||
|
}
|
||||||
|
if (!igdata) {
|
||||||
|
fprintf(stderr,"InternalExtractIcon: no matching real address found for icongroup!\n");
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/* found */
|
||||||
|
cid = (CURSORICONDIR*)igdata;
|
||||||
|
cids[i] = cid;
|
||||||
|
fprintf(stderr,"cursoricondir %d: idType %d, idCount %d\n",
|
||||||
|
i,cid->idType,cid->idCount
|
||||||
|
);
|
||||||
|
RetPtr[i] = LookupIconIdFromDirectoryEx32(igdata,TRUE,SYSMETRICS_CXICON,SYSMETRICS_CYICON,0);
|
||||||
|
fprintf(stderr,"-> best match is %08x\n",RetPtr[i]);
|
||||||
|
}
|
||||||
|
iconresdir=GetResDirEntryW(rootresdir,(LPWSTR)RT_ICON,(DWORD)rootresdir);
|
||||||
|
if (!iconresdir) {
|
||||||
|
fprintf(stderr,"InternalExtractIcon: No Iconresourcedirectory!\n");
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (i=0;i<n;i++) {
|
||||||
|
LPIMAGE_RESOURCE_DIRECTORY xresdir;
|
||||||
|
|
||||||
|
xresdir = GetResDirEntryW(iconresdir,(LPWSTR)RetPtr[i],(DWORD)rootresdir);
|
||||||
|
xresdir = GetResDirEntryW(xresdir,(LPWSTR)0,(DWORD)rootresdir);
|
||||||
|
|
||||||
|
idataent = (LPIMAGE_RESOURCE_DATA_ENTRY)xresdir;
|
||||||
|
|
||||||
|
idata = NULL;
|
||||||
|
/* map virtual to address in image */
|
||||||
|
for (j=0;j<pe_header->FileHeader.NumberOfSections;j++) {
|
||||||
|
if (idataent->OffsetToData < pe_sections[j].VirtualAddress)
|
||||||
|
continue;
|
||||||
|
if (idataent->OffsetToData+idataent->Size > pe_sections[j].VirtualAddress+pe_sections[j].SizeOfRawData)
|
||||||
|
continue;
|
||||||
|
idata = peimage+(idataent->OffsetToData-pe_sections[j].VirtualAddress+pe_sections[j].PointerToRawData);
|
||||||
|
}
|
||||||
|
if (!idata) {
|
||||||
|
fprintf(stderr,"InternalExtractIcon: no matching real address found for icondata!\n");
|
||||||
|
RetPtr[i]=0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RetPtr[i] = CreateIconFromResourceEx32(idata,idataent->Size,TRUE,0x00030000,SYSMETRICS_CXICON,SYSMETRICS_CYICON,0);
|
||||||
|
}
|
||||||
|
UnmapViewOfFile(peimage);
|
||||||
|
CloseHandle(fmapping);
|
||||||
|
_lclose32( hFile);
|
||||||
|
return hRet;
|
||||||
|
}
|
||||||
|
_lclose32( hFile );
|
||||||
|
/* return array with icon handles */
|
||||||
return hRet;
|
return hRet;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* ExtractIcon16 (SHELL.34)
|
* ExtractIcon16 (SHELL.34)
|
||||||
*/
|
*/
|
||||||
HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
|
HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
|
||||||
UINT16 nIconIndex )
|
UINT16 nIconIndex )
|
||||||
{
|
{
|
||||||
HGLOBAL16 handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
|
return ExtractIcon32A( hInstance, lpszExeFileName, nIconIndex );
|
||||||
|
|
||||||
if( handle )
|
|
||||||
{
|
|
||||||
HICON16* ptr = (HICON16*)GlobalLock16(handle);
|
|
||||||
HICON16 hIcon = *ptr;
|
|
||||||
|
|
||||||
GlobalFree16(handle);
|
|
||||||
return hIcon;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1011,10 +1179,32 @@ HICON16 WINAPI ExtractIcon16( HINSTANCE16 hInstance, LPCSTR lpszExeFileName,
|
||||||
* ExtractIcon32A (SHELL32.133)
|
* ExtractIcon32A (SHELL32.133)
|
||||||
*/
|
*/
|
||||||
HICON32 WINAPI ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
|
HICON32 WINAPI ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
|
||||||
UINT32 nIconIndex )
|
UINT32 nIconIndex )
|
||||||
{
|
{
|
||||||
/* FIXME */
|
HGLOBAL16 handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
|
||||||
return ExtractIcon16( hInstance, lpszExeFileName, nIconIndex );
|
|
||||||
|
if( handle )
|
||||||
|
{
|
||||||
|
HICON16* ptr = (HICON16*)GlobalLock16(handle);
|
||||||
|
HICON16 hIcon = *ptr;
|
||||||
|
|
||||||
|
GlobalFree16(handle);
|
||||||
|
return hIcon;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* ExtractIcon32W (SHELL32.180)
|
||||||
|
*/
|
||||||
|
HICON32 WINAPI ExtractIcon32W( HINSTANCE32 hInstance, LPCWSTR lpszExeFileName,
|
||||||
|
UINT32 nIconIndex )
|
||||||
|
{
|
||||||
|
LPSTR exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
|
||||||
|
HICON32 ret = ExtractIcon32A(hInstance,exefn,nIconIndex);
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(),0,exefn);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1024,37 +1214,37 @@ HICON32 WINAPI ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
|
||||||
* Return icon for given file (either from file itself or from associated
|
* Return icon for given file (either from file itself or from associated
|
||||||
* executable) and patch parameters if needed.
|
* executable) and patch parameters if needed.
|
||||||
*/
|
*/
|
||||||
HICON16 WINAPI ExtractAssociatedIcon(HINSTANCE16 hInst,LPSTR lpIconPath,
|
HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst,LPSTR lpIconPath,
|
||||||
LPWORD lpiIcon)
|
LPWORD lpiIcon)
|
||||||
{
|
{
|
||||||
HICON16 hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
|
HICON16 hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
|
||||||
|
|
||||||
if( hIcon < 2 )
|
if( hIcon < 2 )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( hIcon == 1 ) /* no icons found in given file */
|
if( hIcon == 1 ) /* no icons found in given file */
|
||||||
{
|
{
|
||||||
char tempPath[0x80];
|
char tempPath[0x80];
|
||||||
UINT16 uRet = FindExecutable16(lpIconPath,NULL,tempPath);
|
UINT16 uRet = FindExecutable16(lpIconPath,NULL,tempPath);
|
||||||
|
|
||||||
if( uRet > 32 && tempPath[0] )
|
if( uRet > 32 && tempPath[0] )
|
||||||
{
|
{
|
||||||
strcpy(lpIconPath,tempPath);
|
strcpy(lpIconPath,tempPath);
|
||||||
hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
|
hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
|
||||||
|
|
||||||
if( hIcon > 2 ) return hIcon;
|
if( hIcon > 2 ) return hIcon;
|
||||||
}
|
}
|
||||||
else hIcon = 0;
|
else hIcon = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( hIcon == 1 )
|
|
||||||
*lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
|
|
||||||
else
|
|
||||||
*lpiIcon = 6; /* generic icon - found nothing */
|
|
||||||
|
|
||||||
GetModuleFileName16(hInst, lpIconPath, 0x80);
|
if( hIcon == 1 )
|
||||||
|
*lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
|
||||||
|
else
|
||||||
|
*lpiIcon = 6; /* generic icon - found nothing */
|
||||||
|
|
||||||
|
GetModuleFileName16(hInst, lpIconPath, 0x80);
|
||||||
hIcon = LoadIcon16( hInst, MAKEINTRESOURCE(*lpiIcon));
|
hIcon = LoadIcon16( hInst, MAKEINTRESOURCE(*lpiIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
return hIcon;
|
return hIcon;
|
||||||
}
|
}
|
||||||
|
@ -1066,30 +1256,30 @@ HICON16 WINAPI ExtractAssociatedIcon(HINSTANCE16 hInst,LPSTR lpIconPath,
|
||||||
*/
|
*/
|
||||||
LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
|
LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
|
||||||
{
|
{
|
||||||
UINT16 l = strlen(entry);
|
UINT16 l = strlen(entry);
|
||||||
for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
|
for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
|
||||||
{
|
{
|
||||||
if( lstrncmpi32A(lpEnv, entry, l) ) continue;
|
if( lstrncmpi32A(lpEnv, entry, l) ) continue;
|
||||||
|
|
||||||
if( !*(lpEnv+l) )
|
if( !*(lpEnv+l) )
|
||||||
return (lpEnv + l); /* empty entry */
|
return (lpEnv + l); /* empty entry */
|
||||||
else if ( *(lpEnv+l)== '=' )
|
else if ( *(lpEnv+l)== '=' )
|
||||||
return (lpEnv + l + 1);
|
return (lpEnv + l + 1);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEGPTR WINAPI FindEnvironmentString(LPSTR str)
|
SEGPTR WINAPI FindEnvironmentString(LPSTR str)
|
||||||
{
|
{
|
||||||
SEGPTR spEnv = GetDOSEnvironment();
|
SEGPTR spEnv = GetDOSEnvironment();
|
||||||
LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(spEnv);
|
LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(spEnv);
|
||||||
|
|
||||||
LPSTR lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL;
|
|
||||||
|
|
||||||
if( lpString ) /* offset should be small enough */
|
LPSTR lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL;
|
||||||
return spEnv + (lpString - lpEnv);
|
|
||||||
|
|
||||||
return (SEGPTR)NULL;
|
if( lpString ) /* offset should be small enough */
|
||||||
|
return spEnv + (lpString - lpEnv);
|
||||||
|
|
||||||
|
return (SEGPTR)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -1249,6 +1439,30 @@ DWORD WINAPI SHGetFileInfo32A(LPCSTR path,DWORD dwFileAttributes,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHAppBarMessage32 [SHELL32.207]
|
||||||
|
*/
|
||||||
|
UINT32 WINAPI SHAppBarMessage32(DWORD msg, PAPPBARDATA data)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"SHAppBarMessage32(0x%08lx,%p)\n", msg, data);
|
||||||
|
#if 0
|
||||||
|
switch (msg) {
|
||||||
|
case ABM_ACTIVATE:
|
||||||
|
case ABM_GETAUTOHIDEBAR:
|
||||||
|
case ABM_GETSTATE:
|
||||||
|
case ABM_GETTASKBARPOS:
|
||||||
|
case ABM_NEW:
|
||||||
|
case ABM_QUERYPOS:
|
||||||
|
case ABM_REMOVE:
|
||||||
|
case ABM_SETAUTOHIDEBAR:
|
||||||
|
case ABM_SETPOS:
|
||||||
|
case ABM_WINDOWPOSCHANGED:
|
||||||
|
;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* CommandLineToArgvW [SHELL32.7]
|
* CommandLineToArgvW [SHELL32.7]
|
||||||
*/
|
*/
|
||||||
|
@ -1329,9 +1543,7 @@ void WINAPI FreeIconList( DWORD dw )
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This is the wrong place, but where is the right one? */
|
/* This is the wrong place, but where is the right one? */
|
||||||
typedef UINT32 REFCLSID32;
|
#if 0
|
||||||
typedef UINT32 REFIID32;
|
|
||||||
typedef UINT32 HRESULT32;
|
|
||||||
#define E_OUTOFMEMORY 0x8007000EL
|
#define E_OUTOFMEMORY 0x8007000EL
|
||||||
|
|
||||||
HRESULT32 WINAPI SHELL32_DllGetClassObject (REFCLSID32 clsid,
|
HRESULT32 WINAPI SHELL32_DllGetClassObject (REFCLSID32 clsid,
|
||||||
|
@ -1346,3 +1558,9 @@ HRESULT32 WINAPI SHELL32_DllGetClassObject (REFCLSID32 clsid,
|
||||||
|
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *shellfolder) {
|
||||||
|
*shellfolder = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,525 @@
|
||||||
|
/*
|
||||||
|
* Shell Ordinal Functions
|
||||||
|
*
|
||||||
|
* These are completely undocumented. The meaning of the functions changes
|
||||||
|
* between different OS versions (NT uses Unicode strings, 95 uses ASCII
|
||||||
|
* strings, etc. etc.)
|
||||||
|
*
|
||||||
|
* They are just here so that explorer.exe and iexplore.exe can be tested.
|
||||||
|
*
|
||||||
|
* Copyright 1997 Marcus Meissner
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include "windows.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "shell.h"
|
||||||
|
#include "heap.h"
|
||||||
|
#include "module.h"
|
||||||
|
#include "neexe.h"
|
||||||
|
#include "resource.h"
|
||||||
|
#include "dlgs.h"
|
||||||
|
#include "win.h"
|
||||||
|
#include "graphics.h"
|
||||||
|
#include "cursoricon.h"
|
||||||
|
#include "interfaces.h"
|
||||||
|
#include "shlobj.h"
|
||||||
|
#include "stddebug.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "winreg.h"
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_32 [SHELL32.32]
|
||||||
|
* append \ if there is none
|
||||||
|
*/
|
||||||
|
LPSTR WINAPI SHELL32_32(LPSTR path) {
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = lstrlen32A(path);
|
||||||
|
if (len && path[len-1]!='\\') {
|
||||||
|
path[len+0]='\\';
|
||||||
|
path[len+1]='\0';
|
||||||
|
return path+len+1;
|
||||||
|
} else
|
||||||
|
return path+len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_34 [SHELL32.34]
|
||||||
|
* basename(char *fn);
|
||||||
|
*/
|
||||||
|
LPSTR WINAPI SHELL32_34(LPSTR fn) {
|
||||||
|
LPSTR basefn;
|
||||||
|
|
||||||
|
basefn = fn;
|
||||||
|
while (fn[0]) {
|
||||||
|
if (((fn[0]=='\\') || (fn[0]==':')) && fn[1] && fn[1]!='\\')
|
||||||
|
basefn = fn+1;
|
||||||
|
fn++;
|
||||||
|
}
|
||||||
|
return basefn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_35 [SHELL32.35]
|
||||||
|
* bool getpath(char *pathname); truncates passed argument to a valid path
|
||||||
|
* returns if the string was modified or not.
|
||||||
|
* "\foo\xx\foo"-> "\foo\xx"
|
||||||
|
* "\" -> "\"
|
||||||
|
* "a:\foo" -> "a:\"
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_35(LPSTR fn) {
|
||||||
|
LPSTR x,cutplace;
|
||||||
|
|
||||||
|
if (!fn[0])
|
||||||
|
return 0;
|
||||||
|
x=fn;
|
||||||
|
cutplace = fn;
|
||||||
|
while (*x) {
|
||||||
|
if (*x=='\\') {
|
||||||
|
cutplace=x++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (*x==':') {
|
||||||
|
x++;
|
||||||
|
if (*x=='\\')
|
||||||
|
cutplace=++x;
|
||||||
|
continue; /* already x++ed */
|
||||||
|
}
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
if (!*cutplace)
|
||||||
|
return 0;
|
||||||
|
if (cutplace==fn) {
|
||||||
|
if (fn[0]=='\\') {
|
||||||
|
if (!fn[1])
|
||||||
|
return 0;
|
||||||
|
fn[0]='\0';
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*cutplace='\0';
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_37 [SHELL32.37]
|
||||||
|
* concat_paths(char*target,const char*add);
|
||||||
|
* concats "target\\add" and writes them to target
|
||||||
|
*/
|
||||||
|
LPSTR WINAPI SHELL32_37(LPSTR target,LPSTR x1,LPSTR x2) {
|
||||||
|
char buf[260];
|
||||||
|
|
||||||
|
if (!x2 || !x2[0]) {
|
||||||
|
lstrcpy32A(target,x1);
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
lstrcpy32A(buf,x1);
|
||||||
|
SHELL32_32(buf); /* append \ if not there */
|
||||||
|
lstrcat32A(buf,x2);
|
||||||
|
lstrcpy32A(target,buf);
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_36 [SHELL32.36]
|
||||||
|
* concat_paths(char*target,const char*add);
|
||||||
|
* concats "target\\add" and writes them to target
|
||||||
|
*/
|
||||||
|
LPSTR WINAPI SHELL32_36(LPSTR x1,LPSTR x2) {
|
||||||
|
while (x2[0]=='\\') x2++;
|
||||||
|
return SHELL32_37(x1,x1,x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_52 [SHELL32.52]
|
||||||
|
* look for next arg in string. handle "quoted" strings
|
||||||
|
* returns pointer to argument *AFTER* the space. Or to the \0.
|
||||||
|
*/
|
||||||
|
LPSTR WINAPI SHELL32_52(LPSTR cmdline) {
|
||||||
|
BOOL32 qflag = FALSE;
|
||||||
|
|
||||||
|
while (*cmdline) {
|
||||||
|
if ((*cmdline==' ') && !qflag)
|
||||||
|
return cmdline+1;
|
||||||
|
if (*cmdline=='"')
|
||||||
|
qflag=!qflag;
|
||||||
|
cmdline++;
|
||||||
|
}
|
||||||
|
return cmdline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_45 [SHELL32.45]
|
||||||
|
* file_exists(char *fn);
|
||||||
|
*/
|
||||||
|
BOOL32 WINAPI SHELL32_45(LPSTR fn) {
|
||||||
|
if (GetFileAttributes32A(fn)==-1)
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_175 [SHELL32.175]
|
||||||
|
* unknown
|
||||||
|
*/
|
||||||
|
void WINAPI SHELL32_175(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
|
||||||
|
fprintf(stdnimp,"SHELL32_175(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub\n",
|
||||||
|
x1,x2,x3,x4
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_181 [SHELL32.181]
|
||||||
|
* unknown
|
||||||
|
*/
|
||||||
|
void WINAPI SHELL32_181(DWORD x,DWORD y) {
|
||||||
|
fprintf(stderr,"SHELL32_181(0x%08lx,0x%08lx)\n",x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_119 [SHELL32.119]
|
||||||
|
* unknown
|
||||||
|
*/
|
||||||
|
void WINAPI SHELL32_119(LPVOID x) {
|
||||||
|
fprintf(stderr,"SHELL32_119(%p),stub\n",x);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_75 [SHELL32.75]
|
||||||
|
* unknown
|
||||||
|
*/
|
||||||
|
BOOL32 WINAPI SHELL32_75(LPDWORD x,LPDWORD y) {
|
||||||
|
fprintf(stderr,"SHELL32_75(%p,%p),stub\n",x,y);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD WINAPI
|
||||||
|
SHELL32_DllGetClassObject(REFCLSID *clsid,REFIID *iid,LPVOID *x) {
|
||||||
|
char xclsid[50],xiid[50];
|
||||||
|
|
||||||
|
StringFromCLSID((LPCLSID)clsid,xclsid);
|
||||||
|
StringFromCLSID((LPCLSID)iid,xiid);
|
||||||
|
fprintf(stderr,"SHELL32_DllGetClassObject(%s,%s,%p), STUB\n",xclsid,xiid,x);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static FARPROC32 _find_moduleproc(LPSTR dllname,HMODULE32 *xhmod,LPSTR name) {
|
||||||
|
HMODULE32 hmod;
|
||||||
|
FARPROC32 dllunload,nameproc;
|
||||||
|
|
||||||
|
if (xhmod) *xhmod = 0;
|
||||||
|
if (!lstrcmpi32A(SHELL32_34(dllname),"shell32.dll"))
|
||||||
|
return (FARPROC32)SHELL32_DllGetClassObject;
|
||||||
|
|
||||||
|
hmod = LoadLibraryEx32A(dllname,0,LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||||
|
if (!hmod)
|
||||||
|
return NULL;
|
||||||
|
dllunload = GetProcAddress32(hmod,"DllCanUnloadNow");
|
||||||
|
if (!dllunload)
|
||||||
|
if (xhmod) *xhmod = hmod;
|
||||||
|
nameproc = GetProcAddress32(hmod,name);
|
||||||
|
if (!nameproc) {
|
||||||
|
FreeLibrary32(hmod);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
/* register unloadable dll with unloadproc ... */
|
||||||
|
return nameproc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD _get_instance(REFCLSID clsid,LPSTR dllname,
|
||||||
|
LPVOID unknownouter,REFIID refiid,LPVOID inst
|
||||||
|
) {
|
||||||
|
DWORD WINAPI (*dllgetclassob)(REFCLSID,REFIID,LPVOID);
|
||||||
|
DWORD hres;
|
||||||
|
LPCLASSFACTORY classfac;
|
||||||
|
|
||||||
|
dllgetclassob = (DWORD(*)(REFCLSID,REFIID,LPVOID))_find_moduleproc(dllname,NULL,"DllGetClassObject");
|
||||||
|
if (!dllgetclassob)
|
||||||
|
return 0x80070000|GetLastError();
|
||||||
|
|
||||||
|
hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,&classfac);
|
||||||
|
if (hres<0)
|
||||||
|
return hres;
|
||||||
|
|
||||||
|
classfac->lpvtbl->fnCreateInstance(classfac,unknownouter,refiid,inst);
|
||||||
|
classfac->lpvtbl->fnRelease(classfac);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_102 [SHELL32.102]
|
||||||
|
* unknown
|
||||||
|
*/
|
||||||
|
LRESULT WINAPI SHELL32_102(
|
||||||
|
LPSTR aclsid,CLSID *clsid,LPUNKNOWN unknownouter,REFIID refiid,LPVOID inst
|
||||||
|
) {
|
||||||
|
char buffer[256],xclsid[48],xiid[48],path[260],tmodel[100];
|
||||||
|
HKEY inprockey;
|
||||||
|
DWORD pathlen,type,tmodellen;
|
||||||
|
DWORD hres;
|
||||||
|
|
||||||
|
StringFromCLSID(refiid,xiid);
|
||||||
|
|
||||||
|
if (clsid)
|
||||||
|
StringFromCLSID(clsid,xclsid);
|
||||||
|
else {
|
||||||
|
if (!aclsid)
|
||||||
|
return 0x80040154;
|
||||||
|
strcpy(xclsid,aclsid);
|
||||||
|
}
|
||||||
|
fprintf(stderr,"SHELL32_102(%p,%s,%p,%s,%p)\n",
|
||||||
|
aclsid,xclsid,unknownouter,xiid,inst
|
||||||
|
);
|
||||||
|
|
||||||
|
sprintf(buffer,"CLSID\\%s\\InProcServer32",xclsid);
|
||||||
|
if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,buffer,0,0x02000000,&inprockey))
|
||||||
|
return _get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||||
|
pathlen=sizeof(path);
|
||||||
|
if (RegQueryValue32A(inprockey,NULL,path,&pathlen)) {
|
||||||
|
RegCloseKey(inprockey);
|
||||||
|
return _get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||||
|
}
|
||||||
|
fprintf(stderr," -> server dll is %s\n",path);
|
||||||
|
tmodellen=sizeof(tmodel);
|
||||||
|
type=REG_SZ;
|
||||||
|
if (RegQueryValueEx32A(inprockey,"ThreadingModel",NULL,&type,tmodel,&tmodellen)) {
|
||||||
|
RegCloseKey(inprockey);
|
||||||
|
return _get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||||
|
}
|
||||||
|
fprintf(stderr," -> threading model is %s\n",tmodel);
|
||||||
|
hres=_get_instance(clsid,path,unknownouter,refiid,inst);
|
||||||
|
if (hres<0)
|
||||||
|
hres=_get_instance(clsid,"shell32.dll",unknownouter,refiid,inst);
|
||||||
|
RegCloseKey(inprockey);
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_183 [SHELL32.183]
|
||||||
|
* Format and output errormessage.
|
||||||
|
*/
|
||||||
|
void __cdecl SHELL32_183(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
|
||||||
|
char buf[100],buf2[100],*buf3;
|
||||||
|
LPVOID args = &arglist;
|
||||||
|
|
||||||
|
if (!LoadString32A(hmod,x,buf,100))
|
||||||
|
strcpy(buf,"Desktop");
|
||||||
|
LoadString32A(hmod,id,buf2,100);
|
||||||
|
/* FIXME: the varargs handling doesn't. */
|
||||||
|
FormatMessage32A(0x500,buf2,0,0,&buf3,256,&args);
|
||||||
|
|
||||||
|
fprintf(stderr,"SHELL32_183(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p),stub!\n",
|
||||||
|
(DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
|
||||||
|
);
|
||||||
|
MessageBox32A(hwnd,buf3,buf,id|0x10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_71 [SHELL32.71]
|
||||||
|
* returns internal shell values in the passed pointers
|
||||||
|
*/
|
||||||
|
BOOL32 WINAPI SHELL32_71(LPDWORD x,LPDWORD y) {
|
||||||
|
|
||||||
|
fprintf(stderr,"SHELL32_71(%p,%p),stub!\n",x,y);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_72 [SHELL32.72]
|
||||||
|
* dunno. something with icons
|
||||||
|
*/
|
||||||
|
void WINAPI SHELL32_72(LPSTR x,DWORD y,DWORD z) {
|
||||||
|
fprintf(stderr,"SHELL32_72(%s,%08lx,%08lx),stub!\n",x,y,z);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_100 [SHELL32.100]
|
||||||
|
* walks through policy table, queries <app> key, <type> value, returns
|
||||||
|
* queried (DWORD) value.
|
||||||
|
* {0x00001,Explorer,NoRun}
|
||||||
|
* {0x00002,Explorer,NoClose}
|
||||||
|
* {0x00004,Explorer,NoSaveSettings}
|
||||||
|
* {0x00008,Explorer,NoFileMenu}
|
||||||
|
* {0x00010,Explorer,NoSetFolders}
|
||||||
|
* {0x00020,Explorer,NoSetTaskbar}
|
||||||
|
* {0x00040,Explorer,NoDesktop}
|
||||||
|
* {0x00080,Explorer,NoFind}
|
||||||
|
* {0x00100,Explorer,NoDrives}
|
||||||
|
* {0x00200,Explorer,NoDriveAutoRun}
|
||||||
|
* {0x00400,Explorer,NoDriveTypeAutoRun}
|
||||||
|
* {0x00800,Explorer,NoNetHood}
|
||||||
|
* {0x01000,Explorer,NoStartBanner}
|
||||||
|
* {0x02000,Explorer,RestrictRun}
|
||||||
|
* {0x04000,Explorer,NoPrinterTabs}
|
||||||
|
* {0x08000,Explorer,NoDeletePrinter}
|
||||||
|
* {0x10000,Explorer,NoAddPrinter}
|
||||||
|
* {0x20000,Explorer,NoStartMenuSubFolders}
|
||||||
|
* {0x40000,Explorer,MyDocsOnNet}
|
||||||
|
* {0x80000,WinOldApp,NoRealMode}
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_100(DWORD pol) {
|
||||||
|
HKEY xhkey;
|
||||||
|
|
||||||
|
fprintf(stderr,"SHELL32_100(%08lx),stub!\n",pol);
|
||||||
|
if (RegOpenKey32A(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey))
|
||||||
|
return 0;
|
||||||
|
/* FIXME: do nothing for now, just return 0 (== "allowed") */
|
||||||
|
RegCloseKey(xhkey);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD WINAPI SHELL32_77(DWORD x,DWORD y,DWORD z) {
|
||||||
|
fprintf(stderr,"SHELL32_77(%08lx,%08lx,%08lx),stub!\n",x,y,z);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_79 [SHELL32.79]
|
||||||
|
* create_directory_and_notify(...)
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_79(LPCSTR dir,LPVOID xvoid) {
|
||||||
|
fprintf(stderr,"mkdir %s,%p\n",dir,xvoid);
|
||||||
|
if (!CreateDirectory32A(dir,xvoid))
|
||||||
|
return FALSE;
|
||||||
|
/* SHChangeNotify(8,1,dir,0); */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_165 [SHELL32.165]
|
||||||
|
* create_path_and_notify(...)
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_165(DWORD x,LPCSTR path) {
|
||||||
|
if (SHELL32_79(path,(LPVOID)x))
|
||||||
|
return 0;
|
||||||
|
fprintf(stderr,"SHELL32_165(%08lx,%s),stub!\n",x,path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_29 [SHELL32.29]
|
||||||
|
* is_rootdir(const char*path)
|
||||||
|
*/
|
||||||
|
BOOL32 WINAPI SHELL32_29(LPCSTR x) {
|
||||||
|
if (!lstrcmp32A(x+1,":\\")) /* "X:\" */
|
||||||
|
return 1;
|
||||||
|
if (!lstrcmp32A(x,"\\")) /* "\" */
|
||||||
|
return 1;
|
||||||
|
if (x[0]=='\\' && x[1]=='\\') { /* UNC "\\<xx>\" */
|
||||||
|
int foundbackslash = 0;
|
||||||
|
x=x+2;
|
||||||
|
while (*x) {
|
||||||
|
if (*x++=='\\')
|
||||||
|
foundbackslash++;
|
||||||
|
}
|
||||||
|
if (foundbackslash<=1) /* max 1 \ more ... */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_152 [SHELL32.152]
|
||||||
|
* itemlist_length
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_152(LPITEMIDLIST iil) {
|
||||||
|
LPSHITEMID si;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
|
si = &(iil->mkid);
|
||||||
|
len = 2;
|
||||||
|
while (si->cb) {
|
||||||
|
len += si->cb;
|
||||||
|
si = (LPSHITEMID)(((char*)si)+si->cb);
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_196 [SHELL32.196]
|
||||||
|
* void *task_alloc(DWORD len), uses SHMalloc allocator
|
||||||
|
*/
|
||||||
|
LPVOID WINAPI SHELL32_196(DWORD len) {
|
||||||
|
return (LPVOID)LocalAlloc32(len,LMEM_ZEROINIT); /* FIXME */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_18 [SHELL32.18]
|
||||||
|
* copy_itemidlist()
|
||||||
|
*/
|
||||||
|
LPITEMIDLIST WINAPI SHELL32_18(LPITEMIDLIST iil) {
|
||||||
|
DWORD len;
|
||||||
|
LPITEMIDLIST newiil;
|
||||||
|
|
||||||
|
len = SHELL32_152(iil);
|
||||||
|
newiil = (LPITEMIDLIST)SHELL32_196(len);
|
||||||
|
memcpy(newiil,iil,len);
|
||||||
|
return newiil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_25 [SHELL32.25]
|
||||||
|
* merge_itemidlist()
|
||||||
|
*/
|
||||||
|
LPITEMIDLIST WINAPI SHELL32_25(LPITEMIDLIST iil1,LPITEMIDLIST iil2) {
|
||||||
|
DWORD len1,len2;
|
||||||
|
LPITEMIDLIST newiil;
|
||||||
|
|
||||||
|
len1 = SHELL32_152(iil1)-2;
|
||||||
|
len2 = SHELL32_152(iil2);
|
||||||
|
newiil = SHELL32_196(len1+len2);
|
||||||
|
memcpy(newiil,iil1,len1);
|
||||||
|
memcpy(((char*)newiil)+len1,iil2,len2);
|
||||||
|
return newiil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_16 [SHELL32.16]
|
||||||
|
* find_lastitem_in_itemidlist()
|
||||||
|
*/
|
||||||
|
LPSHITEMID WINAPI SHELL32_16(LPITEMIDLIST iil) {
|
||||||
|
LPSHITEMID lastsii,sii;
|
||||||
|
|
||||||
|
if (!iil)
|
||||||
|
return NULL;
|
||||||
|
sii = &(iil->mkid);
|
||||||
|
lastsii = sii;
|
||||||
|
while (sii->cb) {
|
||||||
|
lastsii = sii;
|
||||||
|
sii = (LPSHITEMID)(((char*)sii)+sii->cb);
|
||||||
|
}
|
||||||
|
return lastsii;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_195 [SHELL32.195]
|
||||||
|
* free_ptr() - frees memory using IMalloc
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_195(LPVOID x) {
|
||||||
|
return LocalFree32((HANDLE32)x);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_155 [SHELL32.155]
|
||||||
|
* free_check_ptr - frees memory (if not NULL) allocated by SHMalloc allocator
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_155(LPVOID x) {
|
||||||
|
if (!x)
|
||||||
|
return 0;
|
||||||
|
return SHELL32_195(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* SHELL32_62 [SHELL32.62]
|
||||||
|
*/
|
||||||
|
DWORD WINAPI SHELL32_62(DWORD x,DWORD y,DWORD z,DWORD a) {
|
||||||
|
fprintf(stderr,"SHELL32_62(%08lx,%08lx,%08lx,%08lx),stub!\n",x,y,z,a);
|
||||||
|
return 0xffffffff;
|
||||||
|
}
|
|
@ -117,8 +117,14 @@ static VERSION VERSION_GetVersion(void)
|
||||||
if (!pCurrentProcess) /* at startuptime probably */
|
if (!pCurrentProcess) /* at startuptime probably */
|
||||||
return defaultVersion;
|
return defaultVersion;
|
||||||
if (!pCurrentProcess->exe_modref)
|
if (!pCurrentProcess->exe_modref)
|
||||||
|
{
|
||||||
|
/* HACK: if we have loaded a PE image into this address space,
|
||||||
|
* we are probably using thunks, so Win95 is our best bet
|
||||||
|
*/
|
||||||
|
if (pCurrentProcess->modref_list) return WIN95;
|
||||||
return WIN31; /* FIXME: hmm, look at DDB.version ? */
|
return WIN31; /* FIXME: hmm, look at DDB.version ? */
|
||||||
peheader = pCurrentProcess->exe_modref->pe_module->pe_header;
|
}
|
||||||
|
peheader = PE_HEADER(pCurrentProcess->exe_modref->module);
|
||||||
if (peheader->OptionalHeader.MajorSubsystemVersion == 4)
|
if (peheader->OptionalHeader.MajorSubsystemVersion == 4)
|
||||||
/* FIXME: NT4 has the same majorversion; add a check here for it. */
|
/* FIXME: NT4 has the same majorversion; add a check here for it. */
|
||||||
return WIN95;
|
return WIN95;
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* W32SCOMB
|
||||||
|
* DLL for Win32s
|
||||||
|
*
|
||||||
|
* Copyright (c) 1997 Andreas Mohr
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "windows.h"
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Get16DLLAddress (KERNEL32)
|
||||||
|
*
|
||||||
|
* rough guesswork, but seems to work
|
||||||
|
*/
|
||||||
|
FARPROC16 Get16DLLAddress(HMODULE32 handle, LPSTR name) {
|
||||||
|
if (!handle) handle=GetModuleHandle16("WIN32S16");
|
||||||
|
return (FARPROC16)WIN32_GetProcAddress16(handle, name);
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* W32SKRNL
|
||||||
|
* DLL for Win32s
|
||||||
|
*
|
||||||
|
* Copyright (c) 1997 Andreas Mohr
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windows.h"
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
LPSTR WINAPI GetWin32sDirectory()
|
||||||
|
{
|
||||||
|
static char *sysdir;
|
||||||
|
LPSTR text;
|
||||||
|
|
||||||
|
sysdir = getenv("winsysdir");
|
||||||
|
if (!sysdir) return NULL;
|
||||||
|
strcat(sysdir, "\\WIN32S");
|
||||||
|
text = HeapAlloc(GetProcessHeap(), 0, strlen(sysdir)+1);
|
||||||
|
strcpy(text, sysdir);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME */
|
||||||
|
SEGPTR WINAPI _GetThunkBuff()
|
||||||
|
{
|
||||||
|
return (SEGPTR)NULL;
|
||||||
|
}
|
|
@ -149,6 +149,7 @@ static INT32 WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res )
|
||||||
}
|
}
|
||||||
if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }
|
if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }
|
||||||
else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }
|
else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }
|
||||||
|
else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; }
|
||||||
switch((CHAR)*p)
|
switch((CHAR)*p)
|
||||||
{
|
{
|
||||||
case 'c':
|
case 'c':
|
||||||
|
@ -162,10 +163,10 @@ static INT32 WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res )
|
||||||
res->type = WPR_SIGNED;
|
res->type = WPR_SIGNED;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
res->type = (res->flags & WPRINTF_SHORT) ? WPR_STRING : WPR_WSTRING;
|
res->type = ((res->flags & WPRINTF_SHORT) && !(res->flags & WPRINTF_WIDE)) ? WPR_STRING : WPR_WSTRING;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
res->type = (res->flags & WPRINTF_LONG) ? WPR_WSTRING : WPR_STRING;
|
res->type = (res->flags & (WPRINTF_LONG|WPRINTF_WIDE)) ? WPR_WSTRING : WPR_STRING;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
res->type = WPR_UNSIGNED;
|
res->type = WPR_UNSIGNED;
|
||||||
|
|
|
@ -114,7 +114,7 @@ int main( int argc, char *argv[] )
|
||||||
|
|
||||||
if (Options.debug) DEBUG_AddModuleBreakpoints();
|
if (Options.debug) DEBUG_AddModuleBreakpoints();
|
||||||
|
|
||||||
Yield(); /* Start the first task */
|
Yield16(); /* Start the first task */
|
||||||
fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
|
fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ C_SRCS = \
|
||||||
int26.c \
|
int26.c \
|
||||||
int2a.c \
|
int2a.c \
|
||||||
int2f.c \
|
int2f.c \
|
||||||
|
int3d.c \
|
||||||
int4b.c \
|
int4b.c \
|
||||||
int5c.c \
|
int5c.c \
|
||||||
interrupts.c \
|
interrupts.c \
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* DOS interrupt 3d handler.
|
||||||
|
* Copyright 1997 Len White
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "msdos.h"
|
||||||
|
#include "miscemu.h"
|
||||||
|
#include "stddebug.h"
|
||||||
|
/* #define DEBUG_INT */
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* INT_Int3dHandler
|
||||||
|
*
|
||||||
|
* Handler for int 3d (FLOATING POINT EMULATION - STANDALONE FWAIT).
|
||||||
|
*/
|
||||||
|
void WINAPI INT_Int3dHandler(CONTEXT *context)
|
||||||
|
{
|
||||||
|
switch(AH_reg(context))
|
||||||
|
{
|
||||||
|
case 0x00:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x02:
|
||||||
|
case 0x03:
|
||||||
|
case 0x04:
|
||||||
|
case 0x05:
|
||||||
|
case 0xb:
|
||||||
|
AH_reg(context) = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
INT_BARF( context, 0x3d );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1258,9 +1258,10 @@ void WINAPI GetClipCursor32( RECT32 *rect )
|
||||||
*
|
*
|
||||||
* FIXME: exact parameter sizes
|
* FIXME: exact parameter sizes
|
||||||
*/
|
*/
|
||||||
UINT16 WINAPI LookupIconIdFromDirectoryEx16( CURSORICONDIR *dir, BOOL16 bIcon,
|
INT16 WINAPI LookupIconIdFromDirectoryEx16( LPBYTE xdir, BOOL16 bIcon,
|
||||||
INT16 width, INT16 height, UINT16 cFlag )
|
INT16 width, INT16 height, UINT16 cFlag )
|
||||||
{
|
{
|
||||||
|
CURSORICONDIR *dir = (CURSORICONDIR*)xdir;
|
||||||
UINT16 retVal = 0;
|
UINT16 retVal = 0;
|
||||||
if( dir && !dir->idReserved && (dir->idType & 3) )
|
if( dir && !dir->idReserved && (dir->idType & 3) )
|
||||||
{
|
{
|
||||||
|
@ -1285,31 +1286,41 @@ UINT16 WINAPI LookupIconIdFromDirectoryEx16( CURSORICONDIR *dir, BOOL16 bIcon,
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* LookupIconIdFromDirectoryEx32 (USER32.379)
|
* LookupIconIdFromDirectoryEx32 (USER32.379)
|
||||||
*/
|
*/
|
||||||
INT32 WINAPI LookupIconIdFromDirectoryEx32( CURSORICONDIR *dir, BOOL32 bIcon,
|
INT32 WINAPI LookupIconIdFromDirectoryEx32( LPBYTE dir, BOOL32 bIcon,
|
||||||
INT32 width, INT32 height, UINT32 cFlag )
|
INT32 width, INT32 height, UINT32 cFlag )
|
||||||
{
|
{
|
||||||
return LookupIconIdFromDirectoryEx16( dir, bIcon, width, height, cFlag );
|
return LookupIconIdFromDirectoryEx16( dir, bIcon, width, height, cFlag );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* LookupIconIdFromDirectory (USER32.378)
|
* LookupIconIdFromDirectory (USER.???)
|
||||||
*/
|
*/
|
||||||
INT32 WINAPI LookupIconIdFromDirectory( CURSORICONDIR *dir, BOOL32 bIcon )
|
INT16 WINAPI LookupIconIdFromDirectory16( LPBYTE dir, BOOL16 bIcon )
|
||||||
{
|
{
|
||||||
return LookupIconIdFromDirectoryEx16( dir, bIcon,
|
return LookupIconIdFromDirectoryEx16( dir, bIcon,
|
||||||
bIcon ? SYSMETRICS_CXICON : SYSMETRICS_CXCURSOR,
|
bIcon ? SYSMETRICS_CXICON : SYSMETRICS_CXCURSOR,
|
||||||
bIcon ? SYSMETRICS_CYICON : SYSMETRICS_CYCURSOR, bIcon ? 0 : LR_MONOCHROME );
|
bIcon ? SYSMETRICS_CYICON : SYSMETRICS_CYCURSOR, bIcon ? 0 : LR_MONOCHROME );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* LookupIconIdFromDirectory (USER32.378)
|
||||||
|
*/
|
||||||
|
INT32 WINAPI LookupIconIdFromDirectory32( LPBYTE dir, BOOL32 bIcon )
|
||||||
|
{
|
||||||
|
return LookupIconIdFromDirectoryEx32( dir, bIcon,
|
||||||
|
bIcon ? SYSMETRICS_CXICON : SYSMETRICS_CXCURSOR,
|
||||||
|
bIcon ? SYSMETRICS_CYICON : SYSMETRICS_CYCURSOR, bIcon ? 0 : LR_MONOCHROME );
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* GetIconID (USER.455)
|
* GetIconID (USER.455)
|
||||||
*/
|
*/
|
||||||
WORD WINAPI GetIconID( HGLOBAL16 hResource, DWORD resType )
|
WORD WINAPI GetIconID( HGLOBAL16 hResource, DWORD resType )
|
||||||
{
|
{
|
||||||
CURSORICONDIR *lpDir = (CURSORICONDIR *)GlobalLock16(hResource);
|
LPBYTE lpDir = (LPBYTE)GlobalLock16(hResource);
|
||||||
|
|
||||||
dprintf_cursor( stddeb, "GetIconID: hRes=%04x, entries=%i\n",
|
dprintf_cursor( stddeb, "GetIconID: hRes=%04x, entries=%i\n",
|
||||||
hResource, lpDir ? lpDir->idCount : 0);
|
hResource, lpDir ? ((CURSORICONDIR*)lpDir)->idCount : 0);
|
||||||
|
|
||||||
switch(resType)
|
switch(resType)
|
||||||
{
|
{
|
||||||
|
|
380
objects/dib.c
380
objects/dib.c
|
@ -27,7 +27,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
DC *dc;
|
DC *dc;
|
||||||
LPCVOID bits;
|
LPCVOID bits;
|
||||||
DWORD lines;
|
int lines;
|
||||||
DWORD infoWidth;
|
DWORD infoWidth;
|
||||||
WORD depth;
|
WORD depth;
|
||||||
WORD infoBpp;
|
WORD infoBpp;
|
||||||
|
@ -145,7 +145,7 @@ int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse )
|
||||||
* Return 1 for INFOHEADER, 0 for COREHEADER, -1 for error.
|
* Return 1 for INFOHEADER, 0 for COREHEADER, -1 for error.
|
||||||
*/
|
*/
|
||||||
static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
|
static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
|
||||||
DWORD *height, WORD *bpp )
|
int *height, WORD *bpp )
|
||||||
{
|
{
|
||||||
if (header->biSize == sizeof(BITMAPINFOHEADER))
|
if (header->biSize == sizeof(BITMAPINFOHEADER))
|
||||||
{
|
{
|
||||||
|
@ -235,50 +235,66 @@ static int *DIB_BuildColorMap( DC *dc, WORD coloruse, WORD depth,
|
||||||
return colorMapping;
|
return colorMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* DIB_SetImageBits_1_Line
|
||||||
|
*
|
||||||
|
* Handles a single line of 1 bit data.
|
||||||
|
*/
|
||||||
|
static void DIB_SetImageBits_1_Line(DWORD dstwidth, int *colors,
|
||||||
|
XImage *bmpImage, int h, const BYTE *bits)
|
||||||
|
{
|
||||||
|
BYTE pix;
|
||||||
|
DWORD i, x;
|
||||||
|
|
||||||
|
for (i = dstwidth/8, x = 0; (i > 0); i--)
|
||||||
|
{
|
||||||
|
pix = *bits++;
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[pix >> 7] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[(pix >> 6) & 1] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[(pix >> 5) & 1] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[(pix >> 4) & 1] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[(pix >> 3) & 1] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[(pix >> 2) & 1] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[(pix >> 1) & 1] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[pix & 1] );
|
||||||
|
}
|
||||||
|
pix = *bits;
|
||||||
|
switch(dstwidth & 7)
|
||||||
|
{
|
||||||
|
case 7: XPutPixel( bmpImage, x++, h, colors[pix >> 7] ); pix <<= 1;
|
||||||
|
case 6: XPutPixel( bmpImage, x++, h, colors[pix >> 7] ); pix <<= 1;
|
||||||
|
case 5: XPutPixel( bmpImage, x++, h, colors[pix >> 7] ); pix <<= 1;
|
||||||
|
case 4: XPutPixel( bmpImage, x++, h, colors[pix >> 7] ); pix <<= 1;
|
||||||
|
case 3: XPutPixel( bmpImage, x++, h, colors[pix >> 7] ); pix <<= 1;
|
||||||
|
case 2: XPutPixel( bmpImage, x++, h, colors[pix >> 7] ); pix <<= 1;
|
||||||
|
case 1: XPutPixel( bmpImage, x++, h, colors[pix >> 7] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DIB_SetImageBits_1
|
* DIB_SetImageBits_1
|
||||||
*
|
*
|
||||||
* SetDIBits for a 1-bit deep DIB.
|
* SetDIBits for a 1-bit deep DIB.
|
||||||
*/
|
*/
|
||||||
static void DIB_SetImageBits_1( DWORD lines, const BYTE *srcbits,
|
static void DIB_SetImageBits_1( int lines, const BYTE *srcbits,
|
||||||
DWORD srcwidth, DWORD dstwidth,
|
DWORD srcwidth, DWORD dstwidth,
|
||||||
int *colors, XImage *bmpImage )
|
int *colors, XImage *bmpImage )
|
||||||
{
|
{
|
||||||
DWORD i, x;
|
int h;
|
||||||
BYTE pix;
|
|
||||||
const BYTE *bits = srcbits;
|
|
||||||
|
|
||||||
/* 32 bit aligned */
|
/* 32 bit aligned */
|
||||||
DWORD linebytes = ((srcwidth + 31) & ~31) / 8;
|
DWORD linebytes = ((srcwidth + 31) & ~31) / 8;
|
||||||
|
|
||||||
while (lines--)
|
if (lines > 0) {
|
||||||
{
|
for (h = lines-1; h >=0; h--) {
|
||||||
for (i = dstwidth/8, x = 0; (i > 0); i--)
|
DIB_SetImageBits_1_Line(dstwidth, colors, bmpImage, h, srcbits);
|
||||||
{
|
srcbits += linebytes;
|
||||||
pix = *bits++;
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[pix >> 7] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[(pix >> 6) & 1] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[(pix >> 5) & 1] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[(pix >> 4) & 1] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[(pix >> 3) & 1] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[(pix >> 2) & 1] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[(pix >> 1) & 1] );
|
|
||||||
XPutPixel( bmpImage, x++, lines, colors[pix & 1] );
|
|
||||||
}
|
}
|
||||||
pix = *bits;
|
} else {
|
||||||
switch(dstwidth & 7)
|
for (h = 0; h < lines; h++) {
|
||||||
{
|
DIB_SetImageBits_1_Line(dstwidth, colors, bmpImage, h, srcbits);
|
||||||
case 7: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] ); pix <<= 1;
|
srcbits += linebytes;
|
||||||
case 6: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] ); pix <<= 1;
|
|
||||||
case 5: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] ); pix <<= 1;
|
|
||||||
case 4: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] ); pix <<= 1;
|
|
||||||
case 3: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] ); pix <<= 1;
|
|
||||||
case 2: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] ); pix <<= 1;
|
|
||||||
case 1: XPutPixel( bmpImage, x++, lines, colors[pix >> 7] );
|
|
||||||
}
|
}
|
||||||
srcbits += linebytes;
|
|
||||||
bits = srcbits;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,27 +304,39 @@ static void DIB_SetImageBits_1( DWORD lines, const BYTE *srcbits,
|
||||||
*
|
*
|
||||||
* SetDIBits for a 4-bit deep DIB.
|
* SetDIBits for a 4-bit deep DIB.
|
||||||
*/
|
*/
|
||||||
static void DIB_SetImageBits_4( DWORD lines, const BYTE *srcbits,
|
static void DIB_SetImageBits_4( int lines, const BYTE *srcbits,
|
||||||
DWORD srcwidth, DWORD dstwidth,
|
DWORD srcwidth, DWORD dstwidth,
|
||||||
int *colors, XImage *bmpImage )
|
int *colors, XImage *bmpImage )
|
||||||
{
|
{
|
||||||
DWORD i, x;
|
DWORD i, x;
|
||||||
|
int h;
|
||||||
const BYTE *bits = srcbits;
|
const BYTE *bits = srcbits;
|
||||||
|
|
||||||
/* 32 bit aligned */
|
/* 32 bit aligned */
|
||||||
DWORD linebytes = ((srcwidth+7)&~7)/2;
|
DWORD linebytes = ((srcwidth+7)&~7)/2;
|
||||||
|
|
||||||
while (lines--)
|
if (lines > 0) {
|
||||||
{
|
for (h = lines-1; h >= 0; h--) {
|
||||||
for (i = dstwidth/2, x = 0; i > 0; i--)
|
for (i = dstwidth/2, x = 0; i > 0; i--) {
|
||||||
{
|
BYTE pix = *bits++;
|
||||||
BYTE pix = *bits++;
|
XPutPixel( bmpImage, x++, h, colors[pix >> 4] );
|
||||||
XPutPixel( bmpImage, x++, lines, colors[pix >> 4] );
|
XPutPixel( bmpImage, x++, h, colors[pix & 0x0f] );
|
||||||
XPutPixel( bmpImage, x++, lines, colors[pix & 0x0f] );
|
}
|
||||||
|
if (dstwidth & 1) XPutPixel( bmpImage, x, h, colors[*bits >> 4] );
|
||||||
|
srcbits += linebytes;
|
||||||
|
bits = srcbits;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (h = 0; h < lines; h++) {
|
||||||
|
for (i = dstwidth/2, x = 0; i > 0; i--) {
|
||||||
|
BYTE pix = *bits++;
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[pix >> 4] );
|
||||||
|
XPutPixel( bmpImage, x++, h, colors[pix & 0x0f] );
|
||||||
|
}
|
||||||
|
if (dstwidth & 1) XPutPixel( bmpImage, x, h, colors[*bits >> 4] );
|
||||||
|
srcbits += linebytes;
|
||||||
|
bits = srcbits;
|
||||||
}
|
}
|
||||||
if (dstwidth & 1) XPutPixel( bmpImage, x, lines, colors[*bits >> 4] );
|
|
||||||
srcbits += linebytes;
|
|
||||||
bits = srcbits;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +352,7 @@ static void DIB_SetImageBits_4( DWORD lines, const BYTE *srcbits,
|
||||||
*
|
*
|
||||||
* SetDIBits for a 4-bit deep compressed DIB.
|
* SetDIBits for a 4-bit deep compressed DIB.
|
||||||
*/
|
*/
|
||||||
static void DIB_SetImageBits_RLE4( DWORD lines, const BYTE *bits, DWORD width,
|
static void DIB_SetImageBits_RLE4( int lines, const BYTE *bits, DWORD width,
|
||||||
DWORD dstwidth, int *colors, XImage *bmpImage )
|
DWORD dstwidth, int *colors, XImage *bmpImage )
|
||||||
{
|
{
|
||||||
int x = 0, c, length;
|
int x = 0, c, length;
|
||||||
|
@ -384,22 +412,32 @@ static void DIB_SetImageBits_RLE4( DWORD lines, const BYTE *bits, DWORD width,
|
||||||
*
|
*
|
||||||
* SetDIBits for an 8-bit deep DIB.
|
* SetDIBits for an 8-bit deep DIB.
|
||||||
*/
|
*/
|
||||||
static void DIB_SetImageBits_8( DWORD lines, const BYTE *srcbits,
|
static void DIB_SetImageBits_8( int lines, const BYTE *srcbits,
|
||||||
DWORD srcwidth, DWORD dstwidth,
|
DWORD srcwidth, DWORD dstwidth,
|
||||||
int *colors, XImage *bmpImage )
|
int *colors, XImage *bmpImage )
|
||||||
{
|
{
|
||||||
DWORD x;
|
DWORD x;
|
||||||
|
int h;
|
||||||
const BYTE *bits = srcbits;
|
const BYTE *bits = srcbits;
|
||||||
|
|
||||||
/* align to 32 bit */
|
/* align to 32 bit */
|
||||||
DWORD linebytes = (srcwidth + 3) & ~3;
|
DWORD linebytes = (srcwidth + 3) & ~3;
|
||||||
|
|
||||||
while (lines--)
|
if (lines > 0) {
|
||||||
{
|
for (h = lines - 1; h >= 0; h--) {
|
||||||
for (x = 0; x < dstwidth; x++)
|
for (x = 0; x < dstwidth; x++, bits++) {
|
||||||
XPutPixel( bmpImage, x, lines, colors[*bits++] );
|
XPutPixel( bmpImage, x, h, colors[*bits] );
|
||||||
srcbits += linebytes;
|
}
|
||||||
bits = srcbits;
|
bits = (srcbits += linebytes);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
lines = -lines;
|
||||||
|
for (h = 0; h < lines; h++) {
|
||||||
|
for (x = 0; x < dstwidth; x++, bits++) {
|
||||||
|
XPutPixel( bmpImage, x, h, colors[*bits] );
|
||||||
|
}
|
||||||
|
bits = (srcbits += linebytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +472,7 @@ enum Rle8_EscapeCodes
|
||||||
RleDelta = 2 /* Delta */
|
RleDelta = 2 /* Delta */
|
||||||
};
|
};
|
||||||
|
|
||||||
static void DIB_SetImageBits_RLE8( DWORD lines, const BYTE *bits, DWORD width,
|
static void DIB_SetImageBits_RLE8( int lines, const BYTE *bits, DWORD width,
|
||||||
DWORD dstwidth, int *colors, XImage *bmpImage )
|
DWORD dstwidth, int *colors, XImage *bmpImage )
|
||||||
{
|
{
|
||||||
int x; /* X-positon on each line. Increases. */
|
int x; /* X-positon on each line. Increases. */
|
||||||
|
@ -582,30 +620,124 @@ static void DIB_SetImageBits_RLE8( DWORD lines, const BYTE *bits, DWORD width,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* DIB_SetImageBits_16
|
||||||
|
*
|
||||||
|
* SetDIBits for a 16-bit deep DIB.
|
||||||
|
*/
|
||||||
|
static void DIB_SetImageBits_16( int lines, const BYTE *srcbits,
|
||||||
|
DWORD srcwidth, DWORD dstwidth,
|
||||||
|
DC *dc, XImage *bmpImage )
|
||||||
|
{
|
||||||
|
DWORD x;
|
||||||
|
LPWORD ptr;
|
||||||
|
WORD val;
|
||||||
|
int h;
|
||||||
|
BYTE r, g, b;
|
||||||
|
|
||||||
|
/* align to 32 bit */
|
||||||
|
DWORD linebytes = (srcwidth * 2 + 3) & ~3;
|
||||||
|
|
||||||
|
ptr = (LPWORD) srcbits;
|
||||||
|
if (lines > 0) {
|
||||||
|
for (h = lines - 1; h >= 0; h--) {
|
||||||
|
for (x = 0; x < dstwidth; x++, ptr++) {
|
||||||
|
val = *ptr;
|
||||||
|
r = (BYTE) ((val & 0x7c00) >> 7);
|
||||||
|
g = (BYTE) ((val & 0x03e0) >> 2);
|
||||||
|
b = (BYTE) ((val & 0x001f) << 3);
|
||||||
|
XPutPixel( bmpImage, x, h,
|
||||||
|
COLOR_ToPhysical(dc, RGB(r,g,b)) );
|
||||||
|
}
|
||||||
|
ptr = (LPWORD) (srcbits += linebytes);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
lines = -lines;
|
||||||
|
for (h = 0; h < lines; h++) {
|
||||||
|
for (x = 0; x < dstwidth; x++, ptr++) {
|
||||||
|
val = *ptr;
|
||||||
|
r = (BYTE) ((val & 0x7c00) >> 7);
|
||||||
|
g = (BYTE) ((val & 0x03e0) >> 2);
|
||||||
|
b = (BYTE) ((val & 0x001f) << 3);
|
||||||
|
XPutPixel( bmpImage, x, h,
|
||||||
|
COLOR_ToPhysical(dc, RGB(r,g,b)) );
|
||||||
|
}
|
||||||
|
ptr = (LPWORD) (srcbits += linebytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DIB_SetImageBits_24
|
* DIB_SetImageBits_24
|
||||||
*
|
*
|
||||||
* SetDIBits for a 24-bit deep DIB.
|
* SetDIBits for a 24-bit deep DIB.
|
||||||
*/
|
*/
|
||||||
static void DIB_SetImageBits_24( DWORD lines, const BYTE *srcbits,
|
static void DIB_SetImageBits_24( int lines, const BYTE *srcbits,
|
||||||
DWORD srcwidth, DWORD dstwidth,
|
DWORD srcwidth, DWORD dstwidth,
|
||||||
DC *dc, XImage *bmpImage )
|
DC *dc, XImage *bmpImage )
|
||||||
{
|
{
|
||||||
DWORD x;
|
DWORD x;
|
||||||
const BYTE *bits = srcbits;
|
const BYTE *bits = srcbits;
|
||||||
|
int h;
|
||||||
|
|
||||||
/* align to 32 bit */
|
/* align to 32 bit */
|
||||||
DWORD linebytes = (srcwidth * 3 + 3) & ~3;
|
DWORD linebytes = (srcwidth * 3 + 3) & ~3;
|
||||||
|
|
||||||
/* "bits" order is reversed for some reason */
|
/* "bits" order is reversed for some reason */
|
||||||
|
|
||||||
while (lines--)
|
if (lines > 0) {
|
||||||
{
|
for (h = lines - 1; h >= 0; h--) {
|
||||||
for (x = 0; x < dstwidth; x++, bits += 3)
|
for (x = 0; x < dstwidth; x++, bits += 3) {
|
||||||
XPutPixel( bmpImage, x, lines,
|
XPutPixel( bmpImage, x, h,
|
||||||
COLOR_ToPhysical(dc, RGB(bits[2],bits[1],bits[0])) );
|
COLOR_ToPhysical(dc, RGB(bits[2],bits[1],bits[0])));
|
||||||
|
}
|
||||||
|
bits = (srcbits += linebytes);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
lines = -lines;
|
||||||
|
for (h = 0; h < lines; h++) {
|
||||||
|
for (x = 0; x < dstwidth; x++, bits += 3) {
|
||||||
|
XPutPixel( bmpImage, x, h,
|
||||||
|
COLOR_ToPhysical(dc, RGB(bits[2],bits[1],bits[0])));
|
||||||
|
}
|
||||||
|
bits = (srcbits += linebytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bits = (srcbits += linebytes);
|
|
||||||
|
/***********************************************************************
|
||||||
|
* DIB_SetImageBits_32
|
||||||
|
*
|
||||||
|
* SetDIBits for a 32-bit deep DIB.
|
||||||
|
*/
|
||||||
|
static void DIB_SetImageBits_32( int lines, const BYTE *srcbits,
|
||||||
|
DWORD srcwidth, DWORD dstwidth,
|
||||||
|
DC *dc, XImage *bmpImage )
|
||||||
|
{
|
||||||
|
DWORD x;
|
||||||
|
const BYTE *bits = srcbits;
|
||||||
|
int h;
|
||||||
|
|
||||||
|
DWORD linebytes = (srcwidth * 4);
|
||||||
|
|
||||||
|
if (lines > 0) {
|
||||||
|
for (h = lines - 1; h >= 0; h--) {
|
||||||
|
for (x = 0; x < dstwidth; x++, bits += 4) {
|
||||||
|
XPutPixel( bmpImage, x, h,
|
||||||
|
COLOR_ToPhysical(dc, RGB(bits[2],bits[1],bits[0])));
|
||||||
|
}
|
||||||
|
bits = (srcbits += linebytes);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (h = 0; h < lines; h++) {
|
||||||
|
for (x = 0; x < dstwidth; x++, bits += 4) {
|
||||||
|
XPutPixel( bmpImage, x, h,
|
||||||
|
COLOR_ToPhysical(dc, RGB(bits[2],bits[1],bits[0])));
|
||||||
|
}
|
||||||
|
bits = (srcbits += linebytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -621,6 +753,7 @@ static int DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR *descr )
|
||||||
int *colorMapping;
|
int *colorMapping;
|
||||||
XImage *bmpImage;
|
XImage *bmpImage;
|
||||||
DWORD compression = 0;
|
DWORD compression = 0;
|
||||||
|
int lines;
|
||||||
|
|
||||||
if (descr->info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
if (descr->info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
||||||
compression = descr->info->bmiHeader.biCompression;
|
compression = descr->info->bmiHeader.biCompression;
|
||||||
|
@ -635,7 +768,9 @@ static int DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR *descr )
|
||||||
if( descr->dc->w.flags & DC_DIRTY ) CLIPPING_UpdateGCRegion(descr->dc);
|
if( descr->dc->w.flags & DC_DIRTY ) CLIPPING_UpdateGCRegion(descr->dc);
|
||||||
|
|
||||||
/* Transfer the pixels */
|
/* Transfer the pixels */
|
||||||
XCREATEIMAGE(bmpImage, descr->infoWidth, descr->lines, descr->depth );
|
lines = descr->lines;
|
||||||
|
if (lines < 0) lines = -lines;
|
||||||
|
XCREATEIMAGE(bmpImage, descr->infoWidth, lines, descr->depth );
|
||||||
|
|
||||||
switch(descr->infoBpp)
|
switch(descr->infoBpp)
|
||||||
{
|
{
|
||||||
|
@ -657,10 +792,19 @@ static int DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR *descr )
|
||||||
else DIB_SetImageBits_8( descr->lines, descr->bits, descr->infoWidth,
|
else DIB_SetImageBits_8( descr->lines, descr->bits, descr->infoWidth,
|
||||||
descr->width, colorMapping, bmpImage );
|
descr->width, colorMapping, bmpImage );
|
||||||
break;
|
break;
|
||||||
|
case 15:
|
||||||
|
case 16:
|
||||||
|
DIB_SetImageBits_16( descr->lines, descr->bits, descr->infoWidth,
|
||||||
|
descr->width, descr->dc, bmpImage);
|
||||||
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
DIB_SetImageBits_24( descr->lines, descr->bits, descr->infoWidth,
|
DIB_SetImageBits_24( descr->lines, descr->bits, descr->infoWidth,
|
||||||
descr->width, descr->dc, bmpImage );
|
descr->width, descr->dc, bmpImage );
|
||||||
break;
|
break;
|
||||||
|
case 32:
|
||||||
|
DIB_SetImageBits_32( descr->lines, descr->bits, descr->infoWidth,
|
||||||
|
descr->width, descr->dc, bmpImage);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf( stderr, "Invalid depth %d for SetDIBits!\n", descr->infoBpp );
|
fprintf( stderr, "Invalid depth %d for SetDIBits!\n", descr->infoBpp );
|
||||||
break;
|
break;
|
||||||
|
@ -670,7 +814,7 @@ static int DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR *descr )
|
||||||
descr->xSrc, descr->ySrc, descr->xDest, descr->yDest,
|
descr->xSrc, descr->ySrc, descr->xDest, descr->yDest,
|
||||||
descr->width, descr->height );
|
descr->width, descr->height );
|
||||||
XDestroyImage( bmpImage );
|
XDestroyImage( bmpImage );
|
||||||
return descr->lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -732,7 +876,7 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
{
|
{
|
||||||
DIB_SETIMAGEBITS_DESCR descr;
|
DIB_SETIMAGEBITS_DESCR descr;
|
||||||
BITMAPOBJ * bmp;
|
BITMAPOBJ * bmp;
|
||||||
DWORD height;
|
int height, tmpheight;
|
||||||
INT32 result;
|
INT32 result;
|
||||||
|
|
||||||
/* Check parameters */
|
/* Check parameters */
|
||||||
|
@ -755,6 +899,8 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
GDI_HEAP_UNLOCK( hdc );
|
GDI_HEAP_UNLOCK( hdc );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
tmpheight = height;
|
||||||
|
if (height < 0) height = -height;
|
||||||
if (!lines || (startscan >= height))
|
if (!lines || (startscan >= height))
|
||||||
{
|
{
|
||||||
GDI_HEAP_UNLOCK( hbitmap );
|
GDI_HEAP_UNLOCK( hbitmap );
|
||||||
|
@ -764,7 +910,7 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
if (startscan + lines > height) lines = height - startscan;
|
if (startscan + lines > height) lines = height - startscan;
|
||||||
|
|
||||||
descr.bits = bits;
|
descr.bits = bits;
|
||||||
descr.lines = lines;
|
descr.lines = tmpheight >= 0 ? lines : -lines;
|
||||||
descr.depth = bmp->bitmap.bmBitsPixel;
|
descr.depth = bmp->bitmap.bmBitsPixel;
|
||||||
descr.info = info;
|
descr.info = info;
|
||||||
descr.coloruse = coloruse;
|
descr.coloruse = coloruse;
|
||||||
|
@ -807,7 +953,8 @@ INT32 WINAPI SetDIBitsToDevice32(HDC32 hdc, INT32 xDest, INT32 yDest, DWORD cx,
|
||||||
{
|
{
|
||||||
DIB_SETIMAGEBITS_DESCR descr;
|
DIB_SETIMAGEBITS_DESCR descr;
|
||||||
DC * dc;
|
DC * dc;
|
||||||
DWORD width, height;
|
DWORD width;
|
||||||
|
int height, tmpheight;
|
||||||
|
|
||||||
/* Check parameters */
|
/* Check parameters */
|
||||||
|
|
||||||
|
@ -820,6 +967,8 @@ INT32 WINAPI SetDIBitsToDevice32(HDC32 hdc, INT32 xDest, INT32 yDest, DWORD cx,
|
||||||
if (DIB_GetBitmapInfo( &info->bmiHeader, &width,
|
if (DIB_GetBitmapInfo( &info->bmiHeader, &width,
|
||||||
&height, &descr.infoBpp ) == -1)
|
&height, &descr.infoBpp ) == -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
tmpheight = height;
|
||||||
|
if (height < 0) height = -height;
|
||||||
if (!lines || (startscan >= height)) return 0;
|
if (!lines || (startscan >= height)) return 0;
|
||||||
if (startscan + lines > height) lines = height - startscan;
|
if (startscan + lines > height) lines = height - startscan;
|
||||||
if (ySrc < startscan) ySrc = startscan;
|
if (ySrc < startscan) ySrc = startscan;
|
||||||
|
@ -834,7 +983,7 @@ INT32 WINAPI SetDIBitsToDevice32(HDC32 hdc, INT32 xDest, INT32 yDest, DWORD cx,
|
||||||
|
|
||||||
descr.dc = dc;
|
descr.dc = dc;
|
||||||
descr.bits = bits;
|
descr.bits = bits;
|
||||||
descr.lines = lines;
|
descr.lines = tmpheight >= 0 ? lines : -lines;
|
||||||
descr.infoWidth = width;
|
descr.infoWidth = width;
|
||||||
descr.depth = dc->w.bitsPerPixel;
|
descr.depth = dc->w.bitsPerPixel;
|
||||||
descr.info = info;
|
descr.info = info;
|
||||||
|
@ -851,7 +1000,92 @@ INT32 WINAPI SetDIBitsToDevice32(HDC32 hdc, INT32 xDest, INT32 yDest, DWORD cx,
|
||||||
return CALL_LARGE_STACK( DIB_SetImageBits, &descr );
|
return CALL_LARGE_STACK( DIB_SetImageBits, &descr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* SetDIBColorTable32 (GDI32.311)
|
||||||
|
*/
|
||||||
|
UINT32 WINAPI SetDIBColorTable32( HDC32 hdc, UINT32 startpos, UINT32 entries,
|
||||||
|
RGBQUAD *colors )
|
||||||
|
{
|
||||||
|
DC * dc;
|
||||||
|
PALETTEENTRY * palEntry;
|
||||||
|
PALETTEOBJ * palette;
|
||||||
|
RGBQUAD *end;
|
||||||
|
|
||||||
|
dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
|
||||||
|
if (!dc)
|
||||||
|
{
|
||||||
|
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
|
||||||
|
if (!dc) return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transfer color info */
|
||||||
|
|
||||||
|
if (dc->w.bitsPerPixel <= 8) {
|
||||||
|
palEntry = palette->logpalette.palPalEntry + startpos;
|
||||||
|
if (startpos + entries > (1 << dc->w.bitsPerPixel)) {
|
||||||
|
entries = (1 << dc->w.bitsPerPixel) - startpos;
|
||||||
|
}
|
||||||
|
for (end = colors + entries; colors < end; palEntry++, colors++)
|
||||||
|
{
|
||||||
|
palEntry->peRed = colors->rgbRed;
|
||||||
|
palEntry->peGreen = colors->rgbGreen;
|
||||||
|
palEntry->peBlue = colors->rgbBlue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entries = 0;
|
||||||
|
}
|
||||||
|
GDI_HEAP_UNLOCK( dc->w.hPalette );
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* GetDIBColorTable32 (GDI32.169)
|
||||||
|
*/
|
||||||
|
UINT32 WINAPI GetDIBColorTable32( HDC32 hdc, UINT32 startpos, UINT32 entries,
|
||||||
|
RGBQUAD *colors )
|
||||||
|
{
|
||||||
|
DC * dc;
|
||||||
|
PALETTEENTRY * palEntry;
|
||||||
|
PALETTEOBJ * palette;
|
||||||
|
RGBQUAD *end;
|
||||||
|
|
||||||
|
dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
|
||||||
|
if (!dc)
|
||||||
|
{
|
||||||
|
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
|
||||||
|
if (!dc) return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transfer color info */
|
||||||
|
|
||||||
|
if (dc->w.bitsPerPixel <= 8) {
|
||||||
|
palEntry = palette->logpalette.palPalEntry + startpos;
|
||||||
|
if (startpos + entries > (1 << dc->w.bitsPerPixel)) {
|
||||||
|
entries = (1 << dc->w.bitsPerPixel) - startpos;
|
||||||
|
}
|
||||||
|
for (end = colors + entries; colors < end; palEntry++, colors++)
|
||||||
|
{
|
||||||
|
colors->rgbRed = palEntry->peRed;
|
||||||
|
colors->rgbGreen = palEntry->peGreen;
|
||||||
|
colors->rgbBlue = palEntry->peBlue;
|
||||||
|
colors->rgbReserved = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entries = 0;
|
||||||
|
}
|
||||||
|
GDI_HEAP_UNLOCK( dc->w.hPalette );
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetDIBits16 (GDI.441)
|
* GetDIBits16 (GDI.441)
|
||||||
|
@ -1018,6 +1252,18 @@ INT32 WINAPI GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
|
||||||
bbits += pad;
|
bbits += pad;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 32:
|
||||||
|
for( y = yend - 1; (int)y >= (int)startscan; y-- )
|
||||||
|
{
|
||||||
|
*bbits = 0;
|
||||||
|
for( x = 0; x < xend; x++ ) {
|
||||||
|
unsigned long pixel=XGetPixel( bmpImage, x, y);
|
||||||
|
*bbits++ = (pixel >>16) & 0xff;
|
||||||
|
*bbits++ = (pixel >> 8) & 0xff;
|
||||||
|
*bbits++ = pixel & 0xff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,"GetDIBits*: unsupported depth %d\n",
|
fprintf(stderr,"GetDIBits*: unsupported depth %d\n",
|
||||||
info->bmiHeader.biBitCount
|
info->bmiHeader.biBitCount
|
||||||
|
@ -1069,10 +1315,12 @@ HBITMAP32 WINAPI CreateDIBitmap32( HDC32 hdc, const BITMAPINFOHEADER *header,
|
||||||
{
|
{
|
||||||
HBITMAP32 handle;
|
HBITMAP32 handle;
|
||||||
BOOL32 fColor;
|
BOOL32 fColor;
|
||||||
DWORD width, height;
|
DWORD width;
|
||||||
|
int height;
|
||||||
WORD bpp;
|
WORD bpp;
|
||||||
|
|
||||||
if (DIB_GetBitmapInfo( header, &width, &height, &bpp ) == -1) return 0;
|
if (DIB_GetBitmapInfo( header, &width, &height, &bpp ) == -1) return 0;
|
||||||
|
if (height < 0) height = -height;
|
||||||
|
|
||||||
/* Check if we should create a monochrome or color bitmap. */
|
/* Check if we should create a monochrome or color bitmap. */
|
||||||
/* We create a monochrome bitmap only if it has exactly 2 */
|
/* We create a monochrome bitmap only if it has exactly 2 */
|
||||||
|
|
|
@ -1189,3 +1189,21 @@ BOOL32 WINAPI TranslateCharSetInfo(LPDWORD lpSrc,LPCHARSETINFO lpCs,DWORD dwFlag
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* GetFontLanguageInfo (GDI32.182)
|
||||||
|
*/
|
||||||
|
DWORD WINAPI GetFontLanguageInfo32(HDC32 hdc) {
|
||||||
|
/* return value 0 is correct for most cases anyway */
|
||||||
|
fprintf(stderr,"GetFontLanguageInfo:stub!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* GetFontLanguageInfo (GDI.616)
|
||||||
|
*/
|
||||||
|
DWORD WINAPI GetFontLanguageInfo16(HDC16 hdc) {
|
||||||
|
/* return value 0 is correct for most cases anyway */
|
||||||
|
fprintf(stderr,"GetFontLanguageInfo:stub!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -636,7 +636,7 @@ DWORD WINAPI GetTabbedTextExtent32W( HDC32 hdc, LPCWSTR lpstr, INT32 count,
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetTextCharset (USER32.226) (USER.612)
|
* GetTextCharset (GDI32.226) (GDI.612)
|
||||||
*/
|
*/
|
||||||
INT32 WINAPI GetTextCharset32(HDC32 hdc)
|
INT32 WINAPI GetTextCharset32(HDC32 hdc)
|
||||||
{
|
{
|
||||||
|
@ -648,3 +648,15 @@ INT16 WINAPI GetTextCharset16(HDC16 hdc)
|
||||||
{
|
{
|
||||||
return GetTextCharset32(hdc);
|
return GetTextCharset32(hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* GetTextCharsetInfo (GDI32.381)
|
||||||
|
*/
|
||||||
|
INT32 WINAPI GetTextCharsetInfo(HDC32 hdc,LPCHARSETINFO csi,DWORD flags)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"GetTextCharsetInfo(0x%x,%p,%08lx), stub!\n",hdc,csi,flags);
|
||||||
|
csi->ciCharset = DEFAULT_CHARSET;
|
||||||
|
csi->ciACP = GetACP();
|
||||||
|
/* ... fill fontstruct too ... */
|
||||||
|
return DEFAULT_CHARSET;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
DEFS = @DLLFLAGS@ -D__WINE__
|
||||||
|
TOPSRCDIR = @top_srcdir@
|
||||||
|
TOPOBJDIR = ..
|
||||||
|
SRCDIR = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
MODULE = ole
|
||||||
|
|
||||||
|
C_SRCS = \
|
||||||
|
compobj.c \
|
||||||
|
ole2.c \
|
||||||
|
ole2disp.c \
|
||||||
|
ole2nls.c \
|
||||||
|
olecli.c \
|
||||||
|
olesvr.c
|
||||||
|
|
||||||
|
all: $(MODULE).o
|
||||||
|
|
||||||
|
@MAKE_RULES@
|
||||||
|
|
||||||
|
### Dependencies:
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
/* At the moment, these are only empty stubs.
|
/* At the moment, these are only empty stubs.
|
||||||
*/
|
*/
|
||||||
|
#define INITGUID
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -15,6 +16,8 @@
|
||||||
#include "stddebug.h"
|
#include "stddebug.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "compobj.h"
|
#include "compobj.h"
|
||||||
|
#include "interfaces.h"
|
||||||
|
#include "shlobj.h"
|
||||||
|
|
||||||
DWORD currentMalloc=0;
|
DWORD currentMalloc=0;
|
||||||
|
|
||||||
|
@ -159,7 +162,7 @@ OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR idstr)
|
||||||
char *s;
|
char *s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sprintf(idstr, "{%08lx-%04x-%04x-%2x%2x-",
|
sprintf(idstr, "{%08lx-%04x-%04x-%02x%02x-",
|
||||||
id->Data1, id->Data2, id->Data3,
|
id->Data1, id->Data2, id->Data3,
|
||||||
id->Data4[0], id->Data4[1]);
|
id->Data4[0], id->Data4[1]);
|
||||||
s = &idstr[25];
|
s = &idstr[25];
|
|
@ -46,3 +46,16 @@ HRESULT WINAPI OleFlushClipboard()
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* CoRegisterMessageFilter [OLE32.38]
|
||||||
|
*/
|
||||||
|
HRESULT CoRegisterMessageFilter(
|
||||||
|
LPMESSAGEFILTER lpMessageFilter, /* Pointer to interface */
|
||||||
|
LPMESSAGEFILTER *lplpMessageFilter /* Indirect pointer to prior instance if non-NULL */
|
||||||
|
) {
|
||||||
|
dprintf_ole(stdnimp,"CoRegisterMessageFilter()\n");
|
||||||
|
if (lplpMessageFilter) {
|
||||||
|
*lplpMessageFilter = NULL;
|
||||||
|
}
|
||||||
|
return S_OK;
|
||||||
|
}
|
|
@ -0,0 +1,151 @@
|
||||||
|
/*
|
||||||
|
* OLECLI library
|
||||||
|
*
|
||||||
|
* Copyright 1995 Martin von Loewis
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* At the moment, these are only empty stubs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windows.h"
|
||||||
|
#include "ole.h"
|
||||||
|
#include "gdi.h"
|
||||||
|
#include "stddebug.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
extern LONG OLE_current_handle;
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRegisterClientDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRegisterClientDoc16(LPCSTR classname, LPCSTR docname,
|
||||||
|
LONG reserved, LHCLIENTDOC *hRet )
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRegisterClientDoc:%s %s\n",classname,docname);
|
||||||
|
*hRet=++OLE_current_handle;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRegisterClientDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRegisterClientDoc32(LPCSTR classname, LPCSTR docname,
|
||||||
|
LONG reserved, LHCLIENTDOC *hRet )
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRegisterClientDoc:%s %s\n",classname,docname);
|
||||||
|
*hRet=++OLE_current_handle;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRenameClientDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRenameClientDoc16(LHCLIENTDOC hDoc, LPCSTR newName)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRenameClientDoc: %ld %s\n",hDoc, newName);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRenameClientDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRenameClientDoc32(LHCLIENTDOC hDoc, LPCSTR newName)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRenameClientDoc: %ld %s\n",hDoc, newName);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRevokeClientDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRevokeClientDoc16(LHCLIENTDOC hServerDoc)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRevokeClientDoc:%ld\n",hServerDoc);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRevokeClientDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRevokeClientDoc32(LHCLIENTDOC hServerDoc)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRevokeClientDoc:%ld\n",hServerDoc);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleCreateLinkFromClip32
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleCreateLinkFromClip32(
|
||||||
|
LPCSTR name,LPOLECLIENT olecli,LHCLIENTDOC hclientdoc,LPCSTR xname,
|
||||||
|
LPOLEOBJECT *lpoleob,OLEOPT_RENDER render,OLECLIPFORMAT clipformat
|
||||||
|
) {
|
||||||
|
fprintf(stdnimp,"OleCreateLinkFromClip(%s,%p,%08lx,%s,%p,%d,%ld),stub!\n",
|
||||||
|
name,olecli,hclientdoc,xname,lpoleob,render,clipformat
|
||||||
|
);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleQueryLinkFromClip32
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleQueryLinkFromClip32(LPCSTR name,OLEOPT_RENDER render,OLECLIPFORMAT clipformat) {
|
||||||
|
fprintf(stdnimp,"OleQueryLinkFromClip(%s,%d,%ld),stub!\n",
|
||||||
|
name,render,clipformat
|
||||||
|
);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
/***********************************************************************
|
||||||
|
* OleQueryCreateFromClip32
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleQueryCreateFromClip32(LPCSTR name,OLEOPT_RENDER render,OLECLIPFORMAT clipformat) {
|
||||||
|
fprintf(stdnimp,"OleQueryCreateFromClip(%s,%d,%ld),stub!\n",
|
||||||
|
name,render,clipformat
|
||||||
|
);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleIsDcMeta
|
||||||
|
*/
|
||||||
|
BOOL16 WINAPI OleIsDcMeta(HDC16 hdc)
|
||||||
|
{
|
||||||
|
dprintf_ole(stddeb,"OleIsDCMeta(%04x)\n",hdc);
|
||||||
|
return GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleSetHostNames
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleSetHostNames32(LPOLEOBJECT oleob,LPCSTR name1,LPCSTR name2) {
|
||||||
|
fprintf(stdnimp,"OleSetHostNames(%p,%s,%s),stub\n",oleob,name1,name2);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleQueryType32
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleQueryType32(LPOLEOBJECT oleob,LONG*xlong) {
|
||||||
|
fprintf(stdnimp,"OleQueryType(%p,%p),stub!\n",oleob,xlong);
|
||||||
|
if (!oleob)
|
||||||
|
return 0x10;
|
||||||
|
fprintf(stddeb,"Calling OLEOBJECT.QueryType (%p) (%p,%p)\n",
|
||||||
|
oleob->lpvtbl->QueryType,oleob,xlong
|
||||||
|
);
|
||||||
|
return oleob->lpvtbl->QueryType(oleob,xlong);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleCreateFromClip
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleCreateFromClip32(
|
||||||
|
LPCSTR name,LPOLECLIENT olecli,LHCLIENTDOC hclientdoc,LPCSTR xname,
|
||||||
|
LPOLEOBJECT *lpoleob,OLEOPT_RENDER render, OLECLIPFORMAT clipformat
|
||||||
|
) {
|
||||||
|
fprintf(stdnimp,"OleCreateLinkFromClip(%s,%p,%08lx,%s,%p,%d,%ld),stub!\n",
|
||||||
|
name,olecli,hclientdoc,xname,lpoleob,render,clipformat
|
||||||
|
);
|
||||||
|
/* clipb type, object kreieren entsprechend etc. */
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
/*
|
||||||
|
* OLESVR library
|
||||||
|
*
|
||||||
|
* Copyright 1995 Martin von Loewis
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* At the moment, these are only empty stubs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windows.h"
|
||||||
|
#include "ole.h"
|
||||||
|
#include "stddebug.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
LONG OLE_current_handle;
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRegisterServer
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRegisterServer16( LPCSTR name, LPOLESERVER serverStruct,
|
||||||
|
LHSERVER *hRet, HINSTANCE16 hServer,
|
||||||
|
OLE_SERVER_USE use )
|
||||||
|
{
|
||||||
|
dprintf_ole(stdnimp,"OleRegisterServer:%s\n",name);
|
||||||
|
*hRet=++OLE_current_handle;
|
||||||
|
/* return OLE_ERROR_MEMORY, OLE_ERROR_PROTECT_ONLY if you want it fail*/
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleBlockServer
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleBlockServer16(LHSERVER hServer)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleBlockServer:%ld\n",hServer);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleBlockServer
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleBlockServer32(LHSERVER hServer)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleBlockServer:%ld\n",hServer);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleUnblockServer
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleUnblockServer16(LHSERVER hServer, BOOL16 *block)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleUnblockServer:%ld\n",hServer);
|
||||||
|
/* no more blocked messages :) */
|
||||||
|
*block=FALSE;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleUnblockServer
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleUnblockServer32(LHSERVER hServer, BOOL32 *block)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleUnblockServer:%ld\n",hServer);
|
||||||
|
/* no more blocked messages :) */
|
||||||
|
*block=FALSE;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRegisterServerDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRegisterServerDoc16( LHSERVER hServer, LPCSTR docname,
|
||||||
|
LPOLESERVERDOC document,
|
||||||
|
LHSERVERDOC *hRet)
|
||||||
|
{
|
||||||
|
dprintf_ole(stdnimp,"OleRegisterServerDoc:%ld,%s\n", hServer, docname);
|
||||||
|
*hRet=++OLE_current_handle;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRevokeServerDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC hServerDoc)
|
||||||
|
{
|
||||||
|
dprintf_ole(stdnimp,"OleRevokeServerDoc:%ld\n",hServerDoc);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRevokeServerDoc
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRevokeServerDoc32(LHSERVERDOC hServerDoc)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRevokeServerDoc:%ld\n",hServerDoc);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRevokeServer
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRevokeServer(LHSERVER hServer)
|
||||||
|
{
|
||||||
|
dprintf_ole(stdnimp,"OleRevokeServer:%ld\n",hServer);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
OLESTATUS WINAPI OleRegisterServer32(LPCSTR svrname,LPOLESERVER olesvr,LHSERVER* hRet,HINSTANCE32 hinst,OLE_SERVER_USE osu) {
|
||||||
|
fprintf(stderr,"OleRegisterServer(%s,%p,%p,%08x,%d),stub!\n",
|
||||||
|
svrname,olesvr,hRet,hinst,osu
|
||||||
|
);
|
||||||
|
*hRet=++OLE_current_handle;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
OLESTATUS WINAPI OleRegisterServerDoc32( LHSERVER hServer, LPCSTR docname,
|
||||||
|
LPOLESERVERDOC document,
|
||||||
|
LHSERVERDOC *hRet)
|
||||||
|
{
|
||||||
|
fprintf(stdnimp,"OleRegisterServerDoc:%ld,%s\n", hServer, docname);
|
||||||
|
*hRet=++OLE_current_handle;
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* OleRenameServerDoc32
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
OLESTATUS WINAPI OleRenameServerDoc32(LHSERVERDOC hDoc, LPCSTR newName)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"OleRenameServerDoc: %ld %s; stub.\n",hDoc, newName);
|
||||||
|
return OLE_OK;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue