From bb902548f15deec4dc9d9eaaf6e78b4cbdb01f87 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 64aa27a..bc74173 100644
--- a/server/async.c
+++ b/server/async.c
@@ -68,6 +68,7 @@ static const struct object_ops async_ops =
     no_link_name,              /* link_name */
     NULL,                      /* unlink_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     async_destroy              /* destroy */
 };
@@ -103,6 +104,7 @@ static const struct object_ops async_queue_ops =
     no_link_name,                    /* link_name */
     NULL,                            /* unlink_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 3ff7540..7bebf13 100644
--- a/server/atom.c
+++ b/server/atom.c
@@ -90,6 +90,7 @@ static const struct object_ops atom_table_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 36a1997..6da2f63 100644
--- a/server/change.c
+++ b/server/change.c
@@ -169,6 +169,7 @@ static const struct object_ops dir_ops =
     no_link_name,             /* link_name */
     NULL,                     /* unlink_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 7b92706..fa3aa51 100644
--- a/server/clipboard.c
+++ b/server/clipboard.c
@@ -68,6 +68,7 @@ static const struct object_ops clipboard_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 759c6e2..bca0963 100644
--- a/server/completion.c
+++ b/server/completion.c
@@ -75,6 +75,7 @@ static const struct object_ops completion_ops =
     directory_link_name,       /* link_name */
     default_unlink_name,       /* unlink_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 0d98b78..37e413c 100644
--- a/server/console.c
+++ b/server/console.c
@@ -87,6 +87,7 @@ static const struct object_ops console_input_ops =
     no_link_name,                     /* link_name */
     NULL,                             /* unlink_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     console_input_destroy             /* destroy */
 };
@@ -121,6 +122,7 @@ static const struct object_ops console_input_events_ops =
     no_link_name,                     /* link_name */
     NULL,                             /* unlink_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     console_input_events_destroy      /* destroy */
 };
@@ -175,6 +177,7 @@ static const struct object_ops screen_buffer_ops =
     no_link_name,                     /* link_name */
     NULL,                             /* unlink_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 2eb794a..a2c07ba 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -84,6 +84,7 @@ static const struct object_ops debug_event_ops =
     no_link_name,                  /* link_name */
     NULL,                          /* unlink_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     debug_event_destroy            /* destroy */
 };
@@ -110,6 +111,7 @@ static const struct object_ops debug_ctx_ops =
     no_link_name,                  /* link_name */
     NULL,                          /* unlink_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 a8f6f5d..4fdf7ad 100644
--- a/server/device.c
+++ b/server/device.c
@@ -81,6 +81,7 @@ static const struct object_ops irp_call_ops =
     no_link_name,                     /* link_name */
     NULL,                             /* unlink_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     irp_call_destroy                  /* destroy */
 };
@@ -117,6 +118,7 @@ static const struct object_ops device_manager_ops =
     no_link_name,                     /* link_name */
     NULL,                             /* unlink_name */
     no_open_file,                     /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     device_manager_destroy            /* destroy */
 };
@@ -158,6 +160,7 @@ static const struct object_ops device_ops =
     directory_link_name,              /* link_name */
     default_unlink_name,              /* unlink_name */
     device_open_file,                 /* open_file */
+    no_alloc_handle,                  /* alloc_handle */
     no_close_handle,                  /* close_handle */
     device_destroy                    /* destroy */
 };
@@ -206,6 +209,7 @@ static const struct object_ops device_file_ops =
     no_link_name,                     /* link_name */
     NULL,                             /* unlink_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 45683b9..445c35c 100644
--- a/server/directory.c
+++ b/server/directory.c
@@ -67,6 +67,7 @@ static const struct object_ops object_type_ops =
     directory_link_name,          /* link_name */
     default_unlink_name,          /* unlink_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     no_destroy                    /* destroy */
 };
@@ -102,6 +103,7 @@ static const struct object_ops directory_ops =
     directory_link_name,          /* link_name */
     default_unlink_name,          /* unlink_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 c9a0ebb..36ea8fd 100644
--- a/server/event.c
+++ b/server/event.c
@@ -68,6 +68,7 @@ static const struct object_ops event_ops =
     directory_link_name,       /* link_name */
     default_unlink_name,       /* unlink_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     no_destroy                 /* destroy */
 };
@@ -101,6 +102,7 @@ static const struct object_ops keyed_event_ops =
     directory_link_name,         /* link_name */
     default_unlink_name,         /* unlink_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 28f5346..c64132c 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -212,6 +212,7 @@ static const struct object_ops fd_ops =
     no_link_name,             /* link_name */
     NULL,                     /* unlink_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     fd_destroy                /* destroy */
 };
