From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/rpc_parse/parse_ntsvcs.c | 415 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 415 insertions(+) create mode 100644 source3/rpc_parse/parse_ntsvcs.c (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c new file mode 100644 index 0000000000..f2e4456025 --- /dev/null +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -0,0 +1,415 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Gerald (Jerry) Carter 2005. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "includes.h" + +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_RPC_PARSE + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_get_version"); + depth++; + + /* there is nothing to parse in this PDU */ + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_get_version"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!prs_uint32("version", ps, depth, &r_u->version)) + return False; + + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list_size"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) + return False; + if( !prs_align(ps) ) + return False; + + if ( !prs_uint32("flags", ps, depth, &q_u->flags) ) + return False; + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!prs_uint32("size", ps, depth, &r_u->size)) + return False; + + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) + return False; + if( !prs_align(ps) ) + return False; + + if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) ) + return False; + if ( !prs_uint32("flags", ps, depth, &q_u->flags) ) + return False; + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_io_unistr2("devicepath", ps, depth, &r_u->devicepath) ) + return False; + if(!prs_align(ps)) + return False; + + if(!prs_uint32("needed", ps, depth, &r_u->needed)) + return False; + + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_validate_device_instance"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) ) + return False; + if( !prs_align(ps) ) + return False; + + if ( !prs_uint32("flags", ps, depth, &q_u->flags) ) + return False; + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_validate_device_instance"); + depth++; + + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_reg_property"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) ) + return False; + if( !prs_align(ps) ) + return False; + + if ( !prs_uint32("property", ps, depth, &q_u->property) ) + return False; + if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) ) + return False; + if ( !prs_uint32("buffer_size1", ps, depth, &q_u->buffer_size1) ) + return False; + if ( !prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2) ) + return False; + if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) ) + return False; + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property"); + depth++; + + if ( !prs_align(ps) ) + return False; + + if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) ) + return False; + + if ( !smb_io_regval_buffer("value", ps, depth, &r_u->value) ) + return False; + if ( !prs_align(ps) ) + return False; + + if ( !prs_uint32("size", ps, depth, &r_u->size) ) + return False; + + if ( !prs_uint32("needed", ps, depth, &r_u->needed) ) + return False; + + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_get_hw_profile_info"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_uint32("index", ps, depth, &q_u->index) ) + return False; + + q_u->buffer_size = 0x000000a8; + + if ( UNMARSHALLING(ps) ) + q_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, q_u->buffer_size ); + + if ( !prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size) ) + return False; + + if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) ) + return False; + + if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) ) + return False; + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property"); + depth++; + + if ( !prs_align(ps) ) + return False; + + if ( UNMARSHALLING(ps) ) + r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size ); + + if ( !prs_uint8s(True, "buffer", ps, depth, r_u->buffer, r_u->buffer_size) ) + return False; + + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_q_hw_profile_flags"); + depth++; + + if(!prs_align(ps)) + return False; + + if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) ) + return False; + + + if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) ) + return False; + if( !prs_align(ps) ) + return False; + + if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) ) + return False; + if ( !prs_uint32("unknown3", ps, depth, &q_u->unknown3) ) + return False; + if ( !prs_uint32("unknown4", ps, depth, &q_u->unknown4) ) + return False; + if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) ) + return False; + if ( !prs_uint32("unknown6", ps, depth, &q_u->unknown6) ) + return False; + if ( !prs_uint32("unknown7", ps, depth, &q_u->unknown7) ) + return False; + + if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) ) + return False; + + return True; + +} + +/******************************************************************* +********************************************************************/ + +BOOL ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "ntsvcs_io_r_hw_profile_flags"); + depth++; + + if ( !prs_align(ps) ) + return False; + + if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) ) + return False; + if ( !prs_uint32("unknown2", ps, depth, &r_u->unknown2) ) + return False; + if ( !prs_uint32("unknown3", ps, depth, &r_u->unknown3) ) + return False; + if(!prs_werror("status", ps, depth, &r_u->status)) + return False; + + return True; +} + + + + -- cgit From 0bf72b6e330a76bee502cb36c1cb80c46d47d33c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 6 Oct 2005 17:48:03 +0000 Subject: r10781: merging eventlog and svcctl code from trunk (This used to be commit f10aa9fb84bfac4f1a22b74d63999668700ffaac) --- source3/rpc_parse/parse_ntsvcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index f2e4456025..24bf3a455b 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -79,7 +79,7 @@ BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) return False; - if( !prs_align(ps) ) + if ( !prs_align(ps) ) return False; if ( !prs_uint32("flags", ps, depth, &q_u->flags) ) -- cgit From cc01fd242be450f4598eec50956403d2298ad5a4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Jun 2006 22:55:03 +0000 Subject: r16371: Fix Klocwork #1048. Jeremy. (This used to be commit 5057e90db32adf4395fc2a3fce26a7f64c780828) --- source3/rpc_parse/parse_ntsvcs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 24bf3a455b..599257e802 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -299,8 +299,12 @@ BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_I q_u->buffer_size = 0x000000a8; - if ( UNMARSHALLING(ps) ) + if ( UNMARSHALLING(ps) ) { q_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, q_u->buffer_size ); + if (!q_u->buffer) { + return False; + } + } if ( !prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size) ) return False; @@ -329,8 +333,12 @@ BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_I if ( !prs_align(ps) ) return False; - if ( UNMARSHALLING(ps) ) + if ( UNMARSHALLING(ps) ) { r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size ); + if (!r_u->buffer) { + return False; + } + } if ( !prs_uint8s(True, "buffer", ps, depth, r_u->buffer, r_u->buffer_size) ) return False; -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/rpc_parse/parse_ntsvcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 599257e802..ab5f3f75e8 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -77,7 +77,7 @@ BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST if(!prs_align(ps)) return False; - if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) + if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) return False; if ( !prs_align(ps) ) return False; @@ -127,7 +127,7 @@ BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u if(!prs_align(ps)) return False; - if ( !prs_pointer("devicename", ps, depth, (void**)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) + if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) return False; if( !prs_align(ps) ) return False; -- cgit From 138668d5d284f7d2496f22c16a99be107cdfc872 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 29 Apr 2007 21:13:13 +0000 Subject: r22577: Change all of parse/*.c to use standard form. Fix some marshalling bugs. Jeremy. (This used to be commit 3df99006f8a52af7cff0fbca1bf16157a8648254) --- source3/rpc_parse/parse_ntsvcs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index ab5f3f75e8..559a9d5ab5 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -334,9 +334,13 @@ BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_I return False; if ( UNMARSHALLING(ps) ) { - r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size ); - if (!r_u->buffer) { - return False; + if (r_u->buffer_size) { + r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size ); + if (!r_u->buffer) { + return False; + } + } else { + r_u->buffer = NULL; } } -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/rpc_parse/parse_ntsvcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 559a9d5ab5..212a123bb0 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -5,7 +5,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- source3/rpc_parse/parse_ntsvcs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 212a123bb0..93061deb35 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ #include "includes.h" -- cgit From 929e1d99209e20a9c2c95c8bdfc8eaa37b2c2291 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 30 Aug 2007 19:48:31 +0000 Subject: r24809: Consolidate the use of temporary talloc contexts. This adds the two functions talloc_stackframe() and talloc_tos(). * When a new talloc stackframe is allocated with talloc_stackframe(), then * the TALLOC_CTX returned with talloc_tos() is reset to that new * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse * happens: The previous talloc_tos() is restored. * * This API is designed to be robust in the sense that if someone forgets to * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and * resets the talloc_tos(). The original motivation for this patch was to get rid of the sid_string_static & friends buffers. Explicitly passing talloc context everywhere clutters code too much for my taste, so an implicit talloc_tos() is introduced here. Many of these static buffers are replaced by a single static pointer. The intended use would thus be that low-level functions can rather freely push stuff to talloc_tos, the upper layers clean up by freeing the stackframe. The more of these stackframes are used and correctly freed the more exact the memory cleanup happens. This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and lp_talloc_ctx (did I forget any?) So, never do a tmp_ctx = talloc_init("foo"); anymore, instead, use tmp_ctx = talloc_stackframe() :-) Volker (This used to be commit 6585ea2cb7f417e14540495b9c7380fe9c8c717b) --- source3/rpc_parse/parse_ntsvcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 93061deb35..bcf3f55bd0 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -299,7 +299,7 @@ BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_I q_u->buffer_size = 0x000000a8; if ( UNMARSHALLING(ps) ) { - q_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, q_u->buffer_size ); + q_u->buffer = TALLOC_ARRAY(talloc_tos(), uint8, q_u->buffer_size ); if (!q_u->buffer) { return False; } @@ -334,7 +334,7 @@ BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_I if ( UNMARSHALLING(ps) ) { if (r_u->buffer_size) { - r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size ); + r_u->buffer = TALLOC_ARRAY(talloc_tos(), uint8, r_u->buffer_size ); if (!r_u->buffer) { return False; } -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/rpc_parse/parse_ntsvcs.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index bcf3f55bd0..5758517ca0 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -25,7 +25,7 @@ /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -42,7 +42,7 @@ BOOL ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_st /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; @@ -65,7 +65,7 @@ BOOL ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_st /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -91,7 +91,7 @@ BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; @@ -115,7 +115,7 @@ BOOL ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -143,7 +143,7 @@ BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; @@ -171,7 +171,7 @@ BOOL ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -197,7 +197,7 @@ BOOL ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DE /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; @@ -214,7 +214,7 @@ BOOL ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DE /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -248,7 +248,7 @@ BOOL ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_R /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; @@ -282,7 +282,7 @@ BOOL ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_R /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -321,7 +321,7 @@ BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_I /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; @@ -355,7 +355,7 @@ BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_I /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth) +bool ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return False; @@ -398,7 +398,7 @@ BOOL ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q /******************************************************************* ********************************************************************/ -BOOL ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth) +bool ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth) { if ( !r_u ) return False; -- cgit From dbcd8b76a63f99e746c4f238e021a7692c29fa48 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sun, 17 Feb 2008 23:37:45 +0100 Subject: Remove unused marshalling for NTSVCS_GET_VERSION. Guenther (This used to be commit 58970cc6a8761c30bc4b772b28bb25a112cb684f) --- source3/rpc_parse/parse_ntsvcs.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 5758517ca0..89ba2030fb 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -25,43 +25,6 @@ /******************************************************************* ********************************************************************/ -bool ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_q_get_version"); - depth++; - - /* there is nothing to parse in this PDU */ - - return True; - -} - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth) -{ - if ( !r_u ) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_r_get_version"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("version", ps, depth, &r_u->version)) - return False; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - /******************************************************************* ********************************************************************/ -- cgit From 342d7fd099eb23a5fa8e416197f8f08e121ae86b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sun, 17 Feb 2008 23:42:52 +0100 Subject: Remove unused marshalling for NTSVCS_VALIDATE_DEVICE_INSTANCE. Guenther (This used to be commit 8971afaf744e5124d4b82cad76e368ccd05be394) --- source3/rpc_parse/parse_ntsvcs.c | 43 ---------------------------------------- 1 file changed, 43 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 89ba2030fb..86e8d9d952 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -134,49 +134,6 @@ bool ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u /******************************************************************* ********************************************************************/ -bool ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_q_validate_device_instance"); - depth++; - - if(!prs_align(ps)) - return False; - - if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) ) - return False; - if( !prs_align(ps) ) - return False; - - if ( !prs_uint32("flags", ps, depth, &q_u->flags) ) - return False; - - return True; - -} - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth) -{ - if ( !r_u ) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_r_validate_device_instance"); - depth++; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - bool ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth) { if (q_u == NULL) -- cgit From 9501a920c3b9c680bd0e16b941e084206afb1361 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 18 Feb 2008 00:24:57 +0100 Subject: Remove unused marshalling for NTSVCS_GET_DEVICE_LIST_SIZE. Guenther (This used to be commit bc1df536fa04e004ccf177e0f3ba56f3c47709aa) --- source3/rpc_parse/parse_ntsvcs.c | 53 ---------------------------------------- 1 file changed, 53 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 86e8d9d952..faa7f8ddd3 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -22,59 +22,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_PARSE -/******************************************************************* -********************************************************************/ - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list_size"); - depth++; - - if(!prs_align(ps)) - return False; - - if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) ) - return False; - if ( !prs_align(ps) ) - return False; - - if ( !prs_uint32("flags", ps, depth, &q_u->flags) ) - return False; - - return True; - -} - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth) -{ - if ( !r_u ) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("size", ps, depth, &r_u->size)) - return False; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - - /******************************************************************* ********************************************************************/ -- cgit From 7b5d9af374b432e52765dd23bb0b8e6a9696cf86 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 18 Feb 2008 01:10:37 +0100 Subject: Remove unused marshalling for NTSVCS_HW_PROFILE_FLAGS. Guenther (This used to be commit ddb3838be1ab5080add4db060432dfd007b1fd73) --- source3/rpc_parse/parse_ntsvcs.c | 73 ---------------------------------------- 1 file changed, 73 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index faa7f8ddd3..012b8fa0ef 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -218,76 +218,3 @@ bool ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_I return True; } - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_q_hw_profile_flags"); - depth++; - - if(!prs_align(ps)) - return False; - - if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) ) - return False; - - - if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) ) - return False; - if( !prs_align(ps) ) - return False; - - if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) ) - return False; - if ( !prs_uint32("unknown3", ps, depth, &q_u->unknown3) ) - return False; - if ( !prs_uint32("unknown4", ps, depth, &q_u->unknown4) ) - return False; - if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) ) - return False; - if ( !prs_uint32("unknown6", ps, depth, &q_u->unknown6) ) - return False; - if ( !prs_uint32("unknown7", ps, depth, &q_u->unknown7) ) - return False; - - if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) ) - return False; - - return True; - -} - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth) -{ - if ( !r_u ) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_r_hw_profile_flags"); - depth++; - - if ( !prs_align(ps) ) - return False; - - if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) ) - return False; - if ( !prs_uint32("unknown2", ps, depth, &r_u->unknown2) ) - return False; - if ( !prs_uint32("unknown3", ps, depth, &r_u->unknown3) ) - return False; - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} - - - - -- cgit From f155008ca021d8f80eedbf4395a454d63193c524 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 18 Feb 2008 01:34:13 +0100 Subject: Remove unused marshalling for NTSVCS_GET_HW_PROFILE_INFO. Guenther (This used to be commit 2ec2eefc703df882599b6eac9147350c4df33006) --- source3/rpc_parse/parse_ntsvcs.c | 73 ---------------------------------------- 1 file changed, 73 deletions(-) (limited to 'source3/rpc_parse/parse_ntsvcs.c') diff --git a/source3/rpc_parse/parse_ntsvcs.c b/source3/rpc_parse/parse_ntsvcs.c index 012b8fa0ef..2b15a45506 100644 --- a/source3/rpc_parse/parse_ntsvcs.c +++ b/source3/rpc_parse/parse_ntsvcs.c @@ -145,76 +145,3 @@ bool ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_R return True; } - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_q_get_hw_profile_info"); - depth++; - - if(!prs_align(ps)) - return False; - - if ( !prs_uint32("index", ps, depth, &q_u->index) ) - return False; - - q_u->buffer_size = 0x000000a8; - - if ( UNMARSHALLING(ps) ) { - q_u->buffer = TALLOC_ARRAY(talloc_tos(), uint8, q_u->buffer_size ); - if (!q_u->buffer) { - return False; - } - } - - if ( !prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size) ) - return False; - - if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) ) - return False; - - if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) ) - return False; - - return True; - -} - -/******************************************************************* -********************************************************************/ - -bool ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth) -{ - if ( !r_u ) - return False; - - prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property"); - depth++; - - if ( !prs_align(ps) ) - return False; - - if ( UNMARSHALLING(ps) ) { - if (r_u->buffer_size) { - r_u->buffer = TALLOC_ARRAY(talloc_tos(), uint8, r_u->buffer_size ); - if (!r_u->buffer) { - return False; - } - } else { - r_u->buffer = NULL; - } - } - - if ( !prs_uint8s(True, "buffer", ps, depth, r_u->buffer, r_u->buffer_size) ) - return False; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} -- cgit