From: Stefan Metzmacher Date: Thu, 8 Nov 2018 10:48:46 +0000 (+0100) Subject: s4:rpc_server: add dcesrv_handle_{create,lookup}() functions X-Git-Tag: talloc-2.1.15~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47a941cafbe9e8a6cbf3eef375297859db7ccf53;p=thirdparty%2Fsamba.git s4:rpc_server: add dcesrv_handle_{create,lookup}() functions 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 Reviewed-by: Jeremy Allison --- diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 39492f6acff..8cf7ed8cf04 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -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); diff --git a/source4/rpc_server/handles.c b/source4/rpc_server/handles.c index b2b9962a4f5..043870fa663 100644 --- a/source4/rpc_server/handles.c +++ b/source4/rpc_server/handles.c @@ -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); +}