summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-30 12:53:09 +0100
committerGünther Deschner <gd@samba.org>2008-01-31 11:20:13 +0100
commit3d507a2fcab9da3d9ba928fbe1d30f2642ab4e93 (patch)
tree74820d588d414465587a36954a989696eaf06c0c /source3/rpc_server/srv_samr.c
parent5334b364c21599fe055b32bbbd1e8cf7488b1fa7 (diff)
downloadsamba-3d507a2fcab9da3d9ba928fbe1d30f2642ab4e93.tar.gz
samba-3d507a2fcab9da3d9ba928fbe1d30f2642ab4e93.tar.bz2
samba-3d507a2fcab9da3d9ba928fbe1d30f2642ab4e93.zip
Let _samr_Close() use pidl generated server code.
Guenther (This used to be commit 2df3408079fc382d00d01a0b82b0b8e1ffeba6e4)
Diffstat (limited to 'source3/rpc_server/srv_samr.c')
-rw-r--r--source3/rpc_server/srv_samr.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index a1deac083d..e2ffdefcd6 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -36,33 +36,33 @@
#define DBGC_CLASS DBGC_RPC_SRV
/*******************************************************************
- api_samr_close_hnd
********************************************************************/
-static bool api_samr_close_hnd(pipes_struct *p)
+static bool proxy_samr_call(pipes_struct *p, uint8 opnum)
{
- SAMR_Q_CLOSE_HND q_u;
- SAMR_R_CLOSE_HND r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
+ struct api_struct *fns;
+ int n_fns;
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
+ samr_get_pipe_fns(&fns, &n_fns);
- if(!samr_io_q_close_hnd("", &q_u, data, 0)) {
- DEBUG(0,("api_samr_close_hnd: unable to unmarshall SAMR_Q_CLOSE_HND.\n"));
- return False;
+ if (opnum >= n_fns) {
+ return false;
}
- r_u.status = _samr_close_hnd(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!samr_io_r_close_hnd("", &r_u, rdata, 0)) {
- DEBUG(0,("api_samr_close_hnd: unable to marshall SAMR_R_CLOSE_HND.\n"));
- return False;
+ if (fns[opnum].opnum != opnum) {
+ smb_panic("SAMR function table not sorted");
}
- return True;
+ return fns[opnum].fn(p);
+}
+
+/*******************************************************************
+ api_samr_close_hnd
+ ********************************************************************/
+
+static bool api_samr_close_hnd(pipes_struct *p)
+{
+ return proxy_samr_call(p, NDR_SAMR_CLOSE);
}
/*******************************************************************
@@ -1557,14 +1557,14 @@ static struct api_struct api_samr_cmds [] =
{"SAMR_CONNECT5" , SAMR_CONNECT5 , api_samr_connect5 }
};
-void samr_get_pipe_fns( struct api_struct **fns, int *n_fns )
+void samr2_get_pipe_fns( struct api_struct **fns, int *n_fns )
{
*fns = api_samr_cmds;
*n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct);
}
-NTSTATUS rpc_samr_init(void)
+NTSTATUS rpc_samr2_init(void)
{
return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "samr", "lsass", api_samr_cmds,
sizeof(api_samr_cmds) / sizeof(struct api_struct));