svn commit: samba r24241 - in branches/SAMBA_3_2/source/smbd: .

vlendec at samba.org vlendec at samba.org
Sun Aug 5 10:48:36 GMT 2007


Author: vlendec
Date: 2007-08-05 10:48:35 +0000 (Sun, 05 Aug 2007)
New Revision: 24241

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24241

Log:
Remove reply_prep_legacy from api_WNPHS and api_SNPHS
Modified:
   branches/SAMBA_3_2/source/smbd/ipc.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/ipc.c
===================================================================
--- branches/SAMBA_3_2/source/smbd/ipc.c	2007-08-05 10:37:08 UTC (rev 24240)
+++ branches/SAMBA_3_2/source/smbd/ipc.c	2007-08-05 10:48:35 UTC (rev 24241)
@@ -30,7 +30,7 @@
 
 #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 @@
  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 @@
  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 @@
 		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;



More information about the samba-cvs mailing list