Commit 63c7cdf1 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Made the service thread instanciable in every process.

parent ffe6b767
......@@ -95,6 +95,7 @@ typedef struct _PDB
struct _PDB *next; /* List reference - list of PDB's */
WORD hInstance; /* hInstance on startup */
WORD hPrevInstance; /* hPrevInstance on startup */
struct _SERVICETABLE *service_table; /* Service table for service thread */
} PDB;
/* Process flags */
......
......@@ -9,8 +9,6 @@
#include "winbase.h"
BOOL SERVICE_Init( void );
HANDLE SERVICE_AddObject( HANDLE object,
PAPCFUNC callback, ULONG_PTR callback_arg );
......
......@@ -68,9 +68,6 @@ BOOL MAIN_MainInit(void)
/* Initialize signal handling */
if (!SIGNAL_Init()) return FALSE;
/* Initialize kernel services thread */
if (!SERVICE_Init()) return FALSE;
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return FALSE;
......
......@@ -203,6 +203,7 @@ THDB *THREAD_Create( PDB *pdb, DWORD flags, DWORD stack_size, BOOL alloc_stack16
struct new_thread_request request;
struct new_thread_reply reply = { NULL, -1 };
int fd[2];
HANDLE cleanup_object;
THDB *thdb = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, sizeof(THDB) );
if (!thdb) return NULL;
......@@ -250,9 +251,11 @@ THDB *THREAD_Create( PDB *pdb, DWORD flags, DWORD stack_size, BOOL alloc_stack16
THREAD_First = thdb;
/* Install cleanup handler */
if ( !DuplicateHandle( GetCurrentProcess(), *server_handle,
GetCurrentProcess(), &cleanup_object,
0, FALSE, DUPLICATE_SAME_ACCESS ) ) goto error;
thdb->cleanup = SERVICE_AddObject( cleanup_object, THREAD_FreeTHDB, (ULONG_PTR)thdb );
thdb->cleanup = SERVICE_AddObject( *server_handle,
THREAD_FreeTHDB, (ULONG_PTR)thdb );
return thdb;
error:
......
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