From a04ff4bba9832fd787972911fb391558f129870c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 4 Dec 2015 10:36:47 +0100
Subject: server: Introduce a new alloc_handle object callback. (v2)

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
 server/async.c      |  2 ++
 server/atom.c       |  1 +
 server/change.c     |  1 +
 server/clipboard.c  |  1 +
 server/completion.c |  1 +
 server/console.c    |  3 +++
 server/debugger.c   |  2 ++
 server/device.c     |  4 ++++
 server/directory.c  |  2 ++
 server/event.c      |  2 ++
 server/fd.c         |  4 ++++
 server/file.c       |  1 +
 server/handle.c     | 13 +++++++++++--
 server/hook.c       |  1 +
 server/mailslot.c   |  3 +++
 server/mapping.c    |  1 +
 server/mutex.c      |  1 +
 server/named_pipe.c |  4 ++++
 server/object.c     |  4 ++++
 server/object.h     |  5 ++++-
 server/process.c    |  3 +++
 server/queue.c      |  2 ++
 server/registry.c   |  1 +
 server/request.c    |  1 +
 server/semaphore.c  |  1 +
 server/serial.c     |  1 +
 server/signal.c     |  1 +
 server/snapshot.c   |  1 +
 server/sock.c       |  2 ++
 server/symlink.c    |  1 +
 server/thread.c     |  2 ++
 server/timer.c      |  1 +
 server/token.c      |  1 +
 server/winstation.c |  2 ++
 34 files changed, 73 insertions(+), 3 deletions(-)

diff --git a/server/async.c b/server/async.c
index d2da976..b00d2cc 100644
--- a/server/async.c
+++ b/server/async.c
@@ -66,6 +66,7 @@ static const struct object_ops async_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     async_destroy              /* destroy */
 };
@@ -99,6 +100,7 @@ static const struct object_ops async_queue_ops =
     default_set_sd,                  /* set_sd */
     no_lookup_name,                  /* lookup_name */
     no_open_file,                    /* open_file */
+    no_alloc_handle,                 /* alloc_handle */
     no_close_handle,                 /* close_handle */
     async_queue_destroy              /* destroy */
 };
diff --git a/server/atom.c b/server/atom.c
index 0ed4ed5..1f694bc 100644
--- a/server/atom.c
+++ b/server/atom.c
@@ -88,6 +88,7 @@ static const struct object_ops atom_table_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     atom_table_destroy            /* destroy */
 };
diff --git a/server/change.c b/server/change.c
index 59d1819..4f36179 100644
--- a/server/change.c
+++ b/server/change.c
@@ -167,6 +167,7 @@ static const struct object_ops dir_ops =
     dir_set_sd,               /* set_sd */
     no_lookup_name,           /* lookup_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     fd_close_handle,          /* close_handle */
     dir_destroy               /* destroy */
 };
diff --git a/server/clipboard.c b/server/clipboard.c
index 2f56c72..1f988bc 100644
--- a/server/clipboard.c
+++ b/server/clipboard.c
@@ -66,6 +66,7 @@ static const struct object_ops clipboard_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     no_destroy                    /* destroy */
 };
diff --git a/server/completion.c b/server/completion.c
index 77c72cc..97d2102 100644
--- a/server/completion.c
+++ b/server/completion.c
@@ -73,6 +73,7 @@ static const struct object_ops completion_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     completion_destroy         /* destroy */
 };
diff --git a/server/console.c b/server/console.c
index a57b2fe..264b45f 100644
--- a/server/console.c
+++ b/server/console.c
@@ -85,6 +85,7 @@ static const struct object_ops console_input_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     console_input_destroy             /* destroy */
 };
@@ -117,6 +118,7 @@ static const struct object_ops console_input_events_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     console_input_events_destroy      /* destroy */
 };
@@ -169,6 +171,7 @@ static const struct object_ops screen_buffer_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     screen_buffer_destroy             /* destroy */
 };
