Release 960712
Fri Jul 12 17:43:05 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/scroll.c]
Use Win32 heap functions to allocate scroll-bar info structure.
* [debugger/dbg.y] [debugger/registers.c]
Added support for FS and GS segment registers.
Check that segment registers value are OK before returning from
the signal handler.
* [tools/build.c] [if1632/relay.c] [loader/builtin.c]
Changed relay debugging for Win32 function: the relay code now
passes the entry point address instead of the function name.
* [tools/build.c] [miscemu/*.c]
Added support for data entry points in Win32 DLLs.
Added 'cdecl' function type for Win32.
For 'register' function, the relay code now passes a pointer to
the SIGCONTEXT structure.
* [include/registers.h] [include/wine.h]
Moved SIGCONTEXT structure definition in registers.h.
* [loader/pe_image.c]
Don't die at once if some Win32 entry points cannot be found, but
set them to NULL, just like we do for Win16. This allows some
programs to go further before crashing.
* [loader/task.c] [loader/main.c]
Moved global initializations from InitTask() to MAIN_Init(), as
they no longer need a task context with the new SEGPTR heap functions.
* [memory/string.c]
Added lstrcpynAtoW and lstrcpynWtoA; not real API functions, but
very convenient.
* [windows/graphics.c]
Partially implemented DrawEdge().
* [windows/timer.c] [windows/caret.c]
Implemented Win32 timer handling. Updated caret management to use
Win32 timers (avoids having to use a Win16 callback).
* [windows/win.c]
Prevent programs from setting some style bits with
SetWindowLong(). This should fix some BadMatch crashes.
Link new windows at the end of the linked list.
* [windows/winpos.c]
Don't try to activate a child window in ShowWindow().
* [windows/winproc.c]
Added a 32->32 thunk to support Ansi-Unicode translation.
Wed Jul 10 22:11:12 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/directory.c]
Additional (undocumented) return value for GetTempDrive() added.
* [files/dos_fs.c] [files/file.c] [include/windows.h]
GetTempFileName32* added.
GetShortPathName* added.
* [memory/string.c]
Win16 lstrcpy() can get NULL ptrs as argument and survive.
* [misc/lzexpand.c]
LZOpenFile(): also try opening with compressed filename if normal
open fails.
* [misc/ole2nls.c] [misc/lstr.c] [include/windows.h]
Char* added.
CompareString* added.
Sun Jul 7 01:22:14 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [objects/font.c] [if1632/gdi32.spec]
CreateFontIndirect32A and CreateFontIndirect32W added.
* [misc/ole2nls.c]
GetUserDefaultLCID return values updated for new languages.
Finnish support added for GetLocaleInfoA.
* [object/palette] [gdi32.spec]
RealizePalette32 and SelectPalette32 added.
Sat Jul 6 17:27:30 1996 Ronan Waide <root@waider.ie>
* [misc/shell.c]
Fixup for SHELL_FindExecutable so that File->Run from progman
works once more. Still needs some more fixups - grep for FIXME in
this file.
diff --git a/loader/builtin.c b/loader/builtin.c
index 0d90272..73ebcd5 100644
--- a/loader/builtin.c
+++ b/loader/builtin.c
@@ -59,7 +59,6 @@
#define DLL_FLAG_ALWAYS_USED 0x02 /* Always use built-in DLL */
#define DLL_FLAG_WIN32 0x04 /* DLL is a Win32 DLL */
-
/* 16-bit DLLs */
extern const DLL_DESCRIPTOR KERNEL_Descriptor;
@@ -146,7 +145,7 @@
{ &ADVAPI32_Descriptor, 0 },
{ &COMCTL32_Descriptor, 0 },
{ &COMDLG32_Descriptor, 0 },
- { &CRTDLL_Descriptor, 0 },
+ { &CRTDLL_Descriptor, 0 },
{ &OLE32_Descriptor, 0 },
{ &GDI32_Descriptor, 0 },
{ &KERNEL32_Descriptor, DLL_FLAG_ALWAYS_USED },
@@ -230,6 +229,7 @@
if (pModule->flags & NE_FFLAGS_WIN32)
{
pModule->pe_module = (PE_MODULE *)table;
+ table->flags |= DLL_FLAG_WIN32;
}
else /* Win16 module */
{
@@ -265,13 +265,14 @@
/***********************************************************************
- * BUILTIN_GetEntryPoint
+ * BUILTIN_GetEntryPoint16
*
- * Return the built-in module, ordinal and name corresponding
- * to a CS:IP address. This is used only by relay debugging.
+ * Return the ordinal and name corresponding to a CS:IP address.
+ * This is used only by relay debugging.
*/
-NE_MODULE *BUILTIN_GetEntryPoint( WORD cs, WORD ip, WORD *pOrd, char **ppName )
+LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
{
+ static char buffer[80];
WORD ordinal, i, max_offset;
register BYTE *p;
NE_MODULE *pModule;
@@ -324,18 +325,62 @@
/* (built-in modules have no non-resident table) */
p = (BYTE *)pModule + pModule->name_table;
- *ppName = "???";
while (*p)
{
p += *p + 1 + sizeof(WORD);
- if (*(WORD *)(p + *p + 1) == *pOrd)
- {
- *ppName = (char *)p;
- break;
- }
+ if (*(WORD *)(p + *p + 1) == *pOrd) break;
}
- return pModule;
+ sprintf( buffer, "%.*s.%d: %.*s",
+ *((BYTE *)pModule + pModule->name_table),
+ (char *)pModule + pModule->name_table + 1,
+ *pOrd, *p, (char *)(p + 1) );
+ return buffer;
+}
+
+
+/***********************************************************************
+ * BUILTIN_GetEntryPoint32
+ *
+ * Return the name of the DLL entry point corresponding
+ * to a relay entry point address. This is used only by relay debugging.
+ */
+LPCSTR BUILTIN_GetEntryPoint32( void *relay )
+{
+ static char buffer[80];
+ BUILTIN_DLL *dll;
+ const void **funcs;
+ int first, i, size;
+
+ /* First find the module */
+
+ for (dll = BuiltinDLLs; dll->descr; dll++)
+ if ((dll->flags & DLL_FLAG_WIN32) &&
+ (dll->descr->u.win32.functions[0] <= relay) &&
+ (dll->descr->u.win32.functions[dll->descr->u.win32.size-1] >relay))
+ break;
+ if (!dll->descr)
+ {
+ sprintf( buffer, "???.???: %08x", (UINT32)relay );
+ return buffer;
+ }
+
+ /* Do a binary search for the function */
+
+ relay = (BYTE *)relay - 11; /* The relay entry point is 11 bytes long */
+ funcs = dll->descr->u.win32.functions;
+ first = i = 0;
+ size = dll->descr->u.win32.size;
+ while (first < size)
+ {
+ i = (first + size) / 2;
+ if (funcs[i] == relay) break;
+ if (funcs[i] > relay) size = i;
+ else first = i + 1;
+ }
+ sprintf( buffer, "%s.%d: %s",
+ dll->descr->name, i, dll->descr->u.win32.names[i] );
+ return buffer;
}
@@ -345,12 +390,12 @@
* Implementation of GetProcAddress() for built-in Win32 modules.
* FIXME: this should be unified with the real GetProcAddress32().
*/
-DWORD BUILTIN_GetProcAddress32( NE_MODULE *pModule, char *function )
+FARPROC32 BUILTIN_GetProcAddress32( NE_MODULE *pModule, LPCSTR function )
{
BUILTIN_DLL *dll = (BUILTIN_DLL *)pModule->pe_module;
const WIN32_DESCRIPTOR *info = &dll->descr->u.win32;
- if (!dll) return 0;
+ if (!dll) return NULL;
if (HIWORD(function)) /* Find function by name */
{
@@ -360,7 +405,7 @@
function, dll->descr->name );
for (i = 0; i < info->size; i++)
if (info->names[i] && !strcmp( function, info->names[i] ))
- return (DWORD)info->functions[i];
+ return (FARPROC32)info->functions[i];
}
else /* Find function by ordinal */
{
@@ -368,9 +413,9 @@
dprintf_module( stddeb, "Looking for ordinal %d in %s\n",
ordinal, dll->descr->name );
if (ordinal && ordinal < info->size)
- return (DWORD)info->functions[ordinal - info->base];
+ return (FARPROC32)info->functions[ordinal - info->base];
}
- return 0;
+ return NULL;
}
diff --git a/loader/main.c b/loader/main.c
index 02917c4..01b6511 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -40,7 +40,6 @@
#include "stddebug.h"
#include "debug.h"
-void init_wine_signals(void);
HANDLE32 SystemHeap = 0;
HANDLE32 SegptrHeap = 0;
@@ -50,7 +49,9 @@
*/
int MAIN_Init(void)
{
- extern BOOL RELAY_Init(void);
+ extern BOOL32 RELAY_Init(void);
+ extern BOOL32 SIGNAL_Init(void);
+ extern BOOL32 WIDGETS_Init(void);
int queueSize;
@@ -61,9 +62,6 @@
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return 0;
- /* Initialize message spying */
- if (!SPY_Init()) return 0;
-
#ifdef WINELIB
/* Create USER and GDI heap */
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 0x10000 );
@@ -71,12 +69,24 @@
GDI_HeapSel = GlobalAlloc16( GMEM_FIXED, GDI_HEAP_SIZE );
LocalInit( GDI_HeapSel, 0, GDI_HEAP_SIZE-1 );
#else
- /* Initialize relay code */
+ /* Initialize relay code */
if (!RELAY_Init()) return 0;
- /* Create built-in modules */
+ /* Create built-in modules */
if (!BUILTIN_Init()) return 0;
-#endif
+
+ /* Initialize interrupt vectors */
+ if (!INT_Init()) return 0;
+
+ /* Initialize DOS memory */
+ if (!DOSMEM_Init()) return 0;
+
+ /* Initialize the DOS interrupt */
+ if (!INT21_Init()) return 0;
+
+ /* Initialize signal handling */
+ if (!SIGNAL_Init()) return 0;
+#endif /* WINELIB */
/* Initialise DOS drives */
if (!DRIVE_Init()) return 0;
@@ -90,19 +100,6 @@
/* Initialize communications */
COMM_Init();
-#ifndef WINELIB
- /* Initialize interrupt vectors */
- if (!INT_Init()) return 0;
-
- /* Initialize DOS memory */
- if (!DOSMEM_Init()) return 0;
-
- /* Initialize signal handling */
- init_wine_signals();
-
- /* Initialize the DOS memory */
- if (!INT21_Init()) return 0;
-#endif
/* registry initialisation */
SHELL_LoadRegistry();
@@ -122,12 +119,21 @@
/* Initialize window procedures */
if (!WINPROC_Init()) return 0;
+ /* Initialize built-in window classes */
+ if (!WIDGETS_Init()) return 0;
+
/* Initialize dialog manager */
if (!DIALOG_Init()) return 0;
/* Initialize menus */
if (!MENU_Init()) return 0;
+ /* Create desktop window */
+ if (!WIN_CreateDesktopWindow()) return 0;
+
+ /* Initialize message spying */
+ if (!SPY_Init()) return 0;
+
/* Initialize Win32 data structures */
if (!KERN32_Init()) return 0;
diff --git a/loader/module.c b/loader/module.c
index c643c7d..63c44e2 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -19,14 +19,13 @@
#include "ldt.h"
#include "module.h"
#include "neexe.h"
+#include "registers.h"
#include "stackframe.h"
#include "task.h"
#include "toolhelp.h"
#include "stddebug.h"
#include "debug.h"
-
#include "callback.h"
-#include "wine.h"
extern HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params );
@@ -663,7 +662,7 @@
*
* Return the entry point for a given ordinal.
*/
-SEGPTR MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
+FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
{
NE_MODULE *pModule;
WORD curOrdinal = 1;
@@ -704,7 +703,7 @@
if (sel == 0xfe) sel = 0xffff; /* constant entry */
else sel = (WORD)(DWORD)NE_SEG_TABLE(pModule)[sel-1].selector;
- return PTR_SEG_OFF_TO_SEGPTR( sel, offset );
+ return (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( sel, offset );
}
@@ -1403,12 +1402,12 @@
/***********************************************************************
- * GetProcAddress (KERNEL.50)
+ * GetProcAddress16 (KERNEL.50)
*/
-FARPROC GetProcAddress( HANDLE hModule, SEGPTR name )
+FARPROC16 GetProcAddress16( HMODULE16 hModule, SEGPTR name )
{
WORD ordinal;
- SEGPTR ret;
+ FARPROC16 ret;
if (!hModule) hModule = GetCurrentTask();
hModule = GetExePtr( hModule );
@@ -1425,12 +1424,34 @@
dprintf_module( stddeb, "GetProcAddress: %04x %04x\n",
hModule, ordinal );
}
- if (!ordinal) return (FARPROC)0;
+ if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
- dprintf_module( stddeb, "GetProcAddress: returning %08lx\n", (DWORD)ret );
- return (FARPROC)ret;
+ dprintf_module( stddeb, "GetProcAddress: returning %08x\n", (UINT32)ret );
+ return ret;
+}
+
+
+/***********************************************************************
+ * GetProcAddress32 (KERNEL32.257)
+ */
+FARPROC32 GetProcAddress32( HMODULE32 hModule, LPCSTR function )
+{
+#ifndef WINELIB
+ NE_MODULE *pModule;
+
+ hModule = GetExePtr( hModule );
+ if (!(pModule = MODULE_GetPtr( hModule )))
+ return (FARPROC32)0;
+ if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module)
+ return (FARPROC32)0;
+ if (pModule->flags & NE_FFLAGS_BUILTIN)
+ return BUILTIN_GetProcAddress32( pModule, function );
+ return PE_FindExportedFunction( pModule->pe_module, function );
+#else
+ return NULL;
+#endif
}
diff --git a/loader/ne_image.c b/loader/ne_image.c
index 9ef9966..359242b 100644
--- a/loader/ne_image.c
+++ b/loader/ne_image.c
@@ -37,7 +37,7 @@
WORD *pModuleTable;
WORD count, i, offset;
HMODULE module;
- DWORD address;
+ FARPROC16 address;
int fd;
struct relocation_entry_s *rep, *reloc_entries;
BYTE *func_name;
@@ -242,7 +242,7 @@
}
else
{
- address = PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
+ address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
}
dprintf_fixup(stddeb,"%d: %04x:%04x\n",
@@ -288,9 +288,9 @@
pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp;
if(additive)
- *(unsigned char*)sp = (unsigned char)((address+offset) & 0xFF);
+ *(unsigned char*)sp = (unsigned char)(((int)address+offset) & 0xFF);
else
- *(unsigned char*)sp = (unsigned char)(address & 0xFF);
+ *(unsigned char*)sp = (unsigned char)((int)address & 0xFF);
}
while (offset != 0xffff && !additive);
break;
diff --git a/loader/pe_image.c b/loader/pe_image.c
index 296560a..e95c39f 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -101,7 +101,7 @@
}
}
-static DWORD PE_FindExportedFunction(struct pe_data *pe, char* funcName)
+FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName)
{
struct PE_Export_Directory * exports = pe->pe_export;
unsigned load_addr = pe->load_addr;
@@ -109,7 +109,8 @@
u_long * function;
u_char ** name, *ename;
int i;
- if(!exports)return 0;
+
+ if (!exports) return NULL;
ordinal = (u_short *) (((char *) load_addr) + (int) exports->Address_Of_Name_Ordinals);
function = (u_long *) (((char *) load_addr) + (int) exports->AddressOfFunctions);
name = (u_char **) (((char *) load_addr) + (int) exports->AddressOfNames);
@@ -119,27 +120,16 @@
{
ename = (char *) (((char *) load_addr) + (int) *name);
if(strcmp(ename,funcName)==0)
- return load_addr+*function;
+ return (FARPROC32)(load_addr + *function);
}else{
if(funcName == (int)*ordinal + exports->Base)
- return load_addr+*function;
+ return (FARPROC32)(load_addr + *function);
}
function++;
ordinal++;
name++;
}
- return 0;
-}
-
-DWORD PE_GetProcAddress(HMODULE hModule, char* function)
-{
- NE_MODULE *pModule;
-
- if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
- if (!(pModule->flags & NE_FFLAGS_WIN32) || !pModule->pe_module) return 0;
- if (pModule->flags & NE_FFLAGS_BUILTIN)
- return BUILTIN_GetProcAddress32( pModule, function );
- return PE_FindExportedFunction( pModule->pe_module, function );
+ return NULL;
}
void fixup_imports(struct pe_data *pe, HMODULE hModule)
@@ -211,24 +201,24 @@
{
int ordinal=*import_list & (0x80000000-1);
dprintf_win32(stddeb,"--- Ordinal %s,%d\n", Module, ordinal);
- *thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
- ordinal);
+ *thunk_list = GetProcAddress32(MODULE_FindModule(Module),
+ (LPCSTR)ordinal);
if(!*thunk_list)
{
- fprintf(stderr,"No implementation for %s.%d\n",Module,
- ordinal);
- fixup_failed=1;
+ fprintf(stderr,"No implementation for %s.%d, setting to NULL\n",
+ Module, ordinal);
+ /* fixup_failed=1; */
}
}else{ /* import by name */
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
- *thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
- pe_name->Name);
+ *thunk_list = GetProcAddress32(MODULE_FindModule(Module),
+ pe_name->Name);
if(!*thunk_list)
{
- fprintf(stderr,"No implementation for %s.%d(%s)\n",Module,
- pe_name->Hint, pe_name->Name);
- fixup_failed=1;
+ fprintf(stderr,"No implementation for %s.%d(%s), setting to NULL\n",
+ Module, pe_name->Hint, pe_name->Name);
+ /* fixup_failed=1; */
}
#else
@@ -251,15 +241,15 @@
}
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
- /* FIXME: Both calls should be unified into GetProcAddress */
- *thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
- pe_name->Name);
+ *thunk_list = GetProcAddress32(MODULE_FindModule(Module),
+ pe_name->Name);
#else
fprintf(stderr,"JBP: Call to RELAY32_GetEntryPoint being ignored.\n");
#endif
if(!*thunk_list) {
- fprintf(stderr,"No implementation for %s.%d\n",Module, pe_name->Hint);
- fixup_failed=1;
+ fprintf(stderr,"No implementation for %s.%d, setting to NULL\n",
+ Module, pe_name->Hint);
+ /* fixup_failed=1; */
}
thunk_list++;
}
@@ -533,7 +523,7 @@
}
HINSTANCE MODULE_CreateInstance(HMODULE hModule,LOADPARAMS *params);
-void InitTask(SIGCONTEXT context);
+void InitTask( SIGCONTEXT *context );
HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
{
@@ -644,18 +634,18 @@
int USER_InitApp(HINSTANCE hInstance);
void PE_InitTEB(int hTEB);
-void PE_Win32CallToStart(SIGCONTEXT context)
+void PE_Win32CallToStart( SIGCONTEXT *context )
{
int fs;
HMODULE hModule;
NE_MODULE *pModule;
dprintf_win32(stddeb,"Going to start Win32 program\n");
- InitTask(context);
+ InitTask( &context );
hModule = GetExePtr( GetCurrentTask() );
pModule = MODULE_GetPtr( hModule );
USER_InitApp( hModule );
- fs=(int)GlobalAlloc16(GHND,0x10000);
+ fs=(int)GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, 0x10000 );
PE_InitTEB(fs);
__asm__ __volatile__("movw %w0,%%fs"::"r" (fs));
CallTaskStart32( (FARPROC)(pModule->pe_module->load_addr +
diff --git a/loader/signal.c b/loader/signal.c
index 0aea7fe..c072334 100644
--- a/loader/signal.c
+++ b/loader/signal.c
@@ -168,9 +168,9 @@
/**********************************************************************
- * init_wine_signals
+ * SIGNAL_Init
*/
-void init_wine_signals(void)
+BOOL32 SIGNAL_Init(void)
{
#if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigaltstack ss;
@@ -178,13 +178,13 @@
if ((ss.ss_sp = malloc(MINSIGSTKSZ)) == NULL) {
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
MINSIGSTKSZ);
- exit(1);
+ return FALSE;
}
ss.ss_size = MINSIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
perror("sigstack");
- exit(1);
+ return FALSE;
}
#endif /* __FreeBSD__ || __NetBSD__ */
@@ -194,13 +194,13 @@
if ((ss.ss_sp = malloc(SIGSTKSZ) ) == NULL) {
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
SIGSTKSZ);
- exit(1);
+ return FALSE;
}
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
perror("sigstack");
- exit(1);
+ return FALSE;
}
#endif /* __svr4__ || _SCO_DS */
@@ -216,6 +216,7 @@
#ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */
#endif
+ return TRUE;
}
diff --git a/loader/task.c b/loader/task.c
index 43c7d87..1cfeb3a 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -468,7 +468,7 @@
pTask->pdb.int20 = 0x20cd;
#ifndef WINELIB
pTask->pdb.dispatcher[0] = 0x9a; /* ljmp */
- *(DWORD *)&pTask->pdb.dispatcher[1] = MODULE_GetEntryPoint( GetModuleHandle("KERNEL"), 102 ); /* KERNEL.102 is DOS3Call() */
+ *(FARPROC16 *)&pTask->pdb.dispatcher[1] = MODULE_GetEntryPoint( GetModuleHandle("KERNEL"), 102 ); /* KERNEL.102 is DOS3Call() */
pTask->pdb.savedint22 = INT_GetHandler( 0x22 );
pTask->pdb.savedint23 = INT_GetHandler( 0x23 );
pTask->pdb.savedint24 = INT_GetHandler( 0x24 );
@@ -766,10 +766,9 @@
#ifdef WINELIB
void InitTask(void)
#else
-void InitTask( SIGCONTEXT context )
+void InitTask( SIGCONTEXT *context )
#endif
{
- static int firstTask = 1;
TDB *pTask;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
@@ -777,27 +776,11 @@
LONG stacklow, stackhi;
#ifndef WINELIB
- EAX_reg(&context) = 0;
+ EAX_reg(context) = 0;
#endif
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pModule = MODULE_GetPtr( pTask->hModule ))) return;
- if (firstTask)
- {
- extern BOOL WIDGETS_Init(void);
- extern BOOL WIN_CreateDesktopWindow(void);
-
- /* Perform global initialisations that need a task context */
-
- /* Initialize built-in window classes */
- if (!WIDGETS_Init()) return;
-
- /* Create desktop window */
- if (!WIN_CreateDesktopWindow()) return;
-
- firstTask = 0;
- }
-
#ifndef WINELIB
NE_InitializeDLLs( pTask->hModule );
@@ -809,13 +792,13 @@
* di instance handle of the new task
* es:bx pointer to command-line inside PSP
*/
- EAX_reg(&context) = 1;
- EBX_reg(&context) = 0x81;
- ECX_reg(&context) = pModule->stack_size;
- EDX_reg(&context) = pTask->nCmdShow;
- ESI_reg(&context) = (DWORD)pTask->hPrevInstance;
- EDI_reg(&context) = (DWORD)pTask->hInstance;
- ES_reg (&context) = (WORD)pTask->hPDB;
+ EAX_reg(context) = 1;
+ EBX_reg(context) = 0x81;
+ ECX_reg(context) = pModule->stack_size;
+ EDX_reg(context) = pTask->nCmdShow;
+ ESI_reg(context) = (DWORD)pTask->hPrevInstance;
+ EDI_reg(context) = (DWORD)pTask->hInstance;
+ ES_reg (context) = (WORD)pTask->hPDB;
/* Initialize the local heap */
if ( pModule->heap_size )
@@ -824,7 +807,6 @@
}
#endif
-
/* Initialize the INSTANCEDATA structure */
pSegTable = NE_SEG_TABLE( pModule );
stacklow = pSegTable[pModule->ss - 1].minsize;
@@ -1059,7 +1041,7 @@
/***********************************************************************
* GetTaskQueue (KERNEL.35)
*/
-HQUEUE GetTaskQueue( HANDLE hTask )
+HQUEUE16 GetTaskQueue( HTASK16 hTask )
{
TDB *pTask;
@@ -1073,9 +1055,9 @@
* GetTaskQueueDS (KERNEL.118)
*/
#ifndef WINELIB
-void GetTaskQueueDS( SIGCONTEXT context )
+void GetTaskQueueDS( SIGCONTEXT *context )
{
- DS_reg(&context) = GlobalHandleToSel( GetTaskQueue(0) );
+ DS_reg(context) = GlobalHandleToSel( GetTaskQueue(0) );
}
#endif /* WINELIB */
@@ -1084,9 +1066,9 @@
* GetTaskQueueES (KERNEL.119)
*/
#ifndef WINELIB
-void GetTaskQueueES( SIGCONTEXT context )
+void GetTaskQueueES( SIGCONTEXT *context )
{
- ES_reg(&context) = GlobalHandleToSel( GetTaskQueue(0) );
+ ES_reg(context) = GlobalHandleToSel( GetTaskQueue(0) );
}
#endif /* WINELIB */
@@ -1171,7 +1153,7 @@
/***********************************************************************
* GetTaskDS (KERNEL.155)
*/
-HINSTANCE GetTaskDS(void)
+HINSTANCE16 GetTaskDS(void)
{
TDB *pTask;