@@ -251,6 +252,7 @@ static const struct object_ops device_ops =
     no_link_name,             /* link_name */
     NULL,                     /* unlink_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     device_destroy            /* destroy */
 };
@@ -289,6 +291,7 @@ static const struct object_ops inode_ops =
     no_link_name,             /* link_name */
     NULL,                     /* unlink_name */
     no_open_file,             /* open_file */
+    no_alloc_handle,          /* alloc_handle */
     no_close_handle,          /* close_handle */
     inode_destroy             /* destroy */
 };
@@ -329,6 +332,7 @@ static const struct object_ops file_lock_ops =
     no_link_name,               /* link_name */
     NULL,                       /* unlink_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 15fd411..e6f3fc2 100644
--- a/server/file.c
+++ b/server/file.c
@@ -94,6 +94,7 @@ static const struct object_ops file_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 f440f9f..eb83a3b 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -133,6 +133,7 @@ static const struct object_ops handle_table_ops =
     no_link_name,                    /* link_name */
     NULL,                            /* unlink_name */
     no_open_file,                    /* open_file */
+    no_alloc_handle,                 /* alloc_handle */
     no_close_handle,                 /* close_handle */
     handle_table_destroy             /* destroy */
 };
@@ -232,7 +233,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;
@@ -248,6 +249,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);
 }
 
@@ -372,7 +377,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 3a0e4b4..dc653b8 100644
--- a/server/hook.c
+++ b/server/hook.c
@@ -91,6 +91,7 @@ static const struct object_ops hook_table_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 a0fa6e2..bff0208 100644
--- a/server/mailslot.c
+++ b/server/mailslot.c
@@ -89,6 +89,7 @@ static const struct object_ops mailslot_ops =
     mailslot_link_name,        /* link_name */
     default_unlink_name,       /* unlink_name */
     mailslot_open_file,        /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     fd_close_handle,           /* close_handle */
     mailslot_destroy           /* destroy */
 };
@@ -144,6 +145,7 @@ static const struct object_ops mail_writer_ops =
     no_link_name,               /* link_name */
     NULL,                       /* unlink_name */
     no_open_file,               /* open_file */
+    no_alloc_handle,            /* alloc_handle */
     fd_close_handle,            /* close_handle */
     mail_writer_destroy         /* destroy */
 };
@@ -200,6 +202,7 @@ static const struct object_ops mailslot_device_ops =
     directory_link_name,            /* link_name */
     default_unlink_name,            /* unlink_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 4384cec..fc6404f 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -94,6 +94,7 @@ static const struct object_ops mapping_ops =
     directory_link_name,         /* link_name */
     default_unlink_name,         /* unlink_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 ca0da59..3598ac9 100644
--- a/server/mutex.c
+++ b/server/mutex.c
@@ -71,6 +71,7 @@ static const struct object_ops mutex_ops =
     directory_link_name,       /* link_name */
     default_unlink_name,       /* unlink_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 1e4169d..ade9165 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -135,6 +135,7 @@ static const struct object_ops named_pipe_ops =
     named_pipe_link_name,         /* link_name */
     default_unlink_name,          /* unlink_name */
     named_pipe_open_file,         /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     no_close_handle,              /* close_handle */
     named_pipe_destroy            /* destroy */
 };
@@ -166,6 +167,7 @@ static const struct object_ops pipe_server_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     pipe_server_destroy           /* destroy */
 };
@@ -210,6 +212,7 @@ static const struct object_ops pipe_client_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     pipe_client_destroy           /* destroy */
 };
@@ -258,6 +261,7 @@ static const struct object_ops named_pipe_device_ops =
     directory_link_name,              /* link_name */
     default_unlink_name,              /* unlink_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 b8be122..8310067 100644
--- a/server/object.c
+++ b/server/object.c
@@ -563,6 +563,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 c4bc40b..16bf089 100644
--- a/server/object.h
+++ b/server/object.h
@@ -90,8 +90,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 *);
 };
@@ -161,6 +163,7 @@ extern int no_link_name( struct object *obj, struct object_name *name, struct ob
 extern void default_unlink_name( struct object *obj, struct object_name *name );
 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 c9bcabb..cc9c01c 100644
--- a/server/process.c
+++ b/server/process.c
@@ -84,6 +84,7 @@ static const struct object_ops process_ops =
     no_link_name,                /* link_name */
     NULL,                        /* unlink_name */
     no_open_file,                /* open_file */
+    no_alloc_handle,             /* alloc_handle */
     no_close_handle,             /* close_handle */
     process_destroy              /* destroy */
 };