diff --git a/server/debugger.c b/server/debugger.c
index 374f2ad..5e9e6bf 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -82,6 +82,7 @@ static const struct object_ops debug_event_ops =
     default_set_sd,                /* set_sd */
     no_lookup_name,                /* lookup_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     debug_event_destroy            /* destroy */
 };
@@ -106,6 +107,7 @@ static const struct object_ops debug_ctx_ops =
     default_set_sd,                /* set_sd */
     no_lookup_name,                /* lookup_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     debug_ctx_destroy              /* destroy */
 };
diff --git a/server/device.c b/server/device.c
index fb91c02..e207ba8 100644
--- a/server/device.c
+++ b/server/device.c
@@ -79,6 +79,7 @@ static const struct object_ops irp_call_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     irp_call_destroy                  /* destroy */
 };
@@ -113,6 +114,7 @@ static const struct object_ops device_manager_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     device_manager_destroy            /* destroy */
 };
@@ -152,6 +154,7 @@ static const struct object_ops device_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     device_open_file,                 /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     device_destroy                    /* destroy */
 };
@@ -198,6 +201,7 @@ static const struct object_ops device_file_ops =
     default_set_sd,                   /* set_sd */
     no_lookup_name,                   /* lookup_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     device_file_close_handle,         /* close_handle */
     device_file_destroy               /* destroy */
 };
diff --git a/server/directory.c b/server/directory.c
index e0cf75e..da98fb0 100644
--- a/server/directory.c
+++ b/server/directory.c
@@ -65,6 +65,7 @@ static const struct object_ops object_type_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     no_destroy                    /* destroy */
 };
@@ -98,6 +99,7 @@ static const struct object_ops directory_ops =
     default_set_sd,               /* set_sd */
     directory_lookup_name,        /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     directory_destroy             /* destroy */
 };
diff --git a/server/event.c b/server/event.c
index 4d3c562..9c09694 100644
--- a/server/event.c
+++ b/server/event.c
@@ -66,6 +66,7 @@ static const struct object_ops event_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     no_destroy                 /* destroy */
 };
@@ -97,6 +98,7 @@ static const struct object_ops keyed_event_ops =
     default_set_sd,              /* set_sd */
     no_lookup_name,              /* lookup_name */
     no_open_file,                /* open_file */
+    no_alloc_handle,             /* alloc_handle */
     no_close_handle,             /* close_handle */
     no_destroy                   /* destroy */
 };
diff --git a/server/fd.c b/server/fd.c
index e3fe292..3e6373a 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -210,6 +210,7 @@ static const struct object_ops fd_ops =
     default_set_sd,           /* set_sd */
     no_lookup_name,           /* lookup_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     fd_destroy                /* destroy */
 };
@@ -247,6 +248,7 @@ static const struct object_ops device_ops =
     default_set_sd,           /* set_sd */
     no_lookup_name,           /* lookup_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     device_destroy            /* destroy */
 };
@@ -283,6 +285,7 @@ static const struct object_ops inode_ops =
     default_set_sd,           /* set_sd */
     no_lookup_name,           /* lookup_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     inode_destroy             /* destroy */
 };
@@ -321,6 +324,7 @@ static const struct object_ops file_lock_ops =
     default_set_sd,             /* set_sd */
     no_lookup_name,             /* lookup_name */
     no_open_file,               /* open_file */
+    no_alloc_handle,            /* alloc_handle */
     no_close_handle,            /* close_handle */
     no_destroy                  /* destroy */
 };
diff --git a/server/file.c b/server/file.c
index a07ca16..c9c47a4 100644
--- a/server/file.c
+++ b/server/file.c
@@ -92,6 +92,7 @@ static const struct object_ops file_ops =
     file_set_sd,                  /* set_sd */
     no_lookup_name,               /* lookup_name */
     file_open_file,               /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     file_destroy                  /* destroy */
 };
diff --git a/server/handle.c b/server/handle.c
index 5043ff7..64db8fc 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -131,6 +131,7 @@ static const struct object_ops handle_table_ops =
     default_set_sd,                  /* set_sd */
     no_lookup_name,                  /* lookup_name */
     no_open_file,                    /* open_file */
