s4:rpc_server: add dcesrv_handle_{create,lookup}() functions
authorStefan Metzmacher <metze@samba.org>
Thu, 8 Nov 2018 10:48:46 +0000 (11:48 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:34 +0000 (03:13 +0100)
They take struct dcesrv_call_state as argument and will replace
dcesrv_handle_{new,fetch}() which take dcesrv_connection_context
as argument.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/dcerpc_server.h
source4/rpc_server/handles.c

index 39492f6..8cf7ed8 100644 (file)
@@ -429,11 +429,16 @@ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx,
 NTSTATUS dcesrv_reply(struct dcesrv_call_state *call);
 struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection_context *context, 
                                        uint8_t handle_type);
+struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
+                                          uint8_t handle_type);
 
 struct dcesrv_handle *dcesrv_handle_fetch(
                                          struct dcesrv_connection_context *context, 
                                          const struct policy_handle *p,
                                          uint8_t handle_type);
+struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
+                                          const struct policy_handle *p,
+                                          uint8_t handle_type);
 
 const struct tsocket_address *dcesrv_connection_get_local_address(struct dcesrv_connection *conn);
 const struct tsocket_address *dcesrv_connection_get_remote_address(struct dcesrv_connection *conn);
index b2b9962..043870f 100644 (file)
@@ -73,6 +73,13 @@ _PUBLIC_ struct dcesrv_handle *dcesrv_handle_new(struct dcesrv_connection_contex
        return h;
 }
 
+_PUBLIC_
+struct dcesrv_handle *dcesrv_handle_create(struct dcesrv_call_state *call,
+                                          uint8_t handle_type)
+{
+       return dcesrv_handle_new(call->context, handle_type);
+}
+
 /**
   find an internal handle given a wire handle. If the wire handle is NULL then
   allocate a new handle
@@ -122,3 +129,11 @@ _PUBLIC_ struct dcesrv_handle *dcesrv_handle_fetch(
 
        return NULL;
 }
+
+_PUBLIC_
+struct dcesrv_handle *dcesrv_handle_lookup(struct dcesrv_call_state *call,
+                                          const struct policy_handle *p,
+                                          uint8_t handle_type)
+{
+       return dcesrv_handle_fetch(call->context, p, handle_type);
+}