From 631aa1f0efa75924c4d8ba639de80527fb8da7b5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 5 Mar 2005 18:34:18 +0000 Subject: r5661: Be a little stricter on syntax regarding arrays. A pointer to an array can now only be : type *name[]; rather then : type *name; which was supported in the past. Warnings will be given when the first syntax is used. Reasons for this change in behaviour include improved readability and the fact that the second format makes dealing with multiple levels of pointers harder. (This used to be commit a416de5825c540fd3741731c4be05e9a659a6fdb) --- source4/librpc/idl/atsvc.idl | 2 +- source4/librpc/idl/dcom.idl | 16 ++++++------- source4/librpc/idl/dfs.idl | 16 ++++++------- source4/librpc/idl/drsblobs.idl | 2 +- source4/librpc/idl/drsuapi.idl | 16 ++++++------- source4/librpc/idl/echo.idl | 4 ++-- source4/librpc/idl/eventlog.idl | 6 ++--- source4/librpc/idl/krb5pac.idl | 2 +- source4/librpc/idl/lsa.idl | 36 ++++++++++++++--------------- source4/librpc/idl/netlogon.idl | 42 +++++++++++++++++----------------- source4/librpc/idl/remact.idl | 12 ++++------ source4/librpc/idl/samr.idl | 26 ++++++++++----------- source4/librpc/idl/srvsvc.idl | 44 ++++++++++++++++++------------------ source4/librpc/idl/winreg.idl | 14 ++++++------ source4/librpc/idl/wkssvc.idl | 2 +- source4/librpc/idl/xattr.idl | 4 ++-- source4/librpc/ndr/libndr.h | 2 ++ source4/librpc/ndr/ndr.c | 26 +++++++++++++++++++++ source4/librpc/ndr/ndr_spoolss_buf.c | 6 +++-- 19 files changed, 152 insertions(+), 126 deletions(-) (limited to 'source4/librpc') diff --git a/source4/librpc/idl/atsvc.idl b/source4/librpc/idl/atsvc.idl index 84b8b616f2..bf7743a37c 100644 --- a/source4/librpc/idl/atsvc.idl +++ b/source4/librpc/idl/atsvc.idl @@ -46,7 +46,7 @@ typedef struct { uint32 entries_read; - [size_is(entries_read)] atsvc_JobEnumInfo *first_entry; + [size_is(entries_read)] atsvc_JobEnumInfo *first_entry[]; } atsvc_enum_ctr; /******************/ diff --git a/source4/librpc/idl/dcom.idl b/source4/librpc/idl/dcom.idl index 7c3f181f0e..70a56c2ec5 100644 --- a/source4/librpc/idl/dcom.idl +++ b/source4/librpc/idl/dcom.idl @@ -88,8 +88,8 @@ interface IRemUnknown : IUnknown [in] GUID *ripid, /* interface to QI on */ [in] uint32 cRefs, /* count of AddRefs requested */ [in] uint16 cIids, /* count of IIDs that follow */ - [in, size_is(cIids)] GUID* iids, /* IIDs to QI for */ - [out, size_is(cIids)] MInterfacePointer *ip + [in, size_is(cIids)] GUID *iids[], /* IIDs to QI for */ + [out, size_is(cIids)] MInterfacePointer *ip[] ); typedef struct @@ -102,7 +102,7 @@ interface IRemUnknown : IUnknown [call_as(AddRef)] WERROR RemAddRef ( [in] uint16 cInterfaceRefs, [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[], - [out, size_is(cInterfaceRefs)] WERROR* pResults + [out, size_is(cInterfaceRefs)] WERROR *pResults[] ); [call_as(Release)] WERROR RemRelease ( @@ -181,9 +181,9 @@ interface IRemUnknown2 : IRemUnknown [call_as(QueryInterface2)] WERROR RemQueryInterface2 ( [in] GUID *ripid, [in] uint16 cIids, - [in, size_is(cIids)] GUID*iids, - [out, size_is(cIids)] WERROR *phr, - [out, size_is(cIids)] MInterfacePointer *ppMIF + [in, size_is(cIids)] GUID *iids[], + [out, size_is(cIids)] WERROR *phr[], + [out, size_is(cIids)] MInterfacePointer *ppMIF[] ); } @@ -224,7 +224,7 @@ object, /*FIXME[in,size_is(cNames)] OLESTR *rgszNames[], */ [in] uint16 cNames, [in] uint32 lcid, - [out,size_is(cNames)] uint32 *rgDispId); + [out,size_is(cNames)] uint32 *rgDispId[]); typedef struct { uint16 vartype; @@ -297,7 +297,7 @@ interface IStream : IUnknown ); WERROR Write( - [in,size_is(num_requested)] uint8 *data, + [in,size_is(num_requested)] uint8 *data[], [in] uint32 num_requested, [out] uint32 num_written); } diff --git a/source4/librpc/idl/dfs.idl b/source4/librpc/idl/dfs.idl index 34bb686ba5..d418b8b546 100644 --- a/source4/librpc/idl/dfs.idl +++ b/source4/librpc/idl/dfs.idl @@ -64,7 +64,7 @@ unistr *comment; uint32 state; uint32 num_stores; - [size_is(num_stores)] dfs_StorageInfo *stores; + [size_is(num_stores)] dfs_StorageInfo *stores[]; } dfs_Info3; typedef struct { @@ -74,7 +74,7 @@ uint32 timeout; GUID guid; uint32 num_stores; - [size_is(num_stores)] dfs_StorageInfo *stores; + [size_is(num_stores)] dfs_StorageInfo *stores[]; } dfs_Info4; typedef struct { @@ -122,32 +122,32 @@ typedef struct { uint32 count; - [size_is(count)] dfs_Info1 *s; + [size_is(count)] dfs_Info1 *s[]; } dfs_EnumArray1; typedef struct { uint32 count; - [size_is(count)] dfs_Info2 *s; + [size_is(count)] dfs_Info2 *s[]; } dfs_EnumArray2; typedef struct { uint32 count; - [size_is(count)] dfs_Info3 *s; + [size_is(count)] dfs_Info3 *s[]; } dfs_EnumArray3; typedef struct { uint32 count; - [size_is(count)] dfs_Info4 *s; + [size_is(count)] dfs_Info4 *s[]; } dfs_EnumArray4; typedef struct { uint32 count; - [size_is(count)] dfs_Info200 *s; + [size_is(count)] dfs_Info200 *s[]; } dfs_EnumArray200; typedef struct { uint32 count; - [size_is(count)] dfs_Info300 *s; + [size_is(count)] dfs_Info300 *s[]; } dfs_EnumArray300; diff --git a/source4/librpc/idl/drsblobs.idl b/source4/librpc/idl/drsblobs.idl index 9f3e27827f..dc8a704bee 100644 --- a/source4/librpc/idl/drsblobs.idl +++ b/source4/librpc/idl/drsblobs.idl @@ -100,7 +100,7 @@ interface drsblobs { NTTIME_1sec last_success; NTTIME_1sec last_attempt; WERROR result_last_attempt; - [relative,length_is(other_info_length)] repsFromTo1OtherInfo *other_info; + [relative] repsFromTo1OtherInfo *other_info; [value(ndr_size_repsFromTo1OtherInfo(r->other_info, ndr->flags))] uint32 other_info_length; uint32 replica_flags; uint8 schedule[84]; diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl index be7a06bf23..72197aec16 100644 --- a/source4/librpc/idl/drsuapi.idl +++ b/source4/librpc/idl/drsuapi.idl @@ -219,7 +219,7 @@ interface drsuapi drsuapi_DsNameFormat format_offered; drsuapi_DsNameFormat format_desired; [range(1,10000)] uint32 count; - [size_is(count)] drsuapi_DsNameString *names; + [size_is(count)] drsuapi_DsNameString *names[]; } drsuapi_DsNameRequest1; typedef union { @@ -234,7 +234,7 @@ interface drsuapi typedef struct { uint32 count; - [size_is(count)] drsuapi_DsNameInfo1 *array; + [size_is(count)] drsuapi_DsNameInfo1 *array[]; } drsuapi_DsNameCtr1; typedef union { @@ -261,7 +261,7 @@ interface drsuapi uint32 unknown1; unistr *object_dn; [range(0,10000)] uint32 count; - [size_is(count)] drsuapi_DsNameString *spn_names; + [size_is(count)] drsuapi_DsNameString *spn_names[]; } drsuapi_DsWriteAccountSpnRequest1; typedef union { @@ -314,7 +314,7 @@ interface drsuapi typedef struct { [range(0,10000)] uint32 count; - [size_is(count)] drsuapi_DsGetDCInfo1 *array; + [size_is(count)] drsuapi_DsGetDCInfo1 *array[]; } drsuapi_DsGetDCInfoCtr1; typedef struct { @@ -336,7 +336,7 @@ interface drsuapi typedef struct { [range(0,10000)] uint32 count; - [size_is(count)] drsuapi_DsGetDCInfo2 *array; + [size_is(count)] drsuapi_DsGetDCInfo2 *array[]; } drsuapi_DsGetDCInfoCtr2; typedef struct { @@ -351,7 +351,7 @@ interface drsuapi typedef struct { [range(0,10000)] uint32 count; - [size_is(count)] drsuapi_DsGetDCInfo01 *array; + [size_is(count)] drsuapi_DsGetDCInfo01 *array[]; } drsuapi_DsGetDCInfoCtr01; typedef union { @@ -509,7 +509,7 @@ interface drsuapi unistr *attribute_name; unistr *object_dn; uint32 value_length; - [size_is(value_length)] uint8 *value; + [size_is(value_length)] uint8 *value[]; NTTIME deleted; NTTIME created; uint32 version; @@ -570,7 +570,7 @@ interface drsuapi unistr *attribute_name; unistr *object_dn; uint32 value_length; - [size_is(value_length)] uint8 *value; + [size_is(value_length)] uint8 *value[]; NTTIME deleted; NTTIME created; uint32 version; diff --git a/source4/librpc/idl/echo.idl b/source4/librpc/idl/echo.idl index 612cdb319e..e7a2571235 100644 --- a/source4/librpc/idl/echo.idl +++ b/source4/librpc/idl/echo.idl @@ -23,12 +23,12 @@ interface rpcecho /* Sink data to the server */ void echo_SinkData( [in] uint32 len, - [in,ref,size_is(len)] uint8 *data + [in,size_is(len)] uint8 data[] ); /* Source data from server */ void echo_SourceData( [in] uint32 len, - [out,ref,size_is(len)] uint8 *data + [out,size_is(len)] uint8 data[] ); diff --git a/source4/librpc/idl/eventlog.idl b/source4/librpc/idl/eventlog.idl index 47fadbf394..8f1aad5c69 100644 --- a/source4/librpc/idl/eventlog.idl +++ b/source4/librpc/idl/eventlog.idl @@ -35,9 +35,9 @@ uint32 stringoffset; [size_is(num_of_strings)] eventlog_String bla[*]; uint32 sid_length; - [length_is(sid_length)] dom_sid *sids; + [length_is(sid_length)] dom_sid *sids[]; uint32 data_length; - [length_is(data_length)] uint8 *data; + [length_is(data_length)] uint8 *data[]; unistr *source_name; unistr *machine_name; } eventlog_Record; @@ -101,7 +101,7 @@ [in] uint32 flags, [in] uint32 offset, [in,out] uint32 number_of_bytes, - [out,size_is(number_of_bytes),ref] uint8 *data, + [out,ref,size_is(number_of_bytes)] uint8 *data[], [out] uint32 sent_size, [out] uint32 real_size ); diff --git a/source4/librpc/idl/krb5pac.idl b/source4/librpc/idl/krb5pac.idl index c424f09b78..c5b64993f0 100644 --- a/source4/librpc/idl/krb5pac.idl +++ b/source4/librpc/idl/krb5pac.idl @@ -27,7 +27,7 @@ interface krb5pac netr_SamInfo3 info3; dom_sid2 *res_group_dom_sid; uint32 res_groups_count; - [size_is(res_groups_count)] netr_GroupMembership *res_groups; + [size_is(res_groups_count)] netr_GroupMembership *res_groups[]; } PAC_LOGON_INFO; const uint8 PAC_TYPE_LOGON_INFO = 1; diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl index 5d291927dd..8b20b6db90 100644 --- a/source4/librpc/idl/lsa.idl +++ b/source4/librpc/idl/lsa.idl @@ -47,7 +47,7 @@ typedef struct { uint32 count; - [size_is(count)] lsa_PrivEntry *privs; + [size_is(count)] lsa_PrivEntry *privs[]; } lsa_PrivArray; NTSTATUS lsa_EnumPrivs ( @@ -121,7 +121,7 @@ typedef struct { uint32 auditing_mode; - [size_is(count)] uint32 *settings; + [size_is(count)] uint32 *settings[]; uint32 count; } lsa_AuditEventsInfo; @@ -240,7 +240,7 @@ typedef [public] struct { [range(0,1000)] uint32 num_sids; - [size_is(num_sids)] lsa_SidPtr *sids; + [size_is(num_sids)] lsa_SidPtr *sids[]; } lsa_SidArray; NTSTATUS lsa_EnumAccounts ( @@ -280,7 +280,7 @@ typedef struct { uint32 count; - [size_is(count)] lsa_DomainInformation *domains; + [size_is(count)] lsa_DomainInformation *domains[]; } lsa_DomainList; NTSTATUS lsa_EnumTrustDom ( @@ -313,19 +313,19 @@ typedef struct { [range(0,1000)] uint32 count; - [size_is(count)] lsa_TranslatedSid *sids; + [size_is(count)] lsa_TranslatedSid *sids[]; } lsa_TransSidArray; typedef struct { [range(0,1000)] uint32 count; - [size_is(count)] lsa_TrustInformation *domains; + [size_is(count)] lsa_TrustInformation *domains[]; uint32 max_count; } lsa_RefDomainList; NTSTATUS lsa_LookupNames ( [in,ref] policy_handle *handle, [in,range(0,1000)] uint32 num_names, - [in,ref,size_is(num_names)] lsa_String *names, + [in,size_is(num_names)] lsa_String names[], [out] lsa_RefDomainList *domains, [in,out,ref] lsa_TransSidArray *sids, [in] uint16 level, @@ -344,7 +344,7 @@ typedef struct { [range(0,1000)] uint32 count; - [size_is(count)] lsa_TranslatedName *names; + [size_is(count)] lsa_TranslatedName *names[]; } lsa_TransNameArray; NTSTATUS lsa_LookupSids ( @@ -434,12 +434,12 @@ typedef [flag(NDR_PAHEX)] struct { uint32 length; uint32 size; - [size_is(size),length_is(length)] uint8 *data; + [size_is(size),length_is(length)] uint8 *data[]; } lsa_DATA_BUF; typedef [flag(NDR_PAHEX)] struct { [range(0,65536)] uint32 size; - [size_is(size)] uint8 *data; + [size_is(size)] uint8 *data[]; } lsa_DATA_BUF2; typedef enum { @@ -613,7 +613,7 @@ typedef struct { uint32 count; - [size_is(count)] lsa_String *names; + [size_is(count)] lsa_String *names[]; } lsa_RightSet; NTSTATUS lsa_EnumAccountRights ( @@ -644,7 +644,7 @@ NTSTATUS lsa_QueryTrustedDomainInfoBySid( [in,ref] policy_handle *handle, [in,ref] dom_sid2 *dom_sid, - [in] uint16 level, + [in] lsa_TrustDomInfoEnum level, [out,switch_is(level)] lsa_TrustedDomainInfo *info ); @@ -696,7 +696,7 @@ NTSTATUS lsa_QueryTrustedDomainInfoByName( [in,ref] policy_handle *handle, [in] lsa_String trusted_domain, - [in] uint16 level, + [in] lsa_TrustDomInfoEnum level, [out,switch_is(level)] lsa_TrustedDomainInfo *info ); @@ -742,7 +742,7 @@ typedef struct { [range(0,1000)] uint32 count; - [size_is(count)] lsa_TranslatedName2 *names; + [size_is(count)] lsa_TranslatedName2 *names[]; } lsa_TransNameArray2; NTSTATUS lsa_LookupSids2( @@ -768,13 +768,13 @@ typedef struct { [range(0,1000)] uint32 count; - [size_is(count)] lsa_TranslatedSid2 *sids; + [size_is(count)] lsa_TranslatedSid2 *sids[]; } lsa_TransSidArray2; NTSTATUS lsa_LookupNames2 ( [in,ref] policy_handle *handle, [in,range(0,1000)] uint32 num_names, - [in,ref,size_is(num_names)] lsa_String *names, + [in,size_is(num_names)] lsa_String names[], [out] lsa_RefDomainList *domains, [in,out,ref] lsa_TransSidArray2 *sids, [in] uint16 level, @@ -821,13 +821,13 @@ typedef struct { [range(0,1000)] uint32 count; - [size_is(count)] lsa_TranslatedSid3 *sids; + [size_is(count)] lsa_TranslatedSid3 *sids[]; } lsa_TransSidArray3; NTSTATUS lsa_LookupNames3 ( [in,ref] policy_handle *handle, [in,range(0,1000)] uint32 num_names, - [in,ref,size_is(num_names)] lsa_String *names, + [in,size_is(num_names)] lsa_String names[], [out] lsa_RefDomainList *domains, [in,out,ref] lsa_TransSidArray3 *sids, [in] uint16 level, diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl index a50f5b24cd..5a7477bdfb 100644 --- a/source4/librpc/idl/netlogon.idl +++ b/source4/librpc/idl/netlogon.idl @@ -87,7 +87,7 @@ interface netlogon typedef struct { uint16 size; uint16 length; - [size_is(size/2),length_is(length/2)] uint16 *bindata; + [size_is(size/2),length_is(length/2)] uint16 *bindata[]; } netr_AcctLockStr; typedef struct { @@ -108,7 +108,7 @@ interface netlogon typedef [flag(NDR_PAHEX)] struct { uint16 length; [value(r->length)] uint16 size; - [size_is(size),length_is(length)] uint8 *data; + [size_is(size),length_is(length)] uint8 *data[]; } netr_ChallengeResponse; typedef [flag(NDR_PAHEX)] struct { @@ -157,7 +157,7 @@ interface netlogon uint32 rid; uint32 primary_gid; uint32 group_count; - [size_is(group_count)] netr_GroupMembership *groupids; + [size_is(group_count)] netr_GroupMembership *groupids[]; uint32 user_flags; netr_UserSessionKey key; netr_String logon_server; @@ -180,13 +180,13 @@ interface netlogon typedef [public] struct { netr_SamBaseInfo base; uint32 sidcount; - [size_is(sidcount)] netr_SidAttr *sids; + [size_is(sidcount)] netr_SidAttr *sids[]; } netr_SamInfo3; typedef struct { netr_SamBaseInfo base; uint32 sidcount; - [size_is(sidcount)] netr_SidAttr *sids; + [size_is(sidcount)] netr_SidAttr *sids[]; netr_String forest; netr_String principle; uint32 unknown4[20]; @@ -194,12 +194,12 @@ interface netlogon typedef struct { uint32 pac_size; - [size_is(pac_size)] uint8 *pac; + [size_is(pac_size)] uint8 *pac[]; netr_String logon_domain; netr_String logon_server; netr_String principal_name; uint32 auth_size; - [size_is(auth_size)] uint8 *auth; + [size_is(auth_size)] uint8 *auth[]; netr_UserSessionKey user_session_key; uint32 expansionroom[10]; netr_String unknown1; @@ -357,7 +357,7 @@ interface netlogon uint32 DataLength; /* netr_USER_KEYS encrypted with the session key */ - [size_is(DataLength)][flag(NDR_PAHEX)] uint8 *SensitiveData; + [size_is(DataLength)][flag(NDR_PAHEX)] uint8 *SensitiveData[]; } netr_USER_PRIVATE_INFO; typedef struct { @@ -454,8 +454,8 @@ interface netlogon } netr_DELTA_RENAME; typedef struct { - [size_is(num_rids)] uint32 *rids; - [size_is(num_rids)] uint32 *attribs; + [size_is(num_rids)] uint32 *rids[]; + [size_is(num_rids)] uint32 *attribs[]; uint32 num_rids; uint32 unknown1; uint32 unknown2; @@ -500,7 +500,7 @@ interface netlogon NTTIME auditretentionperiod; bool8 auditingmode; uint32 maxauditeventcount; - [size_is(maxauditeventcount+1)] uint32 *eventauditoptions; + [size_is(maxauditeventcount+1)] uint32 *eventauditoptions[]; netr_String primary_domain_name; dom_sid2 *sid; netr_QUOTA_LIMITS quota_limits; @@ -521,7 +521,7 @@ interface netlogon typedef struct { netr_String domain_name; uint32 num_controllers; - [size_is(num_controllers)] netr_String *controller_names; + [size_is(num_controllers)] netr_String *controller_names[]; uint32 SecurityInformation; sec_desc_buf sdbuf; netr_String unknown1; @@ -541,8 +541,8 @@ interface netlogon typedef struct { uint32 privilege_entries; uint32 privilege_control; - [size_is(privilege_entries)] uint32 *privilege_attrib; - [size_is(privilege_entries)] netr_String *privilege_name; + [size_is(privilege_entries)] uint32 *privilege_attrib[]; + [size_is(privilege_entries)] netr_String *privilege_name[]; netr_QUOTA_LIMITS quotalimits; uint32 system_flags; uint32 SecurityInformation; @@ -568,7 +568,7 @@ interface netlogon typedef struct { uint32 len; uint32 maxlen; - [size_is(maxlen)][length_is(len)] uint8 *cipher_data; + [size_is(maxlen)][length_is(len)] uint8 *cipher_data[]; } netr_CIPHER_VALUE; typedef struct { @@ -671,7 +671,7 @@ interface netlogon typedef struct { uint32 num_deltas; - [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum; + [size_is(num_deltas)] netr_DELTA_ENUM *delta_enum[]; } netr_DELTA_ENUM_ARRAY; @@ -883,7 +883,7 @@ interface netlogon [in] unistr computername, [in] netr_Authenticator credential, [in,out] netr_Authenticator return_authenticator, - [in][size_is(change_log_entry_size)] uint8 *change_log_entry, + [in][size_is(change_log_entry_size)] uint8 *change_log_entry[], [in] uint32 change_log_entry_size, [out] netr_DELTA_ENUM_ARRAY *delta_enum_array ); @@ -953,13 +953,13 @@ interface netlogon typedef struct { uint32 length; - [size_is(length)] uint8 *data; + [size_is(length)] uint8 *data[]; } netr_Blob; typedef [flag(NDR_PAHEX)] struct { uint16 length; uint16 size; - [size_is(size/2),length_is(length/2)] uint16 *data; + [size_is(size/2),length_is(length/2)] uint16 *data[]; } netr_BinaryString; typedef struct { @@ -995,7 +995,7 @@ interface netlogon typedef struct { netr_DomainTrustInfo domaininfo; uint32 num_trusts; - [size_is(num_trusts)] netr_DomainTrustInfo *trusts; + [size_is(num_trusts)] netr_DomainTrustInfo *trusts[]; uint32 unknown[14]; /* room for expansion? */ } netr_DomainInfo1; @@ -1136,7 +1136,7 @@ interface netlogon [in] unistr *server_name, [in] netr_TrustFlags trust_flags, [out] uint32 count, - [out,size_is(count)] netr_DomainTrust *trusts + [out,size_is(count)] netr_DomainTrust *trusts[] ); diff --git a/source4/librpc/idl/remact.idl b/source4/librpc/idl/remact.idl index 4aeb0015ce..30b4ceb118 100644 --- a/source4/librpc/idl/remact.idl +++ b/source4/librpc/idl/remact.idl @@ -22,21 +22,17 @@ interface IRemoteActivation RPC_C_IMP_LEVEL_DELEGATE = 4 } imp_levels; - typedef struct { - MInterfacePointer *p; - } pMInterfacePointer; - const uint32 MODE_GET_CLASS_OBJECT = 0xffffffff; WERROR RemoteActivation ( [in] ORPCTHIS this, [out] ORPCTHAT that, [in] GUID Clsid, - [in, unique] unistr *pwszObjectName, - [in, unique] MInterfacePointer *pObjectStorage, + [in] unistr *pwszObjectName, + [in] MInterfacePointer *pObjectStorage, [in] uint32 ClientImpLevel, [in] uint32 Mode, [in,range(1,32768)] uint32 Interfaces, - [in, unique,size_is(Interfaces)] GUID *pIIDs, + [in,size_is(Interfaces)] GUID *pIIDs[], [in] uint16 num_protseqs, [in, size_is(num_protseqs)] uint16 protseq[], [out] hyper pOxid, @@ -45,7 +41,7 @@ interface IRemoteActivation [out] uint32 AuthnHint, [out] COMVERSION ServerVersion, [out] WERROR hr, - [out,size_is(Interfaces),ref] pMInterfacePointer *ifaces, + [out,size_is(Interfaces)] MInterfacePointer *ifaces[], [out,size_is(Interfaces)] WERROR results[] ); } diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index bf158fadb7..85f032c414 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -99,7 +99,7 @@ typedef struct { uint32 count; - [size_is(count)] samr_SamEntry *entries; + [size_is(count)] samr_SamEntry *entries[]; } samr_SamArray; NTSTATUS samr_EnumDomains ( @@ -310,7 +310,7 @@ typedef struct { [range(0,1024)] uint32 count; - [size_is(count)] uint32 *ids; + [size_is(count)] uint32 *ids[]; } samr_Ids; NTSTATUS samr_GetAliasMembership( @@ -325,7 +325,7 @@ NTSTATUS samr_LookupNames( [in,ref] policy_handle *domain_handle, [in,range(0,1000)] uint32 num_names, - [in,ref,size_is(1000),length_is(num_names)] samr_String *names, + [in,size_is(1000),length_is(num_names)] samr_String names[], [out] samr_Ids rids, [out] samr_Ids types ); @@ -336,13 +336,13 @@ typedef struct { uint32 count; - [size_is(count)] samr_String *names; + [size_is(count)] samr_String *names[]; } samr_Strings; NTSTATUS samr_LookupRids( [in,ref] policy_handle *domain_handle, [in,range(0,1000)] uint32 num_rids, - [in,ref,size_is(1000),length_is(num_rids)] uint32 *rids, + [in,size_is(1000),length_is(num_rids)] uint32 rids[], [out] samr_Strings names, [out] samr_Ids types ); @@ -431,8 +431,8 @@ /* Function 0x19 */ typedef struct { uint32 count; - [size_is(count)] uint32 *rids; - [size_is(count)] uint32 *unknown; + [size_is(count)] uint32 *rids[]; + [size_is(count)] uint32 *unknown[]; } samr_ridArray; NTSTATUS samr_QueryGroupMember( @@ -564,7 +564,7 @@ /* this is also used in samr and netlogon */ typedef [public, flag(NDR_PAHEX)] struct { uint16 units_per_week; - [size_is(1260), length_is(units_per_week/8)] uint8 *bits; + [size_is(1260), length_is(units_per_week/8)] uint8 *bits[]; } samr_LogonHours; typedef struct { @@ -701,7 +701,7 @@ samr_String unknown2; samr_String unknown3; uint32 buf_count; - [size_is(buf_count)] uint8 *buffer; + [size_is(buf_count)] uint8 *buffer[]; uint32 rid; uint32 primary_gid; samr_AcctFlags acct_flags; @@ -819,7 +819,7 @@ typedef struct { uint32 count; - [size_is(count)] samr_RidType *rid; + [size_is(count)] samr_RidType *rid[]; } samr_RidArray; NTSTATUS samr_GetGroupsForUser( @@ -841,7 +841,7 @@ typedef struct { uint32 count; - [size_is(count)] samr_DispEntryGeneral *entries; + [size_is(count)] samr_DispEntryGeneral *entries[]; } samr_DispInfoGeneral; typedef struct { @@ -854,7 +854,7 @@ typedef struct { uint32 count; - [size_is(count)] samr_DispEntryFull *entries; + [size_is(count)] samr_DispEntryFull *entries[]; } samr_DispInfoFull; typedef struct { @@ -870,7 +870,7 @@ typedef struct { uint32 count; - [size_is(count)] samr_DispEntryAscii *entries; + [size_is(count)] samr_DispEntryAscii *entries[]; } samr_DispInfoAscii; typedef union { diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl index 8abc67d076..d7210eef1e 100644 --- a/source4/librpc/idl/srvsvc.idl +++ b/source4/librpc/idl/srvsvc.idl @@ -22,7 +22,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetCharDevInfo0 *array; + [size_is(count)] srvsvc_NetCharDevInfo0 *array[]; } srvsvc_NetCharDevCtr0; typedef struct { @@ -34,7 +34,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetCharDevInfo1 *array; + [size_is(count)] srvsvc_NetCharDevInfo1 *array[]; } srvsvc_NetCharDevCtr1; typedef union { @@ -86,7 +86,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetCharDevQInfo0 *array; + [size_is(count)] srvsvc_NetCharDevQInfo0 *array[]; } srvsvc_NetCharDevQCtr0; typedef struct { @@ -99,7 +99,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetCharDevQInfo1 *array; + [size_is(count)] srvsvc_NetCharDevQInfo1 *array[]; } srvsvc_NetCharDevQCtr1; typedef union { @@ -170,7 +170,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetConnInfo0 *array; + [size_is(count)] srvsvc_NetConnInfo0 *array[]; } srvsvc_NetConnCtr0; typedef struct { @@ -185,7 +185,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetConnInfo1 *array; + [size_is(count)] srvsvc_NetConnInfo1 *array[]; } srvsvc_NetConnCtr1; typedef union { @@ -215,7 +215,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetFileInfo2 *array; + [size_is(count)] srvsvc_NetFileInfo2 *array[]; } srvsvc_NetFileCtr2; typedef struct { @@ -228,7 +228,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetFileInfo3 *array; + [size_is(count)] srvsvc_NetFileInfo3 *array[]; } srvsvc_NetFileCtr3; typedef union { @@ -281,7 +281,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetSessInfo0 *array; + [size_is(count)] srvsvc_NetSessInfo0 *array[]; } srvsvc_NetSessCtr0; typedef struct { @@ -295,7 +295,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetSessInfo1 *array; + [size_is(count)] srvsvc_NetSessInfo1 *array[]; } srvsvc_NetSessCtr1; typedef struct { @@ -310,7 +310,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetSessInfo2 *array; + [size_is(count)] srvsvc_NetSessInfo2 *array[]; } srvsvc_NetSessCtr2; typedef struct { @@ -322,7 +322,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetSessInfo10 *array; + [size_is(count)] srvsvc_NetSessInfo10 *array[]; } srvsvc_NetSessCtr10; typedef struct { @@ -338,7 +338,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetSessInfo502 *array; + [size_is(count)] srvsvc_NetSessInfo502 *array[]; } srvsvc_NetSessCtr502; typedef union { @@ -400,7 +400,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetShareInfo0 *array; + [size_is(count)] srvsvc_NetShareInfo0 *array[]; } srvsvc_NetShareCtr0; typedef struct { @@ -411,7 +411,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetShareInfo1 *array; + [size_is(count)] srvsvc_NetShareInfo1 *array[]; } srvsvc_NetShareCtr1; typedef struct { @@ -427,7 +427,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetShareInfo2 *array; + [size_is(count)] srvsvc_NetShareInfo2 *array[]; } srvsvc_NetShareCtr2; typedef struct { @@ -439,7 +439,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetShareInfo501 *array; + [size_is(count)] srvsvc_NetShareInfo501 *array[]; } srvsvc_NetShareCtr501; typedef struct { @@ -457,7 +457,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetShareInfo502 *array; + [size_is(count)] srvsvc_NetShareInfo502 *array[]; } srvsvc_NetShareCtr502; typedef struct { @@ -1081,7 +1081,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetTransportInfo0 *array; + [size_is(count)] srvsvc_NetTransportInfo0 *array[]; } srvsvc_NetTransportCtr0; typedef struct { @@ -1095,7 +1095,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetTransportInfo1 *array; + [size_is(count)] srvsvc_NetTransportInfo1 *array[]; } srvsvc_NetTransportCtr1; typedef struct { @@ -1104,7 +1104,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetTransportInfo2 *array; + [size_is(count)] srvsvc_NetTransportInfo2 *array[]; } srvsvc_NetTransportCtr2; typedef struct { @@ -1113,7 +1113,7 @@ typedef struct { uint32 count; - [size_is(count)] srvsvc_NetTransportInfo3 *array; + [size_is(count)] srvsvc_NetTransportInfo3 *array[]; } srvsvc_NetTransportCtr3; typedef union { diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl index a77af21a4b..a58a62f62f 100644 --- a/source4/librpc/idl/winreg.idl +++ b/source4/librpc/idl/winreg.idl @@ -136,7 +136,7 @@ typedef struct { uint16 length; uint16 size; - [size_is(size/2),length_is(length/2)] uint16 *name; + [size_is(size/2),length_is(length/2)] uint16 *name[]; } winreg_EnumValueString; WERROR winreg_EnumValue( @@ -145,7 +145,7 @@ [in] winreg_EnumValueString name_in, [out] winreg_String name_out, [in,out] uint32 *type, - [in,out,size_is(*size),length_is(*length)] uint8 *value, + [in,out,size_is(*size),length_is(*length)] uint8 *value[], [in,out] uint32 *size, [in,out] uint32 *length ); @@ -157,7 +157,7 @@ ); typedef struct { - [size_is(size),length_is(len)] uint8 *data; + [size_is(size),length_is(len)] uint8 *data[]; uint32 size; uint32 len; } KeySecurityData; @@ -222,7 +222,7 @@ [in,ref] policy_handle *handle, [in] winreg_String value_name, [in,out] uint32 *type, - [in,out,size_is(*size),length_is(*length)] uint8 *data, + [in,out,size_is(*size),length_is(*length)] uint8 *data[], [in,out] uint32 *size, [in,out] uint32 *length ); @@ -256,7 +256,7 @@ [in,ref] policy_handle *handle, [in] winreg_String name, [in] uint32 type, - [in,size_is(size)] uint8 *data, + [in,size_is(size)] uint8 *data[], [in] uint32 size ); @@ -315,9 +315,9 @@ /* Function: 0x1d */ WERROR winreg_QueryMultipleValues( [in,ref] policy_handle *key_handle, - [in,out,size_is(num_values),length_is(num_values),ref] QueryMultipleValue *values, + [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values[], [in] uint32 num_values, - [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer, + [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer[], [in,out,ref] uint32 *buffer_size ); diff --git a/source4/librpc/idl/wkssvc.idl b/source4/librpc/idl/wkssvc.idl index 318f7ce05b..0d018db4b9 100644 --- a/source4/librpc/idl/wkssvc.idl +++ b/source4/librpc/idl/wkssvc.idl @@ -133,7 +133,7 @@ typedef struct { uint32 count; - [size_is(count)] wkssvc_NetWkstaTransportInfo0 *array; + [size_is(count)] wkssvc_NetWkstaTransportInfo0 *array[]; } wkssvc_NetWkstaTransportCtr0; typedef union { diff --git a/source4/librpc/idl/xattr.idl b/source4/librpc/idl/xattr.idl index f133402d27..84d055ea88 100644 --- a/source4/librpc/idl/xattr.idl +++ b/source4/librpc/idl/xattr.idl @@ -65,7 +65,7 @@ interface xattr typedef [public] struct { uint16 num_eas; - [size_is(num_eas)] xattr_EA *eas; + [size_is(num_eas)] xattr_EA *eas[]; } xattr_DosEAs; /* we store stream information in this xattr structure. Then @@ -90,7 +90,7 @@ interface xattr typedef [public] struct { uint32 num_streams; - [size_is(num_streams)] xattr_DosStream *streams; + [size_is(num_streams)] xattr_DosStream *streams[]; } xattr_DosStreams; diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 4880df43bd..e2ac4279f1 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -49,6 +49,7 @@ struct ndr_pull { struct ndr_token_list *relative_list; struct ndr_token_list *array_size_list; struct ndr_token_list *array_length_list; + struct ndr_token_list *switch_list; /* this is used to ensure we generate unique reference IDs between request and reply */ @@ -68,6 +69,7 @@ struct ndr_push { uint32_t alloc_size; uint32_t offset; + struct ndr_token_list *switch_list; struct ndr_token_list *relative_list; /* this is used to ensure we generate unique reference IDs */ diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 549230bb29..2e350aa0da 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -641,6 +641,32 @@ NTSTATUS ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length) return NT_STATUS_OK; } +/* + store a switch value + */ +NTSTATUS ndr_push_set_switch_value(struct ndr_push *ndr, void *p, uint32_t val) +{ + return ndr_token_store(ndr, &ndr->switch_list, p, val); +} + +NTSTATUS ndr_pull_set_switch_value(struct ndr_pull *ndr, void *p, uint32_t val) +{ + return ndr_token_store(ndr, &ndr->switch_list, p, val); +} + +/* + retrieve a switch value + */ +uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, void *p) +{ + return ndr_token_peek(&ndr->switch_list, p); +} + +uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, void *p) +{ + return ndr_token_peek(&ndr->switch_list, p); +} + /* pull a relative object - stage1 called during SCALARS processing diff --git a/source4/librpc/ndr/ndr_spoolss_buf.c b/source4/librpc/ndr/ndr_spoolss_buf.c index e13e912b68..4b1483709a 100644 --- a/source4/librpc/ndr/ndr_spoolss_buf.c +++ b/source4/librpc/ndr/ndr_spoolss_buf.c @@ -39,7 +39,8 @@ for (i=0;iout.count;i++) {\ ndr2->data += ndr2->offset;\ ndr2->offset = 0;\ - NDR_CHECK(ndr_push_##type(ndr2, NDR_SCALARS|NDR_BUFFERS, r->in.level, &(*r->out.info)[i]));\ + NDR_CHECK(ndr_push_set_switch_value(ndr2, &(*r->out.info)[i], r->in.level)); \ + NDR_CHECK(ndr_push_##type(ndr2, NDR_SCALARS|NDR_BUFFERS, &(*r->out.info)[i]));\ }\ if (*r->in.buf_size >= ndr2->offset) {\ buffer = data_blob_const(ndr2->data, ndr2->offset);\ @@ -94,7 +95,8 @@ for (i=0;iout.count;i++) {\ ndr2->data += ndr2->offset;\ ndr2->offset = 0;\ - NDR_CHECK(ndr_pull_##type(ndr2, NDR_SCALARS|NDR_BUFFERS, r->in.level, &(*r->out.info)[i]));\ + NDR_CHECK(ndr_pull_set_switch_value(ndr2, &(*r->out.info)[i], r->in.level)); \ + NDR_CHECK(ndr_pull_##type(ndr2, NDR_SCALARS|NDR_BUFFERS, &(*r->out.info)[i]));\ }\ }\ } while(0) -- cgit