+    no_alloc_handle,                 /* alloc_handle */
     no_close_handle,                 /* close_handle */
     handle_table_destroy             /* destroy */
 };
@@ -229,7 +230,7 @@ static int grow_handle_table( struct handle_table *table )
 }
 
 /* allocate the first free entry in the handle table */
-static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned int access )
+static obj_handle_t alloc_entry( struct handle_table *table, struct object *obj, unsigned int access )
 {
     struct handle_entry *entry = table->entries + table->free;
     int i;
@@ -245,6 +246,10 @@ static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned
     table->free = i + 1;
     entry->ptr    = grab_object_for_handle( obj );
     entry->access = access;
+
+    if (table->process)
+        obj->ops->alloc_handle( obj, table->process, index_to_handle(i) );
+
     return index_to_handle(i);
 }
 
@@ -369,7 +374,11 @@ struct handle_table *copy_handle_table( struct process *process, struct process
         for (i = 0; i <= table->last; i++, ptr++)
         {
             if (!ptr->ptr) continue;
-            if (ptr->access & RESERVED_INHERIT) grab_object_for_handle( ptr->ptr );
+            if (ptr->access & RESERVED_INHERIT)
+            {
+                ptr->ptr->ops->alloc_handle( ptr->ptr, process, index_to_handle(i) );
+                grab_object_for_handle( ptr->ptr );
+            }
             else ptr->ptr = NULL; /* don't inherit this entry */
         }
     }
diff --git a/server/hook.c b/server/hook.c
index a8e6ab9..c005cae 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -89,6 +89,7 @@ static const struct object_ops hook_table_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     hook_table_destroy            /* destroy */
 };
diff --git a/server/mailslot.c b/server/mailslot.c
index 97ea3f6..5075a1a 100644
--- a/server/mailslot.c
+++ b/server/mailslot.c
@@ -86,6 +86,7 @@ static const struct object_ops mailslot_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     mailslot_open_file,        /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     fd_close_handle,           /* close_handle */
     mailslot_destroy           /* destroy */
 };
@@ -139,6 +140,7 @@ static const struct object_ops mail_writer_ops =
     default_set_sd,             /* set_sd */
     no_lookup_name,             /* lookup_name */
     no_open_file,               /* open_file */
+    no_alloc_handle,            /* alloc_handle */
     fd_close_handle,            /* close_handle */
     mail_writer_destroy         /* destroy */
 };
@@ -193,6 +195,7 @@ static const struct object_ops mailslot_device_ops =
     default_set_sd,                 /* set_sd */
     mailslot_device_lookup_name,    /* lookup_name */
     mailslot_device_open_file,      /* open_file */
+    no_alloc_handle,                /* alloc_handle */
     fd_close_handle,                /* close_handle */
     mailslot_device_destroy         /* destroy */
 };
diff --git a/server/mapping.c b/server/mapping.c
index 16e7c1c..fd31df2 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -92,6 +92,7 @@ static const struct object_ops mapping_ops =
     default_set_sd,              /* set_sd */
     no_lookup_name,              /* lookup_name */
     no_open_file,                /* open_file */
+    no_alloc_handle,             /* alloc_handle */
     fd_close_handle,             /* close_handle */
     mapping_destroy              /* destroy */
 };
diff --git a/server/mutex.c b/server/mutex.c
index 910fbca..6e23770 100644
--- a/server/mutex.c
+++ b/server/mutex.c
@@ -69,6 +69,7 @@ static const struct object_ops mutex_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     mutex_destroy              /* destroy */
 };
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 8d5753a..f48ead9 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -132,6 +132,7 @@ static const struct object_ops named_pipe_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     named_pipe_open_file,         /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     named_pipe_destroy            /* destroy */
 };
@@ -161,6 +162,7 @@ static const struct object_ops pipe_server_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     pipe_server_destroy           /* destroy */
 };
@@ -203,6 +205,7 @@ static const struct object_ops pipe_client_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     pipe_client_destroy           /* destroy */
 };
