[PATCH] idl: use logical dcerpc_object ordering

Stefan (metze) Metzmacher metze at samba.org
Mon Apr 29 10:57:30 MDT 2013


Hi David,

I'm wondering why I didn't see problems with this on the wire while
testing PDUs with object...

Shouldn't we better fix or reject this at the pidl layer?

metze
Am 28.04.2013 13:54, schrieb David Disseldorp:
> This IDL code:
> typedef [nodiscriminant] union {
> 	[default] dcerpc_empty empty;
> 	[case(LIBNDR_FLAG_OBJECT_PRESENT)] GUID object;
> } dcerpc_object;
> 
> Compiles into the following default-before-case marshalling code:
> switch (level) {
> 	default: {
> 		NDR_CHECK(ndr_push_dcerpc_empty(ndr, NDR_SCALARS, &r->empty));
> 	break; }
> 
> 	case LIBNDR_FLAG_OBJECT_PRESENT: {
> 		NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->object));
> 	break; }
> 
> }
> 
> Signed-off-by: David Disseldorp <ddiss at samba.org>
> ---
>  librpc/idl/dcerpc.idl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/librpc/idl/dcerpc.idl b/librpc/idl/dcerpc.idl
> index 86f22a4..8fadf1c 100644
> --- a/librpc/idl/dcerpc.idl
> +++ b/librpc/idl/dcerpc.idl
> @@ -34,8 +34,8 @@ interface dcerpc
>  	} dcerpc_empty;
>  
>  	typedef [nodiscriminant] union {
> -		[default] dcerpc_empty empty;
>  		[case(LIBNDR_FLAG_OBJECT_PRESENT)] GUID object;
> +		[default] dcerpc_empty empty;
>  	} dcerpc_object;
>  
>  	typedef struct {
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130429/3438ffb0/attachment.pgp>


More information about the samba-technical mailing list