From 40f6afcea2dc2341682ce2dc1bc9082342c46d06 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 5 Aug 2007 10:48:35 +0000 Subject: r24241: Remove reply_prep_legacy from api_WNPHS and api_SNPHS (This used to be commit 8702450e91943b1097ae3c8979d60b6962a69632) --- source3/smbd/ipc.c | 80 ++++++++++++++++-------------------------------------- 1 file changed, 23 insertions(+), 57 deletions(-) diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index ddc42c408e..bea4f77450 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -30,7 +30,7 @@ extern int max_send; #define NERR_notsupported 50 -extern int smb_read_error; +static void api_no_reply(struct smb_request *req); /******************************************************************* copies parameters and data, as needed, into the smb buffer @@ -209,26 +209,25 @@ static BOOL api_rpc_trans_reply(const char *inbuf, WaitNamedPipeHandleState ****************************************************************************/ -static BOOL api_WNPHS(const char *inbuf, - char *outbuf, - smb_np_struct *p, - char *param, - int param_len) +static void api_WNPHS(struct smb_request *req, smb_np_struct *p, + char *param, int param_len) { uint16 priority; - if (!param || param_len < 2) - return False; + if (!param || param_len < 2) { + reply_nterror(req, NT_STATUS_INVALID_PARAMETER); + return; + } priority = SVAL(param,0); DEBUG(4,("WaitNamedPipeHandleState priority %x\n", priority)); if (wait_rpc_pipe_hnd_state(p, priority)) { /* now send the reply */ - send_trans_reply(inbuf, outbuf, NULL, 0, NULL, 0, False); - return True; + send_trans_reply_new(req, NULL, 0, NULL, 0, False); + return; } - return False; + api_no_reply(req); } @@ -236,26 +235,25 @@ static BOOL api_WNPHS(const char *inbuf, SetNamedPipeHandleState ****************************************************************************/ -static BOOL api_SNPHS(const char *inbuf, - char *outbuf, - smb_np_struct *p, - char *param, - int param_len) +static void api_SNPHS(struct smb_request *req, smb_np_struct *p, + char *param, int param_len) { uint16 id; - if (!param || param_len < 2) - return False; + if (!param || param_len < 2) { + reply_nterror(req, NT_STATUS_INVALID_PARAMETER); + return; + } id = SVAL(param,0); DEBUG(4,("SetNamedPipeHandleState to code %x\n", id)); if (set_rpc_pipe_hnd_state(p, id)) { /* now send the reply */ - send_trans_reply(inbuf, outbuf, NULL, 0, NULL, 0, False); - return True; + send_trans_reply_new(req, NULL, 0, NULL, 0, False); + return; } - return False; + api_no_reply(req); } @@ -363,46 +361,14 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid, reply_post_legacy(req, -1); break; } - 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; - } - + case TRANSACT_WAITNAMEDPIPEHANDLESTATE: /* Wait Named Pipe Handle state */ - if (!api_WNPHS(inbuf, outbuf, p, params, tpscnt)) { - api_no_reply(req); - return; - } - - reply_post_legacy(req, -1); + api_WNPHS(req, p, params, tpscnt); break; - } - 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; - } - + case TRANSACT_SETNAMEDPIPEHANDLESTATE: /* Set Named Pipe Handle state */ - if (!api_SNPHS(inbuf, outbuf, p, params, tpscnt)) { - api_no_reply(req); - return; - } - - reply_post_legacy(req, -1); + api_SNPHS(req, p, params, tpscnt); break; - } default: reply_nterror(req, NT_STATUS_INVALID_PARAMETER); return; -- cgit