Added stubs for AccessCheckByType, AddAuditAccessAce,
[wine] / dlls / ntdll / server.c
1 /*
2  * Wine server communication
3  *
4  * Copyright (C) 1998 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22 #include "wine/port.h"
23
24 #include <assert.h>
25 #include <ctype.h>
26 #include <errno.h>
27 #include <fcntl.h>
28 #include <signal.h>
29 #include <stdio.h>
30 #include <string.h>
31 #include <sys/types.h>
32 #ifdef HAVE_SYS_SOCKET_H
33 # include <sys/socket.h>
34 #endif
35 #ifdef HAVE_SYS_WAIT_H
36 #include <sys/wait.h>
37 #endif
38 #ifdef HAVE_SYS_UN_H
39 #include <sys/un.h>
40 #endif
41 #ifdef HAVE_SYS_MMAN_H
42 #include <sys/mman.h>
43 #endif
44 #include <sys/stat.h>
45 #ifdef HAVE_SYS_UIO_H
46 #include <sys/uio.h>
47 #endif
48 #ifdef HAVE_UNISTD_H
49 # include <unistd.h>
50 #endif
51 #include <stdarg.h>
52
53 #include "ntstatus.h"
54 #include "thread.h"
55 #include "wine/library.h"
56 #include "wine/pthread.h"
57 #include "wine/server.h"
58 #include "winerror.h"
59 #include "ntdll_misc.h"
60
61 /* Some versions of glibc don't define this */
62 #ifndef SCM_RIGHTS
63 #define SCM_RIGHTS 1
64 #endif
65
66 #define SOCKETNAME "socket"        /* name of the socket file */
67 #define LOCKNAME   "lock"          /* name of the lock file */
68
69 #ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
70 /* data structure used to pass an fd with sendmsg/recvmsg */
71 struct cmsg_fd
72 {
73     int len;   /* size of structure */
74     int level; /* SOL_SOCKET */
75     int type;  /* SCM_RIGHTS */
76     int fd;    /* fd to pass */
77 };
78 #endif  /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
79
80 static sigset_t block_set;  /* signals to block during server calls */
81 static int fd_socket = -1;  /* socket to exchange file descriptors with the server */
82
83 #ifdef __GNUC__
84 static void fatal_error( const char *err, ... ) __attribute__((noreturn, format(printf,1,2)));
85 static void fatal_perror( const char *err, ... ) __attribute__((noreturn, format(printf,1,2)));
86 static void server_connect_error( const char *serverdir ) __attribute__((noreturn));
87 #endif
88
89 /* die on a fatal error; use only during initialization */
90 static void fatal_error( const char *err, ... )
91 {
92     va_list args;
93
94     va_start( args, err );
95     fprintf( stderr, "wine: " );
96     vfprintf( stderr, err, args );
97     va_end( args );
98     exit(1);
99 }
100
101 /* die on a fatal error; use only during initialization */
102 static void fatal_perror( const char *err, ... )
103 {
104     va_list args;
105
106     va_start( args, err );
107     fprintf( stderr, "wine: " );
108     vfprintf( stderr, err, args );
109     perror( " " );
110     va_end( args );
111     exit(1);
112 }
113
114
115 /***********************************************************************
116  *           server_abort_thread
117  */
118 void server_abort_thread( int status )
119 {
120     sigprocmask( SIG_BLOCK, &block_set, NULL );
121     close( NtCurrentTeb()->wait_fd[0] );
122     close( NtCurrentTeb()->wait_fd[1] );
123     close( NtCurrentTeb()->reply_fd );
124     close( NtCurrentTeb()->request_fd );
125     wine_pthread_abort_thread( status );
126 }
127
128
129 /***********************************************************************
130  *           server_protocol_error
131  */
132 void server_protocol_error( const char *err, ... )
133 {
134     va_list args;
135
136     va_start( args, err );
137     fprintf( stderr, "wine client error:%lx: ", GetCurrentThreadId() );
138     vfprintf( stderr, err, args );
139     va_end( args );
140     server_abort_thread(1);
141 }
142
143
144 /***********************************************************************
145  *           server_protocol_perror
146  */
147 void server_protocol_perror( const char *err )
148 {
149     fprintf( stderr, "wine client error:%lx: ", GetCurrentThreadId() );
150     perror( err );
151     server_abort_thread(1);
152 }
153
154
155 /***********************************************************************
156  *           send_request
157  *
158  * Send a request to the server.
159  */
160 static void send_request( const struct __server_request_info *req )
161 {
162     int i, ret;
163
164     if (!req->u.req.request_header.request_size)
165     {
166         if ((ret = write( NtCurrentTeb()->request_fd, &req->u.req,
167                           sizeof(req->u.req) )) == sizeof(req->u.req)) return;
168
169     }
170     else
171     {
172         struct iovec vec[__SERVER_MAX_DATA+1];
173
174         vec[0].iov_base = (void *)&req->u.req;
175         vec[0].iov_len = sizeof(req->u.req);
176         for (i = 0; i < req->data_count; i++)
177         {
178             vec[i+1].iov_base = (void *)req->data[i].ptr;
179             vec[i+1].iov_len = req->data[i].size;
180         }
181         if ((ret = writev( NtCurrentTeb()->request_fd, vec, i+1 )) ==
182             req->u.req.request_header.request_size + sizeof(req->u.req)) return;
183     }
184
185     if (ret >= 0) server_protocol_error( "partial write %d\n", ret );
186     if (errno == EPIPE) server_abort_thread(0);
187     server_protocol_perror( "sendmsg" );
188 }
189
190
191 /***********************************************************************
192  *           read_reply_data
193  *
194  * Read data from the reply buffer; helper for wait_reply.
195  */
196 static void read_reply_data( void *buffer, size_t size )
197 {
198     int ret;
199
200     for (;;)
201     {
202         if ((ret = read( NtCurrentTeb()->reply_fd, buffer, size )) > 0)
203         {
204             if (!(size -= ret)) return;
205             buffer = (char *)buffer + ret;
206             continue;
207         }
208         if (!ret) break;
209         if (errno == EINTR) continue;
210         if (errno == EPIPE) break;
211         server_protocol_perror("read");
212     }
213     /* the server closed the connection; time to die... */
214     server_abort_thread(0);
215 }
216
217
218 /***********************************************************************
219  *           wait_reply
220  *
221  * Wait for a reply from the server.
222  */
223 inline static void wait_reply( struct __server_request_info *req )
224 {
225     read_reply_data( &req->u.reply, sizeof(req->u.reply) );
226     if (req->u.reply.reply_header.reply_size)
227         read_reply_data( req->reply_data, req->u.reply.reply_header.reply_size );
228 }
229
230
231 /***********************************************************************
232  *           wine_server_call (NTDLL.@)
233  *
234  * Perform a server call.
235  */
236 unsigned int wine_server_call( void *req_ptr )
237 {
238     struct __server_request_info * const req = req_ptr;
239     sigset_t old_set;
240
241     sigprocmask( SIG_BLOCK, &block_set, &old_set );
242     send_request( req );
243     wait_reply( req );
244     sigprocmask( SIG_SETMASK, &old_set, NULL );
245     return req->u.reply.reply_header.error;
246 }
247
248
249 /***********************************************************************
250  *           wine_server_send_fd
251  *
252  * Send a file descriptor to the server.
253  */
254 void wine_server_send_fd( int fd )
255 {
256 #ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
257     struct cmsg_fd cmsg;
258 #endif
259     struct send_fd data;
260     struct msghdr msghdr;
261     struct iovec vec;
262     int ret;
263
264     vec.iov_base = (void *)&data;
265     vec.iov_len  = sizeof(data);
266
267     msghdr.msg_name    = NULL;
268     msghdr.msg_namelen = 0;
269     msghdr.msg_iov     = &vec;
270     msghdr.msg_iovlen  = 1;
271
272 #ifdef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
273     msghdr.msg_accrights    = (void *)&fd;
274     msghdr.msg_accrightslen = sizeof(fd);
275 #else  /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
276     cmsg.len   = sizeof(cmsg);
277     cmsg.level = SOL_SOCKET;
278     cmsg.type  = SCM_RIGHTS;
279     cmsg.fd    = fd;
280     msghdr.msg_control    = &cmsg;
281     msghdr.msg_controllen = sizeof(cmsg);
282     msghdr.msg_flags      = 0;
283 #endif  /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
284
285     data.tid = GetCurrentThreadId();
286     data.fd  = fd;
287
288     for (;;)
289     {
290         if ((ret = sendmsg( fd_socket, &msghdr, 0 )) == sizeof(data)) return;
291         if (ret >= 0) server_protocol_error( "partial write %d\n", ret );
292         if (errno == EINTR) continue;
293         if (errno == EPIPE) server_abort_thread(0);
294         server_protocol_perror( "sendmsg" );
295     }
296 }
297
298
299 /***********************************************************************
300  *           receive_fd
301  *
302  * Receive a file descriptor passed from the server.
303  */
304 static int receive_fd( obj_handle_t *handle )
305 {
306     struct iovec vec;
307     int ret, fd;
308
309 #ifdef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
310     struct msghdr msghdr;
311
312     fd = -1;
313     msghdr.msg_accrights    = (void *)&fd;
314     msghdr.msg_accrightslen = sizeof(fd);
315 #else  /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
316     struct msghdr msghdr;
317     struct cmsg_fd cmsg;
318
319     cmsg.len   = sizeof(cmsg);
320     cmsg.level = SOL_SOCKET;
321     cmsg.type  = SCM_RIGHTS;
322     cmsg.fd    = -1;
323     msghdr.msg_control    = &cmsg;
324     msghdr.msg_controllen = sizeof(cmsg);
325     msghdr.msg_flags      = 0;
326 #endif  /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
327
328     msghdr.msg_name    = NULL;
329     msghdr.msg_namelen = 0;
330     msghdr.msg_iov     = &vec;
331     msghdr.msg_iovlen  = 1;
332     vec.iov_base = (void *)handle;
333     vec.iov_len  = sizeof(*handle);
334
335     for (;;)
336     {
337         if ((ret = recvmsg( fd_socket, &msghdr, 0 )) > 0)
338         {
339 #ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
340             fd = cmsg.fd;
341 #endif
342             if (fd == -1) server_protocol_error( "no fd received for handle %d\n", *handle );
343             fcntl( fd, F_SETFD, 1 ); /* set close on exec flag */
344             return fd;
345         }
346         if (!ret) break;
347         if (errno == EINTR) continue;
348         if (errno == EPIPE) break;
349         server_protocol_perror("recvmsg");
350     }
351     /* the server closed the connection; time to die... */
352     server_abort_thread(0);
353 }
354
355
356 /***********************************************************************
357  *           store_cached_fd
358  *
359  * Store the cached fd value for a given handle back into the server.
360  * Returns the new fd, which can be different if there was already an
361  * fd in the cache for that handle.
362  */
363 inline static int store_cached_fd( int fd, obj_handle_t handle )
364 {
365     SERVER_START_REQ( set_handle_info )
366     {
367         req->handle = handle;
368         req->flags  = 0;
369         req->mask   = 0;
370         req->fd     = fd;
371         if (!wine_server_call( req ))
372         {
373             if (reply->cur_fd != fd)
374             {
375                 /* someone was here before us */
376                 close( fd );
377                 fd = reply->cur_fd;
378             }
379         }
380         else
381         {
382             close( fd );
383             fd = -1;
384         }
385     }
386     SERVER_END_REQ;
387     return fd;
388 }
389
390
391 /***********************************************************************
392  *           wine_server_fd_to_handle   (NTDLL.@)
393  *
394  * Allocate a file handle for a Unix fd.
395  */
396 int wine_server_fd_to_handle( int fd, unsigned int access, int inherit, obj_handle_t *handle )
397 {
398     int ret;
399
400     *handle = 0;
401     wine_server_send_fd( fd );
402
403     SERVER_START_REQ( alloc_file_handle )
404     {
405         req->access  = access;
406         req->inherit = inherit;
407         req->fd      = fd;
408         if (!(ret = wine_server_call( req ))) *handle = reply->handle;
409     }
410     SERVER_END_REQ;
411     return ret;
412 }
413
414
415 /***********************************************************************
416  *           wine_server_handle_to_fd   (NTDLL.@)
417  *
418  * Retrieve the Unix fd corresponding to a file handle.
419  */
420 int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *unix_fd,
421                               enum fd_type *type, int *flags )
422 {
423     obj_handle_t fd_handle;
424     int ret, fd = -1;
425
426     *unix_fd = -1;
427     for (;;)
428     {
429         SERVER_START_REQ( get_handle_fd )
430         {
431             req->handle = handle;
432             req->access = access;
433             if (!(ret = wine_server_call( req ))) fd = reply->fd;
434             if (type) *type = reply->type;
435             if (flags) *flags = reply->flags;
436         }
437         SERVER_END_REQ;
438         if (ret) return ret;
439
440         if (fd != -1) break;
441
442         /* it wasn't in the cache, get it from the server */
443         fd = receive_fd( &fd_handle );
444         /* and store it back into the cache */
445         fd = store_cached_fd( fd, fd_handle );
446
447         if (fd_handle == handle) break;
448         /* if we received a different handle this means there was
449          * a race with another thread; we restart everything from
450          * scratch in this case.
451          */
452     }
453
454     if ((fd != -1) && ((fd = dup(fd)) == -1)) return STATUS_TOO_MANY_OPENED_FILES;
455     *unix_fd = fd;
456     return STATUS_SUCCESS;
457 }
458
459
460 /***********************************************************************
461  *           start_server
462  *
463  * Start a new wine server.
464  */
465 static void start_server( const char *oldcwd )
466 {
467     static int started;  /* we only try once */
468     char *path, *p;
469     const char *argv0_path;
470     if (!started)
471     {
472         int status;
473         int pid = fork();
474         if (pid == -1) fatal_perror( "fork" );
475         if (!pid)
476         {
477             /* if server is explicitly specified, use this */
478             if ((p = getenv("WINESERVER")))
479             {
480                 if (p[0] != '/' && oldcwd[0] == '/')  /* make it an absolute path */
481                 {
482                     if (!(path = malloc( strlen(oldcwd) + strlen(p) + 1 )))
483                         fatal_error( "out of memory\n" );
484                     sprintf( path, "%s/%s", oldcwd, p );
485                     p = path;
486                 }
487                 execl( p, p, NULL );
488                 fatal_perror( "could not exec the server '%s'\n"
489                               "    specified in the WINESERVER environment variable", p );
490             }
491
492             /* first try the installation dir */
493             execl( BINDIR "/wineserver", "wineserver", NULL );
494
495             /* now try the dir we were launched from */
496             if ((argv0_path = wine_get_argv0_path()))
497             {
498                 if (!(path = malloc( strlen(argv0_path) + sizeof("wineserver") )))
499                     fatal_error( "out of memory\n" );
500                 strcpy( path, argv0_path );
501                 strcat( path, "wineserver" );
502                 execl( path, path, NULL );
503                 free(path);
504             }
505
506             /* finally try the path */
507             execlp( "wineserver", "wineserver", NULL );
508             fatal_error( "could not exec wineserver\n" );
509         }
510         waitpid( pid, &status, 0 );
511         status = WIFEXITED(status) ? WEXITSTATUS(status) : 1;
512         if (status == 2) return;  /* server lock held by someone else, will retry later */
513         if (status) exit(status);  /* server failed */
514         started = 1;
515     }
516 }
517
518
519 /***********************************************************************
520  *           server_connect_error
521  *
522  * Try to display a meaningful explanation of why we couldn't connect
523  * to the server.
524  */
525 static void server_connect_error( const char *serverdir )
526 {
527     int fd;
528     struct flock fl;
529
530     if ((fd = open( LOCKNAME, O_WRONLY )) == -1)
531         fatal_error( "for some mysterious reason, the wine server never started.\n" );
532
533     fl.l_type   = F_WRLCK;
534     fl.l_whence = SEEK_SET;
535     fl.l_start  = 0;
536     fl.l_len    = 1;
537     if (fcntl( fd, F_GETLK, &fl ) != -1)
538     {
539         if (fl.l_type == F_WRLCK)  /* the file is locked */
540             fatal_error( "a wine server seems to be running, but I cannot connect to it.\n"
541                          "   You probably need to kill that process (it might be pid %d).\n",
542                          (int)fl.l_pid );
543         fatal_error( "for some mysterious reason, the wine server failed to run.\n" );
544     }
545     fatal_error( "the file system of '%s' doesn't support locks,\n"
546           "   and there is a 'socket' file in that directory that prevents wine from starting.\n"
547           "   You should make sure no wine server is running, remove that file and try again.\n",
548                  serverdir );
549 }
550
551
552 /***********************************************************************
553  *           server_connect
554  *
555  * Attempt to connect to an existing server socket.
556  * We need to be in the server directory already.
557  */
558 static int server_connect( const char *oldcwd, const char *serverdir )
559 {
560     struct sockaddr_un addr;
561     struct stat st;
562     int s, slen, retry;
563
564     /* chdir to the server directory */
565     if (chdir( serverdir ) == -1)
566     {
567         if (errno != ENOENT) fatal_perror( "chdir to %s", serverdir );
568         start_server( "." );
569         if (chdir( serverdir ) == -1) fatal_perror( "chdir to %s", serverdir );
570     }
571
572     /* make sure we are at the right place */
573     if (stat( ".", &st ) == -1) fatal_perror( "stat %s", serverdir );
574     if (st.st_uid != getuid()) fatal_error( "'%s' is not owned by you\n", serverdir );
575     if (st.st_mode & 077) fatal_error( "'%s' must not be accessible by other users\n", serverdir );
576
577     for (retry = 0; retry < 6; retry++)
578     {
579         /* if not the first try, wait a bit to leave the previous server time to exit */
580         if (retry)
581         {
582             usleep( 100000 * retry * retry );
583             start_server( oldcwd );
584             if (lstat( SOCKETNAME, &st ) == -1) continue;  /* still no socket, wait a bit more */
585         }
586         else if (lstat( SOCKETNAME, &st ) == -1) /* check for an already existing socket */
587         {
588             if (errno != ENOENT) fatal_perror( "lstat %s/%s", serverdir, SOCKETNAME );
589             start_server( oldcwd );
590             if (lstat( SOCKETNAME, &st ) == -1) continue;  /* still no socket, wait a bit more */
591         }
592
593         /* make sure the socket is sane (ISFIFO needed for Solaris) */
594         if (!S_ISSOCK(st.st_mode) && !S_ISFIFO(st.st_mode))
595             fatal_error( "'%s/%s' is not a socket\n", serverdir, SOCKETNAME );
596         if (st.st_uid != getuid())
597             fatal_error( "'%s/%s' is not owned by you\n", serverdir, SOCKETNAME );
598
599         /* try to connect to it */
600         addr.sun_family = AF_UNIX;
601         strcpy( addr.sun_path, SOCKETNAME );
602         slen = sizeof(addr) - sizeof(addr.sun_path) + strlen(addr.sun_path) + 1;
603 #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
604         addr.sun_len = slen;
605 #endif
606         if ((s = socket( AF_UNIX, SOCK_STREAM, 0 )) == -1) fatal_perror( "socket" );
607         if (connect( s, (struct sockaddr *)&addr, slen ) != -1)
608         {
609             fcntl( s, F_SETFD, 1 ); /* set close on exec flag */
610             return s;
611         }
612         close( s );
613     }
614     server_connect_error( serverdir );
615 }
616
617
618 /***********************************************************************
619  *           server_init_process
620  *
621  * Start the server and create the initial socket pair.
622  */
623 void server_init_process(void)
624 {
625     int size;
626     char *oldcwd;
627     obj_handle_t dummy_handle;
628
629     /* retrieve the current directory */
630     for (size = 512; ; size *= 2)
631     {
632         if (!(oldcwd = malloc( size ))) break;
633         if (getcwd( oldcwd, size )) break;
634         free( oldcwd );
635         if (errno == ERANGE) continue;
636         oldcwd = NULL;
637         break;
638     }
639
640     /* connect to the server */
641     fd_socket = server_connect( oldcwd, wine_get_server_dir() );
642
643     /* switch back to the starting directory */
644     if (oldcwd)
645     {
646         chdir( oldcwd );
647         free( oldcwd );
648     }
649
650     /* setup the signal mask */
651     sigemptyset( &block_set );
652     sigaddset( &block_set, SIGALRM );
653     sigaddset( &block_set, SIGIO );
654     sigaddset( &block_set, SIGINT );
655     sigaddset( &block_set, SIGHUP );
656     sigaddset( &block_set, SIGUSR1 );
657     sigaddset( &block_set, SIGUSR2 );
658
659     /* receive the first thread request fd on the main socket */
660     NtCurrentTeb()->request_fd = receive_fd( &dummy_handle );
661 }
662
663
664 /***********************************************************************
665  *           server_init_thread
666  *
667  * Send an init thread request. Return 0 if OK.
668  */
669 void server_init_thread( int unix_pid, int unix_tid )
670 {
671     TEB *teb = NtCurrentTeb();
672     int version, ret;
673     int reply_pipe[2];
674     struct sigaction sig_act;
675
676     sig_act.sa_handler = SIG_IGN;
677     sig_act.sa_flags   = 0;
678     sigemptyset( &sig_act.sa_mask );
679
680     /* ignore SIGPIPE so that we get a EPIPE error instead  */
681     sigaction( SIGPIPE, &sig_act, NULL );
682     /* automatic child reaping to avoid zombies */
683 #ifdef SA_NOCLDWAIT
684     sig_act.sa_flags |= SA_NOCLDWAIT;
685 #endif
686     sigaction( SIGCHLD, &sig_act, NULL );
687
688     /* create the server->client communication pipes */
689     if (pipe( reply_pipe ) == -1) server_protocol_perror( "pipe" );
690     if (pipe( teb->wait_fd ) == -1) server_protocol_perror( "pipe" );
691     wine_server_send_fd( reply_pipe[1] );
692     wine_server_send_fd( teb->wait_fd[1] );
693     teb->reply_fd = reply_pipe[0];
694     close( reply_pipe[1] );
695
696     /* set close on exec flag */
697     fcntl( teb->reply_fd, F_SETFD, 1 );
698     fcntl( teb->wait_fd[0], F_SETFD, 1 );
699     fcntl( teb->wait_fd[1], F_SETFD, 1 );
700
701     SERVER_START_REQ( init_thread )
702     {
703         req->unix_pid    = unix_pid;
704         req->unix_tid    = unix_tid;
705         req->teb         = teb;
706         req->entry       = teb->entry_point;
707         req->reply_fd    = reply_pipe[1];
708         req->wait_fd     = teb->wait_fd[1];
709         ret = wine_server_call( req );
710         teb->ClientId.UniqueProcess = (HANDLE)reply->pid;
711         teb->ClientId.UniqueThread  = (HANDLE)reply->tid;
712         version  = reply->version;
713     }
714     SERVER_END_REQ;
715
716     if (ret) server_protocol_error( "init_thread failed with status %x\n", ret );
717     if (version != SERVER_PROTOCOL_VERSION)
718         server_protocol_error( "version mismatch %d/%d.\n"
719                                "Your %s binary was not upgraded correctly,\n"
720                                "or you have an older one somewhere in your PATH.\n"
721                                "Or maybe the wrong wineserver is still running?\n",
722                                version, SERVER_PROTOCOL_VERSION,
723                                (version > SERVER_PROTOCOL_VERSION) ? "wine" : "wineserver" );
724 }