Commit 2ace16ac authored by Alexandre Julliard's avatar Alexandre Julliard

Release 960428

Sun Apr 28 14:32:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [Makefile.in] Subdir memory is now also compiled for Winelib, in order to get the Win32 heap functions. * [if1632/Makefile.in] Renamed winprocs and winprocs32 to wprocs and wprocs32 to avoid DLL names > 8 characters. * [loader/builtin.c] (New file) Grouped all built-in DLLs code in a single file. * [memory/global.c] Use the Win32 heap code instead of malloc() to allocate linear memory. This will help test the heap code. * [memory/local.c] Fixed FreeSelector() to clear DS and ES correctly for huge blocks. * [tools/build.c] [if1632/relay.c] Removed 'id' directive in spec files. For relay debugging, the DLL entry point is now computed from the CS:IP entry point address. Added 'heap' directive to specifiy a local heap for the DLL. USER and GDI heap are now created this way. * [windows/class.c] [include/class.h] Changed the class structure to use pointers instead of handles. Changed Get/SetClassWord/Long to use a switch statement; this allows changing the layout of the CLASS structure. * [windows/win.c] [include/win.h] Use a CLASS * instead of a handle for the window class. Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de> * [if1632/kernel32.spec] [memory/global.c] [win32/memory.c] [win32/process.c] GetProcessAffinityMask,GlobalLock,IsBadReadPtr,IsBadWritePtr, LocalLock,SetThreadAffinityMask: new relays. * [win32/cursoricon32.c] Return same handle if a cursor is loaded multiple times. Sat Apr 27 15:13:37 1996 Bang Jun Young <bangjy@nownuri.nowcom.co.kr> * [resources/sysres_Ko.rc] Added support for Korean [Ko] language. Fri Apr 26 00:49:05 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [objects/dc.c] [objects/font.c] Fixed problem with SaveDC()/RestoreDC() and font cache 'used' count. * [objects/metafile.c] [objects/dcvalues.c] Fixed broken SetTextAlign() on metafiles. * [objects/metafile.c] Delete objects in handle table at end of PlayMetaFile(). Wed Apr 24 19:21:01 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [if1632/ver.spec] [misc/ver.c] [include/ver.h] (New files) VER.DLL (partially) implemented (VerFindFile,VerInstallFile) [If it doesn't work for you, use -dll -ver and report it to me] * [if1632/user32.spec] [if1632/kernel32.spec] [if1632/shell.spec] [if1632/shell32.spec] [misc/ole2nls.c] [windows/message.c] [windows/graphics.c] Simple win32 functions, where we can just use the win16 counterpart. Misc. stubs. * [misc/lstr.c] Someone reported a _lstrlen(NULL). NULL is a valid argument. Fixed. * [misc/registry.c] Some alloclens were off by 1, one double fclose() fixed. Requesting value 0 of a key with no values returns an error (should we always return a made up value NULL? what does win3.1?) Tue Apr 23 17:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [misc/shell.c] Implemented FindEnvironmentString(), DoEnvironmentSubst(), ExtractIcon(), InternalExtractIcon() and ExtractAssociatedIcon(). * [misc/user.c] Do extensive cleanup on application exit. * [windows/hook.c] [windows/win.c] [windows/class.c] Added miscellaneous cleanup routines. * [controls/menu.c] More efficient popup menu window handling. Mon Apr 22 21:35:22 1996 Albrecht Kleine <kleine@ak.sax.de> * [include/windows.h][objects/oembitmap.c][include/bitmaps/obm_trtype] Added "TT-bitmap" for later usage in a ChooseFont() ownerdraw combobox.
parent cdcdede2
This is release 960421 of Wine the MS Windows emulator. This is still a
This is release 960428 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960421: (see ChangeLog for details)
- Preliminary support for W32SYS.DLL.
- Built-in COMMDLG improvements.
- New format and location for registry files.
- Window refresh optimized.
WHAT'S NEW with Wine-960428: (see ChangeLog for details)
- Preliminary support for VER.DLL.
- Suuport for Korean [Ko] language.
- More Win32 functions.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -18,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
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960421.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960421.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960421.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960421.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960428.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960428.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960428.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960428.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sun Apr 28 14:32:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [Makefile.in]
Subdir memory is now also compiled for Winelib, in order to get
the Win32 heap functions.
* [if1632/Makefile.in]
Renamed winprocs and winprocs32 to wprocs and wprocs32 to avoid
DLL names > 8 characters.
* [loader/builtin.c] (New file)
Grouped all built-in DLLs code in a single file.
* [memory/global.c]
Use the Win32 heap code instead of malloc() to allocate linear
memory. This will help test the heap code.
* [memory/local.c]
Fixed FreeSelector() to clear DS and ES correctly for huge blocks.
* [tools/build.c] [if1632/relay.c]
Removed 'id' directive in spec files. For relay debugging, the DLL
entry point is now computed from the CS:IP entry point address.
Added 'heap' directive to specifiy a local heap for the DLL. USER
and GDI heap are now created this way.
* [windows/class.c] [include/class.h]
Changed the class structure to use pointers instead of handles.
Changed Get/SetClassWord/Long to use a switch statement; this
allows changing the layout of the CLASS structure.
* [windows/win.c] [include/win.h]
Use a CLASS * instead of a handle for the window class.
Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec] [memory/global.c]
[win32/memory.c] [win32/process.c]
GetProcessAffinityMask,GlobalLock,IsBadReadPtr,IsBadWritePtr,
LocalLock,SetThreadAffinityMask: new relays.
* [win32/cursoricon32.c]
Return same handle if a cursor is loaded multiple times.
Sat Apr 27 15:13:37 1996 Bang Jun Young <bangjy@nownuri.nowcom.co.kr>
* [resources/sysres_Ko.rc]
Added support for Korean [Ko] language.
Fri Apr 26 00:49:05 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [objects/dc.c] [objects/font.c]
Fixed problem with SaveDC()/RestoreDC() and font cache 'used' count.
* [objects/metafile.c] [objects/dcvalues.c]
Fixed broken SetTextAlign() on metafiles.
* [objects/metafile.c]
Delete objects in handle table at end of PlayMetaFile().
Wed Apr 24 19:21:01 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/ver.spec] [misc/ver.c] [include/ver.h] (New files)
VER.DLL (partially) implemented (VerFindFile,VerInstallFile)
[If it doesn't work for you, use -dll -ver and report it to me]
* [if1632/user32.spec] [if1632/kernel32.spec] [if1632/shell.spec]
[if1632/shell32.spec] [misc/ole2nls.c] [windows/message.c]
[windows/graphics.c]
Simple win32 functions, where we can just use the win16 counterpart.
Misc. stubs.
* [misc/lstr.c]
Someone reported a _lstrlen(NULL). NULL is a valid argument. Fixed.
* [misc/registry.c]
Some alloclens were off by 1, one double fclose() fixed.
Requesting value 0 of a key with no values returns an error
(should we always return a made up value NULL? what does win3.1?)
Tue Apr 23 17:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [misc/shell.c]
Implemented FindEnvironmentString(), DoEnvironmentSubst(),
ExtractIcon(), InternalExtractIcon() and ExtractAssociatedIcon().
* [misc/user.c]
Do extensive cleanup on application exit.
* [windows/hook.c] [windows/win.c] [windows/class.c]
Added miscellaneous cleanup routines.
* [controls/menu.c]
More efficient popup menu window handling.
Mon Apr 22 21:35:22 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/windows.h][objects/oembitmap.c][include/bitmaps/obm_trtype]
Added "TT-bitmap" for later usage in a ChooseFont() ownerdraw combobox.
----------------------------------------------------------------------
Sat Apr 20 23:23:16 1996 Robert Pouliot <krynos@qbc.clic.net>
* [resources/sysres_Fr.rc] [resources/TODO]
......
......@@ -53,6 +53,7 @@ COMMONSUBDIRS = \
files \
ipc \
loader \
memory \
misc \
multimedia \
objects \
......@@ -65,7 +66,6 @@ EMUSUBDIRS = \
debugger \
debugger/readline \
if1632 \
memory \
miscemu
LIBSUBDIRS = library
......@@ -79,6 +79,7 @@ COMMONOBJS = \
files/files.o \
ipc/ipc.o \
loader/loader.o \
memory/memory.o \
misc/misc.o \
multimedia/multimedia.o \
objects/objects.o \
......@@ -90,7 +91,6 @@ EMUOBJS = \
debugger/debugger.o \
debugger/readline/readline.o \
if1632/if1632.o \
memory/memory.o \
miscemu/miscemu.o
LIBOBJS = library/library.o
......
......@@ -18,6 +18,7 @@
#include "windows.h"
#include "syscolor.h"
#include "sysmetrics.h"
#include "task.h"
#include "win.h"
#include "menu.h"
#include "module.h"
......@@ -65,6 +66,12 @@ extern void NC_DrawSysButton(HWND hwnd, HDC hdc, BOOL down); /* nonclient.c */
static HBITMAP hStdCheck = 0;
static HBITMAP hStdMnArrow = 0;
/* we _can_ use global popup window because there's no way 2 menues can
* be tracked at the same time.
*/
static WND* pTopPWnd = 0;
static UINT uSubPWndLevel = 0;
/***********************************************************************
* MENU_Init
......@@ -678,6 +685,23 @@ UINT MENU_DrawMenuBar(HDC hDC, LPRECT lprect, HWND hwnd, BOOL suppress_draw)
return lppop->Height;
}
/***********************************************************************
* MENU_SwitchTPWndTo
*/
BOOL MENU_SwitchTPWndTo( HTASK hTask)
{
/* This is supposed to be called when popup is hidden */
TDB* task = (TDB*)GlobalLock(hTask);
if( !task ) return 0;
/* if this task got as far as menu tracking it must have a queue */
pTopPWnd->hInstance = task->hInstance;
pTopPWnd->hmemTaskQ = task->hQueue;
return 1;
}
/***********************************************************************
* MENU_ShowPopup
......@@ -686,7 +710,9 @@ UINT MENU_DrawMenuBar(HDC hDC, LPRECT lprect, HWND hwnd, BOOL suppress_draw)
*/
static BOOL MENU_ShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, int x, int y)
{
POPUPMENU *menu;
POPUPMENU *menu;
WND *wndPtr = NULL;
BOOL skip_init = 0;
if (!(menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( hmenu ))) return FALSE;
if (menu->FocusedItem != NO_SELECTED_ITEM)
......@@ -698,21 +724,47 @@ static BOOL MENU_ShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, int x, int y)
SendMessage( hwndOwner, WM_INITMENUPOPUP, (WPARAM)hmenu,
MAKELONG( id, (menu->wFlags & MF_SYSMENU) ? 1 : 0 ));
MENU_PopupMenuCalcSize( menu, hwndOwner );
if (!menu->hWnd)
{
WND *wndPtr = WIN_FindWndPtr( hwndOwner );
if (!wndPtr) return FALSE;
menu->hWnd = CreateWindow( POPUPMENU_CLASS_ATOM, (SEGPTR)0,
WS_POPUP | WS_BORDER, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
0, 0, wndPtr->hInstance, (SEGPTR)hmenu );
if (!menu->hWnd) return FALSE;
}
else SetWindowPos( menu->hWnd, 0, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
SWP_NOACTIVATE | SWP_NOZORDER );
wndPtr = WIN_FindWndPtr( hwndOwner );
if (!wndPtr) return FALSE;
if (!pTopPWnd)
{
pTopPWnd = WIN_FindWndPtr(CreateWindow( POPUPMENU_CLASS_ATOM, (SEGPTR)0,
WS_POPUP | WS_BORDER, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
0, 0, wndPtr->hInstance, (SEGPTR)hmenu ));
if (!pTopPWnd) return FALSE;
skip_init = TRUE;
}
if( uSubPWndLevel )
{
/* create new window for the submenu */
HWND hWnd = CreateWindow( POPUPMENU_CLASS_ATOM, (SEGPTR)0,
WS_POPUP | WS_BORDER, x, y,
menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
menu->hWnd, 0, wndPtr->hInstance, (SEGPTR)hmenu );
if( !hWnd ) return FALSE;
menu->hWnd = hWnd;
}
else
{
if( !skip_init )
{
MENU_SwitchTPWndTo(GetCurrentTask());
SendMessage( pTopPWnd->hwndSelf, WM_USER, (WPARAM)hmenu, 0L);
}
menu->hWnd = pTopPWnd->hwndSelf;
}
uSubPWndLevel++;
SetWindowPos(menu->hWnd, 0, x, y, menu->Width + 2*SYSMETRICS_CXBORDER,
menu->Height + 2*SYSMETRICS_CYBORDER,
SWP_NOACTIVATE | SWP_NOZORDER );
/* Display the window */
......@@ -1095,7 +1147,16 @@ static void MENU_HideSubPopups( HWND hwndOwner, HMENU hmenu )
}
submenu = (POPUPMENU *) USER_HEAP_LIN_ADDR( hsubmenu );
MENU_HideSubPopups( hwndOwner, hsubmenu );
if (submenu->hWnd) ShowWindow( submenu->hWnd, SW_HIDE );
if (submenu->hWnd == pTopPWnd->hwndSelf )
{
ShowWindow( submenu->hWnd, SW_HIDE );
uSubPWndLevel = 0;
}
else
{
DestroyWindow( submenu->hWnd );
submenu->hWnd = 0;
}
MENU_SelectItem( hwndOwner, hsubmenu, NO_SELECTED_ITEM );
}
......@@ -1596,7 +1657,11 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, int x, int y,
USER_HEAP_FREE( hMsg );
ReleaseCapture();
MENU_HideSubPopups( hwnd, hmenu );
if (menu->wFlags & MF_POPUP) ShowWindow( menu->hWnd, SW_HIDE );
if (menu->wFlags & MF_POPUP)
{
ShowWindow( menu->hWnd, SW_HIDE );
uSubPWndLevel = 0;
}
MENU_SelectItem( hwnd, hmenu, NO_SELECTED_ITEM );
SendMessage( hwnd, WM_MENUSELECT, 0, MAKELONG( 0xffff, 0 ) );
fEndMenuCalled = FALSE;
......@@ -1743,6 +1808,25 @@ LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
return 0;
}
case WM_DESTROY:
/* zero out global pointer in case system popup
* was destroyed by AppExit
*/
if( hwnd == pTopPWnd->hwndSelf )
pTopPWnd = 0;
else
uSubPWndLevel--;
break;
case WM_USER:
if( wParam )
#ifdef WINELIB32
SetWindowLong( hwnd, 0, (HMENU)wParam );
#else
SetWindowWord( hwnd, 0, (HMENU)wParam );
#endif
break;
default:
return DefWindowProc(hwnd, message, wParam, lParam);
}
......@@ -2139,7 +2223,7 @@ BOOL DestroyMenu(HMENU hMenu)
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (!lppop || (lppop->wMagic != MENU_MAGIC)) return FALSE;
lppop->wMagic = 0; /* Mark it as destroyed */
if ((lppop->wFlags & MF_POPUP) && lppop->hWnd)
if ((lppop->wFlags & MF_POPUP) && lppop->hWnd && lppop->hWnd != pTopPWnd->hwndSelf )
DestroyWindow( lppop->hWnd );
if (lppop->hItems)
......
......@@ -129,7 +129,7 @@ break_command:
info_command:
tINFO tBREAK tEOL { DEBUG_InfoBreakpoints(); }
| tINFO tCLASS expr tEOL { CLASS_DumpClass( $3 ); }
| tINFO tCLASS expr tEOL { CLASS_DumpClass( (CLASS *)$3 ); }
| tINFO tMODULE expr tEOL { MODULE_DumpModule( $3 ); }
| tINFO tQUEUE expr tEOL { QUEUE_DumpQueue( $3 ); }
| tINFO tREGS tEOL { DEBUG_InfoRegisters(); }
......
......@@ -71,7 +71,7 @@ void DEBUG_BackTrace(void)
DEBUG_PrintAddress( &addr, 32 );
fprintf( stderr, "\n" );
addr.off = EBP_reg(DEBUG_context);
for (;;)
while (addr.off)
{
FRAME32 *frame = (FRAME32 *)addr.off;
if (!DBG_CHECK_READ_PTR( &addr, sizeof(FRAME32) )) return;
......
......@@ -34,12 +34,13 @@ DLLS = \
toolhelp.spec \
user.spec \
user32.spec \
ver.spec \
w32sys.spec \
win87em.spec \
winprocs.spec \
winprocs32.spec \
winsock.spec \
winspool.spec
winspool.spec \
wprocs.spec \
wprocs32.spec
SPEC_FILES = $(DLLS:.spec=.S)
......
name commdlg
type win16
id 14
1 pascal16 GetOpenFileName(ptr) GetOpenFileName
2 pascal16 GetSaveFileName(ptr) GetSaveFileName
......
name compobj
type win16
id 22
1 pascal CoBuildVersion() CoBuildVersion
2 pascal CoInitialize(long) CoInitialize
......
name ddeml
type win16
id 25
2 stub DdeInitialize #(ptr segptr long long) DdeInitialize
3 stub DdeUnInitialize #(long) DdeUnInitialize
......
name gdi
type win16
id 3
heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
1 pascal SetBkColor(word long) SetBkColor
2 pascal16 SetBkMode(word word) SetBkMode
......
name kernel
type win16
id 1
1 stub FatalExit
2 stub ExitKernel
......
......@@ -31,7 +31,7 @@ base 1
0026 stub CommConfigDialogA
0027 stub CommConfigDialogW
0028 stub CompareFileTime
0029 stub CompareStringA
0029 stdcall CompareStringA(long long ptr long ptr long) CompareStringA
0030 stub CompareStringW
0031 stub ConnectNamedPipe
0032 stub ConsoleMenuControl
......@@ -231,7 +231,7 @@ base 1
0226 stub GetLargestConsoleWindowSize
0227 stdcall GetLastError() GetLastError
0228 stdcall GetLocalTime(ptr) GetLocalTime
0229 stub GetLocaleInfoA
0229 stdcall GetLocaleInfoA(long long ptr long) GetLocaleInfoA
0230 stub GetLocaleInfoW
0231 stub GetLogicalDriveStringsA
0232 stub GetLogicalDriveStringsW
......@@ -257,10 +257,10 @@ base 1
0252 stub GetPrivateProfileIntW
0253 stub GetPrivateProfileSectionA
0254 stub GetPrivateProfileSectionW
0255 stub GetPrivateProfileStringA
0255 stdcall GetPrivateProfileStringA(ptr ptr ptr ptr long ptr) GetPrivateProfileString
0256 stub GetPrivateProfileStringW
0257 stdcall GetProcAddress(long long) WIN32_GetProcAddress
0258 stub GetProcessAffinityMask
0258 stdcall GetProcessAffinityMask(long ptr ptr) GetProcessAffinityMask
0259 stdcall GetProcessHeap() GetProcessHeap
0260 stub GetProcessHeaps
0261 stub GetProcessShutdownParameters
......@@ -270,7 +270,7 @@ base 1
0265 stub GetProfileIntW
0266 stub GetProfileSectionA
0267 stub GetProfileSectionW
0268 stub GetProfileStringA
0268 stdcall GetProfileStringA(ptr ptr ptr ptr long) GetProfileString
0269 stub GetProfileStringW
0270 stub GetQueuedCompletionStatus
0271 stub GetShortPathNameA
......@@ -282,7 +282,7 @@ base 1
0277 stub GetStringTypeExA
0278 stub GetStringTypeExW
0279 stub GetStringTypeW
0280 stub GetSystemDefaultLCID
0280 stdcall GetSystemDefaultLCID() GetSystemDefaultLCID
0281 stub GetSystemDefaultLangID
0282 stub GetSystemDirectoryA
0283 stub GetSystemDirectoryW
......@@ -329,7 +329,7 @@ base 1
0323 stub GlobalGetAtomNameA
0324 stub GlobalGetAtomNameW
0325 stub GlobalHandle
0326 stub GlobalLock
0326 stdcall GlobalLock(long) GlobalLock32
0327 stub GlobalMemoryStatus
0328 stub GlobalReAlloc
0329 stub GlobalSize
......@@ -357,10 +357,10 @@ base 1
0351 stub IsBadCodePtr
0352 stub IsBadHugeReadPtr
0353 stub IsBadHugeWritePtr
0354 stub IsBadReadPtr
0354 stdcall IsBadReadPtr(ptr long) WIN32_IsBadReadPtr
0355 stub IsBadStringPtrA
0356 stub IsBadStringPtrW
0357 stub IsBadWritePtr
0357 stdcall IsBadWritePtr(ptr long) WIN32_IsBadWritePtr
0358 stub IsDBCSLeadByte
0359 stub IsDBCSLeadByteEx
0360 stub IsValidCodePage
......@@ -380,7 +380,7 @@ base 1
0374 stub LocalFlags
0375 stub LocalFree
0376 stub LocalHandle
0377 stub LocalLock
0377 stdcall LocalLock(long) GlobalLock32
0378 stub LocalReAlloc
0379 stub LocalShrink
0380 stub LocalSize
......@@ -502,7 +502,7 @@ base 1
0496 stub SetLastConsoleEventActive
0497 stdcall SetLastError(long) SetLastError
0498 stub SetLocalTime
0499 stub SetLocaleInfoA
0499 stdcall SetLocaleInfoA(long long ptr) SetLocaleInfoA
0500 stub SetLocaleInfoW
0501 stub SetMailslotInfo
0502 stub SetNamedPipeHandleState
......@@ -514,7 +514,7 @@ base 1
0508 stub SetSystemTimeAdjustment
0509 stub SetTapeParameters
0510 stub SetTapePosition
0511 stub SetThreadAffinityMask
0511 stdcall SetThreadAffinityMask(long long) SetThreadAffinityMask
0512 stub SetThreadContext
0513 stub SetThreadLocale
0514 stub SetThreadPriority
......
name keyboard
type win16
id 7
#1 pascal Inquire
#2 pascal Enable
......
name lzexpand
type win16
id 26
1 pascal LZCopy(word word) LZCopy
2 pascal16 LZOpenFile(ptr ptr word) LZOpenFile
......
name mmsystem
type win16
id 10
#1 pascal MMSYSTEM_WEP(word word word ptr) MMSYSTEM_WEP
2 pascal SNDPLAYSOUND(ptr word) sndPlaySound
......
name mouse
type win16
id 13
1 stub INQUIRE
2 stub ENABLE
......
name OLE2
type win16
id 15
1 pascal OleBuildVersion() OleBuildVersion
2 pascal OleInitialize(ptr) OleInitialize
......
name ole2conv
type win16
id 16
1 stub GETFILTERINFO
2 stub IMPORTGR
......
name ole2disp
type win16
id 17
1 stub DLLGETCLASSOBJECT
2 pascal SysAllocString(ptr) SysAllocString
......
name ole2nls
type win16
id 18
1 pascal GetUserDefaultLCID() GetUserDefaultLCID
2 pascal GetSystemDefaultLCID() GetSystemDefaultLCID
......
name ole2prox
type win16
id 19
1 stub DLLGETCLASSOBJECT
#2 WEP
......
name olecli
type win16
id 20
#1 WEP
2 stub OLEDELETE
......
name olesvr
type win16
id 21
#1 WEP
2 pascal OleRegisterServer(ptr ptr ptr word word) OleRegisterServer
......
......@@ -5,7 +5,6 @@
#include <stdio.h>
#include "dlls.h"
#include "global.h"
#include "module.h"
#include "registers.h"
......@@ -19,55 +18,6 @@
dprintf_relay
#endif
#define DLL_ENTRY(name,flags) \
{ #name, name##_Code_Start, name##_Data_Start, \
name##_Module_Start, name##_Module_End, (flags) }
BUILTIN_DLL dll_builtin_table[] =
{
/* Win16 DLLs */
DLL_ENTRY( KERNEL, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( USER, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( GDI, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( WIN87EM, DLL_FLAG_NOT_USED),
DLL_ENTRY( SHELL, 0),
DLL_ENTRY( SOUND, 0),
DLL_ENTRY( KEYBOARD, 0),
DLL_ENTRY( WINSOCK, 0),
DLL_ENTRY( STRESS, 0),
DLL_ENTRY( MMSYSTEM, 0),
DLL_ENTRY( SYSTEM, 0),
DLL_ENTRY( TOOLHELP, 0),
DLL_ENTRY( MOUSE, 0),
DLL_ENTRY( COMMDLG, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2CONV, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2DISP, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2NLS, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2PROX, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLECLI, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLESVR, DLL_FLAG_NOT_USED),
DLL_ENTRY( COMPOBJ, DLL_FLAG_NOT_USED),
DLL_ENTRY( STORAGE, DLL_FLAG_NOT_USED),
DLL_ENTRY( WINPROCS, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( DDEML, DLL_FLAG_NOT_USED),
DLL_ENTRY( LZEXPAND, 0),
DLL_ENTRY( W32SYS, 0),
/* Win32 DLLs */
DLL_ENTRY( ADVAPI32, 0),
DLL_ENTRY( COMCTL32, 0),
DLL_ENTRY( COMDLG32, 0),
DLL_ENTRY( OLE32, 0),
DLL_ENTRY( GDI32, 0),
DLL_ENTRY( KERNEL32, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( SHELL32, 0),
DLL_ENTRY( USER32, 0),
DLL_ENTRY( WINPROCS32, DLL_FLAG_ALWAYS_USED),
DLL_ENTRY( WINSPOOL, 0),
/* Last entry */
{ NULL, }
};
/* Saved 16-bit stack for current process (Win16 only) */
WORD IF1632_Saved16_ss = 0;
WORD IF1632_Saved16_sp = 0;
......@@ -116,17 +66,20 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
void *entry_point, int args32 )
{
STACK16FRAME *frame;
struct dll_table_s *table;
NE_MODULE *pModule;
WORD ordinal;
char *args16, *name;
int i;
if (!debugging_relay) return;
frame = CURRENT_STACK16;
table = &dll_builtin_table[frame->dll_id-1];
name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
printf( "Call %s.%d: %.*s(",
table->name, frame->ordinal_number, *name, name + 1 );
pModule = BUILTIN_GetEntryPoint( frame->entry_cs, frame->entry_ip,
&ordinal, &name );
printf( "Call %.*s.%d: %.*s(",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
ordinal, *name, name + 1 );
args16 = (char *)frame->args;
for (i = 0; i < strlen(args); i++)
......@@ -184,7 +137,8 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
{
STACK16FRAME *frame;
struct dll_table_s *table;
NE_MODULE *pModule;
WORD ordinal;
char *name;
if (*(DWORD *)PTR_SEG_TO_LIN(IF1632_Stack32_base) != 0xDEADBEEF)
......@@ -194,11 +148,14 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
}
if (!debugging_relay) return;
frame = CURRENT_STACK16;
table = &dll_builtin_table[frame->dll_id-1];
name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
printf( "Ret %s.%d: %.*s() ",
table->name, frame->ordinal_number, *name, name + 1 );
frame = CURRENT_STACK16;
pModule = BUILTIN_GetEntryPoint( frame->entry_cs, frame->entry_ip,
&ordinal, &name );
printf( "Ret %.*s.%d: %.*s() ",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
ordinal, *name, name + 1 );
switch(func_type)
{
case 0: /* long */
......@@ -232,12 +189,16 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, int args32 )
*/
void RELAY_Unimplemented16(void)
{
WORD ordinal;
char *name;
STACK16FRAME *frame = CURRENT_STACK16;
struct dll_table_s *table = &dll_builtin_table[frame->dll_id-1];
char *name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
fprintf( stderr, "No handler for routine %s.%d (%.*s)\n",
table->name, frame->ordinal_number, *name, name + 1 );
NE_MODULE *pModule = BUILTIN_GetEntryPoint( frame->entry_cs,
frame->entry_ip,
&ordinal, &name );
fprintf( stderr, "No handler for routine %.*s.%d (%.*s)\n",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
ordinal, *name, name + 1 );
exit(1);
}
......
......@@ -12,70 +12,16 @@
#include <errno.h>
#include "windows.h"
#include "callback.h"
#include "dlls.h"
#include "module.h"
#include "neexe.h"
#include "peexe.h"
#include "relay32.h"
#include "struct32.h"
#include "stackframe.h"
#include "xmalloc.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
typedef struct
{
char *name;
void *definition;
} WIN32_function;
typedef struct
{
int base;
int size;
WIN32_function functions[1];
} WIN32_DLL_INFO;
void *RELAY32_GetEntryPoint(BUILTIN_DLL *dll, char *item, int hint)
{
const WIN32_DLL_INFO *info = (const WIN32_DLL_INFO *)dll->data_start;
int i;
dprintf_module(stddeb, "Looking for %s in %s, hint %x\n",
item ? item: "(no name)", dll->name, hint);
if(!dll) return 0;
/* import by ordinal */
if(!item)
{
if(hint && hint < info->size)
return info->functions[hint - info->base].definition;
return 0;
}
/* hint is correct */
if (hint && hint < info->size &&
info->functions[hint].name &&
strcmp(item,info->functions[hint].name)==0)
return info->functions[hint].definition;
/* hint is incorrect, search for name */
for(i=0;i < info->size;i++)
if (info->functions[i].name && !strcmp(item,info->functions[i].name))
return info->functions[i].definition;
/* function at hint has no name (unimplemented) */
if(hint && hint < info->size && !info->functions[hint].name)
{
/* info->functions[hint].name=xstrdup(item); */
dprintf_module(stddeb,"Returning unimplemented function %s.%d (%s?)\n",
dll->name,hint,item);
return info->functions[hint].definition;
}
return 0;
}
LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
int wParam, LPARAM lParam16)
......
name shell
type win16
id 5
1 pascal RegOpenKey(long ptr ptr) RegOpenKey
2 pascal RegCreateKey(long ptr ptr) RegCreateKey
......@@ -20,12 +19,30 @@ id 5
34 pascal16 ExtractIcon(word ptr s_word) ExtractIcon
36 pascal16 ExtractAssociatedIcon(word ptr ptr) ExtractAssociatedIcon
37 pascal DoEnvironmentSubst(ptr word) DoEnvironmentSubst
38 stub FindEnvironmentString
39 stub InternalExtractIcon
102 pascal16 RegisterShellHook(ptr) RegisterShellHook
103 pascal16 ShellHookProc() ShellHookProc
38 pascal FindEnvironmentString(ptr) FindEnvironmentString
39 pascal16 InternalExtractIcon(word ptr s_word word) InternalExtractIcon
40 stub ExtractIconEx
98 stub SHL3216_THUNKDATA16
99 stub SHL1632_THUNKDATA16
# 8 7 0000 WEP exported, shared data
#100 4 0550 HERETHARBETYGARS exported, shared data
#101 8 010e FINDEXEDLGPROC exported, shared data
# 32 9 0829 WCI exported, shared data
#101 DLLENTRYPOINT #win95 SHELL.DLL
102 pascal16 RegisterShellHook(ptr) RegisterShellHook
103 pascal16 ShellHookProc() ShellHookProc
# 157 RESTARTDIALOG
# 166 PICKICONDLG
262 pascal16 DriveType(long) GetDriveType
# 263 SH16TO32DRIVEIOCTL
# 264 SH16TO32INT2526
# 300 SHGETFILEINFO
# 400 SHFORMATDRIVE
# 401 SHCHECKDRIVE
# 402 _RUNDLLCHECKDRIVE
# 8 WEP
#32 WCI
......@@ -86,7 +86,7 @@ base 1
0081 stub SheShortenPathW
0082 stub ShellAboutA
0083 stub ShellAboutW
0084 stub ShellExecuteA
0084 stdcall ShellExecuteA(word ptr ptr ptr ptr s_word) ShellExecute
0085 stub ShellExecuteEx
0086 stub ShellExecuteExA
0087 stub ShellExecuteExW
......
name sound
type win16
id 6
1 pascal16 OpenSound() OpenSound
2 pascal16 CloseSound() CloseSound
......
name storage
type win16
id 23
1 stub StgCreateDocFile
2 stub StgCreateDocFileOnILockBytes
......
......@@ -2,7 +2,6 @@
#
name stress
type win16
id 9
2 pascal allocmem(long) AllocMem
3 pascal freeallmem() FreeAllMem
......
name system
type win16
id 11
1 stub InquireSystem
2 stub CreateSystemTimer
......
name toolhelp
type win16
id 12
50 pascal16 GlobalHandleToSel(word) GlobalHandleToSel
51 pascal16 GlobalFirst(ptr word) GlobalFirst
......
name user
type win16
id 2
heap 65520
1 pascal16 MessageBox(word ptr ptr word) MessageBox
2 stub OldExitWindows
......@@ -300,7 +300,7 @@ id 2
294 stub LockWindowUpdate
299 register Mouse_Event() Mouse_Event
300 stub UnloadInstalledDrivers
#301 BOZOSLIVEHERE :-))
#301 BOZOSLIVEHERE :-)) <- this is actually EditWndProc
#306 BEAR306
308 pascal DefDlgProc(word word word long) DefDlgProc
309 pascal16 GetClipCursor(ptr) GetClipCursor
......@@ -481,10 +481,10 @@ id 2
652 stub GetKeyboardLayoutList
654 stub UnloadKeyboardLayout
655 stub PostPostedMessages
656 stub DrawFrameControl
656 pascal16 DrawFrameControl(word ptr word word) DrawFrameControl
657 stub DrawCaptionTemp
658 stub DispatchInput
659 stub DrawEdge
659 pascal16 DrawEdge(word ptr word word) DrawEdge
660 stub DrawCaption
661 stub SetSysColorsTemp
662 stub DrawMenubarTemp
......
......@@ -240,7 +240,7 @@ base 1
0228 stub GetCursorPos
0229 stdcall GetDC(long) GetDC
0230 stub GetDCEx
0231 stub GetDesktopWindow
0231 stdcall GetDesktopWindow() GetDesktopWindow
0232 stub GetDialogBaseUnits
0233 stub GetDlgCtrlID
0234 stdcall GetDlgItem(long long) GetDlgItem
......@@ -298,8 +298,8 @@ base 1
0286 stub GetShellWindow
0287 stub GetSubMenu
0288 stdcall GetSysColor(long) GetSysColor
0289 stub GetSysColorBrush
0290 stub GetSystemMenu
0289 stdcall GetSysColorBrush(long) GetSysColorBrush
0290 stdcall GetSystemMenu(long long) GetSystemMenu
0291 stdcall GetSystemMetrics(long) GetSystemMetrics
0292 stub GetTabbedTextExtentA
0293 stub GetTabbedTextExtentW
......@@ -310,14 +310,14 @@ base 1
0298 stub GetUserObjectInformationA
0299 stub GetUserObjectInformationW
0300 stub GetUserObjectSecurity
0301 stub GetWindow
0301 stdcall GetWindow(long long) GetWindow
0302 stub GetWindowContextHelpId
0303 stdcall GetWindowDC(long) GetWindowDC
0304 stub GetWindowLongA
0305 stub GetWindowLongW
0306 stub GetWindowPlacement
0307 stub GetWindowRect
0308 stub GetWindowTextA
0308 stdcall GetWindowTextA(long segptr long) WIN16_GetWindowText
0309 stub GetWindowTextLengthA
0310 stub GetWindowTextLengthW
0311 stub GetWindowTextW
......@@ -398,7 +398,7 @@ base 1
0386 stub MenuItemFromPoint
0387 stub MenuWindowProcA
0388 stub MenuWindowProcW
0389 stub MessageBeep
0389 stdcall MessageBeep(long) MessageBeep
0390 stdcall MessageBoxA(long ptr ptr long) MessageBox
0391 stub MessageBoxExA
0392 stub MessageBoxExW
......
name ver
type win16
#1 DLLENTRYPOINT
2 pascal GetFileResourceSize(ptr segptr segptr ptr) GetFileResourceSize
3 pascal GetFileResource(ptr segptr segptr long long ptr) GetFileResource
6 pascal GetFileVersionInfoSize(ptr ptr) GetFileVersionInfoSize
7 pascal GetFileVersionInfo(ptr long long ptr) GetFileVersionInfo
8 pascal VerFindFile(word ptr ptr ptr ptr ptr ptr ptr) VerFindFile
9 pascal VerInstallFile(word ptr ptr ptr ptr ptr ptr ptr) VerInstallFile
10 pascal VerLanguageName(word ptr word) VerLanguageName
11 pascal VerQueryValue(segptr ptr ptr ptr) VerQueryValue
20 stub GETFILEVERSIONINFORAW
#21 VERFTHK_THUNKDATA16
#22 VERTHKSL_THUNKDATA16
name w32sys
type win16
id 27
#1 WEP
2 stub ISPEFORMAT
......
name win87em
type win16
id 4
1 register _fpMath() WIN87_fpmath
3 pascal16 __WinEm87Info(ptr word) WIN87_WinEm87Info
......
......@@ -5,7 +5,6 @@
#
name winsock
type win16
id 8
1 pascal16 accept(word ptr ptr) WINSOCK_accept
2 pascal16 bind(word ptr word) WINSOCK_bind
......
name winprocs
name wprocs
type win16
id 24
1 pascal ButtonWndProc(word word word long) ButtonWndProc
2 pascal StaticWndProc(word word word long) StaticWndProc
......
name winprocs32
name wprocs32
type win32
1 stdcall ButtonWndProc(long long long long) ButtonWndProc32
......
/* XPM */
static char * obm_trtype[] = {
"14 14 3 1",
" s white c white",
". s black c black",
"o s dkgray c #808080",
" ",
" oooooooo ",
" oo oo oo ",
" o oo o ",
" o o........ ",
" o.. .. .. ",
" o. .. . ",
" o. .. . ",
" oo .. ",
" ooooooo.. ",
" .. ",
" .. ",
" ...... ",
" "};
......@@ -11,30 +11,21 @@
#define CLASS_MAGIC 0x4b4e /* 'NK' */
#ifndef WINELIB
#pragma pack(1)
#endif
/* !! Don't change this structure (see GetClassLong()) */
typedef struct tagCLASS
{
HCLASS hNext; /* Next class */
WORD wMagic; /* Magic number (must be CLASS_MAGIC) */
ATOM atomName; /* Name of the class */
HANDLE hdce; /* Class DCE (if CS_CLASSDC) */
WORD cWindows; /* Count of existing windows of this class */
WNDCLASS wc WINE_PACKED; /* Class information */
WORD wExtra[1]; /* Class extra bytes */
struct tagCLASS *next; /* Next class */
HCLASS self; /* Handle to this class */
WORD wMagic; /* Magic number (must be CLASS_MAGIC) */
ATOM atomName; /* Name of the class */
HANDLE hdce; /* Class DCE (if CS_CLASSDC) */
WORD cWindows; /* Count of existing windows of this class */
WNDCLASS wc; /* Class information */
WORD wExtra[1]; /* Class extra bytes */
} CLASS;
#ifndef WINELIB
#pragma pack(4)
#endif
extern void CLASS_DumpClass( HCLASS hClass );
extern void CLASS_DumpClass( CLASS *class );
extern void CLASS_WalkClasses(void);
extern HCLASS CLASS_FindClassByName( SEGPTR name, HINSTANCE hinstance,
CLASS **ptr );
extern CLASS * CLASS_FindClassPtr( HCLASS hclass );
extern void CLASS_FreeModuleClasses( HMODULE hModule );
extern CLASS * CLASS_FindClassByName( SEGPTR name, HINSTANCE hinstance );
#endif /* CLASS_H */
/*
* Copyright Robert J. Amstadt, 1993
*/
#ifndef __WINE_DLLS_H
#define __WINE_DLLS_H
#include "wintypes.h"
typedef struct dll_table_s
{
char *name; /* DLL name */
const BYTE *code_start; /* 32-bit address of DLL code */
const BYTE *data_start; /* 32-bit address of DLL data */
BYTE *module_start; /* 32-bit address of the module data */
BYTE *module_end;
int flags; /* flags (see below) */
HMODULE hModule; /* module created for this DLL */
} BUILTIN_DLL;
/* DLL flags */
#define DLL_FLAG_NOT_USED 0x01 /* Use original Windows DLL if possible */
#define DLL_FLAG_ALWAYS_USED 0x02 /* Always use built-in DLL */
#define DLL_FLAG_WIN32 0x04 /* DLL is a Win32 DLL */
#define DECLARE_DLL(name) \
extern const BYTE name##_Code_Start[]; \
extern const BYTE name##_Data_Start[]; \
extern BYTE name##_Module_Start[]; \
extern BYTE name##_Module_End[];
/* 16-bit DLLs */
DECLARE_DLL(KERNEL)
DECLARE_DLL(USER)
DECLARE_DLL(GDI)
DECLARE_DLL(WIN87EM)
DECLARE_DLL(MMSYSTEM)
DECLARE_DLL(SHELL)
DECLARE_DLL(SOUND)
DECLARE_DLL(KEYBOARD)
DECLARE_DLL(WINSOCK)
DECLARE_DLL(STRESS)
DECLARE_DLL(SYSTEM)
DECLARE_DLL(TOOLHELP)
DECLARE_DLL(MOUSE)
DECLARE_DLL(COMMDLG)
DECLARE_DLL(OLE2)
DECLARE_DLL(OLE2CONV)
DECLARE_DLL(OLE2DISP)
DECLARE_DLL(OLE2NLS)
DECLARE_DLL(OLE2PROX)
DECLARE_DLL(OLECLI)
DECLARE_DLL(OLESVR)
DECLARE_DLL(COMPOBJ)
DECLARE_DLL(STORAGE)
DECLARE_DLL(WINPROCS)
DECLARE_DLL(DDEML)
DECLARE_DLL(LZEXPAND)
DECLARE_DLL(W32SYS)
/* 32-bit DLLs */
DECLARE_DLL(ADVAPI32)
DECLARE_DLL(COMCTL32)
DECLARE_DLL(COMDLG32)
DECLARE_DLL(OLE32)
DECLARE_DLL(GDI32)
DECLARE_DLL(KERNEL32)
DECLARE_DLL(SHELL32)
DECLARE_DLL(USER32)
DECLARE_DLL(WINPROCS32)
DECLARE_DLL(WINSPOOL)
extern BUILTIN_DLL dll_builtin_table[];
#endif /* __WINE_DLLS_H */
......@@ -258,7 +258,6 @@ typedef struct tagDC
#else
extern LPSTR GDI_Heap;
extern WORD GDI_HeapSel;
#define GDI_HEAP_ALLOC(size) \
......
/*
* Win32 heap definitions
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_HEAP_H
#define __WINE_HEAP_H
#include "winbase.h"
#include "winnt.h"
extern HANDLE32 SystemHeap;
#endif /* __WINE_HEAP_H */
......@@ -4,8 +4,8 @@
* Copyright 1994 Alexandre Julliard
*/
#ifndef HOOK_H
#define HOOK_H
#ifndef __WINE_HOOK_H
#define __WINE_HOOK_H
#include "windows.h"
#include "ldt.h"
......@@ -34,5 +34,7 @@ typedef struct
extern DWORD HOOK_CallHooks( short id, short code,
WPARAM wParam, LPARAM lParam );
extern void HOOK_FreeModuleHooks( HMODULE hModule );
extern void HOOK_FreeQueueHooks( HQUEUE hQueue );
#endif /* HOOK_H */
#endif /* __WINE_HOOK_H */
......@@ -119,14 +119,4 @@ typedef struct
#define FILE_ATTRIBUTE_ATOMIC_WRITE 0x0200
#define FILE_ATTRIBUTE_XACTION_WRITE 0x0400
/* Could this type be considered opaque? */
typedef struct {
LPVOID DebugInfo;
LONG LockCount;
LONG RecursionCount;
HANDLE OwningThread;
HANDLE LockSemaphore;
DWORD Reserved;
}CRITICAL_SECTION;
#endif /* __WINE_KERNEL32_H */
......@@ -35,14 +35,14 @@ typedef struct
HWND flagChildMaximized;
HWND hwndActiveChild;
HMENU hWindowMenu;
WORD idFirstChild; /* order is 3.1-like up to this point */
WORD idFirstChild;
HANDLE hFrameTitle;
WORD sbNeedUpdate;
WORD sbRecalc;
HBITMAP obmClose;
HBITMAP obmRestore;
HWND hwndHitTest;
HWND self;
} MDICLIENTINFO;
#endif /* MDI_H */
......@@ -94,6 +94,10 @@ typedef struct
SEGPTR reserved;
} LOADPARAMS;
/* Resource types */
typedef struct resource_typeinfo_s NE_TYPEINFO;
typedef struct resource_nameinfo_s NE_NAMEINFO;
#define NE_SEG_TABLE(pModule) \
((SEGTABLEENTRY *)((char *)(pModule) + (pModule)->seg_table))
......@@ -111,20 +115,30 @@ typedef struct
#pragma pack(4)
#endif
extern BOOL MODULE_Init(void);
/* module.c */
extern NE_MODULE *MODULE_GetPtr( HMODULE hModule );
extern void MODULE_DumpModule( HMODULE hmodule );
extern void MODULE_WalkModules(void);
extern int MODULE_OpenFile( HMODULE hModule );
extern LPSTR MODULE_GetModuleName( HMODULE hModule );
extern void MODULE_RegisterModule( HMODULE hModule );
extern void MODULE_RegisterModule( NE_MODULE *pModule );
extern HINSTANCE MODULE_GetInstance( HMODULE hModule );
extern WORD MODULE_GetOrdinal( HMODULE hModule, const char *name );
extern SEGPTR MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal );
extern BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset );
extern LPSTR MODULE_GetEntryPointName( HMODULE hModule, WORD ordinal );
extern FARPROC MODULE_GetWndProcEntry16( const char *name );
extern FARPROC MODULE_GetWndProcEntry32( const char *name );
/* builtin.c */
extern BOOL BUILTIN_Init(void);
extern HMODULE BUILTIN_LoadModule( LPCSTR name, BOOL force );
extern NE_MODULE *BUILTIN_GetEntryPoint( WORD cs, WORD ip,
WORD *pOrd, char **ppName );
extern DWORD BUILTIN_GetProcAddress32( NE_MODULE *pModule, char *function );
extern BOOL BUILTIN_ParseDLLOptions( const char *str );
extern void BUILTIN_PrintDLLs(void);
/* ne_image.c */
extern BOOL NE_LoadSegment( HMODULE hModule, WORD segnum );
extern void NE_FixupPrologs( NE_MODULE *pModule );
extern void NE_InitializeDLLs( HMODULE hModule );
......
......@@ -19,7 +19,8 @@ typedef enum
LANG_Da, /* Danish */
LANG_Cz, /* Czech */
LANG_Eo, /* Esperanto */
LANG_It /* Italian */
LANG_It, /* Italian */
LANG_Ko /* Korean */
} WINE_LANGUAGE;
extern const char *langNames[];
......
......@@ -3,7 +3,6 @@
#include <sys/types.h>
#include "windows.h"
#include "dlls.h"
struct pe_data {
struct pe_header_s *pe_header;
......
......@@ -7,11 +7,8 @@
#ifndef __WINE_RELAY32_H
#define __WINE_RELAY32_H
#include "dlls.h"
#include "struct32.h"
void *RELAY32_GetEntryPoint(BUILTIN_DLL *dll, char *item, int hint);
typedef struct tagWNDCLASSA{
UINT style;
WNDPROC lpfnWndProc;
......
......@@ -19,11 +19,11 @@ typedef struct
{
WORD saved_ss; /* saved previous 16-bit stack */
WORD saved_sp;
WORD es;
WORD ds; /* 16-bit ds */
DWORD entry_point WINE_PACKED; /* entry point to call */
WORD ordinal_number; /* ordinal number of entry point */
WORD dll_id; /* DLL id of entry point */
WORD entry_ip; /* ip of entry point */
WORD ds; /* ds */
WORD entry_cs; /* cs of entry point */
WORD es; /* es */
DWORD entry_point WINE_PACKED; /* 32-bit entry point to call */
WORD bp; /* 16-bit bp */
WORD ip; /* return address */
WORD cs;
......
......@@ -10,9 +10,6 @@
#include "ldt.h"
#include "local.h"
extern BOOL USER_HeapInit(void);
/* USER local heap */
#ifdef WINELIB
#define USER_HEAP_ALLOC(size) LocalAlloc (LMEM_FIXED, size)
......@@ -23,7 +20,6 @@ extern BOOL USER_HeapInit(void);
#else /* WINELIB */
extern LPSTR USER_Heap;
extern WORD USER_HeapSel;
#define USER_HEAP_ALLOC(size) \
......
/* Definitions for the VERsion infolibrary (VER.DLL)
*
* Copyright 1996 Marcus Meissner
*/
#ifndef __WINE_VER_H
#define __WINE_VER_H
#include "windows.h"
/* resource ids for different version infos */
#define VS_FILE_INFO MAKEINTRESOURCE(16)
#define VS_VERSION_INFO MAKEINTRESOURCE(1)
#define VS_USER_INFO MAKEINTRESOURCE(100)
#define VS_FFI_SIGNATURE 0xfeef04bdL /* FileInfo Magic */
#define VS_FFI_STRUCVERSION 0x00010000L /* struc version 1.0 */
#define VS_FFI_FILEFLAGSMASK 0x0000003fL /* valid flags */
/* VS_VERSION.dwFileFlags */
#define VS_FF_DEBUG 0x01L
#define VS_FF_PRERELEASE 0x02L
#define VS_FF_PATCHED 0x04L
#define VS_FF_PRIVATEBUILD 0x08L
#define VS_FF_INFOINFERRED 0x10L
#define VS_FF_SPECIALBUILD 0x20L
/* VS_VERSION.dwFileOS */
/* major os version */
#define VOS_UNKNOWN 0x00000000L
#define VOS_DOS 0x00010000L
#define VOS_OS216 0x00020000L
#define VOS_OS232 0x00030000L
#define VOS_NT 0x00040000L
/* minor os version */
#define VOS__BASE 0x00000000L
#define VOS__WINDOWS16 0x00000001L
#define VOS__PM16 0x00000002L
#define VOS__PM32 0x00000003L
#define VOS__WINDOWS32 0x00000004L
/* possible versions */
#define VOS_DOS_WINDOWS16 (VOS_DOS|VOS__WINDOWS16)
#define VOS_DOS_WINDOWS32 (VOS_DOS|VOS__WINDOWS32)
#define VOS_OS216_PM16 (VOS_OS216|VOS__PM16)
#define VOS_OS232_PM32 (VOS_OS232|VOS__PM32)
#define VOS_NT_WINDOWS32 (VOS_NT|VOS__WINDOWS32)
/* VS_VERSION.dwFileType */
#define VFT_UNKNOWN 0x00000000L
#define VFT_APP 0x00000001L
#define VFT_DLL 0x00000002L
#define VFT_DRV 0x00000003L
#define VFT_FONT 0x00000004L
#define VFT_VXD 0x00000005L
/* ??one type missing?? 0x00000006L -Marcus */
#define VFT_STATIC_LIB 0x00000007L
/* VS_VERSION.dwFileSubtype for VFT_DRV */
#define VFT2_UNKNOWN 0x00000000L
#define VFT2_DRV_PRINTER 0x00000001L
#define VFT2_DRV_KEYBOARD 0x00000002L
#define VFT2_DRV_LANGUAGE 0x00000003L
#define VFT2_DRV_DISPLAY 0x00000004L
#define VFT2_DRV_MOUSE 0x00000005L
#define VFT2_DRV_NETWORK 0x00000006L
#define VFT2_DRV_SYSTEM 0x00000007L
#define VFT2_DRV_INSTALLABLE 0x00000008L
#define VFT2_DRV_SOUND 0x00000009L
#define VFT2_DRV_COMM 0x0000000aL
#define VFT2_DRV_INPUTMETHOD 0x0000000bL
/* VS_VERSION.dwFileSubtype for VFT_FONT */
#define VFT2_FONT_RASTER 0x00000001L
#define VFT2_FONT_VECTOR 0x00000002L
#define VFT2_FONT_TRUETYPE 0x00000003L
/* VerFindFile Flags */
/* input */
#define VFFF_ISSHAREDFILE 0x0001
/* output (returned) */
#define VFF_CURNEDEST 0x0001
#define VFF_FILEINUSE 0x0002
#define VFF_BUFFTOSMALL 0x0003
/* VerInstallFile Flags */
/* input */
#define VIFF_FORCEINSTALL 0x0001
#define VIFF_DONTDELETEOLD 0x0002
/* output (return) */
#define VIF_TEMPFILE 0x00000001L
#define VIF_MISMATCH 0x00000002L
#define VIF_SRCOLD 0x00000004L
#define VIF_DIFFLANG 0x00000008L
#define VIF_DIFFCODEPG 0x00000010L
#define VIF_DIFFTYPE 0x00000020L
#define VIF_WRITEPROT 0x00000040L
#define VIF_FILEINUSE 0x00000080L
#define VIF_OUTOFSPACE 0x00000100L
#define VIF_ACCESSVIOLATION 0x00000200L
#define VIF_SHARINGVIOLATION 0x00000400L
#define VIF_CANNOTCREATE 0x00000800L
#define VIF_CANNOTDELETE 0x00001000L
#define VIF_CANNOTRENAME 0x00002000L
#define VIF_CANNOTDELETECUR 0x00004000L
#define VIF_OUTOFMEMORY 0x00008000L
#define VIF_CANNOTREADSRC 0x00010000L
#define VIF_CANNOTREADDST 0x00020000L
#define VIF_BUFTOSMALL 0x00040000L
typedef struct tagVS_FIXEDFILEINFO {
DWORD dwSignature;
DWORD dwStrucVersion;
DWORD dwFileVersionMS;
DWORD dwFileVersionLS;
DWORD dwProductVersionMS;
DWORD dwProductVersionLS;
DWORD dwFileFlagsMask;
DWORD dwFileFlags;
DWORD dwFileOS;
DWORD dwFileType;
DWORD dwFileSubtype;
DWORD dwFileDateMS;
DWORD dwFileDateLS;
} VS_FIXEDFILEINFO;
DWORD WINAPI
GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid,LPDWORD off);
DWORD WINAPI
GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
DWORD off,DWORD reslen,LPVOID data
);
DWORD WINAPI
GetFileVersionInfoSize(LPCSTR filename,LPDWORD handle);
DWORD WINAPI
GetFileVersionInfo(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
DWORD WINAPI
VerFindFile(
UINT flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT *curdirlen,LPSTR destdir,UINT*destdirlen
);
DWORD WINAPI
VerInstallFile(
UINT flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT*tmpfilelen
);
DWORD WINAPI
VerLanguageName(UINT lang,LPSTR langname,UINT langnamelen);
DWORD WINAPI
VerQueryValue(SEGPTR block,LPCSTR subblock,SEGPTR *buffer,UINT *buflen);
/*
20 GETFILEVERSIONINFORAW
21 VERFTHK_THUNKDATA16
22 VERTHKSL_THUNKDATA16
*/
#endif /* __WINE_VER_H */
......@@ -29,35 +29,35 @@
typedef struct tagWND
{
struct tagWND *next; /* Next sibling */
struct tagWND *child; /* First child */
struct tagWND *parent; /* Window parent (from CreateWindow) */
struct tagWND *owner; /* Window owner */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND hwndSelf; /* Handle of this window */
HCLASS hClass; /* Window class */
HANDLE hInstance; /* Window hInstance (from CreateWindow) */
RECT rectClient; /* Client area rel. to parent client area */
RECT rectWindow; /* Whole window rel. to parent client area */
RECT rectNormal; /* Window rect. when in normal state */
POINT ptIconPos; /* Icon position */
POINT ptMaxPos; /* Maximized window position */
HGLOBAL hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HWND hwndLastActive; /* Last active popup hwnd */
WNDPROC lpfnWndProc; /* Window procedure */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HANDLE hVScroll; /* Vertical scroll-bar info */
HANDLE hHScroll; /* Horizontal scroll-bar info */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
HANDLE hText; /* Handle of window text */
WORD flags; /* Misc. flags (see below) */
Window window; /* X window (only for top-level windows) */
HMENU hSysMenu; /* window's copy of System Menu */
HANDLE hProp; /* Handle of Properties List */
WORD wExtra[1]; /* Window extra bytes */
struct tagWND *next; /* Next sibling */
struct tagWND *child; /* First child */
struct tagWND *parent; /* Window parent (from CreateWindow) */
struct tagWND *owner; /* Window owner */
CLASS *class; /* Window class */
DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
HWND hwndSelf; /* Handle of this window */
HANDLE hInstance; /* Window hInstance (from CreateWindow) */
RECT rectClient; /* Client area rel. to parent client area */
RECT rectWindow; /* Whole window rel. to parent client area */
RECT rectNormal; /* Window rect. when in normal state */
POINT ptIconPos; /* Icon position */
POINT ptMaxPos; /* Maximized window position */
HGLOBAL hmemTaskQ; /* Task queue global memory handle */
HRGN hrgnUpdate; /* Update region */
HWND hwndLastActive;/* Last active popup hwnd */
WNDPROC lpfnWndProc; /* Window procedure */
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
HANDLE hdce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
HANDLE hVScroll; /* Vertical scroll-bar info */
HANDLE hHScroll; /* Horizontal scroll-bar info */
UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
HANDLE hText; /* Handle of window text */
WORD flags; /* Misc. flags (see below) */
Window window; /* X window (only for top-level windows) */
HMENU hSysMenu; /* window's copy of System Menu */
HANDLE hProp; /* Handle of Properties List */
WORD wExtra[1]; /* Window extra bytes */
} WND;
/* WND flags values */
......@@ -71,9 +71,6 @@ typedef struct tagWND
#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
#define WIN_CLASS_INFO(wndPtr) (CLASS_FindClassPtr((wndPtr)->hClass)->wc)
#define WIN_CLASS_STYLE(wndPtr) (WIN_CLASS_INFO(wndPtr).style)
/* Window functions */
extern WND *WIN_FindWndPtr( HWND hwnd );
extern WND *WIN_GetDesktop(void);
......
......@@ -102,6 +102,15 @@ typedef struct
int ss;
} exception_info;
/* Could this type be considered opaque? */
typedef struct {
LPVOID DebugInfo;
LONG LockCount;
LONG RecursionCount;
HANDLE OwningThread;
HANDLE LockSemaphore;
DWORD Reserved;
}CRITICAL_SECTION;
/*DWORD WINAPI GetVersion( void );*/
......
......@@ -1371,6 +1371,7 @@ typedef struct tagCOMSTAT
#define OBM_FLOPPY 32731
#define OBM_HDISK 32730
#define OBM_CDROM 32729
#define OBM_TRTYPE 32728
#define OBM_OLD_CLOSE 32767
#define OBM_SIZE 32766
......@@ -2811,7 +2812,7 @@ int ExcludeVisRect(HDC,short,short,short,short);
BOOL ExitWindows(DWORD,WORD);
BOOL ExtFloodFill(HDC,INT,INT,COLORREF,WORD);
BOOL ExtTextOut(HDC,short,short,WORD,LPRECT,LPSTR,WORD,LPINT);
HICON ExtractIcon(HINSTANCE,LPCSTR,UINT);
HICON ExtractIcon(HINSTANCE,LPCSTR,WORD);
WORD FarGetOwner(HANDLE);
void FarSetOwner(HANDLE,HANDLE);
void FatalAppExit(UINT,LPCSTR);
......
......@@ -19,6 +19,11 @@
# endif
#endif
typedef short INT16;
typedef unsigned short UINT16;
typedef int INT32;
typedef unsigned int UINT32;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned short BOOL;
......@@ -42,8 +47,9 @@ typedef WORD NPVOID;
typedef DWORD SEGPTR;
#endif /* WINELIB32 */
typedef UINT16 HANDLE16;
typedef UINT32 HANDLE32;
typedef UINT HANDLE;
typedef DWORD HANDLE32;
typedef UINT WPARAM;
typedef LONG LPARAM;
typedef LONG LRESULT;
......@@ -69,7 +75,10 @@ typedef WORD *LPCATCHBUF;
typedef DWORD ACCESS_MASK;
typedef ACCESS_MASK REGSAM;
#define DECLARE_HANDLE(a) typedef HANDLE a;
#define DECLARE_HANDLE(a) \
typedef HANDLE a; \
typedef HANDLE16 a##16; \
typedef HANDLE32 a##32;
DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HBRUSH);
......
/*
* USER definitions
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_WINUSER_H
#define __WINE_WINUSER_H
#include "wintypes.h"
/* Window classes */
typedef struct
{
UINT32 style;
WNDPROC32 lpfnWndProc;
INT32 cbClsExtra;
INT32 cbWndExtra;
HINSTANCE32 hInstance;
HICON32 hIcon;
HCURSOR32 hCursor;
HBRUSH32 hbrBackground;
LPCSTR lpszMenuName;
LPCSTR lpszClassName;
} WNDCLASS32A, *LPWNDCLASS32A;
typedef struct
{
UINT32 style;
WNDPROC32 lpfnWndProc;
INT32 cbClsExtra;
INT32 cbWndExtra;
HINSTANCE32 hInstance;
HICON32 hIcon;
HCURSOR32 hCursor;
HBRUSH32 hbrBackground;
LPCWSTR lpszMenuName;
LPCWSTR lpszClassName;
} WNDCLASS32W, *LPWNDCLASS32W;
typedef struct
{
UINT16 style;
WNDPROC lpfnWndProc WINE_PACKED;
INT16 cbClsExtra;
INT16 cbWndExtra;
HANDLE16 hInstance;
HICON16 hIcon;
HCURSOR16 hCursor;
HBRUSH16 hbrBackground;
SEGPTR lpszMenuName WINE_PACKED;
SEGPTR lpszClassName WINE_PACKED;
} WNDCLASS16, *LPWNDCLASS16;
typedef struct
{
UINT32 cbSize;
UINT32 style;
WNDPROC32 lpfnWndProc;
INT32 cbClsExtra;
INT32 cbWndExtra;
HINSTANCE32 hInstance;
HICON32 hIcon;
HCURSOR32 hCursor;
HBRUSH32 hbrBackground;
LPCSTR lpszMenuName;
LPCSTR lpszClassName;
HICON32 hIconSm;
} WNDCLASSEX32A, *LPWNDCLASSEX32A;
typedef struct
{
UINT32 cbSize;
UINT32 style;
WNDPROC32 lpfnWndProc;
INT32 cbClsExtra;
INT32 cbWndExtra;
HINSTANCE32 hInstance;
HICON32 hIcon;
HCURSOR32 hCursor;
HBRUSH32 hbrBackground;
LPCWSTR lpszMenuName;
LPCWSTR lpszClassName;
HICON32 hIconSm;
} WNDCLASSEX32W, *LPWNDCLASSEX32W;
typedef void WNDCLASSEX16; /* There's no WNDCLASSEX in Win16 */
DECL_WINELIB_TYPE_AW(WNDCLASS);
DECL_WINELIB_TYPE_AW(LPWNDCLASS);
DECL_WINELIB_TYPE_AW(WNDCLASSEX);
DECL_WINELIB_TYPE_AW(LPWNDCLASSEX);
#endif /* __WINE_WINUSER_H */
......@@ -129,11 +129,6 @@ HGLOBAL GlobalHandle(LPCVOID a)
return 0;
}
void *RELAY32_GetEntryPoint(BUILTIN_DLL *dll, char *item, int hint)
{
return NULL;
}
extern LRESULT ACTIVATEAPP_callback(HWND,UINT,WPARAM,LPARAM);
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ButtonWndProc(HWND,UINT,WPARAM,LPARAM);
......@@ -166,7 +161,7 @@ LRESULT ErrorProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
/***********************************************************************
* MODULE_GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WINPROCS dll.
* Return an entry point from the WPROCS dll.
*/
WNDPROC MODULE_GetWndProcEntry16( char *name )
{
......@@ -201,7 +196,7 @@ WNDPROC MODULE_GetWndProcEntry16( char *name )
/***********************************************************************
* MODULE_GetWndProcEntry32 (not a Windows API function)
*
* Return an entry point from the WINPROCS32 dll.
* Return an entry point from the WPROCS32 dll.
*/
WNDPROC MODULE_GetWndProcEntry32( char *name )
{
......
......@@ -2,6 +2,7 @@ TOPSRC = @top_srcdir@
MODULE = loader
C_SRCS = \
builtin.c \
main.c \
module.c \
ne_image.c \
......
......@@ -16,7 +16,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "task.h"
#include "selectors.h"
#include "comm.h"
#include "user.h"
#include "win.h"
#include "menu.h"
#include "kernel32.h"
......@@ -28,8 +27,8 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "syscolor.h"
#include "sysmetrics.h"
#include "gdi.h"
#include "heap.h"
#include "debugger.h"
#include "dlls.h"
#include "miscemu.h"
#include "neexe.h"
#include "options.h"
......@@ -42,6 +41,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
void init_wine_signals(void);
HANDLE32 SystemHeap = 0;
/***********************************************************************
* Main initialisation routine
......@@ -52,6 +52,9 @@ int MAIN_Init(void)
int queueSize;
/* Create the system heap */
if (!(SystemHeap = HeapCreate( HEAP_GROWABLE, 0x10000, 0 ))) return 0;
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return 0;
......@@ -61,10 +64,10 @@ int MAIN_Init(void)
#ifndef WINELIB
/* Initialize relay code */
if (!RELAY_Init()) return 0;
#endif
/* Create built-in modules */
if (!MODULE_Init()) return 0;
if (!BUILTIN_Init()) return 0;
#endif
/* Initialise DOS drives */
if (!DRIVE_Init()) return 0;
......@@ -90,9 +93,6 @@ int MAIN_Init(void)
/* Initialize the DOS memory */
if (!INT21_Init()) return 0;
/* Create USER heap */
if (!USER_HeapInit()) return 0;
#endif
/* Global atom table initialisation */
......
......@@ -11,10 +11,11 @@
#include <sys/types.h>
#include <unistd.h>
#include "windows.h"
#include "dlls.h"
#include "class.h"
#include "dos_fs.h"
#include "file.h"
#include "global.h"
#include "hook.h"
#include "ldt.h"
#include "module.h"
#include "neexe.h"
......@@ -35,96 +36,6 @@ static HMODULE hCachedModule = 0; /* Module cached by MODULE_OpenFile */
#ifndef WINELIB
static HANDLE hInitialStack32 = 0;
#endif
/***********************************************************************
* MODULE_LoadBuiltin
*
* 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.
*/
#ifndef WINELIB
static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
{
HMODULE hModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
BUILTIN_DLL *table;
char dllname[16], *p;
/* Fix the name in case we have a full path and extension */
if ((p = strrchr( name, '\\' ))) name = p + 1;
lstrcpyn( dllname, name, sizeof(dllname) );
if ((p = strrchr( dllname, '.' ))) *p = '\0';
for (table = dll_builtin_table; table->name; table++)
if (!lstrcmpi( table->name, dllname )) break;
if (!table->name) return 0;
if ((table->flags & DLL_FLAG_NOT_USED) && !force) return 0;
hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, table->module_start,
table->module_end - table->module_start,
0, FALSE, FALSE, FALSE, NULL );
if (!hModule) return 0;
FarSetOwner( hModule, hModule );
table->hModule = hModule;
dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n",
table->name, hModule );
pModule = (NE_MODULE *)GlobalLock( hModule );
pModule->self = hModule;
if (pModule->flags & NE_FFLAGS_WIN32)
{
pModule->pe_module = (PE_MODULE *)table;
}
else /* Win16 module */
{
/* Allocate the code segment */
pSegTable = NE_SEG_TABLE( pModule );
pSegTable->selector = GLOBAL_CreateBlock(GMEM_FIXED, table->code_start,
pSegTable->minsize, hModule,
TRUE, TRUE, FALSE, NULL );
if (!pSegTable->selector) return 0;
pSegTable++;
/* Allocate the data segment */
pSegTable->selector = GLOBAL_Alloc( GMEM_FIXED, pSegTable->minsize,
hModule, FALSE, FALSE, FALSE );
if (!pSegTable->selector) return 0;
memcpy( GlobalLock( pSegTable->selector ),
table->data_start, pSegTable->minsize );
}
pModule->next = hFirstModule;
hFirstModule = hModule;
return hModule;
}
#endif
/***********************************************************************
* MODULE_Init
*
* Create the built-in modules.
*/
BOOL MODULE_Init(void)
{
#ifndef WINELIB32
BUILTIN_DLL *dll;
/* Load all modules marked as always used */
for (dll = dll_builtin_table; dll->name; dll++)
if (dll->flags & DLL_FLAG_ALWAYS_USED)
if (!MODULE_LoadBuiltin(dll->name, TRUE)) return FALSE;
#endif
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
MODULE_SetEntryPoint( GetModuleHandle( "KERNEL" ), 178, GetWinFlags() );
return TRUE;
}
/***********************************************************************
......@@ -358,7 +269,7 @@ static WORD MODULE_Ne2MemFlags(WORD flags)
}
/***********************************************************************
* MODULE_AllocateSegment (WINPROCS.26)
* MODULE_AllocateSegment (WPROCS.26)
*/
DWORD MODULE_AllocateSegment(WORD wFlags, WORD wSize, WORD wElem)
......@@ -410,7 +321,7 @@ static BOOL MODULE_CreateSegments( HMODULE hModule )
* MODULE_GetInstance
*/
#ifndef WINELIB32
static HINSTANCE MODULE_GetInstance( HMODULE hModule )
HINSTANCE MODULE_GetInstance( HMODULE hModule )
{
SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
......@@ -462,7 +373,7 @@ HINSTANCE MODULE_CreateInstance( HMODULE hModule, LOADPARAMS *params )
/***********************************************************************
* MODULE_LoadExeHeader
*/
HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs )
static HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs )
{
struct mz_header_s mz_header;
struct ne_header_s ne_header;
......@@ -677,8 +588,7 @@ HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs )
}
else pModule->dlls_to_init = 0;
pModule->next = hFirstModule;
hFirstModule = hModule;
MODULE_RegisterModule( pModule );
return hModule;
#undef READ
}
......@@ -844,45 +754,9 @@ BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset )
/***********************************************************************
* MODULE_GetEntryPointName
*
* Return the entry point name for a given ordinal.
* Used only by relay debugging.
* Warning: returned pointer is to a Pascal-type string.
*/
LPSTR MODULE_GetEntryPointName( HMODULE hModule, WORD ordinal )
{
register char *cpnt;
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
/* First search the resident names */
cpnt = (char *)pModule + pModule->name_table;
while (*cpnt)
{
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD *)(cpnt + *cpnt + 1) == ordinal) return cpnt;
}
/* Now search the non-resident names table */
if (!pModule->nrname_handle) return 0; /* No non-resident table */
cpnt = (char *)GlobalLock( pModule->nrname_handle );
while (*cpnt)
{
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD *)(cpnt + *cpnt + 1) == ordinal) return cpnt;
}
return NULL;
}
/***********************************************************************
* MODULE_GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WINPROCS dll.
* Return an entry point from the WPROCS dll.
*/
#ifndef WINELIB
WNDPROC MODULE_GetWndProcEntry16( const char *name )
......@@ -890,7 +764,7 @@ WNDPROC MODULE_GetWndProcEntry16( const char *name )
WORD ordinal;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WINPROCS" );
if (!hModule) hModule = GetModuleHandle( "WPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
return MODULE_GetEntryPoint( hModule, ordinal );
}
......@@ -900,14 +774,14 @@ WNDPROC MODULE_GetWndProcEntry16( const char *name )
/***********************************************************************
* MODULE_GetWndProcEntry32 (not a Windows API function)
*
* Return an entry point from the WINPROCS32 dll.
* Return an entry point from the WPROCS32 dll.
*/
#ifndef WINELIB
WNDPROC MODULE_GetWndProcEntry32( const char *name )
{
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WINPROCS32" );
if (!hModule) hModule = GetModuleHandle( "WPROCS32" );
return PE_GetProcAddress( hModule, name );
}
#endif
......@@ -934,13 +808,13 @@ LPSTR MODULE_GetModuleName( HMODULE hModule )
/**********************************************************************
* MODULE_RegisterModule
*/
void MODULE_RegisterModule( HMODULE hModule )
void MODULE_RegisterModule( NE_MODULE *pModule )
{
NE_MODULE *pModule = MODULE_GetPtr( hModule );
pModule->next = hFirstModule;
hFirstModule = hModule;
hFirstModule = pModule->self;
}
/**********************************************************************
* MODULE_FindModule
*
......@@ -996,6 +870,11 @@ static void MODULE_FreeModule( HMODULE hModule )
/* FIXME: should call the exit code for the library here */
/* Free the objects owned by the module */
HOOK_FreeModuleHooks( hModule );
CLASS_FreeModuleClasses( hModule );
/* Clear magic number just in case */
pModule->magic = pModule->self = 0;
......@@ -1058,12 +937,12 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
OFSTRUCT ofs;
/* Try to load the built-in first if not disabled */
if ((hModule = MODULE_LoadBuiltin( name, FALSE ))) return hModule;
if ((hModule = BUILTIN_LoadModule( name, FALSE ))) return hModule;
if ((hFile = OpenFile( name, &ofs, OF_READ )) == HFILE_ERROR)
{
/* Now try the built-in even if disabled */
if ((hModule = MODULE_LoadBuiltin( name, TRUE )))
if ((hModule = BUILTIN_LoadModule( name, TRUE )))
{
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return hModule;
......@@ -1148,7 +1027,7 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
/* Handle self loading modules */
SEGTABLEENTRY * pSegTable = (SEGTABLEENTRY *) NE_SEG_TABLE(pModule);
SELFLOADHEADER *selfloadheader;
HMODULE hselfload = GetModuleHandle("WINPROCS");
HMODULE hselfload = GetModuleHandle("WPROCS");
WORD oldss, oldsp, saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
fprintf (stderr, "Warning: %*.*s is a self-loading module\n"
"Support for self-loading modules is very experimental\n",
......
......@@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include "neexe.h"
#include "dlls.h"
#include "windows.h"
#include "arch.h"
#include "selectors.h"
......
......@@ -23,9 +23,6 @@
#include "stddebug.h"
#include "debug.h"
typedef struct resource_typeinfo_s NE_TYPEINFO;
typedef struct resource_nameinfo_s NE_NAMEINFO;
/***********************************************************************
* NE_FindNameTableId
......
......@@ -18,8 +18,8 @@
#include <sys/types.h>
#include <sys/mman.h>
#include "windows.h"
#include "winbase.h"
#include "callback.h"
#include "dlls.h"
#include "neexe.h"
#include "peexe.h"
#include "pe_image.h"
......@@ -140,16 +140,9 @@ DWORD PE_GetProcAddress(HMODULE hModule, char* function)
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module) return 0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
{
BUILTIN_DLL *dll = (BUILTIN_DLL *)pModule->pe_module;
if(HIWORD(function))
return RELAY32_GetEntryPoint(dll,function,0);
else
return RELAY32_GetEntryPoint(dll,0,(int)function);
}
if (!pModule->pe_module) return 0;
return BUILTIN_GetProcAddress32( pModule, function );
return PE_FindExportedFunction( pModule->pe_module, function );
}
......@@ -247,12 +240,8 @@ void fixup_imports(struct pe_data *pe, HMODULE hModule)
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
/* FIXME: Both calls should be unified into GetProcAddress */
#if 0
*thunk_list=(unsigned int)RELAY32_GetEntryPoint(Module,pe_name->Name,pe_name->Hint);
if(*thunk_list == 0)
#endif
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
pe_name->Name);
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
pe_name->Name);
#else
fprintf(stderr,"JBP: Call to RELAY32_GetEntryPoint being ignored.\n");
#endif
......@@ -619,7 +608,7 @@ HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
pModule->res_table=pModule->import_table=pModule->entry_table=
(int)pStr-(int)pModule;
MODULE_RegisterModule(hModule);
MODULE_RegisterModule( pModule );
pe = PE_LoadImage( fd, hModule, mz_header.ne_offset );
......@@ -656,7 +645,6 @@ void PE_Win32CallToStart(struct sigcontext_struct context)
int fs;
HMODULE hModule;
NE_MODULE *pModule;
struct pe_data *pe;
dprintf_win32(stddeb,"Going to start Win32 program\n");
InitTask(context);
......
......@@ -18,7 +18,6 @@
#include "ldt.h"
#include "neexe.h"
#include "peexe.h"
#include "dlls.h"
#include "pe_image.h"
#include "resource.h"
#include "stddebug.h"
......
......@@ -18,7 +18,6 @@
#include "global.h"
#include "neexe.h"
#include "accel.h"
#include "dlls.h"
#include "module.h"
#include "resource.h"
#include "stddebug.h"
......
......@@ -34,8 +34,7 @@
#define STACK32_SIZE 0x10000
extern void TIMER_SwitchQueue(HQUEUE, HQUEUE );
extern void TIMER_NukeTimers(HWND, HQUEUE );
extern void USER_AppExit(HTASK, HINSTANCE, HQUEUE );
/* ------ Internal variables ------ */
static HTASK hFirstTask = 0;
......@@ -71,6 +70,18 @@ BOOL TASK_Init(void)
/***********************************************************************
* TASK_GetNextTask
*/
HTASK TASK_GetNextTask( HTASK hTask )
{
TDB* pTask = (TDB*)GlobalLock(hTask);
if (pTask->hNext) return pTask->hNext;
return (hFirstTask != hTask) ? hFirstTask : 0;
}
/***********************************************************************
* TASK_CreateDOSEnvironment
*
* Create the original DOS environment.
......@@ -526,8 +537,8 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance,
frame16->saved_sp = 0; /*pTask->sp;*/
frame16->ds = frame16->es = pTask->hInstance;
frame16->entry_point = 0;
frame16->ordinal_number = 24; /* WINPROCS.24 is TASK_Reschedule */
frame16->dll_id = 24; /* WINPROCS */
frame16->entry_ip = OFFSETOF(TASK_RescheduleProc) + 14;
frame16->entry_cs = SELECTOROF(TASK_RescheduleProc);
frame16->bp = 0;
frame16->ip = LOWORD( CALLTO16_RetAddr_word );
frame16->cs = HIWORD( CALLTO16_RetAddr_word );
......@@ -583,14 +594,6 @@ static void TASK_DeleteTask( HTASK hTask )
FILE_CloseAllFiles( pTask->hPDB );
/* Nuke timers */
TIMER_NukeTimers( 0, pTask->hQueue );
/* Free the message queue */
QUEUE_DeleteMsgQueue( pTask->hQueue );
/* Free the selector aliases */
GLOBAL_FreeBlock( pTask->hCSAlias );
......@@ -619,6 +622,12 @@ void TASK_KillCurrentTask( int exitCode )
{
extern void EXEC_ExitWindows( int retCode );
TDB* pTask = (TDB*) GlobalLock( hCurrentTask );
/* Perform USER cleanup */
USER_AppExit( hCurrentTask, pTask->hInstance, pTask->hQueue );
if (hTaskToKill && (hTaskToKill != hCurrentTask))
{
/* If another task is already marked for destruction, */
......
......@@ -11,6 +11,8 @@
* have to be changed.
*/
#ifndef WINELIB
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
......@@ -39,9 +41,6 @@
#define GET_ATOM_TABLE(sel) ((ATOMTABLE*)PTR_SEG_OFF_TO_LIN(sel, \
((INSTANCEDATA*)PTR_SEG_OFF_TO_LIN(sel,0))->atomtable))
#ifdef WINELIB
#define USER_HeapSel 0
#endif
/***********************************************************************
* ATOM_InitTable
......@@ -375,3 +374,5 @@ WORD GlobalGetAtomName( ATOM atom, LPSTR buffer, short count )
#endif
return ATOM_GetAtomName( USER_HeapSel, atom, buffer, count );
}
#endif /* WINELIB */
......@@ -4,6 +4,8 @@
* Copyright 1995 Alexandre Julliard
*/
#ifndef WINELIB
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -11,6 +13,7 @@
#include "windows.h"
#include "global.h"
#include "heap.h"
#include "toolhelp.h"
#include "selectors.h"
#include "dde_mem.h"
......@@ -199,7 +202,7 @@ HGLOBAL GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL hOwner,
else
#endif /* CONFIG_IPC */
{
ptr = malloc( size );
ptr = HeapAlloc( SystemHeap, 0, size );
}
if (!ptr) return 0;
......@@ -209,7 +212,7 @@ HGLOBAL GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL hOwner,
isCode, is32Bit, isReadOnly, &shmdata);
if (!handle)
{
free( ptr );
HeapFree( SystemHeap, 0, ptr );
return 0;
}
......@@ -306,7 +309,7 @@ HGLOBAL GlobalReAlloc( HGLOBAL handle, DWORD size, WORD flags )
if (!(pArena->flags & GA_MOVEABLE) ||
!(pArena->flags & GA_DISCARDABLE) ||
(pArena->lockCount > 0) || (pArena->pageLockCount > 0)) return 0;
free( (void *)pArena->base );
HeapFree( SystemHeap, 0, (void *)pArena->base );
pArena->base = 0;
/* Note: we rely on the fact that SELECTOR_ReallocBlock won't */
/* change the selector if we are shrinking the block */
......@@ -337,7 +340,7 @@ HGLOBAL GlobalReAlloc( HGLOBAL handle, DWORD size, WORD flags )
dprintf_global(stddeb,"oldsize %08lx\n",oldsize);
if (ptr && (size == oldsize)) return handle; /* Nothing to do */
ptr = realloc( ptr, size );
ptr = HeapReAlloc( SystemHeap, 0, ptr, size );
if (!ptr)
{
FreeSelector( sel );
......@@ -350,7 +353,7 @@ HGLOBAL GlobalReAlloc( HGLOBAL handle, DWORD size, WORD flags )
sel = SELECTOR_ReallocBlock( sel, ptr, size, SEGMENT_DATA, 0, 0 );
if (!sel)
{
free( ptr );
HeapFree( SystemHeap, 0, ptr );
memset( pArena, 0, sizeof(GLOBALARENA) );
return 0;
}
......@@ -358,7 +361,7 @@ HGLOBAL GlobalReAlloc( HGLOBAL handle, DWORD size, WORD flags )
if (!(pNewArena = GLOBAL_GetArena( sel, selcount )))
{
free( ptr );
HeapFree( SystemHeap, 0, ptr );
FreeSelector( sel );
return 0;
}
......@@ -392,7 +395,7 @@ HGLOBAL GlobalFree( HGLOBAL handle )
#ifdef CONFIG_IPC
if (is_dde_handle(handle)) return DDE_GlobalFree(handle);
#endif /* CONFIG_IPC */
if (ptr) free( ptr );
if (ptr) HeapFree( SystemHeap, 0, ptr );
return 0;
}
......@@ -825,3 +828,13 @@ void *GlobalAlloc32(int flags,int size)
dprintf_global(stddeb,"GlobalAlloc32(%x,%x)\n",flags,size);
return malloc(size);
}
/***********************************************************************
* GlobalLock32
*/
void* GlobalLock32(DWORD ptr)
{
return (void*)ptr;
}
#endif /* WINELIB */
......@@ -179,7 +179,7 @@ static HEAP *HEAP_GetPtr( HANDLE32 heap )
HEAP *heapPtr = (HEAP *)heap;
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
{
fprintf( stderr, "Invalid heap %08lx!\n", heap );
fprintf( stderr, "Invalid heap %08x!\n", heap );
SetLastError( ERROR_INVALID_HANDLE );
return NULL;
}
......@@ -740,7 +740,7 @@ BOOL HeapDestroy( HANDLE32 heap )
HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap;
dprintf_heap( stddeb, "HeapDestroy: %08lx\n", heap );
dprintf_heap( stddeb, "HeapDestroy: %08x\n", heap );
if (!heapPtr) return FALSE;
DeleteCriticalSection( &heapPtr->critSection );
......@@ -779,7 +779,7 @@ LPVOID HeapAlloc( HANDLE32 heap, DWORD flags, DWORD size )
if (!(pArena = HEAP_FindFreeBlock( heapPtr, size, &subheap )))
{
dprintf_heap( stddeb, "HeapAlloc(%08lx,%08lx,%08lx): returning NULL\n",
dprintf_heap( stddeb, "HeapAlloc(%08x,%08lx,%08lx): returning NULL\n",
heap, flags, size );
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_OUTOFMEMORY );
......@@ -810,7 +810,7 @@ LPVOID HeapAlloc( HANDLE32 heap, DWORD flags, DWORD size )
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( 0 );
dprintf_heap( stddeb, "HeapAlloc(%08lx,%08lx,%08lx): returning %08lx\n",
dprintf_heap( stddeb, "HeapAlloc(%08x,%08lx,%08lx): returning %08lx\n",
heap, flags, size, (DWORD)(pInUse + 1) );
return (LPVOID)(pInUse + 1);
}
......@@ -835,7 +835,7 @@ BOOL HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr )
{
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_INVALID_PARAMETER );
dprintf_heap( stddeb, "HeapFree(%08lx,%08lx,%08lx): returning FALSE\n",
dprintf_heap( stddeb, "HeapFree(%08x,%08lx,%08lx): returning FALSE\n",
heap, flags, (DWORD)ptr );
return FALSE;
}
......@@ -849,7 +849,7 @@ BOOL HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr )
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( 0 );
dprintf_heap( stddeb, "HeapFree(%08lx,%08lx,%08lx): returning TRUE\n",
dprintf_heap( stddeb, "HeapFree(%08x,%08lx,%08lx): returning TRUE\n",
heap, flags, (DWORD)ptr );
return TRUE;
}
......@@ -881,7 +881,7 @@ LPVOID HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
{
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_INVALID_PARAMETER );
dprintf_heap( stddeb, "HeapReAlloc(%08lx,%08lx,%08lx,%08lx): returning NULL\n",
dprintf_heap( stddeb, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning NULL\n",
heap, flags, (DWORD)ptr, size );
return NULL;
}
......@@ -904,6 +904,13 @@ LPVOID HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
pFree->next->prev = pFree->prev;
pFree->prev->next = pFree->next;
pArena->size += (pFree->size & ARENA_SIZE_MASK) + sizeof(*pFree);
if (!HEAP_Commit( subheap, (char *)pArena + sizeof(ARENA_INUSE)
+ size + HEAP_MIN_BLOCK_SIZE))
{
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_OUTOFMEMORY );
return NULL;
}
}
else /* Do it the hard way */
{
......@@ -915,6 +922,7 @@ LPVOID HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
!(pNew = HEAP_FindFreeBlock( heapPtr, size, &newsubheap )))
{
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_OUTOFMEMORY );
return NULL;
}
......@@ -959,7 +967,7 @@ LPVOID HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
pArena->callerEIP = *((DWORD *)&heap - 1); /* hack hack */
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
dprintf_heap( stddeb, "HeapReAlloc(%08lx,%08lx,%08lx,%08lx): returning %08lx\n",
dprintf_heap( stddeb, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning %08lx\n",
heap, flags, (DWORD)ptr, size, (DWORD)(pArena + 1) );
return (LPVOID)(pArena + 1);
}
......@@ -1024,7 +1032,7 @@ DWORD HeapSize( HANDLE32 heap, DWORD flags, LPVOID ptr )
}
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
dprintf_heap( stddeb, "HeapSize(%08lx,%08lx,%08lx): returning %08lx\n",
dprintf_heap( stddeb, "HeapSize(%08x,%08lx,%08lx): returning %08lx\n",
heap, flags, (DWORD)ptr, ret );
return ret;
}
......@@ -1040,7 +1048,7 @@ BOOL HeapValidate( HANDLE32 heap, DWORD flags, LPVOID block )
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
{
fprintf( stderr, "Invalid heap %08lx!\n", heap );
fprintf( stderr, "Invalid heap %08x!\n", heap );
return FALSE;
}
......
......@@ -202,6 +202,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
*
* Print the content of the LDT on stdout.
*/
#ifndef WINELIB
void LDT_Print( int start, int length )
{
int i;
......@@ -231,3 +232,4 @@ void LDT_Print( int start, int length )
flags[0], flags[1], flags[2] );
}
}
#endif /* WINELIB */
......@@ -11,6 +11,8 @@
* parameter than usual.
*/
#ifndef WINELIB
#include <stdlib.h>
#include <string.h>
#include "windows.h"
......@@ -1029,8 +1031,15 @@ WORD LOCAL_CountFree( WORD ds )
{
WORD arena, total;
LOCALARENA *pArena;
LOCALHEAPINFO *pInfo;
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
LOCALHEAPINFO *pInfo = LOCAL_GetHeap( ds );
if (!(pInfo = LOCAL_GetHeap( ds )))
{
fprintf( stderr, "LOCAL_Handle(%04x): Local heap not found\n", ds );
LOCAL_PrintHeap( ds );
return 0;
}
total = 0;
arena = pInfo->first;
......@@ -1309,3 +1318,5 @@ BOOL LocalNext( LOCALENTRY *pLocalEntry )
pLocalEntry->wSize = pLocalEntry->wNext - pLocalEntry->hHandle;
return TRUE;
}
#endif /* WINELIB */
......@@ -4,6 +4,8 @@
* Copyright 1995 Alexandre Julliard
*/
#ifndef WINELIB
#include <string.h>
#include "windows.h"
#include "ldt.h"
......@@ -64,13 +66,14 @@ WORD AllocSelector( WORD sel )
*/
WORD FreeSelector( WORD sel )
{
WORD i, count;
WORD i, count, nextsel;
ldt_entry entry;
STACK16FRAME *frame;
dprintf_selector( stddeb, "FreeSelector(%04x)\n", sel );
if (IS_SELECTOR_FREE(sel)) return sel; /* error */
count = (GET_SEL_LIMIT(sel) >> 16) + 1;
nextsel = sel + (count << __AHSHIFT);
memset( &entry, 0, sizeof(entry) ); /* clear the LDT entries */
/* FIXME: is it correct to free the whole array? */
for (i = SELECTOR_TO_ENTRY(sel); count; i++, count--)
......@@ -84,8 +87,8 @@ WORD FreeSelector( WORD sel )
frame = CURRENT_STACK16;
while (frame)
{
if (frame->ds == sel) frame->ds = 0;
if (frame->es == sel) frame->es = 0;
if ((frame->ds >= sel) && (frame->ds < nextsel)) frame->ds = 0;
if ((frame->es >= sel) && (frame->es < nextsel)) frame->es = 0;
frame = PTR_SEG_OFF_TO_LIN(frame->saved_ss, frame->saved_sp);
}
#endif
......@@ -481,3 +484,5 @@ SEGPTR MAKE_SEGPTR(void * ptr)
return ((entry << 16) | ((unsigned) ptr & 0xffff));
}
#endif
#endif /* WINELIB */
......@@ -28,6 +28,7 @@ C_SRCS = \
stress.c \
toolhelp.c \
user.c \
ver.c \
w32sys.c \
winsocket.c \
xmalloc.c
......
......@@ -9,7 +9,6 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "windows.h"
#include "win.h"
#include "user.h"
#include "dlls.h"
#include "driver.h"
#include "stddebug.h"
#include "debug.h"
......
......@@ -8,7 +8,6 @@
#include <string.h>
#include <unistd.h>
#include "neexe.h"
#include "dlls.h"
#include "shell.h"
#include "windows.h"
#include "callback.h"
......
......@@ -125,6 +125,14 @@ SEGPTR WIN16_lstrcpyn( SEGPTR target, SEGPTR source, WORD n )
/* KERNEL.90 */
INT lstrlen(LPCSTR str)
{
/* looks weird, but win3.1 KERNEL got a GeneralProtection handler
* in lstrlen() ... we check only for NULL pointer reference.
* - Marcus Meissner
*/
if (str==NULL) {
fprintf(stddeb,"lstrlen(NULL) caught, returning 0.\n");
return 0;
}
return strlen(str);
}
......
......@@ -19,13 +19,13 @@
#include <X11/cursorfont.h>
#include "wine.h"
#include "message.h"
#include "module.h"
#include "msdos.h"
#include "windows.h"
#include "winsock.h"
#include "options.h"
#include "desktop.h"
#include "shell.h"
#include "dlls.h"
#define DEBUG_DEFINE_VARIABLES
#include "stddebug.h"
#include "debug.h"
......@@ -65,6 +65,7 @@ const char *langNames[] =
"Cz", /* LANG_Cz */
"Eo", /* LANG_Eo */
"It", /* LANG_It */
"Ko", /* LANG_Ko */
NULL
};
......@@ -147,7 +148,7 @@ static XrmOptionDescRec optionsTable[] =
" -fixedmap Use a \"standard\" color map\n" \
" -iconic Start as an icon\n" \
" -ipc Enable IPC facilities\n" \
" -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo,It)\n" \
" -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo,It,Ko)\n" \
" -managed Allow the window manager to manage created windows\n" \
" -mode mode Start Wine in a particular mode (standard or enhanced)\n" \
" -name name Set the application name\n" \
......@@ -265,48 +266,6 @@ BOOL ParseDebugOptions(char *options)
#endif
#ifndef WINELIB
/***********************************************************************
* MAIN_ParseDLLOptions
*
* Set runtime DLL usage flags
*/
static BOOL MAIN_ParseDLLOptions(char *options)
{
int l;
BUILTIN_DLL *dll;
if (strlen(options)<3) return FALSE;
do
{
if ((*options!='+') && (*options!='-')) return FALSE;
if (strchr(options,',')) l=strchr(options,',')-options;
else l=strlen(options);
for (dll = dll_builtin_table; dll->name; dll++)
{
if (!lstrncmpi(options+1,dll->name,l-1))
{
if (*options == '+') dll->flags &= ~DLL_FLAG_NOT_USED;
else
{
if (dll->flags & DLL_FLAG_ALWAYS_USED) return FALSE;
dll->flags |= DLL_FLAG_NOT_USED;
}
break;
}
}
if (!dll->name) return FALSE;
options+=l;
}
while((*options==',')&&(*(++options)));
if (*options)
return FALSE;
else
return TRUE;
}
#endif
/***********************************************************************
* MAIN_ParseLanguageOption
......@@ -441,23 +400,20 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
}
if(MAIN_GetResource( db, ".dll", &value))
{
#ifndef WINELIB
if(MAIN_ParseDLLOptions((char*)value.addr)==FALSE)
{
int i;
BUILTIN_DLL *dll;
fprintf(stderr,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv[0]);
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs\n");
for (i = 0, dll = dll_builtin_table; dll->name; dll++)
if (!(dll->flags & DLL_FLAG_ALWAYS_USED))
fprintf(stderr,"%-9s%c",dll->name, (((++i)%8==0)?'\n':' '));
fprintf(stderr,"\n\n");
exit(1);
}
if (!BUILTIN_ParseDLLOptions( (char*)value.addr ))
{
fprintf(stderr,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv[0]);
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs:\n");
BUILTIN_PrintDLLs();
exit(1);
}
#else
fprintf(stderr,"-dll not supported in libwine\n");
fprintf(stderr,"-dll not supported in libwine\n");
#endif
}
}
......
......@@ -33,6 +33,7 @@ DWORD WINAPI GetUserDefaultLCID()
case LANG_Cz:
case LANG_Eo:
case LANG_It:
case LANG_Ko:
default:
return 0; /* Neutral language */
}
......@@ -699,3 +700,10 @@ int CompareStringA(DWORD lcid, DWORD fdwStyle,
return (l1<l2)? 1 : 3;
}
/***********************************************************************
* SetLocalInfoA (KERNEL32.499)
*/
BOOL SetLocaleInfoA(DWORD lcid, DWORD lctype, LPCSTR data) {
fprintf(stdnimp,"SetLocaleInfoA(%ld,%ld,%s)\n",lcid,lctype,data);
return TRUE;
}
......@@ -368,11 +368,10 @@ SHELL_SaveRegistry() {
strcat(fn,WINE_PREFIX);
/* create the directory. don't care about errorcodes. */
mkdir(fn,0755); /* drwxr-xr-x */
strcat(fn,"/");
strcat(fn,SAVE_CURRENT_USER);
strcat(fn,"/"SAVE_CURRENT_USER);
_SaveSubReg(key_current_user,fn);
free(fn);
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_LOCAL_MACHINE)+1);
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_LOCAL_MACHINE)+2);
strcpy(fn,pwd->pw_dir);
strcat(fn,WINE_PREFIX"/"SAVE_LOCAL_MACHINE);
_SaveSubReg(key_local_machine,fn);
......@@ -676,6 +675,7 @@ _LoadSubReg(LPKEYSTRUCT lpkey,char *fn) {
if (!_do_loadsubreg(F,lpkey)) {
fclose(F);
unlink(fn);
return;
}
fclose(F);
}
......@@ -694,12 +694,12 @@ SHELL_LoadRegistry() {
/* load the user saved registry. overwriting only newer entries */
pwd=getpwuid(getuid());
if (pwd!=NULL && pwd->pw_dir!=NULL) {
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_CURRENT_USER)+1);
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_CURRENT_USER)+2);
strcpy(fn,pwd->pw_dir);
strcat(fn,WINE_PREFIX"/"SAVE_CURRENT_USER);
_LoadSubReg(key_current_user,fn);
free(fn);
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_LOCAL_MACHINE)+1);
fn=(char*)xmalloc(strlen(pwd->pw_dir)+strlen(WINE_PREFIX)+strlen(SAVE_LOCAL_MACHINE)+2);
strcpy(fn,pwd->pw_dir);
strcat(fn,WINE_PREFIX"/"SAVE_LOCAL_MACHINE);
_LoadSubReg(key_local_machine,fn);
......@@ -1710,7 +1710,7 @@ RegEnumValueW(
lpkey = lookup_hkey(hkey);
if (!lpkey)
return SHELL_ERROR_BADKEY;
if (lpkey->nrofvalues<iValue)
if (lpkey->nrofvalues<=iValue)
return ERROR_NO_MORE_ITEMS;
val = lpkey->values+iValue;
......
......@@ -2,6 +2,7 @@
* Misc. USER functions
*
* Copyright 1993 Robert J. Amstadt
* 1996 Alex Korobka
*/
#include <stdio.h>
......@@ -9,15 +10,19 @@
#include "windows.h"
#include "gdi.h"
#include "user.h"
#include "task.h"
#include "queue.h"
#include "class.h"
#include "win.h"
#include "hook.h"
#include "debug.h"
#include "toolhelp.h"
#define USER_HEAP_SIZE 0x10000
#ifndef WINELIB
LPSTR USER_Heap = NULL;
WORD USER_HeapSel = 0;
extern void TIMER_NukeTimers(HWND, HQUEUE );
extern HTASK TASK_GetNextTask(HTASK);
/***********************************************************************
* GetFreeSystemResources (USER.284)
......@@ -66,19 +71,7 @@ BOOL SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
return TRUE;
}
/***********************************************************************
* USER_HeapInit
*/
BOOL USER_HeapInit(void)
{
if (!(USER_HeapSel = GlobalAlloc(GMEM_FIXED,USER_HEAP_SIZE))) return FALSE;
USER_Heap = GlobalLock( USER_HeapSel );
LocalInit( USER_HeapSel, 0, USER_HEAP_SIZE-1 );
return TRUE;
}
#endif
#endif /* WINELIB */
/***********************************************************************
* TimerCount (TOOLHELP.80)
......@@ -114,3 +107,35 @@ int USER_InitApp(HINSTANCE hInstance)
return 1;
}
/**********************************************************************
* USER_AppExit
*/
void USER_AppExit(HTASK hTask, HINSTANCE hInstance, HQUEUE hQueue)
{
/* FIXME: flush send messages (which are not implemented yet),
* empty clipboard if needed, maybe destroy menus (Windows
* only complains about them but does nothing);
*/
WND* desktop = WIN_GetDesktop();
/* Patch desktop window queue */
if( desktop->hmemTaskQ == hQueue )
desktop->hmemTaskQ = GetTaskQueue(TASK_GetNextTask(hTask));
/* Nuke timers */
TIMER_NukeTimers( 0, hQueue );
HOOK_FreeQueueHooks( hQueue );
/* Nuke orphaned windows */
WIN_DestroyQueueWindows( desktop->child, hQueue );
/* Free the message queue */
QUEUE_DeleteMsgQueue( hQueue );
}
This diff is collapsed. Click to expand it.
......@@ -9,11 +9,11 @@
#include <stdlib.h>
#include <string.h>
#include "windows.h"
#include "winbase.h"
#include "global.h"
#include "ldt.h"
#include "miscemu.h"
#include "module.h"
#include "xmalloc.h"
HANDLE DOSMEM_BiosSeg; /* BIOS data segment at 0x40:0 */
......@@ -82,7 +82,7 @@ static BIOSDATA *pBiosData = NULL;
* DOSMEM_Init
*
* Create the dos memory segments, and store them into the KERNEL
* exported values. MODULE_Init() must already have been called.
* exported values. BUILTIN_Init() must already have been called.
*/
BOOL DOSMEM_Init(void)
{
......@@ -91,7 +91,12 @@ BOOL DOSMEM_Init(void)
/* Allocate 7 64k segments for 0000, A000, B000, C000, D000, E000, F000. */
dosmem = xmalloc( 0x70000 );
dosmem = VirtualAlloc( NULL, 0x70000, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
if (!dosmem)
{
fprintf( stderr, "Could not allocate DOS segments\n" );
return FALSE;
}
MODULE_SetEntryPoint( hModule, 183, /* KERNEL.183: __0000H */
GLOBAL_CreateBlock( GMEM_FIXED, dosmem,
......
......@@ -14,7 +14,7 @@
/* #define DEBUG_INT */
#include "debug.h"
/* base WINPROC module number for VxDs */
/* base WPROCS.DLL ordinal number for VxDs */
#define VXD_BASE 400
static void do_int2f_16(struct sigcontext_struct *context);
......@@ -100,7 +100,7 @@ static void do_int2f_16(struct sigcontext_struct *context)
break;
case 0x84: /* Get device API entry point */
addr = MODULE_GetEntryPoint( GetModuleHandle("WINPROCS"),
addr = MODULE_GetEntryPoint( GetModuleHandle("WPROCS"),
VXD_BASE + BX_reg(context) );
if (!addr) /* not supported */
{
......
......@@ -18,7 +18,7 @@
static SEGPTR INT_Vectors[256];
/* Ordinal number for interrupt 0 handler in WINPROCS.DLL */
/* Ordinal number for interrupt 0 handler in WPROCS.DLL */
#define FIRST_INTERRUPT_ORDINAL 100
......@@ -28,7 +28,7 @@ static SEGPTR INT_Vectors[256];
BOOL INT_Init(void)
{
WORD vector;
HMODULE hModule = GetModuleHandle( "WINPROCS" );
HMODULE hModule = GetModuleHandle( "WPROCS" );
for (vector = 0; vector < 256; vector++)
{
......@@ -72,8 +72,11 @@ void INT_SetHandler( BYTE intnum, SEGPTR handler )
*/
void INT_DummyHandler( struct sigcontext_struct context )
{
INT_BARF( &context,
CURRENT_STACK16->ordinal_number - FIRST_INTERRUPT_ORDINAL );
WORD ordinal;
char *name;
STACK16FRAME *frame = CURRENT_STACK16;
BUILTIN_GetEntryPoint( frame->entry_cs, frame->entry_ip, &ordinal, &name );
INT_BARF( &context, ordinal - FIRST_INTERRUPT_ORDINAL );
}
......
......@@ -20,6 +20,7 @@
#include "callback.h"
#include "user.h"
#include "driver.h"
#include "file.h"
#include "mmsystem.h"
#include "stddebug.h"
#include "debug.h"
......
......@@ -231,7 +231,7 @@ static BOOL CURSORICON_LoadDirEntry(HANDLE hInstance, SEGPTR name,
*
* Create a cursor or icon from a resource.
*/
static HANDLE CURSORICON_LoadHandler( HANDLE handle, HINSTANCE hInstance,
HANDLE CURSORICON_LoadHandler( HANDLE handle, HINSTANCE hInstance,
BOOL fCursor )
{
HANDLE hAndBits, hXorBits;
......
......@@ -362,16 +362,20 @@ void SetDCState( HDC hdc, HDC hdcs )
{
DC * dc, * dcs;
HRGN hVisRgn, hClipRgn, hGCClipRgn;
HFONT hfont;
HBRUSH hbrush;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return;
if (!(dcs = (DC *) GDI_GetObjPtr( hdcs, DC_MAGIC ))) return;
if (!dcs->w.flags & DC_SAVED) return;
dprintf_dc(stddeb, "SetDCState: %04x %04x\n", hdc, hdcs );
/* Save the regions before overwriting everything */
/* Save the regions, font & brush before overwriting everything */
hVisRgn = dc->w.hVisRgn;
hClipRgn = dc->w.hClipRgn;
hGCClipRgn = dc->w.hGCClipRgn;
hfont = dc->w.hFont;
hbrush = dc->w.hBrush;
memcpy( &dc->w, &dcs->w, sizeof(dc->w) );
memcpy( &dc->u.x.pen, &dcs->u.x.pen, sizeof(dc->u.x.pen) );
dc->w.flags &= ~DC_SAVED;
......@@ -380,6 +384,8 @@ void SetDCState( HDC hdc, HDC hdcs )
dc->w.hVisRgn = hVisRgn;
dc->w.hClipRgn = hClipRgn;
dc->w.hGCClipRgn = hGCClipRgn;
dc->w.hFont = hfont;
dc->w.hBrush = hbrush;
CombineRgn( dc->w.hVisRgn, dcs->w.hVisRgn, 0, RGN_COPY );
SelectClipRgn( hdc, dcs->w.hClipRgn );
......@@ -659,6 +665,25 @@ COLORREF SetTextColor( HDC hdc, COLORREF color )
/***********************************************************************
* SetTextAlign (GDI.346)
*/
WORD SetTextAlign( HDC hdc, WORD textAlign )
{
WORD prevAlign;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
if (!(dc = (DC *)GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0;
MF_MetaParam1( dc, META_SETTEXTALIGN, textAlign );
return 1;
}
prevAlign = dc->w.textAlign;
dc->w.textAlign = textAlign;
return prevAlign;
}
/***********************************************************************
* GetDCOrg (GDI.79)
*/
DWORD GetDCOrg( HDC hdc )
......
......@@ -35,17 +35,6 @@ BOOL func_name( HDC hdc, LPPOINT pt ) \
return TRUE; \
}
#define DC_SET_VAL( func_type, func_name, dc_field ) \
func_type func_name( HDC hdc, func_type val ) \
{ \
func_type prevVal; \
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); \
if (!dc) return 0; \
prevVal = dc->w.dc_field; \
dc->w.dc_field = val; \
return prevVal; \
}
#define DC_SET_MODE( func_name, dc_field, min_val, max_val, meta_func ) \
WORD func_name( HDC hdc, WORD mode ) \
{ \
......@@ -90,7 +79,6 @@ DC_GET_VAL( HRGN, InquireVisRgn, hVisRgn ) /* GDI.131 */
DC_GET_X_Y( DWORD, GetBrushOrg, brushOrgX, brushOrgY ) /* GDI.149 */
DC_GET_VAL( HRGN, GetClipRgn, hClipRgn ) /* GDI.173 */
DC_GET_VAL( WORD, GetTextAlign, textAlign ) /* GDI.345 */
DC_SET_VAL( WORD, SetTextAlign, textAlign ) /* GDI.346 */
DC_GET_VAL( HFONT, GetCurLogFont, hFont ) /* GDI.411 */
DC_GET_VAL_EX( GetBrushOrgEx, brushOrgX, brushOrgY ) /* GDI.469 */
DC_GET_VAL_EX( GetCurrentPositionEx, CursPosX, CursPosY ) /* GDI.470 */
......
......@@ -491,9 +491,12 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
/* Unuse previous font */
for (i=0; i < FONTCACHE; i++) {
if (cacheFonts[i].id == prevHandle) {
cacheFonts[i].used--;
}
if(cacheFonts[i].used == 0)
fprintf(stderr, "Trying to decrement a use count of 0.\n");
else
cacheFonts[i].used--;
}
}
/* Store font */
dc->w.hFont = hfont;
......@@ -517,9 +520,10 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
if ((!cacheFontsMin) || ((cacheFontsMin) && (cacheFontsMin->access > cacheFonts[i].access)))
cacheFontsMin=&cacheFonts[i];
}
if (!cacheFontsMin)
if (!cacheFontsMin) {
fprintf(stderr,"No unused font cache entry !!!!\n" );
return prevHandle;
}
if (cacheFontsMin->id!=0) {
dprintf_font(stddeb,
"FONT_SelectObject: Freeing %04x \n",cacheFontsMin->id );
......
......@@ -20,7 +20,6 @@
#include "debug.h"
#include "xmalloc.h"
LPSTR GDI_Heap = NULL;
WORD GDI_HeapSel = 0;
/* Object types for EnumObjects() */
......@@ -163,14 +162,6 @@ BOOL GDI_Init(void)
{
HPALETTE hpalette;
#ifndef WINELIB
/* Create GDI heap */
if (!(GDI_HeapSel = GlobalAlloc(GMEM_FIXED, GDI_HEAP_SIZE))) return FALSE;
GDI_Heap = GlobalLock( GDI_HeapSel );
LocalInit( GDI_HeapSel, 0, GDI_HEAP_SIZE-1 );
#endif
/* Create default palette */
if (!(hpalette = COLOR_Init())) return FALSE;
......
......@@ -138,6 +138,7 @@ HANDLE CreateMetaFile(LPCTSTR lpFilename)
sizeof(HANDLETABLE) * HTLen);
GlobalUnlock(dc->w.hMetaFile);
dprintf_metafile(stddeb,"CreateMetaFile: returning %04x\n", handle);
return handle;
}
......@@ -265,7 +266,8 @@ BOOL PlayMetaFile(HDC hdc, HMETAFILE hmf)
METARECORD *mr;
HANDLETABLE *ht;
int offset = 0;
WORD i;
dprintf_metafile(stddeb,"PlayMetaFile(%04x %04x)\n",hdc,hmf);
/* create the handle table */
......@@ -284,6 +286,11 @@ BOOL PlayMetaFile(HDC hdc, HMETAFILE hmf)
PlayMetaFileRecord(hdc, ht, mr, mh->mtNoObjects);
}
/* free objects in handle table */
for(i = 0; i < mh->mtNoObjects; i++)
if(*(ht->objectHandle + i) != 0)
DeleteObject(*(ht->objectHandle + i));
/* free handle table */
GlobalFree(hHT);
......@@ -356,6 +363,7 @@ void PlayMetaFileRecord(HDC hdc, HANDLETABLE *ht, METARECORD *mr,
case META_DELETEOBJECT:
DeleteObject(*(ht->objectHandle + *(mr->rdParam)));
*(ht->objectHandle + *(mr->rdParam)) = 0;
break;
case META_SETBKCOLOR:
......@@ -576,8 +584,7 @@ void PlayMetaFileRecord(HDC hdc, HANDLETABLE *ht, METARECORD *mr,
break;
case META_SETTEXTALIGN:
fprintf(stderr,"PlayMetaFileRecord: SETTEXTALIGN: %hd\n",mr->rdParam[0]);
SetTextAlign(hdc, *(mr->rdParam));
SetTextAlign(hdc, *(mr->rdParam));
break;
case META_SELECTPALETTE:
......
......@@ -54,6 +54,7 @@
#include "bitmaps/obm_old_uparrow"
#include "bitmaps/obm_size"
#include "bitmaps/obm_old_close"
#include "bitmaps/obm_trtype"
#ifndef WIN_95_LOOK
#include "bitmaps/obm_zoomd"
......@@ -70,7 +71,7 @@
#include "bitmaps/obm_closed_95"
#endif /* WIN_95_LOOK */
#define OBM_FIRST OBM_CDROM /* First OEM bitmap */
#define OBM_FIRST OBM_TRTYPE /* First OEM bitmap */
#define OBM_LAST OBM_OLD_CLOSE /* Last OEM bitmap */
static const struct
......@@ -78,6 +79,7 @@ static const struct
char** data; /* Pointer to bitmap data */
BOOL color; /* Is it a color bitmap? */
} OBM_Pixmaps_Data[OBM_LAST-OBM_FIRST+1] = {
{ obm_trtype, TRUE }, /* OBM_TRTYPE */
{ obm_cdrom, TRUE }, /* OBM_CDROM */
{ obm_harddisk, TRUE }, /* OBM_HARDDISK */
{ obm_drive, TRUE }, /* OBM_DRIVE */
......
......@@ -2,7 +2,7 @@ TOPSRC = @top_srcdir@
MODULE = resources
LANGUAGES = En Es De No Fr Fi Da Cz Eo It
LANGUAGES = En Es De No Fr Fi Da Cz Eo It Ko
SYSRES_SRCS = $(LANGUAGES:%=sysres_%.c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment