From: Joseph Sutton Date: Tue, 11 Jul 2023 00:00:24 +0000 (+1200) Subject: dcerpc.idl: Use simple boolean value instead of flag X-Git-Tag: talloc-2.4.2~914 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0071a60fb635b87499f9c9ee0ca4cf360d80d134;p=thirdparty%2Fsamba.git dcerpc.idl: Use simple boolean value instead of flag One advantage of this is that the type of the switch value is no longer tied to the type of the NDR flags. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/librpc/idl/dcerpc.idl b/librpc/idl/dcerpc.idl index 1850526042c..414b8966e8a 100644 --- a/librpc/idl/dcerpc.idl +++ b/librpc/idl/dcerpc.idl @@ -48,8 +48,8 @@ interface dcerpc } dcerpc_empty; typedef [nodiscriminant] union { - [case(LIBNDR_FLAG_OBJECT_PRESENT)] GUID object; - [default] dcerpc_empty empty; + [default] GUID object; + [case(false)] dcerpc_empty empty; } dcerpc_object; typedef struct { diff --git a/librpc/ndr/ndr_dcerpc.h b/librpc/ndr/ndr_dcerpc.h index 1a7c3bd7c5b..d4ff9273e5f 100644 --- a/librpc/ndr/ndr_dcerpc.h +++ b/librpc/ndr/ndr_dcerpc.h @@ -25,5 +25,5 @@ enum ndr_err_code ndr_pop_dcerpc_sec_verification_trailer( struct dcerpc_sec_verification_trailer **_r); #ifndef NDR_DCERPC_REQUEST_OBJECT_PRESENT -#define NDR_DCERPC_REQUEST_OBJECT_PRESENT (ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT) +#define NDR_DCERPC_REQUEST_OBJECT_PRESENT (!!(ndr->flags & LIBNDR_FLAG_OBJECT_PRESENT)) #endif /* NDR_DCERPC_REQUEST_OBJECT_PRESENT */ diff --git a/source4/librpc/rpc/pyrpc.h b/source4/librpc/rpc/pyrpc.h index 311ba2d294d..390e01a1196 100644 --- a/source4/librpc/rpc/pyrpc.h +++ b/source4/librpc/rpc/pyrpc.h @@ -54,7 +54,7 @@ typedef struct { #ifndef NDR_DCERPC_REQUEST_OBJECT_PRESENT -#define NDR_DCERPC_REQUEST_OBJECT_PRESENT LIBNDR_FLAG_OBJECT_PRESENT +#define NDR_DCERPC_REQUEST_OBJECT_PRESENT true #endif /* NDR_DCERPC_REQUEST_OBJECT_PRESENT */ #endif /* _PYRPC_H_ */