summaryrefslogtreecommitdiff
path: root/source3/rpc_server/rpc_handles.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server/rpc_handles.c')
-rw-r--r--source3/rpc_server/rpc_handles.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c
index cf5bc2770ea..99fc2490dd0 100644
--- a/source3/rpc_server/rpc_handles.c
+++ b/source3/rpc_server/rpc_handles.c
@@ -250,8 +250,11 @@ bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *synta
data_ptr is TALLOC_FREE()'ed
****************************************************************************/
-static struct dcesrv_handle *create_rpc_handle_internal(struct pipes_struct *p,
- struct policy_handle *hnd, void *data_ptr)
+static struct dcesrv_handle *create_rpc_handle_internal(
+ struct pipes_struct *p,
+ struct policy_handle *hnd,
+ uint8_t handle_type,
+ void *data_ptr)
{
struct dcesrv_handle *rpc_hnd;
static uint32_t pol_hnd_low = 0;
@@ -279,8 +282,7 @@ static struct dcesrv_handle *create_rpc_handle_internal(struct pipes_struct *p,
pol_hnd_high++;
}
- /* first bit must be null */
- SIVAL(&rpc_hnd->wire_handle.handle_type, 0 , 0);
+ rpc_hnd->wire_handle.handle_type = handle_type;
/* second bit is incrementing */
SIVAL(&rpc_hnd->wire_handle.uuid.time_low, 0 , pol_hnd_low);
@@ -307,12 +309,14 @@ static struct dcesrv_handle *create_rpc_handle_internal(struct pipes_struct *p,
return rpc_hnd;
}
-bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd,
- void *data_ptr)
+bool create_policy_hnd(struct pipes_struct *p,
+ struct policy_handle *hnd,
+ uint8_t handle_type,
+ void *data_ptr)
{
struct dcesrv_handle *rpc_hnd;
- rpc_hnd = create_rpc_handle_internal(p, hnd, data_ptr);
+ rpc_hnd = create_rpc_handle_internal(p, hnd, handle_type, data_ptr);
if (rpc_hnd == NULL) {
return false;
}
@@ -448,9 +452,13 @@ bool pipe_access_check(struct pipes_struct *p)
return True;
}
-void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
- uint32_t access_granted, size_t data_size,
- const char *type, NTSTATUS *pstatus)
+void *_policy_handle_create(struct pipes_struct *p,
+ struct policy_handle *hnd,
+ uint8_t handle_type,
+ uint32_t access_granted,
+ size_t data_size,
+ const char *type,
+ NTSTATUS *pstatus)
{
struct dcesrv_handle *rpc_hnd;
void *data;
@@ -472,7 +480,7 @@ void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
}
talloc_set_name_const(data, type);
- rpc_hnd = create_rpc_handle_internal(p, hnd, data);
+ rpc_hnd = create_rpc_handle_internal(p, hnd, handle_type, data);
if (rpc_hnd == NULL) {
TALLOC_FREE(data);
*pstatus = NT_STATUS_NO_MEMORY;