server: Add a specific data type for ioctl codes so they can be printed as symbols.
diff --git a/server/fd.c b/server/fd.c
index 7f6c31c..d24eedc 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1855,7 +1855,7 @@
 }
 
 /* default ioctl() routine */
-void default_fd_ioctl( struct fd *fd, unsigned int code, const async_data_t *async,
+void default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
                        const void *data, data_size_t size )
 {
     switch(code)
diff --git a/server/file.h b/server/file.h
index 7109e75..262a011 100644
--- a/server/file.h
+++ b/server/file.h
@@ -40,7 +40,7 @@
     /* get file information */
     enum server_fd_type (*get_fd_type)(struct fd *fd);
     /* perform an ioctl on the file */
-    void (*ioctl)(struct fd *fd, unsigned int code, const async_data_t *async,
+    void (*ioctl)(struct fd *fd, ioctl_code_t code, const async_data_t *async,
                   const void *data, data_size_t size);
     /* queue an async operation */
     void (*queue_async)(struct fd *, const async_data_t *data, int type, int count);
@@ -77,7 +77,7 @@
 extern struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
 extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status );
 extern void fd_reselect_async( struct fd *fd, struct async_queue *queue );
-extern void default_fd_ioctl( struct fd *fd, unsigned int code, const async_data_t *async,
+extern void default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
                               const void *data, data_size_t size );
 extern void default_fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
 extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue );
diff --git a/server/named_pipe.c b/server/named_pipe.c
index aebbdd3..a6871b7 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -139,7 +139,7 @@
 static void pipe_server_destroy( struct object *obj);
 static void pipe_server_flush( struct fd *fd, struct event **event );
 static enum server_fd_type pipe_server_get_fd_type( struct fd *fd );
-static void pipe_server_ioctl( struct fd *fd, unsigned int code, const async_data_t *async,
+static void pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
                                const void *data, data_size_t size );
 
 static const struct object_ops pipe_server_ops =
@@ -565,7 +565,7 @@
     return FD_TYPE_PIPE;
 }
 
-static void pipe_server_ioctl( struct fd *fd, unsigned int code, const async_data_t *async,
+static void pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async,
                                const void *data, data_size_t size )
 {
     struct pipe_server *server = get_fd_user( fd );
diff --git a/server/protocol.def b/server/protocol.def
index e9e3c1e..9aff9e6 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -37,6 +37,7 @@
 typedef unsigned int process_id_t;
 typedef unsigned int thread_id_t;
 typedef unsigned int data_size_t;
+typedef unsigned int ioctl_code_t;
 
 struct request_header
 {
@@ -1967,7 +1968,7 @@
 /* Perform an ioctl on a file */
 @REQ(ioctl)
     obj_handle_t   handle;        /* handle to the device */
-    unsigned int   code;          /* ioctl code */
+    ioctl_code_t   code;          /* ioctl code */
     async_data_t   async;         /* async I/O parameters */
     VARARG(in_data,bytes);        /* ioctl input data */
 @REPLY
diff --git a/server/trace.c b/server/trace.c
index 44cf32e..59cdf1d 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -36,6 +36,7 @@
 #include "winbase.h"
 #include "wincon.h"
 #include "winternl.h"
+#include "winioctl.h"
 #include "file.h"
 #include "request.h"
 #include "unicode.h"
@@ -82,6 +83,18 @@
     fprintf( stderr, "',%04x}", info->attr );
 }
 
+static void dump_ioctl_code( const ioctl_code_t *code )
+{
+    switch(*code)
+    {
+#define CASE(c) case c: fputs( #c, stderr ); break
+        CASE(FSCTL_DISMOUNT_VOLUME);
+        CASE(FSCTL_PIPE_DISCONNECT);
+        default: fprintf( stderr, "%08x", *code ); break;
+#undef CASE
+    }
+}
+
 static void dump_apc_call( const apc_call_t *call )
 {
     fputc( '{', stderr );
@@ -2391,7 +2404,9 @@
 static void dump_ioctl_request( const struct ioctl_request *req )
 {
     fprintf( stderr, " handle=%p,", req->handle );
-    fprintf( stderr, " code=%08x,", req->code );
+    fprintf( stderr, " code=" );
+    dump_ioctl_code( &req->code );
+    fprintf( stderr, "," );
     fprintf( stderr, " async=" );
     dump_async_data( &req->async );
     fprintf( stderr, "," );