From 5445415b824e983738b41d0f7e42482faa467b40 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 19 May 2006 13:58:06 +0000 Subject: r15711: - make use of nttrans_setup_reply() metze (This used to be commit a870c084f6a97fc4f165510e9d447d97f0ee328f) --- source4/smb_server/smb/nttrans.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'source4') diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index b9da899fa9..d7c600aa52 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -68,14 +68,11 @@ static NTSTATUS nttrans_create_send(struct nttrans_op *op) { union smb_open *io = talloc_get_type(op->op_info, union smb_open); uint8_t *params; + NTSTATUS status; - op->trans->out.setup_count = 0; - op->trans->out.setup = NULL; - op->trans->out.params = data_blob_talloc(op, NULL, 69); - op->trans->out.data = data_blob(NULL, 0); - + status = nttrans_setup_reply(op, op->trans, 69, 0, 0); + NT_STATUS_NOT_OK_RETURN(status); params = op->trans->out.params.data; - NT_STATUS_HAVE_NO_MEMORY(params); SSVAL(params, 0, io->ntcreatex.out.oplock_level); SSVAL(params, 2, io->ntcreatex.out.file.fnum); @@ -197,22 +194,20 @@ static NTSTATUS nttrans_create(struct smbsrv_request *req, */ static NTSTATUS nttrans_query_sec_desc_send(struct nttrans_op *op) { - struct smb_nttrans *trans = op->trans; union smb_fileinfo *io = talloc_get_type(op->op_info, union smb_fileinfo); + uint8_t *params; NTSTATUS status; - trans->out.setup_count = 0; - trans->out.setup = NULL; - trans->out.params = data_blob_talloc(op, NULL, 4); - trans->out.data = data_blob(NULL, 0); - NT_STATUS_HAVE_NO_MEMORY(trans->out.params.data); + status = nttrans_setup_reply(op, op->trans, 4, 0, 0); + NT_STATUS_NOT_OK_RETURN(status); + params = op->trans->out.params.data; - status = ndr_push_struct_blob(&trans->out.data, op, + status = ndr_push_struct_blob(&op->trans->out.data, op, io->query_secdesc.out.sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor); NT_STATUS_NOT_OK_RETURN(status); - SIVAL(trans->out.params.data, 0, trans->out.data.length); + SIVAL(params, 0, op->trans->out.data.length); return NT_STATUS_OK; } -- cgit