From f8b82a7b9507e11595bc924def179dc1d7d79a54 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 24 Nov 1999 20:24:33 +0000 Subject: first stages of removing struct cli_state* and uint16 fnum from all msrpc client code. the intent is to hide / abstract / associate connection info behind policy handles. this makes the msrpc functions look more and more like their nt equivalents. who-hou! (This used to be commit c01b18e632aede6fce7264ef6971d7ddba945cfb) --- source3/rpc_server/srv_lsa_hnd.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'source3/rpc_server/srv_lsa_hnd.c') diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index 36bacad59b..8e4620f8dc 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -111,7 +111,7 @@ BOOL init_policy_hnd(int num_pol_hnds) /**************************************************************************** find first available policy slot. creates a policy handle for you. ****************************************************************************/ -BOOL open_policy_hnd(POLICY_HND *hnd) +BOOL register_policy_hnd(POLICY_HND *hnd) { int i; struct policy *p; @@ -135,7 +135,6 @@ BOOL open_policy_hnd(POLICY_HND *hnd) p->pnum = i; p->type = POL_NO_INFO; - create_pol_hnd(hnd); memcpy(&p->pol_hnd, hnd, sizeof(*hnd)); bitmap_set(bmap, i); @@ -148,23 +147,33 @@ BOOL open_policy_hnd(POLICY_HND *hnd) return True; } +/**************************************************************************** + find first available policy slot. creates a policy handle for you. +****************************************************************************/ +BOOL open_policy_hnd(POLICY_HND *hnd) +{ + create_pol_hnd(hnd); + return register_policy_hnd(hnd); +} + /**************************************************************************** find policy by handle ****************************************************************************/ -static struct policy *find_policy(POLICY_HND *hnd) +static struct policy *find_policy(const POLICY_HND *hnd) { struct policy *p; for (p=Policy;p;p=p->next) { if (memcmp(&p->pol_hnd, hnd, sizeof(*hnd)) == 0) { DEBUG(4,("Found policy hnd[%x] ", p->pnum)); - dump_data(4, (char *)hnd->data, sizeof(hnd->data)); + dump_data(4, (const char *)hnd->data, + sizeof(hnd->data)); return p; } } DEBUG(4,("Policy not found: ")); - dump_data(4, (char *)hnd->data, sizeof(hnd->data)); + dump_data(4, (const char *)hnd->data, sizeof(hnd->data)); return NULL; } @@ -172,7 +181,7 @@ static struct policy *find_policy(POLICY_HND *hnd) /**************************************************************************** find policy index by handle ****************************************************************************/ -int find_policy_by_hnd(POLICY_HND *hnd) +int find_policy_by_hnd(const POLICY_HND *hnd) { struct policy *p = find_policy(hnd); @@ -393,7 +402,8 @@ BOOL set_policy_cli_state(POLICY_HND *hnd, struct cli_state *cli, uint16 fnum, /**************************************************************************** get cli state ****************************************************************************/ -BOOL get_policy_cli_state(POLICY_HND *hnd, struct cli_state **cli, uint16 *fnum) +BOOL get_policy_cli_state(const POLICY_HND *hnd, struct cli_state **cli, + uint16 *fnum) { struct policy *p = find_policy(hnd); -- cgit