server: Make thread entry points client_ptr_t instead of void pointers.
diff --git a/server/debugger.c b/server/debugger.c
index f663e16..a865ebb 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -112,32 +112,34 @@
 
 /* routines to build an event according to its type */
 
-static int fill_exception_event( struct debug_event *event, void *arg )
+static int fill_exception_event( struct debug_event *event, const void *arg )
 {
     memcpy( &event->data.info.exception, arg, sizeof(event->data.info.exception) );
     return 1;
 }
 
-static int fill_create_thread_event( struct debug_event *event, void *arg )
+static int fill_create_thread_event( struct debug_event *event, const void *arg )
 {
     struct process *debugger = event->debugger->process;
     struct thread *thread = event->sender;
+    const client_ptr_t *entry = arg;
     obj_handle_t handle;
 
     /* documented: THREAD_GET_CONTEXT | THREAD_SET_CONTEXT | THREAD_SUSPEND_RESUME */
     if (!(handle = alloc_handle( debugger, thread, THREAD_ALL_ACCESS, 0 ))) return 0;
     event->data.info.create_thread.handle = handle;
     event->data.info.create_thread.teb    = thread->teb;
-    event->data.info.create_thread.start  = arg;
+    event->data.info.create_thread.start  = *entry;
     return 1;
 }
 
-static int fill_create_process_event( struct debug_event *event, void *arg )
+static int fill_create_process_event( struct debug_event *event, const void *arg )
 {
     struct process *debugger = event->debugger->process;
     struct thread *thread = event->sender;
     struct process *process = thread->process;
     struct process_dll *exe_module = get_process_exe_module( process );
+    const client_ptr_t *entry = arg;
     obj_handle_t handle;
 
     /* documented: PROCESS_VM_READ | PROCESS_VM_WRITE */
@@ -164,7 +166,7 @@
     event->data.info.create_process.file       = handle;
     event->data.info.create_process.teb        = thread->teb;
     event->data.info.create_process.base       = exe_module->base;
-    event->data.info.create_process.start      = arg;
+    event->data.info.create_process.start      = *entry;
     event->data.info.create_process.dbg_offset = exe_module->dbg_offset;
     event->data.info.create_process.dbg_size   = exe_module->dbg_size;
     event->data.info.create_process.name       = exe_module->name;
@@ -172,24 +174,24 @@
     return 1;
 }
 
-static int fill_exit_thread_event( struct debug_event *event, void *arg )
+static int fill_exit_thread_event( struct debug_event *event, const void *arg )
 {
-    struct thread *thread = arg;
+    const struct thread *thread = arg;
     event->data.info.exit.exit_code = thread->exit_code;
     return 1;
 }
 
-static int fill_exit_process_event( struct debug_event *event, void *arg )
+static int fill_exit_process_event( struct debug_event *event, const void *arg )
 {
-    struct process *process = arg;
+    const struct process *process = arg;
     event->data.info.exit.exit_code = process->exit_code;
     return 1;
 }
 
-static int fill_load_dll_event( struct debug_event *event, void *arg )
+static int fill_load_dll_event( struct debug_event *event, const void *arg )
 {
     struct process *debugger = event->debugger->process;
-    struct process_dll *dll = arg;
+    const struct process_dll *dll = arg;
     obj_handle_t handle = 0;
 
     if (dll->file && !(handle = alloc_handle( debugger, dll->file, GENERIC_READ, 0 )))
@@ -203,21 +205,21 @@
     return 1;
 }
 
-static int fill_unload_dll_event( struct debug_event *event, void *arg )
+static int fill_unload_dll_event( struct debug_event *event, const void *arg )
 {
-    mod_handle_t *base = arg;
+    const mod_handle_t *base = arg;
     event->data.info.unload_dll.base = *base;
     return 1;
 }
 
-static int fill_output_debug_string_event( struct debug_event *event, void *arg )
+static int fill_output_debug_string_event( struct debug_event *event, const void *arg )
 {
-    struct debug_event_output_string *data = arg;
+    const struct debug_event_output_string *data = arg;
     event->data.info.output_string = *data;
     return 1;
 }
 
-typedef int (*fill_event_func)( struct debug_event *event, void *arg );
+typedef int (*fill_event_func)( struct debug_event *event, const void *arg );
 
 #define NB_DEBUG_EVENTS OUTPUT_DEBUG_STRING_EVENT  /* RIP_EVENT not supported */
 
