Added process_id_t and thread_it_t types to the server interface
instead of using void*, and removed a number of type casts.

diff --git a/dlls/kernel/console.c b/dlls/kernel/console.c
index ca84f15..7091b1f 100644
--- a/dlls/kernel/console.c
+++ b/dlls/kernel/console.c
@@ -1406,7 +1406,7 @@
     SERVER_START_REQ( send_console_signal )
     {
         req->signal = dwCtrlEvent;
-        req->group_id = (void*)dwProcessGroupID;
+        req->group_id = dwProcessGroupID;
         ret = !wine_server_call_err( req );
     }
     SERVER_END_REQ;
diff --git a/dlls/kernel/debugger.c b/dlls/kernel/debugger.c
index 96e9e01..92402fe 100644
--- a/dlls/kernel/debugger.c
+++ b/dlls/kernel/debugger.c
@@ -149,8 +149,8 @@
     BOOL ret;
     SERVER_START_REQ( continue_debug_event )
     {
-        req->pid    = (void *)pid;
-        req->tid    = (void *)tid;
+        req->pid    = pid;
+        req->tid    = tid;
         req->status = status;
         ret = !wine_server_call_err( req );
     }
@@ -174,7 +174,7 @@
     BOOL ret;
     SERVER_START_REQ( debug_process )
     {
-        req->pid = (void *)pid;
+        req->pid = pid;
         req->attach = 1;
         ret = !wine_server_call_err( req );
     }
@@ -197,7 +197,7 @@
     BOOL ret;
     SERVER_START_REQ( debug_process )
     {
-        req->pid = (void *)pid;
+        req->pid = pid;
         req->attach = 0;
         ret = !wine_server_call_err( req );
     }
diff --git a/dlls/kernel/toolhelp.c b/dlls/kernel/toolhelp.c
index 0602cd9..11b7660 100644
--- a/dlls/kernel/toolhelp.c
+++ b/dlls/kernel/toolhelp.c
@@ -223,7 +223,7 @@
     {
         req->flags   = flags & ~TH32CS_INHERIT;
         req->inherit = (flags & TH32CS_INHERIT) != 0;
-        req->pid     = (void *)process;
+        req->pid     = process;
         wine_server_call_err( req );
         ret = reply->handle;
     }
@@ -373,7 +373,7 @@
             lpme->ProccntUsage   = 0; /* FIXME */
             lpme->modBaseAddr    = reply->base;
             lpme->modBaseSize    = reply->size;
-            lpme->hModule        = (DWORD)reply->base;
+            lpme->hModule        = (HMODULE)reply->base;
             lpme->szModule[0]    = 0;  /* FIXME */
             lpme->szExePath[wine_server_reply_size(reply)] = 0;
         }