@@ -134,6 +135,7 @@ static const struct object_ops startup_info_ops =
     no_link_name,                  /* link_name */
     NULL,                          /* unlink_name */
     no_open_file,                  /* open_file */
+    no_alloc_handle,               /* alloc_handle */
     no_close_handle,               /* close_handle */
     startup_info_destroy           /* destroy */
 };
@@ -177,6 +179,7 @@ static const struct object_ops job_ops =
     directory_link_name,           /* link_name */
     default_unlink_name,           /* unlink_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 f82060f..e097f5b 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -181,6 +181,7 @@ static const struct object_ops msg_queue_ops =
     no_link_name,              /* link_name */
     NULL,                      /* unlink_name */
     no_open_file,              /* open_file */
+    no_alloc_handle,           /* alloc_handle */
     no_close_handle,           /* close_handle */
     msg_queue_destroy          /* destroy */
 };
@@ -216,6 +217,7 @@ static const struct object_ops thread_input_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 5ca2a52..e38d6bb 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -169,6 +169,7 @@ static const struct object_ops key_ops =
     no_link_name,            /* link_name */
     NULL,                    /* unlink_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 dfa4485..122de96 100644
--- a/server/request.c
+++ b/server/request.c
@@ -107,6 +107,7 @@ static const struct object_ops master_socket_ops =
     no_link_name,                  /* link_name */
     NULL,                          /* unlink_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 c77bd58..9c06ce4 100644
--- a/server/semaphore.c
+++ b/server/semaphore.c
@@ -68,6 +68,7 @@ static const struct object_ops semaphore_ops =
     directory_link_name,           /* link_name */
     default_unlink_name,           /* unlink_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 03d726a..46949a3 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -106,6 +106,7 @@ static const struct object_ops serial_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 c20e154..8c05c5f 100644
--- a/server/signal.c
+++ b/server/signal.c
@@ -77,6 +77,7 @@ static const struct object_ops handler_ops =
     no_link_name,             /* link_name */
     NULL,                     /* unlink_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 3566b89..a0cf32e 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -71,6 +71,7 @@ static const struct object_ops snapshot_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_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 dc10d2a..a11964f 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -156,6 +156,7 @@ static const struct object_ops sock_ops =
     no_link_name,                 /* link_name */
     NULL,                         /* unlink_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     fd_close_handle,              /* close_handle */
     sock_destroy                  /* destroy */
 };
@@ -1000,6 +1001,7 @@ static const struct object_ops ifchange_ops =
     no_link_name,            /* link_name */
     NULL,                    /* unlink_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 bd09d34..6607e47 100644
--- a/server/symlink.c
+++ b/server/symlink.c
@@ -70,6 +70,7 @@ static const struct object_ops symlink_ops =
     directory_link_name,          /* link_name */
     default_unlink_name,          /* unlink_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 ca02a8a..71b4d7b 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -120,6 +120,7 @@ static const struct object_ops thread_apc_ops =
     no_link_name,               /* link_name */
     NULL,                       /* unlink_name */
     no_open_file,               /* open_file */
+    no_alloc_handle,            /* alloc_handle */
     no_close_handle,            /* close_handle */
     thread_apc_destroy          /* destroy */
 };
@@ -151,6 +152,7 @@ static const struct object_ops thread_ops =
     no_link_name,               /* link_name */
     NULL,                       /* unlink_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 0d81d90..966d65d 100644
--- a/server/timer.c
+++ b/server/timer.c
@@ -75,6 +75,7 @@ static const struct object_ops timer_ops =
     directory_link_name,       /* link_name */
     default_unlink_name,       /* unlink_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 ca12813..e13d03a 100644
--- a/server/token.c
+++ b/server/token.c
@@ -161,6 +161,7 @@ static const struct object_ops token_ops =
     no_link_name,              /* link_name */
     NULL,                      /* unlink_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 9dc348d..17c312a 100644
--- a/server/winstation.c
+++ b/server/winstation.c
@@ -73,6 +73,7 @@ static const struct object_ops winstation_ops =
     directory_link_name,          /* link_name */
     default_unlink_name,          /* unlink_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     winstation_close_handle,      /* close_handle */
     winstation_destroy            /* destroy */
 };
@@ -96,6 +97,7 @@ static const struct object_ops desktop_ops =
     desktop_link_name,            /* link_name */
     default_unlink_name,          /* unlink_name */
     no_open_file,                 /* open_file */
+    no_alloc_handle,              /* alloc_handle */
     desktop_close_handle,         /* close_handle */
     desktop_destroy               /* destroy */
 };
-- 
2.7.0

