Patrick Spinler <[EMAIL PROTECTED]> writes:
> I see that Alexandre started to put some preliminary patches in a month
> or two ago. How far along is this ? Any bite sized tasks I could help
> with ?
Development has stalled a bit, since it has been decided (wisely) to
not try to get this into the first Corel release.
If you are feeling adventurous you can try the patch below, that
spawns every new Win32 process in a separate address space. This
should fix the "no relocation records" error, and probably break just
about everything else...
Index: include/thread.h
===================================================================
RCS file: /home/wine/wine/include/thread.h,v
retrieving revision 1.31
diff -u -r1.31 thread.h
--- include/thread.h 2000/03/08 18:26:57 1.31
+++ include/thread.h 2000/03/10 17:25:20
@@ -121,6 +121,7 @@
/* scheduler/thread.c */
+extern BOOL THREAD_AllocStack( TEB *teb, DWORD stack_size, BOOL alloc_stack16 );
extern TEB *THREAD_CreateInitialThread( struct _PDB *pdb, int server_fd );
extern TEB *THREAD_Create( struct _PDB *pdb, int fd, DWORD flags,
DWORD stack_size, BOOL alloc_stack16,
Index: loader/main.c
===================================================================
RCS file: /home/wine/wine/loader/main.c,v
retrieving revision 1.60
diff -u -r1.60 main.c
--- loader/main.c 2000/02/26 16:51:13 1.60
+++ loader/main.c 2000/03/10 17:25:21
@@ -62,6 +62,9 @@
*/
BOOL MAIN_MainInit( int *argc, char *argv[], BOOL win32 )
{
+ LPCSTR filename = NULL;
+ extern void PROCESS_Init32( LPCSTR );
+
/* store the program name */
argv0 = argv[0];
@@ -71,6 +74,8 @@
/* Initialize syslevel handling */
SYSLEVEL_Init();
+ if (PROCESS_Current()->exe_file != -1) filename = argv[1];
+
/* Parse command line arguments */
MAIN_WineInit( argc, argv );
@@ -111,6 +116,7 @@
if (!LoadLibrary16( "KRNL386.EXE" )) return FALSE;
if (!LoadLibraryA( "KERNEL32" )) return FALSE;
+ if (PROCESS_Current()->exe_file != -1) PROCESS_Init32( filename );
return TRUE;
}
Index: loader/pe_image.c
===================================================================
RCS file: /home/wine/wine/loader/pe_image.c,v
retrieving revision 1.54
diff -u -r1.54 pe_image.c
--- loader/pe_image.c 2000/03/09 18:18:41 1.54
+++ loader/pe_image.c 2000/03/10 17:25:21
@@ -974,6 +974,7 @@
BOOL inherit, DWORD flags, LPSTARTUPINFOA startup,
LPPROCESS_INFORMATION info )
{
+#if 0
WORD version = 0;
HMODULE16 hModule16;
HMODULE hModule32;
@@ -1012,6 +1013,9 @@
be done in the context of the new process, in TASK_CallToStart */
return TRUE;
+#endif
+ return PROCESS_Create32( hFile, filename, cmd_line, env,
+ psa, tsa, inherit, flags, startup, info );
}
/*********************************************************************
Index: scheduler/process.c
===================================================================
RCS file: /home/wine/wine/scheduler/process.c,v
retrieving revision 1.81
diff -u -r1.81 process.c
--- scheduler/process.c 2000/03/09 18:18:42 1.81
+++ scheduler/process.c 2000/03/10 17:25:22
@@ -7,6 +7,7 @@
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "wine/winbase16.h"
@@ -17,6 +18,7 @@
#include "file.h"
#include "global.h"
#include "heap.h"
+#include "main.h"
#include "task.h"
#include "ldt.h"
#include "syslevel.h"
@@ -35,6 +37,8 @@
/* The initial process PDB */
static PDB initial_pdb;
+static ENVDB initial_envdb;
+static STARTUPINFOA initial_startup;
static PDB *PROCESS_First = &initial_pdb;
@@ -299,6 +303,7 @@
pdb->next = PROCESS_First;
pdb->winver = 0xffff; /* to be determined */
pdb->main_queue = INVALID_HANDLE_VALUE16;
+ pdb->heap = GetProcessHeap();
PROCESS_First = pdb;
return pdb;
}
@@ -309,6 +314,7 @@
*/
BOOL PROCESS_Init( BOOL win32 )
{
+ struct init_process_request *req;
TEB *teb;
int server_fd;
@@ -320,11 +326,13 @@
initial_pdb.threads = 1;
initial_pdb.running_threads = 1;
initial_pdb.ring0_threads = 1;
+ initial_pdb.env_db = &initial_envdb;
initial_pdb.group = &initial_pdb;
initial_pdb.priority = 8; /* Normal */
initial_pdb.flags = win32? 0 : PDB32_WIN16_PROC;
initial_pdb.winver = 0xffff; /* to be determined */
initial_pdb.main_queue = INVALID_HANDLE_VALUE16;
+ initial_envdb.startup_info = &initial_startup;
/* Initialize virtual memory management */
if (!VIRTUAL_Init()) return FALSE;
@@ -350,14 +358,33 @@
/* Initialize signal handling */
if (!SIGNAL_Init()) return FALSE;
- /* Create the environment DB of the first process */
- if (!PROCESS_CreateEnvDB()) return FALSE;
+ /* Retrieve startup info from the server */
+ req = get_req_buffer();
+ req->ldt_copy = ldt_copy;
+ req->ldt_flags = ldt_flags_copy;
+ if (server_call( REQ_INIT_PROCESS )) return FALSE;
+ initial_pdb.exe_file = req->exe_file;
+ initial_startup.dwFlags = req->start_flags;
+ initial_startup.wShowWindow = req->cmd_show;
+ initial_envdb.hStdin = initial_startup.hStdInput = req->hstdin;
+ initial_envdb.hStdout = initial_startup.hStdOutput = req->hstdout;
+ initial_envdb.hStderr = initial_startup.hStdError = req->hstderr;
+ initial_envdb.cmd_line = HEAP_strdupA( GetProcessHeap(), 0, req->cmdline );
+ if (initial_pdb.exe_file != -1)
+ {
+ initial_pdb.flags &= ~PDB32_WIN16_PROC;
+ NtCurrentTeb()->tibflags |= TEBF_WIN32;
+ }
+ /* Copy the parent environment */
+ if (!ENV_InheritEnvironment( NULL )) return FALSE;
+
/* Create the SEGPTR heap */
if (!(SegptrHeap = HeapCreate( HEAP_WINE_SEGPTR, 0, 0 ))) return FALSE;
- /* Initialize the first process critical section */
+ /* Initialize the critical sections */
InitializeCriticalSection( &initial_pdb.crit_section );
+ InitializeCriticalSection( &initial_envdb.section );
return TRUE;
}
@@ -366,41 +393,25 @@
/***********************************************************************
* PROCESS_Start
*
- * Startup routine of a new process. Called in the context of the new process.
+ * Startup routine of a new Win16 or DOS process. Called in the context of the new
+process.
*/
void PROCESS_Start(void)
{
struct init_process_done_request *req = get_req_buffer();
- int debugged;
UINT cmdShow = SW_SHOWNORMAL;
- LPTHREAD_START_ROUTINE entry = NULL;
PDB *pdb = PROCESS_Current();
NE_MODULE *pModule = NE_GetPtr( pdb->module );
- LPCSTR filename = ((OFSTRUCT *)((char*)(pModule) +
(pModule)->fileinfo))->szPathName;
- IMAGE_OPTIONAL_HEADER *header = !pModule->module32? NULL :
- &PE_HEADER(pModule->module32)->OptionalHeader;
/* Get process type */
- enum { PROC_DOS, PROC_WIN16, PROC_WIN32 } type;
+ enum { PROC_DOS, PROC_WIN16 } type;
if ( pdb->flags & PDB32_DOS_PROC )
type = PROC_DOS;
- else if ( pdb->flags & PDB32_WIN16_PROC )
- type = PROC_WIN16;
else
- type = PROC_WIN32;
+ type = PROC_WIN16;
/* Initialize the critical section */
InitializeCriticalSection( &pdb->crit_section );
- /* Create the heap */
- if (!(pdb->heap = GetProcessHeap()))
- {
- if (!(pdb->heap = HeapCreate( HEAP_GROWABLE,
- header? header->SizeOfHeapReserve : 0x10000,
- header? header->SizeOfHeapCommit : 0 )))
- goto error;
- }
-
/* Create the environment db */
if (!PROCESS_CreateEnvDB()) goto error;
@@ -411,33 +422,12 @@
goto error;
/* Load all process modules */
- switch ( type )
+ if (!(pdb->flags & PDB32_DOS_PROC))
{
- case PROC_WIN16:
if ( !NE_InitProcess( pModule ) )
goto error;
- break;
-
- case PROC_WIN32:
- /* Create 32-bit MODREF */
- if ( !PE_CreateModule( pModule->module32, filename, 0, FALSE ) )
- goto error;
-
- /* Increment EXE refcount */
- assert( pdb->exe_modref );
- pdb->exe_modref->refCount++;
-
- /* Retrieve entry point address */
- entry = (LPTHREAD_START_ROUTINE)RVA_PTR(pModule->module32,
- OptionalHeader.AddressOfEntryPoint);
- break;
-
- case PROC_DOS:
- /* FIXME: move DOS startup code here */
- break;
}
-
/* Note: The USIG_PROCESS_CREATE signal is supposed to be sent in the
* context of the parent process. Actually, the USER signal proc
* doesn't really care about that, but it *does* require that the
@@ -453,29 +443,13 @@
PROCESS_CallUserSignalProc( USIG_PROCESS_LOADED, 0, 0 );
/* Signal the parent process to continue */
- req->module = (void *)pModule->module32;
- req->entry = entry;
+ req->module = NULL;
+ req->entry = NULL;
server_call( REQ_INIT_PROCESS_DONE );
- debugged = req->debugged;
if ( (pdb->flags & PDB32_CONSOLE_PROC) || (pdb->flags & PDB32_DOS_PROC) )
AllocConsole();
- /* Perform Win32 specific process initialization */
- if ( type == PROC_WIN32 )
- {
- EnterCriticalSection( &pdb->crit_section );
-
- PE_InitTls();
- MODULE_DllProcessAttach( pdb->exe_modref, (LPVOID)1 );
-
- LeaveCriticalSection( &pdb->crit_section );
- }
-
- /* Call UserSignalProc ( USIG_PROCESS_RUNNING ... ) only for non-GUI win32 apps */
- if ( type != PROC_WIN16 && (pdb->flags & PDB32_CONSOLE_PROC))
- PROCESS_CallUserSignalProc( USIG_PROCESS_RUNNING, 0, 0 );
-
switch ( type )
{
case PROC_DOS:
@@ -489,13 +463,6 @@
TASK_CallToStart();
ERR_(relay)( "TASK_CallToStart returned; should not happen!\n" );
ExitProcess( 0 );
-
- case PROC_WIN32:
- TRACE_(relay)( "Starting Win32 process (entryproc=%p)\n", entry );
- if (debugged) DbgBreakPoint();
- /* FIXME: should use _PEB as parameter for NT 3.5 programs !
- * Dunno about other OSs */
- ExitProcess( entry(NULL) );
}
error:
@@ -514,8 +481,7 @@
PROCESS_INFORMATION *info )
{
HANDLE handles[2], load_done_evt = 0;
- DWORD exitcode, size;
- BOOL alloc_stack16;
+ DWORD exitcode;
int server_thandle, fd = -1;
struct new_process_request *req = get_req_buffer();
TEB *teb = NULL;
@@ -557,31 +523,19 @@
info->hThread = req->thandle;
info->dwThreadId = (DWORD)req->tid;
- if (pModule->module32) /* Win32 process */
+ if (!pModule->dos_image) /* Win16 process */
{
- IMAGE_OPTIONAL_HEADER *header = &PE_HEADER(pModule->module32)->OptionalHeader;
- size = header->SizeOfStackReserve;
- if (header->Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI)
- pdb->flags |= PDB32_CONSOLE_PROC;
- alloc_stack16 = TRUE;
- }
- else if (!pModule->dos_image) /* Win16 process */
- {
- alloc_stack16 = FALSE;
- size = 0;
pdb->flags |= PDB32_WIN16_PROC;
}
else /* DOS process */
{
- alloc_stack16 = FALSE;
- size = 0;
pdb->flags |= PDB32_DOS_PROC;
}
/* Create the main thread */
- if (!(teb = THREAD_Create( pdb, fd, flags & CREATE_SUSPENDED, size,
- alloc_stack16, tsa, &server_thandle ))) goto error;
+ if (!(teb = THREAD_Create( pdb, fd, flags & CREATE_SUSPENDED, 0,
+ FALSE, tsa, &server_thandle ))) goto error;
teb->tid = (void *)info->dwThreadId;
teb->startup = PROCESS_Start;
fd = -1; /* don't close it */
@@ -632,6 +586,251 @@
PROCESS_FreePDB( pdb );
if (fd != -1) close( fd );
return NULL;
+}
+
+
+static HMODULE main_module;
+
+/***********************************************************************
+ * start_process
+ *
+ * Startup routine of a new Win32 process.
+ */
+static void start_process(void)
+{
+ struct init_process_done_request *req = get_req_buffer();
+ int debugged;
+ LPTHREAD_START_ROUTINE entry;
+ PDB *pdb = PROCESS_Current();
+ HMODULE hModule32 = main_module;
+ LPCSTR filename = pdb->env_db->cmd_line;
+
+ /* Create 32-bit MODREF */
+ if ( !PE_CreateModule( hModule32, filename, 0, FALSE ) )
+ goto error;
+
+ /* Increment EXE refcount */
+ assert( pdb->exe_modref );
+ pdb->exe_modref->refCount++;
+
+ /* Retrieve entry point address */
+ entry =
+(LPTHREAD_START_ROUTINE)RVA_PTR(hModule32,OptionalHeader.AddressOfEntryPoint);
+
+ /* Load system DLLs into the initial process (and initialize them) */
+ if ( !LoadLibrary16("GDI.EXE" ) || !LoadLibraryA("GDI32.DLL" )
+ || !LoadLibrary16("USER.EXE") || !LoadLibraryA("USER32.DLL"))
+ goto error;
+
+ /* Get pointers to USER routines called by KERNEL */
+ THUNK_InitCallout();
+
+ /* Call FinalUserInit routine */
+ Callout.FinalUserInit16();
+
+ /* Note: The USIG_PROCESS_CREATE signal is supposed to be sent in the
+ * context of the parent process. Actually, the USER signal proc
+ * doesn't really care about that, but it *does* require that the
+ * startup parameters are correctly set up, so that GetProcessDword
+ * works. Furthermore, before calling the USER signal proc the
+ * 16-bit stack must be set up, which it is only after TASK_Create
+ * in the case of a 16-bit process. Thus, we send the signal here.
+ */
+
+ PROCESS_CallUserSignalProc( USIG_PROCESS_CREATE, 0, 0 );
+ PROCESS_CallUserSignalProc( USIG_THREAD_INIT, GetCurrentThreadId(), 0 );
+ PROCESS_CallUserSignalProc( USIG_PROCESS_INIT, 0, 0 );
+ PROCESS_CallUserSignalProc( USIG_PROCESS_LOADED, 0, 0 );
+
+ /* Signal the parent process to continue */
+ req->module = (void *)hModule32;
+ req->entry = entry;
+ server_call( REQ_INIT_PROCESS_DONE );
+ debugged = req->debugged;
+
+ if (pdb->flags & PDB32_CONSOLE_PROC) AllocConsole();
+
+ EnterCriticalSection( &pdb->crit_section );
+ PE_InitTls();
+ MODULE_DllProcessAttach( pdb->exe_modref, (LPVOID)1 );
+ LeaveCriticalSection( &pdb->crit_section );
+
+ /* Call UserSignalProc ( USIG_PROCESS_RUNNING ... ) only for non-GUI win32 apps */
+ if (pdb->flags & PDB32_CONSOLE_PROC)
+ PROCESS_CallUserSignalProc( USIG_PROCESS_RUNNING, 0, 0 );
+
+ TRACE_(relay)( "Starting Win32 process (entryproc=%p)\n", entry );
+ if (debugged) DbgBreakPoint();
+ /* FIXME: should use _PEB as parameter for NT 3.5 programs !
+ * Dunno about other OSs */
+ ExitProcess( entry(NULL) );
+
+ error:
+ ExitProcess( GetLastError() );
+}
+
+
+/***********************************************************************
+ * exec_new_wine
+ *
+ * fork() and exec() a new Wine process.
+ */
+static int exec_new_wine( const char *filename, const char *cmd_line, const char
+*env, int fd )
+{
+ int ret = fork();
+ if (!ret) /* child */
+ {
+ char buffer[20], *path, *ptr;
+
+ /* put the environment strings back into the Unix environment */
+ while (*env)
+ {
+ /* do not overwrite PATH or HOME*/
+ if (memcmp( env, "PATH=", 5 ) && memcmp( env, "HOME=", 5 )) putenv( env );
+ env += strlen(env) + 1;
+ }
+ sprintf( buffer, "__WINE_FD=%d", fd );
+ putenv( buffer );
+
+ execl( BINDIR "/wine", "wine", filename, cmd_line, NULL );
+ if (!(path = malloc( strlen(argv0) + 6 ))) _exit(1);
+ if ((ptr = strrchr( strcpy( path, argv0 ), '/' )))
+ {
+ strcpy( ptr, "/wine" );
+ execl( path, "wine", filename, cmd_line, NULL );
+ }
+ execlp( "wine", "wine", filename, cmd_line, NULL );
+ execl( "./wine", "wine", filename, cmd_line, NULL );
+ _exit(1);
+ }
+ return ret;
+}
+
+
+/***********************************************************************
+ * PROCESS_Init32
+ *
+ * Initialisation of a new Win32 process.
+ */
+void PROCESS_Init32( LPCSTR filename )
+{
+ UINT cmdShow = SW_SHOWNORMAL;
+ WORD version;
+ HMODULE16 hModule16;
+ NE_MODULE *pModule;
+ PDB *pdb = PROCESS_Current();
+
+ /* load main module */
+ if ((main_module = PE_LoadImage( pdb->exe_file, filename, &version )) < 32)
+ ExitProcess( main_module );
+
+ /* create 16-bit dummy module */
+ if ((hModule16 = MODULE_CreateDummyModule( filename, version )) < 32)
+ ExitProcess( hModule16 );
+ pModule = (NE_MODULE *)GlobalLock16( hModule16 );
+ pModule->flags = NE_FFLAGS_WIN32;
+ pModule->module32 = main_module;
+ if (pdb->env_db->startup_info->dwFlags & STARTF_USESHOWWINDOW)
+ cmdShow = pdb->env_db->startup_info->wShowWindow;
+ if (!TASK_Create( pModule, cmdShow )) goto error;
+
+ /* allocate main thread stack */
+ if (!THREAD_AllocStack( NtCurrentTeb(),
+
+PE_HEADER(main_module)->OptionalHeader.SizeOfStackReserve, TRUE ))
+ goto error;
+
+ SIGNAL_Init(); /* reinitialize signal stack */
+
+ /* switch to the new stack */
+ CALL32_Init( &IF1632_CallLargeStack, start_process, NtCurrentTeb()->stack_top );
+ error:
+ ExitProcess( GetLastError() );
+}
+
+
+/***********************************************************************
+ * PROCESS_Create32
+ *
+ * Create a new process database and associated info for a 32-bit process.
+ */
+BOOL PROCESS_Create32( HFILE hFile, LPCSTR filename, LPCSTR cmd_line, LPCSTR env,
+ LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
+ BOOL inherit, DWORD flags, STARTUPINFOA *startup,
+ PROCESS_INFORMATION *info )
+{
+ HANDLE handles[2], load_done_evt = 0;
+ DWORD exitcode;
+ int fd = -1;
+ struct new_process_request *req = get_req_buffer();
+
+ info->hThread = info->hProcess = INVALID_HANDLE_VALUE;
+ if (!(load_done_evt = CreateEventA( NULL, TRUE, FALSE, NULL ))) goto error;
+
+ /* Create the process on the server side */
+
+ req->inherit = (psa && (psa->nLength >= sizeof(*psa)) &&
+psa->bInheritHandle);
+ req->inherit_all = inherit;
+ req->create_flags = flags;
+ req->start_flags = startup->dwFlags;
+ req->event = load_done_evt;
+ req->exe_file = hFile;
+ if (startup->dwFlags & STARTF_USESTDHANDLES)
+ {
+ req->hstdin = startup->hStdInput;
+ req->hstdout = startup->hStdOutput;
+ req->hstderr = startup->hStdError;
+ }
+ else
+ {
+ req->hstdin = GetStdHandle( STD_INPUT_HANDLE );
+ req->hstdout = GetStdHandle( STD_OUTPUT_HANDLE );
+ req->hstderr = GetStdHandle( STD_ERROR_HANDLE );
+ }
+ req->cmd_show = startup->wShowWindow;
+ req->env_ptr = NULL;
+ lstrcpynA( req->cmdline, cmd_line, server_remaining(req->cmdline) );
+ if (server_call_fd( REQ_NEW_PROCESS, -1, &fd )) goto error;
+ info->hProcess = req->phandle;
+ info->dwProcessId = (DWORD)req->pid;
+ info->hThread = req->thandle;
+ info->dwThreadId = (DWORD)req->tid;
+
+ /* FIXME: lock environment */
+ if (!env) env = GetEnvironmentStringsA();
+
+ if (exec_new_wine( filename, cmd_line, env, fd ) == -1) goto error;
+ close( fd );
+ fd = -1;
+
+ /* Wait until process is initialized (or initialization failed) */
+ handles[0] = info->hProcess;
+ handles[1] = load_done_evt;
+
+ switch ( WaitForMultipleObjects( 2, handles, FALSE, INFINITE ) )
+ {
+ default:
+ ERR( "WaitForMultipleObjects failed\n" );
+ break;
+
+ case 0:
+ /* Child initialization code returns error condition as exitcode */
+ if ( GetExitCodeProcess( info->hProcess, &exitcode ) )
+ SetLastError( exitcode );
+ goto error;
+
+ case 1:
+ break;
+ }
+
+ CloseHandle( load_done_evt );
+ load_done_evt = 0;
+ return TRUE;
+
+error:
+ if (load_done_evt) CloseHandle( load_done_evt );
+ if (info->hThread != INVALID_HANDLE_VALUE) CloseHandle( info->hThread );
+ if (info->hProcess != INVALID_HANDLE_VALUE) CloseHandle( info->hProcess );
+ if (fd != -1) close( fd );
+ return FALSE;
}
Index: scheduler/thread.c
===================================================================
RCS file: /home/wine/wine/scheduler/thread.c,v
retrieving revision 1.56
diff -u -r1.56 thread.c
--- scheduler/thread.c 2000/03/08 12:01:30 1.56
+++ scheduler/thread.c 2000/03/10 17:25:22
@@ -74,12 +74,11 @@
/***********************************************************************
- * THREAD_InitTEB
+ * THREAD_AllocStack
*
* Initialization of a newly created TEB.
*/
-static BOOL THREAD_InitTEB( TEB *teb, DWORD stack_size, BOOL alloc_stack16,
- LPSECURITY_ATTRIBUTES sa )
+BOOL THREAD_AllocStack( TEB *teb, DWORD stack_size, BOOL alloc_stack16 )
{
DWORD old_prot;
@@ -119,11 +118,6 @@
teb->signal_stack = (char *)teb->signal_stack + 0x10000;
}
- /* StaticUnicodeString */
-
- teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer);
- teb->StaticUnicodeString.Buffer = (PWSTR)teb->StaticUnicodeBuffer;
-
return TRUE;
error:
@@ -172,13 +166,16 @@
TEB *THREAD_CreateInitialThread( PDB *pdb, int server_fd )
{
initial_teb.except = (void *)-1;
+ initial_teb.stack_top = (void *)~0UL;
initial_teb.self = &initial_teb;
initial_teb.tibflags = (pdb->flags & PDB32_WIN16_PROC)? 0 : TEBF_WIN32;
initial_teb.tls_ptr = initial_teb.tls_array;
initial_teb.process = pdb;
initial_teb.exit_code = STILL_ACTIVE;
initial_teb.socket = server_fd;
-
+ initial_teb.StaticUnicodeString.MaximumLength =
+sizeof(initial_teb.StaticUnicodeBuffer);
+ initial_teb.StaticUnicodeString.Buffer = initial_teb.StaticUnicodeBuffer;
+
/* Allocate the TEB selector (%fs register) */
if (!(initial_teb.teb_sel = SELECTOR_AllocBlock( &initial_teb, 0x1000,
@@ -192,7 +189,7 @@
/* Now proceed with normal initialization */
if (CLIENT_InitThread()) return NULL;
- if (!THREAD_InitTEB( &initial_teb, 0, TRUE, NULL )) return NULL;
+ if (!THREAD_AllocStack( &initial_teb, 0, TRUE )) return NULL;
return &initial_teb;
}
@@ -222,6 +219,8 @@
teb->process = pdb;
teb->exit_code = STILL_ACTIVE;
teb->socket = fd;
+ teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer);
+ teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer;
/* Allocate the TEB selector (%fs register) */
@@ -243,7 +242,7 @@
/* Do the rest of the initialization */
- if (!THREAD_InitTEB( teb, stack_size, alloc_stack16, sa )) goto error;
+ if (!THREAD_AllocStack( teb, stack_size, alloc_stack16 )) goto error;
teb->next = THREAD_First;
THREAD_First = teb;
Index: windows/queue.c
===================================================================
RCS file: /home/wine/wine/windows/queue.c,v
retrieving revision 1.47
diff -u -r1.47 queue.c
--- windows/queue.c 2000/02/10 19:03:12 1.47
+++ windows/queue.c 2000/03/10 17:25:23
@@ -1533,7 +1533,7 @@
return 0;
}
- pdb = PROCESS_IdToPDB( pid );
+ if (!(pdb = PROCESS_IdToPDB( pid ))) return 0;
/* check whether we are waiting for a win32 process or the win16 subsystem */
if ( pdb->flags & PDB32_WIN16_PROC ) {
--
Alexandre Julliard
[EMAIL PROTECTED]