diff --git a/dlls/user/message.c b/dlls/user/message.c
index b6c9f9c..76968ff 100644
--- a/dlls/user/message.c
+++ b/dlls/user/message.c
@@ -1229,7 +1229,7 @@
     }
     SERVER_START_REQ( send_message )
     {
-        req->id      = (void *)dest_tid;
+        req->id      = dest_tid;
         req->type    = info->type;
         req->win     = info->hwnd;
         req->msg     = info->msg;
@@ -1606,7 +1606,7 @@
 
     SERVER_START_REQ( send_message )
     {
-        req->id      = (void *)dest_tid;
+        req->id      = dest_tid;
         req->type    = info->type;
         req->win     = info->hwnd;
         req->msg     = info->msg;
diff --git a/include/thread.h b/include/thread.h
index b214065..9ee3a23 100644
--- a/include/thread.h
+++ b/include/thread.h
@@ -58,8 +58,8 @@
     struct _TEB *self;           /* 12-  18 Pointer to this structure */
     WORD         tibflags;       /* 1!n  1c Flags (NT: EnvironmentPointer) */
     WORD         mutex_count;    /* 1-n  1e Win16 mutex count */
-    void        *pid;            /* !2-  20 Process id (win95: debug context) */
-    void        *tid;            /* -2-  24 Thread id */
+    DWORD        pid;            /* !2-  20 Process id (win95: debug context) */
+    DWORD        tid;            /* -2-  24 Thread id */
     HQUEUE16     queue;          /* 1!-  28 Message queue (NT: DWORD ActiveRpcHandle)*/
     WORD         pad1;           /* --n  2a */
     LPVOID      *tls_ptr;        /* 1--  2c Pointer to TLS array */
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 06e6866..8b2a63f 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -35,6 +35,8 @@
 typedef int obj_handle_t;
 typedef unsigned short atom_t;
 typedef unsigned int user_handle_t;
+typedef unsigned int process_id_t;
+typedef unsigned int thread_id_t;
 
 #define FIRST_USER_HANDLE 0x0020
 #define LAST_USER_HANDLE  0xffef
@@ -115,8 +117,8 @@
 
 struct send_fd
 {
-    void  *tid;
-    int    fd;
+    thread_id_t tid;
+    int         fd;
 };
 
 
@@ -207,9 +209,9 @@
 struct get_new_process_info_reply
 {
     struct reply_header __header;
-    void*        pid;
+    process_id_t pid;
     obj_handle_t phandle;
-    void*        tid;
+    thread_id_t  tid;
     obj_handle_t thandle;
     int          success;
 };
@@ -226,7 +228,7 @@
 struct new_thread_reply
 {
     struct reply_header __header;
-    void*        tid;
+    thread_id_t  tid;
     obj_handle_t handle;
 };
 
@@ -307,8 +309,8 @@
 struct init_thread_reply
 {
     struct reply_header __header;
-    void*        pid;
-    void*        tid;
+    process_id_t pid;
+    thread_id_t  tid;
     int          boot;
     int          version;
 };
@@ -352,7 +354,7 @@
 struct get_process_info_reply
 {
     struct reply_header __header;
-    void*        pid;
+    process_id_t pid;
     int          debugged;
     int          exit_code;
     int          priority;
@@ -383,12 +385,12 @@
 {
     struct request_header __header;
     obj_handle_t handle;
-    void*        tid_in;
+    thread_id_t  tid_in;
 };
 struct get_thread_info_reply
 {
     struct reply_header __header;
-    void*        tid;
+    thread_id_t  tid;
     void*        teb;
     int          exit_code;
     int          priority;
@@ -555,7 +557,7 @@
 struct open_process_request
 {
     struct request_header __header;
-    void*        pid;
+    process_id_t pid;
     unsigned int access;
     int          inherit;
 };
@@ -570,7 +572,7 @@
 struct open_thread_request
 {
     struct request_header __header;
-    void*        tid;
+    thread_id_t  tid;
     unsigned int access;
     int          inherit;
 };
@@ -1014,7 +1016,7 @@
     struct request_header __header;
     unsigned int access;
     int          inherit;
-    void*        pid;
+    process_id_t pid;
 };
 struct alloc_console_reply
 {
@@ -1389,7 +1391,7 @@
 {
     struct request_header __header;
     int          signal;
-    void*        group_id;
+    process_id_t group_id;
 };
 struct send_console_signal_reply
 {
@@ -1495,7 +1497,7 @@
     struct request_header __header;
     int          inherit;
     int          flags;
-    void*        pid;
+    process_id_t pid;
 };
 struct create_snapshot_reply
 {
@@ -1515,8 +1517,8 @@
 {
     struct reply_header __header;
     int          count;
-    void*        pid;
-    void*        ppid;
+    process_id_t pid;
+    process_id_t ppid;
     void*        heap;
     void*        module;
     int          threads;
@@ -1536,8 +1538,8 @@
 {
     struct reply_header __header;
     int          count;
-    void*        pid;
-    void*        tid;
+    process_id_t pid;
+    thread_id_t  tid;
     int          base_pri;
     int          delta_pri;
 };
@@ -1553,7 +1555,7 @@
 struct next_module_reply
 {
     struct reply_header __header;
-    void*        pid;
+    process_id_t pid;
     void*        base;
     size_t       size;
     /* VARARG(filename,string); */
@@ -1569,8 +1571,8 @@
 struct wait_debug_event_reply
 {
     struct reply_header __header;
-    void*         pid;
-    void*         tid;
+    process_id_t  pid;
+    thread_id_t   tid;
     obj_handle_t  wait;
     /* VARARG(event,debug_event); */
 };
@@ -1622,8 +1624,8 @@
 struct continue_debug_event_request
 {
     struct request_header __header;
-    void*        pid;
-    void*        tid;
+    process_id_t pid;
+    thread_id_t  tid;
     int          status;
 };
 struct continue_debug_event_reply
@@ -1636,7 +1638,7 @@
 struct debug_process_request
 {
     struct request_header __header;
-    void*        pid;
+    process_id_t pid;
     int          attach;
 };
 struct debug_process_reply
@@ -2118,7 +2120,7 @@
 struct send_message_request
 {
     struct request_header __header;
-    void*           id;
+    thread_id_t     id;
     int             type;
     user_handle_t   win;
     unsigned int    msg;
@@ -2505,8 +2507,8 @@
 {
     struct reply_header __header;
     user_handle_t  full_handle;
-    void*          pid;
-    void*          tid;
+    process_id_t   pid;
+    thread_id_t    tid;
     atom_t         atom;
 };
 
@@ -2559,7 +2561,7 @@
     struct request_header __header;
     user_handle_t  parent;
     atom_t         atom;
-    void*          tid;
+    thread_id_t    tid;
 };
 struct get_window_children_reply
 {
@@ -3211,6 +3213,6 @@
     struct get_window_properties_reply get_window_properties_reply;
 };
 
-#define SERVER_PROTOCOL_VERSION 83
+#define SERVER_PROTOCOL_VERSION 84
 
 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index 18a8d3a..20ae39d 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -442,7 +442,7 @@
  * Initialisation part I. Creation of server object (console input and
  * active screen buffer)
  */
-static struct inner_data* WINECON_Init(HINSTANCE hInst, void* pid, LPCWSTR appname,
+static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appname,
                                        BOOL (*backend)(struct inner_data*))
 {
     struct inner_data*	data = NULL;
@@ -635,7 +635,7 @@
         while (*src && *src != ' ') *dst++ = *src++;
         *dst = 0;
 
-        if (!(data = WINECON_Init(hInst, (void*)GetCurrentProcessId(), buffer, backend))) return 0;
+        if (!(data = WINECON_Init(hInst, GetCurrentProcessId(), buffer, backend))) return 0;
 	ret = WINECON_Spawn(data, wcmdLine);
         if (!ret)
 	{
diff --git a/scheduler/client.c b/scheduler/client.c
index df281db..246d91c 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -71,7 +71,7 @@
 };
 #endif  /* HAVE_MSGHDR_ACCRIGHTS */
 
-static void *boot_thread_id;
+static DWORD boot_thread_id;
 static sigset_t block_set;  /* signals to block during server calls */
 static int fd_socket;  /* socket to exchange file descriptors with the server */
 
@@ -114,7 +114,7 @@
     va_list args;
 
     va_start( args, err );
-    fprintf( stderr, "wine client error:%p: ", NtCurrentTeb()->tid );
+    fprintf( stderr, "wine client error:%lx: ", NtCurrentTeb()->tid );
     vfprintf( stderr, err, args );
     va_end( args );
     SYSDEPS_AbortThread(1);
@@ -126,7 +126,7 @@
  */
 void server_protocol_perror( const char *err )
 {
-    fprintf( stderr, "wine client error:%p: ", NtCurrentTeb()->tid );
+    fprintf( stderr, "wine client error:%lx: ", NtCurrentTeb()->tid );
     perror( err );
     SYSDEPS_AbortThread(1);
 }
@@ -263,7 +263,7 @@
     msghdr.msg_flags      = 0;
 #endif  /* HAVE_MSGHDR_ACCRIGHTS */
 
-    data.tid = (void *)GetCurrentThreadId();
+    data.tid = GetCurrentThreadId();
     data.fd  = fd;
 
     for (;;)
diff --git a/scheduler/process.c b/scheduler/process.c
index d0ed92c..26959c4 100644
--- a/scheduler/process.c
+++ b/scheduler/process.c
@@ -1488,7 +1488,7 @@
     HANDLE ret = 0;
     SERVER_START_REQ( open_process )
     {
-        req->pid     = (void *)id;
+        req->pid     = id;
         req->access  = access;
         req->inherit = inherit;
         if (!wine_server_call_err( req )) ret = reply->handle;
diff --git a/scheduler/syslevel.c b/scheduler/syslevel.c
index 68dcb86..5533c82 100644
--- a/scheduler/syslevel.c
+++ b/scheduler/syslevel.c
@@ -83,7 +83,7 @@
     TEB *teb = NtCurrentTeb();
     int i;
 
-    TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count before %ld\n",
+    TRACE("(%p, level %d): thread %lx (fs %04x, pid %ld) count before %ld\n",
                   lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(),
                   teb->sys_count[lock->level] );
 
@@ -99,7 +99,7 @@
     teb->sys_count[lock->level]++;
     teb->sys_mutex[lock->level] = lock;
 
-    TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count after  %ld\n",
+    TRACE("(%p, level %d): thread %lx (fs %04x, pid %ld) count after  %ld\n",
                   lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(),
                   teb->sys_count[lock->level] );
 
@@ -115,7 +115,7 @@
 {
     TEB *teb = NtCurrentTeb();
 
-    TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count before %ld\n",
+    TRACE("(%p, level %d): thread %lx (fs %04x, pid %ld) count before %ld\n",
                   lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(),
                   teb->sys_count[lock->level] );
 
@@ -133,7 +133,7 @@
 
     LeaveCriticalSection( &lock->crst );
 
-    TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count after  %ld\n",
+    TRACE("(%p, level %d): thread %lx (fs %04x, pid %ld) count after  %ld\n",
                   lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(),
                   teb->sys_count[lock->level] );
 }
diff --git a/scheduler/thread.c b/scheduler/thread.c
index eb5fe60..09b9288 100644
--- a/scheduler/thread.c
+++ b/scheduler/thread.c
@@ -64,7 +64,7 @@
     SERVER_START_REQ( get_thread_info )
     {
         req->handle = 0;
-        req->tid_in = (void *)id;
+        req->tid_in = id;
         if (!wine_server_call( req )) ret = reply->teb;
     }
     SERVER_END_REQ;
@@ -277,7 +277,7 @@
 {
     HANDLE handle = 0;
     TEB *teb;
-    void *tid = 0;
+    DWORD tid = 0;
     int request_pipe[2];
 
     if (pipe( request_pipe ) == -1)
@@ -316,7 +316,7 @@
     teb->startup     = THREAD_Start;
     teb->htask16     = GetCurrentTask();
 
-    if (id) *id = (DWORD)tid;
+    if (id) *id = tid;
     if (SYSDEPS_SpawnThread( teb ) == -1)
     {
         CloseHandle( handle );
@@ -395,7 +395,7 @@
     HANDLE ret = 0;
     SERVER_START_REQ( open_thread )
     {
-        req->tid     = (void *)dwThreadId;
+        req->tid     = dwThreadId;
         req->access  = dwDesiredAccess;
         req->inherit = bInheritHandle;
         if (!wine_server_call_err( req )) ret = reply->handle;
diff --git a/server/console.c b/server/console.c
index 12a7abd..51aa9f9 100644
--- a/server/console.c
+++ b/server/console.c
@@ -388,7 +388,7 @@
 
 struct console_signal_info {
     struct console_input        *console;
-    struct process              *group;
+    process_id_t                 group;
     int                          signal;
 };
 
@@ -397,7 +397,7 @@
     struct console_signal_info* csi = (struct console_signal_info*)user;
 
     if (process->console == csi->console && process->running_threads &&
-        (csi->group == NULL || process->group_id == csi->group))
+        (!csi->group || process->group_id == csi->group))
     {
         struct thread *thread = process->thread_list;
 
@@ -412,7 +412,7 @@
 }
 
 static void propagate_console_signal( struct console_input *console,
-                                      int sig, void* group_id )
+                                      int sig, process_id_t group_id )
 {
     struct console_signal_info csi;
 
@@ -510,7 +510,7 @@
                 if (records[i].Event.KeyEvent.bKeyDown)
                 {
                     /* send SIGINT to all processes attached to this console */
-                    propagate_console_signal( console, CTRL_C_EVENT, NULL );
+                    propagate_console_signal( console, CTRL_C_EVENT, 0 );
                 }
             }
             else i++;
@@ -1461,7 +1461,7 @@
 /* sends a signal to a console (process, group...) */
 DECL_HANDLER(send_console_signal)
 {
-    void*       group;
+    process_id_t group;
 
     group = req->group_id ? req->group_id : current->process->group_id;
 
diff --git a/server/debugger.c b/server/debugger.c
index 409adc3..ba08bd2 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -593,8 +593,8 @@
         size_t size = get_reply_max_size();
         event->state = EVENT_SENT;
         event->sender->debug_event = event;
-        reply->pid = event->sender->process;
-        reply->tid = event->sender;
+        reply->pid = get_process_id( event->sender->process );
+        reply->tid = get_thread_id( event->sender );
         if (size > sizeof(debug_event_t)) size = sizeof(debug_event_t);
         set_reply_data( &event->data, size );
     }
diff --git a/server/process.c b/server/process.c
index 74f879c..9a0ed20 100644
--- a/server/process.c
+++ b/server/process.c
@@ -218,7 +218,7 @@
     process->exe.dbg_size    = 0;
     process->exe.namelen     = 0;
     process->exe.filename    = NULL;
-    process->group_id        = NULL;
+    process->group_id        = 0;
 
     gettimeofday( &process->start_time, NULL );
     if ((process->next = first_process) != NULL) process->next->prev = process;
@@ -292,7 +292,7 @@
     /* set the process console */
     if (!set_process_console( process, parent_thread, info, reply )) return NULL;
 
-    process->group_id = process;
+    process->group_id = get_process_id( process );
     if (parent)
     {
         /* attach to the debugger if requested */
@@ -397,10 +397,10 @@
 }
 
 /* get a process from an id (and increment the refcount) */
-struct process *get_process_from_id( void *id )
+struct process *get_process_from_id( process_id_t id )
 {
     struct process *p = first_process;
-    while (p && (p != id)) p = p->next;
+    while (p && (get_process_id(p) != id)) p = p->next;
     if (p) grab_object( p );
     else set_error( STATUS_INVALID_PARAMETER );
     return p;
diff --git a/server/process.h b/server/process.h
index e89764e..c56af7f 100644
--- a/server/process.h
+++ b/server/process.h
@@ -73,7 +73,7 @@
     struct process_dll   exe;             /* main exe file */
     void                *ldt_copy;        /* pointer to LDT copy in client addr space */
     void                *ldt_flags;       /* pointer to LDT flags in client addr space */
-    void                *group_id;        /* group ID of the process */
+    process_id_t         group_id;        /* group ID of the process */
 };
 
 struct process_snapshot
@@ -95,7 +95,7 @@
 /* process functions */
 
 extern struct thread *create_process( int fd );
-extern struct process *get_process_from_id( void *id );
+extern struct process *get_process_from_id( process_id_t id );
 extern struct process *get_process_from_handle( obj_handle_t handle, unsigned int access );
 extern int process_set_debugger( struct process *process, struct thread *thread );
 extern int debugger_detach( struct process* process, struct thread* debugger );
@@ -115,7 +115,7 @@
 extern struct module_snapshot *module_snap( struct process *process, int *count );
 extern void enum_processes( int (*cb)(struct process*, void*), void *user);
 
-inline static void *get_process_id( struct process *process ) { return process; }
+inline static process_id_t get_process_id( struct process *process ) { return (process_id_t)process; }
 inline static int is_process_init_done( struct process *process )
 {
     return process->startup_state == STARTUP_DONE;
diff --git a/server/protocol.def b/server/protocol.def
index 6e69e93..1aeb6c4 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -51,6 +51,8 @@
 typedef int obj_handle_t;
 typedef unsigned short atom_t;
 typedef unsigned int user_handle_t;
+typedef unsigned int process_id_t;
+typedef unsigned int thread_id_t;
 
 #define FIRST_USER_HANDLE 0x0020  /* first possible value for low word of user handle */
 #define LAST_USER_HANDLE  0xffef  /* last possible value for low word of user handle */
@@ -131,8 +133,8 @@
 /* structure used in sending an fd from client to server */
 struct send_fd
 {
-    void  *tid;  /* thread id */
-    int    fd;   /* file descriptor on client-side */
+    thread_id_t tid;  /* thread id */
+    int         fd;   /* file descriptor on client-side */
 };
 
 /* structure sent by the server on the wait fifo */
@@ -213,9 +215,9 @@
     int          pinherit;     /* process handle inherit flag */
     int          tinherit;     /* thread handle inherit flag */
 @REPLY
-    void*        pid;          /* process id */
+    process_id_t pid;          /* process id */
     obj_handle_t phandle;      /* process handle (in the current process) */
-    void*        tid;          /* thread id */
+    thread_id_t  tid;          /* thread id */
     obj_handle_t thandle;      /* thread handle (in the current process) */
     int          success;      /* did the process start successfully? */
 @END
@@ -227,7 +229,7 @@
     int          inherit;      /* inherit flag */
     int          request_fd;   /* fd for request pipe */
 @REPLY
-    void*        tid;          /* thread id */
+    thread_id_t  tid;          /* thread id */
     obj_handle_t handle;       /* thread handle (in the current process) */
 @END
 
@@ -282,8 +284,8 @@
     int          reply_fd;     /* fd for reply pipe */
     int          wait_fd;      /* fd for blocking calls pipe */
 @REPLY
-    void*        pid;          /* process id of the new thread's process */
-    void*        tid;          /* thread id of the new thread */
+    process_id_t pid;          /* process id of the new thread's process */
+    thread_id_t  tid;          /* thread id of the new thread */
     int          boot;         /* is this the boot thread? */
     int          version;      /* protocol version */
 @END
@@ -312,7 +314,7 @@
 @REQ(get_process_info)
     obj_handle_t handle;           /* process handle */
 @REPLY
-    void*        pid;              /* server process id */
+    process_id_t pid;              /* server process id */
     int          debugged;         /* debugged? */
     int          exit_code;        /* process exit code */
     int          priority;         /* priority class */
@@ -335,9 +337,9 @@
 /* Retrieve information about a thread */
 @REQ(get_thread_info)
     obj_handle_t handle;       /* thread handle */
-    void*        tid_in;       /* thread id (optional) */
+    thread_id_t  tid_in;       /* thread id (optional) */
 @REPLY
-    void*        tid;          /* server thread id */
+    thread_id_t  tid;          /* server thread id */
     void*        teb;          /* thread teb pointer */
     int          exit_code;    /* thread exit code */
     int          priority;     /* thread priority level */
@@ -448,7 +450,7 @@
 
 /* Open a handle to a process */
 @REQ(open_process)
-    void*        pid;          /* process id to open */
+    process_id_t pid;          /* process id to open */
     unsigned int access;       /* wanted access rights */
     int          inherit;      /* inherit flag */
 @REPLY
@@ -458,7 +460,7 @@
 
 /* Open a handle to a thread */
 @REQ(open_thread)
-    void*        tid;          /* thread id to open */
+    thread_id_t  tid;          /* thread id to open */
     unsigned int access;       /* wanted access rights */
     int          inherit;      /* inherit flag */
 @REPLY
@@ -751,7 +753,7 @@
 @REQ(alloc_console)
     unsigned int access;        /* wanted access rights */
     int          inherit;       /* inherit flag */
-    void*        pid;           /* pid of process which shall be attached to the console */
+    process_id_t pid;           /* pid of process which shall be attached to the console */
 @REPLY
     obj_handle_t handle_in;     /* handle to console input */
     obj_handle_t event;         /* handle to renderer events change notification */
@@ -1025,7 +1027,7 @@
 /* Sends a signal to a process group */
 @REQ(send_console_signal)
     int          signal;        /* the signal to send */
-    void*        group_id;      /* the group to send the signal to */
+    process_id_t group_id;      /* the group to send the signal to */
 @END
 
 
@@ -1100,7 +1102,7 @@
 @REQ(create_snapshot)
     int          inherit;       /* inherit flag */
     int          flags;         /* snapshot flags (TH32CS_*) */
-    void*        pid;           /* process id */
+    process_id_t pid;           /* process id */
 @REPLY
     obj_handle_t handle;        /* handle to the snapshot */
 @END
@@ -1112,8 +1114,8 @@
     int          reset;         /* reset snapshot position? */
 @REPLY
     int          count;         /* process usage count */
-    void*        pid;           /* process id */
-    void*        ppid;          /* parent process id */
+    process_id_t pid;           /* process id */
+    process_id_t ppid;          /* parent process id */
     void*        heap;          /* heap base */
     void*        module;        /* main module */
     int          threads;       /* number of threads */
@@ -1128,8 +1130,8 @@
     int          reset;         /* reset snapshot position? */
 @REPLY
     int          count;         /* thread usage count */
-    void*        pid;           /* process id */
-    void*        tid;           /* thread id */
+    process_id_t pid;           /* process id */
+    thread_id_t  tid;           /* thread id */
     int          base_pri;      /* base priority */
     int          delta_pri;     /* delta priority */
 @END
@@ -1140,7 +1142,7 @@
     obj_handle_t handle;        /* handle to the snapshot */
     int          reset;         /* reset snapshot position? */
 @REPLY
-    void*        pid;           /* process id */
+    process_id_t pid;           /* process id */
     void*        base;          /* module base address */
     size_t       size;          /* module size */
     VARARG(filename,string);    /* file name of module */
@@ -1151,8 +1153,8 @@
 @REQ(wait_debug_event)
     int           get_handle;  /* should we alloc a handle for waiting? */
 @REPLY
-    void*         pid;         /* process id */
-    void*         tid;         /* thread id */
+    process_id_t  pid;         /* process id */
+    thread_id_t   tid;         /* thread id */
     obj_handle_t  wait;        /* wait handle if no event ready */
     VARARG(event,debug_event); /* debug event data */
 @END
@@ -1186,15 +1188,15 @@
 
 /* Continue a debug event */
 @REQ(continue_debug_event)
-    void*        pid;          /* process id to continue */
-    void*        tid;          /* thread id to continue */
+    process_id_t pid;          /* process id to continue */
+    thread_id_t  tid;          /* thread id to continue */
     int          status;       /* continuation status */
 @END
 
 
 /* Start/stop debugging an existing process */
 @REQ(debug_process)
-    void*        pid;          /* id of the process to debug */
+    process_id_t pid;          /* id of the process to debug */
     int          attach;       /* 1=attaching / 0=detaching from the process */
 @END
 
@@ -1496,7 +1498,7 @@
 
 /* Send a message to a thread queue */
 @REQ(send_message)
-    void*           id;        /* thread id */
+    thread_id_t     id;        /* thread id */
     int             type;      /* message type (see below) */
     user_handle_t   win;       /* window handle */
     unsigned int    msg;       /* message code */
@@ -1760,8 +1762,8 @@
     user_handle_t  handle;      /* handle to the window */
 @REPLY
     user_handle_t  full_handle; /* full 32-bit handle */
-    void*          pid;         /* process owning the window */
-    void*          tid;         /* thread owning the window */
+    process_id_t   pid;         /* process owning the window */
+    thread_id_t    tid;         /* thread owning the window */
     atom_t         atom;        /* class atom */
 @END
 
@@ -1802,7 +1804,7 @@
 @REQ(get_window_children)
     user_handle_t  parent;        /* parent window */
     atom_t         atom;          /* class atom for the listed children */
-    void*          tid;           /* thread owning the listed children */
+    thread_id_t    tid;           /* thread owning the listed children */
 @REPLY
     int            count;         /* total count of children */
     VARARG(children,user_handles); /* children handles */
diff --git a/server/snapshot.c b/server/snapshot.c
index c9a1225..562f901 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -73,7 +73,7 @@
 
 
 /* create a new snapshot */
-static struct snapshot *create_snapshot( void *pid, int flags )
+static struct snapshot *create_snapshot( process_id_t pid, int flags )
 {
     struct process *process = NULL;
     struct snapshot *snapshot;
diff --git a/server/thread.c b/server/thread.c
index b5a95be..0338b8b 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -244,10 +244,10 @@
 }
 
 /* get a thread pointer from a thread id (and increment the refcount) */
-struct thread *get_thread_from_id( void *id )
+struct thread *get_thread_from_id( thread_id_t id )
 {
     struct thread *t = first_thread;
-    while (t && (t != id)) t = t->next;
+    while (t && (get_thread_id(t) != id)) t = t->next;
     if (t) grab_object( t );
     else set_error( STATUS_INVALID_PARAMETER );
     return t;
@@ -778,7 +778,7 @@
     if ((thread = create_thread( request_fd, current->process )))
     {
         if (req->suspend) thread->suspend++;
-        reply->tid = thread;
+        reply->tid = get_thread_id( thread );
         if ((reply->handle = alloc_handle( current->process, thread,
                                            THREAD_ALL_ACCESS, req->inherit )))
         {
diff --git a/server/thread.h b/server/thread.h
index e502c23..fed326b 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -104,7 +104,7 @@
 /* thread functions */
 
 extern struct thread *create_thread( int fd, struct process *process );
-extern struct thread *get_thread_from_id( void *id );
+extern struct thread *get_thread_from_id( thread_id_t id );
 extern struct thread *get_thread_from_handle( obj_handle_t handle, unsigned int access );
 extern struct thread *get_thread_from_pid( int pid );
 extern int suspend_thread( struct thread *thread, int check_limit );
@@ -139,6 +139,6 @@
 static inline void set_error( unsigned int err ) { global_error = err; if (current) current->error = err; }
 static inline void clear_error(void)    { set_error(0); }
 
-static inline void *get_thread_id( struct thread *thread ) { return thread; }
+static inline thread_id_t get_thread_id( struct thread *thread ) { return (thread_id_t)thread; }
 
 #endif  /* __WINE_SERVER_THREAD_H */
diff --git a/server/trace.c b/server/trace.c
index 70d7b9d..18cda73 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -372,9 +372,9 @@
 
 static void dump_get_new_process_info_reply( const struct get_new_process_info_reply *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
+    fprintf( stderr, " pid=%08x,", req->pid );
     fprintf( stderr, " phandle=%d,", req->phandle );
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " thandle=%d,", req->thandle );
     fprintf( stderr, " success=%d", req->success );
 }
@@ -388,7 +388,7 @@
 
 static void dump_new_thread_reply( const struct new_thread_reply *req )
 {
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " handle=%d", req->handle );
 }
 
@@ -452,8 +452,8 @@
 
 static void dump_init_thread_reply( const struct init_thread_reply *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " pid=%08x,", req->pid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " boot=%d,", req->boot );
     fprintf( stderr, " version=%d", req->version );
 }
@@ -488,7 +488,7 @@
 
 static void dump_get_process_info_reply( const struct get_process_info_reply *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
+    fprintf( stderr, " pid=%08x,", req->pid );
     fprintf( stderr, " debugged=%d,", req->debugged );
     fprintf( stderr, " exit_code=%d,", req->exit_code );
     fprintf( stderr, " priority=%d,", req->priority );
@@ -507,12 +507,12 @@
 static void dump_get_thread_info_request( const struct get_thread_info_request *req )
 {
     fprintf( stderr, " handle=%d,", req->handle );
-    fprintf( stderr, " tid_in=%p", req->tid_in );
+    fprintf( stderr, " tid_in=%08x", req->tid_in );
 }
 
 static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
 {
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " teb=%p,", req->teb );
     fprintf( stderr, " exit_code=%d,", req->exit_code );
     fprintf( stderr, " priority=%d", req->priority );
@@ -626,7 +626,7 @@
 
 static void dump_open_process_request( const struct open_process_request *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
+    fprintf( stderr, " pid=%08x,", req->pid );
     fprintf( stderr, " access=%08x,", req->access );
     fprintf( stderr, " inherit=%d", req->inherit );
 }
@@ -638,7 +638,7 @@
 
 static void dump_open_thread_request( const struct open_thread_request *req )
 {
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " access=%08x,", req->access );
     fprintf( stderr, " inherit=%d", req->inherit );
 }
@@ -951,7 +951,7 @@
 {
     fprintf( stderr, " access=%08x,", req->access );
     fprintf( stderr, " inherit=%d,", req->inherit );
-    fprintf( stderr, " pid=%p", req->pid );
+    fprintf( stderr, " pid=%08x", req->pid );
 }
 
 static void dump_alloc_console_reply( const struct alloc_console_reply *req )
@@ -1194,7 +1194,7 @@
 static void dump_send_console_signal_request( const struct send_console_signal_request *req )
 {
     fprintf( stderr, " signal=%d,", req->signal );
-    fprintf( stderr, " group_id=%p", req->group_id );
+    fprintf( stderr, " group_id=%08x", req->group_id );
 }
 
 static void dump_create_change_notification_request( const struct create_change_notification_request *req )
@@ -1271,7 +1271,7 @@
 {
     fprintf( stderr, " inherit=%d,", req->inherit );
     fprintf( stderr, " flags=%d,", req->flags );
-    fprintf( stderr, " pid=%p", req->pid );
+    fprintf( stderr, " pid=%08x", req->pid );
 }
 
 static void dump_create_snapshot_reply( const struct create_snapshot_reply *req )
@@ -1288,8 +1288,8 @@
 static void dump_next_process_reply( const struct next_process_reply *req )
 {
     fprintf( stderr, " count=%d,", req->count );
-    fprintf( stderr, " pid=%p,", req->pid );
-    fprintf( stderr, " ppid=%p,", req->ppid );
+    fprintf( stderr, " pid=%08x,", req->pid );
+    fprintf( stderr, " ppid=%08x,", req->ppid );
     fprintf( stderr, " heap=%p,", req->heap );
     fprintf( stderr, " module=%p,", req->module );
     fprintf( stderr, " threads=%d,", req->threads );
@@ -1307,8 +1307,8 @@
 static void dump_next_thread_reply( const struct next_thread_reply *req )
 {
     fprintf( stderr, " count=%d,", req->count );
-    fprintf( stderr, " pid=%p,", req->pid );
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " pid=%08x,", req->pid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " base_pri=%d,", req->base_pri );
     fprintf( stderr, " delta_pri=%d", req->delta_pri );
 }
@@ -1321,7 +1321,7 @@
 
 static void dump_next_module_reply( const struct next_module_reply *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
+    fprintf( stderr, " pid=%08x,", req->pid );
     fprintf( stderr, " base=%p,", req->base );
     fprintf( stderr, " size=%d,", req->size );
     fprintf( stderr, " filename=" );
@@ -1335,8 +1335,8 @@
 
 static void dump_wait_debug_event_reply( const struct wait_debug_event_reply *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " pid=%08x,", req->pid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " wait=%d,", req->wait );
     fprintf( stderr, " event=" );
     dump_varargs_debug_event( cur_size );
@@ -1375,14 +1375,14 @@
 
 static void dump_continue_debug_event_request( const struct continue_debug_event_request *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " pid=%08x,", req->pid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " status=%d", req->status );
 }
 
 static void dump_debug_process_request( const struct debug_process_request *req )
 {
-    fprintf( stderr, " pid=%p,", req->pid );
+    fprintf( stderr, " pid=%08x,", req->pid );
     fprintf( stderr, " attach=%d", req->attach );
 }
 
@@ -1735,7 +1735,7 @@
 
 static void dump_send_message_request( const struct send_message_request *req )
 {
-    fprintf( stderr, " id=%p,", req->id );
+    fprintf( stderr, " id=%08x,", req->id );
     fprintf( stderr, " type=%d,", req->type );
     fprintf( stderr, " win=%08x,", req->win );
     fprintf( stderr, " msg=%08x,", req->msg );
@@ -2005,8 +2005,8 @@
 static void dump_get_window_info_reply( const struct get_window_info_reply *req )
 {
     fprintf( stderr, " full_handle=%08x,", req->full_handle );
-    fprintf( stderr, " pid=%p,", req->pid );
-    fprintf( stderr, " tid=%p,", req->tid );
+    fprintf( stderr, " pid=%08x,", req->pid );
+    fprintf( stderr, " tid=%08x,", req->tid );
     fprintf( stderr, " atom=%04x", req->atom );
 }
 
@@ -2046,7 +2046,7 @@
 {
     fprintf( stderr, " parent=%08x,", req->parent );
     fprintf( stderr, " atom=%04x,", req->atom );
-    fprintf( stderr, " tid=%p", req->tid );
+    fprintf( stderr, " tid=%08x", req->tid );
 }
 
 static void dump_get_window_children_reply( const struct get_window_children_reply *req )
diff --git a/tools/make_requests b/tools/make_requests
index 54612d5..9cad33f 100755
--- a/tools/make_requests
+++ b/tools/make_requests
@@ -34,6 +34,8 @@
     "obj_handle_t"  => "%d",
     "atom_t"        => "%04x",
     "user_handle_t" => "%08x",
+    "process_id_t"  => "%08x",
+    "thread_id_t"   => "%08x",
     "rectangle_t"   => "&dump_rectangle",
     "char_info_t"   => "&dump_char_info",
 );
diff --git a/windows/input.c b/windows/input.c
index c4273b4..8857879 100644
--- a/windows/input.c
+++ b/windows/input.c
@@ -112,7 +112,7 @@
 {
     SERVER_START_REQ( send_message )
     {
-        req->id     = (void *)GetCurrentThreadId();
+        req->id     = GetCurrentThreadId();
         req->type   = MSG_HARDWARE_RAW;
         req->win    = 0;
         req->msg    = message;
diff --git a/windows/message.c b/windows/message.c
index c1431dd..5951bff 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -116,7 +116,7 @@
     SERVER_START_REQ( send_message )
     {
         req->type   = type;
-        req->id     = (void *)GetWindowThreadProcessId( msg->hwnd, NULL );
+        req->id     = GetWindowThreadProcessId( msg->hwnd, NULL );
         req->win    = msg->hwnd;
         req->msg    = msg->message;
         req->wparam = msg->wParam;
diff --git a/windows/win.c b/windows/win.c
index 453c968..5a69a8c 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -181,7 +181,7 @@
         {
             req->parent = hwnd;
             req->atom = atom;
-            req->tid = (void *)tid;
+            req->tid = tid;
             wine_server_set_reply( req, list, (size-1) * sizeof(HWND) );
             if (!wine_server_call( req )) count = reply->count;
         }