@@ -249,6 +252,7 @@ static const struct object_ops named_pipe_device_ops =
     default_set_sd,                   /* set_sd */
     named_pipe_device_lookup_name,    /* lookup_name */
     named_pipe_device_open_file,      /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     fd_close_handle,                  /* close_handle */
     named_pipe_device_destroy         /* destroy */
 };
diff --git a/server/object.c b/server/object.c
index 31883bd..3ccaa4c 100644
--- a/server/object.c
+++ b/server/object.c
@@ -548,6 +548,10 @@ struct object *no_open_file( struct object *obj, unsigned int access, unsigned i
     return NULL;
 }
 
+void no_alloc_handle( struct object *obj, struct process *process, obj_handle_t handle )
+{
+}
+
 int no_close_handle( struct object *obj, struct process *process, obj_handle_t handle )
 {
     return 1;  /* ok to close */
diff --git a/server/object.h b/server/object.h
index b59811f..06ee321 100644
--- a/server/object.h
+++ b/server/object.h
@@ -86,8 +86,10 @@ struct object_ops
     /* open a file object to access this object */
     struct object *(*open_file)(struct object *, unsigned int access, unsigned int sharing,
                                 unsigned int options);
+    /* allocate a handle to this object */
+    void (*alloc_handle)(struct object *, struct process *, obj_handle_t);
     /* close a handle to this object */
-    int (*close_handle)(struct object *,struct process *,obj_handle_t);
+    int (*close_handle)(struct object *, struct process *, obj_handle_t);
     /* destroy on refcount == 0 */
     void (*destroy)(struct object *);
 };
@@ -145,6 +147,7 @@ extern int set_sd_defaults_from_token( struct object *obj, const struct security
 extern struct object *no_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attributes );
 extern struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing,
                                     unsigned int options );
+extern void no_alloc_handle( struct object *obj, struct process *process, obj_handle_t handle );
 extern int no_close_handle( struct object *obj, struct process *process, obj_handle_t handle );
 extern void no_destroy( struct object *obj );
 #ifdef DEBUG_OBJECTS
diff --git a/server/process.c b/server/process.c
index e00b429..bc86c24 100644
--- a/server/process.c
+++ b/server/process.c
@@ -82,6 +82,7 @@ static const struct object_ops process_ops =
     default_set_sd,              /* set_sd */
     no_lookup_name,              /* lookup_name */
     no_open_file,                /* open_file */
+    no_alloc_handle,             /* alloc_handle */
     no_close_handle,             /* close_handle */
     process_destroy              /* destroy */
 };
@@ -130,6 +131,7 @@ static const struct object_ops startup_info_ops =
     default_set_sd,                /* set_sd */
     no_lookup_name,                /* lookup_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     startup_info_destroy           /* destroy */
 };
@@ -171,6 +173,7 @@ static const struct object_ops job_ops =
     default_set_sd,                /* set_sd */
     no_lookup_name,                /* lookup_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     job_close_handle,              /* close_handle */
     job_destroy                    /* destroy */
 };
diff --git a/server/queue.c b/server/queue.c
index 3099e12..bdc740d 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -179,6 +179,7 @@ static const struct object_ops msg_queue_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     msg_queue_destroy          /* destroy */
 };
@@ -212,6 +213,7 @@ static const struct object_ops thread_input_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     thread_input_destroy          /* destroy */
 };
diff --git a/server/registry.c b/server/registry.c
index a3c1390..2db56c3 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -167,6 +167,7 @@ static const struct object_ops key_ops =
     default_set_sd,          /* set_sd */
     no_lookup_name,          /* lookup_name */
     no_open_file,            /* open_file */
+    no_alloc_handle,         /* alloc_handle */
     key_close_handle,        /* close_handle */
     key_destroy              /* destroy */
 };
diff --git a/server/request.c b/server/request.c
index f78026a..bd01179 100644
--- a/server/request.c
+++ b/server/request.c
@@ -103,6 +103,7 @@ static const struct object_ops master_socket_ops =
     default_set_sd,                /* set_sd */
     no_lookup_name,                /* lookup_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     master_socket_destroy          /* destroy */
 };