@@ -373,7 +375,7 @@
 
 /* alloc a debug event for a debugger */
 static struct debug_event *alloc_debug_event( struct thread *thread, int code,
-                                              void *arg, const CONTEXT *context )
+                                              const void *arg, const CONTEXT *context )
 {
     struct thread *debugger = thread->process->debugger;
     struct debug_event *event;
@@ -404,7 +406,7 @@
 }
 
 /* generate a debug event from inside the server and queue it */
-void generate_debug_event( struct thread *thread, int code, void *arg )
+void generate_debug_event( struct thread *thread, int code, const void *arg )
 {
     if (thread->process->debugger)
     {
@@ -499,7 +501,7 @@
 }
 
 /* generate all startup events of a given process */
-void generate_startup_debug_events( struct process *process, void *entry )
+void generate_startup_debug_events( struct process *process, client_ptr_t entry )
 {
     struct list *ptr;
     struct thread *thread, *first_thread = get_process_first_thread( process );
@@ -508,7 +510,7 @@
     LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry )
     {
         if (thread == first_thread)
-            generate_debug_event( thread, CREATE_PROCESS_DEBUG_EVENT, entry );
+            generate_debug_event( thread, CREATE_PROCESS_DEBUG_EVENT, &entry );
         else
             generate_debug_event( thread, CREATE_THREAD_DEBUG_EVENT, NULL );
     }
@@ -619,7 +621,7 @@
     }
     else if (debugger_attach( process, current ))
     {
-        generate_startup_debug_events( process, NULL );
+        generate_startup_debug_events( process, 0 );
         break_process( process );
         resume_process( process );
     }
diff --git a/server/object.h b/server/object.h
index cd46f5b..a5d0ffd 100644
--- a/server/object.h
+++ b/server/object.h
@@ -175,8 +175,8 @@
 /* debugger functions */
 
 extern int set_process_debugger( struct process *process, struct thread *debugger );
-extern void generate_debug_event( struct thread *thread, int code, void *arg );
-extern void generate_startup_debug_events( struct process *process, void *entry );
+extern void generate_debug_event( struct thread *thread, int code, const void *arg );
+extern void generate_startup_debug_events( struct process *process, client_ptr_t entry );
 extern void debug_exit_thread( struct thread *thread );
 
 /* mapping functions */
