r67: added a destroy hook in the policy handle -> wire handle code to allow backends
[samba.git] / source4 / rpc_server / handles.c
index 043318c075c81d760b758afd2f3ff9d04f97033d..df6abd65a5383015f78c5ded77ca92c58966e2c4 100644 (file)
@@ -42,6 +42,7 @@ struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection *dce_conn,
        }
        h->mem_ctx = mem_ctx;
        h->data = NULL;
+       h->destroy = NULL;
 
        h->wire_handle.handle_type = handle_type;
        uuid_generate_random(&h->wire_handle.uuid);
@@ -57,6 +58,9 @@ struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection *dce_conn,
 void dcesrv_handle_destroy(struct dcesrv_connection *dce_conn, 
                           struct dcesrv_handle *h)
 {
+       if (h->destroy) {
+               h->destroy(dce_conn, h);
+       }
        DLIST_REMOVE(dce_conn->handles, h);
        talloc_destroy(h->mem_ctx);
 }