diff --git a/server/semaphore.c b/server/semaphore.c
index d87325c..aaf2d65 100644
--- a/server/semaphore.c
+++ b/server/semaphore.c
@@ -66,6 +66,7 @@ static const struct object_ops semaphore_ops =
     default_set_sd,                /* set_sd */
     no_lookup_name,                /* lookup_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     no_destroy                     /* destroy */
 };
diff --git a/server/serial.c b/server/serial.c
index 164a4b1..cc9c3bc 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -101,6 +101,7 @@ static const struct object_ops serial_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     serial_destroy                /* destroy */
 };
diff --git a/server/signal.c b/server/signal.c
index 5e4fe33..308f494 100644
--- a/server/signal.c
+++ b/server/signal.c
@@ -75,6 +75,7 @@ static const struct object_ops handler_ops =
     default_set_sd,           /* set_sd */
     no_lookup_name,           /* lookup_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     handler_destroy           /* destroy */
 };
diff --git a/server/snapshot.c b/server/snapshot.c
index dd00bd1..b827c6f 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -69,6 +69,7 @@ static const struct object_ops snapshot_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     snapshot_destroy              /* destroy */
 };
diff --git a/server/sock.c b/server/sock.c
index 1767dea..57d3d93 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -154,6 +154,7 @@ static const struct object_ops sock_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     sock_destroy                  /* destroy */
 };
@@ -996,6 +997,7 @@ static const struct object_ops ifchange_ops =
     default_set_sd,          /* set_sd */
     no_lookup_name,          /* lookup_name */
     no_open_file,            /* open_file */
+    no_alloc_handle,         /* alloc_handle */
     no_close_handle,         /* close_handle */
     ifchange_destroy         /* destroy */
 };
diff --git a/server/symlink.c b/server/symlink.c
index 2330fde..1107639 100644
--- a/server/symlink.c
+++ b/server/symlink.c
@@ -68,6 +68,7 @@ static const struct object_ops symlink_ops =
     default_set_sd,               /* set_sd */
     symlink_lookup_name,          /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     symlink_destroy               /* destroy */
 };
diff --git a/server/thread.c b/server/thread.c
index bad2231..9407938 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -118,6 +118,7 @@ static const struct object_ops thread_apc_ops =
     default_set_sd,             /* set_sd */
     no_lookup_name,             /* lookup_name */
     no_open_file,               /* open_file */
+    no_alloc_handle,            /* alloc_handle */
     no_close_handle,            /* close_handle */
     thread_apc_destroy          /* destroy */
 };
@@ -147,6 +148,7 @@ static const struct object_ops thread_ops =
     default_set_sd,             /* set_sd */
     no_lookup_name,             /* lookup_name */
     no_open_file,               /* open_file */
+    no_alloc_handle,            /* alloc_handle */
     no_close_handle,            /* close_handle */
     destroy_thread              /* destroy */
 };
diff --git a/server/timer.c b/server/timer.c
index 9c293f2..9957ee3 100644
--- a/server/timer.c
+++ b/server/timer.c
@@ -73,6 +73,7 @@ static const struct object_ops timer_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     timer_destroy              /* destroy */
 };
diff --git a/server/token.c b/server/token.c
index 42cfb3d..893d58f 100644
--- a/server/token.c
+++ b/server/token.c
@@ -159,6 +159,7 @@ static const struct object_ops token_ops =
     default_set_sd,            /* set_sd */
     no_lookup_name,            /* lookup_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     token_destroy              /* destroy */
 };
diff --git a/server/winstation.c b/server/winstation.c
index 5016184..c4e55e3 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -71,6 +71,7 @@ static const struct object_ops winstation_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     winstation_close_handle,      /* close_handle */
     winstation_destroy            /* destroy */
 };
@@ -92,6 +93,7 @@ static const struct object_ops desktop_ops =
     default_set_sd,               /* set_sd */
     no_lookup_name,               /* lookup_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     desktop_close_handle,         /* close_handle */
     desktop_destroy               /* destroy */
 };
-- 
2.6.2