diff --git a/server/process.c b/server/process.c
index a0c66ab..09dd041 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1168,7 +1168,7 @@
         if (dll)
         {
             reply->size = dll->size;
-            reply->entry_point = NULL; /* FIXME */
+            reply->entry_point = 0; /* FIXME */
             reply->filename_len = dll->namelen;
             if (dll->filename)
             {
diff --git a/server/protocol.def b/server/protocol.def
index e5c9676..3c6c55d 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -79,7 +79,7 @@
 {
     obj_handle_t handle;     /* handle to the new thread */
     void        *teb;        /* thread teb (in debugged process address space) */
-    void        *start;      /* thread startup routine */
+    client_ptr_t start;      /* thread startup routine */
 };
 struct debug_event_create_process
 {
@@ -90,7 +90,7 @@
     int          dbg_offset; /* offset of debug info in file */
     int          dbg_size;   /* size of debug info */
     void        *teb;        /* thread teb (in debugged process address space) */
-    void        *start;      /* thread startup routine */
+    client_ptr_t start;      /* thread startup routine */
     client_ptr_t name;       /* image name (optional) */
     int          unicode;    /* is it Unicode? */
 };
@@ -537,7 +537,7 @@
     int          gui;          /* is it a GUI process? */
     mod_handle_t module;       /* main module base address */
     client_ptr_t ldt_copy;     /* address of LDT copy (in thread address space) */
-    void*        entry;        /* process entry point */
+    client_ptr_t entry;        /* process entry point */
 @END
 
 
@@ -548,8 +548,7 @@
     int          debug_level;  /* new debug level */
     void*        teb;          /* TEB of new thread (in thread address space) */
     void*        peb;          /* address of PEB (in thread address space) */
-    void*        entry;        /* thread entry point (in thread address space) */
-    int          unused;       /* was: ldt_copy */
+    client_ptr_t entry;        /* thread entry point (in thread address space) */
     int          reply_fd;     /* fd for reply pipe */
     int          wait_fd;      /* fd for blocking calls pipe */
 @REPLY
@@ -641,7 +640,7 @@
     obj_handle_t handle;       /* process handle */
     mod_handle_t base_address; /* base address of module */
 @REPLY
-    void*        entry_point;
+    client_ptr_t entry_point;
     data_size_t  size;            /* module size */
     data_size_t  filename_len;    /* buffer len in bytes required to store filename */
     VARARG(filename,unicode_str); /* file name of module */
diff --git a/server/thread.c b/server/thread.c
index 675deda..fd7ebfa 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1053,7 +1053,7 @@
         if (process->unix_pid != current->unix_pid)
             process->unix_pid = -1;  /* can happen with linuxthreads */
         if (current->suspend + process->suspend > 0) stop_thread( current );
-        generate_debug_event( current, CREATE_THREAD_DEBUG_EVENT, req->entry );
+        generate_debug_event( current, CREATE_THREAD_DEBUG_EVENT, &req->entry );
     }
     debug_level = max( debug_level, req->debug_level );
 
diff --git a/server/trace.c b/server/trace.c
index db67b2a..5cf5f82 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -499,18 +499,21 @@
         fprintf( stderr, ",first=%d}", event->info.exception.first );
         break;
     case CREATE_THREAD_DEBUG_EVENT:
-        fprintf( stderr, "{create_thread,thread=%04x,teb=%p,start=%p}",
-                 event->info.create_thread.handle, event->info.create_thread.teb,
-                 event->info.create_thread.start );
+        fprintf( stderr, "{create_thread,thread=%04x,teb=%p,start=",
+                 event->info.create_thread.handle, event->info.create_thread.teb );
+        dump_uint64( &event->info.create_thread.start );
+        fputc( '}', stderr );
         break;
     case CREATE_PROCESS_DEBUG_EVENT:
         fprintf( stderr, "{create_process,file=%04x,process=%04x,thread=%04x,base=",
                  event->info.create_process.file, event->info.create_process.process,
                  event->info.create_process.thread );
         dump_uint64( &event->info.create_process.base );
-        fprintf( stderr, ",offset=%d,size=%d,teb=%p,start=%p,name=",
+        fprintf( stderr, ",offset=%d,size=%d,teb=%p,start=",
                  event->info.create_process.dbg_offset, event->info.create_process.dbg_size,
-                 event->info.create_process.teb, event->info.create_process.start );
+                 event->info.create_process.teb );
+        dump_uint64( &event->info.create_process.start );
+        fprintf( stderr, ",name=" );
         dump_uint64( &event->info.create_process.name );
         fprintf( stderr, ",unicode=%d}", event->info.create_process.unicode );
         break;
@@ -974,7 +977,8 @@
     fprintf( stderr, " ldt_copy=" );
     dump_uint64( &req->ldt_copy );
     fprintf( stderr, "," );
-    fprintf( stderr, " entry=%p", req->entry );
+    fprintf( stderr, " entry=" );
+    dump_uint64( &req->entry );
 }
 
 static void dump_init_thread_request( const struct init_thread_request *req )
@@ -984,8 +988,9 @@
     fprintf( stderr, " debug_level=%d,", req->debug_level );
     fprintf( stderr, " teb=%p,", req->teb );
     fprintf( stderr, " peb=%p,", req->peb );
-    fprintf( stderr, " entry=%p,", req->entry );
-    fprintf( stderr, " unused=%d,", req->unused );
+    fprintf( stderr, " entry=" );
+    dump_uint64( &req->entry );
+    fprintf( stderr, "," );
     fprintf( stderr, " reply_fd=%d,", req->reply_fd );
     fprintf( stderr, " wait_fd=%d", req->wait_fd );
 }
@@ -1093,7 +1098,9 @@
 
 static void dump_get_dll_info_reply( const struct get_dll_info_reply *req )
 {
-    fprintf( stderr, " entry_point=%p,", req->entry_point );
+    fprintf( stderr, " entry_point=" );
+    dump_uint64( &req->entry_point );
+    fprintf( stderr, "," );
     fprintf( stderr, " size=%u,", req->size );
     fprintf( stderr, " filename_len=%u,", req->filename_len );
     fprintf( stderr, " filename=" );