From b8de67a2f2ef7334a77aa3b71752658c4555191d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 5 Aug 2007 10:37:08 +0000 Subject: r24240: Push down reply_prep_legacy one level inside api_fd_reply (This used to be commit 0bb95639d6b49b18f2a7f1131f54239355097119) --- source3/smbd/ipc.c | 73 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 19 deletions(-) (limited to 'source3/smbd/ipc.c') diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index a190a59996..ddc42c408e 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -293,8 +293,6 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid, smb_np_struct *p = NULL; int pnum; int subcommand; - char *inbuf, *outbuf; - int size, buflength; DEBUG(5,("api_fd_reply\n")); @@ -341,37 +339,74 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid, DEBUG(10,("api_fd_reply: p:%p max_trans_reply: %d\n", p, p->max_trans_reply)); - if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, &buflength)) { - reply_nterror(req, NT_STATUS_NO_MEMORY); - return; - } - switch (subcommand) { - case TRANSACT_DCERPCCMD: + case TRANSACT_DCERPCCMD: { + + char *inbuf, *outbuf; + int size, buflength; + + if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, + &buflength)) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + return; + } + /* dce/rpc command */ reply = write_to_pipe(p, data, tdscnt); if (reply) reply = api_rpc_trans_reply(inbuf, outbuf, p); + + if (!reply) { + api_no_reply(req); + return; + } + reply_post_legacy(req, -1); break; - case TRANSACT_WAITNAMEDPIPEHANDLESTATE: + } + case TRANSACT_WAITNAMEDPIPEHANDLESTATE: { + + char *inbuf, *outbuf; + int size, buflength; + + if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, + &buflength)) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + return; + } + /* Wait Named Pipe Handle state */ - reply = api_WNPHS(inbuf, outbuf, p, params, tpscnt); + if (!api_WNPHS(inbuf, outbuf, p, params, tpscnt)) { + api_no_reply(req); + return; + } + + reply_post_legacy(req, -1); break; - case TRANSACT_SETNAMEDPIPEHANDLESTATE: + } + case TRANSACT_SETNAMEDPIPEHANDLESTATE: { + + char *inbuf, *outbuf; + int size, buflength; + + if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, + &buflength)) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + return; + } + /* Set Named Pipe Handle state */ - reply = api_SNPHS(inbuf, outbuf, p, params, tpscnt); + if (!api_SNPHS(inbuf, outbuf, p, params, tpscnt)) { + api_no_reply(req); + return; + } + + reply_post_legacy(req, -1); break; + } default: reply_nterror(req, NT_STATUS_INVALID_PARAMETER); return; } - - if (!reply) { - api_no_reply(req); - return; - } - - reply_post_legacy(req, -1); } /**************************************************************************** -- cgit